eee507_2DFIRDesign2.pdf

Embed Size (px)

Citation preview

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    1/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Objectives! Reduces M-D FIR design to 1-D FIR design

    ! Efficient realization of designed filters

    Motivation

    ! M-D designs based on L! (Chebyshev) norm are difficult! 1-D designs very well studied and understood

    Strategy (M = 2; similar for any M-D design)! Given ideal 2-D specifications I(!1, !2)

    " Transform 2-D specs into appropriate 1-D specs by choosing appropriate 1-D filter I(!) 1-D filter calledprototype filter.

    " Design 1-D FIR filter H(!) approximating I(!) using known 1-D techniques

    " Transform the designed 1-D prototype FIR filter H(!) into a 2-D FIR filterH(!1, !2) by using an appropriate 2-D mapping function

    " Want to choose 1-D prototype I(!) and 2-D mapping function F(!1, !2) suchthat H(!1, !2) ~ I(!1, !2).

    H(!) H(!1, !2)

    F(!1, !2)

    mapping1-D FIR prototype Resulting designed2-D FIR filter

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    2/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Two main issues

    ! How can we transform a 1-D FIR filter into an 2-D FIR filter ?

    ! How do we choose the 1-D filter (prototype filter) and mapping function

    F(!1

    , !2

    ) ?

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    3/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter?

    ! Only symmetric 1-D filters can be transformed by the proposed

    McClellan Transformation method.

    ! Background:

    " Mcclellan transformation method maps 1-D positive-symmetric FIR filters into

    2-D (positive-symmetric) FIR filters.

    " Consider a 1-D zero-phase symmetric filter of length 2N+1

    =

    =N

    Nn

    njenhH )()(

    =

    =N

    n

    nna

    0

    cos)(

    =

    ++=N

    n

    njnj eenhh1

    ])[()0(

    =

    =

    ++=N

    n

    nj

    Nn

    njenhenhh

    1

    1

    )()()0(

    ==

    Nnnh

    nhna

    1),(2

    0),0()(

    where

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    4/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)! Background: Chebyshev Polynomials

    " It is well-known that can be expressed as a polynomial ofdegree n in the variable

    where

    " Thus:

    )(coscos nTn =

    11),()(2)(

    )(1)(

    polynomialChebyshev)(

    11

    1

    0

    =

    =

    =

    =

    + xxTxxTxT

    xxTxT

    nxT

    nnn

    th

    n

    =

    =N

    n

    nTnaH0

    )(cos)()(

    ncoscos

    nnaH

    N

    n== 0 cos)()(

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    5/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)

    ! Background: Derivation of the Chebyshev Recursion

    " Let , then

    or

    )cos(

    2

    1)cos(

    2

    1coscos BABABA ++=

    )1(and == nBA

    )2cos(cos)1cos(cos2 += nnn

    )2cos()1cos(cos2cos += nnn)(cos)(coscos2)(cos 21 = nnn TTT

    )()(2)( 21 xTxxTxT nnn =

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    6/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)

    ! The Transformation:

    "McClellan suggested that we can obtain a 2-D zero-phase FIR filter

    if we make the substitution

    Then

    =

    =N

    n

    n FTnaH0

    2121 )],([)(),(

    ),(cos 21 Freplace by

    =

    =N

    n

    nTnaH0

    )(cos)()(

    nnaH

    N

    n== 0 cos)()(

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    7/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)! The Transformation:

    " The mapping function F(!1,!2) should be real (zero-phase) and

    since F(!1,!2) has to replace cos(!) and has to take the samevalues of cos(!) since argument of Chebyshev polynomial=> H(!1,!2) takes same exact values of designed 1-D FIRprototype filter H(!).

    Consequence:

    - values of H(!1,!2) are determined by values of H(!).

    - H(!1,!2) only takes values of H(!).

    FIR Filter Design Using Transformations

    1),(1or1),( 2121 FF

    =

    =N

    n

    n FTnaH0

    2121 )],([)(),(

    =

    =N

    n

    nTnaH0

    )(cos)()(

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    8/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)! The Transformation:

    " The mapping function F(!1,!2) should be chosen to be the frequencyresponse of a zero-phase FIR filter

    " If F(!1,!2) is real and a(n) real H(!1,!2) is real zero-phase

    " If F(!1,!2) is (2Q+1) x (2Q+1) H(!1,!2) is (2NQ+1) x (2NQ+1) becauseH(!1,!2) is a polynomial of degree Nin F(!1,!2) same size as FN

    " Size of support of h(n1,n2) depends on Q (order of transformation subfilter F)and on N (order of 1-D prototype filter)

    )12)(12(

    )14)(14(*

    )12()12(

    2

    ++

    ++

    ++

    NQNQFfff

    QQFff

    QQFf

    N

    TimesN

    !"!#$ %

    &

    !!! "!!! #$"#$gaFa

    n nQnQFTg

    nn ofsupportofsize...

    )12()12()(

    0

    ++

    ++)12()12(),(

    0...

    21 ++

    ++

    NQNQHh

    bFb nn

    !"!#$

    FIR Filter Design Using Transformations

    FT

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    9/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)! The Transformation:

    " The mapping function F(!1,!2) determines the symmetries of thedesigned 2D FIR filter H(!1,!2) => H(!1,!2) have the samesymmetries of F(!1,!2).

    " Example: For zero-phase, even-symmetric H(!1,!2), F(!1,!2)should be zero-phase and even-symmetric of the form:

    ==N

    n

    n FTnaH0

    2121 )],([)(),(

    =

    =N

    n

    nTnaH0

    )(cos)()(

    )sin()sin(

    )cos()cos(),(

    2

    0 0

    1

    2

    0 0

    121

    jis

    rqtF

    I

    i

    J

    j

    ij

    Q

    q

    R

    r

    qr

    = =

    = =

    +

    =

    Note: Order of F(!1,!2) = max(Q,R,I,J).

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    10/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    How to transform 1-D FIR filter into a 2-D FIR filter? (continued)! The Transformation:

    " The mapping function F(!1,!2) determines the shape of thecontours of the designed 2D FIR filter H(!1,!2) => Contours ofH(!1,!2) have the same shape as the contours of F(!1,!2).

    " Let

    "Consequence: Shape of contours of H(!1,!2) determined by F(!1,!2).

    Value C determined by {a(n)}, n = 1 to N, which depends on thedesigned 1-D prototype H(!) => prototype H(!) determines thevalues of H(!1,!2) along contours.

    ==N

    n

    n FTnaH0

    2121 )],([)(),(

    =

    =N

    n

    nTnaH0

    )(cos)()(

    1,),( 21 = CCF

    CCTnaHN

    n

    n ==

    =021 ][)(),(

    1

    constCF ==2

    constCH == '21 ),(

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    11/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    Flexible and Modular:

    - Change F(!1,!2) to change contour shape

    - Change (prototype) to change values on contours

    Procedure:

    1) Design transformation subfilterF(!1,!2) :

    a. to get desired symmetries

    b. to produce or approximate desired contours

    c. OR, if prototype filter already specified, to map values of prototype todesired 2-D locations or contours

    2) Design prototype to get desired values along contours

    FIR Filter Design Using Transformations

    { })(na

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    12/30

    EEE 507 - Lecture 13Copyright 2004 by Prof. Lina Karam

    Example:

    Consider

    Let A=-B=-C=-1/2, D=E=1/4 (proposed by McClellan)

    FIR Filter Design Using Transformations

    212121 coscos2

    1)cos(

    2

    1)cos(

    2

    1

    2

    1),( +++=F

    symmetrysamehas),(designed

    symmetry)(quadrant),(),(),(),(

    21

    21212121

    H

    FFFF

    =>

    ===

    cos()cos()cos()cos(),( 1212121 +++++= EDCBAF

    ),( 21 nnf1n

    8

    1

    4

    1

    8

    14

    1

    2

    1

    4

    18

    1

    4

    1

    8

    1

    2n

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    13/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: (continued)

    Contours of F(!1,!2):

    Note:1)

    =>Prototype exactly mapped along axis

    2)

    =>Prototype exactly mapped along axis

    )()(cos)()0,( 10

    11 HTnaHN

    n

    n == =

    01 =

    22 cos),0( =F )()(cos)(),0( 20

    22 HTnaHN

    n

    n == =

    02 =

    11 cos)0,( =F

    2

    Tend to be rectangular

    Circular around origin

    ),( 21 F

    1

    212121 coscos2

    1)cos(

    2

    1)cos(

    2

    1

    2

    1),( +++=F

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    14/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    To get lowpass 2-D filter, use

    To get bandpass 2-D filter, use

    c

    )(H

    )(H

    L H

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    15/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Designed 2D Filter H(!1, !2)

    Prototype Filter H(!)Mapping F(!

    1,!

    2)

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    16/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Designed 2D Filter H(!1, !2)

    Mapping F(!

    1,!

    2) Prototype Filter H(!

    )

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    17/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Prototype Filter H(!)

    Desired I(!1, !2) Mapping F(!1, !2)

    Designed 2D Filter H(!1, !2)

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    18/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Design Example: We want to design a Fan filter using transformation

    Requirement: 1) Use a 1st order transformation F(!1,!2) function => Q=R=1

    2) Use a lowpass 1-D prototype

    FIR Filter Design Using Transformations

    2

    1

    ),( 21 I

    2/2/

    I(!)

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    19/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Example: Design of a Fan Filter (continued)

    Choice of Transformation Function

    - quadrant symmetric => needs to be quadrant symmetric

    so, of the form:

    Note: since quadrant symmetric => need to consider onlyone quadrant

    FIR Filter Design Using Transformations

    ),( 21 I ),( 21 F

    ),( 21 F

    211120111000

    2

    0 0

    121

    coscoscoscos

    )cos()cos(),(

    tttt

    rqtFQ

    q

    R

    r

    qr

    +++=

    = = =

    2

    1

    ),( 21 I

    0

    2

    1

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    20/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: Design of a Fan Filter (continued)

    ! Determination of parameters:Typically done by:

    1. Exploiting other symmetries

    2. Mapping values of prototype appropriately

    21112011100021 coscoscoscos),( ttttF +++=

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    21/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: Design of a Fan Filter (continued)

    1. Exploiting Other Symmetries:

    symmetric about line

    => Choose to be symmetric about same line

    3 unknowns => need 3 equations to solve for them

    ),( 21 F

    ),( 21 I += 12

    ),(),( 1221 =FF

    121110121000

    211120111000

    coscoscoscos

    coscoscoscos

    tttt

    tttt

    +=

    +++

    =

    =

    0110

    1001

    tt

    tt

    211121100021 coscos)cos(cos),( tttF ++=

    21112011100021 coscoscoscos),( ttttF +++=

    2

    1

    ),( 21 I

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    22/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: Design of a Fan Filter (continued)

    2. Map values of prototype:

    Since used 1-D prototype is lowpass, appropriatemapping is as follows:

    1-D point ! maps into 2-D point (!1,!2)

    Note: To map value at 1-D point !to a desired 2-D location (!1,!2),simply set F(!1,!

    2)=cos(!

    ).

    211121100021 coscos)cos(cos),( tttF ++=

    2

    1

    ),( 21 I

    )2

    ,2

    (2

    )0,(

    ),0(0

    =

    =

    =

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    23/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: Design of a Fan Filter (continued)

    a)

    b)

    c)

    211121100021 coscos)cos(cos),( tttF ++=),0(),(0 21 ==

    1)0cos(),0( ==F

    1cos0cos)cos0(cos 111000 =++ ttt

    )0,(),( 21 ==

    1)cos()0,( == F

    10coscos)11( 111000 =++ ttt2/124)2()1( 1010 == tt

    )2/,2/(),(2/ 21 ==02/cos)2/,2/( == F

    000

    =t

    1)11( 111000 =++ ttt12 111000 =+ ttt

    12 111000 = ttt

    (1)

    (2)

    0122/1

    01011

    10

    00 ==

    =

    =tt

    t

    t

    2121 cos2/1cos2/1),( = F( using (1) )

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    24/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Example: Design of a Fan Filter (continued)

    2121 cos2/1cos2/1),( =F

    Nnnhnaha

    FTna

    FTnhhH

    N

    n

    n

    N

    n

    n

    ==

    =

    +=

    =

    =

    1),(2)(),0()0(where

    )),(()(

    )),(()(2)0(),(

    0

    21

    1

    2121

    )cos(cos2/1),( 2121 =F2

    1

    0

    coscos 12

    12

    >=>

    F

    )(H

    2

    2

    )(oflength)12( nhN =+

    F < 0

    cos(!) >0 cos(!) < 0

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    25/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    FIR Filter Design Using Transformations

    Review of design procedure

    : from 1-D prototype design

    : frequency response of low-order FIR zero-phase filter

    ! If h(n) is 2N+1 points long and f(n1,n2) is (2Q+1)x(2Q+1), then

    h(n1,n2) is (2NQ+1)x(2NQ+1).

    ! Contour shape and symmetries depends only on F.

    ! Amplitude associated with a particular contour depends upon the

    1-D prototype

    { })(na

    ),( 21 F

    =

    =N

    n n

    FTnaH0 2121

    )],([)(),(

    =

    =N

    n

    nTnaH0

    )(cos)()(

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    26/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Implementation of Transformed FIR Designs

    Since the filter is FIR, a direct convolution can be used to implementthe filter

    A DFT can also be used

    There also exists a special implementation that exploits the design! Based on the recursion of Chebyshev polynomials

    ! Thus, if we have and , we can get ,because

    F(!1,!2) is an FIR filter.

    )],([)],([),(2)],([ 2122112121 FTFTFFT nnn =

    1)],([ 210 =FT

    ),()],([ 21211 FFT =][FTn][1 FTn ][2 FTn

    + +

    -

    ][1 FTn][FTn

    ][2

    FTn

    ),(2 21 F

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    27/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Implementation of Transformed FIR Designs

    From the Chebyshev polynomials recursion, we obtain:

    In addition, we can get and from the polynomial thatcome before and so on until we get back to and .

    ][2 FTn][1 FTn

    ++

    -

    ][1 FTn ][FTn

    ][2 FTn

    ),(2 21 F

    ][0 FT][1 FT

    F 2F 2F

    -1

    -1

    + +

    ][0 FT ][1 FT ][2 FT ][3 FT

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    28/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Implementation of Transformed FIR Designs

    Finally, the frequency response H(!1, !2) of the 2D designed FIRfilter is just a linear combination of the :

    where

    Note: This structure will work for filters of any dimensionality.

    To realize an M-dimensional filter ,we simply substitute an M-dimensional mapping function

    =

    =N

    n

    n FTnaH0

    2121 )],([)(),(

    ][FTi

    .1),(2)(and)0()0( Nnnhnaha ==

    F 2F 2F

    -1

    -1

    + +

    + + +out

    IN

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

    ),...,,( 21 MF

    ),...,,( 21 MH

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    29/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Implementation of Transformed FIR Designs

    Consider the first-order transformation:

    Direct implementation of F requires 5 multiplications per output and8 adds per output

    ! Note: Multiplications reduced by combining terms

    )cos()cos(coscos),( 21212121 +++++= EDCBAF

    ==

    ==

    ==

    ==

    ==

    =

    121

    121

    21

    21

    11

    21

    ,1,2

    ,1,2

    1,0,2

    0,1,2

    0,

    ),(

    nnnE

    nnnD

    nnC

    nnB

    nnA

    nnf

    222

    22

    222

    DCE

    BA

    B

    ECD

    ),( 21 nnf of size 3x3

  • 7/24/2019 eee507_2DFIRDesign2.pdf

    30/30

    EEE 507 - Lecture 13

    Copyright 2004 by Prof. Lina Karam

    Implementation of Transformed FIR Designs

    Computational Complexity

    ! To implement each filter F of size (2Q+1)x(2Q+1) requires in general:

    Multiplications/Output

    Additions/ OutputRows of storage

    ! For the whole filter H(!1, !2), we have Nfilters F:

    Mults/OutputAdds/Output

    2)12( +Q

    1)12(

    2

    +Q)12( +Q

    )1()12(

    2

    +++ NQN)1()12( 2 ++ NQN