Spectral leakage and windows in the FFT

An off-bin tone can appear with a lower peak and side lobes even when acquisition is correct. Interpreting the spectrum requires the block duration, tone frequency and applied window: these determine spectral leakage.

The FFT assumes the signal is periodic

A discrete FFT doesn’t see an infinite sine: it sees the finite block of samples you hand it, and it assumes that block repeats identically forever. If the signal frequency falls exactly on a bin — that is, if an integer number of periods fits in the block — the assumption holds and the spectrum is clean: all the energy lands in a single bin.

In practice this almost never happens. The signal frequency is uncorrelated with the block length, the last period is cut off mid-cycle, and at the seam between one repetition and the next a discontinuity appears. That discontinuity isn’t free: the FFT represents it by smearing energy across all the neighbouring bins. That’s leakage. The peak is no longer a sharp line, but a hill with long skirts decaying slowly to either side.

The errors it produces

Leakage isn’t a cosmetic detail. It produces two errors that matter in a real measurement:

  • Corrupted amplitude. The tone’s energy spreads across several bins, so the peak bin reads less than the true value. In the worst case — a frequency exactly halfway between two bins — the scallop-loss error reaches about 3.9 dB with the rectangular window. The indicated amplitude is about 0.64 times the tone amplitude: roughly a 36% reduction, not one half.
  • Masked weak tones. The leakage skirts of a strong tone swamp the bins where a weak nearby tone would live. This is the classic problem when chasing a harmonic distortion or an intermodulation product 60 dB below the carrier: the signal is there, but it drowns in the main tone’s skirts.

Windows: smoothing the seam

Multiplying the block by a window changes the trade-off between main-lobe width and side lobes. Hann reaches zero at its edges; Hamming retains a non-zero value. Windows do not universally eliminate leakage: they can reduce side lobes at the cost of a wider main lobe.

Each window sits at a different point of this trade-off:

  • Hann — the reasonable default: fast-decaying skirts, a moderate main lobe. Good for the vast majority of broadband analysis.
  • Hamming — a lower first side lobe than Hann, but the far skirts decay more slowly. Useful when the disturbance is close in frequency.
  • Blackman — heavily suppressed skirts, a wide main lobe. For when you need to dig out a weak tone far from a strong one.
  • Flat-top — a deliberately wide, flat main lobe, so the amplitude read at the peak is accurate even when the tone falls between two bins. This is the right window when the number you need is the level, not the precise frequency: typically in calibration.

The reference taxonomy on all of this remains Harris’s 1978 work on windows for harmonic analysis.

ENBW in noise measurements

When you move from tone measurements to noise measurements — power spectral density, background levels — the window introduces a factor that must be stated explicitly: the ENBW (Equivalent Noise Bandwidth). A window doesn’t measure noise in a bin of width Δf, but in an effective band of ENBW · Δf. Forgetting this factor means getting the noise level wrong by an amount that depends on the window: for Hann the ENBW is about 1.5 bins. Comparing noise measurements made with different windows without normalising for ENBW means comparing numbers that aren’t comparable.

Before calling it a bug

An FFT spectrum is not a truth: it’s the result of a periodicity assumption and a window, and it lies to you in a predictable way if you ignore either. Faced with a wrong amplitude, two things are worth checking in order: which window is applied, and whether the tone falls on a bin or between two. To get hands-on with leakage, window choice and ENBW we put an interactive FFT / Window Explorer online; the physical model and the formulas are in the dedicated wiki.

For a spectral-analysis pipeline or measurement chain, discuss resolution and accuracy requirements with us.

Have a technical project to discuss?

Hardware, firmware, software, acoustics: tell us what you need.