Editor: This article is the second of a three-part series. Check out Part One here and Part Three here.
In the last article, we explored a visual representation of how a mathematical function can be deconstructed into its sum of sine and cosine waves.
Throughout the next two articles, we will explore the mathematics that underpins this elegant operation, which would be a perfect match for readers who would like to get a clearer understanding of the transformation.
As much of the content of this article will require an understanding of trigonometry, calculus and complex numbers, it would be advisable for you to familiarise yourself with these topics before continuing. Some excellent resources include 3Blue1Brown’s YouTube videos on trigonometry and complex numbers. For an overview of calculus, see Math24’s tutorials.
Let’s start by revisiting the periodic function and find a general description for its conversion into a series of waves.
Deriving the Fourier series
The Fourier series is the sum of sine and cosine waves needed to create a given periodic function. Each sine and cosine wave in the series will have a different amplitude, frequency and sometimes phase. A Fourier series can be represented using either trigonometric identities or in an exponential form - with real and imaginary components. Both are equivalent.
Therefore, this section of the article is aimed at students with a good understanding of calculus and who know how to work with complex numbers. Much of the workings will, nevertheless, be explained step-by-step.
To understand how a Fourier series can be derived from any periodic or even aperiodic function, it is important to briefly explain what even and odd functions are.
Even and odd functions
Even functions
Even functions are symmetrical about the y-axis (Figure 1, left). In other words, the function y = feven (x) can be re-written as:
Odd functions
In contrast to even functions, odd functions are antisymmetric about their y-axis (Figure 1, right) and so the function y = fodd (x) can be written as:
Take a look at Figure 1 to get a better idea of why:
Figure 1: Simple examples of even and odd functions.
Properties of even and odd functions
There are five important properties of even and odd functions that will enable us to find the Fourier series of any given periodic function, as well as the Fourier transform for any given aperiodic function:
1. The product (multiple) of two even functions (e.g. y = cos (x)) is an even function
2. The product of two odd functions (e.g. y = sin (x)) is an even function
3. The product of one even function and one odd function is an odd function
4. The integral of an odd function between and will be zero. i.e.:
5. Property 4 is generally not true for even functions but exceptions, such as y = cos (x), exist
Deriving the Fourier series for even functions
Even functions can be described fully using only a summation of cosine terms.
Before we launch into the formal derivation for this statement, our goal is to convert the time function y = feven (t) into:
This equation demonstrates how feven (t) is made up of an infinite series of cosine waves, where the function has period T and the coefficient ω0 is equal to 2π/T. This is important as we must scale our numeric time (t) variable from seconds into multiples of π. As a result, each integer n in the series corresponds to a cosine wave with a progressively higher frequency. Our goal now is to determine the amplitudes (an) for each value of n.
The first coefficient can be found easily because at n=0, a frequency of zero, cos(0)=1 and so feven (t) = ao.
Therefore, we can expand the equation to:
However, to find subsequent a_(n) coefficients, we will arbitrarily multiply both sides of the equation by cos(mwot), where m is any real number for now:
Next, we will integrate the equation over a single period (T). The exact interval for integration is not important, but either -T/2 ≤ t < T/2 or 0 ≤ t < T would be suitable here. The latter will be used here for simplicity.
Considering the trigonometric identity:
We can expand the equation into:
Or more conveniently:
Note: You might have noticed that the order of summation between n and m has been switched (i.e. u≡m and v≡n, rather than u≡n and v≡m). As we will see later on, this has no material effect on the end result. But for simplicity, we will stick with u≡m and v≡n for now. Remember, m is just an arbitrary real number.
Now, let’s assume that m≥0. This would mean the wave cos[(m+n)ω0t] makes m+n complete oscillations over its period, I. You should recall that even waves have the property whereby integrating over the period x=a to x=-a returns zero. Therefore, we can simplify this equation to:
This form of the equation has an interesting property that is vital for finding all of the a_(n) coefficients. When m≠n, we realise that the integral of cos[(m-n)ω0t] is still zero as we are still integrating an even function over one full period. On the other hand, when m=n, cos[(m-n)ω0t]=1 and the integral of our current solution becomes T. Try it for yourself if you are not convinced.
This gives us two solutions under the following conditions:
Therefore, the summation of integrals between n=0 and n=∞ is zero for all values of n, except n=m.
As a result, we will take the equation and substitute n=m to obtain:
which can be conveniently rearranged to:
Because the condition that got us this far was m=n, we can re-write the equation to find the value of the coefficient a_(n) for any n:
Before we move on and derive our proof for odd functions, there is a special case which we must address to complete our description of an even function in terms of its constituent cosine waves: what happens when n=0 (i.e. how do we find an)?
We cannot simply plug n=0 into our equation for an because it was derived under the condition that n=m.
Therefore, we must return to the equation and substitute m=0:
Now we have an equation for m=0, let’s substitute n=0 into the equation:
Finally, rearranging the equation gives us our definition for an:
Leaving us to complete our description of feven(t) as the Fourier series:
Deriving the Fourier coefficients of odd functions
Now, let’s move on to finding the Fourier coefficients of a general odd function, which is stated as a sum of sine waves:
An important point to note is that the Fourier series of an odd function has no Fourier coefficient at n=0. Simply from inspection of the equation, we can see that substitution of n=0 into sin(nω0t) would equal 0 and mean b0=0. Therefore, we start the series at n=1 for odd functions rather than n=0, as was the case for even functions.
The result of the derivation for odd functions yields:
Try deriving this for yourself by following the steps outlined for the derivation of the even function feven(t).
Arbitrary functions
In this next part of the derivation of the Fourier series, we consider periodic functions which are neither even nor odd. We will term them arbitrary here, although, they can be simplified as the addition of even and odd parts like so:
Since we have stated that any periodic function can be represented as the sum of even and odd wave components, we can use the Fourier series representations to describe f(t) in terms of a series of sine and cosine waves:
This is an enlightening finding, but our next goal is to represent f(t) in a more compact and manageable form, one that is crucial for later deriving the Fourier transform of any function, periodic or not.
The next section will discuss how we go from the previous equation to:
The exponential Fourier series
In order to find the eventual Fourier transform of any function, we must start by converting the previous equation from its trigonometric form into a complex, exponential one. This can be achieved using Euler’s formula:
If you are not familiar with complex numbers, it would be advisable to spend some time exploring the topic before continuing with this part of the derivation.
The purpose of using this notation is to simplify the conversion between the interconvertible synthesis and analysis forms of the Fourier series - i.e. creating a function from a sum of waves and finding the sum of waves that form a function, respectively.
Let’s start by rearranging Euler’s formula to get two definitions for the sine and cosine components of our f(t) function:
Substituting these into our equation for f(t) leads us through the following complete set of steps:
We will now factorise f(t) in order to bring out the exponential terms (recall i·i=-1):
We’re now at a stage where we can define our set of Fourier coefficients for f(t) in its complex exponential form. Let:
These new coefficients fully define the equation for all values of n between positive and negative infinity. We can write this as:
And there it is!
This equation is a way of representing the function f(t) as its sum of complex waves with coefficient c_(n). But we have not gone very far in explaining what c_(n) is other than the amplitude of the complex wave for a given value of n.
We may have defined c_(n) for n values between positive and negative infinity, but our next challenge is to define c_(n) for any value of n in terms of our independent variable t (time).
Coefficients of the exponential Fourier series
We now have a description of f(t) as the summation of a series of waves in their complex, exponential form. However, we have not yet discussed what the c_(n) coefficients are, other than in terms of an and bn from our trigonometric definition of f(t).
The goal now is to find a definition of c_(n) without having to rely on these two trigonometric terms. Let’s start by recalling the equations for our a_(n), b_(n) and c_(n) coefficients:
Because we have defined c_(n) in terms of a_(n) and b_(n), we can simply substitute a_(n) and b_(n) into c_(n):
Using Euler’s formula, we can simplify the equation into:
Interlude: Exponential coefficients in their complex form This section is aimed at readers who are interested in an alternative way of obtaining our equation for f(t) in terms of the exponential waveform.
It is based on the fact that our exponential waveform is a complex number, which can be split up into real and imaginary parts. If you are happy with the explanation from the previous section or aren’t comfortable working with complex numbers, skip this interlude and move on to the next article, where we will derive the Fourier transform of any function, periodic or not.
We will begin by quickly reiterating our conclusions about the description f(t) of as a summation of waves, exponential or trigonometric, before stating some of their shared properties. We will also assume that f(t) along with its an and bn coefficients are real:
Equating the exponential and trigonometric forms of f(t) gives us:
We know this is true as we previously noted c0=a0, which is essentially the average amplitude of our function f(t). Therefore, the remaining c_(n) and c-n values represent the only oscillating parts of our summation, leaving us to re-write the equation as:
for all non-zero values of n.
We can see from inspection that e^(ω0t) is the complex conjugate e^(-ω0t) and so cn must be the complex conjugate of cv(-n). Recall some of the rules for complex numbers:
Therefore, we can state:
As well as:
by employing Euler’s formula.
Now, by taking the left-hand-side of the equation and substituting our new definitions for c_(n) and c-n, we obtain:
You can expand the equation for yourself and you should end up with the same simplified equation.
Now let’s compare the right-hand-side of the simplified equation and the right-hand-side of the equation:
By inspecting the left-hand-side and right-hand-side of the equation, we can see that, by equivalence:
for the condition n≠0.
Having shown that cn=Re{cn} + i·Im{cn} and, c-n=Re{cn} - i·Im{cn} we can now write cn and c-n in terms of an and bn:
This is precisely what we have already shown in our description of f(t) as a sum of trigonometric waves and demonstrates complex functions can be split up into their real and imaginary parts as a Fourier series.
In the next article, we will finish off our derivation by applying what we have learned about the Fourier series to non-periodic (or aperiodic) functions, which we are far more likely to come across in experimental applications.
Author
Joseph I. J. Ellaway
BSc Biochemistry with a Year in Research
Imperial College London
Comments