EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal...

24
Note Set #19 Details of the DFT Reading Assignment: Sect. 7.1.2, 7.1.3, & 7.2 of Proakis & Manolakis EEO 401 Digital Signal Processing Prof. Mark Fowler

Transcript of EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal...

Page 1: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

Note Set #19• Details of the DFT• Reading Assignment: Sect. 7.1.2, 7.1.3, & 7.2 of Proakis & Manolakis

EEO 401 Digital Signal Processing

Prof. Mark Fowler

Page 2: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

2/24

So… Given N signal data points x[n] for n = 0, …, N-1 Compute N DFT points using:

1

0

/2 1...,,2,1,0][][N

n

Nknj NkenxkX

2k k

N

Definition of the DFT

So… Given N DFT points X[k] for k = 0, …, N-1 Compute N signal data points using:

1

0

/2 1...,,2,1,0][1][N

n

Nknj NnekXN

nx

Inverse DFT (IDFT)

Page 3: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

3/24

DFT as a Matrix Operator (Linear Transformation)

1

0

/2 1...,,2,1,0][][N

n

Nknj NkenxkX

12 0 /

0

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

j n N

n

X x n e x x x N x N

12 1 / 2 1/ 2 1( 1)/

0

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

j n N j N j N N

n

X x n e x x e x N e

12 ( 1) / 2 1( 1)/ 2 ( 1)( 1)/

0

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

j N n N j N N j N N N

n

X N x n e x x e x N e

2 11/ 2 2 1/ 2 ( 1) 1/

2 1( 1)/ 2 2( 1)/ 2 ( 1)( 1)/

[0] 1 1 1 1 [0][1] 1 x[1]

[ 1] 1 x[ 1]N N

j N j N j N N

j N N j N N j N N N

X xX e e e

X N e e e N

X x

DFT Matrix

Page 4: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

4/24

It is common to use the WN symbol when discussing the DFT: 2 /j NNW e

“Nth root of unity”

1

0

[ ] [ ] 0,1,2,..., 1N

knN

n

X k x n W k N

1

0

1[ ] [k] 0,1,2,..., 1N

knN

k

x n X W n NN

DFT:

IDFT:

1 2 1

2 4 2( 1)

1 2( 1) ( 1)( 1)

1 1 1 111

1

NN N N

NN N N N

N N N NN N N

W W WW W W

W W W

W

DFT Matrix

N N NX W x 1 *1N N N N NN

x W X W XDFT: IDFT:

Easy to Invert!

Page 5: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

5/24

Properties of DFT

Linearity:

1 1[ ] [ ]DFT

Nx n X k

2 2[ ] [ ]DFT

Nx n X k

1 1 2 2 1 1 2 2[ ] [ ] [ ] [ ]DFT

Na x n a x n a X k a X k

You’ve learned the properties for CTFT and for DTFT… (e.g., delay property, modulation property, convolution property, etc.) and seen that they are very similar (except having to account for the DTFT’s periodicity)

Since the DFT is linked to the DTFT you’d also expect the properties of the DFT to be similar to those of the DTFT…. That is only partially true!

Page 6: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

6/24

Periodicity:

[ ] [ ]X k N X k k

1. DFT points computed using the DFT formula are periodic

2. Signal samples computed using the IDFT formula are periodic

[ ] [ ]x n N x n n

Proof of #2:1

2 ( ) /

0

1[ ] [ ]N

j n N k N

k

x n N X k eN

1

2 / 2 /

0

1 [ ]N

j Nn N j kn N

k

X k e eN

= 1

[ ]x n

Proof of #1 is virtually identical

#1 is not surprising… it comes from the periodicity of the DTFT…

Note that #2 says the periodicity is for the samples AFTER doing an IDFT!!!

This has a big impact on other properties such as convolution & delay properties!!

Page 7: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

7/24

Note that #2 says the periodicity is for the samples AFTER doing an IDFT!!!

0 1 2 3 4 5 6 7-10

0

10

20

30

n

ReX

[k]

0 1 2 3 4 5 6 7-10

-5

0

5

10

n

ImX

[k]

x[n]

n

……

n

xN[n]

Ext

ract

n

12 /

0

[ ] [ ]N

j kn NN

k

x n X k e

……

These are not “really there”… but they are “mathematically there”!!!

Page 8: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

8/24

This periodic “vestige” of the signal that arises in the context of the DFT can be captured this way:

Let this be the L-point signal (segment) with L ≤ N: [ ]x n

Define a N-period periodic signal by [ ] [ ]pl

x n x n lN

= 0 n < 0, n > L -1

Then the periodicity property can be expressed as:

[ ] [ ]p N Nx n IDFT DFT x nN-pt DFT of signal with L ≤ Npoints implies zero-padding out to N points

Page 9: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

9/24

Circular Shift (Defined) Math Notation for Circular Shift

[[ ]] [ ,mod ]Nx n k x n k N

n n mod 4-3 1-2 2-1 30 01 12 23 34 05 16 27 38 0

Page 10: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

10/24

Circular Shift Property of the DFT

Recall the shift property of the DTFT (which is virtually the same as for the CTFT): f f[ ] [ ] ( ) ( )j ly n x n l Y e X

Imparts additional linear phase term of “integer slope”

“Regular” time shift… this is for DTFT

For DFT we have a similar property but it involves circular shift rather than regular shift!!

d d 2 / d[ ] [[ ]] [ ] [ ] [ ]kl j kl NN Ny n x n l Y k W X k e X k

Discrete frequencies

@ 2πk/N

What this says is:1. If you circularly shift a signal then the corresponding DFT has a

linear phase term added… or alternatively2. If you impart a linear phase shift of integer slope to the DFT, then

the corresponding IDFT will have a circular shift imparted to it.

#2 is the most common scenario that arises…

This is a direct result of #2 of “Periodicity”

Page 11: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

11/24

Proof: The “obvious” way to “see” this is to use the periodic extension view of the IDFT: d[ ] [ ]p Nx n IDFT X k

1

2 / d 2 / d 2 /

0

12 ( )/ d

0

1[ ] [ ]

1 [ ]

Nj kl N j kl N j kn N

Nk

Nj k n l N

k

IDFT e X k e X k eN

e X kN

IDFT evaluated at n–l… i.e. Shifted version of periodic

extension

[ ] [[ ]]p Nx n l x n l

Page 12: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

12/24

More step-by-step proof as in the book:

1

2 /

0

1 12 / 2 /

0 [ ]

1 12 / 2 /

0

1 12 ( )/ 2 ( )/

0

[[ ]] [[ ]]

[[ ]] [ ]

[ ] [ ]

[ ] [ ]

Nj kn N

N Nn

l Nj kn N j kn N

Nn n lx N m n

l Nj kn N j kn N

n n l

N Nj k m l N j k m l N

m N l m

DFT x n l x n l e

x n l e x n l e

x N l n e x n l e

x m e x m e

12 / 2 / 2 / d

0

[ ] [ ]

l

Nj kl N j km N j kl N

m

e x m e e X k

When n ≥ l we don’t need the mod operation!

Explicit form for mod

Change of variables in each sum

Combine into single sum

Split from expand pull out

Final Result!

Page 13: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

13/24

Circular Modulation Property of the DFT

2 / d d d[ ] [ ] [ ] [ ] [[ ]] [( ) mod ]nm j nm NN Ny n W x n e x n Y k X k m X k m N

What this says is:1. If you modulate the signal (segment) by a frequency equal to one of

the discrete frequencies, then the corresponding DFT will have a circular shift imparted to it.

2. If you circularly shift a DFT then its IDFT will have a modulation imparted at a frequency equal to a discrete frequency.

The cyclic nature here is the same as for the DTFT… due to the fact that the DTFT is periodic with period of 2π.

Where this differs from the DTFT version is that the modulation frequency must be one of the discrete frequencies of the DFT.

Page 14: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

14/24

Circular Convolution Property of the DFT For CTFT and DTFT we had the most important property of all – the convolution property:

convolution in time domain gives multiplication in frequency domain

For the DFT this property gets changed due to the circular properties of DFT & IDFT. Later we’ll see the ramifications of this.

d1 1

d d1 2 1 2

d2 2

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

[ ] [ ]

DFT

DFTN

N NDFT

N

x n X kx n x n X k X k

x n X k

My symbol for “circular” convolution of two length N signal segments… book uses a different symbol that I could not make!

Circular convolution itself is not really something we “want”… rather we end up here because we ask this question:

Given that multiplying 2 DTFTs corresponds to time-domain convolution… Does the same thing hold for multiplying two DFTs???

The answer is: “sort of” but it gives circular convolution. And since LTI systems do “regular” convolution this result at first seems not that useful.

Page 15: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

15/24

Proof: The periodic extension view of the IDFT provides some insight that this property likely holds… but we need to prove it!

You’ll notice that the proof follows the line of the question we just asked: What happens in the time-domain when I multiply two DFTs???

1d 2 /

0

[ ] [ ] , 0,1,2,..., 1N

j nk Nm m

n

X k x n e k N

For m = 1, 2

d d d3 1 2[ ] [ ] [ ], 0,1,2,..., 1X k X k X k k N

1 1d 2 / d d 2 /

3 3 1 20 0

1 1[ ] [ ] [ ] [ ]N N

j nk N j nk N

k k

x n X k e X k X k eN N

VERY important to sub in w/ different summation dummy

variables!!!

1 1 12 / 2 / 2 /

1 20 0 0

1 [ ] [ ]N N N

j mk N j lk N j nk N

k m l

x m e x l e eN

1 1 12 ( )/

1 20 0 0

1 [ ] [ ]N N N

j k n m l N

m l k

x m x l eN

Need to evaluate!

Page 16: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

16/24

Aside: 12 /

0

, ( is integer)[[ ]]

0, otherwise

Nj kn N

Nk

N n kN ke N n

For “otherwise” this can be established via the geometric summation result:

2 /1 12 / 2 /

2 /0 0

2 /

2 / 2 /

11

1 1 1 01 1

Nj n NN N kj kn N j n Nj n N

k k

j nN N

j n N j n N

ee e

e

ee e

The result is obvious for n = kN since for that case we are summing N 1s.

Re

Im

This can also be seen graphically:

For n = kN

Re

ImFor n ≠ kN

Like evenly spaced forces that cancel out!(Yes… holds for odd N too!)

Page 17: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

17/24

1 1 12 ( )/

3 1 20 0 0

1[ ] [ ] [ ]N N N

j k n m l N

m l k

x n x m x l eN

So… picking up where we left off:

[[ ]]NN n m l

1 1

1 20 0

[ ] [ ] [[ ]]

Sifting Property but w/ mod nature!

N N

Nm l

x m x l n m l

N

1

3 1 2 1 20

[ ] [ ] [[ ]] [ ] [ ]N

N Nm

x n x m x n m x n x n

Here we finish the proof

& define the term “circular convolution”

“Flip & Shift” but with Mod!!! Need to understand “Circular Time Reversal” to

see how this works!

Page 18: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

18/24

Circular Reversal: Reverse about 0 on the circle

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

Yes 0!!

[ ] [ ][0] [0][1] [7][2] [6][3] [5][4] [4][5] [3][6] [2][7] [1]

x n x N nx xx xx xx xx xx xx xx x

N = 8

Forward

Reverse

n

x[n]

n

x[[-n]]N

[[ ]]Nx n

Page 19: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

19/24

Circular Convolution Example:

Flipped

1

3 1 20

[ ] [ ] [[ ]]N

Nm

x n x m x n m

x3[0] = sum of these= 2 + 4 + 6 + 2 = 14

Product Sequence for n = 0

Page 20: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

20/24

Circular Convolution Ex. (p. 2):

Flipped

1

3 1 20

[ ] [ ] [[ ]]N

Nm

x n x m x n m

x3[1] = sum of these= 4 + 1 + 8 + 3 = 16

Product Sequence for n = 1for n = 1

Etc…. See textbook for the rest of the example

Page 21: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

21/24

Circular Convolution Ex. (p. 3): Alternate view using periodized signals

“Original” Signals:

n = 0 Output Sample: 1. Flip periodized version around this point2. No shift needed to get n = 0 Output Value3. Sum over one cycle

Page 22: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

22/24

Circular Convolution Ex. (p. 4):

n = 1 Output Sample: Shift by 1 & Sum over one cycle

n = 2 Output Sample: Shift by 2 & Sum over one cycle

n = 3 Output Sample: Shift by 3 & Sum over one cycle

Page 23: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

23/24

DFT of Product of Two Signals

d1 1

d d1 2 1 2

d2 2

[ ] [ ]1[ ] [ ] [ ] [ ]

[ ] [ ]

DFT

DFTN

N NDFT

N

x n X kx n x n X k X k

Nx n X k

This is the “dual” of the Convolution Property of DFTs… so the proof is very similar.

Parseval’s Theorem for DFT

*

d1 1 1 1

* d d1 2 1 2

0 0d2 2

[ ] [ ]1[ ] [ ] [ ] [ ]

[ ] [ ]

DFT

N NN

DFT n n

N

x n X kx n x n X k X k

Nx n X k

1 1 22 d

0 0

1[ ] [ ]N N

n k

x n X kN

Special Case:

Page 24: EEO 401 Digital Signal Processing - Binghamtonws.binghamton.edu/Fowler/Fowler Personal Page/EE302...Note Set #19 • Details of the DFT • Reading Assignment: Sect. 7.1.2, 7.1.3,

24/24

DFT of Complex-Conjugate

* *d * d d[ ] [ ] [ ] [[ ]] [ ]DFT DFT

NN Nx n X k x n X k X N k

IDFT of Complex-Conjugate

*d * * d[ ] [ ] [[ ]] [ ] [ ]DFT DFT

NN Nx n X k x n x N n X k

Take conjugate here

Take conjugate here