Understanding spectral leakage and window functions
Anyone who has worked with Fourier analysis of signals will know that spectral leakage can be a big problem when attempting to detect frequency peaks. Spectral leakage occurs during the conversion process from a time domain signal into frequency domain. It is important to know that this leakage is not an artifact but in fact a perfect sinusoidal representation of what the Fourier Transform has analyzed. The Fourier Transform expect truly periodic measured signal intervals in order to build the frequency domain representation of a perceived repetitive never ending signal. When the signal is not periodic in nature the Fourier Transform will introduce sharp discontinuities into the signal which are then processed into sinusoids. The spectral energy from these sinusoids spread across FFT bins from the fundamental frequency peak.
View the interactive demo (Processing applet).

