Analog ElectronicsInternubiquitous

Fourier Series: Harmonic Decomposition of Signals

Learn Fourier series coefficients, symmetry shortcuts, and a worked square-wave example that predicts EMI harmonics and PWM filter sizing.

5 min readAhmet Zahid ArıcanUpdated 11 Sept 2026
Contents & prerequisites

Every periodic signal an embedded engineer touches — a PWM output, a clock waveform, a switching regulator's ripple, a distorted sine from a non-linear amplifier — can be broken down into a sum of pure sinusoids at multiples of a fundamental frequency. This is the Fourier series, and it's the tool that explains why square waves radiate EMI at odd harmonics, why a PWM filter needs a certain cutoff, and why a "sine wave" out of a cheap DAC still has audible harmonic distortion. Understanding harmonic decomposition turns a scope trace into a frequency-domain prediction you can design against.

The Core Idea

Any periodic signal x(t) with period T (fundamental frequency f₀ = 1/T, ω₀ = 2πf₀) that satisfies mild conditions (finite discontinuities, finite energy per period — the Dirichlet conditions, met by essentially every real electrical signal) can be written as a sum of a DC term plus sinusoids at integer multiples of f₀:

x(t) = a₀ + Σ [aₙ·cos(nω₀t) + bₙ·sin(nω₀t)],  n = 1, 2, 3, ...

The term at n = 1 is the fundamental; terms at n = 2, 3, ... are harmonics. Each harmonic is itself a pure sinusoid the circuit can be analyzed against independently, using ordinary phasor/impedance techniques — this is what makes the decomposition useful, not just mathematically elegant.

The Coefficient Formulas

a₀ = (1/T) ∫₀ᵀ x(t) dt                      (DC average)
aₙ = (2/T) ∫₀ᵀ x(t)·cos(nω₀t) dt             (cosine content at harmonic n)
bₙ = (2/T) ∫₀ᵀ x(t)·sin(nω₀t) dt             (sine content at harmonic n)

Equivalently, in magnitude/phase form, which is what you actually plot on a spectrum analyzer:

x(t) = a₀ + Σ Cₙ·cos(nω₀t − φₙ),   Cₙ = √(aₙ² + bₙ²),   φₙ = atan2(bₙ, aₙ)

Cₙ is the amplitude of the n-th harmonic; φₙ its phase relative to the fundamental's time origin. Cₙ falling off quickly with n means most of the signal's energy is concentrated near the fundamental — a "clean" waveform. Slow falloff (like 1/n) means significant energy at high frequencies — a "harsh" or EMI-heavy waveform.

Symmetry Shortcuts

Recognizing waveform symmetry eliminates half the integration work:

SymmetryConditionResult
Even functionx(t) = x(−t)All bₙ = 0 (cosine terms only)
Odd functionx(t) = −x(−t)All aₙ = 0, a₀ = 0 (sine terms only)
Half-wave symmetryx(t + T/2) = −x(t)Only odd harmonics exist (n odd); all even n vanish

Half-wave symmetry is the one to remember for digital work: a symmetric square wave, triangle wave, or any waveform with no DC offset and equal positive/negative half-cycles has energy only at odd harmonics (1st, 3rd, 5th, 7th...). This is exactly why square-wave clock harmonics show up at 3×, 5×, 7× the clock frequency in EMI scans — not at 2× or 4×.

Worked Example: Ideal Square Wave

Take a square wave of amplitude ±A, period T, 50% duty, odd symmetry (defined to switch from −A to +A at t = 0), so a₀ = 0 and all aₙ = 0 by odd symmetry — only bₙ survive.

bₙ = (2/T) ∫₀ᵀ x(t)·sin(nω₀t) dt

Splitting the integral over the two half-periods (+A for 0 < t < T/2, −A for T/2 < t < T) and evaluating:

bₙ = (2A/nπ)·[1 − cos(nπ)]
  • n even: cos(nπ) = 1bₙ = 0 (confirms half-wave symmetry prediction)
  • n odd: cos(nπ) = −1bₙ = 4A/(nπ)

So:

x(t) = (4A/π)·[sin(ω₀t) + (1/3)sin(3ω₀t) + (1/5)sin(5ω₀t) + (1/7)sin(7ω₀t) + ...]

Check: at t = 0⁺, sum of a few terms should trend toward the mid-transition value. The fundamental alone has amplitude 4A/π ≈ 1.273A — larger than A, which is expected because the higher harmonics subtract near the edges to sharpen the transition and pull the peak back down. As more terms are added, the overshoot at the discontinuity converges to a fixed ~9% overshoot (the Gibbs phenomenon) that never disappears no matter how many harmonics are summed — a real consequence of truncating a series representing a discontinuous signal, and a preview of why real filtered square waves always show ringing at sharp edges.

Power check: Parseval's theorem states total power equals the sum of power in each harmonic. For this square wave, total RMS² is (since it's always at ±A). Summing (1/2)(4A/(nπ))² over odd n from 1 to ∞ converges to — confirms the coefficients are correct.

Design Implications

  • EMI prediction: a trapezoidal clock's harmonic amplitudes fall off as 1/n for the ideal square wave but roll off faster (1/n²) once finite rise/fall time is included — this is why slew-rate control reduces radiated emissions without touching the fundamental.
  • PWM filtering: to recover a clean analog value from a PWM signal, the low-pass filter must attenuate the fundamental switching harmonic (and its neighbors) by enough dB to meet ripple specs — sized directly from the Cₙ amplitudes.
  • Non-linear distortion (THD): total harmonic distortion is computed directly from Fourier coefficients: THD = √(ΣCₙ² for n≥2) / C₁. A Fourier analysis of an amplifier's output spectrum is exactly how THD is measured.
  • Filter/amplifier bandwidth sizing: if a circuit must faithfully pass a square wave's "sharpness," the required bandwidth is driven by how many harmonics need to pass with low attenuation and phase distortion — not just the fundamental.
  • Sampling and aliasing: any harmonic above the Nyquist frequency of a downstream ADC will alias back into the passband; harmonic content, not just the fundamental, must be considered when setting anti-alias filter cutoffs.

Key Takeaways

  • Any periodic signal decomposes into a DC term plus sinusoidal harmonics at integer multiples of the fundamental frequency — the Fourier series.
  • Coefficients aₙ, bₙ (or magnitude/phase Cₙ, φₙ) are computed by integrating the signal against cosine/sine basis functions over one period.
  • Waveform symmetry (even, odd, half-wave) predicts which harmonics vanish before doing any integration — half-wave symmetry (no even harmonics) is the most common case in digital signals.
  • An ideal square wave contains only odd harmonics with amplitude falling as 1/n; truncating the series produces the persistent ~9% Gibbs overshoot at discontinuities.
  • Harmonic content directly drives real design decisions: EMI emissions, PWM filter sizing, THD specs, and anti-alias filter cutoffs all trace back to a signal's Fourier spectrum.

Learning

Sign in to track your progress.

Evidence

Public projects engineers linked to Fourier Series: Harmonic Decomposition of Signals.

Add evidence

No engineer has linked a project to this topic yet. Built something that proves it? Add the project and tag it with analog-electronics-fourier-series-harmonic-decomposition-of-signals — it then shows here and on your public profile.