DSP 101
M6 · Lab
Hands-on lab
Read what a window costs and buys

Measure the figures of merit of a spectrum-analyzer window in the sandbox, and predict — before you read it off the screen — the coherent gain that scales the amplitude, the equivalent noise bandwidth in bins, the peak sidelobe that sets the dynamic range, and the correction that recovers the true amplitude.

Coherent gain and equivalent noise bandwidth
\mathrm{CG} = \frac{1}{N}\sum_{n=0}^{N-1} w[n], \qquad \mathrm{ENBW} = \frac{N\sum_{n} w^2[n]}{\left(\sum_{n} w[n]\right)^2}

Every window is a compromise, and the analyzer prints the compromise as numbers. A taper scales a tone's amplitude by its coherent gain — so you must divide it back out. It widens the noise it admits to its equivalent noise bandwidth (ENBW), measured in bins. And it lowers the peak sidelobe — buying dynamic range to see weak tones beside strong ones — but only by widening the main lobe, which blurs close tones. That last pair is the whole game: a narrower main lobe resolves close tones, lower sidelobes reveal weak ones, and no window wins both. Reading CG, ENBW and the sidelobe off a real analyzer is how you pick a window on purpose.

1 / 8
DSP 101
M6 · Lab
Set it up
One window

Open the sandbox. It opens on exactly this state — a Hann window on a full-amplitude tone at bin 10, f_s = 8000 Hz — so a Reset gets you here too. Each step names the one knob to change; leave everything else alone.

Set these values
Window -> Hann f_s -> 8000 Hz Tone -> bin 10, A = 1.0 Quantization -> 6-bit (change Window in Steps 1-3, Amplitude in Step 4)

Watch the coherent-gain readout, the ENBW readout, the window-response panel and the peak-amplitude readout — every number you predict is printed there.

2 / 8
DSP 101
M6 · Lab
Step 1 of 4
The coherent gain

Keep the default Hann window. A taper scales a bin-centred tone's amplitude by its coherent gain CG = (1/N)·Σw[n] — the average of the window's own samples. Predict the Hann coherent gain, then read the coherent gain readout.

Expected

The Hann coherent gain is CG = 0.5 — the window keeps only half the amplitude a rectangular window would (CG = 1.0), because its taper rolls the two ends of the record down to zero.

3 / 8
DSP 101
M6 · Lab
Step 2 of 4
The equivalent noise bandwidth

Still Hann. The equivalent noise bandwidth ENBW = N·Σw²[n] / (Σw[n])² is how many bins' worth of white noise the window lets through. Predict the Hann ENBW in bins, then read the ENBW readout.

Expected

The Hann ENBW is 1.5 bins — 50% more noise bandwidth than the rectangular window's 1.0 bin. That extra noise is the price the taper charges: a windowed measurement sits on a slightly higher noise floor.

4 / 8
DSP 101
M6 · Lab
Step 3 of 4
Sidelobes vs the main lobe — the trade

Switch the window to Rectangular and read its peak sidelobe off the window-response panel. Then switch back to Hann and watch the sidelobes drop while the main lobe widens. Predict the rectangular peak sidelobe in dB, then read it.

Expected

The rectangular window's highest sidelobe is only -13.3 dB below the main lobe, so a strong tone drowns weak neighbours. Hann pushes it down to -31.5 dB — about 18 dB more dynamic range — but its main lobe widens from 2 bins to 4. That is the trade: a narrower main lobe resolves close tones, lower sidelobes reveal weak ones, and no window wins both.

5 / 8
DSP 101
M6 · Lab
Step 4 of 4
Recover the true amplitude

Back on the Hann window, drag the tone amplitude down to A = 0.7. The window scaled the tone by its coherent gain (0.5), so the raw peak reads half. The analyzer divides by the coherent gain — multiplies by 2/Σw[n] — to undo it. Predict the recovered amplitude, then read the peak-amplitude readout.

Expected

The corrected peak amplitude reads 0.70 — exactly the tone you set, because dividing the raw peak by the coherent gain undoes the window's amplitude scaling. Without that correction every windowed amplitude would read low.

6 / 8
DSP 101
M6 · Lab
Your turn
Open the sandbox

Everything above is waiting in the sandbox. Switch the window between rectangular, Hann, Hamming and Blackman and watch the coherent gain, ENBW and peak sidelobe move together, add a weak second tone beside a strong one to see which window resolves it, and drag the amplitude to watch the coherent-gain correction hold the readout steady.

7 / 8
DSP 101
M6 · Lab
Wrap-up
What you did
  • Read the Hann coherent gain, CG = 0.5 — the amplitude a taper keeps
  • Found the Hann equivalent noise bandwidth, ENBW = 1.5 bins vs the rectangular 1.0 bin — the noise-bandwidth cost
  • Compared the rectangular peak sidelobe (-13.3 dB) with Hann's (-31.5 dB) — dynamic range bought with a main lobe that widened from 2 to 4 bins
  • Recovered the true amplitude 0.70 through the coherent-gain correction
  • Every value you predicted is the demo's own window arithmetic, not a picture
8 / 8
1 / 8 muted