%
% file:      	two_d_examples_vii.m, (c) Matthew Roughan, Mon Aug  9 2004
%
colormap(gray)

N = 32;
x = (1:N)/N;
[X, Y] = meshgrid(x,x);

f_0 = 3;
A = sin(2*pi*f_0*(X+2*Y)) > 0.2;
A = A - mean(mean(A));
B = fftshift(fft2(A));

figure(7)
subplot(1,2,1)
image(A, 'CDataMapping', 'scaled');
set(gca, 'xtick', [0:5:32], 'fontsize', 18);
title('signal');

figure(7)
subplot(1,2,2)
image(abs(B), 'CDataMapping', 'scaled');
colormap(gray);
set(gca, 'xtick', [0:5:32], 'fontsize', 18);
title('abs(DFT)');

set(gcf, 'PaperUnits', 'centimeters', 'PaperPosition', [0 0 23 10])
print('-depsc', sprintf('Plots/2d_7.eps', i));