Part B: Find the Bug


Bugged 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)


--------------------------------------------------------------------------------------------------------------
To=1/13=0.076 and Ts=0.07 . Sampling rate seems to be too close to the period and based on the figure we conclude that the sampling rate is too small. One must decrease the sampling time to increase the sampling rate.



Correct matlab code :

F0 =13;
T0 =1/F0;
Ts = 0.07/1000;
t  = 0:Ts:13*T0;
x = real(exp(j*(2*pi*F0*t-pi/2)));
plot(t,x)

Alumni Liaison

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

Buyue Zhang