11
Fast Fourier Transform (FFT) Problem : we need an efficient way to compute the DFT. The answer is the FFT. Consider a data sequence and its DFT: x x x xN [ (), (),..., ( )] 0 1 1 1 ,..., 0 , ) ( ) ( 1 0 N k w n x k X N n kn N We can always break the summation into two summations: one on even indices (n=0,2,4,…) and one on odd indeces (n=1,3,5,…), as 1 ,..., 0 , ) ( ) ( ) ( N k w n x w n x k X even n odd n kn N kn N

Fast Fourier Transform (FFT)

Embed Size (px)

DESCRIPTION

Fast Fourier Transform (FFT) Problem : we need an efficient way to compute the DFT. The answer is the FFT. Consider a data sequence and its DFT:. - PowerPoint PPT Presentation

Citation preview

Page 1: Fast Fourier Transform (FFT)

Fast Fourier Transform (FFT)

Problem: we need an efficient way to compute the DFT. The answer is the FFT.

Consider a data sequence and its DFT:x x x x N [ ( ), ( ),..., ( )]0 1 1

1,...,0,)()(1

0

NkwnxkXN

n

knN

We can always break the summation into two summations: one on even indices (n=0,2,4,…) and one on odd indeces (n=1,3,5,…), as

1,...,0,)()()( NkwnxwnxkXevenn oddn

knN

knN

Page 2: Fast Fourier Transform (FFT)

X k x n w x n wNkn

n evenN

kn

n odd

( ) ( ) ( )

wN /2wN /2

since w e e wNj N j N

N2 2 2 2 2

2 / ( / )/

Let us assume that the total number of points N is even, ie N/2 is an integer. Then we can write the DFT as

x m w x m w

x m w w x m w

Nk m

m

N

Nk m

m

N

N

km

m

N

Nk

N

km

m

N

( ) ( )

( ) ( )

( ) ( )2 2 1

2 2 1

2

0

21

2 1

0

21

2

0

21

2

0

21

Page 3: Fast Fourier Transform (FFT)

The two summations are two distinct DFT’s, as we can see below

X k x m w w x m wNkm

m

N

Nk

Nkm

m

N

( ) ( ) ( )/ /

2 2 120

21

20

21

N-point DFT N/2-point DFT N/2-point DFT wNk

X k X k w X kNe

N Nk o

N( ) ( ) ( )/ / 2 2

for k=0,…N-1, where

X DFT x x x x x N

X DFT x x x x x N

eN

even even

oN

odd odd

/

/

, ( ), ( ),..., ( ) ;

, ( ), ( ),..., ( ) .

2

2

0 2 2

1 3 1

Page 4: Fast Fourier Transform (FFT)

X k X k w X kNe

N Nk o

N( ) ( ) ( )/ / 2 2

The problem is that in the expression

the N-point DFT and the N/2 point DFT’s have different lengths, since we define them as

1,...,0),( NkkX N

12/,...,0),(2/ NkkX N

For example if N=4 we need to compute

)]3(),2(),1(),0([ 44444 XXXXX

from two 2-point DFT’s

)]1(),0([

)]1(),0([

22

22

ooo

eee

XXX

XXX

So how do we compute and ?)2(4X )3(4X

Page 5: Fast Fourier Transform (FFT)

We use the periodicity of the DFT, and relate the N-point DFT with the two N/2-point DFT’s as follows

X k X k w X k

X kN

X k w X k

Ne

N Nk o

N

Ne

N Nk o

N

( ) ( ) ( )

( ) ( ),

/ /

/ /

2 2

2 22 k

N 0

21,...,

where we used the facts that

• the DFT is periodic and in particular X k X kN

N N/ /( ) ;2 2 2

w w e wNk N

Nk j N N

Nk / ( / ) /2 2 2•

Page 6: Fast Fourier Transform (FFT)

General Structure of the FFT (take, say, N=8):

x( )0

x( )2

x( )4

x( )6

x( )1

x( )3

x( )5

x( )7

X e ( )0

X e ( )1

X e ( )2

X e ( )3

X o ( )0

X o ( )1

X o ( )2

X o ( )3

w80

w81

w82

w83

4-DFT

4-DFT

X ( )0

X ( )1

X ( )2

X ( )3

X ( )4

X ( )5

X ( )6

X ( )7

where a

b

a b

a b

is called the butterfly.

Page 7: Fast Fourier Transform (FFT)

Same for the 4-DFT:

2-DFT

2-DFT

2-DFT

2-DFT

x( )0

x( )4

x( )2

x( )6

x( )1

x( )5

x( )3

x( )7

w40

w41

w41

w40

X e ( )0

X e ( )1

X e ( )2

X e ( )3

X o ( )0

X o ( )1

X o ( )2

X o ( )3

4-DFT

4-DFT

Page 8: Fast Fourier Transform (FFT)

Finally the 2-DFT’s have a simple expansion:

X x x

X x x2

2

0 0 1

1 0 1

( ) ( ) ( )

( ) ( ) ( ),

x( )1 X ( )1

X ( )0

2-DFT

x( )0

since

1

0222 )1()0()()(

n

kkn xwxwnxkX

with kkjk ew 12

Page 9: Fast Fourier Transform (FFT)

Put everything together:

x( )0

x( )4

x( )2

x( )6

x( )1

x( )5

x( )3

x( )7

)0(X

N/2 mult/stage

stagesN2log N

N2 2log

)1(X

)2(X

)3(X

)4(X

)5(X

)6(X

)7(X

04w

14w

04w

14w

08w

18w

28w

38w

N adds/stage

mult

NN 2log adds

Page 10: Fast Fourier Transform (FFT)

We say that, for a data set of length ,

bNNaoperationsofnumberei 2log..

complexity of the FFT is NNO 2log

for some constants a,b.

On the other hand, for the same data of length N ,

LN 2

complexity of the DFT is 2NO

Since, from the formula, 1,...,0,)()(1

0

NkwnxkXN

n

knN

N ops/term N terms N ops2

Page 11: Fast Fourier Transform (FFT)

This is a big difference in the total number of computations, as shown in this graph:

N

complexity

N0 2000 4000 6000 8000 1000010

2

103

104

105

106

107

108

DFT

FFT