(New page: The bug is the fact that it isn't sampling enough times to plot a decent graph. Therefore change the code such that...)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The bug is the fact that it isn't sampling enough times to plot a decent graph.  Therefore change the code such that...
+
The bug is the fact that it isn't sampling enough times to plot a decent graph.  The period is is 0.7 and so is the Ts value.  So therefore decrease the Ts value such that the function is sampled more times.  It is possible to do this by dividing Ts by 100.
 +
 
 +
== The New Code ==
 +
 
 +
F0 =13;
 +
 
 +
T0 =1/F0;
 +
 
 +
Ts = 0.07/100; % or equivalently Ts = 0.0007;
 +
 
 +
t  = 0:Ts:13*T0;
 +
 
 +
x = real(exp(j*(2*pi*F0*t-pi/2)));
 +
 
 +
plot(t,x)
 +
 
 +
 
 +
Go back to : [[Homework 2_ECE301Fall2008mboutin]]

Latest revision as of 08:55, 11 September 2008

The bug is the fact that it isn't sampling enough times to plot a decent graph. The period is is 0.7 and so is the Ts value. So therefore decrease the Ts value such that the function is sampled more times. It is possible to do this by dividing Ts by 100.

The New Code

F0 =13;

T0 =1/F0;

Ts = 0.07/100; % or equivalently Ts = 0.0007;

t = 0:Ts:13*T0;

x = real(exp(j*(2*pi*F0*t-pi/2)));

plot(t,x)


Go back to : Homework 2_ECE301Fall2008mboutin

Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett