A Sawtooth Wave

Fairly general, even discontinuous, periodic functions can be written as an infinite series in sines and cosines:

a0 + a1sin(x) + b1cos(x) + a2sin(2x) + b2cos(2x) + a3sin(3x) + b3cos(3x) + ....

Such expansions are called Fourier series. If the y-axis lies halfway bewteen two of the discontinuities in the sawtooth, a formula for the sawtooth wave is something like

sin(x) - 12sin(2x) + 13sin(3x) - 14sin(4x) + 15sin(5x) - 16sin(6x) + ...

Below are two pictures of a periodic sawtooth wave and the approximations to it using the initial terms of its Fourier series.


The undershooting and overshooting of the finite series near the discontinuities is called the Gibbs phenomenon. It disappears in the full series but is present in every finite approximation, so it is an important issue to handle in signal processing. To hear the finite approximations to a sawtooth wave, look here.