Tags
Digital Filters

Comparison

Table 1: Comparison of IRR and FIR Filters
IIR FIR
Impulse Response Infinite Finite
Phase No particular phase Linear phase possible
Stability Can be unstable Always stable (feedback not involved)
Analog Derived from analog filter Cannot simulate analog response
Num/Den Both numerator and denominator Only has numerators
Poles/Zeros Zeros and poles Only Zeros

Digital filters with finite-duration impulse response (all-zero, or FIR filters) have both advantages and disadvantages compared to infinite-duration impulse response (IIR) filters.

FIR filters have the following primary advantages:

  • They can have exactly linear phase.
  • They are always stable.
  • The design methods are generally linear.
  • They can be realized efficiently in hardware.
  • The filter startup transients have finite duration.

The primary disadvantage of FIR filters is that they often require a much higher filter order than IIR filters to achieve a given level of performance. Correspondingly, the delay of these filters is often much greater than for an equal performance IIR filter.

From (Shaw and Srinivasan 1990)

The FIR are capable of realizing filters with linear phase shift characteristics and furthermore are less susceptible to signal input and filter coefficient quantization effects. However, their computational demands are excessively large because of the large number of multiplications and additions to be performed at each sampling interval. The effective time delay corresponding to the linear phase shift is large and would have a destabilizing effect in closed loop applications. IIR filters are computationally less demanding. The fact that their phase shift characteristics do not vary linearly with frequency is not a disadvantage in this application. IIR filters are however, more susceptible to signal input and coefficient quantization effects.

From https://dsp.stackexchange.com/a/30999

FIR filters are fairly common in some areas of control theory. As they usually incur a lot of added phase/time-delay, they are not really usable in the feedback path of regular control systems, but they are useful when the added phase/time-delay is not affecting the system in an adverse way, or when the particular phase response and time-delay is desired.

Examples:

  • Feed-forward control. FIR filters are useful for producing filters that approximate arbitrary frequency responses, hence they can be used to shape a reference signal. A typical example is to use an FIR filter with the inverse frequency response of the plant – trying to counteract the dynamics of the plant in order to get a desired output. Phase/time-delay is not interfering with the stability or performance since the computation can be done offline. FIR filters can often produce higher performance than IIR filters, especially where there are non-minimum phase zeros.

Moving Average Filter (FIR)

A moving average is just a basic FIR filtering. If the moving average is done over n samples, the FIR filter’s coefficients are then \([1/n,\ 1/n,\ \dots,\ 1/n]\).

For instance:

1
2
3
n = 3;

b = 1/n*ones(n,1);

And we can look at the step response of the filter:

1
2
3
4
5
6
7
y = ones(3*n, 1);
y(1:n) = 0;

outhi = filter(b,1,y);

figure;
plot(outhi, 'ko')

Figure 1: Step response of the FIR "moving average filter"

Figure 1: Step response of the FIR "moving average filter"

Let’s look at the response of the filter in the frequency domain.

1
2
3
Fs = 1e3; % Sampling frequency

freqz(b,1,[],Fs);

Figure 2: Frequency response of the moving average filter

Figure 2: Frequency response of the moving average filter

FIR Design with Matlab

Bibliography

Shaw, F. R., and K. Srinivasan. 1990. “Bandwidth Enhancement of Position Measurements Using Measured Acceleration.” Mechanical Systems and Signal Processing 4 (1): 23–38. doi:10.1016/0888-3270(90)90038-m.