D5 · Lesson 3 · Windows and leakage
Why a tone that doesn't fit a whole number of cycles in the record spreads across every DFT bin, the rectangular window's sinc-shaped spectrum and its −13 dB sidelobes, tapered windows such as the Hann window that trade a wider main lobe for far less leakage, scalloping loss, and noise bandwidth
Feed a pure tone to an FFT and you'd expect a single spike. You get one only if the tone happens to complete a whole number of cycles in the record. Otherwise the record's abrupt ends cut the wave mid-cycle, and the spectrum shows the tone smeared across every bin, with skirts that can bury a weak signal nearby. Tapering the record smoothly to zero at its ends, multiplying by a window, pulls those skirts down by tens of decibels. Choosing a window is the first decision in any spectrum measurement.
- The spectrum, in decibels, of a tone measured with a rectangular window (no taper) and with a Hann window, against frequency in bins from the tone.
- The rectangular window has the narrowest main lobe, but its sidelobes fall slowly from −13 dB. The Hann window's main lobe is twice as wide, but its sidelobes start at −31 dB and fall three times as fast.
- Slide the tone's offset δ from the nearest bin: the bins sample the curves at δ, δ ± 1, δ ± 2, ... The readouts show the loss at the nearest bin and the leakage five bins away.
Predict
A tone falls exactly halfway between two DFT bins, and no window is used. How much lower does its nearest bin read than the tone's true level?
The rectangular window's spectrum is a sinc, and half a bin off center it's sinc(0.5) = 2/π = 0.637, or −3.92 dB. That's the scalloping loss. With a Hann window it's only 1.42 dB, and with a flat-top window under 0.1 dB, which is why calibrated analyzers use one for amplitude measurements.
Name it
Leakage
A DFT treats the record as one period of a repeating signal. A tone that doesn't complete a whole number of cycles in the record has a jump where the end meets the start, and that discontinuity spreads its energy into every bin. Equivalently, the record is the tone times a rectangular window, so its spectrum is the tone convolved with the window's spectrum, a sinc of width one bin: main lobe ±1 bin, first sidelobe −13.3 dB, falling 6 dB per octave.
Windows
Multiplying the record by a taper that goes smoothly to zero at both ends removes the jump.
| Window | Main lobe (to first null) | First sidelobe | Noise bandwidth | Scalloping loss |
|---|---|---|---|---|
| Rectangular | ±1 bin | −13.3 dB | 1.00 bin | 3.92 dB |
| Hann | ±2 bins | −31.5 dB | 1.50 bins | 1.42 dB |
| Blackman | ±3 bins | −58 dB | 1.73 bins | 1.10 dB |
The Hann window, , has spectrum in bins (for large N), and its sidelobes fall at 18 dB per octave.
Noise bandwidth
A window also widens each bin's effective bandwidth for noise: the equivalent noise bandwidth in hertz is the value in the table times . A wider ENBW lets more noise into each bin, raising the noise floor.
Worked example
A strong tone sits 5.5 bins from a weak one. How far down is the strong tone's leakage at the weak tone's bin with each window?
Show the solution
- Rectangular window. enough to hide a tone 25 dB weaker.
- Hann window. so the weak tone stands clear unless it's 50 dB down.
Answer the leakage is 24.8 dB down with a rectangular window and 54.1 dB down with a Hann window.
Worked example
A 1024-point FFT at 48 kHz uses a Hann window. What's each bin's noise bandwidth?
Show the solution
- No window. Each bin's noise bandwidth is the bin spacing:
- Hann window. It widens the noise bandwidth to 1.5 bins:
- Noise floor. The wider bins collect more noise, so the floor reads higher by
Answer each bin's noise bandwidth is 70.3 Hz, against 46.9 Hz with no window, so the noise floor reads 1.76 dB higher.
Worked example
A tone falls exactly halfway between two bins. How much lower does it read with a Hann window than when centered on a bin?
Show the solution
- Hann response half a bin off center.
- Scalloping loss. against 3.92 dB for the rectangular window.
- Flat-top windows. They cut the loss to a few hundredths of a decibel, for measuring amplitudes.
Answer the tone reads 1.42 dB lower with a Hann window, against 3.92 dB with a rectangular one.
Check
A tone falls 0.25 of a bin from the nearest DFT bin, with a rectangular window. By how much does that bin underread?
Check
The same tone, 0.25 of a bin off, is measured through a Hann window. By how much does its nearest bin underread?
Check
With a rectangular window, how far below a tone's peak is its leakage 5 + 0.3 bins away?
Check
A 512-point FFT at 48 kHz uses a window with a noise bandwidth of 3.77 bins. What's each bin's noise bandwidth in hertz?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A tone sits 0.4 bin from a bin's center.
(a)
How much lower does it read with a rectangular window?
(b)
And with a Hann window?
Check
A 1024-point FFT at 8 kHz uses a window whose noise bandwidth is 1.5 bins.
(a)
What is each bin's noise bandwidth in hertz?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
(b)
What processing gain does the FFT give a tone over white noise (against the full band up to )?
Explain why
Why does windowing reduce leakage but blur the spectrum?
Leakage comes from the sharp edges of the record: a tone that doesn't fit a whole number of cycles is chopped off abruptly at the ends, and a sudden jump contains a broad spread of frequencies, which shows up as skirts reaching every bin. A window tapers the record smoothly to zero at both ends, removing the jump, so the skirts fall away quickly. But tapering effectively shortens the record, since the samples near the ends count for less, and a shorter record has coarser frequency resolution. So the window's main lobe gets wider, blurring tones that are only a bin or two apart, in exchange for much lower leakage far from each tone.
Practice
Keep practicing
8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.