ViewWiki

The world, a little closer

Fourier series.

Spin circles on circles and the tip traces any repeating wave, even a square one. Add more circles and the corners sharpen, but each jump keeps a spike.

Explore the scene Interactive article

01 / The experiment

Circles on circles.

Raise Terms and watch the wave square up, then slide Show the sines to see the separate sines and the spike beside each jump.

Still of the Fourier series 3D scene, which explores: How can smooth circles add up to a wave with sharp corners?
Interactive scene

Loading the interactive version…

The explanation below is available while the scene loads.

Each circle is one sine wave: its radius is the sine's size and it turns k times while the first turns once. The tip's height is the sum of the sines, computed exactly for the terms shown.The graph shows two periods of the sum; the circles turn one period every 10 seconds. Real Fourier series can also use cosines and need infinitely many terms to match a wave with jumps.

02 / Three waves

Jumps, steps and corners.

Each wave drawn with the sum of its first seven terms over two periods. The thin grey line is the wave itself; the blue line is the sum.

Two jumps a period01

Square

Flat tops and sudden steps. It needs fast circles of real size to make each step, so its terms shrink only as 1 over the frequency.

Frequencies used
Odd only: 1, 3, 5 …
Size of term k
1/k
Jumps
Two per period
Overshoot with many terms
About 9% of the jump
One jump a period02

Sawtooth

A steady climb, then a drop. Every whole-number frequency joins in, and the single jump keeps its own spike.

Frequencies used
Every one: 1, 2, 3 …
Size of term k
1/k, alternating sign
Jumps
One per period
Overshoot with many terms
About 9% of the jump
Corners, no jumps03

Triangle

Straight slopes meeting at sharp corners. With no jumps its terms shrink as 1 over the frequency squared, and a few circles already match it closely.

Frequencies used
Odd only: 1, 3, 5 …
Size of term k
1/k², alternating sign
Jumps
None
Overshoot with many terms
None
The big idea

Any repeating wave is a sum of sine waves. The smoother the wave, the faster its terms shrink; a jump makes them shrink slowly and leaves a spike of about 9% that more terms narrow but never remove.

f(t) = Σ bk sin kt

A wave from spinning circles

Pin a circle to a board and let it turn at a steady rate. A point on its rim rises and falls, and its height traced against time is a sine wave, the smoothest kind of repeating wave there is. Now pin a smaller circle to that point and let it turn three times as fast. The rim of the second circle rides on the first, so its height is the sum of two sine waves. Keep going, each circle riding on the rim of the one before, and you have a chain of epicycles: circles on circles, the device ancient astronomers used to describe the wandering paths of the planets.

In the Scene the first circle sits on the left of the board. The glowing bead at the end of the chain is the tip, and a dashed line carries its height across to the graph on the right, where a second bead rides the curve the tip draws over two turns of the first circle.

Adding sines to make a square wave

With one term the tip draws a plain sine wave. Add a second circle a third the size, spinning three times as fast, and the hump flattens on top. Add a fifth-size circle turning five times as fast, then a seventh, and the wave squares up: flat tops, flat bottoms, and steep sides between them. The recipe is

4/π × (sin t + sin 3t/3 + sin 5t/5 + sin 7t/7 + …)

Each piece is called a term, and the whole endless sum is a Fourier series, after Joseph Fourier, who used sums of sines to work out how heat spreads through a solid in the early 1800s. His bold claim was that almost any repeating wave can be built this way, if you choose the sizes of the sines correctly. Each sine has a frequency, how many times it repeats in one period of the wave, and a size, called its amplitude. A Fourier series lists the amplitude for each frequency.

Try it: slide Terms down to 1 and watch the single circle draw a sine wave. Then slide it to 3, and on up to 15, and watch the flat tops appear as the small, fast circles are added.

Back to the experiment

Different waves, different recipes

Change Wave and the circles change size. The Sawtooth rises steadily and then drops all at once; it uses every whole-number frequency, with sizes 1, 1/2, 1/3 and so on, alternately added and subtracted. The Triangle goes up and down in straight lines with sharp corners but no jumps; it uses only odd frequencies again, but their sizes shrink much faster, as 1, 1/9, 1/25, the squares of the odd numbers. With the triangle chosen the later circles are so small they are hard to see, and a handful of terms already gives a close match.

The pattern is general. The smoother a wave is, the faster its circles shrink and the fewer terms it needs. A sudden jump needs fast circles of real size, so the terms of the square and sawtooth waves shrink only as 1 over the frequency.

The spike that never goes away

Slide Show the sines towards Sines inside. First the separate sines appear on the graph, each in the colour of its circle, so you can see that the square-looking curve really is nothing but smooth waves added up. Then the target wave itself appears as a thin chalk line, and finally amber beads mark the highest and lowest points of the sum.

Those beads sit right beside the jumps, and they stick out above the flat top. Add more terms and the spike gets narrower, squeezed closer to the jump, but it does not get shorter. For the square wave the sum peaks at about 1.18 when the wave’s top is 1, an overshoot of about 9% of the full jump from −1 to 1, whether you use 5 terms or 5,000. The sawtooth creeps towards the same 9% more slowly. This stubborn overshoot is called the Gibbs phenomenon, after Josiah Willard Gibbs, who described it in 1899; Henry Wilbraham had found it in 1848.

It does not mean the series fails. At every single point away from a jump, the sum gets as close to the wave as you like if you add enough terms; the spike just moves ever closer to the jump. But no finite number of smooth sines can make a perfectly sharp step, so the sum always rings beside one. The triangle has no jumps, and its sum never overshoots at all.

Where Fourier series turn up

Breaking a signal into sines is one of the most useful ideas in science. The sound of a violin and a flute playing the same note differ in the sizes of their higher frequencies, called harmonics. Music and picture compression, such as MP3 and JPEG, store the large terms and drop the tiny ones the ear or eye will not miss, and the Gibbs ringing shows up as faint ripples beside sharp edges in a heavily compressed photo. Engineers analyse vibrations in bridges and engines the same way, and the method extends from repeating waves to any signal, where it is called the Fourier transform.

What this model leaves out

The Scene uses only sine terms, because all three waves are arranged to be odd (turned half a turn about the centre, their shape below the axis matches the shape above). A general wave also needs cosine terms and a constant, which would be circles that start at a different angle. The Scene stops at 15 terms; the true series has infinitely many, and its sum is exactly the wave everywhere except at the jumps themselves, where it settles on the midpoint. The circles all turn the same way, which is one of several ways to draw a Fourier series with circles. The graph is computed from the formula at 1,200 points across two periods, so for 15 terms the very tip of the narrow spike may be drawn slightly short; the peak value on the label is calculated exactly.

Reuse with credit to ViewWiki and a link to this page.

04 / Learn this in a course

Practise it, step by step.

This lesson teaches the topic with checked questions.

  1. Adding sines Mathematics · Complex numbers