Revision as of 08:27, 11 September 2008 by Moellerb (Talk)

Fixing the Bug

The problem with the code provided was that the sampling rate was much too large for the function in question. With the sampling rate this low, it is impossible to get an accurate representation of what the function actually looks like. To fix this problem, just decrease the time between samples (Ts). As shown below, I chose a Ts value of 0.001. It provided a resolution fine enough to easily observe what the function is supposed to look like.

%Ben Moeller
%Fixing the bug

F0 =13;

T0 =1/F0

Ts = 0.001;

t  = 0:Ts:13*T0

x = real(exp(j*(2*pi*F0*t-pi/2)));

plot(t,x)

Alumni Liaison

Sees the importance of signal filtering in medical imaging

Dhruv Lamba, BSEE2010