f = imread('moon.tif');
PQ = paddedsize(size(f));
[U,V]=dftuv(PQ(1),PQ(2));
D0 = 0.05*PQ(2);
F = fft2(f,PQ(1),PQ(2));
H = exp(-(U.^2+V.^2)/(2*(D0^2)));
g = dftfilt(f,H);
figure(1),imshow(fftshift(H),[]);
figure(2), imshow(log(1+abs(fftshift(F))),[]);
figure(3), imshow(g,[]);