Revision as of 14:21, 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.01*T0;
t = 0:Ts:13*T0;
x = real(exp(j*(2*pi*F0*t-pi/2)));
plot(t,x)

Untitled5 ECE301Fall2008mboutin.jpg

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang