% dtft2_intro1.m

% The 'eight.tif" image is in matlab's image processing toolbox.
% If you do not have it, just try any image you want.
% (If you do, you may need to use 'uint8' to convert your image to grayscale.)

x = imread('eight.tif');
subplot(121), imshow(x), title 'before'
h = [0 1 0; 1 1 1; 0 1 0] / 5; % this is the specified impulse response
y = conv2(x, h, 'same');	% 2D convolution
y = uint8(y);			% convert to uint8 for imshow.
subplot(122), imshow(y), title 'after'
