(New page: == Original Code == <pre> F0 =13; T0 =1/F0; Ts = 0.07; t = 0:Ts:13*T0; x = real(exp(j*(2*pi*F0*t-pi/2))); </pre> The problem with this code is that since its current frequency is 13 Hz...)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
== Original Code ==
 
== Original Code ==
  
Line 8: Line 7:
 
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)
 
</pre>
 
</pre>
  
Line 17: Line 17:
  
 
<pre>
 
<pre>
F0 =13;
+
F0=13;
T0 =1/F0;
+
T0=1/F0;
Ts = 0.07/10000;
+
Ts=0.07/10000;
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)
 
</pre>
 
</pre>

Latest revision as of 11:08, 12 September 2008

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

The problem with this code is that since its current frequency is 13 Hz, this causes a problem with the timestep of a Discrete Time signal which shows why there is a bug in this code. The timestep in this case makes the part of the signal that is plotted is considered to small to get a full sample.

In order to fix this code I have referenced Aishwar Sabesan to see values of a new timestep to use to save time (I could have figured it out on my own but I would rather have values in the ballpark before I began)

From his reference i decided to use a new timestep of Ts/10000. which turns out to be .07/10000 for my deltaT

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

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood