What Is the Fourier Series of a Square Wave?
At a glance
- 1. Set the convention
Specify the wave's amplitude, period, and starting phase; these determine its Fourier coefficients.
- 2. Use symmetry
A zero-mean square wave centered on the time origin is odd, so it has sine terms only.
- 3. Find the coefficients
Integrating over one half-cycle gives nonzero coefficients for odd harmonics, decreasing in proportion to one over harmonic number.
- 4. Check the result
Evaluate the series away from jumps, and remember that at each jump it converges to the midpoint of the two levels.
A square wave is not described by a single sine wave: its sharp transitions require a sum of harmonics. The exact Fourier series depends on the wave’s amplitude, period, offset, and phase. The standard zero-mean square wave has a particularly simple series: it contains only odd sine harmonics.
The standard square-wave convention
Let the wave alternate between +A and −A, with period T. Choose its phase so it is positive during the first half of each cycle and negative during the second:
with the pattern repeating every T. Its fundamental angular frequency is . Equivalently, the wave can be centered on the origin so that it is odd: , except at its jump points.
With this convention, the Fourier series is
In summation notation,
Only odd multiples of the fundamental frequency occur. The amplitude of the harmonic at frequency is .
Why only odd sine terms appear
A Fourier series can include a constant term, cosine terms, and sine terms. This wave has zero average, so its constant term is zero. Its odd symmetry means all cosine coefficients are zero as well. To find the remaining sine coefficients, integrate over one period using the standard formula
Both and are odd, so their product is even. On the interval , the wave equals A, giving
If n is even, and . If n is odd, and . That produces the odd-harmonic series above.
Worked example: a 500 Hz square wave
Suppose a voltage switches between +3 V and −3 V, completing a cycle every 2 ms. Its period is s, so its fundamental frequency is 500 Hz and its angular frequency is rad/s. Substituting V gives
The first three terms have frequencies 500 Hz, 1500 Hz, and 2500 Hz. Keeping only these terms gives an approximation to the square wave; adding more odd harmonics makes the flat portions and sharp edges increasingly recognizable. The approximation still rings near each transition.
If the square wave goes from zero to A
A common alternative is a unipolar wave that is A for half of each period and 0 for the other half. It is not zero-mean: its average value is . For the phase where it is high during the first half-cycle, its series is
The added constant term supplies the offset. A different phase shifts the waveform and changes the sine and cosine coefficients, but not the underlying harmonic frequencies.
Values at jumps and common mistakes
At a discontinuity, a Fourier series converges to the average of the left- and right-hand limits. For the symmetric wave, that average is zero; for the unipolar wave, it is . The value you assign to the signal at the single jump point does not change its Fourier coefficients.
A finite sum does not reproduce a discontinuous edge exactly. It oscillates near the jump, with an overshoot that persists as more terms are added, even though the oscillations become confined closer to the transition. This is the Gibbs phenomenon.
Common errors include using A for the peak-to-peak value when the wave actually ranges from −A to +A (its peak-to-peak value is ), including even harmonics for the standard symmetric wave, and forgetting the average-value term for a unipolar wave. State the amplitude convention, offset, and phase before applying a formula.
References
- Fourier Series and Boundary Value Problems — Richard V. Churchill and James Ward Brown
- Advanced Engineering Mathematics — Erwin Kreyszig
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.