Example 3. Given
the 12 equally spaced data points
![]()
![]()
![]()
![]()
which can be extended periodically over
,
if we define
.
Find the Fourier polynomial of degree n = 5 for the
12 equally spaced points over
interval
.
Use numerical sums to find the coefficients.
Solution 3.
Note. The data are
computed using the function
,
which is the function that was used in examples 1 and
2.
Construct the data points to be used.
![[Graphics:../Images/FourierSeriesMod_gr_154.gif]](../Images/FourierSeriesMod_gr_154.gif)
The ordinates
for
are used in computing the sums for constructing the coefficients
,
and the Fourier polynomial. It is convenient to store them in the
array Y. This can
be accomplished by using the Transpose
of the matrix of data points and selecting the second
row. Or Y can be
constructed directly with the Table
command.
We can adjust the subscript so that the math
for
are used in computing the sums for constructing the coefficients
,
.
Now construct the coefficients
,
.
Remark. Notice that
precisely 12 data points are used in computing the coefficients, and
a point corresponding to
is not used.
Construct the Fourier polynomial using the coefficients
and
.
![[Graphics:../Images/FourierSeriesMod_gr_182.gif]](../Images/FourierSeriesMod_gr_182.gif)
Caveat. Since the
data has period
,
if data points were used at both end of the interval
then the "numerical sums" would weight the endpoints twice, whereas
all other function values would have weight 1. If 13 data
points were used which included the right end point, then a wrong
answer will result, and spurious terms appear in the trigonometric
polynomial. Look at the wrong answer.
Wrong Answer.
Observe. The upper
limit of summation has been changed from
to the wrong value
.
![[Graphics:../Images/FourierSeriesMod_gr_194.gif]](../Images/FourierSeriesMod_gr_194.gif)
(c) John H. Mathews 2004