Presentation is loading. Please wait.

Presentation is loading. Please wait.

Frequancy Domain Filtering (FDF) Lab 5. Using FFT (Fast Fourier Transform ) algorithm DFT (Discrete Fourier Transform) & inverse DFT.

Similar presentations


Presentation on theme: "Frequancy Domain Filtering (FDF) Lab 5. Using FFT (Fast Fourier Transform ) algorithm DFT (Discrete Fourier Transform) & inverse DFT."— Presentation transcript:

1 Frequancy Domain Filtering (FDF) Lab 5

2 Using FFT (Fast Fourier Transform ) algorithm DFT (Discrete Fourier Transform) & inverse DFT

3 Image Operation in Frequency Domain

4 Fourier Transform MATLAB provides a collection of functions for computing and working with Fourier transforms. FunctionDescription fftDiscrete Fourier transform. fft22D Discrete Fourier transform. fftnnD Discrete Fourier transform. ifftinverse Discrete Fourier transform. ifft22D inverse Discrete Fourier transform. ifftnnD inverse Discrete Fourier transform. absMagnitude anglePhase angle unwrapUnwrap phase angle in radians. fftshiftMove zeroth lag to center cplxpairSort numbers into complex conjugate pairs. nextpow2Next higher power of two.

5 fft2 Y=fft2(X); % X is the spatial image It Computes and returns a Discrete Fourier transform(DFT) of an image X, computed with Fast Fourier Transform (FFT) algorithm. Y is the same size of X The origin of Y(DFT) is at top left, with four quarter meeting at the center of the frequency.

6 abs S = abs(Y); Used to obtain the Fourier spectrum. It computes the magnitude of each element in the DFT.

7 fftshift Yc = fftshift(Y); Used to move the origin of the DFT to the center(used to compute the centered DFT).

8 Computing and visualizing the 2D DFT in MATLAB >> X = imread(‘………’); % load in spatial image >> Y = fft2(X); % compute DFT >> S = abs(Y); % compute magnitude for display >> imshow(S,[]); % shows in four corners of display, you can write it as imshow( abs(Y), [] ); >> Yc = fftshift(Y); % shift DFT to center >> imshow(abs(Yc), [] ); % show magnitude of DFT in center

9 NOTE imshow(I,[low high]) displays the grayscale image I – The value low (and any value less than low) displays as black. – the value high (and any value greater than high) displays as white. – Values in between are displayed as intermediate shades of gray. – If you use an empty matrix [] for [low high], imshow uses [min(I(:)) max(I(:))]; that is: the minimum value in I is displayed as black. the maximum value in I is displayed as white.

10 DFT in center can be visually enhanced(increase visual details) by log transformation c*log(1+double(f)) >> Yc2 = log(1 + abs(Yc) ); >> imshow(Yc2, [] ); % or imshow(abs(Yc2), [] );

11 ifftshift Y=ifftshift(Yc) It reverses the centering. Used to move the origin of the DFT from the center to the top left.


Download ppt "Frequancy Domain Filtering (FDF) Lab 5. Using FFT (Fast Fourier Transform ) algorithm DFT (Discrete Fourier Transform) & inverse DFT."

Similar presentations


Ads by Google