Section 4.2 The trigonometric series
Subsection 4.2.1 Periodic functions and motivation
As motivation for studying Fourier series, suppose we have the problem
for some periodic function We already solved
Before we proceed, let us talk a little bit more in detail about periodic functions. A function is said to be periodic with period if for all For brevity we say is -periodic. Note that a -periodic function is also -periodic, -periodic and so on. For example, and are -periodic. So are and for all integers The constant functions are an extreme example. They are periodic for any period (exercise).
Normally we start with a function defined on some interval and we want to extend periodically to make it a -periodic function. We do this extension by defining a new function such that for in For in we define for in and so on. To make that work we needed We could have also started with defined only on the half-open interval and then define
You should be careful to distinguish between and its extension. A common mistake is to assume that a formula for holds for its extension. It can be confusing when the formula for is periodic, but with perhaps a different period.
Exercise 4.2.1.
Subsection 4.2.2 Inner product and eigenvector decomposition
Suppose we have a symmetric matrix, that is As we remarked before, eigenvectors of are then orthogonal. Here the word orthogonal means that if and are two eigenvectors of for distinct eigenvalues, then In this case the inner product is the dot product, which can be computed as
Therefore,
Similarly
You probably remember this formula from vector calculus.
Example 4.2.2.
Subsection 4.2.3 The trigonometric series
Instead of decomposing a vector in terms of eigenvectors of a matrix, we decompose a function in terms of eigenfunctions of a certain eigenvalue problem. The eigenvalue problem we use for the Fourier series is
We computed that eigenfunctions are 1, That is, we want to find a representation of a -periodic function as
This series is called the Fourier series or the trigonometric series for We write the coefficient of the eigenfunction 1 as for convenience. We could also think of so that we only need to look at and
1
Named after the French mathematician Jean Baptiste Joseph Fourier (1768–1830).
As for matrices we want to find a projection of onto the subspaces given by the eigenfunctions. So we want to define an inner product of functions. For example, to find we want to compute We define the inner product as
With this definition of the inner product, we saw in the previous section that the eigenfunctions (including the constant eigenfunction), and are orthogonal in the sense that
For we have
by elementary calculus. For the constant we get
The coefficients are given by
Compare these expressions with the finite-dimensional example. For we get a similar formula
Let us check the formulas using the orthogonality properties. Suppose for a moment that
Then for we have
And hence
Exercise 4.2.2.
Example 4.2.3.
Take the function
The plot of the extended periodic function is given in Figure 4.4. Let us compute the coefficients. We start with
We will often use the result from calculus that says that the integral of an odd function over a symmetric interval is zero. Recall that an odd function is a function such that For example the functions or (importantly for us) are all odd functions. Thus
Let us move to Another useful fact from calculus is that the integral of an even function over a symmetric interval is twice the integral of the same function over half the interval. Recall an even function is a function such that For example is even.
We have used the fact that
The series, therefore, is
Let us write out the first 3 harmonics of the series for
The plot of these first three terms of the series, along with a plot of the first 20 terms is given in Figure 4.5.
Example 4.2.4.
Take the function
Extend periodically and write it as a Fourier series. This function or its variants appear often in applications and the function is called the square wave.
The plot of the extended periodic function is given in Figure 4.6. Now we compute the coefficients. We start with
Next,
And finally,
The Fourier series is
Let us write out the first 3 harmonics of the series for
The plot of these first three and also of the first 20 terms of the series is given in Figure 4.7.
We have so far skirted the issue of convergence. For example, if is the square wave function, the equation
is only an equality for such where is continuous. We do not get an equality for and all the other discontinuities of It is not hard to see that when is an integer multiple of (which gives all the discontinuities), then
and extend periodically. The series equals this new extended everywhere, including the discontinuities. We will generally not worry about changing the function values at several (finitely many) points.
We will say more about convergence in the next section. Let us, however, briefly mention an effect of the discontinuity. Zoom in near the discontinuity in the square wave. Further, plot the first 100 harmonics, see Figure 4.8. While the series is a very good approximation away from the discontinuities, the error (the overshoot) near the discontinuity at does not seem to be getting any smaller as we take more and more harmonics. This behavior is known as the Gibbs phenomenon. The region where the error is large does get smaller, however, the more terms in the series we take.
We can think of a periodic function as a “signal” being a superposition of many signals of pure frequency. For example, we could think of the square wave as a tone of certain base frequency. This base frequency is called the fundamental frequency. The square wave will be a superposition of many different pure tones of frequencies that are multiples of the fundamental frequency. In music, the higher frequencies are called the overtones. All the frequencies that appear are called the spectrum of the signal. On the other hand a simple sine wave is only the pure tone (no overtones). The simplest way to make sound using a computer is the square wave, and the sound is very different from a pure tone. If you ever played video games from the 1980s or so, then you heard what square waves sound like.
Exercises 4.2.4 Exercises
4.2.3.
4.2.4.
4.2.5.
4.2.6.
4.2.7.
4.2.8.
There is another form of the Fourier series using complex exponentials for instead of and for positive This form may be easier to work with sometimes. It is certainly more compact to write, and there is only one formula for the coefficients. On the downside, the coefficients are complex numbers.