Part IV · Calculus Chapter 33 of 60
Fourier series
The sound of a violin, the temperature in a ring and an outline drawn with a finger can all be taken apart into sine waves and put back together. We’ll find out how to get a curve’s harmonics, why a step always keeps a ringing, and how the same trick compresses photos and music.
Builds on: 32 · Functions of several variables
You will learn
- find Fourier coefficients as dot products of a signal with sine waves
- understand where a Fourier series converges, where the 9 % overshoot at a jump comes from and how to get rid of it
- recognise the same trick in Ptolemy’s epicycles, in the fast Fourier transform, JPEG and MP3
The last chapter ended in the hush before a concert. Sound is the air pressure at the eardrum changing over time, that is, a function of just one variable, $p(t)$. A violin and a flute play the same note A, and for both the pressure curve repeats 440 times a second. But the curves themselves are unlike: the flute’s wave is almost smooth, the violin’s angular, like the teeth of a saw. The ear doesn’t confuse them. It breaks sound down into pure tones, sine waves, and hears which of them are present and how loud they are.
In this chapter we’ll open a recording studio and do with a signal what a sound engineer does: listen, split it into tracks, turn the knobs and mix it back together. There are two questions. Can any periodic signal be built from sine waves? And how can you tell from a finished curve which ones it’s made of?
One note, different voices
The simplest sound is a pure tone: the pressure varies as a sine wave, $p(t) = A\sin(2\pi\nu t)$. The number $\nu$ is the frequency, how many oscillations fit into a second; $A$ is the amplitude, on which the loudness depends. A tuning fork gives an almost pure tone. For the A above middle C $\nu = 440$ Hz, and one oscillation lasts $\frac{1}{440}$ of a second, about $2.27$ milliseconds.
Add a sine wave with frequency $880$ Hz. During one oscillation of the fundamental it manages exactly two, so the sum again repeats after $\frac{1}{440}$ of a second. The pitch of the note is the same; only the waveform changes. The frequencies $3 \cdot 440$, $4 \cdot 440$ and so on behave the same way: they all fit into the period of the fundamental a whole number of times. Musicians call them overtones, mathematicians harmonics.
The harmonic number $n$ of a periodic signal is a sine wave whose frequency is $n$ times the fundamental. The sum of a constant and finitely many harmonics is called a trigonometric polynomial.
From now on it’s convenient to measure time so that the period of the fundamental becomes $2\pi$: instead of $t$ we write $x = 2\pi\nu t$. Then harmonic number $n$ is the sine wave $A\sin(nx + \varphi)$, and by the formula for the sine of a sum it equals $A\sin\varphi\cos nx + A\cos\varphi\sin nx$. Any harmonic can be written as a mix of a cosine and a sine of the same frequency, and the shift $\varphi$, the phase, is hidden in the proportions of the mix.
Shuffle the phases a few times. The picture is new every time, yet to the ear the sound hardly changes. It seems the ear perceives the set of amplitudes rather than the waveform itself. This guess was put forward in 1843 by Georg Ohm, the same Ohm who discovered the law for electric circuits, and twenty years later Hermann Helmholtz built a theory of hearing on it. The rule isn’t absolute: in some sounds phases can be told apart after all. But it serves the sound engineer well, and the timbre of an instrument is described by the set of amplitudes of its harmonics.
The set of amplitudes of a signal’s harmonics is called its spectrum. The spectrum answers the question of how much of each frequency the signal contains.
A signal is the sum of two pure tones, 440 Hz and 660 Hz. After how long does it repeat?
$440 = 2 \cdot 220$ and $660 = 3 \cdot 220$, so both tones are the second and third harmonics of the frequency $220$ Hz. In $\frac{1}{220}$ of a second the first makes exactly two oscillations and the second three, and the sum repeats. The fundamental frequency of $220$ Hz isn’t in the signal at all.
Where it all began: heat in a ring
The first to break functions down into sine waves weren’t musicians but a physicist who studied heat. Joseph Fourier went to Egypt with Napoleon, then became prefect of the Isère department in Grenoble and, between administrative duties, worked on heat conduction. In December 1807 he presented a memoir on the propagation of heat to the Paris Academy. The committee, which included Lagrange and Laplace, received it coolly, and the memoir wasn’t printed. Later the Academy made the propagation of heat the subject of its 1811 prize competition, and Fourier won it, although the report again reproached him for lack of rigour. The full theory came out in 1822 as the book The Analytical Theory of Heat.
Take a thin wire ring and heat part of it unevenly. We’ll give the position of a point on the ring by the angle $x$, and its temperature at time $t$ by the function $u(x, t)$. Heat flows from hot to cold, and a point warms up the faster, the warmer its neighbours are on average. This “difference from the neighbours” is measured by the second derivative in $x$. If units are chosen so that the coefficient is one, we get the heat equation
$$\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2}.$$
We know partial derivatives from the last chapter. Fourier noticed that in this equation harmonics live separately. The function $u = e^{-n^2 t}\sin nx$ satisfies it: the derivative in $t$ gives a factor $-n^2$, and the second derivative in $x$ gives the same factor $-n^2$. The same is true of $e^{-n^2 t}\cos nx$. Each harmonic stays a harmonic and simply fades at its own rate. The equation is linear, so a sum of solutions is a solution too. If the initial temperature can be broken down into harmonics, the solution is ready:
The problem has come down to a single question: how do you break the initial temperature down into harmonics? And it can be anything at all, for example half the ring hot and half cold. So Fourier had to claim that even a function with a step can be broken down into sine waves.
A step from sine waves
That’s exactly what outraged Lagrange. Sine waves are smooth, and their sums are smooth too: where would a step come from? Let’s test it on the most awkward signal, the square wave: $\operatorname{sq}(x) = 1$ for $0 < x < \pi$ and $\operatorname{sq}(x) = -1$ for $-\pi < x < 0$, repeated with period $2\pi$ from there on. Fourier’s answer:
Each partial sum is a continuous function, and at the point $x = 0$ all the sines are zero. So the series converges to zero there, exactly the middle of the jump. The step appears only in the limit. Lagrange was wrong: a limit of continuous functions can be discontinuous. But he wasn’t worried for nothing: such a limit has to be handled with care. We’ll find out exactly where the series converges and to what. But first let’s work out where the coefficients $\frac{4}{\pi}$, $\frac{4}{3\pi}$, $\frac{4}{5\pi}$ come from.
Why the tracks don’t interfere
We’ve already solved a similar problem for arrows. In the chapter on vectors the projection of a vector onto a unit axis was a dot product. If the axes $\vec e_1$ and $\vec e_2$ are perpendicular and $\vec a = a_1\vec e_1 + a_2\vec e_2$, then $\vec a \cdot \vec e_1 = a_1$: the second term drops out because $\vec e_2 \cdot \vec e_1 = 0$. A coordinate can be found without solving any equations: you only need to take the dot product with the axis.
Let’s do the same with functions. A vector has a few coordinates; a function has as many “coordinates” as there are points $x$, and the sum of products of coordinates turns into the integral of a product.
Functions $f$ and $g$ are called orthogonal if $\langle f, g\rangle = 0$. The word means “perpendicular”: for functions it’s not a picture but an equation, but it works just as it does for arrows.
For integers $m, n \ge 0$
$$\int_{-\pi}^{\pi}\sin mx\sin nx\,dx = \int_{-\pi}^{\pi}\cos mx\cos nx\,dx = 0 \quad (m \ne n), \qquad \int_{-\pi}^{\pi}\sin mx\cos nx\,dx = 0,$$
and for $m = n \ge 1$ both of the first integrals equal $\pi$ (and $\int_{-\pi}^{\pi}1\,dx = 2\pi$). In other words, the functions $1, \cos x, \sin x, \cos 2x, \sin 2x, \dots$ are pairwise orthogonal.
The trick is to turn a product of sine waves into a sum: the areas under the terms can be computed separately.
The same argument about areas gives a useful rule about symmetry. A signal is called even if $f(-x) = f(x)$, like $|x|$, and odd if $f(-x) = -f(x)$, like the square wave.
If $f$ is odd, then $\langle f, \cos nx\rangle = 0$ for all $n$: its expansion has no cosines and no constant. If $f$ is even, then $\langle f, \sin nx\rangle = 0$: its expansion has no sines.
The idea: the product of an odd function and an even one is odd, and for an odd function the areas to the left and right of zero cancel out.
Splitting into tracks
Now the coefficients are found the same way as the coordinates of a vector. Let $f = \frac{a_0}{2} + \sum_k (a_k\cos kx + b_k\sin kx)$. Take the dot product with $\cos nx$: all the terms but one are orthogonal to this “probe” and drop out, and the remaining one gives $a_n\langle \cos nx, \cos nx\rangle = \pi a_n$. For $n = 0$ the probe is one: $\langle f, 1\rangle = \frac{a_0}{2}\cdot 2\pi = \pi a_0$. That’s why the constant is written with a half: the formula for $a_0$ becomes the same as for the others.
A question of honesty remains: can an infinite sum be multiplied by $\cos nx$ and integrated term by term, like a finite one? Not always. This needs uniform convergence: the remainder of the series after the $N$th term must be small on the whole interval at once, not at each point separately.
Let the series $\frac{a_0}{2} + \sum_{k=1}^{\infty}(a_k\cos kx + b_k\sin kx)$ converge to a function $f$ uniformly on $[-\pi, \pi]$, that is, for any $\varepsilon > 0$ there’s an $N_0$ after which the partial sums $S_N$ differ from $f$ by less than $\varepsilon$ at all points at once. Then for all $n \ge 0$
$$a_n = \frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos nx\,dx, \qquad b_n = \frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin nx\,dx.$$
We’ll find a coordinate as for a vector: take the dot product with the axis. Uniformity will do the work of swapping the sum and the integral.
The formulas can be applied to any integrable function, even without knowing in advance whether anything converges. That’s how the main object of the chapter is defined.
The numbers $a_n = \frac{1}{\pi}\langle f, \cos nx\rangle$ and $b_n = \frac{1}{\pi}\langle f, \sin nx\rangle$ are called the Fourier coefficients of a function $f$ with period $2\pi$, and the series $\frac{a_0}{2} + \sum(a_n\cos nx + b_n\sin nx)$ with these coefficients is its Fourier series. Until convergence is proved, one writes not $f = \dots$ but $f \sim \dots$.
Find the coefficient $b_2$ of the function $f(x) = x$ on $(-\pi, \pi)$ (its periodic extension is the “sawtooth”).
By parts: $\int_{-\pi}^{\pi}x\sin nx\,dx = \Bigl[-\frac{x\cos nx}{n}\Bigr]_{-\pi}^{\pi} + \frac1n\int_{-\pi}^{\pi}\cos nx\,dx = -\frac{2\pi\cos n\pi}{n} + 0$. So $b_n = -\frac{2\cos n\pi}{n} = \frac{2(-1)^{n+1}}{n}$, and $b_2 = -1$. The whole series: $x \sim 2\bigl(\sin x - \frac{\sin 2x}{2} + \frac{\sin 3x}{3} - \dots\bigr)$.
Find $a_1$ for $f(x) = |x|$ on $[-\pi, \pi]$. The answer can be written in terms of $\pi$, for example 4/pi.
The function is even, so $a_n = \frac{2}{\pi}\int_0^{\pi}x\cos nx\,dx = \frac{2}{\pi}\Bigl[\frac{x\sin nx}{n} + \frac{\cos nx}{n^2}\Bigr]_0^{\pi} = \frac{2\bigl((-1)^n - 1\bigr)}{\pi n^2}$. At $n = 1$ we get $a_1 = -\frac{4}{\pi} \approx -1.273$. For even $n$ the coefficients are zero, and the odd ones fall off as $\frac{1}{n^2}$, faster than for the square wave: the “triangle” $|x|$ has no jumps, only corners.
The last observation is worth remembering: the smoother the signal, the faster its coefficients fall off. A jump gives $\frac1n$, a corner $\frac{1}{n^2}$. The reason is integration by parts: each time the signal’s smoothness lets you move a derivative onto it, an extra factor $\frac1n$ appears in the coefficient. That’s why in the ring from the earlier section the sharp corners vanished first: they’re held up by high harmonics, and those fade as $e^{-n^2t}$.
You can compute coefficients for piecewise-defined functions, look at partial sums and at the rotating vectors of the harmonics in the Fourier series visualiser, which also has standard textbook problems.
When the series converges to the signal
Any integrable function has coefficients, but that doesn’t yet mean the series converges, let alone to the function itself. Fourier was sure it always did; Lagrange had doubts. The first to honestly prove convergence for a wide class of functions was Peter Gustav Lejeune Dirichlet, in 1829.
A function with period $2\pi$ is called piecewise smooth if its period can be split into finitely many parts, inside each of which it’s continuously differentiable, with the function and its derivative having finite limits at the ends of the parts. The limits at the point $x$ from the right and from the left are written $f(x + 0)$ and $f(x - 0)$.
The square wave, the “sawtooth”, the “triangle” and any signal drawn with line segments and arcs are piecewise smooth. The proof will need a lemma about fast oscillations: if you multiply a function by a very rapid sine wave, the area under the product almost disappears.
If a function $g$ is piecewise continuous on the interval $[a, b]$, then $\int_a^b g(t)\sin\lambda t\,dt \to 0$ as $\lambda \to \infty$. The same holds for $\cos\lambda t$.
The trick is first to prove the lemma for a step function, where everything is visible, and then to approximate any function by steps.
If a function $f$ with period $2\pi$ is piecewise smooth, its Fourier series converges at every point $x$, and its sum equals $\frac{f(x - 0) + f(x + 0)}{2}$, the average of the limits from the left and from the right. At points where $f$ is continuous this is simply $f(x)$.
The idea: write the partial sum as an average of the signal with a weight that gathers near zero as $N$ grows. The contribution of everything away from zero is killed by the Riemann–Lebesgue lemma.
Dirichlet’s theorem pays off straight away. Expand $f(x) = x^2$ on $[-\pi, \pi]$. The function is even, so there are no sines; integrating by parts twice, we get $a_0 = \frac{2\pi^2}{3}$ and $a_n = \frac{4(-1)^n}{n^2}$:
$$x^2 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty}\frac{(-1)^n\cos nx}{n^2}.$$
The periodic extension of the parabola is continuous, including at the point $x = \pi$, where neighbouring arcs meet at height $\pi^2$. There $\cos n\pi = (-1)^n$, and by Dirichlet’s theorem $\pi^2 = \frac{\pi^2}{3} + 4\sum\frac{1}{n^2}$. Hence $\sum_{n=1}^{\infty}\frac{1}{n^2} = \frac{\pi^2}{6}$: the answer to the Basel problem, which Euler struggled with in the chapter on series, in two lines.
What does the Fourier series of the square wave converge to at the point $x = 0$?
All the sines are zero at zero, so each partial sum equals $0$. This agrees with Dirichlet’s theorem: $\frac{f(0 - 0) + f(0 + 0)}{2} = \frac{-1 + 1}{2} = 0$, the middle of the jump.
Ringing at the edge of a step
Look at the partial sums of the square wave near the jump. Each one overshoots the level one, then dives below it and oscillates like a string after it’s plucked. You might think the overshoot disappears as $N$ grows. It doesn’t: it gets ever narrower and hugs the jump, but its height doesn’t drop below $1.179$.
This overshoot of the partial sums of a Fourier series at a jump, which never goes away, is called the Gibbs phenomenon.
Let $S_M(x) = \frac{4}{\pi}\sum_{j=1}^{M}\frac{\sin(2j - 1)x}{2j - 1}$ be the partial sum of the square wave series with $M$ harmonics. Its first maximum to the right of zero is at the point $x = \frac{\pi}{2M}$, and its height tends to $\frac{2}{\pi}\int_0^{\pi}\frac{\sin t}{t}\,dt \approx 1.1790$ as $M \to \infty$. The overshoot above the level $1$ is about $0.179$, that is, $8.95\,\%$ of the jump height $2$.
The trick is to stretch the picture at the jump by a factor of $2M$. On the new scale the height of the first peak turns out to be a sum of rectangles under the curve $\frac{\sin t}{t}$.
There’s no contradiction with Dirichlet’s theorem. It speaks about each point separately: for a fixed $x > 0$ the peak will sooner or later slip to the left of $x$, and after that $S_M(x)$ will calmly approach one. But the convergence isn’t uniform: near the jump there’s always a point where the partial sum is off by almost $0.18$. It couldn’t be otherwise: a uniform limit of continuous functions is continuous, and the square wave isn’t.
The overshoot can be removed if the series isn’t cut off abruptly. In 1900 Lipót Fejér proposed taking the arithmetic mean of the partial sums, $\sigma_N = \frac{S_0 + S_1 + \dots + S_{N-1}}{N}$. In it the $k$th harmonic enters with weight $1 - \frac{k}{N}$, that is, high harmonics are muted smoothly. Switch on the Fejér means in the magnifier: there are no ripples, and the step is slightly blurred. Why there’s no overshoot at all is shown by the kernel.
If $A \le f \le B$ over the whole period, then $A \le \sigma_N(x) \le B$ for all $x$ and $N$ as well.
By the first step of the proof of Dirichlet’s theorem $S_k(x) = \frac{1}{\pi}\int_{-\pi}^{\pi}f(x + t)D_k(t)\,dt$, so $\sigma_N(x) = \frac{1}{\pi}\int_{-\pi}^{\pi}f(x + t)F_N(t)\,dt$, where $F_N = \frac{D_0 + \dots + D_{N-1}}{N}$ is the Fejér kernel. Let’s find it. From $D_k(t) = \frac{\sin(k + \frac12)t}{2\sin\frac t2}$ and the identity $2\sin\frac t2\sin\bigl(k + \frac12\bigr)t = \cos kt - \cos(k + 1)t$, the sum over $k$ from $0$ to $N - 1$ folds up into $1 - \cos Nt = 2\sin^2\frac{Nt}{2}$. So $F_N(t) = \frac{1}{2N}\Bigl(\frac{\sin(Nt/2)}{\sin(t/2)}\Bigr)^2 \ge 0$. Besides, $\frac1\pi\int_{-\pi}^{\pi}D_k\,dt = 1$ for each $k$, so $\frac1\pi\int_{-\pi}^{\pi}F_N\,dt = 1$ as well. The upshot: $\sigma_N(x)$ is an average of the values of $f$ with a non-negative weight of total mass one. From $A \le f(x + t) \le B$, multiplying by $F_N(t) \ge 0$ and integrating, we get $A \le \sigma_N(x) \le B$. With the Dirichlet kernel this doesn’t work: it has negative waves, and through them the partial sum overshoots the level of the signal.
Gibbs ringing is familiar to anyone who has seen over-compressed JPEG images: ripples appear around black letters on a white background. These are the discarded high harmonics, and we’ll come back to them.
Circles on circles
The formulas get shorter if we recall Euler’s formula from the chapter on the number $e$: $e^{i\varphi} = \cos\varphi + i\sin\varphi$. Then $\cos nx = \frac{e^{inx} + e^{-inx}}{2}$ and $\sin nx = \frac{e^{inx} - e^{-inx}}{2i}$, and the pair “cosine plus sine” turns into a pair of rotations with frequencies $n$ and $-n$.
The formula also works for a closed curve in the plane: a point $z(x) = X(x) + iY(x)$ that goes round the curve in time $2\pi$ is a complex-valued function with period $2\pi$. Its Fourier series is a chain of rotating circles: the centre of each sits on the rim of the one before, and each spins at its own whole-number frequency. Astronomers knew such chains a millennium and a half before Fourier. In Ptolemy’s Almagest (around 150 AD) a planet moves on a small circle, the epicycle, whose centre moves on a large circle, the deferent. This explained retrograde motion: from time to time Mars stops in the sky and loops backwards.
Look at the “Mars from Earth” sample. Mars goes round the Sun in an almost circular orbit of radius $1.52$ astronomical units, the Earth in one of radius $1$, and in 15 years the Earth makes 15 turns and Mars almost exactly 8. The position of Mars relative to the Earth is the difference of two rotations, $z(t) = 1.52\,e^{8it} - e^{15it}$: a Fourier series with two terms. Ptolemy’s deferent is the orbit of Mars itself, and the epicycle the Earth’s orbit turned inside out. That’s why, in the simplest version of the model, the epicycle of an outer planet goes round in exactly a year. Ptolemy’s real model is more complicated: the centre of the deferent is offset, and the uniformity of the motion is measured from a special point, the equant. But in one respect the widget is honest: circles on circles can draw anything at all, even the profile of an elephant, so a good match with observations explains nothing by itself. The explanation came with Kepler’s ellipses (1609) and Newton’s law of gravitation.
The digital mixing desk
In a computer, sound is stored not as a formula but as samples: on a CD, 44,100 values a second. The integral in the formula for $c_n$ is then replaced by a sum over the samples, and we get the discrete transform.
The discrete Fourier transform (DFT) turns $N$ samples $x_0, \dots, x_{N-1}$ into $N$ complex numbers $X_0, \dots, X_{N-1}$ by the formula below.
Remarkably, the discrete transform can be inverted exactly, with no questions about convergence at all. At its heart are the roots of unity from the chapter on complex numbers. Write $\omega = e^{2\pi i/N}$.
For an integer $d$ the sum $1 + \omega^d + \omega^{2d} + \dots + \omega^{(N-1)d}$ equals $N$ if $d$ is divisible by $N$, and zero otherwise.
The idea: add up the terms as arrows, placing each at the end of the one before, and see that the chain closes up.
The samples are recovered from the transform: $x_n = \frac{1}{N}\sum_{k=0}^{N-1}X_k\,\omega^{kn}$.
Substitute the definition $X_k = \sum_m x_m\omega^{-km}$ and swap the order of the two finite sums: $\frac1N\sum_k X_k\omega^{kn} = \frac1N\sum_m x_m\sum_k\omega^{k(n - m)}$. By the lemma the inner sum equals $N$ for $m = n$ (the difference $n - m$ lies between $-(N-1)$ and $N - 1$ and is divisible by $N$ only when it’s zero) and zero for the other $m$. What’s left is $\frac1N\cdot x_n\cdot N = x_n$.
Computing the DFT from the definition is expensive: $N$ numbers, each with $N$ terms, $N^2$ multiplications in all. For $N = 1024$ that’s more than a million. In 1965 James Cooley and John Tukey published a method that came to be called the fast Fourier transform.
The fast Fourier transform (FFT) computes a DFT of length $N = 2^m$ in about $N\log_2 N$ operations instead of $N^2$.
Let $N$ be even, $E_k$ the DFT of the even samples $x_0, x_2, \dots$, and $O_k$ the DFT of the odd ones $x_1, x_3, \dots$ (both of length $\frac N2$). Then for $0 \le k < \frac N2$
$$X_k = E_k + \omega^{-k}O_k, \qquad X_{k + N/2} = E_k - \omega^{-k}O_k.$$
Split the sum for $X_k$ into terms with even indices $n = 2m$ and odd ones $n = 2m + 1$. The first give $\sum_m x_{2m}\omega^{-2km}$, the second $\omega^{-k}\sum_m x_{2m+1}\omega^{-2km}$, because $\omega^{-k(2m + 1)} = \omega^{-k}\cdot\omega^{-2km}$. The number $\omega^2 = e^{2\pi i/(N/2)}$ is an $\frac N2$th root of unity, so both sums are DFTs of length $\frac N2$, that is, $E_k$ and $O_k$. They repeat with period $\frac N2$ in $k$, since $(\omega^2)^{N/2} = 1$. When $k$ is replaced by $k + \frac N2$ only the factor changes: $\omega^{-(k + N/2)} = -\omega^{-k}$, because $\omega^{N/2} = e^{i\pi} = -1$. Hence the second formula.
One DFT of length $N$ has been reduced to two of half the length plus $\frac N2$ multiplications by $\omega^{-k}$. Repeating until the length is one, we get $\log_2 N$ levels of $\frac N2$ multiplications each: for $N = 1024$ that’s $5120$ instead of $1{,}048{,}576$, two hundred times fewer. For $2^{20}$ samples, about 24 seconds of CD sound, the gain is more than a hundred-thousandfold. It later turned out that Gauss had devised the same trick around 1805, when he was calculating the orbits of the asteroids Pallas and Juno. He didn’t publish the note in his lifetime; it was printed in his collected works in 1866 and appreciated only in the 1980s.
Almost all digital signal processing rests on the fast Fourier transform and its relatives. The equaliser in a music player multiplies each frequency component by its own factor: turning up the bass means boosting the low frequencies. The JPEG format (a 1992 standard) divides a picture into $8 \times 8$ squares of pixels and expands each in cosines. This is the discrete cosine transform, proposed by Nasir Ahmed, T. Natarajan and K. R. Rao in 1974. The eye is poor at noticing high harmonics, so they’re stored coarsely or thrown away: hence the ringing at sharp edges. The MP3 format (a 1993 standard) does the same with sound: it breaks it down by frequency and throws away what’s masked by louder neighbouring frequencies and so can’t be heard anyway.
The mixdown
One last job remains in the studio: getting your hand in. On the first level of the trainer the coefficients are read straight off a trigonometric polynomial or guessed from the function’s parity; on the second, the polynomial first has to be obtained from products and powers of sines; on the third, the coefficients are computed by the formulas for the “sawtooth”, the “triangle”, the parabola and the square wave.
Where next
The complex form has made everything simpler. Instead of two formulas for $a_n$ and $b_n$ there’s one for $c_n$, instead of pairs of “cosine and sine” there are rotating circles, and differentiating a harmonic has become very easy: $\bigl(e^{inx}\bigr)' = in\,e^{inx}$, the derivative just multiplies it by a number. What happens if the whole of calculus is carried over into the complex numbers, looking at functions whose argument and value are both complex, differentiating them and integrating them along curves in the plane? There we’ll also find the answer to an old riddle: why the Taylor series of the function $\frac{1}{1 + x^2}$, smooth on the whole line, converges only for $|x| < 1$. That’s the chapter on complex analysis.