Fourier Series

What is a Fourier series?

A Fourier series expresses a periodic function as an infinite linear combination of sinusoidal functions, namely sines and cosines.
$$ f(x) = a_0 + \sum_{k=1}^{\infty} (a_k \cos k \cdot x + b_k \sin k \cdot x ) $$

The quantities a0, ak, and bk are called the Fourier coefficients.

These coefficients depend on the values of the function f(x) over any interval of length 2π.

What is it used for?

With an appropriate choice of coefficients, a Fourier series can represent a wide class of periodic and oscillatory functions.

It plays a central role in physics, signal processing, telecommunications, and electrical engineering.

Note. The Fourier series was introduced by Joseph Fourier in the early 19th century in his study of heat conduction. It remains a cornerstone of modern analysis, especially in the study of signals and physical phenomena such as vibrations of strings and elastic membranes.

Constructing a Fourier series

For simplicity, assume the coefficients a0, ak, and bk take the constant values

$$ a_0 = 0 \\ a_k = 1 \\ b_k = 1 $$

The simplest Fourier series, corresponding to k=1 and often called the fundamental term, is:

$$ f(x) = a_0 + (a_1 \cos x + b_1 \sin x ) $$ $$ f(x) = \cos x + \sin x $$

This function provides a very rough approximation of a square wave with period T=2π.

Fourier approximation of order 1

The Fourier series of order k=2 is:

$$ f(x) = (\cos x + \sin x ) + (\cos 2x + \sin 2x ) $$

The graph changes accordingly, reflecting the contribution of higher harmonics.

Fourier approximation of order 2

The Fourier series of order k=3 is:

$$ f(x) = (\cos x + \sin x ) + (\cos 2x + \sin 2x ) + (\cos 3x + \sin 3x ) $$

The approximation improves further, and the graph evolves toward the target waveform.

Fourier approximation of order 3

 

With suitable Fourier coefficients a0, ak, and bk, one can reconstruct the graph of a broad class of periodic functions.

In the next section, we explain how to compute the Fourier coefficients.

Note. A detailed step by step example is provided below.

Functions representable by a Fourier series

A periodic function f(x) with period 2π, defined on the real line, is representable by a Fourier series if there exist coefficients a0, ak, and bk, with k∈N, such that
$$ f(x) = a_0 + \sum_{k=1}^{\infty} (a_k \cos k \cdot x + b_k \sin k \cdot x ) $$

The coefficients depend on the behavior of f(x) over any interval of length 2π.

Computation of the Fourier coefficients

On the interval [-π,π], the coefficients are given by:

$$ a_0 = \frac{1}{2π} \int_{-π}^π f(x) \: dx $$ $$ a_k = \frac{1}{π} \int_{-π}^π f(x) \cos (k x) \: dx $$ $$ b_k = \frac{1}{π} \int_{-π}^π f(x) \sin (k x) \: dx $$

for k = 1, ..., n.

Note. The Fourier series converges to f(x) at every point where the function is continuous. At a discontinuity, it converges to the midpoint of the jump, that is, the average of the left and right limits.

A worked example

Consider the reconstruction of a pulse signal.

example of a periodic function

This is a periodic function of period 2π, defined on [-π,π] by:

$$ f(x) = \begin{cases} -1 \:\:\:if\:\: -π \le x<0 \\ \\ 1 \:\:\:if\:\: 0 \le x<π \end{cases} $$

First, compute a0:

$$ a_0 = \frac{1}{2π} \int_{-π}^π f(x) \: dx $$

Split the integral:

$$ a_0 = \frac{1}{2 \pi} \left[ \int_{- \pi}^0 f(x)\,dx + \int_0^{\pi} f(x)\,dx \right] $$

Substituting the values of f(x):

$$ a_0 = \frac{1}{2 \pi} \left[ \int_{- \pi}^0 (-1)\,dx + \int_0^{\pi} 1\,dx \right] $$

$$ a_0 = \frac{1}{2 \pi} \left[ - (0 - (-\pi)) + (\pi - 0) \right] $$

$$ a_0 = 0 $$

Next, compute ak:

$$ a_k = \frac{1}{π} \int_{-π}^π f(x) \cos (k x) \: dx $$

Split the integral:

$$ a_k = \frac{1}{π} [ \int_{-π}^0 f(x)\cos(kx)\,dx + \int_0^{\pi} f(x)\cos(kx)\,dx ] $$

Substitute f(x):

$$ a_k = \frac{1}{π} [ - \int_{-π}^0 \cos(kx)\,dx + \int_0^{\pi} \cos(kx)\,dx ] $$

Applying the fundamental theorem of calculus:

$$ a_k = \frac{1}{\pi} \left[ -\frac{\sin(kx)}{k}\Big|_{-\pi}^0 + \frac{\sin(kx)}{k}\Big|_0^{\pi} \right] $$

This simplifies to:

$$ a_k = 0 $$

Thus, ak = 0 for all k.

Finally, compute bk:

$$ b_k = \frac{1}{π} \int_{-π}^π f(x) \sin (k x) \: dx $$

Split the integral:

$$ b_k = \frac{1}{π} [ \int_{-π}^0 f(x)\sin(kx)\,dx + \int_0^{\pi} f(x)\sin(kx)\,dx ] $$

Substitute f(x):

$$ b_k = \frac{1}{π} [ - \int_{-π}^0 \sin(kx)\,dx + \int_0^{\pi} \sin(kx)\,dx ] $$

Using the antiderivative:

$$ \int \sin(kx)\,dx = -\frac{\cos(kx)}{k} $$

Applying the fundamental theorem:

$$ b_k = \frac{1}{k\pi} [ 2 - 2\cos(k\pi) ] $$

Therefore:

$$ b_k = \frac{2}{k\pi} \big(1 - \cos(k\pi)\big) $$

This depends on the parity of k:

  • If k is odd, then cos(kπ) = -1, hence $$ b_k = \frac{4}{k\pi} $$
  • If k is even, then cos(kπ) = 1, hence $$ b_k = 0 $$

Note. In summary:
$$ a_0 = 0 $$ $$ a_k = 0 $$ $$ b_k = \begin{cases} \frac{4}{kπ} \:\: if \:\: k \text{ odd} \\ 0 \:\:\: if k \text{ even} \end{cases} $$

The Fourier series is therefore:

$$ f(x) = \sum_{k=1}^{\infty} \frac{4}{k\pi} \sin(kx) $$

Only odd values of k contribute to the series.

For k=1:

$$ f(x) = \frac{4}{\pi} \sin x $$

This is the leading term of the series.

For k=3:

$$ f(x) = \frac{4}{\pi}\sin x + \frac{4}{3\pi}\sin(3x) $$

For k=5:

$$ f(x) = \frac{4}{\pi}\sin x + \frac{4}{3\pi}\sin(3x) + \frac{4}{5\pi}\sin(5x) $$

The approximation improves as higher harmonics are included.

Using larger odd values such as k=7, 9, 11, ... further refines the approximation.

This example illustrates, step by step, how a Fourier series is constructed.

And so on.

 

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Number Series

Exercises

Tools