Example 3.  Given the 12  equally spaced data points
[Graphics:Images/FourierSeriesMod_gr_145.gif][Graphics:Images/FourierSeriesMod_gr_146.gif][Graphics:Images/FourierSeriesMod_gr_147.gif][Graphics:Images/FourierSeriesMod_gr_148.gif]
which can be extended periodically over [Graphics:Images/FourierSeriesMod_gr_149.gif], if we define[Graphics:Images/FourierSeriesMod_gr_150.gif].  
Find the Fourier polynomial of degree n = 5  for the 12  equally spaced points over interval  [Graphics:Images/FourierSeriesMod_gr_151.gif].  
Use numerical sums to find the coefficients.

Solution 3.

Note.  The data are computed using the function  [Graphics:../Images/FourierSeriesMod_gr_152.gif], which is the function that was used in examples 1 and 2.  

Construct the data points to be used.

[Graphics:../Images/FourierSeriesMod_gr_153.gif]


[Graphics:../Images/FourierSeriesMod_gr_154.gif]

[Graphics:../Images/FourierSeriesMod_gr_155.gif]
[Graphics:../Images/FourierSeriesMod_gr_156.gif]


The ordinates  [Graphics:../Images/FourierSeriesMod_gr_157.gif] for  [Graphics:../Images/FourierSeriesMod_gr_158.gif] are used in computing the sums for constructing the coefficients [Graphics:../Images/FourierSeriesMod_gr_159.gif], [Graphics:../Images/FourierSeriesMod_gr_160.gif] 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.

[Graphics:../Images/FourierSeriesMod_gr_161.gif]

[Graphics:../Images/FourierSeriesMod_gr_162.gif]

[Graphics:../Images/FourierSeriesMod_gr_163.gif]

[Graphics:../Images/FourierSeriesMod_gr_164.gif]

We can adjust the subscript so that the math  [Graphics:../Images/FourierSeriesMod_gr_165.gif] for  [Graphics:../Images/FourierSeriesMod_gr_166.gif] are used in computing the sums for constructing the coefficients [Graphics:../Images/FourierSeriesMod_gr_167.gif], [Graphics:../Images/FourierSeriesMod_gr_168.gif].

 

[Graphics:../Images/FourierSeriesMod_gr_169.gif]

Now construct the coefficients [Graphics:../Images/FourierSeriesMod_gr_170.gif], [Graphics:../Images/FourierSeriesMod_gr_171.gif].

[Graphics:../Images/FourierSeriesMod_gr_172.gif]


[Graphics:../Images/FourierSeriesMod_gr_173.gif]
[Graphics:../Images/FourierSeriesMod_gr_174.gif]
[Graphics:../Images/FourierSeriesMod_gr_175.gif]

Remark.  Notice that precisely 12 data points are used in computing the coefficients, and a point corresponding to [Graphics:../Images/FourierSeriesMod_gr_176.gif] is not used.   

Construct the Fourier polynomial using the coefficients [Graphics:../Images/FourierSeriesMod_gr_177.gif]and [Graphics:../Images/FourierSeriesMod_gr_178.gif].

[Graphics:../Images/FourierSeriesMod_gr_179.gif]


[Graphics:../Images/FourierSeriesMod_gr_180.gif]


[Graphics:../Images/FourierSeriesMod_gr_181.gif]


[Graphics:../Images/FourierSeriesMod_gr_182.gif]

[Graphics:../Images/FourierSeriesMod_gr_183.gif]

[Graphics:../Images/FourierSeriesMod_gr_184.gif]

Caveat.  Since the data has period [Graphics:../Images/FourierSeriesMod_gr_185.gif], if data points were used at both end of the interval [Graphics:../Images/FourierSeriesMod_gr_186.gif] 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 [Graphics:../Images/FourierSeriesMod_gr_187.gif] to the wrong value  [Graphics:../Images/FourierSeriesMod_gr_188.gif] .

[Graphics:../Images/FourierSeriesMod_gr_189.gif]


[Graphics:../Images/FourierSeriesMod_gr_190.gif]
[Graphics:../Images/FourierSeriesMod_gr_191.gif]
[Graphics:../Images/FourierSeriesMod_gr_192.gif]


[Graphics:../Images/FourierSeriesMod_gr_193.gif]


[Graphics:../Images/FourierSeriesMod_gr_194.gif]

[Graphics:../Images/FourierSeriesMod_gr_195.gif]

[Graphics:../Images/FourierSeriesMod_gr_196.gif]
[Graphics:../Images/FourierSeriesMod_gr_197.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004