# Envelope function for two sine curves

1. Nov 8, 2015

### kmsiva

1. The problem statement, all variables and given/known data

Hi,

I am trying to get an envelope function for two sinusoidal curves (A, B) added up.
a1,a2 are the amplitudes(metre), T1,T2 are the periods (hrs), B lags by dt from A at t=0.
case-1:
a1= 1, a2=0.5, p1=11,p2=10,dt=0
w1=2*pi/T1,w2=2*pi/T2
A = a1*cos(w1*t), B=a2*cos(w2*t+dt)
t varies from 0 to 650 hours

2. Relevant equations
Case-1

using a envelope function sqrt(a1^2 + a2^2+2*a1*a2*(cos(w2-w1)*t+dt))
i am getting a nice envelope as in the figure 1

Case-2:

a1= 1, a2=0.5, T1=60, T2=10, dt=0
using a envelope function

a2 – a1 +2*a1*a2*(cos(w1)*t+dt))
I can manage an envelope as in the figure 2

3. The attempt at a solution

Is there a way to combine these two conditions ( or any combination of T1 and T2)
so that I can have one generalized envelope function that does not miss the peaks.

Thanks in anticipation for any help

2. Nov 8, 2015

### Svein

Just a reminder of a trigonometric identity: $\cos(x)+\cos(y)= 2\cos(\frac{x+y}{2})\cos(\frac{x-y}{2})$.

3. Nov 9, 2015

### kmsiva

Thanks Svein,
Could you please elaborate little more.
From what ever I have tried out, it works only for a range and not for all combinations of T1 and T2.
I want to identify the location of extreme amplitude analytically from added up sine curves.
I believe the envelope could be represented by a set of sinusoids

sorry if it is something too simple and i am getting lost.

4. Nov 10, 2015

### Svein

OK. We start out with $A_{1}\cos(\omega_{1} t)+A_{2}\cos(\omega_{2}t+\phi)$. Assume A1>A2. Then we can transform it into $(A_{1}-A_{2})\cos(\omega_{1} t)+A_{2}(\cos(\omega_{1} t)+\cos(\omega_{2}t+\phi))=(A_{1}-A_{2})\cos(\omega_{1} t)+2A_{2}\cos(\frac{\omega_{1}+\omega_{2}+\phi}{2})\cos(\frac{\omega_{1}-\omega_{2}-\phi}{2})$.
In radio technology this shows us that adding an audio signal (ω2) to a carrier wave (ω1) gives us a carrier wave plus two side bands $\frac{\omega_{1}+\omega_{2}+\phi}{2}$ and $\frac{\omega_{1}-\omega_{2}-\phi}{2}$. You can see this best when ω1>>ω2. In your case (when ω1≈ω2), the result is harder to see.

5. Nov 10, 2015

### haruspex

I don't know how you arrived at the envelope function you posted, so I may be just telling you what you already know here.
First, lose the phase constant. If the two frequencies are different then the phase constant is equivalent to a shift along the time axis, so is not interesting.
I would then apply the identity Svein mentioned, but in a more symmetric manner.

Get F(t) into the form $C\sin(\bar \omega t)\cos(\hat \omega t)+D\cos(\bar \omega t)\sin(\hat \omega t)$ where $\bar\omega = \frac{\omega_1+\omega_2}2$ and $\hat\omega = \frac{\omega_1-\omega_2}2$. Clearly the $\bar \omega$ factors are the higher frequency of the two, so we want to find the maximum of F over a cycle of that.

If this frequency is much higher than $\hat \omega$, we can treat the $\hat \omega$ as constant over such a cycle and find the max of F on that basis. This leads to the equation you posted.

If the original frequencies are very different then $\hat \omega$ and $\bar \omega$ will be of similar magnitude, so this method does not work. Instead, you can treat the lower frequency function as roughly constant over a cycle of the higher frequency and arrive at your other equation.

So each solution is just an approximation that works well in its own domain. The worst case, I guess, would be where the ratio of the original frequencies is the same as the ratio of the sum and difference frequencies: $\omega_1:\omega_2=\bar\omega:\hat\omega$. Try plotting one of those to see if it gives any insight.