The square wave, also called a pulse train, or pulse wave, is a periodic waveform consisting of instantaneous transitions between two levels. The square wave is sometimes also called the Rademacher function. The square wave illustrated above has period 2 and levels and 1/2. Other common levels for square waves include and (digital signals).
Analytic formulas for the square wave with half-amplitude , period , and offset include
(1)
| |||
(2)
| |||
(3)
|
where is the floor function, is the sign function, and is the inverse hyperbolic tangent.
The square wave is implemented in the Wolfram Language as SquareWave[x].
Let the square wave have period . The square wave function is odd, so the Fourier series has and
(4)
| |||
(5)
| |||
(6)
| |||
(7)
|
The Fourier series for the square wave with period , phase offset 0, and half-amplitude 1 is therefore
(8)
|