= Square wave
{title2=$\operatorname{sgn}(\sin\theta)=\frac4\pi\sum_{n\geq1,\ n\text{ odd}}\frac{\sin n\theta}{n}$}
{wiki}
A <square wave> alternates between two constant levels for equal halves of a <period>. Choose a $2\pi$-periodic <function> equal to $1$ on $(0,\pi)$ and $-1$ on $(-\pi,0)$, with value zero at the jumps. Its <odd function> symmetry makes the mean and every cosine <Fourier coefficient> vanish. Directly integrating the two constant pieces gives
$$
a_0=a_n=0,\qquad b_n=\frac{2[1-(-1)^n]}{\pi n},\qquad
f(x)\sim\frac4\pi\sum_{k=0}^{\infty}\frac{\sin((2k+1)x)}{2k+1}.
$$
Thus only <odd> sine <Fourier harmonics> occur, with amplitudes decreasing like the reciprocal of their frequency multiplier. Every finite <Fourier partial sum> is smooth, yet their <pointwise limit> has jumps. At those jumps the <Fourier series> converges to zero, the midpoint of the two levels, regardless of which value we assign to the original <function> there.
This example explains how smooth components can encode sharp transitions. Increasing the number of <Fourier harmonics> narrows the transition region, but also produces the persistent overshoot described by the <Gibbs phenomenon>. The illustrated square wave and coefficient calculation are mathematical constructions, not measurements of a physical device.
Back to article page