Hw1 Matlab diary
Problem M2.5
n = 0:50;
% 21a)
s = exp(-.4*pi*i*n);
subplot 211
stem(real(s))
xlabel('Real part');
subplot 212
stem(imag(s))
xlabel('Imaginary part');
title('21a) N=5');
% 21b)
s = sin(.6*pi*n + .6*pi);
stem(s)
title('21b) N=10');
% 21c)
s = 2*cos(1.1*pi*n - .5*pi) + 2*sin(.7*pi*n);
stem(s)
title('21c) N=20');
% 21d)
s = 3*sin(1.3*pi*n) - 4*cos(.3*pi*n + .45*pi);
stem(s)
title('21d) N=20');
% 21e)
s = 5*sin(1.2*pi*n + .65*pi) + 4*sin(.8*pi*n) - cos(.8*pi*n);
stem(s)
title('21e) N=5');
% 21f)
s = mod(n,6);
stem(s)
title('21(f) N=6');