Fourier Harmonics
Drag the slider for the number of terms n and watch the Fourier series of a square wave converge, with the Gibbs overshoot at each jump. Edit the sum.
Joseph Fourier wanted to know how heat spreads through a solid. He wrote a periodic function as a sum of sines and cosines whose frequencies are whole multiples of one fundamental frequency. He announced the method in 1807 and published his Analytical Theory of Heat in 1822. Each term of the sum is called a harmonic. It is behind audio compression; it explains timbre: a violin and a flute playing the same pitch sound different because their harmonics have different amplitudes.
The plot shows the square wave \operatorname{sgn}(\sin x) , which jumps between -1 and 1 , in gray, and in blue the partial sum of its Fourier series, \frac{4}{\pi}\sum_{k=1}^{n} \frac{\sin((2k-1)x)}{2k-1} , the sum of the terms for k = 1, 2, \dots, n : only odd harmonics, with amplitudes that fall as 1/(2k-1) . The slider sets the number of terms n , from 1 (a single sine) to 25 . Drag it and notice that each new term makes the sum flatter between the jumps and steeper at them.
Near each jump the sum overshoots the wave, and the overshoot does not go away: with more terms it moves closer to the jump and gets narrower, but its height stays at about 1.18 , about 9\% of the jump of 2 above the wave. Henry Wilbraham first analyzed it in 1848; it carries the name of J. Willard Gibbs, who explained it in 1899. The series converges at every point, but not uniformly near a discontinuity. Watch the peak: 1.27 with one term, 1.18 with four, and still 1.18 with twenty-five.
JavaScript is required to view the interactive plot.