DIGITAL SIGNAL PROCESSING  

IIR Filter Disign and Implementation


Introduction to the IIR Difference Equation and System Function

IIR Filter Structures

IIR Filter Design with Bilinear Transformation

Typical Analog Filters

Procedure



I. Introduction to the IIR Difference Equation and System Function

The most general form of the relationship between the input and output of physically realizable discrete-time LTI systems can be specified by using the difference equation:

(1)

where {al}, called feedback coefficients, and {bk}, called feedforward coefficients, are the filter coefficients that specify the system and are independent of x(n) and y(n). Taking z-transform on both sides of Eq. (1) gives the corresponding system function for the above difference equation in the form of

where the roots of the denominators z=zp such that

are called poles of the system function, and the roots of the numerators z=z0 such that

are called zeroes. The frequency response of the system is obtained by evaluating H(z) on the unit circle

(2)

where H(ejw) is the same as the frequency response, which we denoted by in the textbook. This fomula is a correspondence between z domain and domain.

If the {al} are non-zero in Eq. (2), then   H(z) has one or more poles so that h[n] contains exponential terms which are of infinite duration. Systems of this form are therefore called infinite impulse response (IIR) systems.


Notice that if the coefficients {al} are all zeros, the difference equation (1) reduces to the difference equation of a FIR system (see Lab #3), where we refer to M as the order of a FIR system. Generally, in an IIR system, we define N, the number of feedback terms, as the order of filter.



II. IIR Filter Structures

There are several structures that can represent an IIR filter. Here we will intuduce four commonly used IIR filter structures.

  1. Direct form I structure:
  2. This is a common and simple structure. From the following figure, we see that the block-diagram dirctly comes from the system function H(z)=(1/A(z))*B(z), so the system implemented in this way is called the Direct Form I implementation.

                Feed-forward Part                    Feedback Part 
                     B(z)                                1/A(z)
    
                 (First-order IIR filter direct form I sructure)
    
  3. Direct form II structure:
  4. For an LTI cascade system, we can change the order of the system without changing the overall system response. Of couse, we can write the first-order IIR filter system function as H(z)=B(z)*(1/A(z)), from which we get a new block-diagram dircectly (see the following figure). Notice that the direct form II requires half as many delay elements as the direct form I.

                  Feedback Part            Feed-forward Part                    
                      1/A(z)                     B(z)   
                      
                 (First-order IIR filter direct form II sructure)
    
  5. Direct form II transposed structure:
  6. The direct form II transposed structure is the modified version of the direct form II and requires the same number of delay elements. The following three steps yield a transposed structure from dircet form II:

    1. Reverse all the arrows with multipliers being unchanged in value and location;
    2. Reverse the roles of the input and output (input <-> output);
    3. Redraw the structure and the branching point and the summing point are interchanged.

                 
                 (First-order IIR filter direct form II transposed sructure)
    
  7. Cascade structure:
  8. An overall transfer function can be represented with cascade transfer functions H(z)=H1(z)*H2(z)*H3(z)*...*Hr(z). So this implies that two or more systems can be cascaded in either order to obtain the same overall system response.

                 
                 (IIR filter cascade form sructure)
    


III. IIR Filter Design with Bilinear Transformation

The most commonly used techniques for the design of IIR filters are based on tranformations of continous-time IIR systems into the discrete-time IIR systems. Since analog filter design techniques have been in use for many years, transformations were developed that map the s-plane poles and zeros into the z-plane to achieve the desired digital filter characteristics. One of the most effective ways of converting an analog filter into a digital equivalent is by means of a Bilinear Transformation.

The Bilinear transformation is a one-to-one mapping from the analog s-plane to the digital z-plane and it allows the following:

  1. The left region in the s-plane maps to the inside the unit circle in the z-plane;
  2. The right region in the s-plane maps to the outside the unit circle in the z-plane;
  3. The imaginary jw axis in the s-plane maps to the unit circle in the z-plane.

The transformation maps each of the analog poles and zeros in the s-plane into unique poles and zeros in the z-plane based on a numerical integration technique used to simulate analog filters. The transformation between the analog domain and the discrete time domain is nonlinear since maps onto therefore restricting this technique to cases where the corresponding frequency warping is acceptable. The bilinear transformation corresponds to replacing s by

where Td=1/fs is the sampling period. With Ha(s) denoting the analog system function and H(z) the discrete-time system function we get that

(5)

A useful property of the bilinear transformation is that it maps the left half s-plane onto the inside of the unit circle in the z-plane. Since all analog filter design methods give rise to stable and causal transfer functions Ha(s), this property guarantees that the digital filter obtained will be stable and causal. By replacing z=ejwand we can derive a relationship between the analog frequency and the discrete time frequency


or

Other versions of the bilinear transformation which are appropriate for designing highpass, bandpass, or bandstop digital filters by starting with an equivalent lowpass filter are given in Table 1, where c is derived based on frequency response specifications of the bandpass and bandstop filters.


Transformation Type

s

Lowpass:

Highpass:

Bandpass:

Bandstop:



IV. Typical Analog Filters

The approximation problem in the design of IIR digital filters is usually solved by using Butterworth, Chebyshev, or Elliptic analog filter approximations.



V. The Procedure

This laboratory experiment consists of two exercises, each of which is a real-time excercise showing the properties discussed above. All IIR filters design and implementation will be in MATLAB. Follow the procedure and complete the lab exercises. Please call the TA for assistance if you have any problems at any time.

  • Exercise I: Transform analog filters into digital IIR filters
        a).  Ha(s) = 1/[(s2+s+0.5)*(s+1)]
    
        b).  Hb(s) = s/(s+2)
    
        c).  Hc(s) = (s2+0.5271)/(s2+0.096s+0.5271)
    
    1. Plot the relationship between analog freqeuncy and the discrete time freqeuncy w as specified by the equation

      = 2/Td * tan(w/2)

      or

      w = 2*arctan(*Td/2)

    2. Using the bilinear function in MATLAB, find the corresponding transfer funcitons in the digital z-plane for the above three transfer functions in the analog s-plane with Td=2 and fs=1/Td.
    3. Use the freqz command in MATLAB to plot the magnitude response of each of the three IIR filters.
    4. Use the zplane command in MATLAB to plot pole-zero figure of each of the three IIR filters.
    5. Specify the order and property of each of the three IIR filters.

  • Exercise II: Implement designed IIR filters

    * Bring the m-files of prelab questions and the .wav file used in lab #3 to the lab session.

    1. Using wavread command in MATLAB read the .wav file used in lab #3 as the input of IIR filter.
    2. Use filter function in MATLAB to implement the IIR filters as Y=filter(B,A,X), where vector B is feedforward coefficients and vector A is feedback coefficients.
    3. Filter the data file using the lowpass filter in prelab 1.
    4. Filter the data file using the highpass filter in prelab 2.
    5. Filter the data file using the bandstop filter in prelab 3.
    6. Print all the filtered signals.
    7. Using wavwrite command in MATLAB write the output of each IIR filter as a .wav file.
    8. Playback each processed .wav file and make a note of the audible changes due to the filtering in each case.