[Math] How to calculate the perceived frequency of two sinusoidal waves added together

signal processingtrigonometry

If you add together two sinusoidal waves of different frequencies, how do you calculate the frequency of the resulting function as perceived by a human?

Best Answer

Identical Amplitudes

When two sinusoidal waves of close frequency are played together, we get $$ \begin{align} \sin(\omega_1t)+\sin(\omega_2t) &=2\sin\left(\frac{\omega_1+\omega_2}{2}t\right)\cos\left(\frac{\omega_1-\omega_2}{2}t\right)\\ &=\pm\sqrt{2+2\cos((\omega_1-\omega_2)t)}\;\sin\left(\frac{\omega_1+\omega_2}{2}t\right)\tag{1} \end{align} $$ Unless played together, two tones of equal frequency, but different phase sound just the same, so the "$\pm$" goes undetected (the sign flips only when the amplitude is $0$), and what is heard is the average of the two frequencies with an amplitude modulation which has a frequency equal to the difference of the frequencies.

$\hspace{1.5cm}$enter image description here

The green curve is the sum of two sinusoids with $\omega_1=21$ and $\omega_2=20$; its frequency is $\omega=20.5$. The red curve is the amplitude as given in $(1)$, which has frequency $\omega=|\omega_1-\omega_2|=1$.

Differing Amplitudes

A similar, but more complex and less pronounced, effect occurs if the amplitudes are not the same; let $\alpha_1< \alpha_2$. To simplify the math, consider the wave as a complex character: $$ \begin{align} \alpha_1e^{i\omega_1 t}+\alpha_2e^{i\omega_2 t} &=e^{i\omega_2t}\left(\alpha_1e^{i(\omega_1-\omega_2)t}+\alpha_2\right)\tag{2} \end{align} $$ The average frequency, $\omega_2$, is given by $e^{i\omega_2 t}$ (the frequency of the higher amplitude component), and the amplitude and a phase shift is provided by $\alpha_1e^{i(\omega_1-\omega_2)t}+\alpha_2$:

$\hspace{3.5cm}$enter image description here

The amplitude (the length of the blue line) is $$ \left|\alpha_1e^{i(\omega_1-\omega_2)t}+\alpha_2\right|=\sqrt{\alpha_1^2+\alpha_2^2+2\alpha_1\alpha_2\cos((\omega_1-\omega_2)t)}\tag{3} $$ The phase shift (the angle of the blue line) is $$ \tan^{-1}\left(\frac{\alpha_1\sin((\omega_1-\omega_2)t)}{\alpha_1\cos((\omega_1-\omega_2)t)+\alpha_2}\right)\tag{4} $$ The maximum phase shift (the angle of the green lines) to either side is $$ \sin^{-1}\left(\frac{\alpha_1}{\alpha_2}\right)\tag{5} $$ This phase modulation has the effect of varying the frequency of the resulting sound from $$ \omega_2+\frac{\alpha_1(\omega_1-\omega_2)}{\alpha_2+\alpha_1} =\frac{\alpha_2\omega_2+\alpha_1\omega_1}{\alpha_2+\alpha_1}\tag{6} $$ (between $\omega_2$ and $\omega_1$) at peak amplitude to $$ \omega_2-\frac{\alpha_1(\omega_1-\omega_2)}{\alpha_2-\alpha_1} =\frac{\alpha_2\omega_2-\alpha_1\omega_1}{\alpha_2-\alpha_1}\tag{7} $$ (on the other side of $\omega_2$ from $\omega_1$) at minimum amplitude.

Equation $(3)$ says that the amplitude varies between $|\alpha_1+\alpha_2|$ and $|\alpha_1-\alpha_2|$ with frequency $|\omega_1-\omega_2|$.

$\hspace{1.5cm}$enter image description here

The green curve is the sum of two sinusoids with $\alpha_1=1$, $\omega_1=21$ and $\alpha_2=3$, $\omega_2=20$; its frequency varies between $\omega=20.25$ at peak amplitude to $\omega=19.5$ at minimum amplitude. The red curve is the amplitude as given in $(3)$, which has frequency $\omega=|\omega_1-\omega_2|=1$.

Conclusion

When two sinusoidal waves of close frequency are played together, the resulting sound has an average frequency of the higher amplitude component, but with a modulation of the amplitude and phase (beating) that has the frequency of the difference of the frequencies of the component waves. The amplitude of the beat varies between the sum and the difference of those of the component waves, and the phase modulation causes the frequency of the resulting sound to oscillate around the frequency of the higher amplitude component (between the frequencies of the components at peak amplitude, and outside at minimum amplitude).

If the waves have the same amplitude, the phase modulation has the effect of changing the frequency of the resulting sound to be the average of the component frequencies with an instantaneous phase shift of half a wave when the amplitude is $0$.