(New page: == Problem == The problem of the program is that the Ts value is too big. T0=1/F0=0.76, and Ts=0.7 is almost a whole period. So The step of the approximation is too big. == Fix == decr...) |
(→Matlab Code) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
The problem of the program is that the Ts value is too big. | The problem of the program is that the Ts value is too big. | ||
− | T0=1/F0=0.76, and Ts=0.7 is almost a whole period. | + | T0=1/F0=0.76, and Ts=0.7 is almost a whole period.The step of the approximation is so big that it only take approximate 1 point in each period, which is not adequate for sketching the graph. |
− | + | ||
== Fix == | == Fix == | ||
− | + | Decrease the value of Ts. | |
− | + | ||
== Matlab Code == | == Matlab Code == | ||
Line 14: | Line 12: | ||
f0=13; | f0=13; | ||
t0=1/f0; | t0=1/f0; | ||
− | ts=0.07/100; | + | ts=0.07/100; %where I fixed |
t=0:ts:13*t0; | t=0:ts:13*t0; | ||
x=real(exp(j*(2*pi*f0*t-pi/2))); | x=real(exp(j*(2*pi*f0*t-pi/2))); | ||
plot(t,x); | plot(t,x); | ||
</pre> | </pre> |
Latest revision as of 08:54, 6 September 2008
Problem
The problem of the program is that the Ts value is too big. T0=1/F0=0.76, and Ts=0.7 is almost a whole period.The step of the approximation is so big that it only take approximate 1 point in each period, which is not adequate for sketching the graph.
Fix
Decrease the value of Ts.
Matlab Code
f0=13; t0=1/f0; ts=0.07/100; %where I fixed t=0:ts:13*t0; x=real(exp(j*(2*pi*f0*t-pi/2))); plot(t,x);