fir filters-window method

Upload: sachin-b

Post on 04-Jun-2018

249 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 FIR Filters-Window Method

    1/59

    Part 1: FIR Filters Window Method

    Tutorial ISCAS 2007

    Copyright 2007 Andreas AntoniouVictoria, BC, Canada

    Email: [email protected]

    July 24, 2007

    Frame # 1 Slide # 1 A. Antoniou Part 1: FIR Filters Window Method

    http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    2/59

    Fourier Series Method

    A simple method for the design of FIR filters is through the

    use of the Fourier series in conjunction with the application

    of a class of functions known as window functions.

    Arbitrary specifications can be achieved by using a method

    proposed by Kaiser.

    Note: The material for this module is taken from Antoniou,Digital Signal Processing: Signals, Systems, and Filters

    Chap. 9.)

    Frame # 2 Slide # 2 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    3/59

    Fourier Series Method

    A fundamental property of digital filters in general is that

    they have a periodic frequency response with period equal

    to the sampling frequency s, i.e.,

    H(ej(+ks)T) =H(ejT)

    Therefore, an arbitrary desired frequency response,

    H(ejT), can be represented by a Fourier series as

    H(ejT) =

    n=h(nT)ejnT (A)

    where h(nT) = 1

    s

    s/2

    s/2

    H(ejT)ejnT d

    are the Fourier series coefficients.

    Frame # 3 Slide # 3 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    4/59

    Fourier Series Method Contd

    H(e

    jT)=

    n=

    h(nT)ejnT

    (A)

    If we letejT =zin Eq. (A), we get

    H(z)=

    n=

    h(nT)zn

    This is the transfer function of an FIR filter with impulse

    responseh(nT).

    Frame # 4 Slide # 4 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    5/59

    Fourier Series Method Contd

    Since the Fourier series coefficients are defined over the range

  • 8/13/2019 FIR Filters-Window Method

    6/59

    Fourier Series Method Contd

    Since the Fourier series coefficients are defined over the range

  • 8/13/2019 FIR Filters-Window Method

    7/59

    Fourier Series Method Contd

    A finite filter length can be achieved by truncating the

    impulse response such that

    h(nT) =0 for |n|>M

    whereM =(N 1)/2.

    Frame # 6 Slide # 7 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    8/59

    Fourier Series Method Contd

    A finite filter length can be achieved by truncating the

    impulse response such that

    h(nT) =0 for |n|>M

    whereM =(N 1)/2.

    On the other hand, a causal filter can be obtained bydelaying the impulse response by a periodMTseconds or

    byMsampling periods.

    Frame # 6 Slide # 8 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    9/59

    Fourier Series Method Contd

    Since delaying the impulse response by Msampling

    periods amounts to multiplying the transfer function byzM,

    the transfer function of the causal filter assumes the form

    H(z) =zMM

    n=M

    h(nT)zn

    Frame # 7 Slide # 9 A. Antoniou Part 1: FIR Filters Window Method

    http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    10/59

    Fourier Series Method Contd

    Since delaying the impulse response by Msampling

    periods amounts to multiplying the transfer function byzM,

    the transfer function of the causal filter assumes the form

    H(z) =zMM

    n=M

    h(nT)zn

    The frequency response of the causal filter is obtained by

    lettingz =ejT in the transfer function, i.e.,

    H(ejT)=ejMTM

    n=M

    h(nT)ejnT

    and since |ejMT| =1, delaying the impulse response by

    Msampling periods does not change the amplitude

    response.

    Frame # 7 Slide # 10 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    11/59

    Example

    Design a lowpass filter with a desired frequency response

    H(ejT)

    1 for || c

    0 for c

  • 8/13/2019 FIR Filters-Window Method

    12/59

    Example Contd

    0 2 4 6 8 1050

    40

    30

    20

    1.0

    0

    1.0

    , rad/s

    Gain,d

    B

    N=11 N=41

    Frame # 9 Slide # 12 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    13/59

    Fourier Series Method Contd

    The amplitude response of the filter (magnitude of the

    frequency response) exhibits oscillations in the passband

    as well as the stopband, which are known as Gibbs

    oscillations. They are caused by the truncation of the

    Fourier series.

    Frame # 10 Slide # 13 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    14/59

    Fourier Series Method Contd

    The amplitude response of the filter (magnitude of the

    frequency response) exhibits oscillations in the passband

    as well as the stopband, which are known as Gibbs

    oscillations. They are caused by the truncation of the

    Fourier series.

    As the filter length is increased, the frequency of the

    oscillations increases but the amplitude stays constant.

    Frame # 10 Slide # 14 A. Antoniou Part 1: FIR Filters Window Method

    F i S i M h d

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    15/59

    Fourier Series Method Contd

    The amplitude response of the filter (magnitude of the

    frequency response) exhibits oscillations in the passband

    as well as the stopband, which are known as Gibbs

    oscillations. They are caused by the truncation of the

    Fourier series.

    As the filter length is increased, the frequency of the

    oscillations increases but the amplitude stays constant.

    In other words, we do not seem to be able to reduce the

    passband and stopband errors below a certain limit by

    increasing the filter length.

    Therefore, the filters that can be designed with the Fourierseries method are of little practical usefulness.

    Frame # 10 Slide # 15 A. Antoniou Part 1: FIR Filters Window Method

    F i S i M th d

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    16/59

    Fourier Series Method Contd

    The standard technique for the reduction of Gibbs

    oscillations is to truncate the infinite-duration impulse

    response,h(nT), through the use of a discrete-time

    window functionw(nT).

    Frame # 11 Slide # 16 A. Antoniou Part 1: FIR Filters Window Method

    F i S i M th d

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    17/59

    Fourier Series Method Contd

    The standard technique for the reduction of Gibbs

    oscillations is to truncate the infinite-duration impulse

    response,h(nT), through the use of a discrete-time

    window functionw(nT).

    If we let

    hw(nT)=w(nT)h(nT)

    then a modified transfer function is obtained as

    Hw(z) = Z[w(nT)h(nT)]

    =1

    2j

    H(v)Wzv v1 dv

    whereH(z)is the original transfer function andW(z)is the

    ztransform of the window function.

    Frame # 11 Slide # 17 A. Antoniou Part 1: FIR Filters Window Method

    F i S i M th d

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    18/59

    Fourier Series Method Contd

    EvaluatingHw(z)on the unit circle z =ejT gives the

    frequency response of the modified filter as

    Hw(ejT)=

    T

    2

    2/T0

    H(ejT)W(ej( )T) d (C)

    W(ejT)is thefrequency spectrumof the window function

    and the integral at the right-hand side is a convolutionintegral.

    Frame # 12 Slide # 18 A. Antoniou Part 1: FIR Filters Window Method

    Window functions

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    19/59

    Window functions

    Frequency spectrum of a typical window:

    0

    , rad/s

    W(ejT

    )

    AML

    Main-lobe width

    Amax

    s/2s/2

    Frame # 13 Slide # 19 A. Antoniou Part 1: FIR Filters Window Method

    Window functions C td

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    20/59

    Window functions Contd

    Windows are characterized by their main-lobe width,BML,

    which is the bandwidth between the first negative and the

    first positive zero crossings, and by their ripple ratio, r,

    which is defined as

    r =100Amax

    AML% or R =20 log

    Amax

    AMLdB

    whereAmaxand AMLare the maximum side-lobe and

    main-lobe amplitudes, respectively.

    Frame # 14 Slide # 20 A. Antoniou Part 1: FIR Filters Window Method

    Window functions C td

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    21/59

    Window functions Contd

    Windows are characterized by their main-lobe width,BML,

    which is the bandwidth between the first negative and the

    first positive zero crossings, and by their ripple ratio, r,

    which is defined as

    r =100Amax

    AML% or R =20 log

    Amax

    AMLdB

    whereAmaxand AMLare the maximum side-lobe and

    main-lobe amplitudes, respectively.

    The main-lobe width and ripple ratio should be as low as

    possible, i.e., the spectral energy of the window should be

    concentrated as far as possible in the main lobe and the

    energy in the side lobes should be as low as possible.

    Frame # 14 Slide # 21 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    22/59

    Window functions Contd

    The way by which Gibbs oscillations can be controlled by

    using a window is illustrated in the next few slides which

    are based on Eq. (C), i.e.,

    Hw(ejT)=

    T

    2 2/T

    0

    H(ejT)W(ej( )T) d (C)

    Frame # 15 Slide # 22 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    23/59

    Window functions Cont d

    The way by which Gibbs oscillations can be controlled by

    using a window is illustrated in the next few slides which

    are based on Eq. (C), i.e.,

    Hw(ejT)=

    T

    2 2/T

    0

    H(ejT)W(ej( )T) d (C)

    Let us consider the application of a generic window in the

    design of a LP filter, assuming that the area under the

    curve in the frequency spectrum of the window is 2/T.

    Frame # 15 Slide # 23 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    24/59

    Window functions Cont d

    1

    c

    H(ejT

    )

    W(ejT

    )

    s

    s/2

    c

    s

    Frequency response of ideal lowpass filter

    Frequency spectrum of window

    Frame # 16 Slide # 24 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    25/59

    Window functions Cont d

    1

    c

    s

    s/2

    s/2

    s/2

    s

    s

    Hw(ejT

    )

    c c

    H(ejT

    )

    W(ej()T

    )

    c

    Frame # 17 Slide # 25 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    26/59

    Window functions Contd

  • 8/13/2019 FIR Filters-Window Method

    27/59

    Window functions Cont d

    1

    c

    s

    s/2

    s/2

    s/2

    c

    s

    s

    Hw(ejT

    )

    c c

    H(ejT

    )

    W(ej()T

    )

    Frame # 19 Slide # 27 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    28/59

    Window functions Cont d

    From the illustrations, we conclude that

    the steepness of the transition characteristic of the filterobtained depends on the main-lobe width of the window,

    and

    Frame # 20 Slide # 28 A. Antoniou Part 1: FIR Filters Window Method

    Window functions Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    29/59

    Window functions Cont d

    From the illustrations, we conclude that

    the steepness of the transition characteristic of the filterobtained depends on the main-lobe width of the window,

    and

    the amplitudes of the passband and stopband ripples

    depend on the ripple ratio of the window.

    Frame # 20 Slide # 29 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    30/59

    One of the most important windows is the Kaiser window.

    Frame # 21 Slide # 30 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function

    http://goforward/http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    31/59

    One of the most important windows is the Kaiser window.

    This is a parametric window which has an independentcontrol parameter .

    Frame # 21 Slide # 31 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    32/59

    One of the most important windows is the Kaiser window.

    This is a parametric window which has an independentcontrol parameter .

    By choosing the value of and the filter length,N, arbitrary

    specifications can be achieved in lowpass (LP), highpass

    (HP), bandpass (BP), and bandstop (BS) filters.

    Frame # 21 Slide # 32 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    33/59

    Ripple ratio versus:

    0 1 2 3 4 5 6 7 8 9 1080

    70

    60

    50

    40

    30

    20

    10

    RR, dB

    Frame # 22 Slide # 33 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    34/59

    Main-lobe width versus :

    0 1 2 3 4 5 6 7 8 9 100

    0.5

    1

    1.5

    2

    2.5

    N=43

    63

    123

    MB, rad

    Frame # 23 Slide # 34 A. Antoniou Part 1: FIR Filters Window Method

    Kaiser Window function Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    35/59

    The Kaiser window function is given by

    wK(nT)=

    I

    0()I0()

    for|n| M

    0 otherwise

    (D)

    where

    =

    1

    nM

    2, I0(x) =1+

    k=1

    1

    k!

    x2

    k2

    andM =(N 1)/2. Its frequency spectrum is given by

    WK(ejT)=wK(0) + 2

    Mn=1

    wK(nT) cos nT

    Frame # 24 Slide # 35 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    36/59

    An FIR LP filter that would satisfy the specifications shown can

    be readily designed by using a procedure due to Kaiser as

    detailed in the next three slides.

    Gain

    1+

    1

    cp a

    1.0

    s/2

    Ap

    Aa

    Frame # 25 Slide # 36 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters Contd

    http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    37/59

    1. Determine the impulse responseh(nT)using the Fourier

    series assuming an idealized frequency response

    H(ejT) =

    1 for|| c

    0 forc

  • 8/13/2019 FIR Filters-Window Method

    38/59

    1. Determine the impulse responseh(nT)using the Fourier

    series assuming an idealized frequency response

    H(ejT) =

    1 for|| c

    0 forc

  • 8/13/2019 FIR Filters-Window Method

    39/59

    3. With the requireddefined, the actual stopband

    attenuationAacan be calculated as

    Aa= 20log10

    Frame # 27 Slide # 39 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    40/59

    3. With the requireddefined, the actual stopband

    attenuationAacan be calculated as

    Aa= 20log10

    4. Choose parameteras

    =

    0 forAa210.5842(Aa 21)

    0.4 + 0.07886(Aa 21) for 21 50

    Frame # 27 Slide # 40 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    41/59

    5. Choose parameterDas

    D=0.9222 forAa21Aa 7.95

    14.36 forAa>21

    Then select the lowest odd value of Nthat would satisfy

    the inequality

    N sD

    Bt+ 1 where Bt =a p

    Frame # 28 Slide # 41 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    42/59

    5. Choose parameterDas

    D=0.9222 forAa21Aa 7.95

    14.36 forAa>21

    Then select the lowest odd value of Nthat would satisfy

    the inequality

    N sD

    Bt+ 1 where Bt =a p

    6. FormwK(nT)using Eq. (D).

    Frame # 28 Slide # 42 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Lowpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    43/59

    5. Choose parameterDas

    D=0.9222 forAa21Aa 7.95

    14.36 forAa>21

    Then select the lowest odd value of Nthat would satisfy

    the inequality

    N sD

    Bt+ 1 where Bt =a p

    6. FormwK(nT)using Eq. (D).

    7. Form

    Hw(z) =zMHw(z) whereHw(z) = Z[wK(nT)h(nT)]

    andM =(N 1)/2.

    Frame # 28 Slide # 43 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Bandpass Filters

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    44/59

    The design method presented can be easily extended to

    FIR HP, BP, and BS filters.

    Consider the case where a BP filter is required that wouldsatisfy the following specifications:

    Passband ripple Ap

    Minimum stopband attenuation Aa

    Lower passband edge p1

    Upper passband edge p2

    Lower stopband edgea1

    Upper stopband edgea2

    Sampling frequencys2

    (Apand Aain dB and all frequencies in rad/s)

    Frame # 29 Slide # 44 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Bandpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    45/59

    Gai

    n

    1+

    1

    c1 c2

    p1

    p2a1a2

    1.0

    s2

    Ap

    Aa

    Frame # 30 Slide # 45 A. Antoniou Part 1: FIR Filters Window Method

    Design of FIR Bandpass Filters Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    46/59

    The only differences in the design of BP filters are to

    use the more critical of the two transition widths for thedesign,

    use the idealized frequency of a BP filter for the

    determination of the initial impulse response.

    Frame # 31 Slide # 46 A. Antoniou Part 1: FIR Filters Window Method

    http://goforward/http://find/http://goback/
  • 8/13/2019 FIR Filters-Window Method

    47/59

    Example

  • 8/13/2019 FIR Filters-Window Method

    48/59

    Design an FIR BP filter satisfying the following specifications:

    Minimum attenuation for 0 200: 45 dB Maximum passband ripple for 400 <

  • 8/13/2019 FIR Filters-Window Method

    49/59

    The idealized impulse response is obtained as

    h(nT) = 1s

    s/2s/2

    H(ejT)ejnT d

    = 1

    n(sin c2nT sin c1nT)

    The application of the design procedure described will give

    =3.9754

    D =2.580

    N =53

    Frame # 34 Slide # 49 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    50/59

    Use of Ultraspherical Window Function

  • 8/13/2019 FIR Filters-Window Method

    51/59

    A more recent approach for the design of FIR filters that

    parallels the method described is a method based on the

    ultraspherical window function proposed by Bergen andAntoniou (see References).

    Frame # 36 Slide # 51 A. Antoniou Part 1: FIR Filters Window Method

    Use of Ultraspherical Window Function

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    52/59

    A more recent approach for the design of FIR filters that

    parallels the method described is a method based on the

    ultraspherical window function proposed by Bergen andAntoniou (see References).

    For certain specifications, this new approach tends to give

    more efficient designs, i.e., the minimum filter length that

    will achieve the required specifications is somewhat lower.

    Frame # 36 Slide # 52 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    53/59

  • 8/13/2019 FIR Filters-Window Method

    54/59

    Summary

  • 8/13/2019 FIR Filters-Window Method

    55/59

    A method for the design of FIR filters using a procedure

    proposed by Kaiser has been described.

    The method is easy to apply and requires a minimal

    amount of computation.

    Hence it can be used to design filters on-line in real or

    quasi-real time applications.

    The method is implemented in a DSP software packageknown as D-Filter.

    Frame # 38 Slide # 55 A. Antoniou Part 1: FIR Filters Window Method

    Summary

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    56/59

    A method for the design of FIR filters using a procedure

    proposed by Kaiser has been described.

    The method is easy to apply and requires a minimal

    amount of computation.

    Hence it can be used to design filters on-line in real or

    quasi-real time applications.

    The method is implemented in a DSP software packageknown as D-Filter.

    The designs obtained are suboptimal, i.e., other methods

    are available that would yield a lower filter order for the

    same specifications, for example, the weighted-Chebyshevmethod which will be described in Part 2 of this tutorial.

    Frame # 38 Slide # 56 A. Antoniou Part 1: FIR Filters Window Method

    References

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    57/59

    A. Antoniou,Digital Signal Processing: Signals, Systems,

    and Filters, Chap. 9, McGraw-Hill, 2005.

    J. F. Kaiser, Nonrecursive digital filter design using the

    I0-sinh window function,in Proc. IEEE Int. Symp. Circuit

    Theory, 1974, pp. 2023.

    S. W. A. Bergen and A. Antoniou, Design of ultraspherical

    window functions with prescribed spectral characteristics,EURASIP Journal on Applied Signal Processing, vol. 13,

    pp. 2053-2065, 2004.

    S. W. A. Bergen and A. Antoniou, Design of nonrecursive

    digital filters using the ultraspherical window function,EURASIP Journal on Applied Signal Processing, vol. 13,

    pp. 1910-1922, 2005.

    Frame # 39 Slide # 57 A. Antoniou Part 1: FIR Filters Window Method

    References Contd

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    58/59

    T. Saramki, Adjustable windows for the design of FIR

    filters A tutorial, 6th Mediterranean Electrotechnical

    Conference, vol. 1, pp. 2833, May 1991. R. L. Streit, A two-parameter family of weights for

    nonrecursive digital filters and antennas,IEEE Trans.

    Acoust., Speech, Signal Process., vol. 32, pp. 108118,

    Feb. 1984. A. Antoniou, Design of digital differentiators satisfying

    prescribed specifications,Proc. Inst. Elect. Eng., Part E,

    vol. 127, pp. 2430, Jan. 1980.

    Frame # 40 Slide # 58 A. Antoniou Part 1: FIR Filters Window Method

    http://find/
  • 8/13/2019 FIR Filters-Window Method

    59/59