Professional Documents
Culture Documents
Fourier Series Example PDF
Fourier Series Example PDF
1 , 0 x 0.5
f ( x)
1 , 0.5 x 1
f(x)
1.0
x
0.5 1.0
-1.0
bn 21 / 2 f ( x) sin 2nxdx 21 / 2 (1) sin 2nxdx 20 (1) sin 2nxdx
1/ 2 0 1/ 2 2
1 (1) n
n
and thus the series representation reduces to
4
f ( x) n sin 2nx
n 1, 3, 5 ,...
The evaluation of this series can easily be done using MATLAB and a code is given
in the text box below. This code loops and evaluates the partial sums of the series
and plots them until an error criteria is satisfied. A couple of the plots are shown
below
Square Wave FS Partial Sum: n = 5 Error = 0.067914 Square Wave FS Partial Sum: n = 21 Error = 0.019523
1.5 1.5
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
-1.5 -1.5
0 0.5 1 1.5 0 0.5 1 1.5