%
% file:      	complex_view_2.m, (c) Matthew Roughan, Sun Aug 22 2004
% view of FT in complex plane
%
N = 32;
x = (0:N)/N;
f1 = 3.4;
y1 = sin(2*pi*f1*x);
z1 = abs(fft(y1)).^2;

theta = 0:2*pi/N:2*pi;
circ_x = cos(theta); circ_y = sin(theta);

figure(2)
hold off
plot3(circ_x, circ_y, z1, 'o', 'linewidth', 5);
hold on
plot3([circ_x; circ_x], [circ_y; circ_y], [zeros(size(z1)); z1], 'b-', 'linewidth', 3);
plot3(circ_x, circ_y, zeros(size(z1)), 'k:', 'linewidth', 3);
grid on
set(gca,'xlim',[-1.5 1.5],'ylim',[-1.5 1.5]);
set(gca, 'linewidth', 3, 'fontsize', 18);
xlabel('real');
ylabel('imaginary');
az = -60;
el = 30;
view(az,el);

set(gcf, 'PaperUnits', 'centimeters', 'PaperPosition', [0 0 18 10])
print('-depsc', 'Plots/complex_view_circ.eps');
