fir and iir filter asdsa

Upload: kishorereddy-reddy

Post on 03-Jun-2018

240 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 FIR and IIR Filter asdsa

    1/55

    Feb.2008 DISP Lab 1

    FIR and IIR Filter DesignTechniques

    FIR IIR Speaker: Wen-Fu Wang

    Advisor: Jian-Jiun Ding

    E-mail: [email protected] Graduate Institute of Communication Engineering

    National Taiwan University, Taipei, Taiwan, ROC

  • 8/12/2019 FIR and IIR Filter asdsa

    2/55

    Feb.2008 DISP Lab 2

    Outline

    Introduction

    IIR Filter Design by Impulseinvariance method

    IIR Filter Design by Bilineartransformation method

    FIR Filter Design by Window functiontechnique

  • 8/12/2019 FIR and IIR Filter asdsa

    3/55

    Feb.2008 DISP Lab 3

    Outline

    FIR Filter Design by Frequency

    sampling technique FIR Filter Design by MSE

    Conclusions

    References

  • 8/12/2019 FIR and IIR Filter asdsa

    4/55

  • 8/12/2019 FIR and IIR Filter asdsa

    5/55

    Feb.2008 DISP Lab 5

    Introduction

    IIR is the infinite impulse responseabbreviation.

    Digital filters by the accumulator, themultiplier, and it constitutes IIR filterthe way, generally may divide intothree kinds, respectively is Direct

    form, Cascade form, and Parallelform.

  • 8/12/2019 FIR and IIR Filter asdsa

    6/55

    Feb.2008 DISP Lab 6

    Introduction

    IIR filter design methods include theimpulse invariance, bilineartransformation, and step invariance.

    We must emphasize at impulseinvariance and bilineartransformation.

  • 8/12/2019 FIR and IIR Filter asdsa

    7/55

    Feb.2008 DISP Lab 7

    Introduction

    IIR filter design methods

    Continuous frequency

    band transformation

    ImpulseInvariance

    method

    Bilineartransformation

    method

    Step invariancemethod

    IIR filter

    Normalized analog

    lowpass filter

  • 8/12/2019 FIR and IIR Filter asdsa

    8/55

    Feb.2008 DISP Lab 8

    Introduction

    The structures of IIR filter

    Direct

    form 1

    Direct form2

    b0

    b1

    b2 b2

    b1

    b0

    -a1

    -a2

    -a1

    -a2

    x(n) x(n)Y(n) Y(n)

    1z

    1z

    1z

    1z

    1z

    1z

  • 8/12/2019 FIR and IIR Filter asdsa

    9/55

    Feb.2008 DISP Lab 9

    Introduction

    The structures of IIR filter

    Cascade form

    x(n) Y(n)b0

    b1

    b2

    -a1

    -a2

    -c1

    -c2

    d1

    d2

    Parallel form

    Y(n)x(n)

    b1

    b0

    d1

    d0

    E

    -c1

    -c2

    -a1

    -a2

    1z

    1z

    1z

    1z

    1z

    1z

    1z

    1z

  • 8/12/2019 FIR and IIR Filter asdsa

    10/55

    Feb.2008 DISP Lab 10

    Introduction

    FIR is the finite impulse responseabbreviation, because its designconstruction has not returned to thepart which gives.

    Its construction generally uses Directform and Cascade form.

  • 8/12/2019 FIR and IIR Filter asdsa

    11/55

    Feb.2008 DISP Lab 11

    Introduction

    FIR filter design methods include thewindow function, frequency sampling,minimize the maximal error, and MSE.

    We must emphasize at window function,frequency sampling, and MSE.

    Window function

    technique

    Frequency

    sampling technique

    Minimize the

    maximal error

    FIR filter

    Mean square

    error

  • 8/12/2019 FIR and IIR Filter asdsa

    12/55

    Feb.2008 DISP Lab 12

    Introduction

    The structures of FIR filter

    x(n) x(n)

    b1

    b2

    b3

    b4

    b0Y(n) Y(n)

    Direct form Cascade form

    b1

    b2

    d1

    d2

    b0

    1z

    1z

    1z

    1z

    1z

    1z

    1z

    1z

  • 8/12/2019 FIR and IIR Filter asdsa

    13/55

    Feb.2008 DISP Lab 13

    IIR Filter Design by Impulseinvariance method

    The most straightforward of these isthe impulse invariance transformation

    Let be the impulse responsecorresponding to , and define thecontinuous to discrete timetransformation by setting

    We sample the continuous timeimpulse response to produce thediscrete time filter

    ( )ch t ( )cH s

    ( ) ( )c

    h n h nT

  • 8/12/2019 FIR and IIR Filter asdsa

    14/55

  • 8/12/2019 FIR and IIR Filter asdsa

    15/55

    Feb.2008 DISP Lab 15

    IIR Filter Design by Impulseinvariance method

    The system function is

    It is the many-to-one transformationfrom the s plane to the z plane.

    1 2( ) | )sT cz e

    k

    H z H s jk

    T T

  • 8/12/2019 FIR and IIR Filter asdsa

    16/55

    Feb.2008 DISP Lab 16

    IIR Filter Design by Impulseinvariance method

    The impulse invariancetransformation does map the -axisand the left-half s plane into the unitcircle and its interior, respectively

    j

    Re(Z)

    Im(Z)

    1

    S domain Z domain

    sTe

    j

  • 8/12/2019 FIR and IIR Filter asdsa

    17/55

  • 8/12/2019 FIR and IIR Filter asdsa

    18/55

    Feb.2008 DISP Lab 18

    IIR Filter Design by Impulseinvariance method

    The Butterworth and Chebyshev-Ilowpass designs are more appropriatefor impulse invariant transformationthan are the Chebyshev-II and ellipticdesigns.

    This transformation cannot be applied

    directly to highpass and bandstopdesigns.

  • 8/12/2019 FIR and IIR Filter asdsa

    19/55

    Feb.2008 DISP Lab 19

    IIR Filter Design by Impulseinvariance method

    is expanded a partial fractionexpansion to produce

    We have assumed that there are nomultiple poles

    And thus

    ( )c

    H s

    1

    ( )N

    kc

    k k

    AH s

    s s

    1

    ( ) ( )kN

    s t

    c kk

    h t A e u t

    1( ) ( )k

    Ns nT

    kkh n A e u n

    11

    ( )1 k

    Nk

    s Tk

    AH z

    e z

  • 8/12/2019 FIR and IIR Filter asdsa

    20/55

    Feb.2008 DISP Lab 20

    IIR Filter Design by Impulseinvariance method

    Example:

    Expanding in a partial fractionexpansion, it produce

    The impulse invariant transformationyields a discrete time design with the

    system function

    2 2( )

    ( )c

    s aH s

    s a b

    1/ 2 1/ 2( )cH s

    s a jb s a jb

    ( ) 1 ( ) 1

    1/ 2 1/ 2( )

    1 1a jb T a jb T H z

    e z e z

  • 8/12/2019 FIR and IIR Filter asdsa

    21/55

    Feb.2008 DISP Lab 21

    IIR Filter Design by Bilineartransformation method

    The most generally useful is the

    bilinear transformation.

    To avoid aliasing of the frequencyresponse as encountered with theimpulse invariance transformation.

    We need a one-to-one mapping from

    the splane to thezplane. The problem with the transformation

    is many-to-one.sTz e

  • 8/12/2019 FIR and IIR Filter asdsa

    22/55

  • 8/12/2019 FIR and IIR Filter asdsa

    23/55

  • 8/12/2019 FIR and IIR Filter asdsa

    24/55

    Feb.2008 DISP Lab 24

    IIR Filter Design by Bilineartransformation method

    The axis is compressed into theinterval for in a one-to-one method

    The relationship between andis nonlinear, but it is approximatelylinear at small .

    ( , )T T

    '

    '

    '

    -

    '/ T

    / T

  • 8/12/2019 FIR and IIR Filter asdsa

    25/55

    Feb.2008 DISP Lab 25

    IIR Filter Design by Bilineartransformation method

    The desired transformation to isnow obtained by invertingto produce

    And setting , which yields

    12' tanh ( )2

    sTs

    T

    2 '

    tanh( )2

    s Ts

    T

    s z

    1' ( ) lns z

    T

    2 lntanh( )

    2

    zs

    T

    1

    12 1( )

    1z

    T z

    Re(Z)

    Im(Z)

    1

    S domain Z domain

    12

    12

    Ts

    zT

    s

    j

  • 8/12/2019 FIR and IIR Filter asdsa

    26/55

    Feb.2008 DISP Lab 26

    IIR Filter Design by Bilineartransformation method

    The discrete-time filter design isobtained from the continuous-timedesign by means of the bilinear

    transformation

    Unlike the impulse invarianttransformation, the bilineartransformation is one-to-one, andinvertible.

    1 1(2/ )(1 )/(1 )( ) ( ) |c s T z z H z H s

  • 8/12/2019 FIR and IIR Filter asdsa

    27/55

    Feb.2008 DISP Lab 27

    FIR Filter Design by Windowfunction technique

    Simplest FIR the filter design iswindow function technique

    A supposition ideal frequencyresponse may express

    where

    ( ) [ ]j j nd dn

    H e h n e

    1[ ] ( )

    2

    j j n

    d dh n H e e d

  • 8/12/2019 FIR and IIR Filter asdsa

    28/55

    Feb.2008 DISP Lab 28

    FIR Filter Design by Windowfunction technique

    To get this kind of systematic causalFIR to be approximate, the mostdirect method intercepts its idealimpulse response!

    [ ] [ ] [ ]dh n w n h n

    ( ) ( ) ( )dH W H

  • 8/12/2019 FIR and IIR Filter asdsa

    29/55

  • 8/12/2019 FIR and IIR Filter asdsa

    30/55

    Feb.2008 DISP Lab 30

    FIR Filter Design by Windowfunction technique

    1.Rectangular window

    2.Triangular window (Bartett window)

    1, 0[ ]

    0,

    n Mw n

    otherwise

    2 , 02

    2[ ] 2 ,2

    0,

    n MnM

    n Mw n n M M

    otherwise

  • 8/12/2019 FIR and IIR Filter asdsa

    31/55

    Feb.2008 DISP Lab 31

    FIR Filter Design by Windowfunction technique

    1.Rectangular window

    2.Triangular window (Bartett window)

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Rectangular window

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Bartlett window

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT

    (jw)(dB) Rectangular window

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT(jw)(dB) Bartlett window

  • 8/12/2019 FIR and IIR Filter asdsa

    32/55

    Feb.2008 DISP Lab 32

    FIR Filter Design by Windowfunction technique

    3.HANN window

    4.Hamming window

    1 21 cos , 0

    [ ] 2

    0,

    nn M

    w n M

    otherwise

    20.54 0.46cos , 0

    [ ]0,

    nn M

    w n Motherwise

  • 8/12/2019 FIR and IIR Filter asdsa

    33/55

    Feb.2008 DISP Lab 33

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT

    (jw)(dB) Hanning window

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT(jw)(dB) Hamming window

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Hanning window

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Hamming window

    FIR Filter Design by Windowfunction technique

    3.HANN window

    4.Hamming window

  • 8/12/2019 FIR and IIR Filter asdsa

    34/55

    Feb.2008 DISP Lab 34

    FIR Filter Design by Windowfunction technique

    5.Kaisers window

    6.Blackman window

    2

    0

    0

    2[ 1 (1 ) ]

    [ ] , 0,1,...,

    [ ]

    nI

    Mw n n M

    I

    2 40.42 0.5cos 0.08cos , 0

    [ ]0,

    n nn M

    w n M Motherwise

  • 8/12/2019 FIR and IIR Filter asdsa

    35/55

    Feb.2008 DISP Lab 35

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT

    (jw)(dB) Blackman window

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-150

    -100

    -50

    0

    50

    100

    pi unitsFrequencyresponseT(

    jw)(dB) Kaiser window

    5.Kaisers window

    6.Blackman window

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Blackman window

    0 10 20 30 40 50 600

    0.5

    1

    sequence (n)

    T(n)

    Kaiser window

    FIR Filter Design by Windowfunction technique

  • 8/12/2019 FIR and IIR Filter asdsa

    36/55

    Feb.2008 DISP Lab 36

    FIR Filter Design by Windowfunction technique

    ( / )s

    M

    Window Peak sidelobe level(dB)

    Transitionbandwidth

    Max. stopband

    ripple(dB)

    Rectangular -13 0.9 -21

    Hann -31 3.1 -44

    Hamming -41 3.3 -53

    Blackman -57 5.5 -74

  • 8/12/2019 FIR and IIR Filter asdsa

    37/55

    Feb.2008 DISP Lab 37

    FIR Filter Design by Frequencysampling technique

    For arbitrary, non-classicalspecifications of , the calculation

    of ,n=0,1,,M, via an appropriate

    approximation can be a substantialcomputation task.

    It may be preferable to employ adesign technique that utilizesspecified values of directly,without the necessity of determining

    ' ( )dH

    ( )dh n

    ' ( )dH

    ( )dh n

  • 8/12/2019 FIR and IIR Filter asdsa

    38/55

    Feb.2008 DISP Lab 38

    FIR Filter Design by Frequencysampling technique

    We wish to derive a linear phase IIRfilter with real nonzero . Theimpulse response must be symmetric

    where are real and denotesthe integer part

    ( )h n

    [ /2]

    0

    1

    2 ( 1/ 2)( ) 2 cos( )

    1

    M

    k

    k

    k nh n A A

    M

    kA [ / 2]M

    0,1,...,n M

  • 8/12/2019 FIR and IIR Filter asdsa

    39/55

    Feb.2008 DISP Lab 39

    FIR Filter Design by Frequencysampling technique

    It can be rewritten as

    where and

    Therefore, it may write

    where

    1/ 2 /

    0

    / 2

    ( )N

    j k N j kn N

    k

    k

    k N

    h n A e e

    0,1,..., 1n N

    1N M k N k

    A A

    / 2 /( ) j k N j kn N k kh n A e e

    1

    0/ 2

    ( ) ( )N

    kkk N

    h n h n

    0,1,..., 1n N

  • 8/12/2019 FIR and IIR Filter asdsa

    40/55

    Feb.2008 DISP Lab 40

    FIR Filter Design by Frequencysampling technique

    with corresponding transform

    where

    Hencewhich has a linear phase

    1

    0

    /2

    ( ) ( )N

    k

    k

    k N

    H z H z

    /

    2 / 1

    (1 )( )

    1

    j k N N

    kk j k N

    A e zH z

    e z

    ' ( 1)/2 sin / 2

    ( ) sin[( / / 2)]

    j T N

    k k

    TN

    H A e k N T

  • 8/12/2019 FIR and IIR Filter asdsa

    41/55

    Feb.2008 DISP Lab 41

    FIR Filter Design by Frequencysampling technique

    The magnitude response

    which has a maximum value

    at where

    ' sin / 2( )sin[( / / 2)]

    k k

    TNH A

    k N T

    kN A

    /k sk N 2 /s T

  • 8/12/2019 FIR and IIR Filter asdsa

    42/55

    Feb.2008 DISP Lab 42

    FIR Filter Design by Frequencysampling technique

    The only nonzero contribution toat is from , and hencethat

    Therefore, by specifying the DFTsamples of the desired magnitude

    response at the frequencies ,

    and setting

    '( )H

    k ' ( )kH

    '( )k kH N A

    ' ( )dH k

    ' ( ) /k d kA H N

  • 8/12/2019 FIR and IIR Filter asdsa

    43/55

    Feb.2008 DISP Lab 43

    FIR Filter Design by Frequencysampling technique

    We produce a filter design fromequation (5.1) for which

    The desired and actual magnituderesponses are equal at the Nfrequencies

    '

    '( ) ( )k d kH H

    k

  • 8/12/2019 FIR and IIR Filter asdsa

    44/55

    Feb.2008 DISP Lab 44

    FIR Filter Design by Frequencysampling technique

    In between these frequencies, isinterpolated as the sum of theresponses , and its magnitude

    does not, equal that of

    '( )H

    ' ( )kH

    ' ( )dH

  • 8/12/2019 FIR and IIR Filter asdsa

    45/55

    Feb.2008 DISP Lab 45

    FIR Filter Design by Frequencysampling technique

    Example: For an ideal lowpass filter

    from , we wouldchoose

    The frequency samples areindeed equal to the desired

    ' 1, 0,1,...,

    ( )0, 1,...,[ / 2]

    d k

    k PH

    k P M

    ' ( ) /k d kA H N

    ( 1) / ( 1), 0,1,...,

    0, 1,...,[ / 2]

    k

    k

    M k PA

    k P M

    ' ( )k

    H

    ' ( )d kH

  • 8/12/2019 FIR and IIR Filter asdsa

    46/55

    Feb.2008 DISP Lab 46

    FIR Filter Design by Frequencysampling technique

    The response is very similar to theresult form using the rectangularwindow, and the stopband is similarly

    disappointing.

    We can try to search for the optimumvalue of the transition sample would

    quickly lead us to a value ofapproximately , k p0.38( 1) /( 1)ppA M

  • 8/12/2019 FIR and IIR Filter asdsa

    47/55

    Feb.2008 DISP Lab 47

    FIR Filter Design by MSE

    : The spectrum of the filter weobtain

    : The spectrum of the desiredfilter

    MSE=

    ( )H f

    ( )dH f

    2/

    2/

    21 s

    s

    f

    f ds dffHfHf

    0 0.1 0.2 0.3 0.4 0.5-0.5

    0

    0.5

    1

    1.5

  • 8/12/2019 FIR and IIR Filter asdsa

    48/55

    Feb.2008 DISP Lab 48

    FIR Filter Design by MSE

    Larger MSE, but smaller maximalerror

    Smaller MSE, but larger maximalerror

    0 0.1 0.2 0.3 0.4-0.5

    0

    0.5

    1

    1.5

    0 0.1 0.2 0.3 0.4-0.5

    0

    0.5

    H(F) H(F) - H (F)d

    0 0.1 0.2 0.3 0.4-0.5

    0

    0.5

    1

    1.5

    0 0.1 0.2 0.3 0.4-0.5

    0

    0.5

    H(F)H(F) - H (F)

    d

  • 8/12/2019 FIR and IIR Filter asdsa

    49/55

  • 8/12/2019 FIR and IIR Filter asdsa

    50/55

    Feb.2008 DISP Lab 50

    FIR Filter Design by MSE

    2. when n,

    when n= , n0,

    when n= , n= 0,

    3. The formula can be repressed as:

    02cos2cos2/1

    2/1 dFFFn

    2/12cos2cos2/1

    2/1 dFFFn

    12cos2cos2/1 2/1 dFFFn

    dFFHdFFHFnnsnssMSE ddk

    n

    k

    n 2/1

    2/12

    2/1

    2/101

    22 2cos][22/][]0[

  • 8/12/2019 FIR and IIR Filter asdsa

    51/55

    Feb.2008 DISP Lab 51

    FIR Filter Design by MSE

    4. Doing the partial differentiation:

    5. Minimize MSE: for all ns

    2/1

    2/12]0[2

    ]0[dFFHs

    s

    MSEd

    2/12/1

    2cos2][][

    dFFHFnnsns

    MSEd

    0][

    ns

    MSE

    2/1

    2/1]0[ dFFHs d

    2/1

    2/12cos2][ dFFHFnns d

    [ ] [0]

    [ ] [ ]/ 2 for n=1,2,...,k

    [ ] [ ]/ 2 for n=1,2,...,k

    [ ] 0 for n

  • 8/12/2019 FIR and IIR Filter asdsa

    52/55

    Feb.2008 DISP Lab 52

    Conclusions

    FIR advantage:

    1. Finite impulse response

    2. It is easy to optimalize3. Linear phase

    4. Stable

    FIR disadvantage:1. It is hard to implementation than IIR

  • 8/12/2019 FIR and IIR Filter asdsa

    53/55

    Feb.2008 DISP Lab 53

    Conclusions

    IIR advantage:

    1. It is easy to design

    2. It is easy to implementation IIR disadvantage:

    1. Infinite impulse response

    2. It is hard to optimalize than FIR3. Non-stable

  • 8/12/2019 FIR and IIR Filter asdsa

    54/55

    Feb.2008 DISP Lab 54

    References

    [1]B. Jackson, Digital Filters and Signal

    Processing, Kluwer Academic Publishers 1986 [2]Dr. DePiero, Filter Design by Frequency

    Sampling, CalPoly State University

    [3]W.James MacLean, FIR Filter DesignUsing Frequency Sampling

    [4],

    ,

    2005 [5]Maurice G.Bellanger, Adaptive Digital

    Filters second edition, Marcel dekker 2001

  • 8/12/2019 FIR and IIR Filter asdsa

    55/55

    Feb 2008 DISP Lab 55

    References

    [6] Lawrence R. Rabiner, Linear ProgramDesign of Finite Impulse Response DigitalFilters, IEEE 1972

    [7] Terrence J mc Creary, On FrequencySampling Digital Filters, IEEE 1972