introduction to the fast fourier transform · pdf fileintroduction fast fourier transforms...
TRANSCRIPT
Course Outline
Course Outline
INTRODUCTION TO THE
FAST FOURIER TRANSFORM
ALGORITHM
Introduction
Fast Fourier Transforms have revolutionized digital signal processing
What is the FFT?A collection of “tricks” that exploit the symmetry of the DFT calculation to make its execution much fasterSpeedup increases with DFT size
Introduction, continued
Some dates:1880 - algorithm first described by Gauss1965 - algorithm rediscovered (not for the first time) by Cooley and Tukey
In 1967, calculation of a 8192-point DFT on the top-of-the line IBM 7094 took ….
30 minutes using conventional techniques5 seconds using FFTs
Measures of computational efficiency
Could considerNumber of additionsNumber of multiplicationsAmount of memory requiredScalability and regularity
For the present discussion we’ll focus most on number of multiplications as a measure of computational complexity
More costly than additions for fixed-point processorsSame cost as additions for floating-point processors, but number of operations is comparable
Computational Cost of Discrete-Time Filtering
Computational Cost of Discrete-Time FilteringConvolution of an N-point input with an M-point unit sample response ….
Direct convolution:
Number of multiplies ≈ MN
y[n] = x[k]h[n− k]k=−∞
∞∑
Computational Cost of Discrete-Time Filtering
Computational Cost of Discrete-Time FilteringConvolution of an N-point input with an M-point unit sample response ….
Using transforms directly:
Computation of N-point DFTs requires multiplys Each convolution requires three DFTs of length N+M-1 plus an additional N+M-1 complex multiplys or
For , for example, the computation is
X[k] = x[n]e− j2πkn / N
n=0
N−1∑
3(N + M −1)2 + (N + M −1)
N >> M O(N2)
N2
The Cooley-Tukey decimation-in-time algorithm
The Cooley-Tukey decimation-in-time algorithm
X[k] =k=0
N−1∑ x[n]WNnk =
k=0
N−1∑ x[n]e− j2πnk / N ; WN = e− j2π / N
X[k] = x[n]WN2k +n even
∑ x[n]WN2k
n odd∑
• Consider the DFT algorithm for an integer power of 2,
• Create separate sums for even and odd values of n:
• Letting for n even and for n odd, we obtain
n = 2r n = 2r +1
X[k] = x[2r]WN2rk +r=0
N / 2( )−1∑ x[2r +1]WN 2r+1( )k
r=0
N /2( )−1∑
The Cooley-Tukey decimation in time algorithm
Splitting indices in time, we have obtained
But andSo …
N/2-point DFT of x[2r] N/2-point DFT of x[2r+1]
X[k] = x[2r]WN2rk +r=0
N / 2( )−1∑ x[2r +1]WN 2r+1( )k
r=0
N /2( )−1∑
WN2 = e− j2π2 / N = e− j2π /(N / 2) = WN / 2 WN
2rkWNk =WN
kWN / 2rk
X[k] =n=0
(N/ 2)−1∑ x[2r]WN /2
rk +WNk
n=0
(N/ 2)−1∑ x[2r +1]WN / 2
rk
Savings so far …
Savings so far …We have split the DFT computation into two halves:
Have we gained anything? Consider the nominal number of multiplications for
Original form produces multiplicationsNew form produces multiplications So we’re already ahead ….. Let’s keep going!!
X[k] =k=0
N−1∑ x[n]WNnk
=n=0
(N/ 2)−1∑ x[2r]WN /2
rk +WNk
n=0
(N/ 2)−1∑ x[2r +1]WN / 2
rk
N = 882 = 64
2(42 ) + 8 = 40
Signal flowgraph representation of 8-point DFT
Signal flowgraph representation of 8-point DFTRecall that the DFT is now of the formThe DFT in (partial) flowgraph notation:
The complete decomposition into 2-point DFTs
The complete decomposition into 2-point DFTs
Now let’s take a closer look at the 2-point DFT
The expression for the 2-point DFT is:
Evaluating for we obtain
which in signal flowgraph notation looks like ...
X[k] =n=0
1∑ x[n]W2
nk =n=0
1∑ x[n]e− j2πnk / 2
X[0] = x[0]+ x[1]
X[1] = x[0] + e− j2π1/ 2x[1] = x[0]− x[1]
This topology is referred to as thebasic butterfly
k = 0,1
The complete 8-point decimation-in-time FFT
Number of multiplys for N-point FFTs
N log2(N)
• Let• (log2(N) columns)(N/2 butterflys/column)(2 mults/butterfly)
or ~ multiplys
N = 2ν where ν = log2(N)
Computational complexity
Additional timesavers: reducing multiplications in the basic butterfly
As we derived it, the basic butterfly is of the form
Since we can reduce computation by 2 by premultiplying by
WNN / 2 = −1
WNr
WNr+N / 2
WNr
1
−1
WNr
Bit reversal of the input
Recall the first stages of the 8-point FFT:
Consider the binary representation of theindices of the input:
0 000 4 1002 0106 1101 0015 1013 0117 111
If these binary indices are time reversed, we get the binary sequence representing
0,1,2,3,4,5,6,7
Hence the indices of the FFTinputs are said to be in bit-reversed order
Some comments on bit reversalIn the implementation of the FFT that we discussed,
the input is bit reversed and the output is developed in natural order
Some other implementations of the FFT have the input in natural order and the output bit reversed
In some situations it is convenient to implement filtering applications by
Use FFTs with input in natural order, output in bit-reversed orderMultiply frequency coefficients together (in bit-reversed order)Use inverse FFTs with input in bit-reversed order, output in natural order
Computing in this fashion means we never have to compute bit reversal explicitly
Decimation in Freq FFT
Alternate FFT structures
We developed the basic decimation-in-time (DIT) FFT structure, but other forms are possible simply by rearranging the branches of the signal flowgraph
Consider the rearranged signal flow diagrams on the following panels …..
Alternate DIT FFT structures (continued)
DIT structure with input bit-reversed, output natural (OSB 9.10):
Alternate DIT FFT structures (continued)
DIT structure with input natural, output bit-reversed (OSB 9.14):
Alternate DIT FFT structures (continued)
DIT structure with both input and output natural (OSB 9.15):
Alternate DIT FFT structures (continued)
DIT structure with same structure for each stage (OSB 9.16):
Comments on alternate FFT structures
A method to avoid bit-reversal in filtering operations is:
Compute forward transform using natural input, bit-reversed output (as in OSB 9.10) Multiply DFT coefficients of input and filter response (both in bit-reversed order)Compute inverse transform of product using bit-reversed input and natural output (as in OSB 9/14)
Latter two topologies (as in OSB 9.15 and 9.16) are now rarely used
Using FFTs for inverse DFTsWe’ve always been talking about forward DFTs in our
discussion about FFTs …. what about the inverse FFT?
One way to modify FFT algorithm for the inverse DFT computation is:
Replace by wherever it appearsMultiply final output by
This method has the disadvantage that it requires modifying the internal code in the FFT subroutine
x[n] = 1Nk=0
N−1∑ X[k]WN
−kn ; X[k] =n=0
N−1∑ x[n]WN
kn
WNk WN
−k
1/N
A better way to modify FFT code for inverse DFTs
Taking the complex conjugate of both sides of the IDFT equation and multiplying by N:
This suggests that we can modify the FFT algorithm for the inverse DFT computation by the following:
Complex conjugate the input DFT coefficientsCompute the forward FFTComplex conjugate the output of the FFT and multiply by 1/N
This method has the advantage that the internal FFT code is undisturbed; it is widely used.
Nx *[n] = 1Nk=0
N−1∑ X *[k ]WN
kn; or x[n] = 1Nk=0
N−1∑ X *[k]WN
kn
*
Principle
Sinusoidal signals
Windowing: resolution and leakage (I)
Windowing: resolution and leakage (II)
Windowing: resolution and leakage (III)
Windowing: resolution and leakage (IV)
Frequencies matched to sampling points
Frequencies matched to sampling pointsN.B: if Hamming window:
Increasing the resolutionNot by increasing L, the DFT size:
Increasing the resolution(II)
Increasing the resolution(III)
Increasing the resolution(IV)
Increasing the resolution(V)
Increasing the resolution(VI)
Effect of window typeUse of other windows can reduce the contamination between peaks:
Effect of window type (II)
Effect of window type (III)
• Kaiser window: prediction formulae for N and β from the values of
– main lobe width
– relative attenuation of side lobes
Summary
We developed the structure of the basic decimation-in-time FFT
Use of the FFT algorithm reduces the number of multiplys required to perform the DFT by a factor of more than 100 for 1024-point DFTs, with the advantage increasing with increasing DFT size