% CS484-F13, FFT 1d example

Im=double(imread('einstein.pgm','pgm'));
f=Im(100,:);

figure; hold on;
plot(f,'r-');
F=fftshift(fft(f));
for n=[1,2,4,8,16,32,64,128],
  FF=zeros(size(F));
  FF(129-n+1:129+n-1)=F(129-n+1:129+n-1);
  ff=real(ifft(fftshift(FF)));
  clf; hold on; plot(f,'r-'); plot(ff,'b-');
  k=waitforbuttonpress;
end;

