(New page: == MATLAB code == This is the faulty MATLAB code that was given to us to correct: <pre> 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) </pr...)
 
(MATLAB code)
 
Line 17: Line 17:
 
F0 =13;  
 
F0 =13;  
 
T0 =1/F0;  
 
T0 =1/F0;  
Ts = 0.00007;
+
Ts = 0.0007;
 
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 17:33, 10 September 2008

MATLAB code

This is the faulty MATLAB code that was given to us to correct:

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 the above code is that the Ts value is too large. Thus, we can easily solve this problem by decreasing the Ts value significantly. We then are left with the following, corrected MATLAB code:

F0 =13; 
T0 =1/F0; 
Ts = 0.0007;
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