chapter9computationofthedft-130219120328-phpapp01 - Copy
chapter9computationofthedft-130219120328-phpapp01 - Copy
2
9.0 Introduction
Implement a convolution of two
sequences by the following procedure:
1. Compute the N-point DFTX 1 k X 2 k
and
x1 n
of the two sequence x2 nand
2. ComputeX 3 k X 1 k X 2 k for0 k N 1
3. Computex3 n x1 n N x2 n as the
X 3 k of
inverse DFT
Why not convolve the two sequences directly?
5 5
9.1 Efficient Computation of
Discrete Fourier Transform
Most fast methods are based on Periodicity properties
Periodicity in n and k; Conjugate symmetry
j 2 / N k N n j 2 / N kN j 2 / N k n j 2 / N kn
e e e e
j 2 / N kn j 2 / N k n N j 2 / N k N n
e e e
Re ]
6 6
9.2 The Goertzel Algorithm
Makes use of the periodicity j 2 / N Nk
e e j 2 k 1
Multiply DFT equation with this factor
j 2 / N kN
N1
j 2 / N rk N1
j 2 / N k N r
X k e x[r ]e x[r ]e
r 0 r 0
Define
j 2 / N k n r
yk n x[r ]e u n r
r
using x[n]=0 for n<0 and n>N-1
X k yk n n N
X[k] can be viewed as the output of a filter to the input x[n]
Impulse response of filter: j 2 / N kn
h[n] e u n
X[k] is the output of the filter at time n=N
7 7
9.2 The Goertzel Algorithm
Goertzel j 2 / N kn
Filter: h[n] e u[n] W knu[n]
N
1
H k z
1 WN k z 1
X k yk n n N , k 0,1,..., N
N1
X k x[n]WNkn
n 0
Computational complexity
4N real multiplications; 4N real additions
Slightly less efficient than the direct method
But it avoids computation and storage ofW kn
8
N 8
Second Order Goertzel Filter
Goertzel Filter
1
H k z 2
j k 1
1 e N z
Multiply both numerator and denominator
2 2
j k j k
1 e N
z 1 1 e N
z 1
H k z
j
2
k 2
j k 1 2 k 1 2
1 e N
z 1
1 e N
z 1 2 cos z z
N
2 k
y[n] y[n 2] 2 cos y[n 1] x[n], n 0,1,..., N
N
yk [ N ] y[ N ] WNk y[ N 1] X k , k 0,1, ..., N
9 9
Second Order Goertzel Filter
2 k
y[n] y[n 2] 2 cos y[n 1] x[n], n 0,1,..., N
N
yk [ N ] y[ N ] WNk y[ N 1] X k , k 0,1, ..., N
Complexity for one DFT coefficient ( x(n) is complex
sequence).
Poles: 2N real multiplications and 4N real additions
Zeros: Need to be implement only once:
4 real multiplications and 4 real additions
Complexity for all DFT coefficients
Each pole is used for two DFT coefficients
Approximately N2 real multiplications and 2N2 real
additions
1 10
Second Order Goertzel Filter
2 k
y[n] y[n 2] 2 cos y[n 1] x[n], n 0,1,..., N
N
11 11
9.3 decimation-in-time FFT
Algorithms
Makes use of both periodicity and symmetry
Consider special case of N an integer power of 2
Separate x[n] into two sequence of length N/2
Even indexed samples in the first sequence
Odd indexed samples in the other sequence
N1
j 2 / N kn
X k x[n]e
n 0
G k W H k
k j 2 2 j 2
N W 2
N e N e N /2 WN /2
G[k] and H[k] are the N/2-point DFT’s of each subsequence
1 13
9.3 decimation-in-time FFT
Algorithms
N /2 1 N /2 1
X k x[2r ]W rk
N /2
k
W
N x[2r 1]W rk
N /2
r 0 r 0
G k W H k
k
j 2 2 rk j 2 rk
N
e N e N /2 WNrk/2
N1
k 0,1,..., k 0,1,..., N
2
N N
G k G k H k H k
2 2
G[k] and H[k] are the N/2-point DFT’s of each subsequence
1 14
8-point DFT using decimation-in-time
1 Figure 9.3
computational complexity
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
1 16
9.3 decimation-in-time FFT
Algorithms
N=8
1 17
9.3 decimation-in-time FFT
Algorithms
After two steps of decimation in time
Complexity:
Nlog2N complex multiplications and additions
1 19
Butterfly Computation
Flow graph constitutes of butterflies
Complexity:
(Nlog2N)/2 complex multiplications and Nlog2N additions
2 21
9.3.1 In-Place Computation 同址运算
Decimation-in-time flow graphs require two sets of registers
Input and output for each stage
X 0 0 x 0 x 0 X 2 0 X 0
X 0 1 x 4 x 4 X 2 1 X 1
X 0 2 x 2 x 2 X 2 2 X 2
X 0 3 x 6 x 6 X 2 3 X 3
X 0 4 x 1 x 1 X 2 4 X 4
X 0 5 x 5 x 5 X 2 5 X 5
X 0 6 x 3 x 3 X 2 6 X 6
2X0 7 x 7 x 7 X 2 7 X 7 22
9.3.1 In-Place Computation 同址运算
Note the arrangement of the input indices
Bit reversed indexing (码位倒置)
X 0 0 x 0 X 0 000 x 000 x 0 X 0
X 0 1 x 4 X 0 001 x 100 x 4 X 1
X 0 2 x 2 X 0 010 x 010 x 2 X 2
X 0 3 x 6 X 0 011 x 110 x 6 X 3
X 0 4 x 1 X 0 100 x 001 x 1 X 4
X 0 5 x 5 X 0 101 x 101 x 5 X 5
X 0 6 x 3 X 0 110 x 011 x 3 X 6
X 0 7 x 7 X 0 111 x 111 x 7 X 7
2 23
cause of bit-reversed order
010
011
100
101
110
111
X 0 0 x 0 X 0 000 x 000 x 0 X 0
X 0 1 x 4 X 0 001 x 100 x 4 X 1
X 0 2 x 2 X 0 010 x 010 x 2 X 2
X 0 3 x 6 X 0 011 x 110 x 6 X 3
X 0 4 x 1 X 0 100 x 001 x 1 X 4
X 0 5 x 5 X 0 101 x 101 x 5 X 5
X 0 6 x 3 X 0 110 x 011 x 3 X 6
X 0 7 x 7 X 0 111 x 111 x 7 X 7
2 25
9.3.2 Alternative forms
G k W H k
k j 2 2 j 2
N W 2
N e N e N /2 WN /2
G[k] and H[k] are the N/2-point DFT’s of each subsequence
2 29
9.3.1 In-Place Computation 同址运算
Bit reversed indexing (码位倒置)
X 0 000 x 000 x 0 X 0
X 0 001 x 100 x 4 X 1
X 0 010 x 010 x 2 X 2
X 0 011 x 110 x 6 X 3
X 0 100 x 001 x 1 X 4
X 0 101 x 101 x 5 X 5
X 0 110 x 011 x 3 X 6
X 0 111 x 111 x 7 X 7
3 30
9.3.2 Alternative forms
N1 N / 2 1 N1
X 2r x[n]WNn 2 r x[n]WNn 2 r x[n]WNn 2 r
n 0 n 0 n N / 2
N /2 1 N /2 1
Substitute x[n]W n N /2 2 r
variables n 0
n2r
N
n 0
x[n N / 2]WN
N /2 1
x[n] x[n N / 2]W nr
N /2
n 0
N /2 1
g (n)WNrn/2
n 0
3 32
9.4 Decimation-In-Frequency FFT
Algorithm N1
The DFT equation X k x[n]WNnk
n 0
N1 N /2 1 N1
X 2r 1 x[n]W n (2 r 1)
N x[n]W n (2 r 1)
N x[n]W n (2 r 1)
N
n 0 n 0 n N /2
N /2 1 N /2 1
n N /2 (2 r 1)
x[n]W n (2 r 1)
N x[n N / 2]WN
n 0 n 0
N /2 1
x[n] x[n N / 2]W n (2 r 1)
N
n 0
N / 2 1 N /2 1
x[n] x[n N / 2]W W n
N
rn
N /2
h(n)WNnWNrn/2
n 0 n 0
N
n 2 r 1 2 rn n rn n (2 r 1)
W N W W W W
N N N /2 N W N
2
WNNrWNN /2 1
3 33
decimation-in-frequency decomposition of an N-point
DFT to N/2-point DFT
N /2 1 N /2 1
X 2r x[n] x[n N / 2]WNnr/2 g (n)WNrn/2
n 0N /2 1 n 0 N /2 1
X 2r 1 x[n] x[n N / 2]WNnW
rn
N /2
h(n)WNnWNrn/2
3 n 0 n 0 34
decimation-in-frequency decomposition of an 8-point
DFT to four 2-point DFT
N / 4 1 N /4 1
X 2* 2 s [ g (n) g (n N / 4)]WNsn/4 p (n)WNsn/4
n 0 n 0
N / 4 1 N /4 1
X 2*(2 s 1) [ g (n) g (n N / 4)]W W
2n
N
sn
N /4 q (n)WN2 nWNsn/4
3 n 0 n 0 35
2-point DFT
X v ( p) X v 1 ( p) X v 1 (q)
3 36
N /2 1 N /2 1
X 2r x[n] x[n N / 2] WNnr/2 g (n)WNrn/2
n 0 n 0
N /4 1 N /2 1
X 2* 2 s g (n)WN2/2sn g (n)WN2/2sn
n 0 n N /4
N /4 1 N /4 1
g (n)WN2/2sn g (n N / 4)WN2/2s ( n N /4)
n 0 n 0
N /4 1 N /4 1
g (n)W sn
N /4 g (n N / 4)W sn
N /4
n 0 n 0
N /4 1 N /4 1
[ g (n) g (n N / 4)]W sn
N /4
p (n)WNsn/4
n 0 n 0
3
N /2 1 N /2 1
X 2r x[n] x[n N / 2] nr
WN /2 g (n)WNrn/2
n 0 n 0
N /2 1
X 2*(2 s 1) g (n)WN(2/2s 1) n
n 0
N /4 1 N /2 1
g (n)WN(2/2s 1) n g (n)WN(2/2s 1) n
n 0 n N / 4
N /4 1 N /4 1
g (n)WNsn/4WNn/2 g (n N / 4)WN(2/2s 1)( n N /4)
n 0 n 0
N /4 1 N /4 1
g (n)WNsn/4WN2 n g (n N / 4)WNsn/4WN2 nWN(2/ 2s 1) N /4
n 0 n 0
N /4 1 N /4 1
3
WN(2/2s 1) N /4 WNsN/2/2WNN/2/4 1
N /4 1
X 2* 2 s p (n)WNsn/4
n 0
N /4 1
X 2* 2* 2t p(n)W 2 tn
N /4
n 0
N /8 1 N /4 1
p (n)W 2 tn
N /4 p (n)W 2 tn
N /4
n 0 n N / 8
N /8 1 N /8 1
p (n)W 2 tn
N /4 p (n N / 8)W 2 t ( n N /8)
N /4
n 0 n 0
N /8 1
[ p (n) p (n N / 8)]WNtn/8
n 0
p (n) p (n 1) when N 8
3
N /4 1
X 2* 2 s p (n)WNsn/4
n 0
N /4 1
X 2* 2*(2t 1) p( n)WN(2/4t 1) n
n 0
N /8 1 N /4 1
p (n)WN(2/4t 1) n p (n)WN(2/ 4t 1) n
n 0 n N / 8
N /8 1 N /8 1
p (n)WN(2/4t 1) n p (n N / 8)WN(2/4t 1)( n N /8)
n 0 n 0
N /8 1 N /8 1
p (n)WN2/4
tn
WNn/4 p (n N / 8)WN2/4
tn
WNn/4WN(2/4t 1) N /8
n 0 n 0
N /8 1
[ p (n) p (n N / 8)]WNtn/8WN4 n
n 0 WN(2/4t 1) N /8 WNtN/4/4WNN/4/8 1
[ p (n) p (n 1)]W80 when N 8
4
Final flow graph for 8-point DFT
decimation in frequency
4 41
9.4.1 In-Place Computation 同址运算
DIF
FFT
DIT FFT
4 42
9.4.1 In-Place Computation 同址运算
DIF
FFT
DIT FFT
4 43
9.4.2 Alternative forms
decimation-in-frequecy Butterfly Computation
4 44
The DIF FFT is the transpose of the DIT FFT
DIF
FFT
DIT FFT
4 45
9.4.2 Alternative forms
DIF
FFT
DIT FFT
4
9.4.2 Alternative forms
DIF
FFT
DIT FFT
4
Figure 9.24 erratum
x 0
x 4
x 2
x 6
x 1
x 5
x 3
x 7
4
9.4.2 Alternative forms
DIF
FFT
DIT FFT
4
Chapter 9 HW
9.1, 9.2, 9.3,