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

S7 · Lesson 23 · Optimal equiripple FIR design

The minimax criterion, weighted error, the alternation theorem, the Parks–McClellan algorithm and how long an optimal filter must be

A windowed design spends its ripple unevenly: the error is largest near the band edges and shrinks away from them, so most of the passband and stopband are better than they need to be, and that slack is paid for in taps. The best possible filter of a given length spreads its error evenly, touching the allowed limit again and again across every band. Parks and McClellan turned that idea into an algorithm in 1972, and it remains the standard way to design FIR filters: given band edges, ripple limits and a length, it returns the filter whose largest weighted error is as small as it can be.

  • The filter order M needed to meet a lowpass specification against its transition width Δω, for a Kaiser window design (dashed) and for an optimal equiripple design (solid), from each method's length formula.
  • The stopband needs A dB of attenuation; the passband ripple is a ratio K times the stopband's δ.
  • The equiripple design is always shorter, and the saving is largest when the passband can be looser than the stopband, which the window method can't exploit.

Predict

A lowpass needs δ₁ = 0.01 in its passband, δ₂ = 0.001 in its stopband and a 0.2π transition. Kaiser's window needs M = 37. Roughly what order does an equiripple design need?

Name it

The minimax criterion

For a Type I filter with Ae(ω)=∑k=0Lakcos⁡(kω), L = M/2, choose the coefficients to minimize the largest weighted error

E(ω)=W(ω)[Hd(ω)−Ae(ω)]

over the passband and stopband (the transition band is "don't care"). With W = 1/K in the passband and 1 in the stopband, K=δ1/δ2, the optimal filter has ripples exactly δ1 and δ2.

The alternation theorem

Ae is the unique best approximation if and only if E(ω) attains its maximum magnitude, with alternating signs, at at least L + 2 frequencies in the bands. A lowpass optimum has L + 2 or L + 3 such extremal frequencies (the latter an "extraripple" filter), and the band edges ωp and ωs are always among them.

The Parks–McClellan algorithm

The Remez exchange: guess L + 2 extremal frequencies, solve for the polynomial that alternates with equal error δ there, find where the actual error peaks, move the guesses to those peaks, and repeat until they stop moving. It converges in a few iterations to the optimum.

How long it must be

M≈−10log⁡(δ1δ2)−132.324Δω

against the Kaiser window's M=A−82.285Δω with A set by the smaller δ. Passband ripple in dB relates to δ₁ by Rp=20log⁡1+δ11−δ1.

Worked example

Estimate the order for ωp = 0.4π, ωs = 0.6π, δ₁ = 0.01, δ₂ = 0.001, and compare with a Kaiser window.

Show the solution
  1. Equiripple order. M=−10log⁡10−5−132.324×0.2π=371.460=25.3 so M ≈ 26.
  2. Kaiser order. Kaiser must meet 0.001 everywhere, so A = 60: M=521.436=36.2 so 37.
  3. Compare. The equiripple filter needs about 10 fewer multiplications per sample.
  4. Weight. With weight K = 10, the stopband error counts ten times as much as the passband's.

Answer about M = 26 for equiripple, against M = 37 for a Kaiser window.

Worked example

A specification gives 0.1 dB of passband ripple. What δ₁ is that?

Show the solution
  1. Ripple as a ratio. 1+δ11−δ1=100.1/20=1.01158
  2. Solve for δ₁. δ1=1.01158−11.01158+1=0.00576
  3. Weight. Paired with 60 dB in the stopband (δ₂ = 0.001), the weight is K = 5.76.

Answer δ₁ = 0.00576.

Worked example

A filter may ripple by 0.87 dB in its passband (δ₁ = 0.05) but needs 80 dB of rejection (δ₂ = 10⁻⁴), with a 0.05π transition. Compare equiripple and Kaiser lengths.

Show the solution
  1. Product of the ripples. δ1δ2=5×10−6, so −10log10⁡(5×10−6)=53.0
  2. Equiripple. M≈53.0−132.324×0.05π=53.0−130.365=110
  3. Kaiser. Kaiser has to use the smaller δ in both bands: M=80−82.285×0.05π=201
  4. Compare. Because the window method can't loosen the passband, the optimal design needs barely half the taps when the two tolerances differ this much.

Answer about 110 for equiripple against 201 for Kaiser.

Check

An equiripple lowpass needs δ₁ = 0.05, δ₂ = 0.001 and a 0.2π transition. What order does Kaiser's estimate give?

Check

For the same specification, how many more orders does a Kaiser window design need (both before rounding)?

Check

A passband may ripple by 0.1 dB peak to peak. What's δ₁?

Check

An optimal Type I lowpass has order M = 36. At least how many alternation frequencies does its error have?

Check

A design needs δ₁ = 0.01 and δ₂ = 0.001. What passband-to-stopband ripple ratio K does the weighting use?

Check

What stopband attenuation does δ₂ = 0.001 mean?

Check

A lowpass may ripple 0.5 dB peak to peak in its passband, must reject 50 dB, and has a 0.1π transition.

(a)

What is δ₁?

(b)

What equiripple order does Kaiser's estimate give?

Check

A lowpass has ripples a (passband) and b (stopband, b < a) and transition width d rad.

Step 1

What equiripple order does the estimate give?

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 is an equiripple filter shorter than a windowed filter that meets the same specification?

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.