thank you so much. Okay so I changed some of my code to suit the question.
Generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the
4000 Hz sinusoids Finally, make sure that you have at least 25 samples per period of the sinusoidal wave. In other words, when you use the
colon operator to define the time vector, make the increment small enough to generate 25 samples per
So the only thing that I don't get now is am I generating 25 samples per period?
f = 4e3; % sinusoid freq
T = 1/f; % period (250 usec)
fs = T/25; % time step
tt = -T:fs:T; % time vector
x1 = 20*cos(2*pi*f*tt-8.5);
x2 = 24*cos(2*pi*f*tt+2);
x3 = x1+x2;
plot(tt, x1), grid on;
plot(tt, x2), grid on;
plot(tt, x3), grid on;
because I am doing this: but fs = 4000/25 = 160.
So I am doing 160 samples right?
I just want to make sure I have interpreted that part correctly so I can ask the teacher why he is doing that.