Download as pdf or txt
Download as pdf or txt
You are on page 1of 49

k /

t .
Fast Fourier Transform u b e
e t
c s
/ /
p :
t t
h

http://csetube.weebly.com/
1
Fast Fourier Transform

• FFTs use a divide and conquer approach,


breaking an N-point DFT into severalksmaller
/
DFTs . t
b e
• N can be factored as N=rt1ru2r2…rv where the {ri}
are prime s e
c
• Particular focus on/ r1=r2=..=rv=r, where r is
/
called the radix p : the FFT algorithm
of
t t
• In this caseh N=rv and the FFT has a regular
pattern
• We will study radix-2 (r=2) and radix-4 (r=4)
FFTs in this class
http://csetube.weebly.com/
2
FFT (Jet Speed)
• J. W. Cooley and J. W. Tukey are given credit for bringing
the FFT to the world in the 1960s
k /
• Simply an algorithm for more efficiently calculating the DFT
. t
• Takes advantage of symmetry and bperiodicity
e in the twiddle
factors as well as uses a divideet u conquer method
and
• Symmetry: WN r +N/2 = -WN/r c s
: /
• Periodicity: WN = p
r+N WN r
t t
h
• Requires only (N/2)log2(N) multiplications !
• Faster computation times
• More precise results due to less round-off error
http://csetube.weebly.com/
3
FFT Algorithm
• Several different types of FFT Algorithms (Radix-2, Radix-4,
DIT & DIF)
• Focus on Radix-2 using Decimation in Time k /(DIT) method
. t
• Breaks down the DFT calculationbe into a number of 2-point
DFTs t u
s e
• Each 2-point DFT uses / can operation called the Butterfly
: /
• These groups arepthen re-combined with another group of
t t
two and so hon for log2(N) stages
• Using the DIT method the input time domain points must
be reordered using bit reversal

http://csetube.weebly.com/
4
Butterfly Operation

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
5
Bit Reversal

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
6
8-Point Radix-2 FFT Example

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
7
8-Point Radix-2 FFT Example

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
8
FFT Implementation
• To efficiently implement the FFT algorithm a few
observations are made:
• Each stage has the same number
/kof butterflies
t
(number of butterflies = N/2,bN e.is number of points).
• The number of DFT groups t u per stage is equal to
s e
(N/2stage). / c
/
:between the upper and lower leg is
• The differencep
equal toht
t
2stage-1.
• The number of butterflies in the group is equal to
2stage-1.

http://csetube.weebly.com/
9
FFT Implementation
Example: 8 point FFT
W0 -1

W0 -1
k /
W0 -1 W2 -1
.t
b e
W0 -1
t u
W0 -1 e
cs
W1 -1
W0
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
10
FFT Implementation
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k /
W0 -1 W2 -1
.t
b e
W0 -1
t u
W0 -1 e
cs
W1 -1
W0
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
11
FFT Implementation
Stage 1
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k/Nstages = 1
W0 -1 W2 -1
.t
b e
W0 -1
t u
W0 -1 e
cs
W1 -1
W0
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
12
FFT Implementation
Stage 1 Stage 2
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k/Nstages = 2
W0 -1 W2 -1
.t
b e
W0 -1
t u
W0 -1 e
cs
W1 -1
W0
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
13
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
kN/stages = 3

W0 -1 W2 -1
.t
b e
W0 -1
t u
W0 -1 e
cs
W1 -1
W0
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
14
FFT Implementation
Stage 1 Stage 2 Stage 3

Example: 8 point FFT


W0 -1 (1) Number of stages:
W0 -1
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1:
W0 -1
W0
W1
c se-1

W0 -1
/ /
W2 -1

W0 -1 W2
p :
-1 W3 -1
t
ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
15
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1
W0 -1 (1) Number of stages:
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1: Nblocks = 1
W0 -1
W0
W1
s
-1e
c
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
16
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1
W0 -1 (1) Number of stages:

Block 2
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1: Nblocks = 2
W0 -1
W0
W1
s
-1e
c
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
17
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1
W0 -1 (1) Number of stages:

Block 2
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
Block 3 t  Stage 1: Nblocks = 3
W0 -1
W0
W1
s
-1e
c
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
18
FFT Implementation
Stage 1 Stage 2 Stage 3

Example: 8 point FFT


Block 1
W0 -1 (1) Number of stages:
Block 2
W0 -1
 kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

Block 3 W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
c se-1

Block 4
W0 -1
/ /
W2 -1

W0 -1 W2
p :
-1 W3 -1
t
ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
19
FFT Implementation
Stage 1 Stage 2 Stage 3

Example: 8 point FFT

Block 1
W0 -1 (1) Number of stages:
W0 -1
k /Nstages = 3
t
e.Blocks/stage:
W0 -1 W2 -1
(2)
W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
c se-1

W0 -1 /
W2 -1  Stage 2: Nblocks = 1
: /
W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
20
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
Block 1
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1: Nblocks = 4
Block 2
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
t p-1 W3 -1

ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
21
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1 
k /Nstages = 3
t
e.Blocks/stage:
W0 -1 W2 -1
Block 1 (2)
W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht
• Decimation in time FFT:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
22
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1 
k /Nstages = 3
t
e.Blocks/stage:
W0 -1 W2 -1
(2)
W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1:
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
23
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
• Number of blocks/stage = N/2stage
• Number of butterflies/block = 2stage-1
http://csetube.weebly.com/
24
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1 
k /Nstages = 3
t
e.Blocks/stage:
W0 -1 W2 -1
(2)
W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
 Stage 2: Nbtf = 1
• Number of blocks/stage = N/2 stage

• Number of butterflies/block = 2stage-1


http://csetube.weebly.com/
25
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1 
kN/stages = 3
t
(2)e.Blocks/stage:
W0 -1 W2 -1

W0 -1 u b
t  Stage 1: Nblocks = 4
W0 -1
W0
W1
s
-1e
c  Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
 Stage 2: Nbtf = 2
• Number of blocks/stage = N/2 stage

• Number of butterflies/block = 2stage-1


http://csetube.weebly.com/
26
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT

W0 -1
(1) Number of stages:
W0 -1 /  Nstages = 3
t k
W0 -1 W2 -1
.(2) Blocks/stage:
be
W0 -1
t u  Stage 1: Nblocks = 4
W0 -1 W1
s
-1e
W0
c  Stage 2: Nblocks = 2
W0 -1 W2
/ / -1

:  Stage 3: Nblocks = 1
tp
W0 -1 W2 -1 W3 -1

ht (3) B’flies/block:
• Decimation in time FFT:  Stage 1: Nbtf = 1
• Number of stages = log2N  Stage 2: Nbtf = 2
• Number of blocks/stage = N/2stage  Stage 3: N = 1
btf
• Number of butterflies/block = 2 stage-1
http://csetube.weebly.com/
27
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k /  Nstages = 3
W0 -1 W2 -1 t
. (2)
e Blocks/stage:
W0 -1 ub
t  Stage 1: Nblocks = 4
W0 -1 e
cs
W1 -1
W0
 Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
 Stage 2: Nbtf = 2
• Number of blocks/stage = N/2 stage
 Stage 3: Nbtf = 2
• Number of butterflies/block = 2 stage-1
http://csetube.weebly.com/
28
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k / Nstages = 3
W0 -1 W2 -1
. t
e(2) Blocks/stage:
W0 -1 ub
t  Stage 1: Nblocks = 4
W0 -1 e
cs
W1 -1
W0
 Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
 Stage 2: Nbtf = 2
• Number of blocks/stage = N/2 stage
 Stage 3: Nbtf = 3
• Number of butterflies/block = 2 stage-1
http://csetube.weebly.com/
29
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
W0 -1 (1) Number of stages:
W0 -1
k / Nstages = 3
W0 -1 W2 -1 t
. (2)
e Blocks/stage:
W0 -1 ub
t  Stage 1: Nblocks = 4
W0 -1 e
cs
W1 -1
W0
 Stage 2: Nblocks = 2
W0 -1

: //
W2 -1

W0 -1 W2
p-1 W3 -1  Stage 3: Nblocks = 1
t
ht (3) B’flies/block:
• Decimation in time FFT:
 Stage 1: Nbtf = 1
• Number of stages = log2N
 Stage 2: Nbtf = 2
• Number of blocks/stage = N/2 stage
 Stage 3: Nbtf = 4
• Number of butterflies/block = 2 stage-1
http://csetube.weebly.com/
30
FFT Implementation
Stage 1 Stage 2 Stage 3

W0 -1

W0 -1

W0 -1
k /
W2 -1

.t
W0 -1 b e W0 -1

tu W0 W1 -1

se
W0 -1 W2 -1

/c
W0 -1 W2 -1 W3 -1

Start Index : / 0 0 0
Input Index t p 1 2 4
h t
Twiddle Factor Index N/2 = 4

http://csetube.weebly.com/
31
FFT Implementation
Stage 1 Stage 2 Stage 3

W0 -1

W0 -1

W0 -1
k /
W2 -1

.t
W0 -1 b e W0 -1

tu W0 W1 -1

se
W0 -1 W2 -1

/c
W0 -1 W2 -1 W3 -1

Start Index : / 0 0 0
Input Index t p 1 2 4
h t
Twiddle Factor Index N/2 = 4 4/2=2

http://csetube.weebly.com/
32
FFT Implementation
Stage 1 Stage 2 Stage 3

W0 -1

W0 -1

W0 -1
k /
W2 -1

.t
W0 -1 b e W0 -1

tu W0 W1 -1

se
W0 -1 W2 -1

/c
W0 -1 W2 -1 W3 -1

Start Index : / 0 0 0
Input Index t p 1 2 4
h t
Twiddle Factor Index N/2 = 4 4/2=2 2/2=1

http://csetube.weebly.com/
33
FFT Implementation
Stage 1 Stage 2 Stage 3

W0 -1

W0 -1

W0 -1
k /
W2 -1

.t
W0 -1 b e W0 -1

tu W0 W1 -1

se
W0 -1 W2 -1

/c
W0 -1 W2 -1 W3 -1

Start Index : / 0 0 0
Input Index t p 1 2 4
h t
Twiddle Factor Index N/2 = 4 4/2 = 2 2/2 = 1
W0
Indicies Used W0 W0
W1
W2
W2
http://csetube.weebly.com/ W3 34
Decimation-in-time Radix-2 FFT
• Split x(n) into even and odd samples and perform smaller FFTs
• f1(n) = x(2n)
• f2(n) = x(2n+1) /
• n=0, 1, … N/2-1 t k
e .
• Derivation performed in class b
t u
• Radix-2 Decimation-in-time (DIT) algorithm
s e
• In radix-2, the "butterfly" element
c takes in 2 inputs and produces 2
outputs / /
:
p2-point FFT
• Butterfly implementst
• Computations: h t
• (N/2)log2N complex multiplications
• Nlog2N complex additions

http://csetube.weebly.com/
35
Decimation-in-time Radix-2 FFT (N=8)

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
36
Radix-2 DIT Basic Butterfly

k /
.t
b e
t u
se
/ c
:/
a (complex) A (complex)

t p
h t
b (complex) B (complex)

W N (complex)

http://csetube.weebly.com/
37
Decimation-in-time Radix-2 FFT (N=8)

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
38
The decimation-in-frequency (DIF)
FFT algorithm

• Introduction: Decimation in frequency is / an alternate


way of developing the FFT algorithm t k
e .
• It is different from decimation in
u btime in its
e t
development, although citsleads to a very similar
structure / /
p :
t t
h

http://csetube.weebly.com/
39
DIF – FFT structure:

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
40
Continuing by decomposing the odd and
even output points we obtain …

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
41
… and replacing the N/4-point DFTs by
butterflys we obtain

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
42
The DIF FFT is the transpose of the DIT FFT

• To obtain flowgraph transposes:


• Reverse direction of flowgraph arrows /
• Interchange input(s) and output(s) . t k
b e
• DIT butterfly: tu DIF butterfly:
s e
/c
: /
t p
ht

http://csetube.weebly.com/
43
The DIF FFT is the transpose of the DIT FFT

• Comparing DIT and DIF structures:


DIT FFT structure: DIF FFT structure:
k /
. t
b e
t u
se
/ c
: /
tp
h t

• Alternate forms for DIF FFTs are similar to those of


DIT FFTs
http://csetube.weebly.com/
44
Alternate DIF FFT structures

• DIF structure with input natural, output bit-reversed

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
45
Alternate DIF FFT structures (continued)

• DIF structure with input bit-reversed, output natural

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
46
Alternate DIF FFT structures (continued)

• DIF structure with both input and output natural

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
47
Alternate DIF FFT structures (continued)

• DIF structure with same structure for each stage

k /
.t
b e
t u
se
/ c
: /
tp
h t

http://csetube.weebly.com/
48
k /
.t
Thank you u b e
e t
c s
/ /
p :
t
ht

http://csetube.weebly.com/
49

You might also like