(a) Generate a 256 × 256 grey level image M showing a sine in the horizontal direction with a period of 16 pixels. Display the image using the commands :
imagesc(M)
colormap(gray);
Plot the magnitude of the frequency spectrum (both linear and logarithmic) and interpret the result. With the fftshift command you can put DC at the center of your plot. Display the axes in periods per pixel using command imagesc(...,...,fftshift(...)).
(b) Now generate a 256 × 256 image with a sine in the vertical direction and a period of 32 pixels. Sum both images together and interpret the resulting spectrum.