Tuesday, November 04, 2008

Frequency response of Laplacian filter

zero freq response shifted to (32,32), Matlab code:

clear
X=[-1 0 -1;-1 4 -1;-1 0 -1];
Y=fft2(X,64,64);
Y=fftshift(Y);
Y=abs(Y);
figure(1)
[x,y]=meshgrid(1:1:64,1:1:64);
mesh(x,y,Y)
title('frequency response of 3x3 Laplacian filter')
xlabel('k_1 +32')
ylabel('k_2 +32')
figure(2)
contour(Y)
title('frequency response of 3x3 Laplacian filter')
xlabel('k_1 +32')
ylabel('k_2 +32')


laplacian_1 laplacian_2

No comments:

Post a Comment