22
1 6. 6. Fast Fourier Transform Fast Fourier Transform Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform -1 x[0] x[4] x[2] x[6] x[1] x[5] x[3] x[7] X[0] X[1] X[2] X[3] X[4] X[5] X[6] X[7] W N 3 W N 2 W N 1 W N 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 W N 1 W N 0 W N 1 W N 0

Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

Embed Size (px)

Citation preview

Page 1: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

1

6.6. Fast Fourier TransformFast Fourier Transform

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

-1

x[0]

x[4]x[2]

x[6]

x[1]

x[5]x[3]

x[7]

X[0]

X[1]X[2]

X[3]

X[4]

X[5]X[6]

X[7]WN3

WN2

WN1

WN0

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1-1WN

1

WN0

WN1

WN0

Page 2: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

2

A Historical Perspective

• The Cooley and Tukey Fast Fourier Transform (FFT) algorithm is a turning point to the computation of DFT

• Before that, DFT was never practical except running by some very expensive computers

• FFT gives nearly a factor of 1000 improvement in the computation speed over the traditional approach in most computing environments

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Page 3: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

3

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• Principal discoveries of efficient methods of computing the DFT are listed as follows:

Researcher(s) Date Feature

Cooley & Tukey 1965 Any 2n composite integer

I.J. Good 1958 Any integer with relatively prime factors

L.H. Thomas 1948 Any integer with relatively prime factors

Danielson 1942 2n

K. Stumpff 1939 2nk, 3nk

C. Runge 1903 2nk

J.D. Everett 1860 12

A. Smith 1846 4, 8, 16, 32

F. Carlini 1828 12

C.F. Gauss 1805 Any composite integer

Page 4: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

4

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• Basic principle of FFT

Divide and Conquer

)(cos

)(cos)(cos

problemoriginaltoverheadtssubproblemt

<

+∑• Need to satisfy the following criterion

⇒ To break down a big problem to a number of smaller problems and tackle them individually

Page 5: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

5

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

)(cos

)(cos)(cos

problemoriginaltoverheadtssubproblemt

<

+∑

Big Problem SmallerProblem

SmallerProblem

SmallerProblems

OverheadApply Divide and Conquer iteratively

Page 6: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

6

Operation of FFT

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Length-N/4 DFTs

For each round, the size of the problem is divided by 2

Length-N DFT Length-N/2DFT

Length-N/2DFT

Overhead

Page 7: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

7

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Mathematical Derivation• Recall the DFT of x[n], for n = 0, 1,…,N-1

∑−

==

1

0][][

N

n

nkNWnxkX

• Separate the summation into two groups

∑∑ +=nodd

nkN

neven

nkN WnxWnxkX ][][][

for k = 0, 1,…,N-1

for k = 0, 1,…,N-1

NnkjnkN eWwhere /2π−=

Page 8: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

8

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Example• If DFT of x[n] is

kkkk WxWxWxWxkX .34

.24

.14

.04 ]3[]2[]1[]0[][ +++=

• We separate it into two groups with odd and even n

{ } { }∑∑ +=

+++=

nodd

nk

neven

nk

kkkk

WnxWnx

WxWxWxWxkX

44

.34

.14

.24

.04

][][

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

Page 9: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

9

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

∑∑

∑∑−

=

+−

=++=

+=

12/

0

)12(12/

0

2 ]12[]2[

][][][

N

r

krN

N

r

rkN

nodd

nkN

neven

nkN

WrxWrx

WnxWnxkX

for k = 0, 1,…,N-1

∑∑−

=

=++=

12/

0

212/

0

2 ]12[]2[N

r

rkN

kN

N

r

rkN WrxWWrx

Page 10: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

10

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Length-N/2 DFT of data with even n

Overhead

][][

]12[]2[][12/

02/

12/

02/

kHWkG

WrxWWrxkX

kN

N

r

rkN

kN

N

r

rkN

+=

++= ∑∑−

=

=

• Since

rkN

NrkjNrkjrkN

W

eeW

2/

)2//(2/222

=

== −− ππ

for k = 0, 1,…,N-1

Length-N/2 DFT of data with odd n

Page 11: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

11

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Example: N = 8

N/2 point DFT

x[0]

x[2]

x[4]

x[6]

N/2 point DFT

x[1]

x[3]x[5]

x[7]

G[0]

G[1]

G[2]G[3]

H[0]

H[1]

H[2]H[3]

X[0]

X[1]X[2]

X[3]

X[4]

X[5]X[6]

X[7]WN

6

WN5

WN4

WN3

WN2

WN1

WN0

WN7

Page 12: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

12

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

How much it saves?• Assume x[n] has N data and each data is a

complex number

∑−

==

1

0][][

N

n

nkNWnxkX for k = 0, 1,…,N-1

• For each k, it needs N complex multiplications and N-1 complex additions

• In overall, it needs N2 complex multiplications and N(N-1) complex additions

Page 13: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

13

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• FFT converts an N-point DFT to 2 N/2-points DFTs

][][][ kHWkGkX kN+= for k = 0, 1,…,N-1

(N/2)2 complex multiplicationsN(N/2-1) complex additions

N complex multiplications

Page 14: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

14

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

262,144x/261,632+ 131,584x/131,072+

N DFT 1-stage FFT4 16x/12+ 16x/8+

8 64x/56+ 40x/32+

16 256x/240+ 144x/128+

32 1,024x/992+ 544x/512+

64 4,096x/4,032+ 2,112x/2,048+

128 16,384x/16,256+ 8,320x/8,192+

256 65,536x/65,280+ 33,024x/32,768+

1024 1,048,576x/1,047,552+ 525,312x/524,288+

512

Page 15: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

15

cos ( ) cos ( )cos ( )

t subproblems t overheadt original problem

+<

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• Obviously

• We can re-apply the same approach to the decomposed N/2 problems

Page 16: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

16

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Example: Apply to G[k] and H[k]x[0]

x[4]

x[2]

x[6]

x[1]

x[5]

x[3]

x[7]

X[0]

X[1]X[2]

X[3]

X[4]

X[5]X[6]

X[7]WN

7

WN6

WN5

WN4

WN3

WN2

WN1

WN0N/4 point

DFT

N/4 point DFT

N/4 point DFT

N/4 point DFT

WN/23

WN/22

WN/21

WN/20

WN/23

WN/22

WN/21

WN/20

Page 17: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

17

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• The complexity is further reduced

• The above decomposition is recursively performed until a length-2 DFT is computed

• A length-2 DFT can be implemented as a butterflyas follows:

12

02

02

02

2

1

0

]1[]0[]1[

]1[]0[]0[

][][

WxWxX

WxWxX

WnxkX nk

n

+=

+=⇒

= ∑=

x[0]

x[1]

X[0]

X[1]

W20 1=

12/212 −== − πjeW

Page 18: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

18

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

x[0]

x[4]x[2]

x[6]

x[1]

x[5]x[3]

x[7]

X[0]

X[1]X[2]

X[3]

X[4]

X[5]X[6]

X[7]WN

7

WN6

WN5

WN4

WN3

WN2

WN1

WN0

WN/23

WN/22

WN/21

WN/20

WN/23

WN/22

WN/21

WN/20

-1

-1

-1

-1

Page 19: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

19

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

• The complexity can be further reduced. For every butterfly, it can be converted as follows:

rNW

)2/( NrNW + r

NW

1

-1

rNW

rNW−

rN

jrN

NN

rN

NrN WeWWWW −=== −+ π2/)2/(Since

Page 20: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

20

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

-1

x[0]

x[4]x[2]

x[6]

x[1]

x[5]x[3]

x[7]

X[0]

X[1]X[2]

X[3]

X[4]

X[5]X[6]

X[7]WN3

WN2

WN1

WN0

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1-1WN

1

WN0

WN1

WN0

FFTTotal complex multiplication: 5Total complex addition: 24

DFTTotal complex multiplication: 64Total complex addition: 56

Page 21: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

21

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Remarks:• FFT of the form above is called decimation-in-time

(DIT) FFT (or Cooley and Tukey FFT)• In general, the complexity of DIT FFT is

(N/2)log2N complex multiplications (W0 is considered as multiplication in this expression)

Nlog2N complex additions

• DIT FFT requires N to be a power of 2• If N is not a power of 2, need zero padding to let N

be a power of 2 before FFT • More than a hundred of FFT algorithms after DIT

FFT for different applications

Page 22: Signal Processing Fundamentals – Part I Spectrum …enpklun/EIE327/FFT.pdf3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 6. Fast Fourier Transform •

22

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

6. Fast Fourier Transform

Exercise• Show why the complexity of DIT FFT is given by

(N/2)log2N complex multiplications (W0 is considered as multiplication in this expression)Nlog2N complex additions

• If N = 256, what are the complexities of DIT FFT and DFT?