Dec 26 2008

Fourier Series

Fourier Series

The Fourier Series is a representation of a periodic function using a series of sine and cosine terms.  In other words, the fourier series is a breakdown of the original function into its individiual frequency components.  In a physical sense, consider a ray of white light entering a prisim.  The white light is broken up into the different colours (frequencies) of light that make up the white light.  In this case, the white light would represent the original function, and the different colours would represent the fourier series of the white light. 

Consider the function f(x) that is periodic with a period of 2\pi, that is f(x) = f(x+2\pi).  The fourier series representation of the function is given by:

f(x) = \sum_{n=0}^{\infty}a_n\cos(nx) + \sum_{n=0}^{\infty}b_n\sin(nx)


Where an and bn are constants.  We must determine what these constants are in order to find the fourier series.  Before we do that, consider the following integrals:

\int_{-\pi}^{\pi} \sin(mx) dx &= 0


\int_{-\pi}^{\pi} \cos(mx) dx &= 0


\int_{-\pi}^{\pi} \cos(mx)\cos(nx) dx &=\pi\delta_{m,n}


\int_{-\pi}^{\pi} \sin(mx)\sin(nx) dx &=\pi\delta_{m,n}


\int_{-\pi}^{\pi} \sin(mx)\cos(nx) dx &=0


Where m and n are integers and m,n \ne 0 and \delta_{m,n} is the Kronecker delta function defined as:

\delta_{m,n}&=\begin{cases}  0 & \text{ if } m \ne n \\   1 & \text{ if } m = n \end{cases}


To determine the constants an and bn, take equation 1 and integrate both sides of the equation over the period.  The period is 2\pi so we will integrate from -\pi to \pi which gives us a domain of 2\pi.

\int_{-\pi}^{\pi} f(x)dx = \sum_{n=0}^{\infty} \int_{-\pi}^{\pi} a_n\cos(nx) dx+ \sum_{n=0}^{\infty} \int_{-\pi}^{\pi} b_n\sin(nx)dx


According to equations 2 and 3, the two summations of integrals on the right side of the equation is equal to 0 for all values of n, except n=0.  So equation 8 simplifies down to.

\int_{-\pi}^{\pi} f(x)dx &= \int_{-\pi}^{\pi}a_o\cos(0x)dx+\int_{-\pi}^{\pi}b_o\sin(0x)dx \\ &= \int_{-\pi}^{\pi}a_odx \\ &= 2\pi a_o \

\int_{-\pi}^{\pi} f(x) &=2\pi a_o


a_0 &= \frac{1}{2 \pi} \int_{-\pi}^{\pi} f(x) 


Note that b0 is not needed because the constant is always multiplied by sin(0) which is equal to 0.

Now take equation 1 and multiply both sides of the equation by cos(mx) and integrate over the period:

\int_{-\pi}^{\pi} f(x)\cos(mx)dx &= \sum_{n=0}^{\infty}\int_{-\pi}^{\pi}a_n\cos(mx)\cos(nx)dx+ \sum_{n=0}^{\infty}\int_{-\pi}^{\pi}a_n\cos(mx)\sin(nx)dx


From equation 6, the second integral sum on the right side of the equation is always equal to 0, and from equation 4, the first integral sum is equal to \pi when n=m and 0 when n \ne m.

Since the right side of the equation is non-zero only when n=m, we can simplify equation 11 and use equation 4 to get the following:

\int_{-\pi}^{\pi} f(x)\cos(nx)dx &=\int_{-\pi}^{\pi}a_n\cos(nx)\cos(nx)dx \\ &= a_n\pi \

This gives us the following expression for the an coefficients:

a_n &= \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)dx


To find the bn coefficients, we multiply equation 1 by \sin(mx) and integrate over the period.  Doing this and following the same reasoning as we did in determining the an coefficients, we get the following expression for the bn.

b_n &= \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)dx


Putting together equation 1, 10, 12 and 13, we can represent the function f(x) as a sum of sine and cosine terms which we call the Fourier Series:

f(x) &= \frac{a_0}{2} + \sum_{n=1}^{\infty}a_n\cos(nx) + \sum_{n=1}^{\infty}b_n\sin(nx)\\ a_0 &=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) dx\\ a_n &= \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)dx\\ b_n &= \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)dx

Note the slight change in the expression for a0, the factor of 1/2 was removed but a factor of 1/2 was added to the series expression.  In the above applet, the bar graph represents the amplitudes of the sine and cosine terms.  The red bars show the an coefficients and the green bars show the bn coefficients.

Leave a Reply

To prove that you're not a bot, enter this code
Anti-Spam Image