Biomedical Engineering Reference
In-Depth Information
Combining results
1
5
2 þ
10
m p cos
x ð t Þ¼
ð
m o o t þ f m
Þ
m ¼
1
where f m is as just defined. An interesting point regards the similarity of standard and compact
versions of the Fourier series for this square wave example. In the standard form, the coefficient
a m alternates between positive and negative values, while for the compact form the Fourier coef-
ficient,
or -) of
the standard Fourier coefficient is now consumed in the phase term, which alternates between
0 and p . This forces the cosine to alternate in its external sign because
A m , is identical in magnitude to
a m , but it is always a positive quantity. The sign (
þ
.
The two equations are therefore mathematically identical, differing only in the way that the trigo-
nometric functions are written out.
cos
ð x Þ¼
cos
ð x þ pÞ
MATLAB implementation:
%Plotting Fourier Series Approximation
time
¼
-2:0.01:2; %Time Axis
¼
x
5/2; %Initializing Signal
¼
m
1:10;
¼
A
(10*sin(m*pi/2)./m/pi); %Fourier Coefficients
¼
P
angle(A); %Phase Angle
¼
A
abs(A); %Fourier Magnitude
for m
¼
1:10
¼
þ
þ
x
x
A(m)*cos(m*pi*time
P(m));
end
subplot(211)
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
¼
1:10;
¼
A
[5/2 A]; %Fourier Magnitudes
Faxis
¼
(0:10)*.5; %Frequency Axis
plot(Faxis,A,'k.') %Plotting
axis([0 5 -2 4])
set(gca,'Box','off')
xlabel('Frequency (Hz)')
ylabe l ('Fourier Amplitudes')
The results are identical to those shown in Figures 11.8a and b.
Search WWH ::




Custom Search