SnapSummary logo SnapSummary Try it free →
Clase de Análisis y Porcesamiento de Señales 4 de Junio de 2026
Mariano Llamedo Soria · Watch on YouTube · Generated with SnapSummary · 2026-06-06

Lecture recap — Spectral leakage, windows, and FIR design ⚡️

Key topics covered

  • Spectral leakage (desparramo / spread) — three situations

    • Bin misalignment (sintonización): tone frequency not landing exactly on an FFT bin → energy spreads to neighbor bins.
    • Window truncation (ventaneo): cutting an infinite-duration sinusoid with a finite window → intrinsic convolution with window spectrum → leakage.
    • Lobe overlap (spectral “sprit” / spread): when two tones fall inside the same main-lobe (or lobes overlap) → components mix (depends on window main-lobe width).
    • Related concept: “sprit” / split (hold definition) when two frequencies fall into the same lobe.
  • Windows: trade-offs

    • Rectangular: narrow main-lobe (good resolution) but high side-lobes (bad leakage, ~-13 dB).
    • Hamming/Blackman: wider main-lobe (worse resolution) but much lower side-lobes (better leakage suppression).
    • Choose window depending on required stop-band attenuation vs. resolution (distance between tones and relative amplitude difference).
  • Practical points about leakage

    • Leakage is always present: even if a tone coincides with a bin for a given N/FS, zero-padding or changing sampling can reveal leakage.
    • Rectangular window zeros align with grid so sometimes appear “no leakage” for special cases.
    • Side-lobe amplitude governs leakage magnitude: larger side-lobes → more leakage (e.g., rectangular ≫ Blackman).

Resolution, bins and window widths (practical formulas)

  • FFT bin resolution: Δf = Fs / N.
  • In normalized radians: one bin = 2π / N.
  • Main-lobe widths (approx. from Holton):
    • Rectangular main-lobe ≈ 4π / N → ≈ 2 bins.
    • Hanning/Hamming ≈ 8π / N → ≈ 4 bins (roughly double).
    • Blackman ≈ 12π / N → ≈ 6 bins (roughly triple).
  • Use these widths to compute minimum N so main-lobes of two tones do NOT overlap:
    • Example: tone spacing Δf = 50 Hz, Fs = 8000 → require N_min such that main-lobe half-width ≤ 25 Hz → compute N (in example N_min ≈ 320 for rectangular-derived criterion).

How to pick Fs and N (practical guidance)

  • If you can choose both Fs and N you can often force a tone to land on a bin (choose Fs such that tone frequency is integer multiple of Δf).
  • If constraints fix Fs or N you must choose window and N to satisfy resolution and attenuation specs (trade-off).
  • Consider also amplitude differences: if one tone is e.g. -40 dB, windows with poor side-lobe attenuation (rectangular) will mask it.

Exercise-oriented workflow (how to solve class problems)

  1. Compute bin spacing Δf = Fs / N (or choose N so Δf meets separation requirement).
  2. Convert window main-lobe width to bins (use 2π/N baseline) and check overlap with tone spacing.
  3. Check side-lobe attenuation of candidate windows vs required stop-band attenuation (if tone amplitude difference matters).
  4. Simulate (Python recommended): generate tones, apply chosen window, compute DFT, inspect spectrum and confirm detection.

FIR filter design methods — overview 🔧

  • Three main FIR design families (available in SciPy / signal libraries):

    • Window method (firwin / firwin2): easiest; build desired frequency response (brick-wall-like), inverse DFT → truncate/ window impulse response → choose window. Single main parameter: N (number of taps). Simple but not optimal.
    • Least-squares (FIRLS): solve a linear least-squares problem to minimize mean-square error between desired and achievable response. Algebraic closed-form (pseudoinverse); can use interpolation grid R > N/2 for overdetermined system.
    • Parks-McClellan / Remez (remez): minimax design that minimizes the maximum error (Chebyshev/ equiripple). Iterative algorithm using Remez exchange (alternation theorem). Usually yields the most efficient (smallest N) equiripple filters but is iterative and may face convergence issues.
  • When to use each:

    • Window method: simple, immediate, educational; choose window for stop-band attenuation/transition width trade-off.
    • FIRLS: better than window in many cases; uses least-squares criterion.
    • Remez/Parks‑McClellan: best for tight specs (equiripple), lowest tap count for given specs — but iterative and may need parameter tuning (weights, initial grid, N).

Important design concepts & steps (window method)

  • Define desired frequency response (band edges, desired gains, weights).
  • Build discrete frequency vector (“frek” or freq sampling) and gains vector (pairs).
  • Inverse DFT (with interpolation / zero padding as needed) → impulse response (ideal, infinite) → truncate and multiply by chosen window → implemented FIR taps.
  • Windows are symmetric → preserve linear-phase property (FIR Type I/II etc.); windowing yields symmetric coefficients (phase linearity).

FIRLS (least-squares) — essentials

  • Represent plausible frequency response HR as linear combination of cosines (due to symmetry), HR = C·A.
  • Choose an interpolation grid (r ≥ N/2) for overdetermined system.
  • Solve for coefficient vector A via least-squares (pseudoinverse): A = (CᵀC)⁻¹ Cᵀ D (matrix form).
  • Produces closed-form solution minimizing mean-square frequency error.

Parks‑McClellan / Remez — essentials

  • Goal: minimize the maximum absolute error between desired and actual response across the bands (minimax).
  • Error becomes alternant/alternating at extremal frequencies (alternation theorem) → algorithm iteratively finds extremal frequencies and updates coefficients.
  • Iterative process: compute coefficients → compute actual response → find extrema → update → repeat until extrema stable (convergence). Converged solution is equiripple (equal ripple in pass & stop).
  • Requires tuning (weights for bands, N). Not guaranteed to converge for impossible specs; relax specs or increase N if it fails.

Practical tips & simulation

  • Always simulate designs in Python (SciPy.signal): generate signals, apply windows, compute DFT, verify detection/separation and attenuation.
  • Use zero-padding / denser FFT grid to inspect spectral leakage details.
  • For applied problems (e.g., radar clutter removal) use adaptive filtering strategies: detect clutter extent (spectral width), adapt cutoff / filter per pixel/radial, then reconstruct amplitude (detection → filtering → reconstruction pipeline).
  • Example shown in class: radar pixel simulation — strong clutter at near-zero Doppler (terrain/clutter) masks broadband target (storm). Using appropriate windowing and filtering (and adaptive cutoff) allows extracting underlying spectral “bump” (storm) while suppressing clutter.

Actionable checklist for assignments

  • For each problem: list constraints (Fs, N, required attenuation/ripple, tone spacing).
  • Compute Δf and convert window main-lobe width to bins.
  • Evaluate candidate windows: main-lobe width vs side-lobe attenuation.
  • Compute minimal N for separation (using main-lobe width formulas).
  • Simulate with code (recommended): generate signals, apply windows, FFT, plot in dB with markers (use points, not just lines).
  • If designing FIR: pick method (window for quick; remez for efficient equiripple; firls if least-squares desired), supply band edges, gains and weights, iterate if needed.
  • Holton (reference figures for window responses & lobes) — consult box/figures for main-lobe widths and attenuation numbers.
  • SciPy.signal functions: firwin, firwin2 (window method), firls (least-squares), remez (Parks–McClellan).
  • Course notes / instructor docs (examples & code snippets provided).

If you want, I can:

  • Extract the exact numeric steps from the class example (Fs=8000, Δf=..., N_min=320) into a short worked example. ✅
  • Provide a ready-to-run Python snippet that tests window choices and demonstrates leakage and the N_min calculation. 🐍

Summarize any YouTube video instantly

Get AI-powered summaries, timestamps, and Q&A for free.

Generate your own summary →
More summaries →