(New page: In the code used below the sampling frequency is too) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | In the code used below the sampling frequency is too | + | In the code used below the sampling frequency is too low. Hence the time interval between any two samples is very high. This results into skipping of certain values of the signal. |
+ | |||
+ | == code with bug == | ||
+ | |||
+ | <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> | ||
+ | |||
+ | [[Image:Signal_with_low_Fs.jpg _ECE301Fall2008mboutin]] | ||
+ | ---- | ||
+ | |||
+ | == code without bug == | ||
+ | |||
+ | just increase the sampling freq or in other words decrease the sampling time | ||
+ | <pre> | ||
+ | F0 =13; | ||
+ | |||
+ | T0 =1/F0; | ||
+ | |||
+ | Ts = 0.07/100; | ||
+ | |||
+ | t = 0:Ts:13*T0; | ||
+ | |||
+ | x = real(exp(j*(2*pi*F0*t-pi/2))); | ||
+ | |||
+ | plot(t,x) | ||
+ | </pre> | ||
+ | [[Image:Signal_with_high_fs.jpg _ECE301Fall2008mboutin]] |
Latest revision as of 20:59, 11 September 2008
In the code used below the sampling frequency is too low. Hence the time interval between any two samples is very high. This results into skipping of certain values of the signal.
code with bug
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)
File:Signal with low Fs.jpg ECE301Fall2008mboutin
code without bug
just increase the sampling freq or in other words decrease the sampling time
F0 =13; T0 =1/F0; Ts = 0.07/100; t = 0:Ts:13*T0; x = real(exp(j*(2*pi*F0*t-pi/2))); plot(t,x)