D53 of 13
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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?

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.

WindowMain lobe (to first null)First sidelobeNoise bandwidthScalloping loss
Rectangular±1 bin−13.3 dB1.00 bin3.92 dB
Hann±2 bins−31.5 dB1.50 bins1.42 dB
Blackman±3 bins−58 dB1.73 bins1.10 dB

The Hann window, wn=12(1−cos⁡2πnN), has spectrum 12sinc⁡(f)/(1−f2) 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 fs/N. 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
  1. Rectangular window. 20log10⁡|sinc(5.5)|=−24.8dB enough to hide a tone 25 dB weaker.
  2. Hann window. 20log10⁡|sinc(5.5)1−5.52|=−54.1dB 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
  1. No window. Each bin's noise bandwidth is the bin spacing: 48000Hz1024=46.9Hz
  2. Hann window. It widens the noise bandwidth to 1.5 bins: B=1.5×48000Hz1024=70.3Hz
  3. Noise floor. The wider bins collect more noise, so the floor reads higher by 10log10⁡1.5=1.76dB

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
  1. Hann response half a bin off center. W(0.5)=sinc(0.5)1−0.25=0.6370.75=0.849
  2. Scalloping loss. −20log10⁡0.849=1.42dB against 3.92 dB for the rectangular window.
  3. 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 fs/2)?

Explain why

Why does windowing reduce leakage but blur the spectrum?

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.