% file:      	complex_view_4.m, (c) Matthew Roughan, Sun Aug 22 2004
N = 64;
x = (0:N-1)/N;
f1 = 3.4;
y1 = sin(2*pi*f1*x);
figure(11)
hold off
plot([x; x], [zeros(size(y1)); y1],'b', 'linewidth', 3);
hold on
plot(x, y1, 'bo', 'linewidth', 4);
set(gca, 'linewidth', 3, 'fontsize', 18, 'ylim', [-1.2 1.2], 'xlim', [0 max(x)], 'xtick', [], 'ytick', []);
title('signal');
set(gcf, 'PaperUnits', 'centimeters', 'PaperOrientation', 'portrait', 'PaperPosition', [0 0 20 12])
print('-depsc', 'Plots/circular_view_of_period_1.eps');

%% now do circular view
figure(21)
theta = 0:2*pi/N:2*pi-2*pi/N;
circ_x = cos(theta);
circ_y = sin(theta);
hold off
plot3(circ_x, circ_y, y1, 'o', 'linewidth', 5);
hold on
plot3([circ_x; circ_x], [circ_y; circ_y], [zeros(size(y1)); y1], 'b-', 'linewidth', 3);
plot3(circ_x, circ_y, zeros(size(y1)), 'k:', 'linewidth', 3);
grid on
set(gca,'xlim',[-1.5 1.5],'ylim',[-1.5 1.5], 'linewidth', 3, 'fontsize', 18);
view(-130,50);
set(gcf, 'PaperUnits', 'centimeters', 'PaperOrientation', 'portrait', 'PaperPosition', [0 0 18 14])
print('-depsc', 'Plots/circular_view_of_period_2.eps');
