CA6_F18_Solutions.pdf - ECE114 Fall 2014 Computer Assignment 6 Solution 1 Matlab functions 1.1 ScaleFTAmp.m function FAmp = ScaleFTAmp(F shift the FT

CA6_F18_Solutions.pdf - ECE114 Fall 2014 Computer...

This preview shows page 1 - 4 out of 9 pages.

ECE114, Fall 2014 Computer Assignment 6 Solution ________________________________________________________________________ 1. Matlab functions 1.1. ScaleFTAmp.m function FAmp = ScaleFTAmp(F) % shift the FT with shift, log, and rescale c = 4.; % take the log of the amplitude FAmp = log10(abs(F)/max(max(abs(F))) + 0.000001); % normalize the max number to 255 FAmp = (FAmp + c) * 255 / c; FAmp = fftshift(FAmp); 1.2. ReduceFT.m function out = ReduceFT(in, range) % reduce the FT coefficients to only those chosen % around DC [x_size, y_size] = size(in); out = in; out(range + 1 : x_size - range, : ) = 0.0001; out( :, range + 1 : x_size - range) = 0.0001; 2. Results 2.1. Task a Typing im = imread('ca6.tif'); imagesc(im); colormap(gray); axis square; yields the result in Figure 1. / 1 9
Image of page 1
Computer Assignment 6 Solution EE114, Winter 2014 Figure 1 Bridge original Typing ft = fft2(im); sft = ScaleFTAmp(ft); imagesc(sft); colormap(gray); axis square; yields the result in Figure 2. / 2 9
Image of page 2
ECE114, Fall 2014 Computer Assignment 6 Solution ________________________________________________________________________ Figure 2 FT coefficients magnitude, original 2.2. Task b: Reduced to [-128:127] Typing ft_128 = ReduceFT(ft, 128); sft_128 = ScaleFTAmp(ft_128); imagesc(sft_128); colormap(gray); axis square; yields the result in Figure 3.
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 9 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture