Skip to content
Math Analysis 2

Fourier series: coefficients, convergence and signal spectra

Orthogonality and the coefficient formulas, the square wave and its harmonics, Dirichlet's theorem, the Gibbs phenomenon, Parseval's identity and the complex form.

The Taylor series approximates a function with powers, and it is excellent near a point. For periodic functions, such as the signals of a circuit in AC steady state, sines and cosines are far more natural. Fourier proposed this in 1807 to solve the heat equation; today it is the foundation of signal analysis, filters, audio compression and communications.

Trigonometric polynomials and Fourier series

We want to write a function f of period 2\pi as

    \[ f(x) \sim \frac{a_0}{2} + \sum_{k=1}^{\infty}\big(a_k\cos kx + b_k\sin kx\big) \]

The term a_0/2 is the mean value, the k = 1 terms are the fundamental, those with k \ge 2 the harmonics. For any period T, replace kx with k\omega t, where \omega = 2\pi/T.

Proof: the coefficient formulas

The key is the orthogonality relations: for integers k, m \ge 1

    \[ \int_{-\pi}^{\pi}\cos kx\cos mx\,dx = \int_{-\pi}^{\pi}\sin kx\sin mx\,dx = \begin{cases}\pi & k = m\\ 0 & k \ne m\end{cases},\qquad \int_{-\pi}^{\pi}\sin kx\cos mx\,dx = 0 \]

They are proved with product-to-sum formulas: for example \cos kx\cos mx = \tfrac12[\cos(k - m)x + \cos(k + m)x], and the integral over a period of \cos nx is zero for every n \ne 0.

Multiply the series by \cos mx and integrate over [-\pi, \pi], assuming we may integrate term by term. Every term vanishes except the one with \cos mx, which gives a_m\pi. Hence

    \[ a_k = \frac1\pi\int_{-\pi}^{\pi}f(x)\cos kx\,dx,\qquad b_k = \frac1\pi\int_{-\pi}^{\pi}f(x)\sin kx\,dx \]

It is exactly the computation of coordinates in an orthogonal basis from the Geometry and Algebra lesson: the functions \cos kx and \sin kx are an orthogonal basis for the inner product \langle f, g\rangle = \int_{-\pi}^{\pi} f g, and the Fourier coefficients are the projections of f onto it.

Useful symmetries. If f is even, all b_k are zero (a cosine series); if it is odd, all a_k are zero (a sine series).

Example: the square wave

Let f(x) = 1 for 0 \lt x \lt \pi and f(x) = -1 for -\pi \lt x \lt 0, extended periodically. It is odd, so a_k = 0, and

    \[ b_k = \frac2\pi\int_0^\pi\sin kx\,dx = \frac{2}{k\pi}(1 - \cos k\pi) = \begin{cases}\dfrac{4}{k\pi} & k \text{ odd}\\ 0 & k \text{ even}\end{cases} \]

    \[ f(x) = \frac4\pi\left(\sin x + \frac{\sin 3x}{3} + \frac{\sin 5x}{5} + \dots\right) \]

Partial sums of the Fourier series of a square wave with 1, 3 and 19 terms
Partial sums of the square wave series (grey) with harmonics up to N = 1, 3 and 19. With more terms the approximation improves everywhere except near the jumps, where an overshoot of about 9% of the jump remains: the Gibbs phenomenon.

A square wave contains only odd harmonics, with amplitude falling as 1/k. That is why a 100 MHz digital clock produces interference at 300, 500, 700 MHz, and why the edges of fast signals are sometimes deliberately slowed down.

Convergence

Theorem (Dirichlet). If f is periodic and piecewise smooth (with finitely many jumps and corners in a period), the Fourier series converges at every point:

  • to f(x) where f is continuous;
  • to the average \tfrac12[f(x^+) + f(x^-)] at jumps.

For the square wave, at x = 0 the series gives 0, the average of -1 and 1.

Near the jumps the convergence is not uniform: the partial sums overshoot the function by about 9% of the size of the jump, and this peak moves towards the jump but does not shrink as terms are added. This is the Gibbs phenomenon, visible in the figure. If instead f is continuous and piecewise smooth, the convergence is uniform.

Parseval’s identity and energy

    \[ \frac1\pi\int_{-\pi}^{\pi}f(x)^2\,dx = \frac{a_0^2}{2} + \sum_{k=1}^{\infty}\big(a_k^2 + b_k^2\big) \]

It is Pythagoras’ theorem in infinite dimensions: the squared norm is the sum of the squares of the coordinates. Physically, the power of a periodic signal is the sum of the powers of its harmonics. For the square wave the left side is 2, and a surprising result follows: \sum_{k \text{ odd}}\frac{16}{\pi^2k^2} = 2, that is 1 + \frac19 + \frac1{25} + \dots = \frac{\pi^2}{8}.

It also follows that the fundamental alone carries 8/\pi^2 \approx 81\% of the square wave’s power: this is the starting point for computing a signal’s total harmonic distortion (THD).

Complex form

With Euler’s formula the series becomes more compact:

    \[ f(x) = \sum_{k=-\infty}^{\infty}c_k\,e^{ikx},\qquad c_k = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\,e^{-ikx}\,dx \]

This is the form used in electronics and telecommunications. Letting the period tend to infinity, the sum over discrete frequencies k becomes an integral over all frequencies: the Fourier transform, which describes the spectrum of non-periodic signals. The version for sampled signals, computed with the FFT algorithm, is inside every digital oscilloscope, modem and audio codec. The Z transform, linked to this subject, generalises it to discrete-time systems.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x