f = imread('coins.png');
g0 = im2double(f);
g1 = fft2(g0);
g2 = fftshift(g1);
g3 = abs(g2);
g4 = log(g3+1);
subplot(3,3,1);imshow(f);title("原图");
subplot(3,3,2);imshow(g0);title("格式转换");
%subplot(3,3,3);imshow(g1);title("计算频谱");
%subplot(3,3,4);imshow(g2);title("平移");
subplot(3,3,5);imshow(g3,[]);title("频谱幅度");
subplot(3,3,6);imshow(g4,[]);title("对数变换");