MATH-101 · Lesson 10 of 12 · 30 min
Fourier series
Taylor series build a function from powers of \(x\), matching its behavior near a single point. Many signals in engineering are better described in a different way: as a sum of sines and cosines of different frequencies. The vibration of a machine, the current drawn by a rectifier, the sound of a musical instrument, the temperature cycle of a day and a year, and the voltage at the output of an inverter are all periodic, repeating after a fixed time, and each can be decomposed into a fundamental frequency and its harmonics. Joseph Fourier introduced this idea in 1807 to solve problems of heat conduction, and it has become one of the most widely used tools in science and engineering. This lesson shows how to compute the Fourier series of a periodic function, how such series converge, how symmetry simplifies them, and how they are used to analyze power quality, vibrations and filters.
Periodic functions and harmonics
A function is periodic with period \(T\) if \(f(t + T) = f(t)\) for all \(t\). The fundamental angular frequency is \(\omega_0 = 2\pi/T\), and the sinusoids \(\cos n\omega_0 t\) and \(\sin n\omega_0 t\) for \(n = 1, 2, 3, \ldots\) all repeat with period \(T\). The \(n\)-th harmonic has frequency \(n\) times the fundamental: on a 60 Hz power system, the third harmonic is 180 Hz and the fifth is 300 Hz. Fourier's claim, made precise later, is that a periodic function with reasonable behavior can be written as:
where \(a_0\) is the average value (the DC component) and \(a_n\), \(b_n\) give the amount of each harmonic.
Finding the coefficients
The coefficients can be found because sines and cosines of different harmonics are orthogonal over a period: the integral of the product of any two different ones over a full period is zero. For integers \(m \ne n\):
while \(\int_0^T \cos^2 n\omega_0 t\,dt = \int_0^T \sin^2 n\omega_0 t\,dt = T/2\). These follow from the product-to-sum identities of Lesson 1. Multiplying the series by \(\cos n\omega_0 t\) and integrating over a period therefore kills every term except one, and similarly for \(\sin n\omega_0 t\). The result is the Euler-Fourier formulas:
The integrals can be taken over any interval of length \(T\), for example \(-T/2\) to \(T/2\), whichever is more convenient. Each coefficient measures how strongly the function correlates with one harmonic: the same idea, comparing a signal with a reference sinusoid and averaging, is how lock-in amplifiers and spectrum analyzers work.
The square wave
Worked problem
Fourier series of a square wave
Find the Fourier series of the square wave of period \(2\pi\) that equals \(-1\) for \(-\pi < t < 0\) and \(+1\) for \(0 < t < \pi\).
Show solution
- The average is zero, so \(a_0 = 0\). The function is odd, so every \(a_n = 0\) (see the symmetry section below).
- \(b_n = \dfrac{2}{2\pi}\displaystyle\int_{-\pi}^{\pi} f(t)\sin nt\,dt = \frac{2}{\pi}\int_0^{\pi}\sin nt\,dt = \frac{2}{\pi}\cdot\frac{1 - \cos n\pi}{n}\).
- Since \(\cos n\pi = (-1)^n\), \(b_n = \dfrac{4}{n\pi}\) for odd \(n\) and 0 for even \(n\).
Answer: f(t) = (4/π)[sin t + (1/3) sin 3t + (1/5) sin 5t + ⋯]. A square wave contains only odd harmonics, with amplitudes falling as 1/n. The fundamental alone has amplitude 4/π ≈ 1.27, larger than the square wave itself.
Convergence and the Gibbs phenomenon
Dirichlet proved in 1829 that the Fourier series of a periodic function that is piecewise smooth (made of finitely many smooth pieces with finitely many jumps) converges to the function at every point where it is continuous, and to the average of the left and right values at each jump. The square wave series gives 0 at \(t = 0\), halfway between −1 and +1.
Near a jump, however, the partial sums overshoot. As more terms are added, the overshoot becomes narrower but does not get smaller: it approaches about 9 percent of the size of the jump. This Gibbs phenomenon appears whenever a signal with a sharp edge is represented with a limited number of frequencies, such as ringing near edges in compressed images and in digitally filtered signals. Smoother functions have Fourier coefficients that decrease faster: coefficients fall like \(1/n\) for functions with jumps, like \(1/n^2\) for continuous functions with corners, such as a triangle wave, and faster still for smooth functions. Fewer terms are then needed for a good approximation.
Using symmetry
Symmetry eliminates half the work. If \(f\) is even, \(f(-t) = f(t)\), then \(f(t)\sin n\omega_0 t\) is odd and integrates to zero over a symmetric interval, so all \(b_n = 0\) and the series contains only cosines (a cosine series). If \(f\) is odd, all \(a_n = 0\) (including \(a_0\)), and the series contains only sines. A further symmetry, half-wave symmetry, \(f(t + T/2) = -f(t)\), which most AC waveforms have because their positive and negative halves are mirror images, removes all even harmonics. This is why the current of a balanced three-phase rectifier or a saturated transformer contains odd harmonics (3rd, 5th, 7th) but not even ones.
Worked problem
A triangle wave
Find the Fourier series of the triangle wave of period \(2\pi\) defined by \(f(t) = |t|\) for \(-\pi \le t \le \pi\).
Show solution
- The function is even, so \(b_n = 0\). Average: \(a_0 = \dfrac{1}{2\pi}\displaystyle\int_{-\pi}^{\pi}|t|\,dt = \dfrac{\pi}{2}\).
- \(a_n = \dfrac{2}{\pi}\displaystyle\int_0^{\pi} t\cos nt\,dt\). By parts (Lesson 1): \(= \dfrac{2}{\pi}\left[\dfrac{t\sin nt}{n} + \dfrac{\cos nt}{n^2}\right]_0^{\pi} = \dfrac{2}{\pi n^2}\left((-1)^n - 1\right)\).
- So \(a_n = -\dfrac{4}{\pi n^2}\) for odd \(n\), and 0 for even \(n \ge 2\).
Answer: f(t) = π/2 − (4/π)[cos t + cos 3t/9 + cos 5t/25 + ⋯]. The coefficients fall as 1/n², so a few terms give an excellent approximation; setting t = 0 gives the curious result π²/8 = 1 + 1/9 + 1/25 + ⋯.
Energy, RMS value and Parseval's theorem
Because the harmonics are orthogonal, the mean square value of a periodic function is the sum of the mean squares of its components, Parseval's theorem:
In electrical terms, the RMS value (Calculus I) of a distorted waveform is \(\sqrt{I_0^2 + I_{1,\text{RMS}}^2 + I_{2,\text{RMS}}^2 + \cdots}\), where each harmonic's RMS value is its amplitude divided by \(\sqrt{2}\). The power delivered to a resistor is the sum of the powers delivered by each harmonic separately.
Worked problem
Total harmonic distortion
A rectifier draws a current whose harmonics have RMS values of 10 A at the fundamental, 8 A at the 3rd, 5 A at the 5th, 2.5 A at the 7th and 1 A at the 9th. Find the total RMS current and the total harmonic distortion, \(\text{THD} = \sqrt{I_3^2 + I_5^2 + \cdots}/I_1\).
Show solution
- Harmonic content: \(\sqrt{64 + 25 + 6.25 + 1} = \sqrt{96.25} = 9.81\) A.
- Total RMS: \(\sqrt{100 + 96.25} = 14.0\) A. THD \(= 9.81/10 = 98\) percent.
Answer: The current is 14.0 A RMS although only 10 A does useful work at the fundamental, and THD is about 98 percent, typical of a single-phase rectifier with a large capacitor. The harmonics heat cables and transformers and distort the supply voltage, which is why standards such as IEEE 519 and IEC 61000-3-2 limit them (ELE-470).
Fourier series and linear systems
The great practical value of Fourier series lies in how linear systems respond to them. A linear system, such as an electrical circuit, a mechanical structure or a filter, responds to a sinusoidal input with a sinusoid of the same frequency, changed in amplitude and phase by amounts that depend on the frequency. By the principle of superposition, the response to a sum of sinusoids is the sum of the responses. So to find the response to any periodic input, decompose the input into harmonics, find the response to each using phasors (Lesson 9), and add.
Worked problem
Filtering a square wave
A ±12 V square wave at 1 kHz drives an RC low-pass filter whose gain at frequency \(f\) is \(1/\sqrt{1 + (f/f_c)^2}\) with \(f_c = 1\) kHz. Find the amplitudes of the fundamental, 3rd and 5th harmonics at the output.
Show solution
- Input amplitudes: \(\dfrac{4 \times 12}{n\pi}\): 15.28 V, 5.09 V, 3.06 V for \(n = 1, 3, 5\).
- Gains: \(1/\sqrt{2} = 0.707\), \(1/\sqrt{10} = 0.316\), \(1/\sqrt{26} = 0.196\).
- Outputs: 10.80 V, 1.61 V, 0.60 V.
Answer: The 3rd harmonic falls from 33 percent to 15 percent of the fundamental, and the 5th from 20 percent to 6 percent, so the output is much closer to a sine wave. Inverters and power supplies use exactly this principle, with steeper filters, to turn switched waveforms into smooth outputs.
The same reasoning explains resonance in structures and machines. A periodic force with harmonics near a natural frequency of the structure excites large vibrations even if the fundamental is far away, which is why engineers examine the full harmonic content of forces from rotating machinery, footfalls on floors and the blade-passing frequencies of fans and turbines.
Complex form and the road to the Fourier transform
Using Euler's formula, the sines and cosines can be combined into complex exponentials, giving the compact complex form:
Each \(c_n\) is a complex number whose modulus gives the amplitude and whose argument gives the phase of the \(n\)-th harmonic; a plot of \(|c_n|\) against frequency is the signal's spectrum. For signals that are not periodic, letting the period grow without bound turns the sum into an integral, the Fourier transform, which describes a signal by a continuous spectrum. Sampled data are analyzed with the discrete Fourier transform, computed by the fast Fourier transform (FFT) algorithm popularized in 1965, which made spectrum analysis routine in instruments, audio and image compression, wireless communication and vibration monitoring. The signals and systems courses in the ELE and CMP programs develop these ideas.
Common mistakes
MistakeUsing 1/T instead of 2/T for aₙ and bₙ.
Insteada₀ uses 1/T; aₙ and bₙ use 2/T.
MistakeComputing both aₙ and bₙ for an odd or even function.
InsteadUse symmetry: odd functions have only sines, even functions only cosines.
MistakeExpecting the partial sums to converge uniformly at a jump.
InsteadThe Gibbs overshoot of about 9% remains, and the series gives the midpoint at the jump.
MistakeAdding harmonic RMS values directly.
InsteadAdd their squares and take the square root (Parseval).
MistakeAnalyzing a filter's response to a square wave as if it were a single sinusoid.
InsteadDecompose into harmonics, apply the gain at each frequency, and add.
Summary and key terms
- Periodic functions can be written as a DC term plus harmonics of the fundamental frequency.
- Orthogonality of sines and cosines gives the Euler-Fourier formulas for a₀, aₙ and bₙ.
- A square wave contains only odd harmonics with amplitudes 4/(nπ).
- Fourier series converge to the function where continuous and to the midpoint at jumps, with a persistent Gibbs overshoot.
- Even functions give cosine series, odd functions sine series, half-wave symmetry only odd harmonics.
- Parseval's theorem gives RMS values and total harmonic distortion from harmonic amplitudes.
- Linear systems respond to each harmonic separately; the complex form leads to spectra, the Fourier transform and the FFT.
- Periodic function
- A function that repeats after a fixed period T.
- Fundamental frequency
- The lowest frequency of a periodic signal, 1/T.
- Harmonic
- A sinusoidal component at an integer multiple of the fundamental frequency.
- Orthogonality
- The property that integrals of products of different harmonics over a period are zero.
- Fourier coefficients
- The amplitudes aₙ and bₙ of the harmonics in a Fourier series.
- Gibbs phenomenon
- The persistent overshoot of Fourier partial sums near a jump.
- Half-wave symmetry
- f(t + T/2) = −f(t), which eliminates even harmonics.
- Parseval's theorem
- The mean square of a function equals the sum of the mean squares of its harmonics.
- Total harmonic distortion
- The RMS of the harmonics divided by the RMS of the fundamental.
- Spectrum
- The amplitudes of a signal's frequency components.
Practice problems
Work each problem on paper first, then reveal the answer to check.
What are the frequencies of the 5th and 7th harmonics of a 60 Hz system?
Show answer
300 Hz and 420 Hz.
Find a₀ for \(f(t) = 3 + 2\cos t - \sin 4t\).
Show answer
3 (the series is already a Fourier series).
Is \(f(t) = t^2\) on \([-\pi, \pi]\) even or odd? Which coefficients vanish?
Show answer
Even; all bₙ = 0.
What is the amplitude of the 7th harmonic of a ±1 square wave?
Show answer
4/(7π) ≈ 0.182.
To what value does the square wave series converge at t = π?
Show answer
0, the average of +1 and −1.
How do Fourier coefficients of a triangle wave decrease?
Show answer
Like 1/n².
A current has 8 A fundamental and 6 A harmonics (RMS). Total RMS and THD?
Show answer
10 A; 75%.
Why do symmetrical AC waveforms contain no even harmonics?
Show answer
Half-wave symmetry makes even-harmonic coefficients vanish.
A filter has gain 0.1 at 300 Hz. A 300 Hz harmonic of 20 V becomes?
Show answer
2 V.
What algorithm computes discrete Fourier transforms efficiently?
Show answer
The fast Fourier transform (FFT).
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.