Example 5.  Given the 12  equally spaced data points
[Graphics:Images/FourierSeriesMod_gr_242.gif][Graphics:Images/FourierSeriesMod_gr_243.gif][Graphics:Images/FourierSeriesMod_gr_244.gif][Graphics:Images/FourierSeriesMod_gr_245.gif]
which can be extended periodically over [Graphics:Images/FourierSeriesMod_gr_246.gif], if we define  [Graphics:Images/FourierSeriesMod_gr_247.gif].  
Find the Fourier polynomial of degree n = 5  for the 12  equally spaced points over interval  [Graphics:Images/FourierSeriesMod_gr_248.gif].  
Use Mathematica's built in Fourier subroutine to find the solution.

Solution 5.

Next, make a table of the function values at first twelve points in the partition of  [Graphics:../Images/FourierSeriesMod_gr_249.gif].  
Do not include the right endpoint !  
If you do by mistake it will create a mistake and you won't like those complex numbers showing up.  
So use the table iteration limit of  11  not  12.  A data set is being created using the counter k = 0,1,2,...,11.

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

Construct the data points to be used.

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


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

[Graphics:../Images/FourierSeriesMod_gr_253.gif]
[Graphics:../Images/FourierSeriesMod_gr_254.gif]
[Graphics:../Images/FourierSeriesMod_gr_255.gif]

Then use Mathematica's Fourier procedure, and multiply the result by [Graphics:../Images/FourierSeriesMod_gr_256.gif].  
Mathematica's Inverse Fourier procedure is also adjusted by a constant.  
Why does Mathematica do this ?  
Because the FFT is most often used for signal processing and it is not necessary to use the precise multiples that would be used for curve fitting.  
When signal processing is done, then everything works out o.k. when you transform and get the Fourier coefficients, and inverse transform from the Fourier coefficients back to the signal.

 

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

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

The real part of this list is the list for [Graphics:../Images/FourierSeriesMod_gr_259.gif] and the imaginary parts form the list for [Graphics:../Images/FourierSeriesMod_gr_260.gif].

Use the first m+1 terms in the list.

This example involves only the coefficients [Graphics:../Images/FourierSeriesMod_gr_261.gif]. Thus we see that

 

[Graphics:../Images/FourierSeriesMod_gr_262.gif]
[Graphics:../Images/FourierSeriesMod_gr_263.gif]

These are the same values that we obtained earlier using "numerical integration," and "least squares."

If you are curious about the FFT, then go the Help menu and lookup Fourier.  You will discover the following facts.

Fourier[list] finds the discrete Fourier transform of a list of complex numbers.

In Mathematica, the discrete Fourier transform  [Graphics:../Images/FourierSeriesMod_gr_264.gif]  of a list  [Graphics:../Images/FourierSeriesMod_gr_265.gif]  of length  [Graphics:../Images/FourierSeriesMod_gr_266.gif]  is by default defined to be  [Graphics:../Images/FourierSeriesMod_gr_267.gif] .
The computations involve complex numbers, and the derivation of this formula is covered in a complex analysis course.

Also, this is an introduction, so we have used an example that is easier to understand.  There are more details to be mastered !

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


[Graphics:../Images/FourierSeriesMod_gr_269.gif]
[Graphics:../Images/FourierSeriesMod_gr_270.gif]

Since lists are used instead of a mathematical formula, we will need to add one to the index of the coefficients when we form the sum.
Also, we will need to use the vector notation

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


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


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


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

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

[Graphics:../Images/FourierSeriesMod_gr_276.gif]
[Graphics:../Images/FourierSeriesMod_gr_277.gif]
[Graphics:../Images/FourierSeriesMod_gr_278.gif]
[Graphics:../Images/FourierSeriesMod_gr_279.gif]

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

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

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

[Graphics:../Images/FourierSeriesMod_gr_283.gif]
[Graphics:../Images/FourierSeriesMod_gr_284.gif]
[Graphics:../Images/FourierSeriesMod_gr_285.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004