(New page: The code given by the assignment was to plot 13 cycles of a 13Hz sinusoid. <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) </pre> The resu...)
 
Line 10: Line 10:
  
 
The resulting graph:
 
The resulting graph:
 +
 
[[Image:HW2PartBPic1_ECE301Fall2008mboutin.jpg]]
 
[[Image:HW2PartBPic1_ECE301Fall2008mboutin.jpg]]
  
Line 25: Line 26:
  
 
The resulting graph actually has 13 cycles over one second of time:
 
The resulting graph actually has 13 cycles over one second of time:
 +
 
[[Image:HW2PartBPic2_ECE301Fall2008mboutin.jpg]]
 
[[Image:HW2PartBPic2_ECE301Fall2008mboutin.jpg]]

Revision as of 08:34, 12 September 2008

The code given by the assignment was to plot 13 cycles of a 13Hz sinusoid.

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 resulting graph:

HW2PartBPic1 ECE301Fall2008mboutin.jpg

As you can see, over a period of time, the graph completes only a little bit more than one cycle. It should have thirteen cycles instead. The reason would be that the time step, Ts, was set too high and therefore was not allowing for enough values to be calculated. The remedy would be to decrease the time step by many magnitudes. Due to the fact that there needs to be 1/13 second for a second to complete, I decided that there should be least 1000 time steps per cycle, which gives us 13000 samples per second.

Ts was changed to 1/13000 instead of 0.07:

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

The resulting graph actually has 13 cycles over one second of time:

HW2PartBPic2 ECE301Fall2008mboutin.jpg

Alumni Liaison

Prof. Math. Ohio State and Associate Dean
Outstanding Alumnus Purdue Math 2008

Jeff McNeal