69
The Discrete Fourier Transform

DFT.ppt

Embed Size (px)

Citation preview

Page 1: DFT.ppt

The Discrete Fourier Transform

Page 2: DFT.ppt

Content Introduction Representation of Periodic Sequences

– DFS (Discrete Fourier Series) Properties of DFS The Fourier Transform of Periodic Signals Sampling of Fourier Transform Representation of Finite-Duration Sequences

– DFT (Discrete Fourier Transform) Properties of the DFT Linear Convolution Using the DFT

Page 3: DFT.ppt

The Discrete Fourier Transform

Introduction

Page 4: DFT.ppt

Signal Processing Methods

Time

Continuous

Discrete

PeriodicityPeriodic Aperiodic

Fourier SeriesFourier Series Continuous-TimeFourier Transform

Continuous-TimeFourier Transform

DFSDFS

DurationFinite Infinite

Discrete-TimeFourier Transformand z-Transform

Discrete-TimeFourier Transformand z-Transform

Page 5: DFT.ppt

Frequency-Domain Properties

Time

Continuous

Discrete

PeriodicityPeriodic Aperiodic

Fourier SeriesFourier Series Continuous-TimeFourier Transform

Continuous-TimeFourier Transform

DFSDFS

DurationFinite Infinite

Discrete-TimeFourier Transformand z-Transform

Discrete-TimeFourier Transformand z-Transform

Discrete &

Aperiodic

Discrete &

Aperiodic

Continuous &

Aperiodic

Continuous &

Aperiodic

Continuous &

Periodic (2)

Continuous &

Periodic (2)??

Page 6: DFT.ppt

Frequency-Domain Properties

Time

Continuous

Discrete

PeriodicityPeriodic Aperiodic

Fourier SeriesFourier Series Continuous-TimeFourier Transform

Continuous-TimeFourier Transform

DFTDFT

DurationFinite Infinite

Discrete-TimeFourier Transformand z-Transform

Discrete-TimeFourier Transformand z-Transform

Discrete &

Aperiodic

Discrete &

Aperiodic

Continuous &

Aperiodic

Continuous &

Aperiodic

Continuous &

Periodic (2)

Continuous &

Periodic (2)??

Relation?

Relation?

Relation?Relation?

Page 7: DFT.ppt

Frequency-Domain Properties

Time

Continuous

Discrete

PeriodicityPeriodic Aperiodic

Fourier SeriesFourier Series Continuous-TimeFourier Transform

Continuous-TimeFourier Transform

DFTDFT

DurationFinite Infinite

Discrete-TimeFourier Transformand z-Transform

Discrete-TimeFourier Transformand z-Transform

Discrete &

Aperiodic

Discrete &

Aperiodic

Continuous &

Aperiodic

Continuous &

Aperiodic

Continuous &

Periodic (2)

Continuous &

Periodic (2)

Discrete &

Periodic

Discrete &

Periodic

Page 8: DFT.ppt

The Discrete Fourier Transform

Representation of Periodic Sequences --- DFS

Page 9: DFT.ppt

Periodic Sequences

Notation: a sequence with period N

)(~)(~ rNnxnx )(~)(~ rNnxnx

where r is any integer.

Page 10: DFT.ppt

HarmonicsknNj

k ene )/2()( knNjk ene )/2()(

)()(),()( 110 nenenene NN

Facts:)()( rNnene kk

,2,1,0 k

Each has Periodic N.

N distinct harmonics e0(n), e1(n),…, eN1(n).

Page 11: DFT.ppt

Synthesis and Analysis

Notation )/2( NjN eW )/2( Nj

N eW

Synthesis

1

0

)(~

)(~N

k

knNWkXnx

1

0

)(~

)(~N

k

knNWkXnx

Analysis1

0

1( ) ( )

Nkn

Nn

X k x n WN

1

0

1( ) ( )

Nkn

Nn

X k x n WN

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

Both have Period N

Page 12: DFT.ppt

Example

r

rNnnx )()(~

r

rNnnx )()(~ A periodic impulse train with period N.

1)(~)(~ 1

0

knN

N

n

WnxkX

1

0

)/2(1

0

11)(~

N

k

knNjN

k

knN e

NW

Nnx

Page 13: DFT.ppt

Example

k

k

n

kn

W

WWkX

10

510

4

010 1

1)(

~

0 1 2 3 4 5 6 7 8 9 n

)10/sin(

)2/sin()10/4(

k

ke kj

Page 14: DFT.ppt

Example

k

k

n

kn

W

WWkX

10

510

4

010 1

1)(

~

0 1 2 3 4 5 6 7 8 9 n

)10/sin(

)2/sin()10/4(

k

ke kj

Page 15: DFT.ppt

Example

k

k

n

kn

W

WWkX

10

510

4

010 1

1)(

~

0 1 2 3 4 5 6 7 8 9 n

)10/sin(

)2/sin()10/4(

k

ke kj

Page 16: DFT.ppt

DFS vs. FT)(~ nx )(~ nx

0 N nN

0 n

)(nx )(nx

0

)()(n

njj enxeX

1

0

)(N

n

njenx

1

0

)/2()(~)(~ N

n

knNjenxkX

Nk

jeXkX/2

)()(~

Page 17: DFT.ppt

Example

0 1 2 3 4 5 6 7 8 9 n

0 1 2 3 4 5 6 7 8 9 n

)(~ nx )(~ nx

)(nx )(nx

)2/sin(

)2/5sin(

1

1)( 2

54

0

jj

j

n

njj ee

eeeX

)10/sin(

)2/sin()()(

~ )10/4(

10/2 k

keeXkX kj

k

j

Page 18: DFT.ppt

Example

0 1 2 3 4 5 6 7 8 9 n

0 1 2 3 4 5 6 7 8 9 n

)(~ nx )(~ nx

)(nx )(nx

)2/sin(

)2/5sin(

1

1)( 2

54

0

jj

j

n

njj ee

eeeX

)10/sin(

)2/sin()()(

~ )10/4(

10/2 k

keeXkX kj

k

j

Page 19: DFT.ppt

Example

0 1 2 3 4 5 6 7 8 9 n

0 1 2 3 4 5 6 7 8 9 n

)(~ nx )(~ nx

)(nx )(nx

)2/sin(

)2/5sin(

1

1)( 2

54

0

jj

j

n

njj ee

eeeX

)10/sin(

)2/sin()()(

~ )10/4(

10/2 k

keeXkX kj

k

j

Page 20: DFT.ppt

The Discrete Fourier Transform

Properties of DFS

Page 21: DFT.ppt

Linearity

)(~

)(~11 kXnx DFS )(

~)(~

11 kXnx DFS

)(~

)(~22 kXnx DFS )(

~)(~

22 kXnx DFS

)(~

)(~

)(~)(~2121 kXbkXanxbnxa DFS )(

~)(

~)(~)(~

2121 kXbkXanxbnxa DFS

Page 22: DFT.ppt

Shift of A Sequence

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

)(~

)(~ kXWmnx kmN DFS )(

~)(~ kXWmnx km

N DFS

Change Phase (delay)

)(~

)]([~ kXWlNmnx kmN DFS )(

~)]([~ kXWlNmnx km

N DFS

Page 23: DFT.ppt

Shift of Fourier Coefficient

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

)(~

)(~ lkXnxW nlN DFS )(

~)(~ lkXnxW nl

N DFS

Modulation

Page 24: DFT.ppt

Duality

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

)(~)(~

kxNnX DFS )(~)(~

kxNnX DFS

Page 25: DFT.ppt

Periodic Convolution

)(~

)(~11 kXnx DFS )(

~)(~

11 kXnx DFS

)(~

)(~

)(~)(~21

1

021 kXkXmnxnx

N

m

DFS )(~

)(~

)(~)(~21

1

021 kXkXmnxnx

N

m

DFS

)(~

)(~22 kXnx DFS )(

~)(~

22 kXnx DFS

Both have Period N

Page 26: DFT.ppt

Periodic Convolution

)(~

)(~11 kXnx DFS )(

~)(~

11 kXnx DFS

1

02121 )(

~)(

~1)(~)(~

N

l

lkXlXN

nxnx DFS

1

02121 )(

~)(

~1)(~)(~

N

l

lkXlXN

nxnx DFS

)(~

)(~22 kXnx DFS )(

~)(~

22 kXnx DFS

Both have Period N

Page 27: DFT.ppt

The Discrete Fourier Transform

The Fourier Transform of Periodic Signals

Page 28: DFT.ppt

Fourier Transforms of Periodic Signals

Time

Continuous

Discrete

PeriodicityPeriodic Aperiodic

Fourier SeriesFourier Series Continuous-TimeFourier Transform

Continuous-TimeFourier Transform

DFTDFT

DurationFinite Infinite

Discrete-TimeFourier Transformand z-Transform

Discrete-TimeFourier Transformand z-Transform

Discrete &

Aperiodic

Discrete &

Aperiodic

Continuous &

Aperiodic

Continuous &

Aperiodic

Continuous &

Periodic (2)

Continuous &

Periodic (2)DFSDFSSampling

Sampling

Page 29: DFT.ppt

Fourier Transforms of Periodic Signals

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

)(~ nx )(~ nx

0 N nN

0 n

)(nx )(nx

Nk

jeXkX/2

)()(~

Nk

jeXkX/2

)()(~

k

j

N

kkX

NeXnx

2)(

~2)(

~)(~ FT

Page 30: DFT.ppt

The Discrete Fourier Transform

Sampling of

Fourier Transform

Page 31: DFT.ppt

Equal Space Sampling of Fourier Transform

)()( jeXnx FT )()( jeXnx FT

Nk

jeXkX/2

)()(~

Nk

jeXkX/2

)()(~

jez

zX )(

z-plane z-planekNjez

zXkX)/2(

)()(~

0 n

)(nx )(nx

N’1

?)(~ nx

N N’>=<

Page 32: DFT.ppt

Equal Space Sampling of Fourier Transform

Nk

jeXkX/2

)()(~

Nk

jeXkX/2

)()(~

)()()(~ )/2(

)/2(

kNj

ezeXzXkX

kNj

1

0

)(~1

)(~N

k

knNWkX

Nnx

1

0

)/2( )(1 N

k

knN

kNj WeXN

1

0

)/2()(1 N

k

knN

m

kmNj WemxN

m

N

k

mnkNW

Nmx

1

0

)(1)(

r

N

k

mnkN rNmnW

N)(

1 1

0

)(

r

N

k

mnkN rNmnW

N)(

1 1

0

)(

m r

rNmnmx )()( ( )* ( )r

x n n rN

Page 33: DFT.ppt

Equal Space Sampling of Fourier Transform

kNjezzXkX

)/2()()(

~

kNjezzXkX

)/2()()(

~

( ) ( )* ( )r

x n x n n rN

( ) ( )* ( )r

x n x n n rN

z-plane

Page 34: DFT.ppt

Example

n

)(~ nx )(~ nx

0 8

N=12

12

n

)(nx )(nx

0 8

N’=9

n0 8

N=7

12

)(~ nx )(~ nx

Page 35: DFT.ppt

n

)(~ nx )(~ nx

0 8

N=12

12

n

)(nx )(nx

0 8

N’=9

n0 8

N=7

12

)(~ nx )(~ nx

Example

Time-Domain AliasingTime-Domain Aliasing

Page 36: DFT.ppt

Time-Domain Aliasing vs. Frequency-Domain Aliasing

To avoid frequency-domain aliasing– Signal is bandlimited– Sampling rate in time-domain is high enough

To avoid time-domain aliasing– Sequence is finite– Sampling interval (2/N) in frequency-

domain is small enough

Page 37: DFT.ppt

DFT vs. DFS Use DFS to represent a finite-length sequence

is call the DFT (Discrete Fourier Transform). So, we represent the finite-duration sequence

by a periodic sequence. One period of which is the finite-duration sequence that we wish to represent.

otherwise

Nnnxnx

0

10)(~)(

otherwise

Nnnxnx

0

10)(~)(

Page 38: DFT.ppt

The Discrete Fourier Transform

Representation of

Finite-Duration Sequences --- DFT

Page 39: DFT.ppt

Definition of DFT

Synthesis

1

0

)(~

)(~N

k

knNWkXnx

1

0

)(~

)(~N

k

knNWkXnx

Analysis

1

0

)(~)(~ N

n

knNWnxkX

1

0

)(~)(~ N

n

knNWnxkX

)(~

)(~ kXnx DFS )(~

)(~ kXnx DFS

otherwise

NnWkXnx

N

k

knN

0

10)()(

1

0

otherwise

NnWkXnx

N

k

knN

0

10)()(

1

0

otherwise

NnWnxkX

N

n

knN

0

10)()(

1

0

otherwise

NnWnxkX

N

n

knN

0

10)()(

1

0

)()( kXnx DFT )()( kXnx DFT

Page 40: DFT.ppt

Example)(nx )(nx

5 ),(~ Nnx 5 ),(~ Nnx

)(~

kX )(~

kX

)(kX )(kX

Page 41: DFT.ppt

Example)(nx )(nx

10 ),(~ Nnx 10 ),(~ Nnx

|)(| kX |)(| kX

)(kX )(kX

Page 42: DFT.ppt

The Discrete Fourier Transform

Properties of the DFT

Page 43: DFT.ppt

Linearity

n

)(1 nx )(1 nx

0 N11

Duration N1

n)(2 nx )(2 nx

0 N21

Duration N2

),max( 21 NNN ),max( 21 NNN )()( 11 kXnx DFT )()( 11 kXnx DFT

)()( 22 kXnx DFT )()( 22 kXnx DFT

)()()()( 2121 kbXkaXnbxnax DFT )()()()( 2121 kbXkaXnbxnax DFT

Page 44: DFT.ppt

Circular Shift of a Sequence

0n

)(nx )(nx

N

n

)(~ nx )(~ nx

0 N

n

)(~)(~1 mnxnx )(~)(~

1 mnxnx

0 N

otherwise

Nnmnxnxnx N

0

10))(()(~)( 1

1

otherwise

Nnmnxnxnx N

0

10))(()(~)( 1

1

Page 45: DFT.ppt

Circular Shift of a Sequence

otherwise

Nnmnxnxnx N

0

10))(()(~)( 1

1

otherwise

Nnmnxnxnx N

0

10))(()(~)( 1

1

)()( kXnx DFT )()( kXnx DFT

)(10 ,))(( )/2( kXeNnmnx mNjN

DFT )(10 ,))(( )/2( kXeNnmnx mNjN

DFT

Page 46: DFT.ppt

Duality

)()( kXnx DFT )()( kXnx DFT

10 ,))(()( NkkNxnX NDFT 10 ,))(()( NkkNxnX NDFT

Page 47: DFT.ppt

ExampleChoose N=10Choose N=10

Re[X(k)]Re[X(k)]

Im[X(k)]Im[X(k)]

Re[x1(n)]= Re[X(n)]Re[x1(n)]= Re[X(n)]

Im[x1(n)]= Im[X(n)]Im[x1(n)]= Im[X(n)]

X1(k) = 10x((k))10X1(k) = 10x((k))10

Page 48: DFT.ppt

Linear Convolution (Review)

)(*)()()()( 2113 nxnxmnxmxnxm

)(*)()()()( 2113 nxnxmnxmxnxm

)()( 11 jeXnx FT )()( 11

jeXnx FT)()( 22

jeXnx FT )()( 22 jeXnx FT

)()()()(*)()( 213213 jjj eXeXeXnxnxnx FT )()()()(*)()( 213213

jjj eXeXeXnxnxnx FT

Page 49: DFT.ppt

Circular Convolution

)()())(()()( 21

1

013 nxnxmnxmxnx

N

mN

)()())(()()( 21

1

013 nxnxmnxmxnx

N

mN

)()( 11 kXnx DFT )()( 11 kXnx DFT)()( 22 kXnx DFT )()( 22 kXnx DFT

)()()()()()( 213213 kXkXkXnxnxnx DFT )()()()()()( 213213 kXkXkXnxnxnx DFT

both of length N

Page 50: DFT.ppt

Example

)()( 01 nnnx )()( 01 nnnx

)(2 nx )(2 nx

)(*)( 21 nxnx )(*)( 21 nxnx0

0 N

0 n0 N

)()( 21 nxnx )()( 21 nxnx 0

n0=2, N=5n0=2, N=5

Page 51: DFT.ppt

Example

)()( 01 nnnx )()( 01 nnnx

)(2 nx )(2 nx

)(*)( 21 nxnx )(*)( 21 nxnx0

0 N

0 n0 N

)()( 21 nxnx )()( 21 nxnx

n0=2, N=7n0=2, N=7

0

Page 52: DFT.ppt

Example

otherwise

Lnnxnx

0

101)()( 21

otherwise

Lnnxnx

0

101)()( 21

)()()( 213 nxnxnx )()()( 213 nxnxnx

L=N=6L=N=6

otherwise

kN

WkXkXN

n

knN

0

0

)()(1

021

otherwise

kN

WkXkXN

n

knN

0

0

)()(1

021

otherwise

kNkXkXkX

0

0)()()(

2

213

otherwise

kNkXkXkX

0

0)()()(

2

213

0 L

)(1 nx )(1 nx

0 L

)(2 nx )(2 nx

0 L

)(3 nx )(3 nxN

Page 53: DFT.ppt

Example

)()()( 213 nxnxnx )()()( 213 nxnxnx

otherwise

LkW

W

WkXkX

kL

LkN

L

n

knL

0

1201

1

)()(

2

1)1(

1

0221

otherwise

LkW

W

WkXkX

kL

LkN

L

n

knL

0

1201

1

)()(

2

1)1(

1

0221

otherwise

LkW

WkXkXkX k

L

LkL

0

1201

1 )()()(

2

2

1)1(2

213

otherwise

LkW

WkXkXkX k

L

LkL

0

1201

1 )()()(

2

2

1)1(2

213

otherwise

Lnnxnx

0

101)()( 21

otherwise

Lnnxnx

0

101)()( 21

L=2N=12L=2N=12

0 L

)(2 nx )(2 nx

N

0 L

)(1 nx )(1 nx

N

0

)(3 nx )(3 nx

N

N

Page 54: DFT.ppt

The Discrete Fourier Transform

Linear Convolution Using the DFT

Page 55: DFT.ppt

Why Using DFT for Linear Convolution?

FFT (Fast Fourier Transform) exists.

But., we have to ensure that circular convolving nature of DFT gives the linear convolving result.

Page 56: DFT.ppt

The Procedure

Let x1(n) and x2(n) be two sequences of length L and P, respectively.

1. Compute N-point (N = ?) DFTs X1(k) and X2(k).

2. Let X3(k) = X1(k) X2(k), 0 k N1.

3. Let x3(n) = DFT1[X3(k)] = x1(n) x2(n).

x1(n) * x2(n) = x1(n) x2(n)?x1(n) * x2(n) = x1(n) x2(n)?

Page 57: DFT.ppt

Linear Convolution ofTwo Finite-Length Sequences

m

nmxmxnxnxnx )()( )(*)()( 21213

m

nmxmxnxnxnx )()( )(*)()( 21213

0 L

x1(m)

m

0 P L

x2(m)

m

0P 1 Lm

x2(1 m)

L0 nP+1 nm

x2(n m)

0 n+P1n Lm

x2(L+P1 m)

x3(1) = 0

x3(n) 0

x3(L+P1) = 0

n = 0, 1, , L+P2

Page 58: DFT.ppt

Linear Convolution ofTwo Finite-Length Sequences

m

nmxmxnxnxnx )()( )(*)()( 21213

m

nmxmxnxnxnx )()( )(*)()( 21213

0 L

x1(m)

m

0 P L

x2(m)

m

0P 1 Lm

x2(1 m)

L0 nP+1 nm

x2(n m)

0 n+P1n Lm

x2(L+P1 m)

x3(1) = 0

x3(n) 0

x3(L+P1) = 0

n = 0, 1, , L+P2

Length of x3(n) = x1(n)*x2(n) = L+P1Length of x3(n) = x1(n)*x2(n) = L+P1

Page 59: DFT.ppt

Circular Convolution as Linear Convolution with Time Aliasing

x1(n) Length Lx2(n) Length P

x(n) = x1(n)*x2(n) Length L+P1

)()( 11 jeXnx FT )()( 11

jeXnx FT

)()( 22 jeXnx FT )()( 22

jeXnx FT

)()()()( 21 jjj eXeXeXnx FT )()()()( 21

jjj eXeXeXnx FT

otherwise

NkeXkX

Nkj

0

10)()(Let

)/2(

r

rNnxnx )()(~

otherwise

Nnnxnxp 0

10)(~)(Let ?)()( nxnxp ?)()( nxnxp

Page 60: DFT.ppt

Circular Convolution as Linear Convolution with Time Aliasing

L0

x1(n)n

P

x2(n)

0n

L

0 Pn

L+P1

x (n)

L

Page 61: DFT.ppt

N = L+P1

)()(~ nxnxp )()(~ nxnxp

0n

L+P1

x (n)

L

0n

L+P1

)(~ nx

L

0n

L+P1L

Page 62: DFT.ppt

For Finite Sequences

L0

x1(n)n

P

x2(n)

0n

x p(n) = x1(n)*x2(n)

= x1(n)x2(n), 0 n L+P2

Zero padding to length L+P1

Zero padding to length L+P1

0n

L+P2

Page 63: DFT.ppt

N = L

0 P1 nL+P1

x (n)

L

0 P1 nL+P1

)(~ nx

L L

0 P1 nL+P1L

otherwise

LnPnx

PnLnxnx

nxp

0

1)(

20)()(

)(~

otherwise

LnPnx

PnLnxnx

nxp

0

1)(

20)()(

)(~

Page 64: DFT.ppt

N = L

0 P1 nL+P1

x (n)

L

0 P1 nL+P1

)(~ nx

L L

0 P1 nL+P1L

otherwise

LnPnx

PnLnxnx

nxp

0

1)(

20)()(

)(~

otherwise

LnPnx

PnLnxnx

nxp

0

1)(

20)()(

)(~

Corrupted(P1) points

Uncorrupted(LP+1) points

Page 65: DFT.ppt

FIR Filter for Indefinite-Length Signals

Overlap-Add MethodOverlap-Save Method

x (n)

h (n)

Block Convolution

Page 66: DFT.ppt

Overlay-Add Method

x (n)

h (n)

)(0 nx )(1 nx )(2 nx

otherwise

LnrLnxnxr 0

10)()(

otherwise

LnrLnxnxr 0

10)()(

0

)()(r

r rLnxnx

0

)()(r

r rLnxnx

Page 67: DFT.ppt

Overlay-Add Method

otherwise

LnrLnxnxr 0

10)()(

otherwise

LnrLnxnxr 0

10)()(

0

)()(r

r rLnxnx

0

)()(r

r rLnxnx

0

)()(*)()(r

r rLnynhnxny

0

)()(*)()(r

r rLnynhnxny

)(*)()( nhnxny rr )(*)()( nhnxny rr

Page 68: DFT.ppt

Overlay-Add Method

Set N = L+P1for each block convolution

Page 69: DFT.ppt

Overlay-Save Method

• Each block is of length L.• P1 samples are overlaid btw.

adjacent blocks.• Set N = L+P1 for each block

convolution.• Save the last LP+1 values

for each block convolution.