Introduction
Square waves have an interesting mix of practice and theory. In practice, they are extremely simple — an alternating sequence of high/low or 1's and 0's found in countless applications. In theory, however, they are somewhat difficult to analyze. This article derives the harmonic content rigorously using Laplace Transforms and explores practical applications including harmonic cancellation.
Square Wave Parameters
A general square wave is described by four parameters:
The first cycle expressed with unit step functions:
The full periodic wave: \(v(t) = \sum_{n=-\infty}^{\infty} v_0(t - nT)\)
Laplace Transform
The Laplace transform of a single cycle:
The full periodic square wave in the s-domain:
Fourier Series
The poles are at \(s = jn\frac{2\pi}{T}\) for \(n = 0, \pm1, \pm2, \ldots\) After applying L'Hôpital's rule, the residues (Fourier coefficients) are:
The final Fourier series expansion of the square wave:
Harmonic Spectrum
RC Filter Response
The transfer function of an RC low-pass filter is:
The output in the time domain over one period:
where \(K_2 = d\) (DC level) and \(K_1\) captures the transient behavior.
Harmonic Cancellation
A single pulse per period suppresses the n-th harmonic when:
For multiple harmonic cancellation, use M equal slots per period. The m-th pulse has Fourier coefficient:
Two pulses at positions \(m_1\) and \(m_2\) cancel the n-th harmonic when:
This requires M even and n dividing M/2. Minimum M values to cancel up to the n-th harmonic:
| n (highest cancelled) | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|
| Minimum M | 4 | 12 | 24 | 120 | 120 | 840 | 840 | 2520 |
Phasor Diagram
Each pulse position m corresponds to a phasor \(e^{-jn\pi m/6}\). Two pulses cancel a harmonic when their phasors are exactly 180° apart: