Title: EE 7730
1EE 7730
- 2D Discrete Fourier Transform (DFT)
22D Discrete Fourier Transform
- 2D Discrete Fourier Transform (DFT)
2D DFT is a sampled version of 2D FT.
32D Discrete Fourier Transform
- 2D Discrete Fourier Transform (DFT)
where and
42D Discrete Fourier Transform
- It is also possible to define DFT as follows
where and
52D Discrete Fourier Transform
where and
62D Discrete Fourier Transform
72D Discrete Fourier Transform
82D Discrete Fourier Transform
92D Discrete Fourier Transform
10Periodicity
- M,N point DFT is periodic with period M,N
1
11Periodicity
- M,N point DFT is periodic with period M,N
1
12Convolution
- Be careful about the convolution property!
LengthPQ-1
LengthQ
LengthP
For the convolution property to hold, M must be
greater than or equal to PQ-1.
13Convolution
4-point DFT (M4)
14DFT in MATLAB
- Let f be a 2D image with dimension M,N, then
its 2D DFT can be computed as follows - Df fft2(f,M,N)
- fft2 puts the zero-frequency component at the
top-left corner. - fftshift shifts the zero-frequency component to
the center. (Useful for visualization.) - Example
- f imread(saturn.tif) f double(f)
- Df fft2(f,size(f,1), size(f,2))
- figure imshow(log(abs(Df)), )
- Df2 fftshift(Df)
- figure imshow(log(abs(Df2)), )
15DFT in MATLAB
f
Df fft2(f)
After fftshift
16DFT in MATLAB
- Lets test convolution property
- f 1 1
- g 2 2 2
- Conv_f_g conv2(f,g) figure plot(Conv_f_g)
- Dfg fft (Conv_f_g,4) figure plot(abs(Dfg))
- Df1 fft (f,3)
- Dg1 fft (g,3)
- Dfg1 Df1.Dg1 figure plot(abs(Dfg1))
- Df2 fft (f,4)
- Dg2 fft (g,4)
- Dfg2 Df2.Dg2 figure plot(abs(Dfg2))
- Inv_Dfg2 ifft(Dfg2,4)
- figure plot(Inv_Dfg2)
17DFT in MATLAB
- Increasing the DFT size
- f 1 1
- g 2 2 2
- Df1 fft (f,4)
- Dg1 fft (g,4)
- Dfg1 Df1.Dg1 figure plot(abs(Dfg1))
- Df2 fft (f,20)
- Dg2 fft (g,20)
- Dfg2 Df2.Dg2 figure plot(abs(Dfg2))
- Df3 fft (f,100)
- Dg3 fft (g,100)
- Dfg3 Df3.Dg3 figure plot(abs(Dfg3))
18DFT in MATLAB
- Scale axis and use fftshift
- f 1 1
- g 2 2 2
- Df1 fft (f,100)
- Dg1 fft (g,100)
- Dfg1 Df1.Dg1
- t linspace(0,1,length(Dfg1))
- figure plot(t, abs(Dfg1))
- Dfg1_shifted fftshift(Dfg1)
- t2 linspace(-0.5, 0.5, length(Dfg1_shifted))
- figure plot(t, abs(Dfg1_shifted))
19Example
20Example
21DFT-Domain Filtering
- a imread(cameraman.tif')
- Da fft2(a)
- Da fftshift(Da)
- figure imshow(log(abs(Da)),)
- H zeros(256,256)
- H(128-2012820,128-2012820) 1
- figure imshow(H,)
- Db Da.H
- Db fftshift(Db)
- b real(ifft2(Db))
- figure imshow(b,)
H
Frequency domain
Spatial domain
22Low-Pass Filtering
81x81
61x61
121x121
23Low-Pass Filtering
h
DFT(h)
24High-Pass Filtering
h
DFT(h)
25High-Pass Filtering
High-pass filter
26Anti-Aliasing
aimread(barbara.tif)
27Anti-Aliasing
aimread(barbara.tif) bimresize(a,0.25) cimr
esize(b,4)
28Anti-Aliasing
aimread(barbara.tif) bimresize(a,0.25) cimr
esize(b,4) Hzeros(512,512) H(256-6425664,
256-6425664)1 Dafft2(a) Dafftshift(Da) Dd
Da.H Ddfftshift(Dd) dreal(ifft2(Dd))
29Noise Removal
- For natural images, the energy is concentrated
mostly in the low-frequency components.
Einstein
DFT of Einstein
Profile along the red line
Signal vs Noise
Noise40rand(256,256)
30Noise Removal
- At high-frequencies, noise power is comparable to
the signal power.
Signal vs Noise
- Low-pass filtering increases signal to noise
ratio.
31Appendix
32Appendix Impulse Train
- The Fourier Transform of a comb function is
33Impulse Train (contd)
- The Fourier Transform of a comb function is
(Fourier Trans. of 1)
?
34Impulse Train (contd)
35Appendix Downsampling
- Question What is the Fourier Transform of
?
36Downsampling
Using the multiplication property
37Downsampling
where
38Example
39Example
?
40Downsampling
41Example
42Example
No aliasing if