Examples of Fourier series

This set of animations provides examples of common Fourier series often used in introductory courses on the subject. For each periodic function, I take the first six nonzero Fourier components and let them run in time. These are summed to produce an approximation to the original function.

The examples include

- Square wave: I chose the rising edge of the square wave to be positioned at t = 0 (or x = 0 for the spatial version), meaning the Fourier series is antisymmetric and thus only contains sine terms. The series has the Fourier coefficients:

for odd n, and

for even values of n. L is the periodicity. - Pulse train: this is the more general case of the square wave whereby the duty cycle dc can be anything between . The square wave has a duty cycle (i.e., the ratio of the “on” time to the periodicity) dc = 0.5. I chose the pulse to sit symmetrically around the y-axis, and hence the series is symmetric with only cosine terms. The series has the Fourier coefficients:
- Sawtooth wave: this is a wave with a linear gradient over a time (or distance) L, followed by an infinitely sharp drop. I chose the vertical drop to be at the origin, and the function is therefore antisymmetric, with only sine terms. The series has the Fourier coefficients:
- Triangular wave: this is a periodic function with linearly rising and falling flanks. It is defined by M, the ratio of the periodicity to the span in t (or x) of the rising flank. A symmetric triangular function would thus have M = 2 and a sawtooth wave would have M = 1. I chose the rising flank to have its centre at the y-axis and thus the function is antisymmetric with only sine terms. The series has the Fourier coefficients:

Finally, I include an animation of a square wave, in which I gradually increase the number of Fourier components, showing how the finite approximation becomes more and more precise.