Given MATLAB Code

This MATLAB program attempts to plot 13 cycles of a 13 Hz sinusoid.

F0 =13;

T0 =1/F0;

Ts = 0.07;

t = 0:Ts:13*T0;

x = real(exp(j*(2*pi*F0*t-pi/2)));

plot(t,x)


Correct MATLAB Code

F0 =13;

T0 =1/F0;

Ts = 0.0007;

t = 0:Ts:13*T0;

x = real(exp(j*(2*pi*F0*t-pi/2)));

plot(t,x)

The problem was that the sampling frequency Ts was too high. I decreased it by a factor of 100 and it produced the correct graph.

Alumni Liaison

Have a piece of advice for Purdue students? Share it through Rhea!

Alumni Liaison