SlideShare a Scribd company logo
Infinite Impulse Response (IIR) Filters
                 Vol-5
Introduction
   Infinite Impulse Response (IIR) filters are
    the first choice when:
        Speed is paramount.
        Phase non-linearity is acceptable.
   IIR filters are computationally more
    efficient than FIR filters as they require
    fewer coefficients due to the fact that they
    use feedback or poles.
   However feedback can result in the filter
    becoming unstable if the coefficients
    deviate from their true values.
Concept of Digital IIR filter

                    h(k), k=0,1,2,…,∞
     x(n)           (impulse response-             y(n)
Input sequence        infinite length)        output sequence




                 y(n)         h(k ) x(n k )
                        k 0
Properties of an IIR Filter
   The general equation of an IIR filter can
    be expressed as follows:
                    b0 b1 z 1  bN z N
              H z
                    1 a1 z 1  aM z M
                        N
                                   k
                            bk z
                        k 0
                          M
                                       k
                    1          ak z
                         k 1


   ak and bk are the filter coefficients.
Properties of an IIR Filter
   The transfer function can be factorised to
    give:
                z z1 z z 2  z z N   Y z
     H z   k
               z p1 z p2  z p N     X z


   Where: z1, z2, …, zN are the zeros,
           p1, p2, …, pN are the poles.
Properties of an IIR Filter .. continued

   Time domain theoretical equation of IIR

              y(n)           h(k ) x(n k )
                       k 0

   For the implementation of the above
    equation we need the difference equation:
               N                M
       y(n)       b x(n k )         b y (n k )
              k 0 k            k   1k
              b(0) x(n) b(1) x(n   1) b(2) x(n 2) 
                        a(1) y(n   1) a(2) y(n 2)
IIR difference Equation and Direct Implementation
                    Structure

           y(n) b(0) x(n) b(1) x(n 1) b(2) x(n 2) 
                          a(1) y(n 1) a(2) y(n 2)

   x(n)          b0                                   y(n)
                        +           +


          z-1                                   z-1


                 b1     +           +     a1


          z-1                                  z-1


                 b2                       a2



                IIR structure for order=N = M = 2
IIR Direct Form I and Direct Form II
              Structures
x[n]                                                     y[n]
                                +
                Z-1       b0                   Z-1

       x[n-1]                                          y[n-1]    IIR
                Z-1       b1
                                       -a1     Z-1              Direct
       x[n-2]                                                   Form I
                                                     y[n-2]
                          b2
                                       -a2


       x[n]           +                       +          y[n]
                                      b0
                                Z-1                           IIR Direct
                          -a1         b1                       Form II
                                Z-1
                                                              (Canonic)
                          -a2         b2


  y(n) b(0)x(n) b(1)x(n 1) b(2)x(n 2)  a(1) y(n 1) a(2) y(n 2)
Dsp lecture vol 5 design of iir
Design Procedure
   To fully design and implement a filter five
    steps are required:
     (1)   Filter specification.
     (2)   Coefficient calculation.
     (3)   Structure selection.
     (4)   Simulation (optional).
     (5)   Implementation.
Dsp lecture vol 5 design of iir
Dsp lecture vol 5 design of iir
Filter Specification - Step 1
  |H(f )|     pass-band                        stop-band

      1




                            fc : cut-of f f requency               fs/2       f (norm)
                                        (a)


  |H(f )|     pass-band   transition band        stop-band                |H(f )|
   (dB)                                                                   (linear)
          p                                                               1       p

      0                                                                   1
                                                                          1           p

                                                       pass-band
     -3
                                                         ripple



                                                       stop-band
                                                         ripple
          s                                                                   s



                                                                   fs/2       f (norm)
                                   fsb : stop-band f requency
                                fc : cut-of f f requency
                              fpb : pass-band f requency
                                        (b)
Coefficient Calculation - Step 2
   There are two different methods available
    for calculating the coefficients:
        Direct placement of poles and zeros.
        Using analogue filter design.
            Impulse invariant
            Bilinear z-transform etc
Pole-zero Placement Method
   All that is required for this method is the
    knowledge that:
        Placing a zero near or on the unit circle in
         the z-plane will minimise the transfer
         function at this point.
        Placing a pole near or on the unit circle in
         the z-plane will maximise the transfer
         function at this point.
        To obtain real coefficients the poles and
         zeros must either be real or occur in
         complex conjugate pairs.
Analogue to Digital Filter Conversion
   This is one of the simplest method.
   There is a rich collection of prototype
    analogue filters with well-established
    analysis methods.
   The method involves designing an
    analogue filter and then transforming it to
    a digital filter.
   The two principle methods are:
        Bilinear transform method
        Impulse invariant method.
Realisation Structures - Step 3
   Direct Form I:
                         N
                                        k
                                 bk z
          Y z            k 0                    b0 b1 z 1  bN z N
    H z                    M
          X z                               k   1 a1 z 1  aM z M
                     1            ak z
                          k 1


   Difference equation:
                             N                    M
                yn                bk x n k              ak y n k
                          k 0                     k 1




   This leads to the following structure…
Realisation Structures - Step 3
   Direct Form I:
       x(n)                                     y(n)
                    b0     +   +


              z-1                         z-1


                    b1     +   +   a1


              z-1                         z-1


                    b2     +   +   a2




                    bN-1   +   +   aM-1


              z-1                         z-1


                    bN     +   +   aM
Realisation Structures - Step 3
   Direct Form II canonic realisation:
    x(n)                    P(n)              y(n)
           +                         b0   +

                      z-1
                            P(n-1)
           +    -a1                  b1   +

                      z-1
                            P(n-2)
           +    -a2                  b2   +




                      z-1
                            P(n-N)
           +   -aN                   bN   +
Bilinear Transform Method
   Practical example of the bilinear
    transform method:
        The design of a digital filter to approximate a
         second order low-pass analogue filter is
         required.
        The transfer function that describes the
         analogue filter is (This is an analog
         BUTTERWORTH filter):
                               1
                    H s
                          s2    2s 1
        The digital filter is required to have:
            Cut-off frequency =100 Hz
            Sampling frequency of 1 kHz.
Example: Design of a LP filter design using
        Bilinear Transformation

  Design a digital equivalent of a 2nd order
  Butterworth LP filter with a
  cut-off freq fc=100 Hz
  Sampling frequency fs=1000 Hz.
  The normalized cut off frequency of the digital filter
  ω=2πfc/fs=2πfc 100/1000=0.628
  Now equivalent analog filter cut-off freq
  Ω=ktan(ω/2)= 1.tan(0.628/2)=0.325 rads/sec
Design of a LP filter design using Bilinear
         Transformation ..continued
     H(s) for a Butterworth filter
                            1
             H ( s)
                      s2      2s 1
Now the transfer function of this Butterworth filter
becomes (putting s=s/Ω)
                                 1
             H ( s)
                        s 2              s
                                     2         1
                      0.325            0.325
Design of a LP filter design using Bilinear Transformation
                         ..continued
 Now convert the analog filter H(s) into equivalent
 digital filter H(z) by applying the bilinear z-transform-
                                 1
                       z 1 1 z
                   s             1
                       z 1 1 z

                             1
      H ( z)
                  1   1 z 1 2    2 1 z 1
                                              1
               0.3252 1 z 1   0.325 1 z 1

               0.067 0.135z 1 0.067 z 2
               1 1.1429 z 1 0.4127 z 2
Design of a LP filter design using Bilinear Transformation
                         ..continued
     From the previous we get the filter coefficients-
    {bk}Coefficients          {ak}coefficients
    b0=0.067                  a1= -1.1429
    b1=0.0135                 a2=0.4127
    b2=0.067

  The time domain difference equation is obtained
    y(n) b(0) x(n) b(1) x(n 1) b(2) x(n 2) 
                    a(1) y(n 1) a(2) y(n 2)
         0.67 x(n) 0.135x(n 1) 0.67 x(n)
                   1.1429 y(n 1) 0.4127 y(n 2)
Direct realization of the design

x(n)                                                y(n)
               b0       +   +

             b0=0.067
       z-1                                    z-1


                b       +   +        a
                 1                    1
             b1=0.135           a1=1.1429
       z-1                                    z-1


                b                    a
                 2                    2
             b2=0.067           a2= -0.4127
Matlab Code for the BZT Method
clear all
fc=100;fs=1000;
wp=2*pi*fc*(1/fs);
OmegaP=2*fs*tan(wp/2);
Omega=tan(wp/2);
Hs_den1=[(1/Omega)^2,((2^0.5)/Omega),1];
Hs_den=[(1/OmegaP)^2,((2^0.5)/OmegaP),1];
Hs_num=1;
Hs_denN=Hs_den/Hs_den(1);
Hs_numN=Hs_num/Hs_den(1);
[b,a]=bilinear(Hs_numN,Hs_denN,fs);
freqz(b,a,fs)
Infinite Impulse Response (IIR) Filters
                - End -

More Related Content

PDF
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
PDF
Basics of Digital Filters
PPTX
Lecture No:1 Signals & Systems
PPTX
Design of digital filters
PDF
Design of FIR filters
PDF
DSP_FOEHU - Lec 07 - Digital Filters
DOCX
digital filter design
PDF
Dsp U Lec07 Realization Of Discrete Time Systems
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
Basics of Digital Filters
Lecture No:1 Signals & Systems
Design of digital filters
Design of FIR filters
DSP_FOEHU - Lec 07 - Digital Filters
digital filter design
Dsp U Lec07 Realization Of Discrete Time Systems

What's hot (20)

PPTX
Fir filter design using windows
PPTX
Fir filter design (windowing technique)
PPT
Fir and iir filter_design
PDF
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
PPTX
Z TRRANSFORM
PPTX
Discrete Fourier Transform
PDF
Adaptive filter
PPT
digital filters
PDF
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
PPTX
Applications of Z transform
PPTX
Image Enhancement using Frequency Domain Filters
PPTX
Discrete time filter design by windowing 3
PPT
carry look ahead adder
PPTX
Fourier transforms of discrete signals (DSP) 5
PDF
Design of IIR filters
PDF
Z transform
PDF
03 image transform
PDF
Convolution linear and circular using z transform day 5
PPTX
Multirate DSP
Fir filter design using windows
Fir filter design (windowing technique)
Fir and iir filter_design
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
Z TRRANSFORM
Discrete Fourier Transform
Adaptive filter
digital filters
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
Applications of Z transform
Image Enhancement using Frequency Domain Filters
Discrete time filter design by windowing 3
carry look ahead adder
Fourier transforms of discrete signals (DSP) 5
Design of IIR filters
Z transform
03 image transform
Convolution linear and circular using z transform day 5
Multirate DSP
Ad

Viewers also liked (20)

PDF
Advantages of blackman window over hamming window method for designing fir fi...
PPT
Digital signal processing By Er. Swapnil Kaware
PPT
Digital Filters Part 2
PDF
Dsp U Lec09 Iir Filter Design
PPTX
Design of Filters PPT
PDF
Implementation of Digital Filters
DOCX
Dsp model exam qp
PDF
A Novel Methodology for Designing Linear Phase IIR Filters
PPTX
filter design
PPT
Ajal filters
PDF
Warping Concept (iir filters-bilinear transformation method)
PPTX
Ecg compression using fft
PPT
Fir filter_utkarsh_kulshrestha
PDF
Time v Frequency Domain Analysis For Large Automotive Systems
PPT
Digital Filters Part 1
PPTX
Unit 4 frequency response-Bode plot
PPT
Bode plot
PDF
Dft and its applications
PPTX
Butterworth filter design
Advantages of blackman window over hamming window method for designing fir fi...
Digital signal processing By Er. Swapnil Kaware
Digital Filters Part 2
Dsp U Lec09 Iir Filter Design
Design of Filters PPT
Implementation of Digital Filters
Dsp model exam qp
A Novel Methodology for Designing Linear Phase IIR Filters
filter design
Ajal filters
Warping Concept (iir filters-bilinear transformation method)
Ecg compression using fft
Fir filter_utkarsh_kulshrestha
Time v Frequency Domain Analysis For Large Automotive Systems
Digital Filters Part 1
Unit 4 frequency response-Bode plot
Bode plot
Dft and its applications
Butterworth filter design
Ad

Similar to Dsp lecture vol 5 design of iir (20)

PPT
Digital fiiter
PPT
BUTTERWORTH FILTER AND CHEBYSHEW FILTERS
PPT
Chapter14
PPT
Digital filters (FIR).ppt
PPT
DIGITAL FILTER SPECIFICATIONS AND MATHEMATICS.ppt
PPT
Filter dengan-op-amp
PPTX
New filters1 filler design for the dsp system
PPTX
DSP-UNIT-V-PPT-1.pptx
PPTX
Importance of FIR filters power point.pptx
PPT
fghdfh
PDF
1-Digital filters (FIR).pdf
PPT
6-Digital filters (FIR).ppt
PPT
Quadrature amplitude modulation qam transmitter
PPTX
State description of digital processors,sampled continous systems,system with...
PDF
Simplextabular
PPTX
Chapter8
PPTX
Cepstral coefficients
PDF
Dsp U Lec08 Fir Filter Design
PPTX
State equations model based on modulo 2 arithmetic and its applciation on rec...
PPTX
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
Digital fiiter
BUTTERWORTH FILTER AND CHEBYSHEW FILTERS
Chapter14
Digital filters (FIR).ppt
DIGITAL FILTER SPECIFICATIONS AND MATHEMATICS.ppt
Filter dengan-op-amp
New filters1 filler design for the dsp system
DSP-UNIT-V-PPT-1.pptx
Importance of FIR filters power point.pptx
fghdfh
1-Digital filters (FIR).pdf
6-Digital filters (FIR).ppt
Quadrature amplitude modulation qam transmitter
State description of digital processors,sampled continous systems,system with...
Simplextabular
Chapter8
Cepstral coefficients
Dsp U Lec08 Fir Filter Design
State equations model based on modulo 2 arithmetic and its applciation on rec...
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...

Dsp lecture vol 5 design of iir

  • 1. Infinite Impulse Response (IIR) Filters Vol-5
  • 2. Introduction  Infinite Impulse Response (IIR) filters are the first choice when:  Speed is paramount.  Phase non-linearity is acceptable.  IIR filters are computationally more efficient than FIR filters as they require fewer coefficients due to the fact that they use feedback or poles.  However feedback can result in the filter becoming unstable if the coefficients deviate from their true values.
  • 3. Concept of Digital IIR filter h(k), k=0,1,2,…,∞ x(n) (impulse response- y(n) Input sequence infinite length) output sequence y(n) h(k ) x(n k ) k 0
  • 4. Properties of an IIR Filter  The general equation of an IIR filter can be expressed as follows: b0 b1 z 1  bN z N H z 1 a1 z 1  aM z M N k bk z k 0 M k 1 ak z k 1  ak and bk are the filter coefficients.
  • 5. Properties of an IIR Filter  The transfer function can be factorised to give: z z1 z z 2  z z N Y z H z k z p1 z p2  z p N X z  Where: z1, z2, …, zN are the zeros, p1, p2, …, pN are the poles.
  • 6. Properties of an IIR Filter .. continued  Time domain theoretical equation of IIR y(n) h(k ) x(n k ) k 0  For the implementation of the above equation we need the difference equation: N M y(n) b x(n k ) b y (n k ) k 0 k k 1k b(0) x(n) b(1) x(n 1) b(2) x(n 2)  a(1) y(n 1) a(2) y(n 2)
  • 7. IIR difference Equation and Direct Implementation Structure y(n) b(0) x(n) b(1) x(n 1) b(2) x(n 2)  a(1) y(n 1) a(2) y(n 2) x(n) b0 y(n) + + z-1 z-1 b1 + + a1 z-1 z-1 b2 a2 IIR structure for order=N = M = 2
  • 8. IIR Direct Form I and Direct Form II Structures x[n] y[n] + Z-1 b0 Z-1 x[n-1] y[n-1] IIR Z-1 b1 -a1 Z-1 Direct x[n-2] Form I y[n-2] b2 -a2 x[n] + + y[n] b0 Z-1 IIR Direct -a1 b1 Form II Z-1 (Canonic) -a2 b2 y(n) b(0)x(n) b(1)x(n 1) b(2)x(n 2)  a(1) y(n 1) a(2) y(n 2)
  • 10. Design Procedure  To fully design and implement a filter five steps are required: (1) Filter specification. (2) Coefficient calculation. (3) Structure selection. (4) Simulation (optional). (5) Implementation.
  • 13. Filter Specification - Step 1 |H(f )| pass-band stop-band 1 fc : cut-of f f requency fs/2 f (norm) (a) |H(f )| pass-band transition band stop-band |H(f )| (dB) (linear) p 1 p 0 1 1 p pass-band -3 ripple stop-band ripple s s fs/2 f (norm) fsb : stop-band f requency fc : cut-of f f requency fpb : pass-band f requency (b)
  • 14. Coefficient Calculation - Step 2  There are two different methods available for calculating the coefficients:  Direct placement of poles and zeros.  Using analogue filter design.  Impulse invariant  Bilinear z-transform etc
  • 15. Pole-zero Placement Method  All that is required for this method is the knowledge that:  Placing a zero near or on the unit circle in the z-plane will minimise the transfer function at this point.  Placing a pole near or on the unit circle in the z-plane will maximise the transfer function at this point.  To obtain real coefficients the poles and zeros must either be real or occur in complex conjugate pairs.
  • 16. Analogue to Digital Filter Conversion  This is one of the simplest method.  There is a rich collection of prototype analogue filters with well-established analysis methods.  The method involves designing an analogue filter and then transforming it to a digital filter.  The two principle methods are:  Bilinear transform method  Impulse invariant method.
  • 17. Realisation Structures - Step 3  Direct Form I: N k bk z Y z k 0 b0 b1 z 1  bN z N H z M X z k 1 a1 z 1  aM z M 1 ak z k 1  Difference equation: N M yn bk x n k ak y n k k 0 k 1  This leads to the following structure…
  • 18. Realisation Structures - Step 3  Direct Form I: x(n) y(n) b0 + + z-1 z-1 b1 + + a1 z-1 z-1 b2 + + a2 bN-1 + + aM-1 z-1 z-1 bN + + aM
  • 19. Realisation Structures - Step 3  Direct Form II canonic realisation: x(n) P(n) y(n) + b0 + z-1 P(n-1) + -a1 b1 + z-1 P(n-2) + -a2 b2 + z-1 P(n-N) + -aN bN +
  • 20. Bilinear Transform Method  Practical example of the bilinear transform method:  The design of a digital filter to approximate a second order low-pass analogue filter is required.  The transfer function that describes the analogue filter is (This is an analog BUTTERWORTH filter): 1 H s s2 2s 1  The digital filter is required to have:  Cut-off frequency =100 Hz  Sampling frequency of 1 kHz.
  • 21. Example: Design of a LP filter design using Bilinear Transformation Design a digital equivalent of a 2nd order Butterworth LP filter with a cut-off freq fc=100 Hz Sampling frequency fs=1000 Hz. The normalized cut off frequency of the digital filter ω=2πfc/fs=2πfc 100/1000=0.628 Now equivalent analog filter cut-off freq Ω=ktan(ω/2)= 1.tan(0.628/2)=0.325 rads/sec
  • 22. Design of a LP filter design using Bilinear Transformation ..continued H(s) for a Butterworth filter 1 H ( s) s2 2s 1 Now the transfer function of this Butterworth filter becomes (putting s=s/Ω) 1 H ( s) s 2 s 2 1 0.325 0.325
  • 23. Design of a LP filter design using Bilinear Transformation ..continued Now convert the analog filter H(s) into equivalent digital filter H(z) by applying the bilinear z-transform- 1 z 1 1 z s 1 z 1 1 z 1 H ( z) 1 1 z 1 2 2 1 z 1 1 0.3252 1 z 1 0.325 1 z 1 0.067 0.135z 1 0.067 z 2 1 1.1429 z 1 0.4127 z 2
  • 24. Design of a LP filter design using Bilinear Transformation ..continued From the previous we get the filter coefficients- {bk}Coefficients {ak}coefficients b0=0.067 a1= -1.1429 b1=0.0135 a2=0.4127 b2=0.067 The time domain difference equation is obtained y(n) b(0) x(n) b(1) x(n 1) b(2) x(n 2)  a(1) y(n 1) a(2) y(n 2) 0.67 x(n) 0.135x(n 1) 0.67 x(n) 1.1429 y(n 1) 0.4127 y(n 2)
  • 25. Direct realization of the design x(n) y(n) b0 + + b0=0.067 z-1 z-1 b + + a 1 1 b1=0.135 a1=1.1429 z-1 z-1 b a 2 2 b2=0.067 a2= -0.4127
  • 26. Matlab Code for the BZT Method clear all fc=100;fs=1000; wp=2*pi*fc*(1/fs); OmegaP=2*fs*tan(wp/2); Omega=tan(wp/2); Hs_den1=[(1/Omega)^2,((2^0.5)/Omega),1]; Hs_den=[(1/OmegaP)^2,((2^0.5)/OmegaP),1]; Hs_num=1; Hs_denN=Hs_den/Hs_den(1); Hs_numN=Hs_num/Hs_den(1); [b,a]=bilinear(Hs_numN,Hs_denN,fs); freqz(b,a,fs)
  • 27. Infinite Impulse Response (IIR) Filters - End -