%This illustrates simple noiseless deconvolution using the 2-D DFT.
clear;load letters.mat;FX=fft2(X,280,280);
figure,imagesc(X),colormap(gray),axis off,title('Letters image f[n,m]')
%0-pad to size of blurred image, which is 276X276. Round 256+21-1=276 to 280.
H=exp(-[-10:10].*[-10:10]/20);FH=fft2(H'*H,280,280);%Gaussian PSF.
FY=FH.*FX;%2-D DFT of blurred image.
figure,imagesc(real(ifft2(FY))),colormap(gray),axis off,title('Blurred image g[n,m]')
Z=real(ifft2(FY./FH));%Deconvolve using Eq. (6.25)).
figure,imagesc(Z),colormap(gray),axis off,title('Deconvolved image f[n,m]')
