[Components] Design Finite Impulse Response Digital Filters Precise FIR digital filters can be designed with the help of a popular mathematical modeling program and an understanding of basic performance trade-offs. Ricardo A. Losada | ED Online ID #7229 | January 2004
Digital filters have enabled much of modern communications and the measurements that support them. While most high-frequency design engineers may be familiar with the use of the MATLAB mathematical modeling tool from The MathWorks (Natick, MA) for the design of advanced antennas, the software also features powerful algorithms and toolboxes for the design of finite-impulse-response (FIR) digital filters. This four-part article series on designing FIR digital filters with MATLAB will open with a review of key FIR filter specifications and examples of optimal linear- and nonlinear-phase FIR filter designs. Although many lowpass filters will be shown, the design techniques apply to other filter types as well. An ideal lowpass filter passes all frequency components of a signal below a designated cutoff frequency, ωc, and rejects all frequency components of a signal above ωc, according to:
The impulse response of an ideal lowpass filter in Eq. 1 can be found from1:
Because the impulse response required to implement the ideal lowpass filter is infinitely long, it is not possible to design an ideal FIR lowpass filter. Finite-length approximations of the ideal impulse response lead to ripples in both the passband and the stopband, as well as a nonzero transition width between the passband and the stopband (Fig. 1). Although it would be ideal to eliminate the transition width as well as the passband and stopband ripples, they are unavoidable deviations from the response of an ideal lowpass filter when using an FIR approximation. Practical FIR designs typically consist of filters meeting certain design specifications. For example, a practical FIR filter design has a given transition width and passband and stopband ripples set at some maximum value(s). The filter is also defined by its order, or equivalently, the length of the truncated impulse response. The trade-offs among key filter specifications can be represented in the form of a triangle (Fig. 2). The triangle shows the degrees of freedom available when designating design specifications. Because the sum of the angles is fixed, values can only be selected for two of the specifications; the third will be dictated by the selection of the other two. As with the triangle, if one of the specifications is made larger or smaller, it will impact one or both of the other two specifications. For example, consider the design of an FIR filter that meets the following specifications: a cutoff frequency of 0.4π rads/sample, a transition width of 0.06π rads/sample, and maximum passband and stopband ripple of 0.05 dB. The filter can easily be designed with the truncated-and-windowed impulse response algorithm implemented in the "firl" function within MATLAB's Filter Design Toolbox (or by using the "fdatool" graphical user interface) provided that a Kaiser-window filter design is used. Figure 3 shows the zero-phase response of a filter designed according to these specifications. Since the transition width and peak-ripple performance are fixed, the filter order has been determined by these other two parameters. Examination at the stopband-edge frequency ωs = 0.43π shows that the peak passband/stopband ripples are within the allowable specifications. Usually, the specifications are exceeded because the order is rounded to the next integer greater than the actual value required. While the truncated-and-windowed impulse response design algorithm is simple and reliable, it is not optimal. It yields designs that are generally inferior to those produced by algorithms employing optimization criteria; the nonoptimized designs will have greater order, greater transition width, or greater passband/stopband ripples than an optimized design. Since improved performance is usually desirable, the usefulness of more sophisticated algorithms (with optimization) is obvious. Optimal designs are computed by minimizing some measure of the deviations between an ideal filter and a filter to be designed. The most common optimal FIR design algorithms are based on fixing the transition width and the order of the filter, and minimizing the ideal/practical deviations of the passband/stopband ripples. This deviation or error can be expressed mathematically as (ref. 2):
where: Ha(ω) = the zero-phase response of the designed filter and
It is still necessary to define a measurement to determine "the size" of E(ω), the quantity to be minimized as a result of the optimization. The most often used measures are L(infinity)-norm (||E(w)||(infinity) minimum-maximum designs) and L2-norm (||E(w)||2 least-squares designs). To allow for different peak ripples in the passband and stopband, a weighting function [W(ω)] is usually introduced:
A filter with linear-phase response is desirable in many applications, notably image processing and data transmission. One of the desirable characteristics of FIR filters is that they can be designed very easily to have linear phase. It is well known3 that linear-phase FIR filters will have impulse responses that are either symmetric or antisymmetric. For these types of filters, the zero-phase response can be determined analytically,3 and the filter design problem becomes a well-behaved approximation theory problem.4 The approximation involves determining the best solution for a given function (the response of an ideal lowpass filter) by means of a polynomial (the FIR filter) of given order. The "best" solution is one that minimizes the differences for a given performance parameter between an ideal filter and the filter to be designed. The "remez" function in MATLAB implements an algorithm developed in ref. 5 that computes a solution to the design problem for linear-phase filters in the L(infinity)-norm case. The design problem is essentially to find a filter that minimizes the maximum error between the ideal and the actual filters. This type of design leads to so-called equiripple filters, i.e., filters in which the peak deviations from the ideal response are all equal. The software's "firls" function implements an algorithm to compute solution for linear-phase FIR filters in the L2-norm case. The design problem is to find a filter that minimizes the energy of the error between ideal and actual filters.
|
Resources

RSS




















)
)
)
)
)
