% 2-d laplacian enhancement filter using the dft
clear
x=[1 -1 3 2;
   2 1 2 4;
   1 -1 2 -2;
   3 1 2 2]; % input
h=zeros(8);h(1,1)=5;
h(1,2)=-1;h(2,1)=-1;h(8,1)=-1;h(1,8)=-1; % f coeff
H=fft2(h); % dft of filter
X=fft2(x,8,8); % dft of input
%
y=real(ifft2(X .* H)); %  output
round(y(1:4,1:4))
 



 
 

