(New page: ==Bug and the solution== <pre> 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 poin...)
 
(No difference)

Latest revision as of 14:41, 10 September 2008

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

Meet a recent graduate heading to Sweden for a Postdoctorate.

Christine Berkesch