Fast Fourier Transform

Content
Introduction
Radix-2 DIT- FFT Algorithm

Radix-2 DIF- FFT Algorithm

M

.K

.B
hu

ya

n

The fast algorithm of IDFT

Introduction

Problems

Although the DFT is a computable transform, the
straightforward implementation is very inefficient,
especially when the sequence length N is large.

N complex multiplications for each value of k.

(N-1) complex addition for each value of k.

N2 complex multiplications for N values of k.

N(N-1) complex additions for N values of k.

M

.K

.B

hu

ya

n

N 1

X [k ]   [(Re{x[n ]}Re{WNkn }  Im{x[n ]Im{WNkn }) 
n 0

j (Re{x[n ]}Im{WNkn }  Im{x[n ]}Re{WNkn })],
k  0.1........, N  1
requires:
 4 real multiplications and 2 real additions
.B
hu

ya

n

 Each complex addition requires two real additions.
 4N real multiplications for each value of k
.K

W

M

kn
N

 (4N-2) real additions for each value of k.
 That means 4N2 real multiplications and N(4N -2) real
additions are required for N different values of k

B hu ya n • Can the number of computations required be reduced? M Number of Multiplications Performance of the DFT Algorithm 8 9 10 .120 Number of Additions 120 100 80 60 40 20 100 80 60 40 20 0 0 0 1 2 3 4 5 6 7 8 9 0 10 1 2 3 4 5 6 7 Number of Samples Number of Samples .K .

B hu ya n  . M .Introduction  How to reduce the computational complexity In 1965. Cooley and Tukey showed a procedure to substantially reduce the amount of computations involved in the DFT.  All these efficient algorithms are collectively known as Fast Fourier Transform (FFT) algorithms.  Most of the computations can be eliminated using the symmetry and periodicity properties of DFT.K . This led to the explosion of applications of the DFT.

K  1 M W N/ 2 N n 2 N k N k N .Symmetry and Periodicity W  exp(  j 2k / N ) k N W ( k  N/ 2 ) N W (k  N ) N  W W W  WN / 2 ya .B hu .

FFT: Decimation-in-frequency FFT algorithm .Introduction  FFT algorithm classification DIT .FFT: Decimation-in-time FFT algorithm M .B hu ya n DIF .K .

and odd-indexed samples.B hu ya n  To synthesize the N spectra into a single frequency spectrum. separating the even.K .FFT Algorithm Radix-2: the sequence length N satisfied: L is an integer N  2 L  How does DIT-FFT operate To decompose an N point time domain signal into N signals each containing a single point. M .Radix-2 DIT.  To calculate the N frequency spectra corresponding to these N time domain signals. Each decomposing stage uses an interlace decomposition.  .

FFT Algorithm 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 signals of 8 points 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 4 signals of 4 points 0 4 8 12 2 6 10 14 1 5 9 13 8 signals of 2 points 0 8 4 12 2 10 6 14 16 signals of 1 point 0 4 12 1 9 3 7 11 15 5 13 3 11 7 15 M .Radix-2 DIT. .K .B hu ya n 1 signal of 16 points 8 2 10 6 14 1 9 5 13 3 11 7 15 The frequency spectrum of a 1 point signal is equal to itself.

x 2 ( r )  x ( 2 r  1 ) .B  N 1 2  x ( r )W r 0 2 rk N 2  N 1 2  x ( 2r  1)W r 0 rk N 2 N (k  0 ~  1) 2 . 2 .  1 2 To compute the DFT of x1(r) and x2(r)  x ( 2r )W n  r 0 ya r 0 1 hu  x ( r )W rk N 2 N 1 2 N (k  0 ~  1) 2 rk N 2 X 2 (k )  M .Radix-2 DIT. r  0 .K X 1 (k )  N 1 2 .FFT Algorithm  Algorithm principle  To divide N-point sequence x(n) into two N/2-point sequence x1(r) and x2(r) N x 1 ( r )  x ( 2 r ).1 .

To compute the DFT of N-point sequence x(n) N 1 X ( k )   x ( n )W n0 n  0 ( even ) N 1 2 N 1 2 r 0 r 0 nk N  N 1  x( n)W n  0 ( odd ) 2 rk ( 2 r 1 ) k x ( 2 r ) W  x ( 2 r  1 ) W   N N N 1 2 N 1 2 rk k rk x ( r ) W W x ( r ) W   1 N N 2 N  X 1 ( k )  W Nk X 2 ( k ) r 0 n 2 ya r 0 .K  nk N N 1 M  nk N .2.B hu   x( n)W  2 ( k  0.1.  N  1) .

 2 k N x1 ( r ) X 1 (k ) X (k ) x2 ( r ) M .K .B hu ya n x(n) X 2 (k ) .1.1.  2 N (  ) k N N N 2 X (k  )  X 1 (k  )  W N X 2 (k  ) 2 2 2 N k  X 1 (k )  W N X 2 (k )  1) ( k  0.N  1) X ( k )  X 1 ( k )  W X 2 ( k ) ( k  0.

  1) 2 There are 1 complex multiplication and 2 complex additions .K X 2 (k ) N ( k  0 .1.1. Butterfly computation flow graph X (k )  X 1 (k )  W X 2 (k ) k N N X ( k  )  X 1 ( k )  W Nk X 2 ( k ) 2 X 1 ( k )  W Nk X 2 ( k ) X 1(k ) .   1) 2 N ( k  0 .B hu ya n W Nk 1 X 1 ( k )  W Nk X 2 ( k ) M .

X 1 (0) x1(0 )  x (0 ) X (1 ) X 1(2) X (2) DFT x1(3 )  x (6 ) X 1(3) x 2 ( 0 )  x (1 ) X 2 (0) W N0 x 2 (1 )  x ( 3 ) X 2 (1 ) W N1 X 2 (2) W N2 X 2 (3) W N3 x 2 (2 )  x (5 ) N/2point DFT .B hu ya n x 2 (3 )  x (7 ) X (3) .K x2 (r ) x1(2 )  x (4 ) X 1 (1 ) M x1 (r ) x 1 (1 )  x ( 2 ) N/2point X (0 ) N-point DFT 1 X (4 ) 1 X (5 ) 1 X (6 ) 1 X (7 ) .

the N point sequence is decimated into 2-point sequences. From the result of 2 point DFTs. the 4 point DFTs can be computed. until we get N point DFT. and 2 point DFT for each decimated sequence is computed. the 8 point DFT can be computed and so on.K x (7 ) W 0 N W N0 . From the result of 4 point DFT.B hu x (5) W X (2) 1 In radix-2 FFT .x (0) x (4) X (0 ) W N0 1 x(2) x (6) W N0 X (1 ) W N0 W N2 1 1 x (1 ) 0 N 1 x(3) 1 ya n W N2 1 1 W 0 N W 1 N W 2 N W 3 N X (3) 1 X (4 ) 1 X (5 ) 1 X (6 ) 1 X (7 ) M . .

FFT Algorithm  The computation complexity for N  2 3 X (k ) x(n ) 2-point DFT 2-point DFT Synthesize the 2-point DFTs into a 4-point DFT Synthesize the 4-point DFTs into a 8-point DFT .K M 2-point DFT ya n 2-point DFT Synthesize the 2-point DFTs into a 4-point DFT 3-stage synthesize.B hu .Radix-2 DIT. each has N/2 butterfly computation .

each has N/2 butterfly computations.FFT Algorithm for N  2L  There are L-stage synthesization.K a F  N L  N lo g 2 N M  .  The total number of complex multiplications is: N N mF  L  log 2 N 2 2 . Each butterfly computation has 1 complex multiplication and 2 complex additions.Radix-2 DIT.B hu ya n The total number of complex additions is: .

Radix-2 DIT.B hu 1 M X m 1 ( j ) WNr X m (k )  X r ( k )  W m 1 N X m 1 ( j) X m ( j)  X r ( k )  W m 1 N X m 1 ( j) .FFT Algorithm  The characteristics of DIT-FFT algorithm  In-place computation X m 1 ( k ) .K n ya .

FFT Algorithm At the end of computation flow graph at any stage. . output variables can be stored in the same registers previously occupied by the corresponding input variables.Radix-2 DIT.K .B hu ya n This type of memory location sharing is called in-place computation which results in significant saving in overall memory requirements. M .

Thus.B hu ya n Let m. n represent the sequential and bit-reversed order in binary forms respectively. 010 n: 100 010 000 . a sequentially ordered input x(n) must be reordered appropriately before the fast algorithm can be implemented.Radix-2 DIT. then: .FFT Algorithm  Bit-reversed order In the DFT computation scheme.K 001 011 100 101 110 111 110 001 101 011 111 M m: 000 . the DFT samples X(k) appear at the output in a sequential order while the input samples x(n) appear in a different order: a bit-reversed order.

B hu ya n 1 .K M x (000) x (0) 1 x (1 0 0 ) x(4) x (010) x(2) 1 x (1 1 0 ) x (6) 0 x (001) x (1 ) 1 x (1 0 1 ) x (011) x (5 ) x (1 1 1 ) x (7 ) 0 1 1 0 0 1 x (3 ) . Why is the input bit-reversed order n0 n1 n2 0 0 x (n 2n1n0 ) 0 .

then: A ( 0 ) A (1 ) A ( 2 ) A ( 3 ) A (4) A (5) A (6) A (7 ) x (4) x (5) x (6) x (7 ) x (1 ) x (5) x(3) x (7 ) ya n n x ( 0 ) x (1 ) x ( 2 ) x ( 3 ) ˆrepresent the n M . the bit-reversed order.K . How to get the bit-reversed order Let n represent the natural order.B hu ˆ x (0) x (4) x (2 ) x (6) n .

K .Radix-2 DIF.FFT Algorithm M .B hu ya n  How does DIF-FFT operate .

K .x(n ) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 butterfly computation 0 1 0 1 2 2 3 0 1 2 3 3 0 1 2 3 butterfly computation butterfly computation 1 0 1 0 1 0 n 0 ya 1 0 1 1 0 1 0 1 X (k ) M .B hu 0 butterfly butterfly butterfly butterfly 0 2 1 3 4 6 5 7 .

B hu ya n The latter N/2-point .FFT Algorithm  Algorithm principle  To divide N-point sequence x(n) into two N/2-point sequence N x ( n ).Radix-2 DIF. 0n 1 2 N N x ( n  ). 0  n  1 2 2 The former N/2-point M .K .

K N  nk  k    x ( n )  ( 1) x ( n  )W N 2  n0  ( k  0.B hu N 1 2 n N k  N  nk 2    x ( n )  W N x ( n  )W N 2  n0  M . To compute the DFT of N-point sequence x(n) N 1 X ( k )   x ( n )W n0  N 1 2  x( n)W n0 N 1 2 nk N nk N  N 1 2  x( n)W n0 nk N N 1  x( n)W  n N 1 2 ( n N   x ( n  )W N 2 n0 nk N N 2 N )k 2 ya .  N  1) .1.

1 .FFT Algorithm  To separate the even and odd numbered samples of X(k) N le t k  2 r .1 .   1) 2  2 2 n0  ya n N 1 2 M .B hu N  n nr N  X ( 2 r  1 )    x ( n )  x ( n  )  W N W N ( r  0 . ( r  0 .1 .   1) 2  2 n0  2 . k  2 r  1 .Radix-2 DIF.  1 ) 2 N 1 2 N  nr N  X ( 2 r )    x ( n )  x ( n  ) W N ( r  0 .K .  .

 1 2 ya N   x 1 ( n )  x ( n )  x ( n  2 ) let  N  n   x 2 ( n )   x ( n )  x ( n  ) W N  2   2 .1.Radix-2 DIF.B hu N 1 2 .1.K n0 1 N ( r  0.   1) 2 .1.FFT Algorithm X ( 2 r  1)   x ( n )W n0 nr N 2 N ( r  0.   1) 2 n  x ( n )W nr N 2 M X ( 2r )  N 1 2 N n  0 .

B hu There are 1 complex multiplication and 2 complex additions .Radix-2 DIF.K .FFT Algorithm  Butterfly computation flow graph N x1 (n )  x (n )  x (n  ) 2 x(n ) 1 N  n  x 2 ( n )   x ( n )  x ( n  ) W N 2   ya n N x(n  ) 2 W Nn M .

for N  2 3 x1 (0) x (0) x 1 (1 ) x (1 ) x1 (2) x(2) x (7 ) 1 W N2 x2 (2) W N3 n x 2 (1 ) ya 1 W N1 .K x (6) 1 W N0 M x (5) N/2point X (2) DFT X (4 ) x1 (3) x(3) x (4) X (0 ) x2 (3) X (6 ) X (1 ) N/2point X (3) DFT X (5 ) X (7 ) .B hu 1 x 2 (0) .

K x (5) W 0 N M x (4) 1 W N0 1 W N0 1 W N0 1 X (5 ) X (3) W N0 W N2 1 X (7 ) .for N  2 3 x (0) X (0 ) x (1 ) x(2) 1 x(3) 1 W N0 W N2 1 W N0 W N2 1 W N3 n 1 X (2) W N1 ya x (7 ) 1 X (4 ) X (6 ) X (1 ) .B hu x (6) 1 .

B hu ya n  .FFT Algorithm  The comparison of DIT and DIF The order of samples DIT-FFT: the input is bit.K .Radix-2 DIF.reversed order and the output is natural order DIF-FFT: the input is natural order and the output is bitreversed order  The butterfly computation DIT-FFT: multiplication is done before additions DIF-FFT: multiplication is done after additions M .

FFT Algorithm Both DIT-FFT and DIF-FFT have the identical computation complexity.e.K . Each butterfly computation has 1 multiplication and 2 additions.  A DIT-FFT flow graph can be transposed to a DIFFFT flow graph and vice versa.  Both DIT-FFT and DIF-FFT have the characteristic of in-place computation. there are total L stages and each has N/2 butterfly computation.B hu ya n  return . for N  2 L . i. M .Radix-2 DIF.

K .The fast algorithm of IDFT  Algorithm 1 N 1 X (k )   x(n)WNnk n 0 N 1 1 x(n)   X (k )WN nk N k 0 N  2 L In an FFT flow graph of DFT: .B hu ya n x ( n )  X ( k ). X ( k )  x ( n ) M W N1  W N 1 . each stage is multiplied by 1/2 .

 N-1 ) .1 .K M  n N 1 (k  0 .The fast algorithm of IDFT  Algorithm 2 1 x(n)  N N 1  X ( k )W k 0  nk N  1  nk      X ( k )W N  N  k 0  1    DFT[ X ( k )] N ya  .B hu .