Biomedical Engineering Reference
In-Depth Information
ð
T
x
ð
t
Þ
e
jm
o
o
t
dt
¼
ð
1=2
1
=
2
2
e
jm
p
t
1
T
1
2
5
e
jm
p
t
dt
¼
c
m
¼
5
jm
p
1
=
2
1
=
2
2
e
þ
jm
p=2
e
jm
p=2
jm
p
5
5
2
sin
ð
m
p=
2
Þ
¼
¼
:
m
p=
2
Therefore,
þ1
1
5
2
sin
ð
p
=
2
Þ
m
c
m
e
jk
o
o
t
¼
e
jm
p
t
x
ð
t
Þ¼
m
p=
2
m
¼1
m
¼1
MATLAB implementation:
%Plotting Fourier Series Approximation
subplot(211)
time
¼
-2:0.01:2; %Time Axis
¼
x
0; %Initialize Signal
for m
¼
-10:10
if m
¼¼
0
¼
þ
¼
x
x
5/2; %Term for m
0
else
x
¼
þ
x
5/2*sin(m*pi/2)/m/pi*2*exp(j*m*pi*time);
end
end
plot(time,x,'k') %Plotting and Labels
xlabel('Time (sec)')
ylabel('Amplitude')
set(gca,'Xtick',[-2:2])
set(gca,'Ytick',[0 5])
set(gca,'Box','off')
%Plotting Fourier Magnitudes
subplot(212)
m
¼
þ
(-10:10)
1E-10;
¼
A
[5/2*sin(m*pi/2)./m/pi*2]; %Fourier Magnitudes
Faxis
¼
(-10:10)*.5; %Frequency Axis
plot(Faxis,A,'k.') %Plotting
axis([-5 5 -2 4])
set(gca,'Box','off')
xlabel('Frequency (Hz)')
ylabel('Fourier Amplitudes')
Note that we now require positive and negative frequencies in the approximation. Results
showing the MATLAB output are shown in Figure 11.9.
Continued