Window Functions and Spectral Leakage

Graduate Depth 88 in the knowledge graph I know this Set as goal
Unlocks 11 downstream topics
windowing spectral-analysis dft frequency-domain

Core Idea

Spectral leakage occurs when analyzing finite-length signals with the DFT because the signal is not periodic within the window. Window functions taper the signal at the edges to reduce leakage at the cost of broader mainlobes. Common windows (Hann, Hamming, Blackman, Kaiser) trade off mainlobe width and sidelobe attenuation, making the choice critical for spectral accuracy.

Explainer

The DFT assumes the N samples you provide represent one complete period of a periodic signal. When you compute the N-point DFT, you are implicitly tiling the signal — pretending the N samples repeat forever. If the signal contains a frequency that does not fit an integer number of cycles within your window, the signal's value jumps discontinuously at the boundary between repetitions. That jump has energy at all frequencies, so it contaminates every spectral bin — this is spectral leakage. A pure sinusoid at exactly bin 5 produces energy only at bin 5; a sinusoid at frequency 5.3 (not a whole number of cycles in the window) smears its energy across all N bins.

This connects directly to what you learned about the Fourier transform and the DFT. Computing the N-point DFT of a finite segment of a signal is mathematically equivalent to multiplying the infinite signal by a rectangular pulse of width N, then transforming. In the frequency domain, multiplication becomes convolution: the DFT output is the convolution of the true spectrum with the Fourier transform of the rectangular window. The rectangular window's spectrum is a sinc-like function with a narrow mainlobe but sidelobes at only −13 dB below the peak — meaning a strong frequency can contaminate neighboring bins at 1/5 of its amplitude. The sidelobes fall off slowly, so leakage from a strong tone can bury a nearby weak tone.

The solution is a window function: taper the signal to zero at both edges before computing the DFT. A Hann window multiplies each sample n by w(n) = 0.5(1 − cos(2πn/N)), smoothly reaching zero at n = 0 and n = N−1. This eliminates the edge discontinuity. The cost is that the window's frequency-domain representation has a wider mainlobe — instead of resolving frequencies that differ by 1/N, you now need a separation of roughly 2/N. But the sidelobes drop to −31 dB, dramatically reducing the contamination. A Blackman window achieves −58 dB sidelobes at the cost of a 3/N mainlobe width.

The Kaiser window makes this tradeoff continuous via a parameter β: β = 0 gives a rectangular window, and increasing β widens the mainlobe while suppressing sidelobes. This lets you design the window to meet a specification — if you need to detect a signal 40 dB weaker than a nearby tone, choose β to give ≥40 dB sidelobe attenuation, then accept the resulting resolution loss. The design question is always: do you need to *resolve* close frequencies (want narrow mainlobe, tolerate sidelobes) or *detect* weak signals near strong ones (want low sidelobes, tolerate wider mainlobe)? These requirements pull in opposite directions, and no window satisfies both simultaneously.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionFundamental Theorem of Calculus Part 1Fundamental Theorem of Calculus Part 2U-SubstitutionIntegration by PartsSeparable Differential EquationsIntegrating Factor Method for First-Order Linear ODEsFirst-Order Linear Ordinary Differential EquationsSecond-Order Linear Homogeneous Differential EquationsCharacteristic Equation Method for Linear ODEsComplex Roots and Oscillatory SolutionsSpring-Mass Systems and Mechanical VibrationsResonance and Damping in Forced VibrationsRLC Circuit Applications of Differential EquationsIntroduction to Differential EquationsLaplace Transform: Fundamentals and PropertiesZ-Transform: Fundamentals for Discrete-Time SignalsDiscrete-Time Fourier Transform (DTFT)Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) AlgorithmsWindow Functions and Spectral Leakage

Longest path: 89 steps · 395 total prerequisite topics

Prerequisites (2)

Leads To (3)