CurvG
Sign In

No. 1 · Analysis · Signals

How can a chain of spinning circles draw any curve?

Each circle is one sine wave spinning at a steady rate. Chain them tip to tail and they build a square wave, or even draw π. Watch the circles stack up, then draw your own curve and see it taken apart.

Why?

The explanation

Any periodic motion splits into circles turning at steady speeds. More circles get closer, but the ≈ 9% spike at a jump never goes away.

01One circle, one sine wave

A point moves round a circle of radius rr at a steady rate, so its angle θ\theta grows evenly with time. Its height is rsin⁡θr\sin\theta. Record that height over time and you get a sine wave.

A faster circle makes a denser wave, a bigger one a taller wave. Speed and radius are all there is to know about the circle.

02Stacking circles: the Fourier series

Pin the centre of a second circle to the rim of the first, and the height of the end point is the sum of two sine waves. A square wave needs circles turning 1, 3, 5, 7… times as fast, with radii shrinking as 1,13,15,17,…1, \tfrac13, \tfrac15, \tfrac17, \dots:

f(θ)=4π(sin⁡θ+sin⁡3θ3+sin⁡5θ5+⋯ )f(\theta)=\frac{4}{\pi}\left(\sin\theta+\frac{\sin 3\theta}{3}+\frac{\sin 5\theta}{5}+\cdots\right)

Fourier, working on how heat spreads, claimed that any periodic function can be written as a sum like this of sines and cosines. The size of each circle is the coefficient of its term.

  • A triangle wave's radii shrink as 1/n21/n^2, so five circles are already within about 1%.
  • A square wave's shrink as 1/n1/n, which is much slower: five circles are still about 20% off, and sixty about 6%.

The sharper the curve, the more circles it takes.

03The 9% at the corner: the Gibbs phenomenon

At a jump, the partial sums of a square wave always overshoot. More circles make the spike narrower and push it towards the jump, but its height settles at about 8.95% of the jump. For a square wave of ±1\pm1 the peak is about 1.1791.179.

The total error does keep shrinking, because the spike keeps getting thinner, but the largest error never goes away. In the language of analysis, the series does not converge uniformly near the jump. Wilbraham noticed it first, in 1848; Gibbs pointed it out again in 1899 and the name stuck.

Engineers often tame the spike with weighted averages such as Fejér summation, at the cost of rounding off the corner.

04From waves to shapes: circles in the plane

Treat a point in the plane as a complex number z=x+iyz=x+iy. A spinning circle is then cke2πiktc_k e^{2\pi i k t}: ∣ck∣|c_k| is the radius, the angle of ckc_k is where it starts, and kk is the speed (negative means clockwise). A closed curve z(t)z(t) can be written as

z(t)=∑kck e2πikt,ck=1N∑j=0N−1zj e−2πikj/Nz(t)=\sum_{k} c_k\, e^{2\pi i k t},\qquad c_k=\frac1N\sum_{j=0}^{N-1} z_j\, e^{-2\pi i k j/N}

Here the curve is first sampled at N=256N=256 points zjz_j evenly spaced along its length, and a discrete Fourier transform gives every circle. They are drawn largest first: the big circles set the outline, the small ones add detail.

For the π on the stage, three circles leave about 40% error, thirty about 2%, and a hundred only about 0.3%.

05Why it matters

Splitting a signal into frequencies is close to the starting point of modern signal processing:

  • Compression: JPEG splits each image block into cosine components (a close relative of Fourier's) and MP3 does the same for sound; both then drop the small components we barely notice.
  • Spectra: tuners, equalisers and speech recognition all start by asking which frequencies a sound contains.
  • Solving equations: Fourier built the method to solve the heat equation; each frequency fades on its own, and the pieces are added back together.

Questions

Why circles?

A circle turning at a steady speed is the simplest periodic motion, and its shadow in any direction is a sine wave. Sine waves of different frequencies do not interfere with each other (they are orthogonal), so each circle's size can be worked out on its own, and adding or removing one leaves the others unchanged.

How many circles are enough?

It depends on how sharp the curve is. Smooth curves have coefficients that shrink fast, so a few circles look right. Curves with corners or jumps shrink slowly, need many circles, and always keep the Gibbs spike at a jump.

Can the Gibbs spike be removed?

Not by adding circles. Weighting the terms (Fejér summation, sigma factors) flattens it, at the cost of a blunter corner.

What if my drawing is not closed?

A Fourier series assumes the curve repeats, so it joins the end straight back to the start. That join acts like a jump, and you will see ripples there: the Gibbs phenomenon in the plane.

The syllabus side

Related curves

Sources: Fourier series — Wikipedia · Gibbs phenomenon — Wikipedia