S722 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

S7 · Lesson 22 · FIR design by windowing

Truncating the ideal impulse response, how the window's spectrum sets ripple and transition width, the classic windows, and Kaiser's design formulas

The ideal lowpass filter's impulse response is known exactly, a sinc, but it's infinitely long. Cutting it off gives a realizable FIR filter, and the way it's cut off decides how good that filter is. Chopping abruptly leaves the Gibbs ripple of lesson 1: 9% overshoot, about 21 dB of stopband rejection, however many taps are used. Tapering the cut with a smooth window trades a wider transition band for much smaller ripple. Kaiser's window turns that trade into two formulas that give the length and shape needed to meet a specification directly.

  • The spectra of three windows of length M + 1 in dB: rectangular, Hamming and Blackman, each computed exactly as a sum of shifted Dirichlet kernels.
  • The rectangular window has the narrowest main lobe but sidelobes only 13 dB down; Hamming's are 42 dB down and Blackman's 58 dB, with main lobes two and three times as wide.
  • Increasing M narrows every main lobe without lowering any sidelobe: length buys sharpness, while the window's shape buys rejection.

Predict

A rectangular-window lowpass design gives only 21 dB of stopband attenuation. Will doubling the number of taps improve it?

Name it

Windowing the ideal response

For a lowpass with cutoff ωc and delay α = M/2:

hd[n]=sin⁡ωc(n−α)π(n−α),h[n]=hd[n]w[n],0≤n≤M

The designed response is the ideal one convolved (periodically) with W(ejω)/2π: the window's main-lobe width sets the transition width, and its sidelobes set the ripple, which is about the same in passband and stopband (δ1≈δ2).

WindowPeak sidelobeMain-lobe widthPeak error, 20 log δ
Rectangular−13 dB4π/(M + 1)−21 dB
Hann−31 dB8π/M−44 dB
Hamming−41 dB8π/M−53 dB
Blackman−57 dB12π/M−74 dB

(Oppenheim and Schafer's Table 7.2.) The transition width of the designed filter is roughly the main-lobe width, a little less.

The Kaiser window

w[n]=I0(β1−((n−α)/α)2)/I0(β) has a shape parameter β. For a stopband attenuation A=−20log⁡δ and transition width Δω=ωs−ωp:

β={0.1102(A−8.7),A>500.5842(A−21)0.4+0.07886(A−21),21≤A≤500,A<21M=A−82.285Δω

with ωc midway between ωp and ωs.

Worked example

Design a Kaiser lowpass with ωp = 0.4π, ωs = 0.6π and δ1=δ2 = 0.001.

Show the solution
  1. Attenuation and transition. A = 60 dB and Δω = 0.2π.
  2. Shape parameter. β=0.1102(60−8.7)=5.653
  3. Order. M=522.285×0.628=36.2 so M = 37 (38 taps).
  4. Cutoff. Put ωc midway, at 0.5π.
  5. Check. This is Oppenheim and Schafer's Example 7.8; the finished filter meets the specification with a little to spare.

Answer β = 5.653, M = 37 (38 taps) and ωc = 0.5π.

Worked example

Designing for the same 0.2π transition with a Hamming window: how long is it, and how much rejection does it give?

Show the solution
  1. Length. Hamming's main lobe is 8π/M wide, so a transition of about 0.2π needs M≈8π0.2π=40 a little more than Kaiser's 37.
  2. Rejection. Hamming gives a fixed −53 dB, short of the 60 dB required.
  3. Why Kaiser wins. Kaiser's adjustable β is what lets it hit exactly the rejection needed with the shortest length.

Answer M ≈ 40, with a fixed 53 dB of rejection, short of the 60 dB required.

Worked example

A lowpass needs about 44 dB of rejection and a 0.1π transition. Compare a Hann design with a Kaiser design.

Show the solution
  1. Hann. Hann's main lobe is 8π/M wide, so M=8π0.1π=80 for its fixed −44 dB peak error.
  2. Kaiser's β for A = 44. β=0.5842(23)0.4+0.07886×23=3.86
  3. Kaiser's order. M=44−82.285×0.1π=50.1 so M = 51.
  4. Compare. The Kaiser window reaches the same rejection with about 40% fewer taps, because its β can be set for exactly the attenuation needed instead of a fixed window's.

Answer Hann needs M = 80; Kaiser needs M = 51 (β = 3.86), about 40% fewer taps.

Check

A Kaiser design needs 60 dB of stopband attenuation. What β?

Check

A Kaiser design needs only 40 dB. What β?

Check

A Kaiser design needs 60 dB with a transition width of 0.05π. What does the formula give for M (before rounding up)?

Check

A length-(M + 1) lowpass with M = 36 and cutoff 0.35π: what's the ideal coefficient hd[13]?

Check

What's the Hamming window's value at n = 5 for M = 50?

Check

A Blackman-window design must have a transition width of about 0.1π. Roughly what M does that take, using the main-lobe width?

Check

A lowpass needs about 44 dB of rejection with a 0.1π transition.

(a)

What order does a Hann window need (main lobe 8π/M)?

(b)

What order does Kaiser's formula give for 44 dB?

Check

A length-(M + 1) Hamming-window lowpass with cutoff cπ is evaluated at tap n (n ≠ M/2).

Step 1

What is the ideal coefficient hd[n]?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why does tapering the window lower the ripple but widen the transition band?

Practice

Keep practicing

10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.