ln7_dft_part2_v4

Upload: amino-file

Post on 27-Feb-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 LN7_DFT_part2_v4

    1/27

    ilolu 1

    GETTING THE RESULT OF LINEAR CONVOLUTION USING DFT

    Let []and []be -point and -point sequences and []be their linearconvolution.

    Let[]and []be -point DFTs of []and [].The IDFT of [] [][]is the same as the linear convolution of []and[]

    if

    + 1.

  • 7/25/2019 LN7_DFT_part2_v4

    2/27

    ilolu 2

    Ex:Let []and []be 5-point and 9-point sequences, respectively. At leasthow many point DFT has to be used to get the result of their linear convolution?

    Answer: 5+9-1=13 point DFT.

    However, if, for example, 10-point DFT used then

    The result has 10 samples in total

    The first 13-10 = 3 samples out of these 10 samples are not equal to the

    those of the linear convolution

    The remaining 10-3 samples are equal to those of the linear convolution.

    Therefore only 7 samples of the result of linear convolution (13 samples)

    will be obtained.

  • 7/25/2019 LN7_DFT_part2_v4

    3/27

    ilolu 3

    MATLAB Example

    x = [1 2 3]; y = [-1 2 1 2]; z = conv(x,y); z = -1 0 2 10 7 6

    X = fft(x,6)

    X = 6 0.5-4.3i -1.5 + 0.9i 2 -1.5-0.9i 0.5+4.3i

    Y = fft(y,6)

    Y = 4 -2.5 - 2.6i -0.5 - 0.9i -4 -0.5 +0. 9i -2.5 + 2.6i

    Z=X.*Y

    Z =24 -12.5 +9.5i 1.5 + 0. 9i -8 1.5 -0. 9i -12.5 - 9.5i

    z_=ifft(Z) z = -1 0 2 10 7 6

    X = fft(x,5)

    X =6 -0.8 -3.7i 0.3+1.7i 0.3-1.7i -0.8+3. 7i

    Y = fft(y,5)

    Y =4 -2.8 - 1.3i -1.7 - 2.1i -1.7 + 2.1i -2.8 + 1.3i

    Z = X.*Y

    Z =24 -2.5 + 11.4i 3.0 - 3.5i 3.0 + 3.5i -2.5 - 11.4i

    z_= ifft(Z) z_ = 5 0 2 10 7

  • 7/25/2019 LN7_DFT_part2_v4

    4/27

    ilolu 4

    7) Sampling the DTFT

    XN

    jFTD

    eXT

    nx

    length

    Let

    1,...,1,0 2

    NkeXkXN

    k

    j

    where is arbitrary, i.e. not necessarily !

    [] ? ? ?(

    -point IDFT of

    [])

  • 7/25/2019 LN7_DFT_part2_v4

    5/27

    ilolu 5

    [] []= 0 , 1 , , 10 ..

    []= []

    = =

    [] = []=

    [] [ ]=

    [ ]

    =

    Therefore

    ..0

    1,...,1,0

    wo

    NnmNnxnx m

  • 7/25/2019 LN7_DFT_part2_v4

    6/27

    ilolu 6

    Ex: 6, 4

    56 3 3 3

    2

    2 2 2

    1 sin 3

    1sin

    2

    j j j jj

    j

    jj j j

    e e e eX e e

    ee e e

    For N = 4

    0 6 1 1 2 0 3 1X X j X X j

    and

    40

    : 0 0 2 2 1 1 0 0n

    x n

    x n

    5

    m

    mnx 4

    5

    5

    nx

  • 7/25/2019 LN7_DFT_part2_v4

    7/27

    ilolu 7

    Ex: Demonstration of the proof. 8 , 5

    n

    nj

    n

    njj

    enx

    enxeX

    7

    0

    4

    5

    3

    5

    2

    5

    5

    7

    5

    6

    5

    5

    5

    4

    5

    3

    5

    2

    55

    5

    5

    2

    4

    3

    72

    61

    50

    76543210

    2

    5

    1

    5

    0

    5

    k

    k

    k

    k

    W

    k

    W

    k

    W

    kkkkk

    n

    kn

    k

    j

    Wx

    Wx

    Wxx

    Wxx

    xx

    WxWxWxWxWxWxWxx

    Wnx

    eXkX

    kkk

    This is the 5-point DFT of

    44

    33

    722

    611

    500

    xx

    xx

    xxx

    xxx

    xxx

  • 7/25/2019 LN7_DFT_part2_v4

    8/27

    ilolu 8

    8) Multiplication in Time Domain

    DFS

    Let 1x n and 2x n be periodic with common period N.

    1

    DFS

    3 1 2 3 1 2

    0

    1 N

    l

    x n x n x n X k X l X k lN

    DFT

    Let 1x n and 2x n be two finite length sequences and 1X k and 2X k their N-

    point DFTs, 1 2max ,N N N .

    1

    -point DFT

    3 1 2 3 1 2

    0

    10,1,..., 1

    N

    N

    Nl

    x n x n x n X k X l X k l k NN

  • 7/25/2019 LN7_DFT_part2_v4

    9/27

    ilolu 9

    IMPLEMENTING LTI SYSTEMS USING DFT

    The output of an LTI system can be computed using DFT:

    Multiply the DFTs of input and impulse response and compute the IDFT

    There are efficient DFT computation techniques.

    We consider FIR systems with long inputs.

  • 7/25/2019 LN7_DFT_part2_v4

    10/27

    ilolu 10

    BLOCK PROCESSING

    Input is decomposed into short segments and the output is computed by

    properly combining the responses to the short segments.

    Otherwise, it is not practical to consider DFTs of very long sequences.

    Furthermore the output of the system will be delayed excessively since all the

    input has to be collected first..

    h[n]: length P.

    The input is decomposed into blocks of length L.

  • 7/25/2019 LN7_DFT_part2_v4

    11/27

    ilolu 11

    Two Methods

    Overlap-Add

    DFT length: L+P-1 point

    Overlap-Save

    DFT length: Lpoint

  • 7/25/2019 LN7_DFT_part2_v4

    12/27

    ilolu 12

    OVERLAP-ADD METHOD

    Lets start with a linear convolution example

    ,...0,0,3,2,1,0,0...,:0n

    nh 3-point sequence (P= 3)

    ,...0,0,1,1,2,2,1,1,0,0...,:0

    n

    nx

    Linear convolution: 6+3-1 = 8 points

    .. .0,0,3,1,7,1,1,3,1,1,0,0...,:0

    n

    ny

    0n

    31711311

    321

    321

    642

    642

    321

    321

  • 7/25/2019 LN7_DFT_part2_v4

    13/27

    ilolu 13

    By Overlap-add:

    ,...0,0,3,2,1,0,0...,:0n

    nh 3-point sequence (P= 3)

    ,...0,0,1,1,2,2,1,1,0,0...,:0

    n

    nx (In general, infinite length, starts at n = 0)

    Decompose the input, x[n], into L-point segments.

    Lets choose L= 3; could be something else...

    ,...0,0,1,1,2,2,1,1,0,0...,:21

    xx

    nx

    Compute the 5-point(L+P-1) DFTs ofx1and x2 X1and X2

    Compute the 5-point DFT of h H

    Compute

    y1= IDFT{H X1}

    ,...0,0,6,1,3,1,1,0,0...,:1

    y

    and

    y2= IDFT{H X2}

    ,...0,0,3,1,7,5,2,0,0,0,0...,:2

    y

    Compute y[n] by overlap-add, i.e,

    0n

    31711311

    31752

    61311

  • 7/25/2019 LN7_DFT_part2_v4

    14/27

    ilolu 14

    Overlap Add Formally

    Let the impulse response of the system be of length Psamples.

    Decompose the input x n into nonoverlaping, consecutive blocks of length L.

    thr block is

    0

    0 . .r

    x n rL n Lx n

    o w

    so that

    0

    r

    r

    x n x n rL

    Compute the (L+P-1)-point DFT of h n , H k

    For the thr block, the output is found by (L+P-1)-point IDFT of r rY k H k X k ,

    ry n

    0 1 2, , , ...y n y n y n

    The overall output is formed as 0 1 20

    2 ...rr

    y n y n rL y n y n L y n L

  • 7/25/2019 LN7_DFT_part2_v4

    15/27

    ilolu 15

    Overlap Add Pictorially

    samples

    L

    1 samples

    L P

    input segments

    output segments

    0n

  • 7/25/2019 LN7_DFT_part2_v4

    16/27

    ilolu 16

    OVERLAP-SAVE METHOD

    Ex:

    ,...0,0,3,2,1,0,0...,:0n

    nh 3-point sequence (P= 3)

    ,...0,0,1,1,2,2,1,1,0,0...,:0

    n

    nx (In general, infinite length, starts at n = 0)

    Decompose the input, [], into -point segments ( ).Choose 4, could be something else...In overlap-save method, we use -point DFTsTherefore, the first + 1 1samples for each output segmentwill be incorrect. In this example, the first 2 samples...

    Because of the two incorrect samples at each output block, the first segment is

    choosen to start at 1 2

    ,...0,0,1,1,2,2,1,1,0,0,0,0...,:

    1

    x

    nx

    then, the second segment is chosen as

    ,...0,0,1,1,2,2,1,1,0,0,0,0...,: nx

    which overlaps wih the previous segmentby two samples

    1x

    2x

  • 7/25/2019 LN7_DFT_part2_v4

    17/27

    ilolu 17

    Compute the 4-pointDFTs of , , , , , . . . , , , , , . . .Compute the 4-point DFT of Compute ,...0,0,1,1,3,1,0,0...,:1 y ,...0,0,1,3,5,3,0,0...,:2 y ,...0,0,7,1,5,1,0,0...,:3 y

    ,...0,0,3,1,1,1,0,0...,:4

    y ,...0,0,0,0,0,0,0,0...,:5y Compute []by saving the correct samples,

    ...0,0,3,1,7,1,1,3,1,1,0,0...,:0

    n

    ny

    0n

    31711311

    3111

    7151

    1353

    1131

    saved

  • 7/25/2019 LN7_DFT_part2_v4

    18/27

    ilolu 18

    OVERLAP SAVE FORMALLY

    Let < + 1 The first + 1 samples of -point IDFT are incorrect.In particular, if , 1samples are incorrect.So, choose the first input segment, nx

    0, as

    samples

    ,...,1,0,1,...,2,1

    L

    PLxxxxPxPx

    i.e, 1010 LnPnxnx

    Compute its L-point DFT kX0

    Compute the L-point DFT of h kH

    Compute ny0 L-point IDFT of kHkX0 .

    Discard the first (P-1) samples to get the first ouput segment

    0

    0

    1 1

    0 . .

    y n P n Ly n

    o w

    then the first (L-(P-1)) samples of the output are

    0 1 0,1,..., 1 1y n y n P n L P

    Then take the second input segment as

    samples

    122...,,11

    L

    PLxPPLx

    i.e. 122...,,22 PLxPLx

  • 7/25/2019 LN7_DFT_part2_v4

    19/27

    ilolu 19

    and continue the process...

    Overlap Save Pictorially

    samples

    L

    input segments

    output segments

    0n

    1 zerosP

    input segments

    1 samplesP

    -1 samples discardedP

  • 7/25/2019 LN7_DFT_part2_v4

    20/27

    ilolu 20

    LINEAR CONVOLUTION AND CIRCULAR CONVOLUTION

    We know the following

    [] ()[] ()

    (

    ) (

    )(

    )

    [] ()} [] []

  • 7/25/2019 LN7_DFT_part2_v4

    21/27

    ilolu 21

    Now, the question is [] ?

    [] [][] []

    where [] ()()=

    0 , 1 , , 1

  • 7/25/2019 LN7_DFT_part2_v4

    22/27

    ilolu 22

    We know that IDFT yields

    [] { [ ]

    = 0 , 1 , , 10 ..

  • 7/25/2019 LN7_DFT_part2_v4

    23/27

    ilolu 23

    Therefore -point circular convolution of []and []can also be computedvia linear convolution:

    Compute

    [] [] []Then, you can find [] []as

    [] [] {

    [ ]= 0 , 1 , , 10 ..

    or as

    [] [] [][]

  • 7/25/2019 LN7_DFT_part2_v4

    24/27

    ilolu 24

    Ex:

    [] 0 0 1= 2 0 0

    [] 0 0 2= 1 1 0 0 a) Let[]and []be 5-point DFTs of[]and[], respectively.Find the sequence[] [] [].b) Let[]and []be 3-point DFTs of[]and[], respectively. Find thesequence [] [] []c) Let

    [] (

    )|= 0 , 1

    [] ()|= 0 , 1Find the sequence []obtained by applying 2-point inverse DFT operation to[] [].

  • 7/25/2019 LN7_DFT_part2_v4

    25/27

    ilolu 25

    a) [] [] []

    [] ( )

    = 0,1,2,3,4

    [0] () + [1] ( 1) 0,1,2,3,4

    Therefore

    [] 0 0 2= 3 3 2 0 0

    Or, since the linear convolution of []and[]yields (3+2-1) 4-pointsequence and the DFTs are 5-point, 5-point circular convolution and linear

    convolution yields the same result.

    [] [] [] [] [][]

    02332

    02240

    00112

  • 7/25/2019 LN7_DFT_part2_v4

    26/27

    ilolu 26

    b) [] [] []

    [] ( )

    = 0,1 ,2

    [0] () + [1] ( 1) 0 ,1 ,2

    Therefore

    [] 0 0 3= 3 0 0 or

    [] [] []

    {

    [ 3]= 0,1 ,2

    0 ..

    330

    2332

    2332

    2332

    210

    nnn

    330

    242

    112

  • 7/25/2019 LN7_DFT_part2_v4

    27/27

    c)

    [

    ] {

    12 [][]

    = 0 , 1

    0 . .

    {

    [ 2]= 0 , 1

    0 . .

    where [] [] [](linear conv.)

    Therefore

    [] 0 0 1= 3 0 0

    31

    2332

    2332

    2332

    10

    nn