i=imread('lena.bmp');
figure;imshow(i);
G=fft2(double(i));
FG=abs(fftshift(G));
PG=angle(G);
IFG=ifft2(FG);
IPG=ifft2(exp(j*PG));
figure;
subplot(2,2,1);
imshow(log(FG+1),[])%显示频谱幅度
title('图像频谱幅度');
subplot(2,2,2);
imshow(angle(fftshift(G)),[])
title('图像相位');
%---------------------------
subplot(2,2,3);
imshow(log(1+abs(IFG)),[]);
title('图像频谱幅度的逆变换');
subplot(2,2,4);
imshow(IPG,[]);
title('图像相位的逆变换');
%---------------------------
M=ifft2(abs(G).*exp(j*PG));
figure;imshow(M,[]);