# Square wave

A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency between fixed minimum and maximum values, with the same duration at minimum and maximum. In an ideal square wave, the transitions between minimum and maximum are instantaneous.

Square wave
Sine, square, triangle, and sawtooth waveforms
General information
General definition${\displaystyle x(t)=4\left\lfloor t\right\rfloor -2\left\lfloor 2t\right\rfloor +1,2t\notin \mathbb {Z} }$
Fields of applicationElectronics, synthesizers
Domain, Codomain and Image
Domain${\displaystyle \mathbb {R} \setminus \left\{{\tfrac {n}{2}}\right\},n\in \mathbb {Z} }$
Codomain${\displaystyle \left\{-1,1\right\}}$
Basic features
ParityOdd
Period1
AntiderivativeTriangle wave
Fourier series${\displaystyle x(t)={\frac {4}{\pi }}\sum _{k=1}^{\infty }{\frac {1}{2k-1}}\sin \left(2\pi \left(2k-1\right)t\right)}$

The square wave is a special case of a pulse wave which allows arbitrary durations at minimum and maximum amplitudes. The ratio of the high period to the total period of a pulse wave is called the duty cycle. A true square wave has a 50% duty cycle (equal high and low periods).

Square waves are often encountered in electronics and signal processing, particularly digital electronics and digital signal processing. Its stochastic counterpart is a two-state trajectory.