% file:      	two_d_filter_ex_i.m, (c) Matthew Roughan, Sat Aug 21 2004
%
N = 250;
x = (1:N)/N;
[X, Y] = meshgrid(x,x);
A = ((X-0.5).^2 + (Y-0.5).^2) < 0.007;      %  a simple image
B = 10*log10(abs(fftshift(fft2(A))).^2);    %  and its DFT

figure(1)
image(A, 'CDataMapping', 'scaled');
set(gca, 'xtick', [0:50:250], 'ytick', [0:50:250]);
set(gca, 'fontsize', 18);
title('signal');
colorbar;
set(gcf, 'PaperUnits', 'centimeters', 'PaperPosition', [0 0 12 10])
print('-depsc', sprintf('Plots/2d_filter_1a.eps', i));

figure(2)
image(B, 'CDataMapping', 'scaled');
% colormap(gray);
set(gca, 'fontsize', 18);
title('power spectrum');
colorbar;
set(gcf, 'PaperUnits', 'centimeters', 'PaperPosition', [0 0 12 10])
print('-depsc', sprintf('Plots/2d_filter_1b.eps', i));

