# Beat envelope detection

I am trying to write a python function that checks whether two lets say sine signals would generate a distinct beat envelope or not. I know that the beat frequency = f1-f2 where f1 and f2 are the frequencies of my input signal. Is there a mathematical measure on when two sine curves generate a beat envelope and when they dont?

• Perhaps the material at the following web page will be of interest to you: dsprelated.com/showarticle/189.php – Richard Lyons Feb 24 at 8:23
• Very nice @RichardLyons! You should link it as an actual answer with two sentence summary since it is so spot on. I always found it interesting here how as you say the 205 Hz is created but also note that the 205 Hz is flipping back and forth 180 degrees such that it doesn't exist when observed over multiple 10 Hz cycles (identical to carrier suppression in DSB-SC). We could confirm this intuitively by placing a 1 Hz BPF at 205 Hz (given the time span of that filt). But when observed over periods shorter than the phase reversal, we observe/hear 205 Hz growing and shrinking! Very interesting. – Dan Boschen Feb 24 at 14:25
• @DanBoschen. Thanks. It's interesting that the human ear/brain system hears a 10 Hz tone while listening to a signal whose spectrum contains no energy at 10 Hz. – Richard Lyons Feb 24 at 21:26
• @RichardLyons yes indeed and also (I believe) that the underlying carrier must be within our audible spectrum – Dan Boschen Feb 25 at 1:57
• @RichardLyons as I ponder that I am thinking that we don’t hear the lower frequency at all but we indeed hear the higher frequency tone involved effectively turning on and off at that lower frequency rate (as evidenced by doing that experiment with simply turning on and off a 500 Hz at a 10 Hz rate and then again with a 3 KHz tone on and off at a 10 Hz rate. Then listen to 10 Hz itself— very different sounds. (I would think... I didn’t actually do this). Here with a beat note it is more than just being on and off but I believe the effect would be the same. – Dan Boschen Feb 25 at 4:29

If you add two cosines you simply get the product of the sum and difference frequencies.

$$cos(x) + cos(y) = 2\cdot cos \left( \frac{x+y}{2} \right) \cdot cos \left( \frac{x-y}{2} \right)$$

If the frequencies are very close together, than the difference frequency is close to zero and that's what creates the "beat".

The exact definition of what constitutes a beat and what doesn't depends on your application. For example: in audio I would call any frequency difference of less than maybe 4 Hz or so a beat since it creates the typical beat sound.

• Auditory beating is strongly related to the concept of critical bandwidth. Roughly speaking, if two sinusoidal stimuli are closer together than the auditory critical bandwidth at the mean frequency of the two stimuli, then you hear beating. For large parts of the hearing range, this is around 50Hz. – Jazzmaniac Feb 23 at 12:43

@bjornhartmann. The material at the following web page explains, and demonstrates using MATLAB, how beat notes are generated when we sum two sine wave sequences: dsprelated.com/showarticle/189.php

Thank you so much for getting back to me. Very interesting and relevant post! If i understand correctly, there will always be a beat in a signal, but whether we see it as a strong beat or not depends on the application. If so, i guess i will have to determine myself how much beat effect to allow.

For those interested: I am doing a time-series prediction algorithm, fitting fourier series("seasonalities") to a dataset. If my chosen "seasonalities" are too close together i see this unwanted beat in the prediction area