(New page: ==Finding the Bug== The code below is suppose to plot 13 cycles of a sinusoidal wave. However there is a problem with the code. The problem in the following code: <pre> F0 =13; T0 =1/F0; ...) |
(No difference)
|
Revision as of 18:21, 10 September 2008
Finding the Bug
The code below is suppose to plot 13 cycles of a sinusoidal wave. However there is a problem with the code. The problem 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 that the sample rate Ts is incorrect. Ts should be 0.01 instead. The current sampling rate causes matlab to take points the signal not equal in spacing therefore not producing the correct plot.