FIR Filters

Finite impulse response (FIR) filters are digital filters that have a finite impulse response. FIR filters operate only on current and past input values and are the simplest filters to design. FIR filters also are known as non-recursive filters, convolution filters, and moving average (MA) filters. FIR filters perform a convolution of the filter coefficients with a sequence of input values and produce an equally numbered sequence of output values. Equation A defines the finite convolution an FIR filter performs.

(A)

where x is the input sequence to filter, y is the filtered sequence, and h is the FIR filter coefficients.

FIR filters have the following characteristics:

The following figure shows a typical magnitude and phase response of an FIR filter compared to normalized frequency.

In the previous figure, the discontinuities in the phase response result from the discontinuities introduced when you use the absolute value to compute the magnitude response. The discontinuities in phase are on the order of pi. However, the phase is clearly linear.

Taps

The terms tap and taps frequently appear in descriptions of FIR filters, FIR filter design, and FIR filtering operations. The following figure illustrates the process of tapping.

The previous figure represents an n-sample shift register containing the input samples [xi, xi – 1, …]. The term tap comes from the process of tapping off of the shift register to form each hkxik term in Equation A. Taps usually refers to the number of filter coefficients for an FIR filter.

Designing FIR Filters

You design FIR filters by approximating the desired frequency response of a discrete-time system. The most common techniques approximate the desired magnitude response while maintaining a linear-phase response. Linear-phase response implies that all frequencies in the system have the same propagation delay.

Because FIR filters have ripple in the magnitude response, designing FIR filters has the following design challenges:

For example, a lowpass filter has an ideal characteristic magnitude response. A particular application might allow some ripple in the passband and more ripple in the stopband. The filter design algorithm must balance the relative ripple requirements while producing the sharpest transition band.

The most common techniques for designing FIR filters are windowing and the Parks-McClellan algorithm, also known as Remez Exchange.

Designing FIR Filters by Windowing

Windowing is the simplest technique for designing FIR filters because of its conceptual simplicity and ease of implementation. Designing FIR filters by windowing takes the inverse FFT of the desired magnitude response and applies a smoothing window to the result. The smoothing window is a time domain window.

Complete the following steps to design a FIR filter by windowing.

  1. Decide on an ideal frequency response.
  2. Calculate the impulse response of the ideal frequency response.
  3. Truncate the impulse response to produce a finite number of coefficients. To meet the linear-phase constraint, maintain symmetry about the center point of the coefficients.
  4. Apply a symmetric smoothing window.

Truncating the ideal impulse response results in the Gibbs phenomenon. The Gibbs phenomenon appears as oscillatory behavior near cut-off frequencies in the FIR filter frequency response. You can reduce the effects of the Gibbs phenomenon by using a smoothing window to smooth the truncation of the ideal impulse response. By tapering the FIR coefficients at each end, you can decrease the height of the side lobes in the frequency response. However, decreasing the side lobe heights causes the main lobe to widen, resulting in a wider transition band at the cut-off frequencies.

Selecting a smoothing window requires a trade-off between the height of the side lobes near the cut-off frequencies and the width of the transition band. Decreasing the height of the side lobes near the cut-off frequencies increases the width of the transition band. Decreasing the width of the transition band increases the height of the side lobes near the cut-off frequencies.

Designing FIR filters by windowing has the following disadvantages:

Designing FIR filters by windowing does not require a large amount of computational resources. Therefore, windowing is the fastest technique for designing FIR filters. However, windowing is not necessarily the best technique for designing FIR filters.

Designing Optimum FIR Filters Using the Parks-McClellan Algorithm

The Parks-McClellan algorithm, or Remez Exchange, uses an iterative technique based on an error criterion to design FIR filter coefficients. You can use the Parks-McClellan algorithm to design optimum, linear-phase, FIR filter coefficients. Filters you design with the Parks-McClellan algorithm are optimal because they minimize the maximum error between the actual magnitude response of the filter and the ideal magnitude response of the filter.

Designing optimum FIR filters reduces adverse effects at the cut-off frequencies. Designing optimum FIR filters also offers more control over the approximation errors in different frequency bands than other FIR filter design techniques, such as designing FIR filters by windowing, which provides no control over the approximation errors in different frequency bands.

Optimum FIR filters you design using the Parks-McClellan algorithm have the following characteristics:

FIR filters you design using the Parks-McClellan algorithm have an optimal response. However, the design process is complex, requires a large amount of computational resources, and is much longer than designing FIR filters by windowing.

Designing Equiripple FIR Filters Using the Parks-McClellan Algorithm

You can use the Parks-McClellan algorithm to design equiripple FIR filters. Equiripple design equally weights the passband and stopband ripple and produces filters with a linear phase characteristic.

You must specify the following filter characteristics to design an equiripple FIR filter:

The cut-off frequency for equiripple filters specifies the edge of the passband, the stopband, or both. The ripple in the passband and stopband of equiripple filters causes the following magnitude responses:

For example, if you specify a lowpass filter, the passband cut-off frequency is the highest frequency for which the passband conditions are true. Similarly, the stopband cut-off frequency is the lowest frequency for which the stopband conditions are true.