Skip to main content

Rectangular window in FIR design; Gibbs oscillations

Short answer

To design an FIR filter, truncate the shifted ideal impulse response with a rectangular window of length M (w(n)=1). Gibbs oscillations arise because multiplication in time means convolution in frequency; the rectangular window's spectrum has large side lobes that cause ripples and a ~9% overshoot at the discontinuity, independent of filter length.

Explain in detail about how rectangular window is used in FIR filter design. How do Gibbs oscillations arise in this process?

Using the rectangular window

An ideal low-pass filter has H_d(e^jω) = 1 for |ω| ≤ ωc and 0 otherwise. Its impulse response is infinite and non-causal:

h_d(n) = sin(ωc(n − α)) / (π(n − α)), n ≠ α; h_d(α) = ωc/π

To get a finite, causal filter of length M, shift the ideal response by α = (M−1)/2 and multiply it by a window w(n):

h(n) = h_d(n) · w(n)

For the rectangular window, w(n) = 1 for 0 ≤ n ≤ M−1 and 0 otherwise, so the impulse response is simply the ideal response truncated to M samples. Steps:

  1. Specify ωc (the midpoint of the transition band) and M.
  2. Compute h_d(n) for n = 0 … M−1 with α = (M−1)/2.
  3. h(n) = h_d(n) for 0 ≤ n ≤ M−1.
  4. Check the response; increase M if the transition is too wide.

The result is symmetric, so the phase is linear. Properties: the main lobe is 4π/M wide (so the transition is narrow), but the first side lobe is only 13 dB down, giving a minimum stop-band attenuation of about 21 dB.

Why Gibbs oscillations arise

Windowing in time is multiplication, which means convolution in frequency:

H(e^jω) = (1/2π) ∫ H_d(e^jθ) W(e^j(ω−θ)) dθ

The spectrum of the rectangular window, with amplitude sin(Mω/2)/sin(ω/2), has a main lobe and large side lobes. As this kernel slides across the sharp (brick-wall) edge of the ideal response, the side lobes alternately add and subtract area, giving ripples in the pass band and stop band. Near the edge, the response overshoots the ideal value by about 9 %, and the ripples die out slowly away from the edge. This is the Gibbs phenomenon: truncating a Fourier series at a discontinuity always leaves an overshoot.

Key points:

  • Increasing M makes the ripples narrower and moves them closer to the edge, but their height stays about 9 % (the minimum stop-band attenuation stays near 21 dB).
  • The cure is to use a window with a gradually tapering shape (Hamming, Hanning, Blackman, Kaiser). These have smaller side lobes and so smaller ripple, at the cost of a wider transition band.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Signal Analysis and Processing chapter 5 questions →