Fourier Series

Interactive Lecture

Decomposing Periodic Signals into Sinusoidal Components

by Dr Arnaldo Delli Carri

Fourier Series

Fourier's theorem tells you something profound about periodic signals: any periodic function, however complex its shape, can be exactly represented as a sum of simple sinusoids. A square wave, a sawtooth, the pressure fluctuation in a turbine — all are, in principle, nothing but overlaid cosines and sines at harmonically related frequencies. Formalised by Joseph Fourier in 1822 while studying heat conduction, this idea now underpins signal processing, vibration analysis, power electronics, and acoustics.

Any periodic signal is a superposition of sinusoids at integer multiples of its fundamental frequency. Each sinusoid — called a harmonic — contributes its own amplitude and phase. The Fourier series gives you the exact recipe for decomposing or rebuilding the signal from those components.

The Fourier Series Formula

For a periodic function \(f(t)\) with period \(T\), the Fourier series is:

\[f(t) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\!\left[a_n\cos\!\left(\frac{2\pi n t}{T}\right) + b_n\sin\!\left(\frac{2\pi n t}{T}\right)\right]\]

Where the Fourier coefficients are:

\[a_0 = \frac{2}{T}\int_0^T f(t)\,dt \qquad \text{(DC component — twice the mean value)}\]

\[a_n = \frac{2}{T}\int_0^T f(t)\cos\!\left(\frac{2\pi n t}{T}\right)dt\]

\[b_n = \frac{2}{T}\int_0^T f(t)\sin\!\left(\frac{2\pi n t}{T}\right)dt\]

Notation:

Harmonic Amplitude and Phase

Each harmonic \(n\) contributes a sinusoid at frequency \(n f_0\). You can combine the cosine and sine terms into a single amplitude–phase form:

\[C_n = \sqrt{a_n^2 + b_n^2}, \qquad \phi_n = \arctan\!\left(-\frac{b_n}{a_n}\right)\]

so that \(a_n\cos(n\omega_0 t) + b_n\sin(n\omega_0 t) = C_n\cos(n\omega_0 t + \phi_n)\).

Where:

Even and Odd Functions

The symmetry of \(f(t)\) determines which coefficients survive:

Coefficients of Common Waveforms

Three waveforms appear throughout engineering. Their Fourier coefficients (all with zero mean, so \(a_0 = 0\)) are:

Square wave \([\,f(t) = \operatorname{sgn}(\sin t)\,]\) — odd harmonics only:

\[b_n = \frac{4}{n\pi},\quad n = 1, 3, 5, \ldots \qquad b_n = 0,\quad n = 2, 4, 6, \ldots\]

\[f(t) = \frac{4}{\pi}\!\left(\sin t + \frac{\sin 3t}{3} + \frac{\sin 5t}{5} + \cdots\right)\]

Sawtooth wave \([\,f(t) = 1 - t/\pi\text{ on }(0,2\pi)\,]\) — all harmonics:

\[b_n = \frac{2}{n\pi}, \quad n = 1, 2, 3, \ldots\]

\[f(t) = \frac{2}{\pi}\!\left(\sin t + \frac{\sin 2t}{2} + \frac{\sin 3t}{3} + \cdots\right)\]

Triangle wave — odd harmonics only, amplitudes fall as \(1/n^2\):

\[b_n = \frac{8\,(-1)^{(n-1)/2}}{n^2\pi^2},\quad n = 1, 3, 5, \ldots \qquad b_n = 0,\quad n = 2, 4, 6, \ldots\]

\[f(t) = \frac{8}{\pi^2}\!\left(\sin t - \frac{\sin 3t}{9} + \frac{\sin 5t}{25} - \cdots\right)\]

Convergence and the Gibbs Phenomenon

For smooth periodic functions the Fourier series converges uniformly — adding more harmonics makes the partial sum uniformly closer to \(f(t)\). At jump discontinuities the situation is different: the partial sum overshoots the true value by approximately 9% of the jump height, and this overshoot does not decrease as \(N \to \infty\). It narrows, but never disappears. This is the Gibbs phenomenon. The simulation below makes it visible in the square and sawtooth waves — watch the spikes at the edges as you increase \(N\).

Parseval's Theorem

The mean square value of a signal equals the sum of the mean square contributions of each harmonic. This is Parseval's theorem:

\[\frac{1}{T}\int_0^T \!\left[f(t)\right]^2 dt \;=\; \frac{a_0^2}{4} + \frac{1}{2}\sum_{n=1}^{\infty}\!\left(a_n^2 + b_n^2\right)\]

It lets you compute RMS values and signal power directly from the spectrum, without integrating the time-domain waveform.

Interactive Simulation: Waveform Synthesis

Select a waveform, then drag the harmonics slider to add or remove sinusoidal components. The upper panel shows the target waveform (grey dashed) and the Fourier partial sum (gold). The lower panel shows the amplitude spectrum — each bar is one harmonic. Tick Show components to draw the individual sinusoids.

5

Engineering Applications

Summary of Key Equations

Concept Equation Notes
Fourier series \(\displaystyle f(t) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\!\bigl[a_n\cos(n\omega_0 t) + b_n\sin(n\omega_0 t)\bigr]\) \(\omega_0 = 2\pi/T\)
DC coefficient \(\displaystyle a_0 = \frac{2}{T}\int_0^T f(t)\,dt\) Twice the mean value
Cosine coefficients \(\displaystyle a_n = \frac{2}{T}\int_0^T f(t)\cos(n\omega_0 t)\,dt\) \(n = 1,2,3,\ldots\)
Sine coefficients \(\displaystyle b_n = \frac{2}{T}\int_0^T f(t)\sin(n\omega_0 t)\,dt\) \(n = 1,2,3,\ldots\)
Harmonic amplitude \(C_n = \sqrt{a_n^2 + b_n^2}\) Magnitude of \(n\)th harmonic
Parseval's theorem \(\displaystyle \frac{1}{T}\!\int_0^T\!\!f^2\,dt = \frac{a_0^2}{4} + \frac{1}{2}\sum_{n=1}^{\infty}(a_n^2+b_n^2)\) Mean square from spectrum
Square wave (odd \(n\)) \(b_n = 4/(n\pi)\) \(b_n = 0\) for even \(n\)
Sawtooth wave \(b_n = 2/(n\pi)\) All harmonics present
Triangle wave (odd \(n\)) \(b_n = 8(-1)^{(n-1)/2}/(n^2\pi^2)\) Amplitudes fall as \(1/n^2\)

Practice Problems

Problem 1: Square Wave Coefficients

A square wave \(f(t)\) has period \(T = 2\pi\) and amplitude \(\pm 1\). Write down the first three non-zero Fourier coefficients \(b_n\) and hence state the partial Fourier sum \(f_5(t)\) that includes all non-zero harmonics up to and including \(n = 5\).

Show Solution

Problem 2: RMS Value from Parseval's Theorem

A periodic voltage signal is described by: \[v(t) = 2\sin(\omega_0 t) + \sin(2\omega_0 t) \quad\text{(V)}\] Find the RMS value of \(v(t)\).

Show Solution

Problem 3: Sawtooth Harmonic Amplitude

A periodic sawtooth wave has amplitude \(A = 10\;\text{V}\) and period \(T = 0.02\;\text{s}\). Its Fourier coefficients are \(b_n = 2A/(n\pi)\). Find the amplitude of the 3rd harmonic and its frequency.

Show Solution

Problem 4: Harmonic Excitation in a Vibrating Structure

A machine applies a periodic square-wave force to a structure. The force has amplitude \(F = 100\;\text{N}\) and fundamental frequency \(f_0 = 10\;\text{Hz}\). The structure has a natural frequency of 110 Hz. Determine the amplitude and frequency of the harmonic component that could excite this resonance.

Show Solution

Knowledge Check Quiz

Question 1: Which harmonics appear in the Fourier series of a square wave?

Question 2: What is the Gibbs phenomenon?

Question 3: A square wave with amplitude \(\pm 1\) has Fourier coefficients \(b_n = 4/(n\pi)\) for odd \(n\). What is the amplitude of the 5th harmonic?

Question 4: Parseval's theorem states that:

Question 5: A periodic signal has fundamental frequency \(f_0 = 50\;\text{Hz}\). What is the frequency of the 7th harmonic?