Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

FIR and IIR Filters (Digital Filter Design Toolkit)

LabVIEW 8.6 Digital Filter Design Toolkit Help
June 2008

NI Part Number:
371988B-01

»View Product Info

You can design both finite impulse response (FIR) and infinite impulse response (IIR) digital filters using the LabVIEW Digital Filter Design Toolkit:

  • FIR—The output signal of the filter, after you set the input signal from nonzero to zero, can be nonzero for only a finite number of sample times before the output signal also becomes zero.
  • IIR—The output signal of the filter can be nonzero infinitely after you set the input signal from nonzero to zero.

The choice between FIR and IIR filters affects both the filter design process and the implementation of the filter.

Mathematical Definitions

In the time domain, the filtering process for FIR filters is defined mathematically as a convolution of M+1 filter coefficients hk with a sequence of input data samples x[n]:

(A)

where y[n] is the output of the filter and M is the filter order. The number of coefficients for the FIR filter is defined as the number of taps, which is M+1.

If a single nonzero value is present at the input of the filter but all subsequent input samples are zeroes, the output of the filter in Equation A becomes zero after the filter processes M+1 input data samples. Because the duration of the nonzero response in this case is finite for M+1, the filter in Equation A is an FIR filter.

In 1962, Charles Rader and Bernard Gold at MIT Lincoln Laboratory, motivated by a digital vocoder (voice coder) application, devised the idea of using recursive digital filters. This innovation led to the IIR filter, which has a time-domain response defined by the following equation:

(B)
where N is the numerator order
M is the denominator order
ai is the set of reverse coefficients
bk is the set of forward coefficients

The filter defined by Equation B operates on the current input x[n] and the previous input x[nk] and the current output y[n] and the previous output y[ni]. The impulse response of the filter in this case is infinite because the filter might generate nonzero outputs arbitrarily for an indefinite amount of time in response to a single nonzero input sample.

For most filtering applications, FIR filters are sufficient. In general, FIR filters use the available precision better, and they are more numerically robust. However, in some cases FIR filter orders become impractically large. For example, if you need a large number of FIR filter coefficients—perhaps hundreds or more—an FIR filter might be too difficult or expensive to implement because the implementation might require more memory, power, processing time, and engineering time.

FIR Filters versus IIR Filters

One difference between FIR and IIR filters is the impulse response, which is finite or infinite, respectively. When you design a filter, you must consider other differences between FIR and IIR filters that might affect the design. For example, FIR filter implementations typically require more multiplications and summations than IIR filters with similar filtering performance. However, because certain computer architectures, for example digital signal processors (DSPs), are frequently better suited to performing FIR filtering, the computation speed of an IIR filter is not necessarily faster than an FIR filter. The following table compares the attributes of causal FIR and IIR filters.

Attribute FIR Filter IIR Filter
Exact linear phase response Possible Not possible
Stability Always stable Conditionally stable
Fixed-point version Easy to implement Can be complicated to implement
Computational complexity More computations Fewer computations
Data path precision typically required Less precision required Greater precision required
Zero-input limit cycles1 Cannot produce limit cycles Might produce limit cycles
1 “Zero-input limit cycle behavior refers to the effect that the output may continue to oscillate indefinitely with a periodic pattern while the input remains equal to zero. And it is a consequence either of the nonlinear quantizers in the feedback loop of IIR filter or of overflow of additions.” (Oppenheim and Schafer)

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit