Basis Lab

The Fourier Transform

One Signal, Two Descriptions

A recording can be written as a list of values in time order, or as a list of rhythms with an amount beside each. Both hold everything, and each makes a different question easy.

A microphone does one thing. It reports the air pressure in front of it, over and

over, at regular instants. A recording is that sequence of readings written down in

order, and nothing else. Play the list back through a loudspeaker and the sound

returns, so the list is complete.

It is also mute. A violin and a flute playing the same note produce two different

lists, and no inspection of either list says which instrument it was. The lists do

not come with the ingredients labelled, because the ingredients were added together

before the microphone ever saw them, and addition covers its tracks.

Adding rhythms hides the rhythms

Take three steady rhythms: a slow one, one three times as fast at a third of the

height, and one five times as fast at a fifth. Each one on its own is the simplest

repeating shape there is. Their sum is not.

FIG 1Three steady rhythms, and what they look like once they are added
-1.50-0.750.000.751.500.01.63.14.76.3time
the slow rhythm alonethree times as fast, a third as tallfive times as fast, a fifth as tallall three added together
The sum is the only one of these four a microphone would ever hand you. Its shape carries no visible mark of having three ingredients: the peaks are flattened, the slopes are steepened, and that is all. Nothing in it is labelled one third, and the number three appears nowhere. A reader given only the last curve and asked what it is made of has no way in that does not involve inventing this lesson.

The temptation is to look for the ingredients by eye, and it fails immediately. Two

quite different recipes can produce curves that look much the same, and one recipe

can produce a curve that looks like nothing at all. This is not a failure of

attention. Addition genuinely destroys the separation, and getting it back requires

an operation, not a closer look.

Where the rhythms come from

A steady rhythm is what a point does when it goes round a circle at a constant rate

and you watch only its height. That is worth taking seriously rather than treating

as a picture, because everything later in this course is easier in terms of turning

arrows than in terms of waves.

Here are two arrows, joined end to end. The first turns slowly. The second is

mounted on the tip of the first and turns three times as fast. The far tip traces a

path, and the height of that tip, plotted as it goes, is a sum of two rhythms.

FIG 2Two turning arms, and the sum they trace out
the axlethe far tip-1.5-1-0.500.511.5050100150200steps takenheight above the middle

the two arm lengths, squared and addedunder 0.001% of it gone by the end, at every setting of every slider

1

240 of 240 steps

height of the far tipheight of the slow arm's tip alone
stepped by
a → cos(0.06)*a - sin(0.06)*b b → sin(0.06)*a + cos(0.06)*b c → cos(0.18)*c - sin(0.18)*d d → sin(0.18)*c + cos(0.18)*d
each rule reads
the state as it was when the step began
started at
a = 1.0, b = 0.0, c = m, d = 0.0
held steady
the two arm lengths, squared and added = a*a + b*b + c*c + d*d
drift
under 0.001% over the run, against 0.20% allowed
Neither arm ever changes length, which is the quantity the figure is checked against, and the checker confirms it does not move across the whole run. What changes is only where each arm is pointing. Set the fast arm to zero length and the height is a plain rhythm. Lengthen it and the same ripple appears on the trace as in the figure above, and the tip's path turns into a loop with a loop in it. The two descriptions of this machine are the trace on the right, which is what a microphone would record, and the two arm lengths, which is the whole recipe in two numbers.

Everything in the rest of the course is this picture with more arms. A signal is

claimed to be a sum of turning arms of different rates, and the job of the transform

is to report how long each arm is and where it was pointing when the clock started.

The second description holds everything

The reasonable suspicion at this point is that describing a signal by its rhythms

must be a summary, and that summaries lose things. It is worth killing that

suspicion early, because it is wrong in a specific way that matters.

Count. A recording of a thousand readings is a thousand numbers. The description in

terms of rhythms, done properly, is also a thousand numbers, and the thousand

readings can be rebuilt from them exactly, to the last digit. No approximation is

involved and no detail has been dropped. The conversion is a change of description,

not a compression.

FIG 3A signal written as a sum of rhythms
the reading taken at instant n, which is the first description: the list the microphone produced
how much of the rhythm that completes k whole cycles across the record is present
where in its cycle that rhythm was when the record began, which the next two lessons show is as necessary as the amount
how many readings there are, which also fixes how many distinct rhythms there is room for
Read right to left this builds the signal from its ingredients, and read as a question it asks for the amounts and the starting positions. The lesson after next derives how to find them. Note the count: N readings on the left, and on the right a pair of numbers for each of N rhythms, which looks like twice too many. It is not, and sorting out why is most of the work of the fourth lesson.

Which description to ask in

Neither description is the true one. They make different questions easy, and the

split between them is sharp enough to be useful as a rule of thumb.

Ask where in this hour of recording the door slammed. In the first description this

is a matter of looking for the large numbers, and it takes one pass. In the second

it is close to hopeless, because a bang lasts no time at all and therefore contains

a little of every rhythm, so it appears as a faint contribution spread over the

whole spectrum with nothing to say about when it happened.

Now ask which note is being held. In the second description the answer is the

largest entry, read directly. In the first it requires counting peaks and hoping the

signal is clean, which it never is.

FIG 4Where the energy sits in a recording of one played note
Illustrative of the shape a bowed string gives rather than a measurement of any one instrument. The point is that this picture exists at all. It is five numbers, it says what the sound is made of, and it is what the second description hands you directly. The same information is present in the recording, in the sense that it can be computed from it, and is visible nowhere in it. Changing the five numbers while keeping the lowest one fixed changes the instrument and not the note.

The two descriptions are not rivals, then, and the question of which is correct does

not arise. The transform is worth the trouble because real work asks both kinds of

question about the same signal, and converting between the descriptions turns out to

be cheap enough to do constantly.

That cheapness is not obvious and was not always true. It is the subject of the last

lesson, and for the twenty years before that lesson's algorithm was published, the

second description was understood perfectly well and used very little.

Recap

  • A signal measured at regular instants is a list of numbers. Nothing in that list says what the signal is made of, because adding steady rhythms together destroys every visible trace of the rhythms that went in.
  • The second description lists how much of each steady rhythm the signal contains. It is not a summary and it throws nothing away: it has exactly as many numbers in it as the recording did, and the recording can be rebuilt from it exactly.
  • Which description to use is decided by the question. Where something happened is easy in the first and painful in the second; what something is made of, and what a filter will do to it, are easy in the second and painful in the first.

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

NextAsking a Signal How Much of One Rhythm It Holds →

The rest of this course

  1. 01One Signal, Two Descriptionsyou are here
  2. 02Asking a Signal How Much of One Rhythm It Holdsopening only
  3. 03Two Numbers for Every Rhythmopening only
  4. 04The Transform of a Finite Listopening only
  5. 05Sliding Becomes Multiplyingopening only
  6. 06What Was Lost Before You Startedopening only
  7. 07The Price of Looking for a Finite Timeopening only
  8. 08The Algorithm That Made It Practicalopening only

Read alongside