% Periodic discrete sinusoid
fh = figure;
subplot(3,1,1);
w0 = 2*pi/6;
n = -5:30;  x = -5:0.1:30;
y = cos(w0*n);  yc = cos(w0*x);
stem(n,y,'k','filled');
hold on;  plot(x,yc,'--');  hold off;
title('\omega=2\pi/6 (period T=6)');

% Discrete sinusoid with periodicity different from inverse frequency
subplot(3,1,2);
w0 = 2*pi/6.5;
y = cos(w0*n);  yc = cos(w0*x);
stem(n,y,'k','filled');
hold on;  plot(x,yc,'--');  hold off;
title('\omega=2\pi/6.5 (period T=13)');

% Discrete sinusoid with no periodicity
subplot(3,1,3);
w0 = 1;
y = cos(w0*n);  yc = cos(w0*x);
stem(n,y,'k','filled');
hold on;  plot(x,yc,'--');  hold off;
title('\omega=1 (not periodic)');

%print(fh,'-depsc2','periodicity.eps');
%close(fh);
