Here are the images produced by my work on assignment #1. Note that the images are slightly distorted because I specified each image (in HTML) to be a 100x100 square. Not all of the images were actually square-shaped.
>> colormap("default") # use the default 3*64 colormap >> x=zeros(10); # make a 10*10 matrix of zeros >> x(30:80,30:80)=ones(51); # change a square in the middle to ones >> x = x*64; # change the ones to 64s (because the value is a colormap index) >> imshow(x) # display the 2D square>> y = fft(x) # compute it's Fourier transform >> z = abs(y) # compute the magnitude component >> imshow(z) # visualize the magnitude response
>> z = arg(y) # compute the phase component >> imshow(z) # visualize the phase response
>> x = loadimage("baby.img") # load the image into variable 'x' >> imshow(x) # display the image>> y = fft(x) # compute the image's Fourier transform and store # the result in variable 'y' >> z = abs(y) # get the magnitude component and store it in 'z' >> imshow(z) # visualize the magnitude response
>> z = arg(y) # get the phase component and store it in 'z' >> imshow(y) # visulaize the phase response