FFT window function explorer

Pick FFT windows to see their shape, side lobes and leakage live, with the numbers worked out for you.

Tap a window to make it the main one (amber); up to two others stay as blue and coral lines. Tap a shown one again to hide it.

Shape in time

Frequency response

Side lobe—
ENBW—
Coherent gain—
Scallop loss—

Leakage demo: a 0 dB tone between two bins

Peak reads—
Leakage—
Weak tone—

Which window for my job?

Use: Hann

Use it in the analyzer

All windows, worked out from a 512-point frame

WindowHighest side lobe (dB)Roll-off (dB/oct)ENBW (bins)Coherent gainScalloping loss (dB)−3 dB width (bins)

How to use the window explorer

  1. Tap a window, such as Hann. It becomes the main one, drawn in amber. Tap two more to compare them in blue and coral.
  2. Read its numbers under the charts, or the whole table below.
  3. In the leakage demo, slide Tone position between 0 (on a bin) and 0.5 (halfway), and switch on a Weak tone to see if it survives next to the strong one.
  4. Pick your job under Which window for my job? and press Use it in the analyzer.

How to read the plots

main lobe: ±2 bins to the first null highest side lobe −31.5 dB side lobes fall 18 dB per octave 0−20−40−60−800−16+16Bins away from the tone (Hann window)
A sketch of the Hann window's frequency response: one wide hill and a row of small ones that shrink on both sides.

An FFT looks at a short frame of sound, and the window is the shape that frame is multiplied by. The shape in time chart shows it: the rectangular window keeps every sample at full size and cuts hard at the edges, while Hann, Blackman and the others fade in and out. The frequency response shows what that fade does to a pure tone. Each window turns one tone into a hill, the main lobe, with a row of smaller hills on both sides, the side lobes.

A narrow main lobe separates tones that are close together. Low side lobes stop a loud tone from spilling into far-away bins, where it would hide quiet signals: that spill is called leakage. You cannot have both at once, which is why there are so many windows. The table puts numbers on it. ENBW tells you how much noise each bin collects, coherent gain how much the window shrinks a tone (analyzers correct for it), and scalloping loss how low a tone reads when it falls exactly between two bins. The leakage demo makes it real: with the rectangular window, a tone halfway between bins reads 3.9 dB too low and smears across the whole screen.

Use cases

Weak signal near a strong one

Suppose you look for a faint hum at −80 dB a dozen bins away from a loud 1 kHz tone. Set the weak tone to −80 dB and the distance to 12 bins. With the rectangular window and with Hann it is buried: even Hann still leaks about −68 dB that far out. With Blackman-Harris it stands out by more than 20 dB, because that window's side lobes sit about 92 dB down. This is the right choice for spurs, harmonics far below the tone and the RF noise floor.

Exact level measurement

When the level itself is the answer, as in a THD measurement or a calibration, the tone must read correctly wherever it falls. Slide the tone position from 0 to 0.5 bin: Hann's reading drops by 1.42 dB, Blackman-Harris's by 0.83 dB, and the flat-top window's by about 0.01 dB. The price is a main lobe about 2.6 times as wide as Hann's (3.72 against 1.44 bins at −3 dB), so use flat-top for single tones, not for close ones.

General audio

For music, speech and everyday checks, Hann is the safe default. Its main lobe is narrow enough to split two notes a semitone apart above about 200 Hz with an 8,192-point FFT at 48 kHz, and its side lobes fall away fast, so a bass note does not spray energy across the treble. The live analyzer on our home page starts with it too.

Comparison table

These figures come from the explorer itself, worked out from a 512-point frame with 32 times zero padding. Values for Kaiser use β 8.6, Gaussian σ 0.4 and Tukey α 0.5; change them in the tool to see new figures.

WindowHighest side lobeENBWScalloping lossBest for
Rectangular−13.3 dB1.00 bins3.92 dBClicks and signals that fit the frame exactly
Hann−31.5 dB1.50 bins1.42 dBGeneral audio and music
Hamming−42.7 dB1.36 bins1.75 dBClose tones of similar level, speech
Blackman−58.1 dB1.73 bins1.10 dBA step up from Hann for quiet details
Blackman-Harris−92.0 dB2.00 bins0.83 dBWeak signals near strong ones, spurs
Flat-top−93.0 dB3.77 bins0.01 dBExact levels: THD, calibration
Kaiser (β 8.6)−63.3 dB1.72 bins1.11 dBTuning the trade-off with one knob
Gaussian (σ 0.4)−43.3 dB1.45 bins1.58 dBSmooth peaks for frequency estimation
Tukey (α 0.5)−15.1 dB1.22 bins2.24 dBMostly-flat frames with soft edges

Roll-off is how fast the side lobes shrink further from the tone. Windows that fade smoothly to zero at both ends, such as Hann and Blackman, fall 18 dB per octave; the others fall 6 dB per octave, but some of them start so low that it hardly matters.

Limits of a window

A window cannot add detail. Only a longer frame, a bigger FFT at the same sample rate, separates tones that are closer than about two bins; the FFT calculator shows the bin width for any size. A window also changes noise readings by its ENBW, which matters when you compare noise levels between analyzers. For the idea behind the FFT itself, read FFT explained, and when you have chosen, use it in the analyzer. More lessons are in spectrum analyzer basics.

FAQ

Hann or Hamming?

Hann has lower far side lobes and is the usual default; Hamming has a lower first side lobe, good for some speech work.

When should I use flat-top?

When you need the exact level of a tone, such as THD or calibration.

Why use a window at all?

A cut-off piece of signal spreads energy into nearby bins (leakage); a window tapers the edges to reduce it.

What is ENBW?

Equivalent noise bandwidth: how wide the window's filter is for noise, which affects noise readings.

Written and tested by the SpectrumAnalyzer.app team · Last checked

How we tested: Checked against the textbook values for each window: Hann has a highest side lobe of −31.5 dB, an ENBW of 1.50 bins and 1.42 dB scalloping loss, the rectangular window 3.92 dB scalloping loss, and the flat-top window reads a tone within 0.01 dB between bins.