The Fast Fourier Transform & Spectral Methods

spectral leakage

Cut a single pure musical note out of a recording with scissors, but cut at arbitrary points so the wave does not start and end at the same height. When you analyze that clipped fragment, the sudden jumps at the two cut ends behave like extra noise, and the DFT reports energy at many frequencies that were never in the original tone. That smearing of one clean frequency across a whole neighbourhood of bins is spectral leakage.

Here is the precise cause. The DFT treats your N samples as ONE period of an infinitely repeating signal. If the signal completes a whole number of cycles within the window, the periodic copy joins up smoothly and the DFT shows a single sharp spike. But if the frequency falls between bins — its cycles do not fit evenly in the window — then tiling the window creates a discontinuity at the wrap-around seam, and a discontinuity contains all frequencies. The result is that the true tone's energy LEAKS into nearby bins, raising a skirt of spurious amplitude around the real peak and potentially burying weaker nearby tones. Leakage is not measurement error; it is the unavoidable consequence of looking at a finite slice of an ongoing signal.

Leakage cannot be eliminated, only managed. The standard remedy is windowing: before transforming, multiply the samples by a window function that tapers smoothly to zero at both ends, removing the artificial edge jump so the periodic extension is continuous. This trades a tall, narrow leakage skirt for a shorter, wider main lobe — you cannot have both perfect frequency resolution and zero leakage, a manifestation of the same uncertainty principle that limits how sharply any finite observation can localize frequency. Choosing the window is choosing where on that trade-off you want to sit.

Sample a 3.5-cycles-per-window tone with N = 16. Because 3.5 is not a whole number of cycles, no single DFT bin captures it; instead bins 3 and 4 share the bulk while a long skirt of nonzero values spreads across all the others. Applying a Hann window first collapses that skirt dramatically, at the cost of a slightly broader central peak.

A frequency that doesn't fit the window smears its energy across many bins.

Leakage is intrinsic to analyzing a finite window, not a bug to be fixed; windowing reduces it but never removes it, and it always widens the main lobe in exchange. There is no free lunch between leakage suppression and frequency resolution.

Also called
leakageDFT leakage洩漏頻譜外洩