Example 5. 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 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
.
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
,
which is the function that was used in examples 1 -
3.
Construct the data points to be used.
![[Graphics:../Images/FourierSeriesMod_gr_252.gif]](../Images/FourierSeriesMod_gr_252.gif)
Then use Mathematica's Fourier procedure, and multiply the
result by
.
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.
The real part of this list is the list for
and the imaginary parts form the list for
.
Use the first m+1 terms in the
list.
This example involves only the coefficients
.
Thus we see that
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
of
a list
of
length
is
by default defined to be
.
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 !
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_274.gif]](../Images/FourierSeriesMod_gr_274.gif)
(c) John H. Mathews 2004