Linear Phase

Embed Size (px)

Citation preview

  • 7/31/2019 Linear Phase

    1/8

    Linear Phase Filters

    VOCAL Technologies LTD

    October 25th, 2012

    1

  • 7/31/2019 Linear Phase

    2/8

    I. Introduction

    Linear phase filters are practical realizations of zero phase filters. A zero

    phase filter is a filter that has symmetry about the origin. Thus when using a

    zero phase filter, one must take negative indices into account, which is rather

    tedious and is prone to error. To make things easier, we instead make the filter

    symmetric about some non-zero point. What results is a linear phase filter

    shown below:

    Figure 1: A Linear Phase Filter The Hamming Window

    Linear phase filters are important for audio filter design because passing a

    signal through a linear phase filter will delay all of the frequency components

    by the same amount, thus leaving the structure of the signal intact, which will

    preserve speech intelligibility. To understand how phase effect delay, its quite

    common to start by looking at the frequency response of the ideal delay system

    h[n] = [n nd]:

    H(ej) =

    +

    k=

    [n nd]ejk = ejnd (1)

    This behavior is due to the sampling property of the delta function. We

    can see that the phase is then:

    H(ej) = arg[ejnd ] = nd (2)

    Which is a linear function of frequency. Thus, time delay and linear phase

    2

  • 7/31/2019 Linear Phase

    3/8

    are inexorably linked. If you still dont believe, consider what happens when we

    put a signal x through the ideal delay system. The output is:

    y[n] = (x|h)[n] = x[n nd] (3)

    This has frequency response:

    Y(ej) = X(ej)H(ej) = X(ej)ejnd (4)

    As the equation shows, regardless of what the frequency response of the

    input x is, it is shifted linearly by nd, while the time domain signal is shifted

    by nd. Again, time delay and linear phase are inexorably linked. With this in

    mind, it will be useful to examine some different types of filters that will giveus a linear phase response. First, we will examine the four types of FIR filters

    [1].

    II. Linear Phase FIR Filters

    The four types of linear phase FIR filters are appropriately named Type

    I-IV. These filters are categorized by whether they have an even or odd length,

    and whether they are symmetric or antisymmetric. In all cases, we will define

    the center of symmetry to be M2

    where M 1 is the length of the filter. Since

    the filters will have essentially the same shape on either side of the center ofsymmetry, we can think of each as a filter delayed by M

    2. The examples follow

    from [1].

    3

  • 7/31/2019 Linear Phase

    4/8

    Type I FIR Filters

    Figure 2: Type I FIR Filter

    As the above figure shows, Type I FIR Filters are odd length filters with a

    symmetric impulse response given by:

    h[n] = h[M n] 0 n M (5)

    Most generally, these filters can be represented as:

    H(ej) = ejM

    2

    M

    2

    k=0

    a[k]cos(k) (6)

    Where:

    a[0] = h[M

    2]

    a[k] = 2h[M

    2 k] 1 k

    M

    2(7)

    For the example above, the frequency response is:

    H(ej) =

    6

    k=0

    h[n]ejwn

    = 0 ejw0 + 1 ejw1 + 2 ejw2 + 3 ejw3 + 2 ejw4 + 1 ejw5 + 0 ejw6

    = ej3w(ej2w + 2 ejw + 3 + 2 ejw + ej2w)

    = ej3w(2(ejw + ejw) + (ej2w + ej2w) + 3)

    = ej3w(4cos(w) + 2cos(2w) + 3) (8)

    4

  • 7/31/2019 Linear Phase

    5/8

    Type II FIR Filters

    Figure 3: Type II FIR Filter

    As the above figure shows, Type II FIR Filters are even length filters with

    a symmetric impulse response. Most generally, these filters can be represented

    as:

    H(ej) = ejM

    2

    M+1

    2

    k=1

    b[k]cos[(k 1

    2)] (9)

    Where:

    a[k] = 2h[M+ 1

    2 k] 1 k

    M+ 1

    2(10)

    For the example above, the frequency response is:

    H(ej) =

    5

    k=0

    h[n]ejwn

    = 1 ejw0 + 2 ejw1 + 3 ejw2 + 3 ejw3 + 2 ejw4 + 1 ejw5

    = ej52w(ej

    52w + 2 ej

    32w + 3 ej

    12w + 3 ej

    12w + 2 ej

    32w + ej

    52w)

    = ej52w((ej

    52w + ej

    52w) + 2(ej

    32w + ej

    32w) + 3(ej

    12w + ej

    12w)

    = ej52w(2cos(

    5

    2w) + 4cos(

    3

    2w) + 6cos(

    1

    2w)) (11)

    5

  • 7/31/2019 Linear Phase

    6/8

    Type III FIR Filters

    Figure 4: Type III FIR Filter

    As the above figure shows, Type III FIR Filters are odd length filters with

    an antisymmetric impulse response given by:

    h[n] = h[M n] 0 n M (12)

    Most generally, these filters can be represented as:

    H(ej) = jejM

    2

    M

    2

    k=1

    c[k]sin(k) (13)

    Where:

    c[k] = 2h[M

    2 k] 1 k

    M

    2(14)

    Similarly to the Type I filter, the frequency response of the above example

    is:

    H(ej) =6

    k=0

    h[n]ejwn

    = ej3w+

    2 (4sin(w) + 2sin(2w) + 3) (15)

    6

  • 7/31/2019 Linear Phase

    7/8

    Type IV FIR Filters

    Figure 5: Type IV FIR Filter

    As the above figure shows, Type IV FIR Filters are even length filters with an

    antisymmetric impulse response. Most generally, these filters can be represented

    as:

    H(ej) = jejM

    2

    M+1

    2

    k=1

    d[k]sin[(k 1

    2)] (16)

    Where:

    d[k] = 2h[M+ 1

    2 k] 1 k

    M+ 1

    2(17)

    Similarly to the Type II filter, the frequency response of the above example

    is:

    H(ej) =

    6

    k=0

    h[n]ejwn

    = ej52w+

    2 (2sin(5

    2w) + 4sin(

    3

    2w) + 6sin(

    1

    2w)) (18)

    With analogy to (4), it is clear that all of these filters have linear phase.

    From this discussion, it should be clear to you which FIR filters will be linear

    phase, and which will not be. Similarly, by shifting in the time domain, you cancreate a linear phase filter from a zero phase one.

    7

  • 7/31/2019 Linear Phase

    8/8

    III. Linear Phase IIR Filters

    IIR Filters may be made linear phase by using what is called bi-directional

    filtering. In bi-directional filtering, the signal of interest is first filtered via

    convolution with the IIR filter from left-to-right, and then the output is filtered

    via the IIR filter going from right-to-left for instance. In this manner, filters

    that are generally not linear phase like IIR filters can be effectively transformed

    to filters that are.

    Of course, in practice, this method demands a great deal of delay because

    not only do you have to wait for the signal values to create the IIR filter, but

    you also need to filter the signal twice. However, if your FIR filter is sufficiently

    long, using a much lower order IIR filter may be worth the extra computational

    overhead.

    References

    [1] A. V. Oppenheim, R. W. Schafer, Transform Analysis of Linear Time-

    Invariant Systems, in Discrete Time Signal Processing, 2nd ed. Upper Saddle

    River, NJ: Prentice-Hall Inc., 1999, ch. 5, sec. 7, pp. 298300.

    8