fast fourier transform & assignment 2 yong-fong lin visual communications lab department of...
TRANSCRIPT
Fast Fourier Transform&
Assignment 2Yong-Fong LinVisual Communications LabDepartment of Communication EngineeringNational Central UniversityChungli, TaiwanOct. 4, 2007
Outline
• Assignment Description• Discrete Fourier Transform Review• Introduction to Fast Fourier Transform(FFT)• Example : 4 Point FFT & FFT Butterfly• Experimental Result• Notice• Reference
Assignment Description
• Part 1Transform an gray image from spatial
domain into frequency domain using Fast Fourier Transform(FFT). And show the spectrum of the image.
• Part 2Rotate the gray image by , and show
the spectrum of the rotated image.
o90
Discrete Fourier Transform(DFT) Review
• One-Dimensional DFT
for u = 0,1,2, …. ,M-1
1
0
)(1
)(M
x
uxMWxfM
uF MjM eW /2,
Fast Fourier Transform (1/5)
for u = 0, 1, 2, … ,M-1If (n N) then M can be expressed as M=2K (K N)
MjM eW /2,
nM 2
1
0
)(1
)(M
x
uxMWxfM
uF
12
0
)(2
1)(
K
x
uxMWxfK
uF
1
0
)12(2
1
0
)2(2 )12(
1)2(
1
2
1 K
x
xuK
K
x
xuK Wxf
KWxf
K
1
02
)2(2
1
0
)2(2 )12(
1)2(
1
2
1 K
x
uK
xuK
K
x
xuK WWxf
KWxf
K
1
02
1
0
)12(1
)2(1
2
1 K
x
uK
uxK
K
x
uxK WWxf
KWxf
K
(Keep this in mind !!)
Fast Fourier Transform (2/5)
(1) for u = 0,1, … , K-1
1
02
1
0
)12(1
)2(1
2
1 K
x
uK
uxK
K
x
uxK WWxf
KWxf
K
uKoddeven WuFuFuF 2)()(
2
1)(
Fast Fourier Transform (3/5)By (1)
)(2)()(
2
1)( Ku
Koddeven WKuFKuFKuF
1
0
)(2
)(1
0
)( )12(1
)2(1
2
1 K
x
KuK
xKuK
K
x
xKuK WWxf
KWxf
K
1
022
1
0
)12(1
)2(1
2
1 K
x
KK
uK
KxK
uxK
K
x
KxK
uxK WWWWxf
KWWxf
K
1
022
1
0
)12(1
)2(1
2
1 K
x
KK
uK
uxK
K
x
uxK WWWxf
KWxf
K
1
02
1
0
)12(1
)2(1
2
1 K
x
uK
uxK
K
x
uxK WWxf
KWxf
K
Fast Fourier Transform (4/5)
(2)
for u = K, K+1, … , 2K-1
uKoddeven WuFuFKuF 2)()(
2
1)(
uKoddeven WuFuF 2)()(
2
1
Fast Fourier Transform (5/5)
• Conclusion:– We can perform the DFT by using FFT as follow steps
for the first K points (u = 0 ~ K-1)
for the rest K points (u = K ~ 2K-1)the rest K points doesn’t need extra computation, it can just be obtained by the result of first K points.
uKoddeven WuFuFuF 2)()(
2
1)(
uKoddeven WuFuFKuF 2)()(
2
1)(
Example : 4 Point FFT & FFT Butterfly• Consider a sequence : f(x) for x= 0 ~ 3 need to be
transformed.• The transformed result is F(u) for u = 0 ~ 3.F(0
)
F(2)
F(1)
F(3)
F(0)
F(1)
F(2)
F(3)
18W
08W
F(0)
F(2)
F(1)
F(3)
08W
08W
+
-
Experimental Result (1/2)
• Original image and the corresponding spectrum
Experimental Result (2/2)
• Rotated image and the corresponding spectrum
Notice• Don’t forget to multiply
• According to the property of “ Separability ” , we can perform two-dimensional DFT by using one-dimensional DFT. (p197)
• is just • To deal with complex number , we must have
2 buffer. – One for the real part– The other for the imaginary part
)()1( yx
jaexp )sin()cos( aja
Reference
• Rafael C. Gonzalez , Richard E. Woods , “Digital Image Processing, ” second edition , pp.208-213