by Barry Van Veen
I am frequently asked, "Which is the best filter?" There are infinite impulse response (IIR) and finite impulse response (FIR) filters, Butterworth, Chebyshev I and II, elliptic, and minimax designs. Then there are at least a dozen different windows that can be used with the window design method. In light of this bewildering range of possibilities, it is perfectly understandable to ask for guidance.
The very fact that there are so many options suggests in advance that there is no single optimal filter design. My goal with this post is to address some of the factors that should be considered when selecting a filter.
IIR vs FIR
The desired phase characteristics of the filter can determine whether the class of IIR or FIR filters are the best choice. The phase response of filters is discussed in detail in Characterizing Filter Phase Response.
If the application is sensitive to phase distortion, then an FIR filter is favored. FIR filters can be designed to have exactly linear phase, and thus zero phase distortion. Recall that linear phase in the frequency domain corresponds to a simple delay in the time domain.
All IIR filters have nonlinear phase - an unavoidable consequence of introducing poles. Typically the phase distortion is greatest near the filter pass band edges. In the center of the passband the phase is often nearly linear.
FIR filters are always stable, for any choice of coefficients, while IIR filters must keep their poles inside the unit circle. Poles that are placed close to the unit circle during design may move outside the unit circle when filter coefficients are represented with finite precision. IIR filters are generally more sensitive to the effects of finite precision arithmetic.
The advantage of IIR filters is two-fold. Typically they have a much lower order for a given set of specifications than an FIR filter. This results in fewer computations per output sample.
The other advantage of an IIR filter is that it can introduce less average delay to the input signal than an FIR filter with comparable magnitude response. The amount of delay can be critical if the filter is used in a feedback loop because delay in a feedback loop causes instability.
The order required for an FIR filter to satisfy design specifications cannot generally be determined in advance. Typically a guess and check procedure is used and the order is iterated until an order is found that meets the specifications. In contrast, the order of IIR filter can be determined in closed form from the design specifications.
Selecting an IIR Filter: Ripple or Monotone Response?
There are four different types of IIR filter designs: Butterworth, Chebyshev I and II, and elliptic. The differences between their responses is whether the response is monotone or has ripple in the pass band and stop band.
Butterworth lowpass filters are monotone decreasing in both the pass band and the stop band. Chebyshev I lowpass filters have equi-ripple response in the pass band and monotone decreasing response in the stop band. Chebyshev II filters have monotone decreasing response in the pass band and equi-ripple response in the stop band. Elliptic filters have equi-ripple responses in both pass band and stop band.
Equi-ripple response in the pass band results in the amplitude distortion being distributed across the whole passband. In contrast, monotone response in the pass band typically results in the majority of amplitude distortion near the band edge. Some applications are sensitive to ripple and monotone response may be preferred. For example, passband ripple can be heard in high fidelity audio systems and monotone characteristics may be preferred.
Equi-ripple response in the stop band results in approximately uniform attenuation across the stop band. In contrast, monotone stop band response produces increasing attenuation at frequencies more distant from the band edge. This can be advantageous if the noise power is greater at frequencies farther from the band edge.
For example, noise in electroencephalography tends to follow a distribution. The noise power is greatest at the lowest frequencies and decreases as frequency increases. A high-pass filter designed to attenuate the noise can benefit from a monotone decreasing response because then the frequencies with the greatest power see the greatest attenuation.
Filters with ripple can generally meet specifications on pass band gain and stop band attenuation with lower order than monotone designs. Hence, Butterworth filters generally require the highest order and elliptic filters the lowest order for a given set of specifications.
The degree of phase distortion and average delay introduced by an IIR filter varies depending on filter type, order, and amplitude specifications. Phase distortion must be evaluated numerically to determine which filter offers the best performance.
FIR Filter Design
Two popular FIR filter design methods are the Parks-McClellan design and the window method. Parks-McClellan design produces a minimax optimal filter. This means that the maximum weighted error between the desired response and the actual filter response is minimized for a given order. This results in equi-ripple characteristics in the pass and stop bands. The ripple is controlled in the design process by the weighting function and the filter order.
The window method generally also produces designs with ripple. The ripple is not uniform, but depends on the particular window that is used.
Filter design relies on well established mathematical procedures. However, there is significant art in the design process - setting specifications and choosing a filter type require the designer to make informed choices based on the application for the filter.