Finite-Length Discrete Transforms

Embed Size (px)

Citation preview

  • 7/30/2019 Finite-Length Discrete Transforms

    1/44

    Finite-Length Discrete

    Transforms

    1

  • 7/30/2019 Finite-Length Discrete Transforms

    2/44

    Orthogonal Transforms

    Let x[n] denote a length-N time-

    domain sequence with

    denoting the coefficient of its N-

    point orthogonal transform. The

    general form of the orthogonal

    transform pair is of the form

    Referred to as the analysis and

    synthesis equation respectively.

    2

    The above condition are said to be

    orthogonal to each other

    The verification of this equation in

    book page 200

    x [ k]= n=0

    N 1

    x [ n ] [ k, n ], 0 k N 1

    x [ n ]=1

    N n=0

    N 1

    x [n ] [ k, n ], 0 k N 1

    n=0

    N 1

    [ k, n ] [ l,n] = {1, l=k0 l k}[k]

  • 7/30/2019 Finite-Length Discrete Transforms

    3/44

  • 7/30/2019 Finite-Length Discrete Transforms

    4/44

    The inverse discrete Fouriertransform (IDFT) is given by

    As can be seen from the above

    expression, the inverse DFT x[n] can

    be a complex sequence even when

    the DFT X[k] is real sequence.

    4

    The Discrete Transform

    x [ n ]=1

    Nk=0

    N 1

    X[ k] WN kn, 0 n N 1

    X[k]

    Example - Consider the length-Nsequence defined for 0 n N-1

    Where is r is an integer in the range0 n N-1

    Using a trigonometric identity, wecan write as

    x [n ]= cos(2 rn N), 0 n N 1

    x [ n ]= 12

    (e j2rn /N+e j2rn /N)

    1

    2(WN

    rn+WN

    rn )

  • 7/30/2019 Finite-Length Discrete Transforms

    5/44

    5

    The Discrete Transform

    The N-point DFT ofg[n] is thus given by

    Making use of the identity

    X[ k ]= n=0

    N 1

    g[n ] WNkn

    1

    2 (n=0N 1

    WN ( r k)n+

    n=0

    N 1

    WN( r+k)n)

    0 k N 1

    n=0

    N 1

    WN (k )n

    ={N,fork =rN,ran int eger

    0,otherwise }G[ k]={

    N/2, fork=r

    N/2, fork=N r

    0otherwis }0 k N 1

    we

    get

    Matrix Relations

    The DFT samples defined by

    can be expressed in matrix form as

    WhereX is the vector composed of

    the N DFT samples and x is thevector ofNinput samples

    X[ k]= n=0

    N 1

    x[ n]WN

    k n, 0 k N 1

    X=DNx

    X=[ X[0 ] X[1 ] X[ N 1 ] ]t

    x=[ x [0 ]x [1 ]x [ N 1 ] ]t

  • 7/30/2019 Finite-Length Discrete Transforms

    6/44

    6

    The Discrete Transform

    and DNis the NNDFT matrix given

    by

    Likewise, the IDFT relation given by

    DN=[1 1 1 1

    1 WN1 W

    N2 W

    N(N 1)

    1 WN

    2 WN

    4 WN

    2( N 1)

    1 WN

    (N 1 ) WN

    2(N 1) WN

    (N 1)2 ]

    can be expressed in matrix form as

    where is the NNDFT matrix

    Where

    Note

    DN

    1

    x=DN 1

    X

    DN 1

    =

    [1 1 1 1

    1 WN

    1 WN

    2 WN

    (N 1 )

    1 WN

    2 WN

    4 WN

    2(N 1)

    1 WN

    (N 1) WN

    2(N 1) WN

    (N 1)2

    ]D

    N

    1=1

    N

    DN

    x [ n ]=1

    Nk=0

    N 1

    X[K]WN kn, 0 n N 1

  • 7/30/2019 Finite-Length Discrete Transforms

    7/44

    The FT of length-Nsequence x[n]

    limit the extent of the summation to

    N points and evaluate the

    continuous function of frequency at

    Nequally spaced points

    7

    Relation with DTFT

    X(ej)= n=

    x [ n ]e jn

    = n=0

    N 1

    x [ n ]e jn

    X(ej)=

    2

    Nk

    =X(k) =Xk

    = n=0

    N 1

    x [ n ]e j2kn/N

    Numerical Computation of the

    DTFT using the DFT

    A practical approach to the

    numerical computation of the DTFT

    of a finite-length sequence.

    LetX(ej) be the DTFT of a length-N

    sequencex[n]

    We wish to evaluate X(ej) at a

    dense grid of frequencies k=2k/M,0kM-1,where M>> N:

    Relation Between the DTFT and the DFT and Their Inverses

    ejn

  • 7/30/2019 Finite-Length Discrete Transforms

    8/44

    Define a new sequence

    Then

    X(ej

    k)= n=0

    N 1

    x [ n ]e j

    kn=

    n=0

    N 1

    x [ n ]e j2kn/M

    X(ej

    k)= n=0

    M 1

    xe[ n ]e j2kn/M

    xe[n ]= {x [n ],0 n N 10, N n M 1 }

    Thus is essentially an M-point DFT Xe[k] of the length-Msequencexe[n]

    The DFT Xe[k] can be computedvery efficiently using the FFTalgorithm ifMis an integer power of2

    The function freqz employs this

    approach to evaluate the frequencyresponse at a prescribed set offrequencies of a DTFT expressed asa rational function in e-j

    X(ej

    k)

    Relation Between the DTFT and the DFT and Their Inverses

  • 7/30/2019 Finite-Length Discrete Transforms

    9/44

    DTFT from DFT by Interpolation

    The N-point DFT X[k] of a length-N

    sequence x[n] is simply the

    frequency samples of its DTFT

    X(ej) evaluated at N uniformly

    spaced frequency points

    Given the N-point DFT X[k] of alength-N sequence x[n], its DTFT

    X(ej) can be uniquely determined

    fromX[k]

    =k= 2k/N , 0 k N 1

    Thus

    X(ej

    )= n= 0

    N 1

    x [n ]e jn

    n= 0

    N 1

    [1

    Nk=0

    N 1

    X[ k]WN kn ]e jn

    1N k= 0

    N 1

    X[ k] n= 0

    N 1

    e j ( 2k/N)n

    S

    Relation Between the DTFT and the DFT and Their Inverses

  • 7/30/2019 Finite-Length Discrete Transforms

    10/44

    To develop a compact expressionfor the sum S, let

    Then

    From the above

    Or, equivalently,

    r=e j( 2k/N)

    S= rn

    rS= rn= 1+ rn+rN 1

    r

    n

    +r

    N

    1=S+rN

    1

    Hence

    Therefore

    S=1 rN

    1 r=1 e j (N 2k)

    1 e j [ (2k/N) ]

    sin

    (

    N 2k

    2 )sin(N 2k2N )

    e j [ 2k/N)][(N 1)/2]

    S rS=(1 r) S=1 rN

    5.3 Relation Between the DTFT and the DFT and Their Inverses

    X(ej)

    1

    Nk= 0

    N 1

    X[ k]

    sin(N 2k2 )sin

    (

    N 2k

    2N

    )

    e j [ 2k/N)][(N 1)/2 ]

  • 7/30/2019 Finite-Length Discrete Transforms

    11/44

    Sampling the Fourier Transform

    Consider a sequencex[n] with a DTFT

    X(ej)

    We sampleX(ej) at Nequally spaced

    points k=2k/N, 0kN-1 developingthe Nfrequency samples

    These N frequency samples can be

    considered as an N-point DFT Y[k]

    whose N- point IDFT is a length-N

    sequence y[n]

    now

    {X(ejk)}

    Relation Between the DTFT and the DFT and Their Inverses

    X(ej

    )=

    x [ ]e j

    Thus

    An IDFT ofY[k] yields

    Y[ k]=X(ejk)=X(e

    j2k/N)

    x [ ]e j2k/N=

    x [ ]WNk

    y [ n ]=1

    Nk0

    N 1

    Y[k]WN kn

    y [ n ]=1

    Nk0

    N 1

    =

    x[ ]WNkW

    N kn

    =

    x [ ][1N k= 0N 1

    WN k( n )]

    1

    N

    n0

    N 1

    WN k( n r)= (

    1, forr=n+mN

    0, otherwise

  • 7/30/2019 Finite-Length Discrete Transforms

    12/44

    we arrive at the desired relation

    Thus y[n] is obtained from x[n] by

    adding an infinite number of shifted

    replicas of x[n], with each replicashifted by an integer multiple of N

    sampling instants, and observing the

    sum only for the interval 0nN-1

    y [n ]= m=

    x [ n+mN],0 n N 1

    To apply

    To finite-length sequences, we

    assume that the samples outside the

    specified range are zeros

    y [ n ]= m=

    x [ n+mN], 0 n N 1

    Relation Between the DTFT and the DFT and Their Inverses

    Thus ifx[n] is a length-M sequence

    with MN, then y[n]= x[n] , for

    0nN-1

    Example 5.6

    Let {x[n]}={0 1 2 3 4 5}

    By sampling its DTFT X(ej) at

    k=2k/4, 0k3 and then applying

    a 4-point IDFT to these samples, we

    arrive at the sequence y[n] given by

    y[n]=x[n]+x[n+4]+x[n-4] 0n3

    i.e. {y[n]}={4 6 2 3}

    {x[n]} cannot be recovered from {y[n]}

  • 7/30/2019 Finite-Length Discrete Transforms

    13/44

    Circular Convolution

    This operation is analogous to linear

    convolution, but with a subtle

    difference

    Consider two length-N sequences,

    g[n] and h[n], respectively

    Their linear convolution results in a

    length-(2N-1) sequence yL[n] given

    by

    yL

    [n ]= m=0

    N 1

    g[ m ] h[ n m], 0 n 2N 2

    In computing yL[n] we have assumedthat both length-N sequence havebeen zero-padded to extend theirlengths to 2N-1

    The longer form ofyL[n] results fromthe time-reversal of the sequenceh[n] and its linear shift to the right

    The first nonzero value ofyL[n] is

    yL[0]= g[0]h[0] ,and the last nonzerovalue is

    yL[2N-2]= g[N-1]h[N-1]

  • 7/30/2019 Finite-Length Discrete Transforms

    14/44

    Definition:

    To develop a convolution-like

    operation resulting in a length-N

    sequence yC[n] , we need to define a

    circular time-reversal, and then apply

    a circular time-shift

    Resulting operation, called a

    circular convolution, is defined by

    yC

    [ n ]= m=0

    N 1g[ m ] h [n m

    N],

    0 n N 1

    Since the operation defined involves

    two length-N sequences, it is often

    referred to as an N-point circular

    convolution, denoted as

    The circular convolution is

    commutative, i.e.

    y[n] =g[n] h[n]

    g[n] h[n] = h[n] g[n]

    Circular Convolution

  • 7/30/2019 Finite-Length Discrete Transforms

    15/44

    The N-point circular convolution canbe written in matrix form as

    Note: The elements of each diagonalof the NNmatrix are equal

    Such a matrix is called a circulantmatrix

    [yC[0 ]

    yC[1 ]

    yC[2 ]

    yC[N 1 ]]=

    [h[ 0 ] h [N 1 ] h[ N 2 ] h [1 ]

    h[ 1 ] h[ 0 ] h [N 1] h[ 2 ]

    h[ 2 ] h[ 1] h[ 0 ] h [3 ]

    h [N 1 ] h[ N 2] h [N 3] h[ 0 ]][g[ 0 ]

    g[1 ]

    g[ 2 ]

    g[N 1 ]]

    5.4 Circular Convolution

    Tabular Method

    Consider the evaluation of y[n]= h[n]

    g[n]

    where {g[n]} and {h[n]} are length-4

    sequences

    First, the samples of the two

    sequences are multiplied using theconventional multiplication method as

    shown on the next slide

  • 7/30/2019 Finite-Length Discrete Transforms

    16/44

    The partial products generated in the 2nd, 3rd, and 4th rows are circularly shiftedto the left as indicated above

    Circular Convolution

  • 7/30/2019 Finite-Length Discrete Transforms

    17/44

    Circular Convolution

    The modified table after circular

    shifting is shown below

    The samples of the sequence {yc[n]}

    are obtained by adding the 4 partial

    products in the column above of eachsample

    Thus

    yc[0]=g[0]h[0]+ g[3]h[1]+ g[2]h[2]+ g[1]h[3]

    yc[1]=g[1]h[0]+ g[0]h[1]+ g[3]h[2]+ g[2]h[3]

    yc[2]=g[2]h[0]+ g[1]h[1]+ g[0]h[2]+ g[3]h[3]

    yc[3]=g[3]h[0]+ g[2]h[1]+ g[1]h[2]+ g[0]h[3]

    The definition of circular conjugate-symmetric sequence and circularconjugate-antisymmetric sequence.

    Circular conjugate-symmetry

    Circular conjugate-antisymmetry

  • 7/30/2019 Finite-Length Discrete Transforms

    18/44

    Classifications of Finite-Length Sequences

    Classifications Based on Conjugate

    Symmetry Any complex length-N sequence x[n]can be expressed as:

    Where, Xcs[n] is its circularconjugate-symmetric part and Xca[n]is its circular conjugate-anti-symmetric part, defined by:

    For a real sequence x[n], it can beexpressed as:

    Where, Xev[n] is its circular evenpart and Xca[n] is its circular oddpart, defined by:

  • 7/30/2019 Finite-Length Discrete Transforms

    19/44

    Classifications of Finite-Length Sequences

    Classifications Based on Geometric

    Symmetry Two types of geometric symmetries

    are usually defined:For a real

    (1) Symmetric sequence

    (2) Antisymmetric sequence

    Since the length N of a sequencecan be either even or odd, four typesof geometric symmetry are defined:

    Type1: Symmetric impulse responsewith odd length.

    Type2: Symmetric impulse responsewith even length

    Type1: Anti-symmetric impulseresponse with odd length.

    Type1: Anti-symmetric impulseresponse with even length.

  • 7/30/2019 Finite-Length Discrete Transforms

    20/44

    Classifications of Finite-Length Sequences

    Type 1 symmetric sequence, withN=9,

    is

    x[n]=x[0]+x[1]+x[2]+x[3]+x[4]+x[5]+

    x[6]+x[7]+x[8]

    The Fourier transform is

    Type 1 Symmetry with Odd Length

    Taking e-j4 as a common factor ineach group of.

    Factoring out e-j4 in the right hand

    side

  • 7/30/2019 Finite-Length Discrete Transforms

    21/44

    Classifications of Finite-Length Sequences

    Notice that the quantity inside the

    braces, { }, is a real function of andcan assume positive or negative values

    in the range 0

    The of the sequence is given by

    () = 4 + where is either 0 or

    , and hence the phase is a linear

    function of

    In general, for Type 1 linear-phase

    sequence of length-N

    Type 2 Symmetry with Even Length

    Similarly, the Fourier transform ofType 2 symmetric sequence, with N=8,

    can be written.

    where the phase is given by

    In general, for Type 2 linear-phase

    sequence of length-N

  • 7/30/2019 Finite-Length Discrete Transforms

    22/44

    Classifications of Finite-Length Sequences

    The Fourier transform of Type 3

    antisymmetric sequence, with N=9, is

    (notice that x[4]=0)

    Now, x[0]=-x[8], x[1]=-x[7], x[2]=-x[6],

    x[3]=-x[5] and x[4]=0

    Type 3 Antisymmetry with Odd Length

    Multiplying by j=ej/2and 2, we obtain

    which results in

    The phase is now

    The antisymmetry introduces a phase

    shift of/2

  • 7/30/2019 Finite-Length Discrete Transforms

    23/44

    Classifications of Finite-Length Sequences

    In general, the Fourier transform of

    Type 3 linear phase antisymmetric

    sequence of odd length-N is

    Similarly, the Fourier transform of

    Type 4 linear phase antisymmetric

    sequence of even length-N is

    In both cases, j=ej/2 introduces a

    phase shift of/2

    Type 4 Antisymmetry with Even Length

    Multiplying by j=ej/2and 2, we obtain

    which results in

    The phase is now

    The antisymmetry introduces a phase

    shift of/2

  • 7/30/2019 Finite-Length Discrete Transforms

    24/44

    DFT Symmetry Relations

    In general, the DFT X[k] of a finite

    sequence x[n] is a sequence of complex

    numbers and can be expressed as

    Real and imaginary parts of the DFT

    sequence can be found as:

    Assuming that the original time-domain

    signal is complex

    its DFT can be found as:

    Therefore, real and imaginary parts ofthe DFT sequence are:

    X[ k]= Xre

    [ k]+ j Xim [ k]

  • 7/30/2019 Finite-Length Discrete Transforms

    25/44

    DFT Symmetry Relations

    Symmetry Properties of the DFT of a

    real sequence

    Symmetry Properties of the DFT of a

    complex sequence

  • 7/30/2019 Finite-Length Discrete Transforms

    26/44

    Discrete Fourier Transform Theorems

    The DFT satisfies a number of

    properties that are useful in signalprocessing.

    All time domain sequences are

    assumed to be of length-N with N-point

    DFT.

    Linearity Theorem

    Consider a sequence x[n] obtained by a

    linear combination of g[n] and h[n]

    Circular Time Shifting Theorem

    The DFT of the circularly time shifting

    sequence x[n] is given by

    Circular Frequency Shifting Theorem

    The inverse DFT of the circularly

    frequency shifting DFT is given by

    Duality Theorem

    If the N-point DFT of the length-N

    sequence g[n] is G[k], then

    Circular Convolution Theorem

    The N-point DFT Y[k] of the length N-sequence is given by

  • 7/30/2019 Finite-Length Discrete Transforms

    27/44

    Computation of the DFT of Real Sequence

    Modulation Theorem

    The N-point DFT Y[k] of the length-Nproduct sequence is given by a

    circulation of theirDFTs

    Parsevals TheoremThe total energy of a length-N sequence

    g[n] can be computed by summing the

    square of the absolute values of the

    DFT.

    N-point DFTs of two Real Sequences

    using a single N-point DFT

    Let g[n] and h[n] be two length-N realsequences with G[k] and H[k] denoting

    their respective N-point DFTs

    These two N-point DFTs can be

    computed efficiently using a single N-

    point DFT

    Define a complex length-N sequence

    The inverse DFT of the circularly

    frequency shifting DFT is given by

    LetX[k] denote the N-point DFT of x[n]

    Note that for 0 k N1,

  • 7/30/2019 Finite-Length Discrete Transforms

    28/44

    Computation of the DFT of Real Sequence

    Thus

    Linear Convolution using the DFT

    Since a DFT can be efficiently

    implemented using FFT algorithms, it is

    of interest to develop methods for the

    implementation of linear convolution

    using the DFT

    Let g[n] and h[n] be two finite-length

    sequences of length N

    and M, respectively

    Define two length-L (L = N + M 1)sequences

    Thus

    2N-point DFT of a Real Sequence

    using a single N-point DFTLet v[n] be a length-N real sequence

    with a 2N-point DFT V[k]

    Define two length-N real sequences

    g[n] and h[n] as follows:

    Let G[k] and H[k] denote their espective

    N-point DFTs

    Define a length-N complex sequence

    with an N-point DFT X[k]

  • 7/30/2019 Finite-Length Discrete Transforms

    29/44

    Linear Convolution using the DFT

    Linear Convolution of a Finite-Length

    Sequence with an infinite Length

    Sequence

    Overlap-Add Method

    We first segment x[n], assumed to be a

    causal sequence here without any loss

    of generality, into a set of contiguous

    finite-length subsequences of length N

    each:

    Where

    Thus

    where

    The corresponding implementation

    scheme is illustrated below

    We next consider the DFT-basedimplementation of

    where h[n] is a finite-length sequence oflength M and x[n] is an infinite length (or

    a finite length sequence of length much

    greater than M)

  • 7/30/2019 Finite-Length Discrete Transforms

    30/44

    Linear Convolution using the DFT

    The desired linear convolution y[n] =

    h[n] x[n] is broken up into a sum of

    infinite number of short-length linear

    convolutions of length N + M 1 each:

    ym[n] = h[n] xm[n]

    Consider implementing the following

    convolutions using the DFT-basedmethod, where now the DFTs (and the

    IDFT) are computed on the basis of (N

    + M 1) points

    In general, there will be an overlap ofM

    1 samples between the samples of the

    short convolutions h[n] xr-1[n]and h[n]

    xm[n] for (r 1)N n rN + M 2

  • 7/30/2019 Finite-Length Discrete Transforms

    31/44

    Linear Convolution using the DFT

    Therefore, y[n] obtained by a linear

    convolution of x[n] and h[n] is given by

    The above procedure is called the

    overlap-add method

    since the results of the short linear

    convolutions overlap and the

    overlapped portions are added to get

    the correct final result

    Overlap-Save Method

    In implementing the overlap-add

    method using the DFT, we need to

    compute two (N + M1)-point DFTs and

    one (N + M 1)-point IDFT for each

    short linear convolution

    It is possible to implement the overalllinear convolution by performing instead

    circular convolution of length shorter

    than (N + M 1)

    To this end, it is necessary to

    segment x[n] intooverlapping blocksxm[n] , keep the terms o f the circular

    convolution of h[n] with that

    corresponds to the terms obtained by a

    linear convolution ofh[n] and xm[n], and

    throw away the other parts of the

    circular convolution

  • 7/30/2019 Finite-Length Discrete Transforms

    32/44

    Linear Convolution using the DFT

    To understand the correspondence

    between the linear and circular

    convolutions, consider a length-4

    sequencex[n] anda length-3 sequence

    h[n]

    Let yL[n] denote the result of a linear

    convolution of x[n] with h[n]

    The six samples ofyL[n] are given by

    If we append h[n] with a single zero-

    valued sample andconvert it into a

    length-4 sequence he[n], the 4-point

    circularconvolution yC[n] of he[n] and

    x[n] is given by

    Next form

  • 7/30/2019 Finite-Length Discrete Transforms

    33/44

    Linear Convolution using the DFT

    Or equivalently

    Computing the above for m = 0, 1, 2, 3,

    . . . , and substituting the values of xm[n]we arrive at

    Then, we reject the first M 1 samples

    of wm[n] and abutthe remaining M M

    + 1 samples of wm[n] to form yL[n], the

    linear convolution ofh[n] and x[n]

    Ifym[n] denotes the saved portion ofwm[n], i.e.,

  • 7/30/2019 Finite-Length Discrete Transforms

    34/44

    Linear Convolution using the DFT

    The approach is called overlap-save

    method since the input is segmented

    into overlapping sections and parts of

    the results of the circular convolutions

    are saved and abutted to determine the

    linear convolution result

  • 7/30/2019 Finite-Length Discrete Transforms

    35/44

    Discrete Cosine Transform

    In general, the N-point DFT X[k] oflength-N real sequence is a complex

    sequence satisfying the symmetry

    condition

    For N even, the DFT samples X[0]

    and X[N-2]/2 are real and distinct. The

    remaining N-2 DFT samples are

    complex and only half of these samples

    are distinct

    For N odd, the DFT samples x[0] is

    real and the remaining N-1 DFT

    samples are complex, of which only half

    of these samples are distinct

    The DFT of a real symmetric and anti-symmetric finite sequence is a product

    of a linear phase term and a real

    amplitude function.

    Orthogonal transform is based onconverting an arbitrary sequence into

    either a symmetric or an anti-symmetric

    sequence and then extracting the real

    orthogonal transform coefficients from

    the DFT, the transform develop via this

    approach is called discrete cosine

    transform (DCT)

    kX=X[k]*

  • 7/30/2019 Finite-Length Discrete Transforms

    36/44

    Discrete Cosine Transform

    To develop the expression for theDCT for symmetric periodic sequence,

    consider type 1 DCT.

    then the extracted periodic is given by

    To develop the Type-2 DCT, extracty[n] of the symmetric periodic sequence

    let x[n] be a length-N sequencedefined for 0nN-1. First, x[n] is

    extended to a length-2N sequence by

    zero padding.

    Next, type-2 symmetric sequence y[n]

    of length 2N is formed from xe[n]

    according to

    {}{ cba=x[n]

    {}{ cdcba=y[n]

    {}{ bcddcba=y[n]

    2,010],[][

    nN

    Nnnxnxe

    ][nxe

    120

    ]12[][][

    Nn

    nNxnxn ee

    2],12[

    0],[

    nNnNx

    nnx

  • 7/30/2019 Finite-Length Discrete Transforms

    37/44

    Discrete Cosine Transform

    The generated sequence y[n]satisfies the symmetry property.

    the 2N-point DFT Y[k] of the length-2N sequence y[n] is thus

    rewrite

    By making a change of variables, the

    DFT Y[k] can be expressed as

    The Type-2 N point DCT,

    The samples of XDCT[k] are real for

    real sequence x[n]

    ]12[][ nNyn

    20,][][12

    0

    2 nWnykYN

    n

    kn

    N

    120

    ,]12[,][

    ,][][][

    12

    0

    2

    1

    0

    2

    1

    0

    12

    0

    22

    Nk

    WnNxWnx

    WnyWnykY

    N

    n

    kn

    N

    N

    n

    kn

    N

    N

    n

    N

    n

    kn

    N

    kn

    N

    120

    ,2

    )12(cos][2

    ][

    ,][][][

    1

    0

    2/

    2

    1

    0

    2/

    22

    2/

    222

    1

    0

    1

    0

    )12(

    222

    Nk

    N

    nknxW

    WWWWnxW

    WWnxWnxkY

    N

    n

    k

    N

    N

    n

    k

    N

    kn

    N

    k

    N

    kn

    N

    kn

    N

    N

    n

    N

    n

    Nk

    N

    kn

    N

    kn

    N

    XDCT

    [ k]= n= 0

    N 1

    2x[n ] cos(k(2n + 1)2N ),0 k 2N 1

  • 7/30/2019 Finite-Length Discrete Transforms

    38/44

    Discrete Cosine Transform

    The inverse discrete cosine transform

    (IDCT) of an N-point DCT XDCT[k] is

    given by

    where

    a DCT pair may often be denoted as

    it can be shown that

    In other words, the basis sequence

    are orthogonal to each other.

    To verify that x[n] is indeed the IDCT

    of XDCT[k]

    The IDCT of an N-point DCT XDCT[k]

    can also be computed using the DFT

    120

    2

    )12(cos][][

    1][

    1

    0

    Nk

    N

    nkkXk

    Nnx

    N

    n

    DCT

    1102/1][k

    kk

    x [ k] DCT

    XDCT[ k]

    ,,0

    ,0,2/1

    ,0,1

    2

    )12(cos

    2

    )12(cos

    1 1

    0

    mk

    mk

    mk

    N

    nm

    N

    nk

    N

    N

    n

    Nnk2

    )12(cos

    10

    2

    )12(cos

    2

    )12(cos

    1][][2

    2

    )12(cos

    2

    )12(cos][][

    2][

    1

    0

    1

    0

    1

    0

    1

    0

    Nk

    N

    nk

    N

    nl

    NlXl

    N

    nk

    N

    nllXl

    NkX

    N

    l

    N

    l

    DCT

    N

    n

    N

    l

    DCTDCT

    21],2[

    ,,0

    10][

    ][

    2/

    2

    2/

    2

    kNkNXW

    Nk

    NkkXW

    kY

    DCT

    k

    N

    DCT

    k

    N

  • 7/30/2019 Finite-Length Discrete Transforms

    39/44

    Discrete Cosine Transform

    The 2N-point IDFT y[n] of Y[k] is

    given by

    We get

    The length-N IDCT x[n] of the N-point

    DCT

    The DCT satisfies a number ofproperties that are useful in certain

    application. Assume all time domain

    sequences to be length N with an N-

    point DCT.

    The DCT XDCT[k] of a sequence

    obtained by a linear combination of two

    sequences, g[n] and h[n]. Where and arbitrary constants.

    20,][2

    1][

    12

    0

    2 nWkyNnN

    k

    kn

    N

    12

    1

    (

    2

    1

    0

    )2

    1(

    2 ]2[

    2

    1][

    2

    1][

    N

    Nk

    DC

    N

    k

    kn

    NDCT kX

    N

    WkX

    N

    n

    1

    1

    2)(2

    1(

    2

    1

    0

    )2

    1(

    2 ][2

    1][

    2

    1 N

    k

    n

    NDC

    N

    k

    kn

    NDCTkX

    NWkX

    N

    1

    1

    (

    2

    12

    0

    )2

    1(

    2 ][2

    1][

    2

    1 N

    k

    DC

    N

    k

    kn

    NDCTkX

    NWkX

    N

    120

    2

    )12(cos][

    1

    2

    ]0[ 1

    1

    Nn

    nkkX

    NN

    XN

    k

    DCT

    DCT

    10][][ Nnnynx

    DCT Properties

    ][][

    ][][

    kHnh

    kGng

    DCT

    DCT

    DCT

    DCT

    Linearity Property

    [][][][ kGnhng DDCTDCT

  • 7/30/2019 Finite-Length Discrete Transforms

    40/44

    The Haar Transform

    The DCT of the conjugate sequenceis given by

    The energy preservation property of

    the DCT is similar to the persevals

    relation for the DFT.

    Symmetry Properties

    Energy Preservation Property

    ][][ ** kGng DCTDCT

    1

    0

    1

    0

    2|][|][

    2

    1|][|

    N

    k

    D

    N

    n

    GkN

    ng

    The discrete-time Haar transform isderived by sampling the continouse-

    time Haar function.

    The set of Haar function hl(t) contains

    N numbers, with N a power-of-2 positive

    integer: that is N=2v+1, where v 0.

    In defining the Haar function, the

    integer subscript l is uniquely

    represented as a function of two non

    negative integer variable, r and s.

    Where variables r and s have ranges

    0 r v; 0 s 2r

    The Haar Transform

    12 sl r

  • 7/30/2019 Finite-Length Discrete Transforms

    41/44

    The Haar Transform

    The NN discrete-time Haar

    transform matrix HN is obtained by

    discretizing the Haar functions at

    discrete values of t, given by t = n/N,

    0 n N-1

    Definition

    To derive the high order Haartransform

    Where denotes the kroneckerproduct and IK is the KK identity.

    The N-point transform XHaar of length

    N sequence x[n] is given by

    where l= 2r+s 1

    10,1)()( 0,00 tthth

    00

    22

    5.0

    2

    ,2

    5.0

    2

    1,2

    )()(

    2/

    2/

    ,

    tforotherwise

    s

    t

    s

    st

    s

    thth rrr

    rr

    r

    srl

    .1,112

    11

    2

    2/

    2

    12v

    I

    HH

    v

    v

    vv

    ,.xHhNHaar

    HaHaarHaarHaar XXXh []...1[]0[

    Nxxxx ]1[]...1[]0[

  • 7/30/2019 Finite-Length Discrete Transforms

    42/44

    The Haar Transform

    The inverse Haar transform is giveby

    2 2 normalized Haar ransform

    matrix is given by

    Higher order normalized Haar

    transform is given by

    Haar Transform Properties

    The Haar transform matrix is

    orthogonal and hence

    Haar transform expression reduced to

    If denote the (k, l)-th element of HN ashN(k,l) then

    t

    NN HNH

    11

    10

    [),(1

    ][1

    0

    Nn

    XlkhN

    nxN

    k

    HaN

    HaarNXHx1

    2

    1

    2

    1

    2

    1

    2

    1

    x

    .0,

    2

    1

    2

    1

    2

    1

    2

    1

    2

    ,2

    21v

    I

    H

    H

    v

    v

    v

    n

    Orthogonality Property

    HaartNXH

    Nx1

  • 7/30/2019 Finite-Length Discrete Transforms

    43/44

    The Haar Transform

    The expression is similar to theParsevals relation for the DFT also

    exists for the Haar transform

    If L samples of the transform with

    indices in the range R are set to zero

    with L < < N and if x(m) [n] denotes the

    inverse of the modified transform, then

    a measure of the energy compaction

    property

    Energy conservation property Consider the energy compaction

    proper of the DFT, the DCT and theHaar transform.

    N-point DFT, the high frequency

    indices around

    The Discrete Fourier Transform

    12

    1],[

    2

    1

    2

    1

    ,0

    2

    10],[

    ][)(

    NkLN

    kX

    N

    k

    LN

    LNkkX

    kX

    DFT

    DFT

    m

    DFT

    1

    0

    1

    0

    2|][|

    1|][|

    N

    k

    Ha

    N

    n

    kHN

    nx

    Energy Compaction Properties

    1

    0

    )(|][][|

    1)(N

    k

    mxnx

    NL

  • 7/30/2019 Finite-Length Discrete Transforms

    44/44

    The Energy Compaction Properties

    The original time domain sequence

    x[n] is obtained by computing the IDFT

    The corresponding approximation

    error is given by

    The high frequency samples havehigh indices and thus the modified DCT

    obtained

    The original time domain sequence

    x[n] is obtained by computing the IDCT

    Hence the approximation error is

    The modified Haar transform obtained

    The x[n] is obtained by computing theIDCT

    1

    0

    )()(][

    1][

    N

    k

    m

    DFT

    m

    DFT kXNn

    1

    0

    )(|][][|

    1)(N

    k

    m

    DXnx

    NL

    The Discrete Cosine Transform

    10][][)(

    NkkXkDCTm

    DCT

    LN

    k

    mDCT

    mDCT kkXkNn

    1

    0

    )()(

    22(co][][1][

    1

    0

    )( |][][|1)(N

    k

    m

    DCxnxNL

    The Haar Transform

    0

    10][][)(

    kLN

    NkkXkHaarm

    Haar

    LN

    k

    H

    m

    Haar XnkhNnx

    1

    0

    )( [],[1][

    1)( |][][|

    1)(N

    m

    HaxnxL