FIR Filter Design_new

Embed Size (px)

Citation preview

  • 7/31/2019 FIR Filter Design_new

    1/21

    op cs:

    1. Linear Phase FIR Digital Filter.

    Introduction

    2. Linear-Phase FIR Digital Filter Design:n ow n ow ng e o

    1

    op c:

    .

    advanta es and disadvanta es of linear hase FIR di ital

    filters,

    linear phase conditions for FIR filters,

    four groups/kinds of linear phase FIR digital filters.

    2

    op c:

    -Window (Windowing) Method

    basic principles and algorithms,

    method description in time- and frequency-domain,

    Example A.: FIR filter design-rectangular window application,

    Gibbs phenomenon and different windowing applications,

    Example B.: FIR filter design at different window

    applications.

    3

    Special operations

    Differentiation:( )

    ( )dx t

    y tdt

    = ( ) ( )Y j j X j =

    Integration:

    ( ) ( )y t x d

    =

    ( ) ( ) (0) ( )Y j X j X j

    = +

    4

  • 7/31/2019 FIR Filter Design_new

    2/21

    Digital Filter Design

    Objective - Determination of a realizabletrans er unct on z approx mat ng a g venfrequency response specification.

    Digital filter design is the process of derivingthe transfer function G(z).

    Two possibilities: IIR or FIR.

    ,

    stable real rational function

    5

    Digital Filter Specifications

    The magnitude and/or the phase (delay)response is specified for the design of a

    di ital filter for most a lications

    In most practical applications, the problem

    v z

    approximation to a given magnituderesponse specification

    6

    Digital Filter Specifications

    approximation problem

    magnitude responses as shown belowj

    1

    LP e

    1

    HP e

    0 cc 0 cc H j

    11

    BP (e )

    1

    7 c1 c1c2 c2 c1 c1c2 c2

    Digital Filter Specifications

    As the im ulse res onse corres ondin to

    each of these ideal filters is noncausal and

    ,

    realizable

    In practice, the magnitu e response

    specifications of a digital filter in the

    passband and in the stopband are given with

    In addition, a transition band is specified

    8

    etween t e pass an an stop an

  • 7/31/2019 FIR Filter Design_new

    3/21

    Digital Filter Specifications

    For exam le, the ma nitude res onse| |j

    G e

    of adigital lowpass filter may be given as

    9

    Digital Filter Specifications

    As indicated in the figure, in thepassband,

    defined by , we require that

    with an error i.e.1jeG

    p0

    jeG + ,1)(1

    require that with an error ,0)( jeG

    s

    s

    . .,

    ssj

    eG ,)(

    10

    Digital Filter Specifications

    -

    - stopband edge frequency

    p

    s

    - peak ripple value in thepassbandp-

    is a periodic function of and thes

    )( j

    eG

    magnitude response of a real-coefficient

    di ital filter is an even function of

    As a result, filter specifications are given

    11

    on y or e requency range

    .

    response of ideal filters is linear:

    0( ) t =

    B. Comments on group delay function: Group delayfunction of ideal filters is constant:

    ( )d d = = = =0 0 .

    d d

    C. Note: It will be proved for linear phase FIR filters:

    12

    02

    t =

  • 7/31/2019 FIR Filter Design_new

    4/21

    - -

    response is identically a positive constant ( )( ) .jH e const =

    . -

    is not restricted and is allowed to vary arbitrarily as a.

    In general, a rational filter is all-pass if only if it has the

    same number of poles and zeros (including multiplicities),

    and each zero is the conjugate inverse of a corresponding

    pole:zk=1/pk.

    Example:1

    0.8( )

    1 0.8

    zH z

    z

    =

    1 0.8p =1 1/0.8z =

    131 11/ 0.8 1/ z p= =

    Linear Phase FIR Digital Filter.Introduction

    14

    g a er as a n e num er o non-zero

    coefficients of its impulse response:

    : ( ) 0M N h n for n M = >

    Mathematical model of a causal FIR digital filter:

    1

    0

    ( ) ( ) ( )M

    k

    y n h k x n k

    =

    =

    Digital FIR filters cannot be derived from analogue

    filters, since causal analogue filters cannot have a finiteimpulse response. In many digital signal processing

    15applications, FIR filters are preferred over their IIR

    counterparts.

    FIR filters with exactly linear phase can be easilydesigned. This simplifies the approximation problem,

    in many cases, when one is only interested in designing

    of a filter that approximates an arbitrary magnituderesponse. Linear phase filters are important for

    applications where frequency dispersion due to

    nonlinear phase is harmful (e.g. speech processing and

    data transmission).

    implementing FIR filters. These include both non-

    16

    .

  • 7/31/2019 FIR Filter Design_new

    5/21

    FIR filters realized non-recursively are inherentlystable and free of limit cycle oscillations when

    implemented on a finite-word length digital system.

    The output noise due to multiplication round off

    sensitivity to variations in the filter coefficients is

    .

    Excellent design methods are available for variouskinds of FIR filters with arbitrary specifications.

    17

    The relative com utational com lexit of FIR filter ishigher than that of IIR filters. This situation can be

    met es eciall in a lications demandin narrowtransition bands or if it is required to approximate sharp

    cut off fre uenc . The cost of im lementation of an FIR

    filter can be reduced e.g. by using multiplier-efficient

    realizations, fast convolution al orithms and multirate

    filtering.

    e group e ay unc on o near p ase ers

    need not always be an integer number of samples.

    18

    Frequency Response of Linear Phase FIR Digital

    Filters

    FIR filter of length M:

    1Mk

    1M

    0k

    e e=

    =0k

    y n x n=

    =

    19

    The linear phase condition is obtained by imposing

    symmetry conditions on the impulse response of the

    filter. In particular, we consider two different symmetry

    conditions for h(k):

    ( ) ( 1 ) 0,1,2, , 1h k h M k for k M = = K

    .

    B. Antisymmetrical impulse response:

    ( ) ( 1 ) 0,1,2, , 1h k h M k for k M = = K

    The length of the impulse response of the FIR filter(M) can be even or odd. Then, the four cases of linear

    20phase FIR filters can be obtained.

  • 7/31/2019 FIR Filter Design_new

    6/21

    Symmetrical Impulse Response, M: Even

    =7 = 8

    =

    =

    =

    21n

    Example: M=4 (even), symmetrical impulse response

    1 4 1 3 0,1,2,3M k = = =

    (0) (3) (1) (2)h h h h= =

    1 1 1 22 2 2 2

    = = = =

    , , , , K

    (0) ( 1), (1) ( 2), (2) ( 3), ,h h M h h M h h M = = = K

    1M M

    h h

    =

    22

    1 4 1 3

    0 0 0

    ( ) ( ) ( ) ( )M

    j j k j k j k

    k k k

    H e h k e h k e h k e

    = = =

    = = =

    0 1 2 30 1 2 3j j j j jH e h e h e h e h e = + + + =

    0 3 1 2j j j j

    1

    0

    ( ) j k

    k

    h k e e

    =

    = + =

    ( )

    12

    1

    M

    j M kj k

    = =23

    .0k=

    .

    11 2

    1

    M

    MM kk k

    0 0k k

    e e e e= =

    = = + =

    11 2 22

    22 ( )

    M j k j kM

    j e ee h k

    +

    =

    1M

    0k=

    2

    0

    1( ) 2 ( )cos

    2

    jj

    k

    H e e h k k

    =

    =

    Here, the real-valued frequency response is given by

    12 1

    ( ) 2 ( )cos

    M

    MH h k k

    =

    240 2k=

  • 7/31/2019 FIR Filter Design_new

    7/21

    1

    2( ) ( )M

    jj

    H e e H

    =1

    2( ) ( ) 0M

    j

    H e for H

    1

    2 0

    Mj

    H e or H

    +

    =

    g(0)=f(-7)

    =-

    63n

    Example: Magnitude Response

    =

    xamp e: ase esponse

    ( )

    0

    =

    64

  • 7/31/2019 FIR Filter Design_new

    17/21

    Gibbs Phenomenon and Different Windowing

    Direct truncation of impulse response leads to well known

    .

    It manifests itself as a fixed percentage overshoot and ripple

    e ore an a er scon nu y n e requency response.

    E.g. standard filters, the largest ripple in the frequency

    response is about 18% of the size of discontinuity and its

    amplitude does not decrease with increasing impulse response

    . .

    series does not decrease the amplitude of the largest ripple.

    ns ea , e overs oo s con ne o a sma er an sma er

    frequency range as is increased.

    65

    Example: Gibbs phenomenon illustration

    -

    FIR low-pass digital filters with normalized cut off

    =, , , , .confirm the above given statements concerning the

    .

    66

    Low-Pass FIR Filter: Rectangular Window Applicationj5N= =

    j

    / 2 / 2

    jG e

    jG e

    100N=50N=

    67 / 2 / 2

    The major effect is that discontinuities of became( )jH e

    transition bands between values on the either side of the

    discontinuity. Since the final frequency response of the

    filter is the circular convolution of the ideal frequencyresponse with the windows frequency response

    *j j j

    on the width of the main (central) lobe of .( )jW e

    68

  • 7/31/2019 FIR Filter Design_new

    18/21

    from the side lobes produces a ripple in the resulting

    .

    a) Small width of the main lobe of the frequency

    response of the window containing as much the total

    energy as possible.

    b) Side lobes of the frequency response that decrease in

    69

    .

    Some Commonly Used Windows

    1

    2

    MN

    =

    ( )w n R for N n N ( ) 0w n for n N = >

    n

    1N

    +ec angu ar: =

    Hann: ( ) 1 cos2 2 1

    w nN

    = +

    Hamming: ( ) 0.54 0.46cos2 1

    nw n

    N

    =

    +

    70Blackmann:2 4

    ( ) 0.42 0.5cos 0.08cos2 1 2 1

    n nw n

    N N

    = +

    + +

    Properties of Commonly Used Windows

    Rectangular Bart let t ( t r iangular)

    =

    otherwise

    nnw

    ,0

    ,,][

    = MnMMnnw 2/,/22

    ,

    ][

    otherwise,0Hanning Hamming

    71

    =

    otherwisenw

    ,0

    ,..][

    =

    otherwise

    MnMnnw

    ,0

    0),/2cos(46.054.0][

    Windows Magnitude of Frequency

    Response

    Window Based Design

  • 7/31/2019 FIR Filter Design_new

    19/21

    Summary of Windows

    Characteristics

    We see clearly that a wider transition region (wider main-

    lobe) is compensated by much lower side-lobes and thus less

    ripples.

    Window Based DesignGiven specifications: p,, 21 an s

    We employ the following procedure

    1. Compute

    = ),min( 21

    sp =

    Choose M, the filter order, to meet transition

    10og

    width

    are given by[ ] [ ] [ ], 0

    dh n h n w n n M =

    =74

    ,c p s

    Window type Window length

    = .

    Hanning M= 3.1/ f

    Hamming M= 3.3/ f

    Blackman M=5.5/ f

    Kaiser Window

    1 21

    2nI

    2/,0,)(

    ][0

    MMnI

    nw ==

    is zeroth order modified Bessel function of theFirst Kind

    (.)0I

    2

    )5(.)(

    =m

    xxI

    controls sidelobe level (Stopband Attenuation)

    =m

    The filter or er M controls the Mainlo e wi th

    76

  • 7/31/2019 FIR Filter Design_new

    20/21

    Desi n Method: define

    ps =

    ),min(,log20 2110 == whereA

    > 50,)7.8(1102. AA

    += 5021),21(07886.)21(5842.4.0

    AAA

    8

    ,

    A

    77=

    285.2M

    78

    Normalized frequency ( )

    79

    Exam le:

    By the windowing method, design a low-pass filter of

    or er = w pass- an cu o requency .

    Frequency sampling is .0 z=

    4Sf kHz=

    .

    80

    Example:FIR Filter Design by Windowing Method

    Example:FIR Filter Design by Windowing Method

  • 7/31/2019 FIR Filter Design_new

    21/21

    * j

    =10

    [dB]

    Bartlett Window

    Rectangular Window

    Hamming Window

    81

    * j

    10

    Kaiser Window: alfa=3

    Kaiser Window: alfa=10

    a ser n ow: a a=

    =

    82