This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Chapter 9. Computation of Discrete Fourier Transform
9.1 Introduction
9.2 Decimation-in-Time Factorization
9.3 Decimation-in-Frequency Factorization
9.4 Application of FFT
9.5 Fast Computation of DCT
9.6 Matrix Approach
9.7 Prime Factor Algorithm
BGL/SNU
1. Introduction
1,,1,0,][1
][: IDFT
1,,1,0,][][: DFT
,thenNotation Use-
1,,1,0,][1
][: IDFT
1,,1,0,][][: DFT
1
0
1
0
2
1
0
2
1
0
2
NnWkXN
nx
NkWnxkX
eW
NnekXN
nx
NkenxkX
N
k
knN
N
n
knN
Nj
N
N
k
nN
jk
N
n
nN
jk
BGL/SNU
????knNW of meaning the s What'-
manner.circular in clockwise
origin the from counted
circleunit the on points N
the amongpoint kn the th
0NW
1NW
2NW
3NW
4NW
5NW
6NW
7NW
8NW
)(
(NOTE)
Pj
P
N
Nj
PPN
N
NN
NN
eeWW
WWW 22
1/
12
2/ ,1,1
BGL/SNU
?NW of view in DFT is What -
up. themsum then and
,,, torespect
1)-x(N,x(1),(0),multiply x)1(10 kN
Nk
NN WWW
08W
kW8kW 2
8
kW 38
kW 48
kW 58
kW 78
)0(x
)3(x)2(x
)4(x
)5(x
)6(x)7(x
)1(x
kW 68
BGL/SNU
)4(3,2,1,0,][][3
04
NkWnxkXn
kn
]3[ˆ
]2[ˆ
]1[ˆ
]0[ˆ
100
0011
100
0011
]3[
]2[
]1[
]0[
1010
0101
1010
0101
100
0011
100
0011
]3[
]2[
]1[
]0[
11W- 1
111- 1
1 W1
111 1
]3[
]2[
]1[
]0[
]3[
]2[
]1[
]0[
9630
6420
3210
0000
x
x
x
x
W
W
x
x
x
x
W
W
x
x
x
x
W
x
x
x
x
WWWW
WWWW
WWWW
WWWW
X
X
X
X
- Example of fast computation
BGL/SNU
]0[x
]1[x
]2[x
]3[x
]0[X
]1[X
]2[X
]3[X1
1
]3[x̂
]2[x̂
]1[x̂
]0[x̂
1
W
W
8
12 : additions of #
24 : tionsmultiplica of #
BGL/SNU
2. Decimation-in-Time Factorization
)(,.2/
12/
02/
)(,.2/
12/
02/
12/
0
)12(12/
0
2
,,
.
1
0
]12[]2[
]12[]2[
)2(1,,1,0,][][
kHDFTptN
N
r
rkN
kN
kGDFTptN
N
r
rkN
N
r
krN
N
r
rkN
oddnevenn
DFTptN
N
n
knN
WrxWWrx
WrxWrx
NNkWnxkX
BGL/SNU
8)( Neg]0[x]1[x
]7[x
]0[X]1[X
]7[X
DFT
pt.-N
]0[x]2[x]4[x
]0[X]1[X]2[X
DFT
pt.-2
N
]3[X]6[x
]0[G
]1[G]2[G
]3[G
]1[x]3[x]5[x
]4[X]5[X]6[X
DFT
pt.-2
N
]7[X]7[x
]0[H
]1[H]2[H
]3[H
0NW
1NW
3NW
2NW
4NW
5NW
6NW
7NW
BGL/SNU
graph flow Final
]0[x
]2[x
]4[x
]6[x
]1[x
]3[x
]5[x
]7[x
]0[X
]1[X
]2[X
]3[X
]4[X
]5[X
]6[X
]7[X
0NW
1NW
3NW
2NW
4NW
5NW
6NW
7NW
0NW
0NW
0NW
0NW
4NW
4NW
4NW
4NW
0NW
2NW
4NW
6NW
0NW
2NW
4NW
6NW
000
100
010
110
001
101
011
111
000
100
010
110
001
101
011
111
)( reversedbit )(natural
BGL/SNU
reversed.-bit : ordering datainput -
scompuation phase-in -
N/22 : additons
N/21 : tionsmultiplica
(complex) nscomputatio of # total
/butterflyy2/butterfl : additons
y1/butterfly2/butterfl : tionsmultiplica
(complex) nscomputatio # -
N/2/stage# : sbutterflie -
Nlogstages# : processing cascaded -
Remarks
2
NN
NN
2
2
log
log2
2
18W
58W
18W
1
1
BGL/SNU
Decimation-in-time FFT flow graphs
BGL/SNU
Decimation-in-time FFT flow graphs
BGL/SNU
Decimation-in-time FFT flow graphs
BGL/SNU
(Sande- Tuckey) FFT
nkN
k
N
n
N
n
nkN
kN
N
N
n
nkN
N
Nn
nkN
N
n
nkN
N
n
nkN
WN
nxnx
WN
nxWWnx
WnxWnx
NNkWnxkX
]}2
[)1(][{
]2
[][
][][
2 ,1,...,1,0 ,][][
12
0
12
0
2
12
0
1
2
12
0
1
0
3. Decimation-in-frequency Factorization
BGL/SNU
12
0 2
12
0 2
]}2
[][{]12[
12
,...,1,0 ,]}2
[][{]2[
N
n
nN
nrN
N
n
nrN
WWN
nxnxrX
NrW
NnxnxrX
g(n)
h(n)
g[0]
g[1] g[2] g[3]
h[0] h[1] h[2] h[3]
X[0]
X[2] X[4] X[6]
X[1] X[3] X[5] X[7]
x[0] x[1] x[2] x[3]
x[4] x[5] x[6] x[7]
48
38
28
18
W 1
W 1
W 1
W 1
DFT2
ptN
DFT2
ptN
Final flow graph
X[0]
X[4]
X[2]
X[6]
X[1]
X[5]
X[3]
X[7]
x[0
]
x[1
]
x[2
]
x[3
]
x[4
]
x[5
]
x[6
]
x[7
]
3N
2N
1N
0N
W 1
W 1
W 1
W 1
2N
0N
2N
0N
W 1
W 1
W 1
W 1
0N
0N
0N
0N
W 1
W 1
W 1
W 1
BGL/SNU
-Remarks
)(log2
:
2:
log:
2
2
complexNN
N
N - # Stages
- # butterflies
- # computations
- inplace computations
- output data ordering : bit-reversed
-Question
The flow graph for D-I-F is obtained by reversing.
The direction of the flow graph for D-I-T. Why?
-Omit Sections 9.5-9.7BGL/SNU
(1) Spectrum Analysis
-
is the spectrum of x[n] , n=0,1,…,N-1
- Inverse transform can be done through the same mechanism
i) Take the complex conjugate of X[k]
ii) Pass it through the FFT process,
But with one shift right(/2) operation at each stage
iii) Finally, take the complex conjugate of the result
- Example: 2D DCT Algorithm (1991, N.I.Cho and S.U.Lee)
BGL/SNU
otherwise, 1
0k,2
1 ][u
1,...,1,0,
2
)12(cos
2
)12(cos],[][][
4n],[
1
0
1
02
k
Nnm
N
nj
N
mijixnumu
NmY
N
n
N
j
Separable Transform NxN 2D DCT = N 1-D DCT into row direction followed by N 1-D DCT into column direction. Totally 2N 1-D DCT (each N-point) are required.
Fast Algorithm reduces the number of 1-D DCTs into N.
By using the trigonometric properties, 2D DCT is decomposed into 1-D DCTs.
N
njmi
N
njmiN
nj
N
mi
2
)12()12(cos
2
)12()12(cos
2
12
)12(cos
2
)12(cos
Signal flow graph of 2-D DCT8x8 DCT 4x4 DCT
6. Matrix Approach
0001100101
01
01
22)2)(2(
012
012
0
),(3,2,1,0),(
),(3,2,1,0),(
,4for
)()(
nknknknnkknk
nnn
kkk
knNkn
WWW
nnxnnx
kkXkkX
N
nxnx
WW
· Decimation-in-time
1
0
1
0
)2(201001
0 1
00110),(),(n n
nkknk WWnnxkkX
),( 001 nkx
BGL/SNU
reversed!order -bit ;
),(),(
),(),(
),(),(
01102
1
0
)2(00101
1
0
2010001
0
001
1
10
kkXkkx
WnkxkkX
Wnnxnkx
n
nkk
n
nk
)1,1(
)0,1(
)1,0(
)0,0(
010
001
010
001
)1,1(
)0,1(
)1,0(
)0,0(
0
0
0
0
2
2
0
0
1
1
1
1
x
x
x
x
W
W
W
W
x
x
x
x
)1,1(
)0,1(
)1,0(
)0,0(
100
100
001
001
)1,1(
)0,1(
)1,0(
)0,0(
1
1
1
1
3
1
2
0
2
2
2
2
x
x
x
x
W
W
W
W
x
x
x
x
)3(
)2(
)1(
)0(
)1,1(
)0,1(
)1,0(
)0,0(
100
100
001
001
010
001
010
001
)1,1(
)0,1(
)1,0(
)0,0(
)1,1(
)1,0(
)0,1(
)0,0(
)3(
)2(
)1(
)0(
0
0
0
0
3
1
2
0
2
2
0
0
2
2
2
2
x
x
x
x
x
x
x
x
W
W
W
W
W
W
W
W
x
x
x
x
X
X
X
X
X
X
X
X
).()(where 0 nxnx BGL/SNU
· Decimation-in-frequency
1
0
1
0
2)2(01001
0 1
01001),(),(n n
nkknn WWnnxkkX
),( 001 nkx
reversed!order -bit ;
),(),(
),(),(
),(),(
01102
1
0
200101
1
0
)2(010001
0
01
1
001
kkXkkx
WnkxkkX
Wnnxnkx
n
nk
n
knn
)3(
)2(
)1(
)0(
00
00
1010
0101
00
1100
00
0011
)3(
)2(
)1(
)0(
32
10
20
20
x
x
x
x
WW
WW
WW
WW
X
X
X
X
BGL/SNU
· General expression for N=2 case
022
11
022
11
22
22
kkkk
nnnn
knkkknkknknnk
nk
n n n
WWWWW
WnnnxkkkX
ii
ii
00111
0122
011
0 1 1
)22(2)2(22
021
1
0
1
0
1
0021 ),,,(),,,(
knkknkn
n n n
WWWnnnx
kkkX
00122
011
0 1 1
)2(22021
1
0
1
0
1
0
021
),,,(
),,,(
),,,( 0201 nnkx
),,,,( 03102 nnkkx
),,,( 110 kkkx
)222(),,,,,,(
),,,,,,(with
0122
112
01,210
1
01
021,110
1
kkkkWnnnkkkx
nnnkkkx
ii
iin
iiin
i
iiii
i
i
,1,,1,0
,1,,1,0,
,1,,1,0
,1,,1,0,
prime)y necessaril(not
0
101
0
101
qk
pkkqkk
pn
qnnpnn
qpN
1
0
1
0
)(0101
0101
1 0
00110),(),(
),()(),,()(q
n
p
n
nkqknpk WWnnxkkX
kkXkXnnxnx
),( 001 nkx
1
0102
)(00101
1
001001
0
101
1
10
),(),(),(
),(),(
p
n
nkqk
q
n
npk
kkxWnkxkkX
Wnnxnkx
· Extension to general N (Cooley/Tuckey)
BGL/SNU
· # computations (complex)
NNNNN
pppNpppN
qpN
npNx
nqNx
2
2121
02
11
log)222(222if
)(if
)2( total
)1hen (except w )1(
)0hen (except w )1(
times)( times)(
BGL/SNU
7. Prime Factor Algorithm (Thomas/Good)(1) Basics from Number Theory Euler’s Phi function
.2)6(,4)5(,2)4(,2)3(,1)2(,1)1()(
)than smaller numbers prime relative (#
.1),gcd(with1)(
eg
n
nllnnl
Euler’s Theorem
6mod125,2)(,6,5)(
.mod1then,1),(If)(
)(
NaNNaeg
NaNa
Chinese Remainder Theorem (CRT)
.modby determined is and
,mod and}1,,1,0{
s.t. unique a is there},1,,1,0{Given
.,1),(,
)()(
11
21
1
NN
Na
N
Naaa
iNaaNa
aNa
kiNNNNNN
LN
LL
N
ii
ii
kiL
N
122141
231
1
21
1112
1221
)(12
)(21
21
9412mod3344
.4,3,12)(
.modwhere,mod
mod
)2( case) Special(
21
21
aaaaa
NNNeg
NNNNaNNa
NNaNaa
LNNN
NNN
NN
1a 2a
112582
710141
36900
3210
Second Integer Representation (SIR)
.modby determined is and
,mod and}1,,1,0{
s.t. unique a is there},1,,1,0{Given
.,1),(,
11
21
NN
Na
N
Naaa
iNaN
NaNa
aNa
kiNNNNNN
LL
i
Nii
ii
kiL
i
BGL/SNU
}11,,1,0{ a
1221
21
1221
21
34
.4,3,12)(
mod
case) (Special
aaa
NNNeg
NNaNaa
NNN
1a 2a
521182
110741
96300
3210
}11,,1,0{ a
BGL/SNU
(2) Prime Factor Algorithm
.1),(,where1,,1,0,)()(1
0
qpqpNNkWnxkXN
n
nkN
.1,,1,0
1,,1,0
mod
),(
1,,1,0
1,,1,0
mod
),(
1
0
11
01
01
1
0
01
01
pk
qk
Nkqqkppk
CRTviakkk
qn
pn
Nqnpnn
SIRviannn
pq
Set
Then
.100111
001
1
11
001
011
101
1
11
01
01 ))((
knp
knq
kqqnp
kppnq
kqqqnpq
kppqnpq
kqqpnpq
kpppnpq
kqqkppqnpnpq
nkN
WWWW
WWWW
WW
pq
pqpq
pq
BGL/SNU
Therefore
1
0
1
00101
0 1
1001),(),(p
n
q
n
knp
knq WWnnxkkX
),( 011 nkx
1
010201101
1
001011
0
10
1
01
),(),(),(
),(),(
p
n
knp
q
n
knq
kkxWnkxkkX
Wnnxnkx
Note that the only difference is in the “twiddle factor” .00nkNW