Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
MEH329DIGITAL SIGNAL PROCESSING
-9-Fast Fourier Transform
Fast Fourier TransformIntroduction
MEH329 Digital Signal Processing 2
• Computational Complexity:• For each DFT coefficient:
• N complex multiplication (4N real multiplication+2N real addition)• N-1 complex addition (2(N-1) real addition)
• For all DFT coefficients:• NxN complex multiplication• Nx(N-1) complex addition
As N gets larger, the number of computations required for DFT becomesvery large
1
2 /
0
1[ ]
Nj N kn
k
x n X k eN
1
2 /
0
[ ]N
j N kn
n
X k x n e
MEH329 Digital Signal Processing 3
Fast Fourier Transform Introduction
MEH329 Digital Signal Processing 4
• The approaches that aim to provide a fast computation of DFTare termed fast Fourier transform (FFT). Most suchapproaches are motivated by the following two properties ofDFT:1. Conjugate symmetry
2 /2 /2
Nj N k
j N ke e
2
Nk kN NW W
Fast Fourier Transform Introduction
MEH329 Digital Signal Processing 5
• The approaches that aim to provide a fast computation of DFTare termed fast Fourier transform (FFT). Most suchapproaches are motivated by the following two properties ofDFT:
2. Periodicity with N
2 / 2 /j N k N j N ke e k N kN NW W
MEH329 Digital Signal Processing 6
Fast Fourier TransformIntroduction
MEH329 Digital Signal Processing 7
• Fast Fourier Transform (FFT).• 2 Decimation Algorithms:
• Decimation in Time (x[n] is decomposedinto successively smaller subsequences)
• Decimation in Frequency (X[k] is intosuccessively smaller subsequences)
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 8
• FFT based on decimation in time depends on decomposing x[n] into successively smaller subsequences
• Separate x[n] into two sequence of length N/2
– Even indexed samples in the first sequence– Odd indexed samples in the other sequence
12 /
0
1 12 / 2 /
n even n odd
[ ]
[ ] [ ]
Nj N kn
n
N Nj N kn j N kn
X k x n e
x n e x n e
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 9
/ 2 1 /2 1
2 12
0 r 0
[2 ] [2 1]
N Nr krk
N Nr
X k x r W x r W
• Using = 2 for even , and = 2 + 1 for odd
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 10
/ 2 1 /2 12 12
0 r 0
/2 1 /2 1
/2 /2r 0 r 0
[2 ] [2 1]
[2 ] [2 1]
N Nr krk
N Nr
N Nrk k rkN N N
kN
X k x r W x r W
x r W W x r W
G k W H k
N/2 point DFT of x[2r] N/2 point DFT of x[2r]
G[k] and H[k] are the N/2-point DFT’s of even and odd x[n] samples, and are periodic with N/2
• Using = 2 for even , and = 2 + 1 for odd
MEH329 Digital Signal Processing 11
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 12
MEH329 Digital Signal Processing 13
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 14
• 8-point DFT example using decimation-in-time
• Two N/2-point DFTs– 2(N/2)2 complex multiplications– 2(N/2)2 complex additions
• Combining the DFT outputs– N complex multiplications– N complex additions
• Total complexity– N2/2+N complex multiplications– N2/2+N complex additions– More efficient than direct DFT
• Repeat same process – Divide N/2-point DFTs into – Two N/4-point DFTs– Combine outputs
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 15
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 16
2-pointDFT
2-pointDFT
2-pointDFT
Fast Fourier TransformDecimation in Time (Final Graph)
MEH329 Digital Signal Processing 17
Nlog2N complex multiplications and additions
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 18
• Butterfly Structure:
WN(r+N/2) = -WN
r
(just one multiplication!)Reduces complex multiplications and additions to (N/2)log2N
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 19
• Indexing rule:
111x111X7x7X
011x110X3x6X
101x101X5x5X
001x100X1x4X
110x011X6x3X
010x010X2x2X
100x001X4x1X
000x000X0x0X
00
00
00
00
00
00
00
00
Bit reversed order!
Fast Fourier TransformDecimation in Time
MEH329 Digital Signal Processing 20
• Example: Find the DFT coefficients of x[n] = [1 1 2 2 -1 -1 2 2] using N=8 point FFT.
x[0]=1
x[4]=-1
x[2]=2
x[6]=2
x[1]=1
X[5]=-1
X[3]=2
X[7]=2
K[0]=1-1=0
K[1]=1+1=2
L[0]=2+2=4
L[1]=2-2=0
M[0]=1-1=0
M[1]=1+1=2
P[0]=2+2=4
P[1]=2-2=0
G[0]=0+4=4
G[1]=2+0j=2
G[2]=0-4=-4
G[3]=2-j0=2
H[0]=0+4=4
H[1]=2-j0=2
H[2]=0-4=-4
H[3]=2-j0=2
X[0]=4+4=8
X[1]=2+2(.707-j.707)
X[2]=-4-4(-j)
X[3]=2+2(-.707-j.707)
X[4]=4-4=0
X[5]=2+2(-.707+j.707)
X[6]=-4-4j
X[7]=2+2(.707+j.707)
Fast Fourier TransformDecimation in Frequency
MEH329 Digital Signal Processing 21
• Separate X[k] into two coefficient sequence of length N/2
1
0
[ ]N
nkN
n
X k x n W
1 /2 1 1
2 2 2
0 0 /2
2 [ ] [ ] [ ]N N N
n r n r n rN N N
n n n N
X r x n W x n W x n W
/ 2 1 / 2 1 /2 1
/2 22/2
0 0 0
2 [ ] [ / 2] [ ] [ / 2]N N N
n N rn r nrN N N
n n n
X r x n W x n N W x n x n N W
/ 2 1
/20
2 1 [ ] [ / 2]N
n rnN N
n
X r x n x n N W W
Even-indexed frequencies
Odd-indexed frequencies
Fast Fourier TransformDecimation in Frequency
MEH329 Digital Signal Processing 22
Fast Fourier TransformDecimation in Frequency
MEH329 Digital Signal Processing 23
Fast Fourier TransformDecimation in Frequency
MEH329 Digital Signal Processing 24
• N=8 point decimation in frequency: -- Twiddle factors
Fast Fourier TransformDecimation in Frequency
MEH329 Digital Signal Processing 25
• N=8 point decimation in frequency:
x[0]=1
X[1]=1
x[2]=2
x[3]=2
x[4]=-1
X[5]=-1
X[6]=2
X[7]=2
0
0
4
4
2
2(.707-j.707)
0
0
4
4
-4
j4
2
2(.707-j.707)
2
-1.414-j1.414
X[0]=8
X[4]=0
X[2]=-4+j4
X[6]=-4-j4
X[1]=2+2(.707-j.707)
X[5]=2-2(.707-j.707)
X[3]=2-2(.707+j.707)
X[7]=2+2(.707+j.707)
MEH329 Digital Signal Processing 26
MEH329 Digital Signal Processing 27
MEH329 Digital Signal Processing 28
MEH329 Digital Signal Processing 29
Windowing Prior to DFT• • In this case, frequency components that are not
actually in the signal occur
• • This is caused by the potential discontinuity that is caused by the periodicity in DFT
• • This can be considered as a leak of the energy to other frequencies, and therefore is termed spectral leakage
• • This problem can be mitigated by windowing
MEH329 Digital Signal Processing 30
MEH329 Digital Signal Processing 31
Discrete Fourier TransformWindowing
32
• Windowing is utilized to overcome this effect.• Well known window functions:
• Triangular• Trapezoid• Hamming• Hanning• Blackman• Parzen• Welch• Nuttall• Kaiser
0 5 10 15 20 250
0.2
0.4
0.6
0.8
1
Window Function (Hamming)
MEH329 Digital Signal Processing 33