Suppose two sound waves of slightly different frequencies impinge on your ear at the same time. The displacement perceived by your ear is the superposition of these two waves, with time dependence
where we now have and . What you actually hear is a tone with angular frequency which fades in and out with period
The beat frequency is simply
Note how beats are the time analog of wave packets -- the mathematics are the same except that frequency replaces wavenumber and time replaces space.