Demo entry 6114004

elen

   

Submitted by anonymous on Sep 30, 2016 at 08:51
Language: Matlab. Code size: 589 Bytes.

%% Ze Scales HW 1 Q6
%% part b.
A = [8, 5, 2, 6, 3];
B = [2, 2, 9, 4, 7];
C = 2 * A .* B
figure()
stem(C)

%% part c.
n = -25:25;
T = 0.01;
x = cos(2 * pi * 5 * T * n)

figure()
plot(n, x)

%% part d.
hold on
stem(n, x, 'green')

%% part e.
% The frequency of the sampled signal has not changed. Rather, we are
% sampling for a longer amount of time. n represents the number of samples
% and to convert this into a real time, we multiply by the sampling period
% T.
T2 = 0.02
x2 = cos(2 * pi * 5 * T2 * n)

figure()
plot(n, x2)
hold on
stem(n, x2, 'green')

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).