|
This interactive tutorial shows why window functions matter in digital signal processing. The central idea: when you take a DFT/FFT of a finite-length signal, you implicitly multiply it by a rectangular window (abrupt cut at the edges). If the signal's frequency does not align with an FFT bin (off-bin), you get spectral leakage—energy spreads into neighboring bins and sidelobes. Window functions (Hann, Hamming, Blackman, Kaiser) taper the edges to reduce sidelobes, at the cost of a wider main lobe (worse frequency resolution). Bin-Centered vs Off-BinBin-centered: The sinusoid completes an integer number of cycles over the window (e.g. 10 or 11 cycles). The FFT peak falls exactly on a bin; the rectangular window's sinc-like response has nulls at other bins, so you see a clean spike. Off-bin: The frequency is between bins (e.g. 10.25 cycles). The DFT samples the continuous sinc pattern between nulls, so energy “leaks” into all bins. You see a broad main lobe and prominent sidelobes instead of a single spike. What Window Functions DoTapering windows (Hann, Hamming, Blackman, Kaiser) smooth the edges of the signal. That reduces sidelobes (better dynamic range) but widens the main lobe (worse resolution). The simulation lets you:
TIME DOMAIN: Raw sinusoid, window shape, windowed signalFREQUENCY DOMAIN: |X[k]| (dB) ? Rectangular (gray) vs selected windowWindow formula?
?
How Freq (bins) worksFreq (bins) is the frequency of the test sinusoid expressed as number of cycles over the N-sample window. The signal is
The Freq (bins) slider is enabled only for the Leakage preset (single-tone mode). Resolution and Dynamic range presets use fixed multi-tone signals, so Freq is disabled there. Window equationsBelow the frequency plot, the Window formula panel shows the equation for the selected window. Summary:
Presets
Controls
Key concepts
|