FIR Filter Design
Fourier series method, Gibb's phenomenon.
Designing an FIR filter means finding the finite set of coefficients h[n] such that the resulting frequency response closely approximates a desired specification. The window-based Fourier series method is the most classical and widely taught approach. Understanding it requires working through the ideal impulse response, truncation via windows, and the Gibbs phenomenon.
Core Concept: The Fourier Series Method
The window method begins with the desired frequency response H_d(e^jw), which is the ideal specification such as a brick-wall LPF. The ideal impulse response h_d[n] is computed as the Inverse Discrete-Time Fourier Transform of H_d(e^jw). For an ideal LPF with cutoff wc, this gives h_d[n] = (wc/pi) * sinc(wc*n/pi), where sinc(x) = sin(pi*x)/(pi*x). This ideal response is infinite in length and noncausal.
To make h_d[n] finite and causal, it is truncated by multiplying with a window function w[n] of length N. The final FIR filter coefficients are h[n] = h_d[n] * w[n] for n = 0 to N-1 after shifting by (N-1)/2 to make it causal. The choice of window determines the tradeoff between stopband attenuation and transition band width.
Mathematical Expression
For an ideal LPF with cutoff frequency wc (normalized), the ideal impulse response is h_d[n] = (wc/pi) * sin(wc*n) / (wc*n) for n not equal to 0, and h_d[0] = wc/pi. After shifting to make it causal with center at M = (N-1)/2: h_d[n] = sin(wc*(n-M)) / (pi*(n-M)) for n not equal to M, and h_d[M] = wc/pi. Multiplying by the chosen window w[n] gives the final coefficient set of length N.
Gibbs Phenomenon
The Gibbs phenomenon occurs when the ideal (infinite-length) impulse response is abruptly truncated using a rectangular window. At the transition from passband to stopband, the truncated response exhibits oscillatory ripples. The peak overshoot at the discontinuity is approximately 8.9% of the step height (equivalently 9%) regardless of how large N is. Increasing N only makes the ripple narrower, not smaller in amplitude.
This is the fundamental limitation of the rectangular window. The minimum achievable stopband attenuation with a rectangular window is only about 21 dB. To reduce Gibbs phenomenon, smooth window functions are used. The Hamming window achieves about 53 dB stopband attenuation with a modest increase in transition band width. The Blackman window achieves 74 dB at the cost of a wider transition band.
Window Functions
The rectangular window is w[n] = 1 for 0 to N-1 and 0 elsewhere. It gives the sharpest transition but worst Gibbs ripple. The Hanning window is w[n] = 0.5*(1 - cos(2*pi*n/(N-1))). The Hamming window is w[n] = 0.54 - 0.46*cos(2*pi*n/(N-1)). The Blackman window is w[n] = 0.42 - 0.5*cos(2*pi*n/(N-1)) + 0.08*cos(4*pi*n/(N-1)). Each has a different main lobe width and sidelobe level tradeoff. The Kaiser window provides a parametric approach where a single parameter beta controls the tradeoff continuously.
Numerical Example
Given:
Desired LPF with cutoff wc = pi/4 radians/sample
Filter length N = 11 (Type I, odd)
Using Hamming window
Why this formula applies:
h_d[n] = sin(wc*(n-M)) / (pi*(n-M)), M = (N-1)/2 = 5
Hamming: w[n] = 0.54 - 0.46*cos(2*pi*n/(N-1))
Formula:
h[n] = h_d[n] * w[n] for n = 0 to 10
Substitution (center sample n=5):
h_d[5] = wc/pi = (pi/4)/pi = 0.25
For n=4 (one step from center): n-M = -1
h_d[4] = sin(pi/4 * (-1)) / (pi * (-1)) = -0.7071 / (-3.1416) = 0.2251
w[4] = 0.54 - 0.46*cos(2*pi*4/10) = 0.54 - 0.46*cos(144°) = 0.54 + 0.372 = 0.912
h[4] = 0.2251 * 0.912 = 0.2053
Calculation:
Center coeff h[5] = 0.25 * w[5] = 0.25 * 1.0 = 0.25 (Hamming peaks at center)
Edge coeff h[0] = h[10] ≈ 0 (Hamming tapers to near zero)
Symmetry: h[n] = h[10-n] confirmed
Final Answer:
h[5] = 0.25 (center), h[4] = h[6] ≈ 0.2053.
Hamming window provides ~53 dB stopband attenuation. Transition width ≈ 8*pi/N = 8*pi/11.Exam Tip: Gibbs phenomenon produces exactly 8.9% overshoot (about 9%) at the discontinuity, regardless of N. Increasing N only narrows the transition band, it does not reduce peak ripple. To suppress Gibbs, switch from rectangular to Hamming or Blackman window. This distinction is a common GATE trap.
Loading lab...
Quick Revision
- Window method: compute ideal h_d[n] via IDTFT of desired H_d(w), then truncate using window w[n].
- Ideal LPF impulse response: h_d[n] = sin(wc*(n-M)) / (pi*(n-M)). Center at M=(N-1)/2.
- Gibbs phenomenon: 8.9% overshoot at discontinuity using rectangular window. Does NOT decrease with N.
- Rectangular: 21 dB stopband. Hanning: 44 dB. Hamming: 53 dB. Blackman: 74 dB.
- Wider window main lobe = wider transition band. Tradeoff: attenuation vs transition sharpness.
- Hamming window: w[n] = 0.54 - 0.46*cos(2*pi*n/(N-1)). Most commonly used in practice.
- Kaiser window is parametric: beta controls stopband attenuation vs transition band continuously.
FIR Filter Design Quiz
Test your knowledge on this topic!