Revision as of 14:41, 10 September 2008 by Sranka (Talk)

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

Bug and the solution

The bug in the above problem is that the step time Ts=0.07 is too big as the period for one cycle To=1/f=0.0786. Thus in one there are hardly one or two points and thus the plot is too  irregular and cannot be plotted correctly.
By reducing the step time we can overcome this problem. so if Ts reduced by a factor of say 70 i.e Ts=0.001. The bug vanishes as now there are enough points on one wave that can be taken into consideration for plotting the curve. 

corrected code

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

Alumni Liaison

To all math majors: "Mathematics is a wonderfully rich subject."

Dr. Paul Garrett