(New page: The error in the following 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)))...)
 
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
 
               plot(t,x)
 
               plot(t,x)
 
</pre>
 
</pre>
is the value for F0 is too small.
+
is the value for Ts is too large. The sampling frequency needs to much smaller to get a good result.
 +
 
 +
If we change the value to 1/2000 the code will work as expected.
 +
 
 +
<pre>
 +
        F0 =13;
 +
        T0 =1/F0;
 +
        Ts = 1/2000;
 +
        t  = 0:Ts:13*T0;
 +
        x = real(exp(j*(2*pi*F0*t-pi/2)));
 +
        plot(t,x)
 +
</pre>

Latest revision as of 09:38, 11 September 2008

The error in the following 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)

is the value for Ts is too large. The sampling frequency needs to much smaller to get a good result.

If we change the value to 1/2000 the code will work as expected.

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

Alumni Liaison

Recent Math PhD now doing a post-doctorate at UC Riverside.

Kuei-Nuan Lin