Revision as of 11:24, 11 September 2008 by Cjuzeszy (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood