Back to Home

Fourier Series · Square Wave Decomposition and Harmonic Superposition

A square wave can be decomposed into the superposition of odd sine harmonics: \(f(t) = \frac{4}{\pi}\left(\sin\omega t + \frac{1}{3}\sin 3\omega t + \frac{1}{5}\sin 5\omega t + \cdots\right)\)
The charts below show the fundamental wave, and the process of progressively adding 3rd, 5th, 7th, 11th, 33rd, and 55th harmonics to approximate a square wave.

Fourier Series (Square Wave)

Fourier series of a periodic square wave (amplitude \(\pm1\), angular frequency \(\omega=2\pi f\)):

\[ f(t) = \frac{4}{\pi} \sum_{n=1,3,5,\ldots}^{\infty} \frac{\sin(n\omega t)}{n} \]

• Fundamental component: \(\frac{4}{\pi}\sin(\omega t)\)
• 3rd harmonic: \(\frac{4}{3\pi}\sin(3\omega t)\)
• 5th harmonic: \(\frac{4}{5\pi}\sin(5\omega t)\)
• 7th harmonic: \(\frac{4}{7\pi}\sin(7\omega t)\)
• 11th, 33rd, 55th harmonics follow the same pattern, with coefficient \( \frac{4}{n\pi} \).
As harmonics increase, the synthesized waveform approaches the ideal square wave, but Gibbs phenomenon (overshoot) appears at edges.

📌 Horizontal axis is time \(t\) (seconds), fundamental frequency \(f = 1\,\text{Hz}\), showing two complete periods.

Key Observations

  • The fundamental is a sine wave with amplitude ~1.27, same frequency as the original square wave.
  • Adding the 3rd harmonic, the waveform begins to show a "square wave" outline with ripples on top.
  • Continuing to add 5th and 7th harmonics, the rising edge steepens, top ripple becomes finer, approaching the ideal square wave.
  • Adding 11th, 33rd, and 55th harmonics, the waveform edges become steeper, top oscillation becomes denser, Gibbs overshoot persists (~9%).
  • Higher harmonics yield more precise synthesis, but the overshoot cannot be fully eliminated (Gibbs phenomenon).

① Ideal Square Wave (Reference)

Amplitude ±1 V

Ideal square wave, 50% duty cycle, instantaneous transition

② Fundamental Component (1st Harmonic)

Amplitude 4/π ≈ 1.273

\(f_1(t)=\frac{4}{\pi}\sin(\omega t)\), a single sine wave

③ Fundamental + 3rd Harmonic

1st + 3rd

Top begins to flatten, small ripples appear

④ Fundamental + 3rd + 5th Harmonics

1+3+5th

Closer to square wave, rising edge steepens

⑤ Fundamental + 3rd + 5th + 7th Harmonics

1+3+5+7th

Further approximation to square wave, Gibbs overshoot becomes evident

⑥ Fundamental + 3+5+7+9+11th Harmonics

1+3+5+7+9+11th

Rising edge steeper, top ripple denser, improved approximation

⑦ Fundamental ~ 33rd Harmonic (Odd)

1+3+5+...+33rd

Steep edges, refined top oscillation, Gibbs overshoot stabilizes at 9%

⑧ Fundamental ~ 55th Harmonic (Odd)

1+3+5+...+55th

High-order harmonics make waveform nearly perfect, only fine ripples and overshoot remain

⚡ Gibbs Phenomenon: At discontinuities, a finite Fourier series exhibits ~9% overshoot that does not vanish with increasing terms.