You are on page 1of 35

Computation of DFT using FFT Algorithms

FFT : Fast Fourier Transform Algorithms

Mrs.Aarti Bang,
VIIT, Pune

Discrete Fourier Transform


DFT
N 1

X (k ) x(n)e

j 2nk / N

k 0,1,2.....N 1

n0

IDFT

1 N 1
j 2nk / N
x(n) X (k )e
N k 0
Mrs.Aarti Bang,
VIIT, Pune

n 0,1,2.....N 1

For SPECTRAL ANALYSIS and LINEAR FILTERING


Computation of DFT involves large no. of computations
Efficient algorithms are developed which require
less no. of computations Fast Fourier Transform
Algorithms
or

FFT Algorithms

Mrs.Aarti Bang,
VIIT, Pune

Direct Computation of DFT :


To compute one DFT point :
N complex multiplications are required
N-1 complex additions are required
To compute N DFT points (k = 0,1, ,N-1)
N2 complex multiplications (N x N)
N2-N complex additions. ( (N -1) x N )
Mrs.Aarti Bang,
VIIT, Pune

Each complex multiplication requires :


(a + jb) x (c + jd)
(ac bd) + j(ad + bc)
4 real multiplications & 2 real additions
N2 complex multipications require :
4N2 real multiplications
2N2 real additions
Mrs.Aarti Bang,
VIIT, Pune

Each complex addition requires :


(a + jb) + (c + jd)
(a+c) + j(b+d)
2 real additions
N2 N complex additions require :
2(N2 -N )= 2N2 2N real additions

Mrs.Aarti Bang,
VIIT, Pune

4N2 real multiplications


2N2 real additions
2N2 2N real additions
Total
Real Multiplications
Real Additions

: 4N2
: 4N2 2N

Trigonometric functions

: 2N2

Mrs.Aarti Bang,
VIIT, Pune

N 1

DFT

X (k ) x(n)W

where

kn
N

n0

k 0,1,2.....N 1

j 2 / N

WN e

WN is called as Phase factor or Twiddle factor

IDFT

Mrs.Aarti Bang,
VIIT, Pune

N 1

1
kn
x(n) X (k )W n 0,1,2.....N 1
N k 0

Properties of W N
Periodicity property :
k N
N

W
k
N

k 8
8

k
N

k
8

is periodic with period N

Symmetry property :
k

WN

N
2

k
N

W WN / 2
2
N

Relation :
Mrs.Aarti Bang,
VIIT, Pune

2 j 2 / N

W e
2
N

j 2 / N / 2

WN / 2

Radix - 2 Decimation in Time FFT algorithm :


(Radix 2 DIT FFT algorithm)
N is considered as integer power of 2
N-point data sequence, x(n), is splitted into
two N/2 point data sequences
containing even numbered and odd numbered data points
N 1

X (k ) x(n)W
n0

Mrs.Aarti Bang,
VIIT, Pune

kn
N

X (k )

x(n)W

nk
N

neven

Substitute n=2r
n=2r+1

X (k )

x(2r)W

2rk
N

r 0

X (k )

x(2r)(W
r 0

Mrs.Aarti Bang,
VIIT, Pune

x(n)W

nodd

for even {x(0), x(2), x(4), x(6)}


for odd {x(1), x(3), x(5), x(7)}

N / 21

N / 21

nk
N

N / 21

x(2r 1)W
r 0

) W

2 rk
N

( 2r 1) k
N

k
N

N / 21

x(2r 1)(W
r 0

2 rk
N

W WN / 2
2
N

X (k )

N / 21

x(2r)W
r 0

rk
N/2

k
N

N / 21

x(2r 1)W

rk
N/2

r 0

X (k ) G(k ) W H (k )
k
N

where G(k) & H(k) are N/2 point DFTs of x(2r) & x(2r+1)

Since G(k) & H(k) are periodic with period N/2


we have,

G(k+N/2) = G(k)

also,

W Nk+N/2 = -WNk

Mrs.Aarti Bang,
VIIT, Pune

&

H(k+N/2) = H(k)

X (k ) G(k ) W H (k )
k
N

N
k
X (k ) G(k ) WN H (k )
2

Mrs.Aarti Bang,
VIIT, Pune

k = 0,1,..,N/2 - 1

k = 0,1,..,N/2 - 1

Signal Flow Graph


x(0)

G(0)

x(2)

G(1)

x(4)

N/2 point
DFT

x(6)

G(2)
G(3)

X(0)

W N0
WN

X(1)

WN

X(2)

W N3

X(3)

x(1)

H(0)

W N4

X(4)

x(3)

H(1)

W N5

X(5)

H(2)

W N6

X(6)

H(3)

W N7

X(7)

x(5)
x(7)
Mrs.Aarti Bang,
VIIT, Pune

N/2 point
DFT

No. of Complex Multiplications & Additions:


2 N/2 pt. DFTs
: 2(N/2) 2
Combining DFTs : N
( H(k) x WNk )
Total

N + 2(N/2) 2 ~ N2/2 (Complex Mul. & Add.)

Reduction by a factor of 2

Mrs.Aarti Bang,
VIIT, Pune

G(k) & H(k) can be computed by splitting each of them into


2 N/4 pt. DFTs

G(k )

N / 21

g(r)W

rk
N/2

r 0

G(k )

N / 41

g(2l)W
l 0

2lk
N/2

N / 41

g(2l 1)W
l 0

N/ 41

G(k) g(2l)(W ) W
l0

Mrs.Aarti Bang,
VIIT, Pune

2 lk
N/ 2

( 2l 1) k
N/2

k
N/ 2

N/ 41

g(2l 1)(W
l0

2 lk
N/ 2

2
N/2

G(k )

N / 41

g(2l)W
l 0

H (k )

lk
N/4

h(2l)W

N / 41

N / 41
l 0

Mrs.Aarti Bang,
VIIT, Pune

WN / 4

lk
N/4

k
N/2

g(2l 1)W
l 0

k
N/2

lk
N/4

N / 41

h(2l 1)W
l 0

lk
N/4

WN / 2 W

2
N

G(k )

N / 41

g(2l)W
l 0

H (k )

N / 41

h(2l)W
l 0

Mrs.Aarti Bang,
VIIT, Pune

lk
N/4

N / 41

lk
N/4

2k
N

g(2l 1)W
l 0

2k
N

lk
N/4

N / 41

h(2l 1)W
l 0

lk
N/4

x(0)
x(4)

N/4 pt.
DFT

X(0)

WN 0
WN

WN 0

X(1)

WN 1

x(2)
x(6)

x(1)
x(5)
x(3)
x(7)

WN 4

N/4 pt.
DFT

WN 2

WN 6

WN 3
WN 4

N/4 pt.
DFT

WN 0
WN 2
WN 4

N/4 pt.
DFT

Mrs.Aarti Bang,
VIIT, Pune

WN 6

X(2)
X(3)
X(4)

WN 5

X(5)

WN 6

X(6)

WN 7

X(7)

x(0)
x(4)

WN 0

WN 0

X(1)

WN 1
WN 4

x(2)
x(6)

WN

WN 4

X(0)

WN 0

WN 0
WN

WN 2

WN 6

WN 3

WN 4

x(1)
x(5)

WN 0
WN

Mrs.Aarti Bang,
VIIT, Pune

WN 2

WN 4

x(3)
x(7)

WN 0

WN 0

WN 6

WN 4

Signal Flow Graph

X(2)
X(3)
X(4)

WN 5

X(5)

WN 6

X(6)

WN 7

X(7)

No. of Complex Multiplications & Additions:


4 N/4 pt. DFTs

: 4(N/4) 2
~ N2/4 (Complex Mul. & Add.)

Again Reduction by a factor of 2


Total reduction: by a factor of 4

Mrs.Aarti Bang,
VIIT, Pune

Splitting (Decimation) is done until reduced to


one point sequence

For
Decimation is performed

N 2
log2 N

times

The total No. of Complex Multiplications & Additions


are reduced to

N log2 N

Mrs.Aarti Bang,
VIIT, Pune

Butterfly Structure
a
W Nr

WN

r+N/2

a
W Nr

-WN

A = a + WNr.b
B = a + W Nr+N/2.b

B
A

A = a + WNr.b
B = a - WNr.b

Symmetry Property

b
W Nr

Mrs.Aarti Bang,
VIIT, Pune

-1

A = a + WNr.b
B = a - WNr.b

No. of multiplications per butterfly


Is ONE (instead of TWO)

Hence, total computations are :


Complex Multiplications are :

Complex Additions are

Mrs.Aarti Bang,
VIIT, Pune

N
log2 N
2

N log2 N

X(0)

x(0)
x(4)
x(2)
x(6)

X(1)

-1

WN 0

WN

-1

X(2)

-1

WN 0

X(3)

-1

WN 2

x(1)
x(5)

-1

WN 0

x(3)

WN 0

x(7)

WN

-1

WN 0

-1

WN 1

-1

WN 0

-1
-1

-1

WN 2
WN

-1

Final Signal Flow Graph of DIT -FFT Algorithm

Mrs.Aarti Bang,
VIIT, Pune

X(4)
X(5)
X(6)
X(7)

Order of input sequence is not natural but definite.


Initial
Input
sequence

Binary
Sequence
of index

Bit
reversed
Sequence

Index of
final input
sequence

Final
Input
Sequence

x(0)

000

000

x(0)

x(1)

001

100

x(4)

x(2)

010

010

x(2)

x(3)

011

110

x(6)

x(4)

100

001

x(1)

x(5)

101

101

x(5)

x(6)

110

011

x(3)

x(7)

111

111

x(7)

Mrs.Aarti Bang,Bit
VIIT, Pune

Reversal

Input Sequence is bit reversed

16 pt. DFT

Mrs.Aarti Bang,
VIIT, Pune

Binary Sequence

Input order

Output order

0000

x(0)

X(0)

0001

x(8)

X(1)

0010

x(4)

X(2)

0011

x(12)

X(3)

0100

x(2)

X(4)

0101

x(10)

X(5)

0110

x(6)

X(6)

0111

x(14)

1000

x(1)

1001

x(9)

1010

x(5)

1011

x(13)

1100

x(3)

1101

x(11)

1110

x(7)

X(14)

1111

x(15)

X(15)

In Place Computations :
Butterfly Operation on input pair of complex nos. (a, b)
Produces output pair of complex nos. (A, B)
Same locations can be used to store (A, B)
i.e. (A, B) is stored in place of (a, b)
Hence same 2N locations are used throughout the
computation to store the butterfly result.
Hence computations are done in place.

Input data sequence stored in Bit Reversed Order &


Butterfly computations done In Place,
Output DFT sequence is obtained in Natural Order.
Mrs.Aarti Bang,
VIIT, Pune

DIT FFT Algorithm:

Pad input sequence, of N samples, with ZERO's


until the number of samples is the nearest power of two.
e.g. 12 samples are padded with 4 zeros to make length
of input sequence 16 (2^4)
Bit reverse the input sequence.
e.g. x(3) = 0011 goes to 1100 = 12 th position in array
Perform butterfly computations = log2N stages

Mrs.Aarti Bang,
VIIT, Pune

Radix - 2 Decimation in Frequency - FFT algo. :


(Radix 2 DIF FFT algorithm)
N is considered as integer power of 2
Output sequence X(k) is divided into smaller sequences.
N-point data sequence, x(n), is splitted into
two N/2 point data sequences
containing first half and next half data points
i.e. {x(0), x(1), x(2), x(3)}
{x(4), x(5), x(6), x(7)}
N 1

X (k ) x(n)W
Mrs.Aarti Bang,
VIIT, Pune

n0

kn
N

X (k )

N / 21

x(n)W

nk
N

n0

X (k )

N / 21

x(n)W

nk
N

n0

X (k )

N / 21

x(n)W

nk
N

n0

N 1

x(n)W

nk
N

n N / 2

N / 21

n0

N
( n ) k
2
N

N
x(n )W
2

N N / 21
k
2
N
n0

N nk
x(n )WN
2

Note: Two summations are not N/2 pt. DFTs

N
k
2
N

Mrs.Aarti Bang,
VIIT, Pune

(1)

Periodicity & Symmetry Property

X (k )

N / 21

x(n)W

nk
N

n0

(1)

N / 21
k

n0

N nk
x(n )WN
2

Now consider k even & k odd separately

X (2 r )

N / 2 1

n 0

X (2 r 1)

N / 2 1

n 0

Mrs.Aarti Bang,
VIIT, Pune

N
[x(n ) x(n
]W
2

2 rn
N

N
{[ x ( n ) x ( n
]W
2

n
N

}W

2 rn
N

W WN / 2
2
N

X (2 r )

N / 2 1

N
[x(n ) x(n
]W
2

n 0

X (2 r 1)

N / 2 1

n 0

rn
N / 2

N
{[ x ( n ) x ( n
]W
2

n
N

}W

rn
N / 2

Above eqs. are two N/2 pt. DFTs

X (2 r )

N / 2 1

g ( n )W

n 0

X (2 r 1)

g(n)=x(n)+x(n+N/2)

N / 2 1

n 0

Mrs.Aarti Bang,
VIIT, Pune

rn
N / 2

h ( n )W

n
N

rn
N / 2

h(n)=x(n)-x(n+N/2)

x(0)

g(0)

X(0)

g(1)

x(1)

g(2)

x(2)

g(3)

x(3)
x(4)
x(5)
x(6)
x(7)

Mrs.Aarti Bang,
VIIT, Pune

N/2 pt.
DFT

-1
-1
-1
-1

h(0)
h(1)
h(2)
h(3)

X(2)
X(4)
X(6)

W N0
W N1
W N2
WN

X(1)
N/2 pt.
DFT

X(3)
X(5)
X(7)

X(0)

x(0)
x(1)

-1

x(2)

W N0

x(3)

WN

x(4)
x(5)

-1
-1

x(6)
x(7)

Mrs.Aarti Bang,
VIIT, Pune

W N0
-1

W N1
-1

WN
-1

-1

WN

-1
-1

W N0

W N0

X(4)
X(2)
X(6)
X(1)
X(5)
X(3)

W N0
W N2

W N0

-1

W N0

X(7)

You might also like