Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 4780 2D Discrete Fourier Transform (DFT). Bahadir K. Gunturk2 2D Discrete Fourier Transform 2D Fourier Transform 2D Discrete Fourier Transform (DFT)

Similar presentations


Presentation on theme: "EE 4780 2D Discrete Fourier Transform (DFT). Bahadir K. Gunturk2 2D Discrete Fourier Transform 2D Fourier Transform 2D Discrete Fourier Transform (DFT)"— Presentation transcript:

1 EE 4780 2D Discrete Fourier Transform (DFT)

2 Bahadir K. Gunturk2 2D Discrete Fourier Transform 2D Fourier Transform 2D Discrete Fourier Transform (DFT) 2D DFT is a sampled version of 2D FT.

3 Bahadir K. Gunturk3 2D Discrete Fourier Transform Inverse DFT 2D Discrete Fourier Transform (DFT) where and

4 Bahadir K. Gunturk4 2D Discrete Fourier Transform Inverse DFT It is also possible to define DFT as follows where and

5 Bahadir K. Gunturk5 2D Discrete Fourier Transform Inverse DFT Or, as follows where and

6 Bahadir K. Gunturk6 2D Discrete Fourier Transform

7 Bahadir K. Gunturk7 2D Discrete Fourier Transform

8 Bahadir K. Gunturk8 2D Discrete Fourier Transform

9 Bahadir K. Gunturk9 2D Discrete Fourier Transform

10 Bahadir K. Gunturk10 Periodicity 1 [M,N] point DFT is periodic with period [M,N]

11 Bahadir K. Gunturk11 Periodicity 1 [M,N] point DFT is periodic with period [M,N]

12 Bahadir K. Gunturk12 Convolution Be careful about the convolution property! Length=P Length=Q Length=P+Q-1 For the convolution property to hold, M must be greater than or equal to P+Q-1.

13 Bahadir K. Gunturk13 Convolution Zero padding 4-point DFT (M=4)

14 Bahadir K. Gunturk14 DFT 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)),[ ]);

15 Bahadir K. Gunturk15 DFT in MATLAB f Df = fft2(f) After fftshift

16 Bahadir K. Gunturk16 DFT in MATLAB Let’s 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);

17 Bahadir K. Gunturk17 DFT 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));

18 Bahadir K. Gunturk18 DFT 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));

19 Bahadir K. Gunturk19 Example

20 Bahadir K. Gunturk20 Example

21 Bahadir K. Gunturk21 DFT-Domain Filtering a = imread(‘cameraman.tif'); Da = fft2(a); Da = fftshift(Da); figure; imshow(log(abs(Da)),[]); H = zeros(256,256); H(128-20:128+20,128-20:128+20) = 1; figure; imshow(H,[]); Db = Da.*H; Db = fftshift(Db); b = real(ifft2(Db)); figure; imshow(b,[]); Frequency domainSpatial domain H

22 Bahadir K. Gunturk22 Low-Pass Filtering 81x8161x61 121x121

23 Bahadir K. Gunturk23 Low-Pass Filtering * = DFT(h) h

24 Bahadir K. Gunturk24 High-Pass Filtering * = DFT(h) h

25 Bahadir K. Gunturk25 High-Pass Filtering High-pass filter

26 Bahadir K. Gunturk26 Anti-Aliasing a=imread(‘barbara.tif’);

27 Bahadir K. Gunturk27 Anti-Aliasing a=imread(‘barbara.tif’); b=imresize(a,0.25); c=imresize(b,4);

28 Bahadir K. Gunturk28 Anti-Aliasing a=imread(‘barbara.tif’); b=imresize(a,0.25); c=imresize(b,4); H=zeros(512,512); H(256-64:256+64, 256-64:256+64)=1; Da=fft2(a); Da=fftshift(Da); Dd=Da.*H; Dd=fftshift(Dd); d=real(ifft2(Dd));

29 Bahadir K. Gunturk29 Noise Removal For natural images, the energy is concentrated mostly in the low-frequency components. Profile along the red line DFT of “Einstein” “Einstein” Noise=40*rand(256,256); Signal vs Noise

30 Bahadir K. Gunturk30 Noise Removal At high-frequencies, noise power is comparable to the signal power. Signal vs Noise Low-pass filtering increases signal to noise ratio.

31 Bahadir K. Gunturk31 Appendix

32 Bahadir K. Gunturk32 Appendix: Impulse Train ■ The Fourier Transform of a comb function is

33 Bahadir K. Gunturk33 Impulse Train (cont’d) ■ The Fourier Transform of a comb function is (Fourier Trans. of 1) ?

34 Bahadir K. Gunturk34 Impulse Train (cont’d) ■ Proof

35 Bahadir K. Gunturk35 Appendix: Downsampling Question: What is the Fourier Transform of ?

36 Bahadir K. Gunturk36 Downsampling Let Using the multiplication property:

37 Bahadir K. Gunturk37 Downsampling where

38 Bahadir K. Gunturk38 Example

39 Bahadir K. Gunturk39 Example ?

40 Bahadir K. Gunturk40 Downsampling

41 Bahadir K. Gunturk41 Example

42 Bahadir K. Gunturk42 Example No aliasing if


Download ppt "EE 4780 2D Discrete Fourier Transform (DFT). Bahadir K. Gunturk2 2D Discrete Fourier Transform 2D Fourier Transform 2D Discrete Fourier Transform (DFT)"

Similar presentations


Ads by Google