Revision as of 11:16, 10 September 2008 by Kschrems (Talk)

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

Part B: Find the Bug

The original Matlab code:
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)

This code produces an accurate plot of the real part of the signal it is attempting to plot. However, because the sampling frequency is so large, the plotted points make the signal look as if it is not periodic. In order to correct this mistake, the variable Ts needs to be much smaller.


New Matlab code:
F0 =13;
T0 =1/F0;
Ts = 0.1*T0;
t = 0:Ts:13*T0;
x = real(exp(j*(2*pi*F0*t-pi/2)));
plot(t,x)

Alumni Liaison

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

Alumni Liaison