DSPRelated.com

Parks-McClellan

Category: Filters | Also known as: Remez exchange, equiripple

Parks-McClellan is an iterative algorithm for designing equiripple (minimax) optimal linear-phase FIR filters by minimizing the maximum weighted approximation error (the Chebyshev or minimax criterion) across specified frequency bands. It is also called the Remez exchange algorithm or equiripple design because the resulting filter's frequency response exhibits equal-amplitude ripple in every band.

In practice

In embedded DSP work, Parks-McClellan is typically invoked offline in a tool such as MATLAB (`firpm`), Python's `scipy.signal.remez`, or GNU Octave to generate FIR filter coefficients. Those coefficients are then hard-coded into firmware as a fixed-point or floating-point array and applied at runtime via a direct-form or transposed-form convolution loop, or fed to a hardware FIR accelerator found on some DSPs and SoCs.

One well-known practical advantage of Parks-McClellan is coefficient efficiency. For a given passband ripple, stopband attenuation, and transition bandwidth, Parks-McClellan often achieves the same spec with fewer taps than many alternative methods, including windowed-sinc designs, though the margin depends on the specific spec and the window chosen. Fewer taps means lower multiply-accumulate (MAC) load per sample, which matters on MCUs without a hardware MAC and on battery-powered devices where every cycle costs energy. The blog post "Multi-Decimation Stage Filtering for Sigma Delta ADCs: Design and Optimization" discusses this kind of tap-count trade-off in the context of sigma-delta decimation chains, where Parks-McClellan designs are commonly used at later stages.

A related application is half-band filter design. When Parks-McClellan is configured with half-band constraints (equal passband and stopband ripple weights and band edges symmetric around 0.25), the resulting equiripple design yields half-band FIR filters whose alternating coefficients are exactly zero, halving the number of multiplications needed. The zero-valued taps are a property of the half-band filter structure itself, not a general consequence of the algorithm. The blog post "A Matlab Function for FIR Half-Band Filter Design" illustrates this directly.

The main pitfall when targeting fixed-point hardware is coefficient quantization. Parks-McClellan finds optimal coefficients in infinite precision; rounding them to 16-bit or narrower integers shifts the ripple and can degrade stopband attenuation by several dB. It is good practice to re-evaluate the quantized frequency response in the design tool before committing coefficients to firmware, and to add a few dB of design margin to the stopband spec to absorb quantization loss.

Frequently asked

What does 'equiripple' mean in the context of a Parks-McClellan filter?
It means the approximation error between the actual and ideal frequency response oscillates between equal positive and negative peaks across each band. The algorithm converges when these peaks are all the same height -- this equal-ripple condition is mathematically equivalent to the Chebyshev (minimax) optimality criterion, meaning no other FIR of the same length can achieve a smaller maximum error under the same band constraints.
How does Parks-McClellan differ from windowed-sinc (e.g., Kaiser window) FIR design?
Windowed-sinc methods start from an ideal impulse response and apply a smooth window to reduce sidelobes; ripple is not equal across the band and some stopband attenuation budget is wasted. Parks-McClellan directly optimizes for equal ripple, so it typically achieves the same attenuation and passband flatness with fewer taps. The trade-off is that windowed designs are simpler to compute by hand and have no iterative convergence requirement.
Can Parks-McClellan design IIR filters?
No. The standard Parks-McClellan / Remez exchange algorithm is specific to linear-phase FIR filters. IIR filters are designed with different methods such as bilinear transform of analog prototypes (Butterworth, Chebyshev, elliptic) or direct IIR optimization techniques. Parks-McClellan's linear-phase guarantee comes from the symmetric coefficient constraint that is intrinsic to FIR structures.
What inputs does the algorithm need, and what does it produce?
Inputs are: filter length (number of taps), band edges as normalized frequencies (0 to 0.5 or 0 to pi), desired amplitude in each band, and per-band weighting factors that set the relative importance of ripple in each region. The output is a set of symmetric FIR coefficients. Tools like MATLAB's `firpm` or `scipy.signal.remez` handle the iteration internally; you only specify the design requirements.
How should I handle coefficient quantization when targeting a fixed-point MCU or DSP?
Design with a few extra dB of stopband margin to absorb rounding loss, then quantize the coefficients to your target word length (e.g., Q15 for a 16-bit fixed-point core) and re-plot the frequency response in your design tool. If the quantized stopband attenuation falls short, increase the filter length or the design margin and repeat. Some tools, like MATLAB's Filter Design Toolbox, include quantization-aware design flows that iterate automatically.

Differentiators vs similar concepts

Parks-McClellan (Remez exchange) is often compared to windowed-sinc FIR design and to IIR filter design. Windowed-sinc methods (Hamming, Kaiser, etc.) are simpler but produce non-equiripple responses and require more taps for the same spec. IIR designs (Butterworth, Chebyshev, elliptic) can match a given attenuation spec with far fewer coefficients but introduce non-linear phase, which causes group-delay distortion that Parks-McClellan FIR designs avoid by construction. The elliptic IIR filter is the IIR analogue in the minimax sense -- it achieves equiripple in both passband and stopband -- but its phase response is not linear.