clear all
clf
end1=15;
n=[-1-end1:end1+1];
t=[-1-end1:0.01:end1+1];
%
w0=3*pi/8;
%w0=2;
x=cos(w0*n);
y=cos(w0*t);
%
amin=min(n);
amax=max(n);
omin=min(x)-0.5;
omax=max(x)+0.5;
set(0,'defaultaxesfontsize',20);
figure(1)
stem(n,x,'Linewidth',3)
set(gca,'XTick',[-1-end1:end1+1])
axis([amin amax omin omax]);
hold on
plot(t,y,'r','Linewidth',3)
grid
xlabel('Discrete Time (n)'), ylabel('Signal Amplitude')
title('Sinewave')
hold off
