%This illustrates how setting to zero portions of a spectrum
%can eliminate unwanted interference (notch filtering).
clear;load notch.mat; FX=fft2(X);
figure,imagesc(X),colormap(gray),axis off,title('Original image with scan lines')
figure,imagesc(fftshift(log10(abs(FX)))),colormap(gray),axis off,...
title('Log of magnitude of spectrum of original image')
%Eliminate scan lines by setting to zero spectrum along vertical axis Omega_1=0.
FY=FX;FY(:,[1:5 802-[1:5]])=0;Y=real(ifft2(FY));
figure,imagesc(Y),colormap(gray),axis off,title('Notch-filtered image')
figure,imagesc(fftshift(log10(abs(FY)))),colormap(gray),axis off,...
title('Log of magnitude of spectrum of notch-filtered image')