Interactive course · about 2 hours 30

Filters

Take three numbers in a row, add them up, divide by three, and write the answer down. Do that all the way along a list of measurements and you have removed most of the wobble from it. That is a filter. Everything else in this course is the same operation wearing different clothes. The equaliser on a music player is one. So is the thing that pulls a heartbeat out of a chest strap, and the part of a radio that hears one station and not its neighbour. What changes between them is only which numbers get multiplied by what before they are added. By the end you will have measured what your own filters do to every frequency, one sine at a time, and made one of them run away and never stop.

How this works

Every number on these pages is worked out while you watch, from the same small piece of arithmetic underneath the whole course. The frequency curves matter most here. None of them is drawn from a formula. Each point is one pure wave that was built, pushed through the filter, and measured on the way out. That is exactly the experiment you do by hand in Step 6. A curve that came from an equation would agree with a broken filter as happily as with a working one.

What you need to know first

Adding, dividing, and the idea that a letter can stand for a number. It also helps to have done Sound and Signals, the course before this one. That is where a wave becomes a list of numbers, and where the limit on how fast a wiggle can be comes from. If you have not, only one thing carries over. It is said again here. A list sampled a thousand times a second cannot hold anything faster than five hundred cycles a second. That is why five hundred is where every frequency axis on these pages stops.

The steps

Step 1

Average three numbers with a pencil

A thermometer wired to a small computer, reading once a second. What comes back is a signal: a list of numbers, one per moment, in the order they were measured. Each number is a sample. The room is warming up gently, so the list should climb gently, and it does not quite. Every reading is the truth plus a small amount of rubbish, different each time. That rubbish is called noise.

Anyone handed that list invents the same fix within a minute. Instead of writing down each reading on its own, replace it by the average of it and the reading on either side. Three numbers, added up, divided by three. Slide that three-wide window along the list and do it again at every position. The result is called a moving average.

That is a filter: a rule that turns one list of numbers into another list of numbers. The name is borrowed from the kitchen, and the borrowing is fair. A sieve keeps the stones and passes the sand, sorting by size. This filter keeps the slow climb and passes on much less of the fast wobble, sorting by speed of change. The difference is what it is made of. A sieve is mesh; this is arithmetic. The whole of the rest of this course is the same operation with the three numbers multiplied by something other than a third each.

What exactly is a sample, and why is the list not just a curve?

The thermometer does not report continuously. Something asks it for a number, on a clock, at a steady rate, and each answer is a sample. In this course that clock ticks a thousand times a second, so a sample lasts a millisecond and a list of a thousand numbers is one second of measurement. Between two samples there is nothing recorded at all.

That is why charts here are sometimes drawn as separate sticks rather than as a line. A line says something about what happened between two samples, and nothing did. The course before this one, Sound and Signals, is where the sampling itself gets taken apart.

Why does averaging cancel the wobble but keep the shape?

Because they behave differently across three neighbouring samples. The shape underneath is nearly the same in all three, so averaging three copies of nearly the same number gives you that number back. The wobble is a fresh accident at every sample, as likely to be above as below, so adding three of them together makes them partly cancel each other.

Partly, and not completely. Three numbers pointing in random directions do not add to zero, they add to something smaller than any one of them was likely to be. That is why the second lab reports a wobble that is smaller rather than gone, and why the number it reports is worth reading.

What happens at the very first sample, where there is no neighbour before it?

Something has to be assumed, and every choice is a little bit wrong. This course assumes that everything before the start of the list was zero, which is what a real filter sees when it is switched on with nothing behind it. The first few outputs are therefore too small, because they are averaging real readings with imaginary zeros.

The alternatives are to repeat the first sample backwards, to reflect the start of the list, or to refuse to produce an output until the window is full. Audio software argues about this and picture software argues about it more, because the edge of a photograph is where you can see the choice. It is worth knowing that the first few numbers out of any filter are not to be trusted.

Lab 1 · One output number, by hand
Try this firstThree readings are boxed in the top row. Add them up in your head, divide by three, and press the button with your answer. Then press Move the window right and do the next one. Get three or four right before you press Do the whole row for me.
Nothing was hidden from you there. Every number in the output row is three readings added up and divided by three, and you did some of them yourself. Hold on to that, because in two steps' time the same operation will be called convolution and will look like something you would need a textbook for.

Twelve numbers is enough to see the arithmetic and too few to see the effect. The next lab runs the same rule down a list of two hundred and forty, against a shape you are allowed to see behind the noise. That is a luxury no real measurement ever gives you.

Lab 2 · The same rule down a longer list
Try this firstPress The readings as they arrived and read the wobble before pill, then press Average every three and read the wobble after pill. Watch the tall narrow peak in the right-hand half of the chart while you switch between the two.
The wobble shrank by a real, measured factor, and the peak paid a little. Both numbers are printed because both matter. A filter that removes noise is only useful if what is left is still the thing you were trying to measure. The next step is about how quickly that stops being true.
A scale in a factory reports the weight on a conveyor a hundred times a second, and the readings jump about by a few grams. An engineer replaces every reading with the average of it and its two neighbours. A crate lands on the belt at some moment. What does the output do?
The jump gets blurred over three samples. While the window straddles the moment the crate landed, it is averaging some readings from before with some from after, so the output climbs in stages. That is the trade in miniature: the wobble comes down because it differs between neighbours, and the sudden change gets smeared for exactly the same reason.
Step 2

Widen the window until the peak disappears

Three was an arbitrary choice. Nothing stops you averaging five, or nine, or forty-one, and the more you average the smoother the answer gets. So the obvious question is why anybody stops.

Three things move together when the window widens, and only one of them is what you wanted. The wobble gets smaller, which is the point. The output starts describing a moment that has already gone, because an average of forty-one samples is centred half a window back: that delay is called lag. And any feature narrower than the window gets flattened, because the window cannot tell the difference between a genuine narrow peak and a run of bad luck.

The signal in this lab has a broad hump and a narrow one. Watch the narrow one.

Why does a longer window make the answer arrive later?

Because it is an average of a stretch of time, and the honest label for an average is the middle of that stretch. A forty-one sample average taken at the newest sample is really a statement about twenty samples ago, with the newest twenty and the oldest twenty either side of it.

The lab measures the lag rather than working it out: it slides the output backwards over the input and reports the shift that lines the two up best. That is worth knowing as a technique. Sliding one list over another until it fits is how a radio finds the start of a packet and how a sonar finds an echo.

How can the chart show the shape underneath if nobody can see through noise?

Because this signal was built rather than measured. The shape was written down first, the noise was added on top, and both are kept. So the chart can draw the answer faintly behind the working. The lab can also measure the damage exactly. It feeds the clean shape through the same filter on its own, and compares the two outputs.

A real measurement never offers that. It is why filters get argued about: without the answer to compare against, two people can disagree for ever about whether a bump was real. Anything you learn here about what a window costs is worth carrying to the case where you cannot check.

Is there a best window length?

Only once somebody says what the signal is for. If the narrow peak in this lab is the event you are hunting, any window wide enough to flatten it has failed however clean the line looks. If the narrow peak is a fault in the sensor, the same window has succeeded.

What can be said without knowing the purpose is the shape of the trade. Averaging a window of forty-one takes the wobble down by roughly the square root of forty-one, which is a bit over six. The lag grows straight in proportion to the window. So doubling the window buys about forty per cent less noise and costs exactly twice the delay, and the returns get worse the further you push it.

Lab 3 · The window as a dial
Try this firstDrag window length, samples from 1 up to 41 one notch at a time, and watch the three pills underneath. Stop when the pill reading narrow peak keeps first drops below half, and look at what the chart has done to the tall peak by then.
The dial has no good setting, only a chosen one. A short window leaves the noise, a long one arrives late and eats the peak, and no length gives you all three. Notice that the two ends of the dial are not equally honest. At the wide end the line looks better than the data is, which is the more dangerous of the two mistakes.
A heart rate monitor averages the last five hundred samples of its electrical signal to get rid of mains hum. The trace comes out perfectly smooth and the beat detector stops working. What has most likely happened?
The window is wider than the thing being looked for. A beat is a sharp spike a handful of samples long. Averaging five hundred samples spreads that spike across five hundred outputs, so nothing that is left looks like a beat. The clean trace is the clue and not the consolation: it looks better than the data because the interesting part has been thrown away with the hum.
Step 3

Write the same averaging out as a list of weights

Adding three numbers and dividing by three is the same as multiplying each by a third and adding the results. Written that way, the filter is a short list of numbers of its own: a third, a third, a third. Those are its weights. Each weight is also called a tap, a name left over from the electronics this came from. There, you tapped a wire onto a delay line to get at an older sample.

Once it is a list, the thirds are only one choice out of infinitely many. Make the middle one bigger and the filter leans towards the present. Make one of them negative and something quite different happens, which is Step 5. The operation of sliding a list of weights along a signal, multiplying and adding, has a name: convolution.

There is one wrinkle in that name and it is worth getting straight now rather than being ambushed by it later. When the weights are laid over the signal, they go on backwards. Weight number 0 multiplies the newest sample, weight number 1 multiplies the one before it, and so on into the past. Lay them on forwards instead and you get a different answer, unless the weight list happens to read the same in both directions.

Why call it a tap?

From the hardware. The first filters of this kind were built as a chain of stores. Each store held the signal one sample later than the one before it, so a sample walked down the chain one step per tick. To get at the sample from three ticks ago you attached a wire at the third store along. Attaching a wire at a point in a line is called tapping it.

The chain is gone and the word stayed. A filter with forty-one taps is one with forty-one weights, needing forty-one multiplications for every output sample it produces, and Step 9 is about how much that costs.

Why would anyone define it backwards? It sounds like a mistake.

It is not a convention somebody chose to be awkward. It falls out of what the operation actually is, and Step 4 shows that directly. Every input sample drops a scaled copy of the weight list into the output. Adding those copies up puts the weights on backwards, without anybody having decided anything.

For now the useful thing is to know that both orderings are used and have different names. Sliding the weights on forwards is called correlation, and it is what you want when you are hunting for a shape in a signal. Sliding them on backwards is convolution. It is what a filter does.

What if the weights add up to something other than one?

Then a steady input does not come out at the height it went in at. Weights adding to two double everything flat, weights adding to a half halve it, and weights adding to zero cancel a steady input completely. None of those is wrong, but only one of them is an average.

This is a real trap in picture editing, where a blur whose weights add to 1.05 makes the whole photograph slowly brighter every time it is applied. It is why filter weights are usually normalised, meaning divided by their own total, before anybody uses them. The lab measures the total by running a flat input through rather than by adding the sliders up, so you can see the two agree.

Lab 4 · Three weights you choose
Try this firstPress Average the three, then drag weight 1 up on its own and watch the line get spikier. Then press Subtract the neighbour and read the pill saying what a flat input of 1 comes out at.
The sum of the weights is the whole story for a flat input. The pill that reports it is not adding the sliders up: it puts a steady input of 1 through the filter and reads what comes out the far end. These methods agree for this linear, time-invariant filter. Step 10 introduces a system where the shortcut no longer applies.
Lab 5 · The flip, one position at a time
Try this firstWith the lopsided weights selected, drag position n and read the two rows labelled backwards and forwards. They are the same three inputs and the same three weights, paired up in opposite orders. Then press Weights 0.25, 0.5, 0.25 and read the pill for the biggest gap anywhere.
Symmetric weights hide the flip completely. The gap between the two orderings measures exactly zero, because reversing a list that reads the same both ways changes nothing. Nearly every filter anyone writes first is symmetric, which is why people can use convolution for years without meeting the flip and then be badly confused by it once.
Two people write filtering code from the same description. One multiplies the newest sample by the first weight, the other by the last. Their weights are 0.25, 0.5, 0.25. Whose output is different?
They agree, and that is the problem. A symmetric weight list is its own reverse, so both programs give identical answers and both authors go away confident. The disagreement surfaces later, on the first lopsided filter either of them writes, usually a long way from the code that caused it. This is why it is worth pinning down which end is which while the example is three numbers long.
Step 4

Send in a single 1 and read the weights back out

Here is the cheapest possible experiment on a filter you know nothing about. Feed it silence, then one single 1, then silence again. That input has a name: an impulse. What comes out is called the impulse response.

For a filter made of weights, the impulse response is the weight list, written out in order. While the 1 sits under weight 0 the output is weight 0. One sample later the 1 has moved under weight 1, so the output is weight 1. The filter reads itself out.

That is more than a party trick, because any input at all is a pile of spikes of different sizes, one per sample. Each of those spikes drops its own scaled copy of the impulse response into the output, and the output is those copies added up. So the impulse response does not describe the filter. It is the filter.

How can a list of numbers I already knew tell me anything new?

Because you usually do not know it. A filter arrives as somebody else's code, or as a circuit, or as a room with a clap echoing round it. The impulse response is how you find out what it does without being shown the inside. This is a standard measurement: fire a starting pistol in a concert hall, record what comes back. You have the hall as a list of numbers.

Once you have that list you can apply the same room to a recording made in a dry studio, by convolving one with the other. That is what reverb plug-ins labelled convolution are doing, and the impulse responses they ship are real recordings of real halls.

What does FIR stand for?

Finite impulse response. Every filter in this course so far is one. The impulse response is the weight list, and the weight list has an end, so the response goes to exactly zero once the spike has walked off that end. Finite means it stops.

The word finite is only worth saying because the other kind exists. From Step 10 the output of the filter is fed back into it, and its impulse response never quite reaches zero. That one is called infinite impulse response, which is the reason anybody bothers to say finite about this one.

Does one spike really tell you everything, even about a filter you did not build?

It does, provided the filter obeys two rules. Doubling the input must double the output, and putting in the sum of two signals must give the sum of what each would have given on its own. Together those are called linearity, and every filter in this course has them because all it ever does is multiply by fixed numbers and add.

Plenty of real things break those rules. A guitar distortion pedal is meant to: turn the input up and the output does not simply get louder, it changes shape. For anything like that the impulse response tells you about the one impulse you sent and nothing else, and a different approach is needed.

Lab 6 · A single spike, and then two
Try this firstDrag any of the five weight sliders and watch the lower stick chart copy it exactly. The panel underneath prints both lists and the biggest gap between them. Then press Send in two spikes and find where the second copy starts.
Two spikes give two copies, and where they overlap they add. That is the whole of convolution in one picture, and it is where the backwards ordering from Step 3 comes from. At any output position, the copy left by the newest input sample is showing its weight 0. The copy left by the sample before it has moved along one, so it is showing its weight 1. And so on backwards into the past.
Lab 7 · Name the filter from its impulse response
Try this firstLook at Filter A's sticks and press the description you think fits before you read anything else. The verdict then checks your answer by running a slow sine and a fast sine through and reporting both heights. Do all three.
Filter C is the awkward one. A single 1 sitting several places along changes nothing about any wave except when it arrives. Both test sines come out at full height, so the filter is invisible to the test. Being late is a real thing a filter can do, and it will matter enough by Step 12 to get a lab of its own.
You are handed a filter as a sealed piece of code and told nothing about it. You feed in one 1 surrounded by zeros and get back 0.4, 0.3, 0.2, 0.1 and then zeros for ever. What can you say about what it will do to a recording of an orchestra?
Those four numbers are the entire filter. Whatever goes in, the output is one copy of 0.4, 0.3, 0.2, 0.1 per input sample, each scaled by that sample and started at that sample's position, all added together. Nothing else is going on inside. The sealed code has no secrets left, and you found that out with five numbers and no documentation.
Step 5

Subtract a neighbour instead of averaging it

Take the simplest average there is, two weights of a half each, and change one sign. Half of this sample minus half of the last one. Two numbers, one sign, and the filter does the opposite of what it did before.

The reason is the same argument as Step 1, run backwards. Two neighbouring samples of a slowly changing signal are nearly equal, so subtracting one from the other leaves almost nothing. Two neighbouring samples of a fast wiggle are on opposite sides of the wave, so subtracting doubles it. A filter that keeps the slow parts and blocks the fast ones is a low pass. One that does the reverse is a high pass. Slow and fast here mean the frequency, which is how many complete cycles of a wave fit into a second.

You have met a low pass without knowing its name. The thick wall between you and the party next door is one. The bass thuds through the wall as if it were not there, and the treble, all the hiss and sparkle at the top, is muffled to almost nothing. A wall passes low frequencies and blocks high ones: a low pass made of brick. This step builds the opposite instrument out of one minus sign; the two are exact mirrors of one another. The lab measures that rather than asserting it.

How fast can a fast wiggle even be, in a list of numbers?

There is a hard ceiling and it is worth knowing where it is. The fastest thing a sampled list can hold is a wave that goes up, down, up, down, one sample each way. At a thousand samples a second that is five hundred complete cycles a second, and nothing faster can exist in the list at all. This is why every frequency axis in this course stops at five hundred.

Anything faster than that, arriving at the sensor, does not get recorded as itself. It comes back as a slower wave that was never there, which is called aliasing and is the main event of the course before this one. Here it is enough to know that five hundred is the top of the scale.

Where would anyone actually want to throw away the slow part?

Wherever the slow part is the nuisance. A heart trace drifts up and down as the patient breathes and as the electrode gel dries out. That drift is far slower than any beat, so a high pass removes it and leaves the beats untouched. A microphone picks up rumble from traffic through the building, well below anything anyone is saying.

The same filter also shows up where nobody calls it a filter. Subtracting neighbouring pixels across a photograph leaves nothing on flat walls and something bright everywhere the brightness changes, which is edge detection. It is this step's arithmetic, applied sideways instead of forwards in time.

What about keeping the middle and throwing away both ends?

That is a band pass, and it is what a radio does to hear one station rather than the one next to it. There is also the opposite, a band stop, which is how a piece of equipment removes the fifty cycle hum of the mains and keeps everything either side of it.

Neither needs new machinery. A band pass is a low pass and a high pass applied one after the other, and that is still one list of weights. Running two weighted sums in a row can always be collapsed into a single longer weighted sum. Four names, one operation.

Lab 8 · Average, subtract, or leave alone
Try this firstPress Do nothing and read the two pills for the slow swell and the fast ripple. Now press Average the pair, then Subtract the pair, watching those same two pills each time. Only the signs of the weights changed between the last two.
The two filters have swapped the numbers between them. What the average keeps, the difference throws away, and the other way round. There is nothing special about averaging: it is one setting of the weights, and the neighbouring setting with a minus sign in it is a completely different instrument.
An accelerometer on a bridge reports a slow sag as the traffic loads it and a fast shiver from the wind. An engineer only cares about the shiver. Which weights should the readings go through?
0.5 and minus 0.5. The test to apply is whether the weights add to zero. If they do, anything steady cancels, and the slow sag is very nearly steady from one sample to the next. If they add to one, steady things pass at full height, which is what you want when the slow part is the signal and not the nuisance. Reading the sum of the weights first tells you which of the two kinds of filter you are holding.
Step 6

Put in one sine at a time and note the height that comes out

Fast and slow have been doing a lot of work in the last two steps without being pinned down. Here is how to pin them down, and it needs no theory at all. Build one pure wave at one frequency, meaning one number of complete cycles per second. Push it through the filter. Measure how tall the wave is that comes out, compared with how tall the one going in was. Write the pair down. Do it again at another frequency.

The height of a wave, measured from the middle to the top, is its amplitude. The output amplitude divided by the input amplitude is the gain at that frequency. A gain of 1.00 means the wave came through untouched, 0.50 means half of it survived, and 0.00 means it was wiped out. The whole set of those readings, one per frequency, is the filter's frequency response.

That is the entire method, and it is a measurement rather than a derivation. Nothing on this page looks up what a moving average does. It builds a sine, runs it, and reads the output.

Why sines? Why not test it with square waves or with music?

Because a sine is the one shape these filters cannot change. Put a sine in and what comes out is a sine at the same frequency, possibly shorter and possibly shifted along, but never a different shape. Nothing else has that property, so nothing else lets you describe the filter with two numbers per frequency.

Put a square wave in and the output is not a square wave, so there is no single height to write down. That does not make square waves useless: it makes them a mixture. Working out which sines a mixture is made of is the whole subject of the course after this one.

How do you measure the height of a wave that only exists at sample points?

Not by looking for the tallest sample, which is the obvious method and is wrong. At four hundred cycles a second there are only two and a half samples per cycle, so the samples land wherever they land and mostly miss the actual peak. The tallest one you can see understates the wave, sometimes badly.

What the page does instead is ask which wave of that exact frequency best matches the whole output, using every sample rather than the luckiest one. It also throws away the first stretch of each run. A filter that has just been switched on is still filling up with the signal, and has not settled into its answer yet.

Why does the curve not simply fall as the frequency goes up?

Because a five-sample average has frequencies it wipes out completely and frequencies in between where a little gets through. At two hundred cycles a second, exactly five samples span one whole cycle, so the window is averaging one complete cycle of the wave. One complete cycle of a sine adds to nothing. The output at that frequency is zero, and you can measure it.

Just above and below that, the window is averaging a bit more or a bit less than a whole cycle, so a small amount survives. Those small humps between the zeros are real, and they are called side lobes. They are the reason a plain moving average is a poor low pass however long you make it. Step 9 builds a better one.

Lab 9 · Measure it yourself, one sine at a time
Try this firstLeave the frequency at 60 Hz and press Run this sine through, then set it to 200 Hz and press it again. Compare the two rows in the table. Take four or five more readings of your own before you press Measure ten more for me.
Those points are not a picture of a formula. Each one is a sine that was built, run through the same five-sample average from Step 2, and measured. Notice that the curve does not slide smoothly to nothing. There are frequencies it kills stone dead, and small humps in between where some of the signal gets through after all.
You measure a filter at 100 Hz and get a gain of 0.71, then at 200 Hz and get 0.00. A colleague says the filter must therefore block everything above 200 Hz. What is wrong with that?
Nothing was measured above 200 Hz. The reading of 0.00 says the filter kills that one frequency, which is a hole in the curve rather than the start of a floor. The lab shows exactly this: the five-sample average has zeros at particular frequencies and small humps between them, and above 400 Hz its gain climbs back up again. A curve is a set of measurements, and the gaps between them are still gaps.
Step 7

The wall next door, drawn as a curve

Step 5 said a thick wall is a low pass. The bass of the party next door thuds through it; the hiss of the cymbals does not. Step 6 handed you the tool to say that precisely. Measure the wall one sine at a time and plot gain against frequency, and the whole character of the wall is one curve. It is high on the left, because slow waves get through nearly whole. It falls in the middle. It runs flat and low along the right, where almost nothing survives.

Every low pass ever measured has those three parts: a shelf, a fall, and a floor. The place where the shelf gives way to the fall is the curve's knee. That knee is the most useful single thing to know about a filter, because it says which frequencies this filter treats as slow and which as fast. It has a formal name and an exact address, and both arrive in the next step. For now it is a place on a picture, and in the lab you can take hold of it.

You have turned this handle before. The tone knobs on a speaker, the ones marked bass and treble, are filters like these. Turning the treble knob down drags a knee like this one to the left, and turning it back up drags the knee to the right. The lab gives you the knob and the curve at the same time, so you can watch what the knob has been doing all along.

Why does a wall pass the bass and block the treble?

Because a wall is heavy, and heavy things cannot shake quickly. A sound wave arriving at the wall is a push, then a pull, then a push. A slow wave pushes in the same direction for long enough to lean the whole wall a tiny distance. The moving wall then leans on the air in the next room. That is the bass getting through.

A fast wave reverses its push before the heavy wall has begun to move, so the wall simply never picks the wiggle up. The heavier the wall, the slower a wave has to be to move it, which is why a concrete wall has a lower knee than a plasterboard one. Same curve, different place.

Is the knee one exact point on the curve?

Not to the eye. The curve bends gradually, so the eye picks out a region where the shelf is clearly over and the fall has clearly begun. Two people looking at the same curve would point a finger at two slightly different places, and neither would be wrong.

Engineers need to write one number in a datasheet, so they agreed on a convention: a particular height on the curve counts as the official knee. The next step says what the height is and why that height was the one chosen. The picture comes first, because the number only makes sense as a place on this picture.

What do the bass and treble knobs actually change?

Inside the equaliser, the signal is split in two. One copy goes straight through. The other goes through a filter that keeps only the top of the band, a high pass like Step 5's. The knob sets how much of that filtered copy is added back before the speaker. Full treble adds it all, and cutting the treble adds none of it, or even subtracts some.

Mixing a filtered copy with the original is itself just another filter. Two weighted sums added together can always be written as one longer weighted sum, so the knob is choosing between weight lists, exactly as the lab's handle does. The bass knob is the same trick built on a low pass.

Lab 10 · Drag the knee
Try this firstDrag the marked knee left until the fast hiss pill falls below 0.10, watching the wave underneath lose its fuzz. Then press A thin wall, drag the knee back to the right, and compare how wide the fall is on the way down.
The knee is a setting, not a fact of nature. Every place you dragged it to was a different list of weights, built and measured on the spot. Notice what thinning the wall changed. Its fall is about six times as wide, and the flattened shelf even drags the measured knee a little low. The next two steps give that fall a name and a price.
Through the wall of the flat next door you can feel every drumbeat of the music, but you cannot make out a single word the singer sings. Reading the wall as a measured curve, why?
The wall's floor is where the words live. A drumbeat is almost all low frequency, up on the shelf of the curve, so it comes through nearly whole. The crispness that tells one word from another rides on high frequencies, and those sit past the fall. You are hearing the music through a low pass, and once you can read the curve you can say exactly what it will keep.
Step 8

Passband, cutoff, stopband and roll-off

Step 7 left you with a picture: a shelf, a fall, a floor and a knee you can drag. This step attaches the words that engineers write in datasheets, plus the numbers behind them. The four words in the title are the four questions anyone asks about a measured curve. Which frequencies get through, where does getting through stop, which frequencies are properly blocked, and how quickly does it go from one to the other.

The passband is the shelf with a number on it: the stretch of frequencies that keep most of their height, taken here as at least nine tenths. The stopband is the floor, the stretch left with under a tenth. The cutoff is the knee's exact address, the single frequency picked out as the boundary. By long convention it sits where the gain has fallen to 0.71, and the first note below says where that odd-looking number comes from. The roll-off is how steep the fall is, quoted here as what the gain divides by over the next doubling of frequency.

None of those is a property a filter is issued with. Each is a reading taken off a curve, and the lab takes them off the curve in front of you.

Why is the cutoff at 0.71 and not at a half?

Because the thing being halved is not the height. The power carried by a wave goes with the square of its height. A wave at 0.71 of its original height therefore carries 0.71 times 0.71 of its power, which is a half. The cutoff is the half-power point, and 0.71 is what half the power looks like when you are measuring heights.

Where 0.71 comes from is worth knowing: it is one divided by the square root of two, since squaring it has to give a half. You will meet the same number in the same role in electronics, acoustics and optics, always for this reason.

Is the cutoff a cliff edge? Does anything above it get through?

Plenty gets through. At the cutoff itself, by definition, 71 per cent of the height survives, which is most of it. The name misleads more than any other word in the subject, and the lab is worth using to break the habit. Shade in the passband, shade in the stopband, and look at how much of the axis is neither.

That middle stretch is the transition, and how wide it is turns out to be the expensive question. Step 9 is about the price.

Where do decibels come into this?

They are a different way of writing the same gain, used because the interesting range is enormous. A filter's stopband can easily be a thousandth of its passband, and a chart from 1.0 down to 0.001 is unreadable with a straight scale. A decibel figure is twenty times the logarithm of the gain. So a gain of 1 is 0 decibels, a half is about minus 6, and a thousandth is minus 60. This course prints gains as plain numbers because they are easier to check against a chart.

Two pieces of the usual jargon fall straight out. The cutoff is called the minus three decibel point, because a gain of 0.71 works out to minus 3.01. Roll-off is usually quoted in decibels per octave, an octave being a doubling of frequency, so the lab's factor per doubling is the same statement in different clothes.

Lab 11 · The four names, read off a measured curve
Try this firstStart on the five-sample average and find the dashed line marked cutoff, then read the table underneath. Now press a sharp 41-tap low pass and compare the same four rows, especially how far the passband and the stopband are apart.
The two averages have the same shape and different sizes. Tripling the window from five to fifteen moves every frequency in the table down by roughly the same factor of three. The sharp filter is a different animal: its passband and stopband nearly touch, and what that costs is the next step.
A datasheet says a filter has a cutoff of 1 kHz. A colleague concludes that a 1 kHz tone will be silent at the output. What should you tell them?
It comes out at about 71 per cent. The cutoff is the half-power point, and losing half the power still leaves seven tenths of the height. The frequency where a tone has really gone is up in the stopband, which on the filters in the lab sits at two or three times the cutoff. Reading cutoff as silence is the most common mistake made with a datasheet, and the shaded chart in the lab is the fastest cure.
Step 9

Sharpen the edge, and count the extra multiplications

Step 8 left one stretch of the axis unnamed: the part between the passband and the stopband, where the curve is on its way down. Its width is the transition width, and it is the number that decides whether a filter can separate two things that are close together in frequency.

This lab holds the cutoff still at 100 cycles a second and changes only how many taps the filter has. The weights are built each time from the shape that would give a perfectly vertical edge if it went on for ever, cut down to the number of taps available. More taps means more of that shape survives, and a steeper edge.

Every tap is a multiplication that has to happen for every output sample, so this is the first place in the course where the filter has a price.

Why can a short filter not have a sharp edge?

Because a short filter can only look at a short stretch of the signal, and telling two nearby frequencies apart takes time. Two waves 5 cycles a second apart stay in step with each other for a fifth of a second. Anything looking at less than that much signal cannot yet see any difference between them.

That is the whole reason for the trade, and it is not a limitation of any particular design. Taps are samples of the past, so more taps means a longer look back and a longer look back is the only thing that buys resolution in frequency.

Is one multiplication per tap really worth worrying about?

Multiply it out and it usually is. Audio at 48,000 samples a second through a 101-tap filter is about five million multiplications a second, per channel. That is nothing for a laptop and a great deal for a hearing aid running off a battery the size of a lentil.

It is also why the shape of the weight list matters commercially. Suppose one design gets a given edge in 61 taps where another needs 101. That saves forty per cent of the work on every sample, for ever. A whole field of filter design exists to shave taps off.

Where does that hump-shaped weight list come from?

It is the impulse response a perfect brick-wall filter would have to have, and it is infinitely long. Cut it off at some number of taps and you have an approximation, which gets better the more taps you keep. The stick chart in the lab is that shape: a hump in the middle with smaller and smaller ripples to either side.

Notice the ripples go negative. A filter whose only job is to smooth ends up with weights that subtract in places, which looks wrong and is not. Those negative weights are what make the edge sharp, and in Step 12 they are also what makes it ring.

Lab 12 · Taps against sharpness
Try this firstDrag number of taps up towards 81 and watch the solid curve get steeper while the dashed 11-tap curve behind it stays put. Read the pill giving the edge width at each end of the slider, then look at the last pill, which multiplies the taps by that width.
Taps multiplied by edge width stays roughly constant. That is the trade written as a number you can check. To halve the width of the edge you double the taps, and you pay for it on every output sample for as long as the filter runs. There is no design anywhere that escapes this, only designs that get a better constant.
Two radio channels sit 10 kHz apart. A receiver using a 51-tap filter picks up both at once. The engineer needs the edge four times narrower. Roughly what does that cost?
Roughly four times the taps, and four times the work. The product of taps and edge width is about constant, so sharpness is bought in proportion. This is the calculation behind a lot of hardware decisions. At some point the chip cannot do 200 multiplications per sample in the time available. The answer then stops being a better filter and starts being a different approach, and Step 10 is one of those.
Step 10

Feed the output back in

Every filter so far has looked only at inputs. Its output is a weighted sum of the last few samples that arrived. Once a sample has walked off the end of the tap list, it is gone for good. Now allow one more term: the previous output.

Keep a fraction g of the last answer and let in the rest of the new sample. If g is 0.8, each output is eight tenths of the last output plus two tenths of the new reading. That is feedback, meaning the output is wired back round to the input. A filter written this way is called recursive, because each answer is worked out from the previous answer.

Send one spike into it and the output never quite reaches zero. Each sample is a fraction of the one before, so it halves and halves and keeps going. Because that response has no end, filters of this kind are called infinite impulse response, or IIR, against the FIR of Step 4.

How can two numbers hold a memory hundreds of samples long?

Because the memory is not stored in the coefficients, it is stored in the last output. That one number already contains a fraction of the output before it, which contains a fraction of the one before that, all the way back to the beginning. It is a running total that quietly forgets, and forgetting slowly is what makes it long.

A moving average has to keep every sample it is still using, so a window of fifty samples means fifty numbers in memory and fifty multiplications. The recursive version keeps one number and does two multiplications, for a similar amount of smoothing. What it gives up is any say over the shape of the forgetting, which is always the same decaying curve.

Have I met this before under another name?

Almost certainly. It is the running average that games and dashboards use for a smoothed frame rate, and it is what a spreadsheet calls exponential smoothing. Somewhere in most pieces of software there is a line reading something like avg = 0.9 * avg + 0.1 * newValue. That line is this filter.

It is popular for the reason the lab measures: it is one line, it stores one number, and nobody has to keep a list. Whoever wrote it was usually not thinking about frequency responses, which does not stop it having one.

What does this look like written out?

Three lines, and the middle one is the filter. The rest of this course could be built out of the same shape with more terms on the right.

let y = 0;                         // the last output, kept between samples
for (const x of input) {
  y = (1 - g) * x + g * y;         // the whole filter
  output.push(y);
}

Compare that with an FIR of the same smoothing power. The FIR needs an array of dozens of weights, a buffer of dozens of past samples, and a loop inside the loop. The saving is real, and it is why this shape turns up in so much shipped code.

Lab 13 · One number of feedback
Try this firstDrag how much comes back, g up towards 0.95 and watch the stick chart's tail stretch out to the right. Then read the last two pills together: where this filter cuts, and how many taps a plain average would need to cut in the same place.
Two numbers are doing the work of dozens. Both cutoffs in those pills were measured the same way, by running sines through and reading the output height, so they are comparable. What feedback buys is a long memory for almost no work. Step 11 is the bill.
A program keeps a smoothed frame rate with the line avg = 0.99 * avg + 0.01 * newFrame. The frame rate drops off a cliff and the displayed number takes several seconds to follow it down. Why?
A g of 0.99 forgets very slowly. Each reading is allowed to move the answer by a hundredth of the remaining gap, so the memory is on the order of a hundred readings deep. That is the same trade as Step 2 in a different costume: more smoothing, more lag, and the smoothing is doing exactly what it was told. Lowering g to 0.9 makes it ten times quicker to respond and ten times less smooth.
Step 11

Turn the feedback up past one and break it

An FIR filter cannot misbehave. Whatever its weights are, the output is a fixed number of inputs multiplied by fixed numbers. If the input stays within limits, the output stays within limits, and that is the end of it. A filter with feedback has no such guarantee, and this step is about finding out why by breaking one.

The loop hands each output back to be part of the next one. If it hands back less than it received, whatever is circulating shrinks a little each time round and eventually fades out. If it hands back more, it grows a little each time round, and it goes on growing after the input has stopped, with nothing feeding it but itself. A filter that fades is stable. One that grows without limit is unstable.

The lab feeds in a short burst and then silence, so anything still moving at the end has no excuse.

What does a filter blowing up look like in a real machine?

Loud, briefly, and then not at all. In audio the numbers run past what the format can hold and the sound becomes a full-scale screech before the hardware protects itself or the output saturates flat. Anyone who has held a microphone too close to a speaker has heard the same effect built out of air rather than arithmetic. The howl is a loop handing back more than it received.

In a control system it is worse than a noise, because the numbers are steering something. A value doubling every few milliseconds reaches the machine's limit almost at once and stays there. That is a machine at full power in one direction, with nobody able to talk it down.

Why can an FIR never do this, even with enormous weights?

Because there is no route from the output back to the input. An FIR output is at most the biggest input multiplied by the sum of the sizes of the weights, and that is a fixed number however unpleasant it is. A filter with weights of a hundred each amplifies by a lot and then stops.

This is the reason FIR filters are chosen for anything where a failure is expensive, even when an IIR would do the same job with a tenth of the arithmetic. You cannot make one unstable by typing the wrong number, and that is worth a great many multiplications.

How do designers check for this without trying every setting?

They work out where the loop exactly breaks even, for g or for whatever set of feedback numbers they have. Then they check that the actual values sit on the safe side. Those break-even values are called poles. The test is that all of them sit inside a circle of radius one. For the one-coefficient filter here, the circle is just the range from minus one to one, which is why 1.00 is the boundary you can watch the slider cross.

There is a second trap that the arithmetic on this page does not have. Real hardware stores its numbers with limited precision. A filter designed at 0.9998 may be stored as 1.0000, and become unstable on the device while being perfectly safe in the design. Splitting a long filter into a chain of short ones is the standard defence.

Lab 14 · Break it on purpose
Try this firstDrag g slowly from 0.90 up through 1.00 to 1.02, watching the pill that says stable or unstable. The input is the same short burst every time and it always stops at the mark. Read the biggest output pill at 0.99 and again at 1.02.
The input never went above 1, and past g of 1.00 the output has no ceiling. Nothing was fed in to make that happen. Two hundredths on one coefficient is the whole difference between a filter that settles and a filter that has to be switched off. That is why every book on the subject spends a chapter on stability before it spends a page on cleverness.
A filter is stable at g of 0.98 and unstable at 1.02. An engineer decides to keep g at 1.02 but clamp the output to a safe range, so it can never exceed what the hardware allows. Is that a fix?
Safe and useless are different from working. The clamp keeps the arithmetic legal, and the loop then sits at the limit permanently, because it is still trying to grow on every sample. The output becomes a flat line at the maximum with no relation to what went in. A limiter is a fine safety net and it is never a fix for a coefficient on the wrong side of one.
Step 12

Ringing, and how late each frequency arrives

Two things a frequency response does not tell you, and both bite in practice. The first is what a sharp filter does to a sudden edge. Send a step into the sharpest low pass from Step 9. The output climbs past the level it is heading for, comes back under it, goes past again, and wobbles its way in. That is ringing, and the input never went above the level at all.

It is the same fact as Step 9 seen from the other side. A sharp corner in the frequency response needs a long weight list with ripples in it. Every sudden edge in the input drops a copy of those ripples into the output. Sharpness in frequency and calmness in time cannot both be bought.

The second thing is timing. Every filter delays what it passes, and the question worth asking is whether it delays all frequencies by the same amount. When it does, a shape made of several frequencies comes out as the same shape moved along. When it does not, the parts arrive at different times and the shape comes out bent. A filter that delays everything equally is said to have linear phase, phase being the word for where a wave sits along its own cycle.

Why does a symmetric weight list delay everything by the same amount?

Because its centre of gravity is in the middle, and the middle is the same distance back whatever wave is passing. A nine-sample average weights the last nine samples equally, so the answer describes the moment four samples ago, for a slow wave and a fast one alike.

A feedback filter has no middle. Its impulse response starts tall and fades, so its centre of gravity sits near the front. How much a wave gets held back then depends on how much of that tail it is still in step with. That is why the second lab's table has one column standing still and one sliding.

Why is the same idea called both delay and phase?

They are the same shift measured against two different rulers. Delay measures it in samples, which is a fixed amount of time. Phase measures it as a fraction of one cycle of the wave being shifted. For a fast wave, the same shift is a much bigger fraction of a cycle than for a slow one.

So a delay of four samples is four samples at every frequency, but written as a phase it grows with frequency. That is where the word linear comes from: phase rising in a straight line means a constant delay. The lab reports samples, because samples are the thing a reader can count off the chart.

When does bending the shape matter, and when does nobody care?

For listening, mostly nobody cares, and analogue equipment has bent phase for a century without anyone objecting. The ear is fairly forgiving about when the parts of a sound arrive relative to each other, within limits.

For measurement it matters a great deal. Say the job is to find the exact moment of a heartbeat, or the leading edge of a radar echo. A filter that moves the slow parts of that edge by a different amount from the fast parts has changed the answer. Anything doing timing uses a symmetric FIR for that reason, and pays the extra multiplications for a delay it can subtract back out.

Lab 15 · A step through a sharp filter
Try this firstDrag taps in the low pass from 9 up to 81 and watch the overshoot pill and the wobbles pill climb together. Then press A plain average instead at the same tap count and compare all three pills, including the edge width.
The blunt filter is the calm one. The overshoot grows as the edge in frequency narrows, and a plain average, which has the widest edge of all, never overshoots at any length. Chopping the weight list off dead rings more than fading it out, which is worth knowing, but no amount of care with the ends removes what the sharpness itself costs.
Lab 16 · How late, and does it depend on the frequency
Try this firstDrag frequency from 5 Hz to 110 Hz and watch the two samples late pills. One of them does not move at all. Check it against the table underneath, which lists both delays across the whole range.
One column of that table is a constant and the other is not. Both filters were measured the same way, by running sines through and reading how far the output had slid. A symmetric weight list holds every frequency back by half its length, so subtracting that delay afterwards recovers the timing exactly. Nothing you subtract can undo a delay that was different for every frequency.
A team filters an electrical heart trace to remove noise before finding the exact instant of each beat. Their first attempt uses a recursive filter with one coefficient, and the measured beat times come out slightly wrong in a way that depends on the shape of the beat. What should they change?
Use a symmetric FIR and subtract the known delay. A beat is made of several frequencies at once, and a recursive filter holds each of them back by a different amount. The shape arrives distorted, and its peak moves depending on what the beat looked like. A symmetric weight list delays them all by half its length, which is one number, known in advance, and easy to take back off. The extra multiplications are exactly what Step 9 said they would be, and this is the job worth spending them on.
Step 13

A filter made of two parts from a shop

Long before anyone multiplied lists of numbers, filters were built out of parts. The classic one takes two. A resistor is a part that lets electric current through reluctantly, like a narrow pipe. A capacitor is a part that stores charge, like a small bucket that fills and empties. Feed a voltage in through the narrow pipe and let it fill the bucket, and the bucket's level is your output. This pair is called an RC filter, after the letters used for the two parts.

The bucket cannot fill instantly, because the pipe is narrow. That single fact makes the pair a low pass. A slow wave gives the bucket time to fill and empty in step, so it follows almost perfectly. A fast wiggle reverses before the level has moved, so it barely shows. It is the heavy wall from Step 7, built small enough to solder. How quickly the bucket can respond is one number, the time constant, written τ and equal to R times C. A bigger resistor or a bigger capacitor both slow it down, and the knee of the curve sits at 1 divided by 2πRC.

Physicists write the filling rule as an equation about speed of change: how fast the level rises is set by how far it still has to go. An equation of that kind is called a differential equation, and this one is solved by a curve that climbs quickly at first and then levels off. To run the same rule on samples, you chop time into steps, which is called discretising. Do that to the bucket and out falls exactly the one-coefficient feedback filter of Step 10. The g you turned there is the sampled shadow of τ.

Where would I have met an RC filter without knowing?

Almost anywhere a knob changes tone. The treble control on a cheap guitar amplifier is close to being one resistor and one capacitor. The click removers on old record players, the smoothing after a power supply, and the touch sensitivity of a phone screen all lean on capacitors filling through resistors.

They are also hiding in places nobody calls a filter. A thermometer in a hot drink reads low for the first seconds because heat flows into it through a poor conductor and fills its small heat capacity. Same equation, same curve, with temperature standing in for charge.

Why does the answer keep 63.2 per cent turning up?

Start the bucket empty and switch the input on. After one time constant the level has covered 63.2 per cent of the distance to its final value. After another time constant it covers 63.2 per cent of what remained, and so on. Each τ takes the same fraction of the leftover gap, which is why the curve never quite arrives. It is also why five time constants is the usual engineering answer for close enough, within about one per cent.

The number itself is 1 minus 1 over e, where e is the mathematical constant 2.718. It falls out of the differential equation, and you can check it against the lab rather than take it on trust.

What breaks when you chop time into steps?

The careful way to discretise the bucket keeps its behaviour exactly: the sampled decay matches the true curve at every sample, whatever the step size. The quick and obvious way, called an Euler step, just adds speed times step size on each tick. It is fine when the steps are small compared with τ, and it goes wrong when they are not.

Wrong here does not mean slightly off. A coarse Euler step can turn a decaying bucket into a growing oscillation, which is Step 11's instability arriving through the back door of a lazy approximation. The second lab lets you cross that line on purpose and watch it happen.

Lab 17 · Charge an RC filter
Try this firstLeave R at 1 kΩ and C at 1 µF, and step the elapsed time up from 1 ms, reading the step output pill each time. Then make either part ten times bigger and do it again, watching how the same moments now catch the bucket much less full.
One number tells you the whole curve. At one time constant the level has covered 63.2 per cent of the gap, whatever R and C are. After five it is within about one per cent of the top. Everything this pair of parts can do is that curve, stretched or squashed along the time axis.
Lab 18 · Map the analogue decay onto samples
Try this firstSet the time constant to 10 ms and the sample rate to 1 kHz, and compare the two decay curves in the chart. Then drop the rate to 100 Hz with the time constant at 1 ms, and read the pill that says whether the rough Euler version is even stable.
The exact mapping is safe and the lazy one is not. The exact sampled decay matches the physics at any rate. The Euler shortcut is fine when the steps are small next to τ, and at coarse steps it crosses the break-even line and grows. A method that worked at one sample rate can fail at another, which is worth knowing before you change either.
An RC filter starts empty and a steady input is switched on. After exactly one time constant, how full is the output?
About 63 per cent. The remaining gap after one time constant is 1 over e, about 36.8 per cent, and each further time constant takes the same fraction of what is left. That is why the curve climbs fast and lands softly, and why five time constants is the usual answer to how long until it is done.
Step 14

Poles, zeros and the z-plane

Step 11's deeper note introduced poles as the settings where a feedback loop exactly breaks even, and said they must all sit inside a circle of radius one. This step gives that circle its proper home. Draw a flat map. Distance from the centre says how strongly a loop hangs on to what is circulating, and direction round the circle says which frequency it circulates at. That map is called the z-plane, and every feedback filter is a handful of marked points on it.

A pole is one such point, and its two coordinates are its whole story. The radius is how slowly the loop forgets. At 0.7 an echo dies in a few samples, and at 0.98 it rings on for hundreds. Past 1 it grows, which is Step 11's instability drawn as a dot crossing a line. The angle is which frequency the loop favours, from a slow hum near the axis round towards the fastest wiggle the samples can hold. A pole near the circle at some angle makes a filter that rings at that frequency, which is called resonance.

A zero is the opposite kind of point: a setting that cancels one frequency completely instead of feeding it. Park a zero exactly on the circle at the angle of mains hum, and that hum measures 0.00 at the output while its neighbours barely notice. A cancellation that surgical is called a notch. The bookkeeping that turns a filter's numbers into its poles and zeros is called the z-transform, and its details belong to a later course. Reading the map does not have to wait for them.

Why do the points come in mirrored pairs?

Every zero or pole placed off the horizontal axis in these labs brings a twin, mirrored below the axis. The reason is that the filter's own numbers, the ones the code multiplies by, have to be ordinary real numbers. A lone tilted point would demand weights that are not, and an input of real samples would come out imaginary, which no loudspeaker knows how to play.

Placed as a pair, the imaginary parts cancel and the weights come out real. The pair acts like one point as far as the response is concerned, so the labs let you steer one and carry its twin along.

Where does a resonant pole show up in real machines?

Anywhere something prefers one frequency. A wine glass sings one note when flicked because the glass is a loop of stored motion with a pole near the circle at that note's angle. A car suspension bouncing after a bump, a bridge swaying in step with marching feet, and the whistle of a badly tuned microphone stage are the same picture.

Filter designers use resonance on purpose. A pole pair pulled close to the circle at one angle makes a filter that answers strongly to one band, which is how a radio's tuner leans towards one station. The radius sets how choosy it is, and how long it rings.

How this connects to the s-plane and Laplace transforms

Continuous circuits like Step 13's RC pair have their own map, the s-plane, drawn with the Laplace transform. There the stable side is the left half of the plane rather than the inside of a circle. Sampling rolls that half-plane up into the unit circle, which is why the two stability rules are the same rule seen through different transforms.

Standard recipes such as the bilinear transform carry an analogue design across to the z-plane. The carrying bends the frequency axis a little, which is called warping, and a design moved across without accounting for it lands its cutoff in the wrong place.

Lab 19 · Move one pole
Try this firstKeep the angle at 0.5 rad and step the radius from 0.70 to 0.98, reading the samples to fade pill. Then push it to 1.02 and read the stable pill, and only then change the angle and watch which pill the angle moves.
The two coordinates do two different jobs. Radius alone decides whether the ringing fades, and how many samples it takes. Angle alone decides which frequency rings. Radius one is the boundary between a filter and an oscillator. A pole parked close to it can be nudged across by nothing more than rounding its numbers, which is Step 16's business.
Lab 20 · Place a notch zero
Try this firstAt a 1 kHz sample rate, choose the 50 Hz mains hum and look at where the notch lands on the curve. Then switch the sample rate to 48 kHz and watch the same 50 Hz slide towards the left edge, because the angle depends on both numbers.
A zero on the circle is a perfect cancellation of one frequency. The notch takes its neighbours down a little and everything further away hardly at all. Note the pair: the zero and its mirror twin move together, because real weights demand it. Try asking for a 1 kHz notch at a 1 kHz sample rate and read what the lab refuses to do, and why.
A feedback filter has a pole at radius 1.02. What is it?
Unstable. The radius is how much of what circulates survives each trip round the loop. At 1.02 each trip hands back more than arrived, so the natural response grows rather than decays, exactly like g past 1.00 in Step 11. The angle only chooses which frequency does the growing.
Step 15

Design from a specification

Every filter so far was built by turning a dial and looking. A filter that ships in a product is built the other way round: somebody writes down the promises first, and the filter is whatever keeps them. That written list is a specification. A useful one names the sample rate, where the passband ends and how level it must stay, and where the stopband begins and how far down it must sit. It also says how much delay is allowed, and how much arithmetic the chip can afford. The depth of the stopband gets its own word: attenuation, how much the unwanted part is cut down.

Notice what is not a specification. Remove the noise says nothing a design can be checked against, because it does not say which frequencies are noise or how gone they must be. The lab turns real requirements into the first hard number of a design, the order, which for an FIR is simply how many taps it needs. Step 9's trade reappears with its price list attached: a narrower transition or a deeper stopband both push the order up, and the delay rises with it.

Once the promises are fixed, you rarely invent weights from nothing. Designers reach for named recipes, each an honest trade taken to an extreme. A Butterworth design buys the flattest possible passband. A Chebyshev or elliptic design buys the steepest edge for a given order, and pays in ripple. A symmetric FIR buys Step 12's equal delay at every frequency. The family follows the requirement, never the other way round, and whatever a design tool returns is measured against the original promises before it ships.

Who actually writes these lists?

Anyone whose filter has neighbours. A hearing aid team writes one so speech survives while the battery lasts the day. A phone team writes one so the radio does not leak into the channel next door, and the law in most countries makes some of those numbers compulsory. A heart monitor team writes one so the mains hum goes and the beat's timing stays.

The list is also how disagreements get settled. When the built filter disappoints, the question is not whether it seems fine but which promised number it misses. A specification is an argument that was had once, in advance, instead of forever afterwards.

What is ripple, and why would anyone accept it?

Ripple is small wobble in the response where flatness was wanted. A passband that wavers between 0.99 and 1.01 instead of holding 1.00 has ripple, and so does a stopband floor that bumps along instead of lying still. It means some frequencies are treated a little differently from their neighbours.

It is accepted because it is bought at a discount. Allowing a per cent of wobble lets the same order fall much faster, so the edge sharpens without more taps. For music playback a per cent is inaudible and the sharper edge is not, so the trade is usually taken. For a measuring instrument it may be the other way round.

Filtering a recording you already have, with no delay at all

A stored recording offers a trick a live signal cannot. Run the filter forward, then run it again backwards over the result. The two passes shift every frequency by equal and opposite amounts, so the delays cancel to zero, and the filtering happens twice, which squares the response. It is called zero-phase filtering, and analysis software does it as a matter of course.

It needs future samples, so nothing live can use it. A controller or a radio receiving as the samples arrive cannot read tomorrow's input, and a method that is routine for stored measurements is simply impossible there. A specification should say which world it lives in.

Lab 21 · Turn requirements into an order
Try this firstStart at 60 dB of attenuation with a 1 kHz transition and read the estimated taps pill. Then narrow the transition to 100 Hz and watch the taps and the delay pill jump, and compare that with what demanding 90 dB instead did.
Each promise has a price in taps. Narrowing the transition tenfold costs roughly tenfold taps, and every tap is a stored sample, a multiplication, and a little more delay. When a requirement pushes the order past what the chip can spend, the design moves to feedback, to Step 17's rate tricks, or back to the customer to renegotiate.
Lab 22 · Choose a filter family
Try this firstPress each priority in turn and read which family the flow lands on. Notice which two priorities land on the same family, and work out why the steepest edge and the lowest order turn out to be the same purchase.
The family follows the requirement. Four priorities and three different first candidates. The steepest edge at a given order and the lowest order for a given edge are one trade seen from its two ends. Choosing an algorithm first and inventing the specification afterwards is the design mistake this step exists to prevent. The candidate is still only a candidate until it is measured against every promise on the list.
Which change to a specification most directly raises the number of FIR taps needed?
Narrowing the transition. The edge's width and the tap count trade against each other as a near-constant product. Asking for a sharper boundary is asking for more taps, more memory, more multiplications and more delay. The other two options change nothing the filter can feel.
Step 16

Biquads, bits and overflow

Everything so far assumed the arithmetic itself is perfect. On a real chip it is not. Numbers are stored in a fixed number of bits, the ones and zeros of memory, so every coefficient gets rounded to the nearest value the chip can hold. Step 11 warned what rounding can do to a feedback filter: a pole designed at 0.9998 stored as 1.0000 is an oscillator. The bigger the filter, the worse the sensitivity, because in one big feedback loop every rounded number leans on every pole at once.

The standard defence is to never build the big loop. A biquad is a small feedback filter with just one pole pair. A high order design is built as a chain of biquads, each guarding its own pair. The same poles and the same response on paper, with a completely different sensitivity to rounding, which the first lab measures side by side. Mathematically equivalent forms are not numerically equivalent. The form you test must be the form you ship.

Cheap chips bring one more habit. They do arithmetic on whole numbers only, with the program pretending a scale, so 10000 might stand for the value 1. That is called fixed point. Its danger is overflow: a result too big for the box it must fit in. The chip then does one of two things. Saturate means clamp at the biggest value it can hold, a lie that at least points the right way. Wrap means roll round like a car's odometer, so slightly past the top comes out as a huge negative number. The second lab lets you choose which failure you get.

How bad can wraparound actually sound?

As bad as digital audio gets. Saturation on a loud passage shaves the tops of the wave, which adds a hard buzz but keeps the shape. Wraparound replaces the top of the wave with its opposite extreme: a full-scale jump in the wrong direction on every loud sample. It plays as violent crackling far louder than the music.

Worse, inside a feedback filter that wrong-signed number goes back round the loop, so one overflow can leave the filter thrashing long after the loud moment has passed. That is why fixed-point designs reserve headroom, and why saturate is almost always the mode switched on.

Why not just use floating point everywhere?

Bigger processors do, which removes most of this step's problems in exchange for silicon and power. A hearing aid, a smoke alarm or a sensor on a coin cell cannot pay that. A fixed-point multiplier costs a fraction of the chip area and the battery of a floating-point one. A product made in millions multiplies those savings by millions.

Even where floating point is available, its rounding still exists, just further down. Long feedback filters can misbehave in float too, so the biquad habit and the test-what-you-ship rule survive at every budget.

Initial state and block boundaries

A feedback filter carries its running memory between calls. Audio arrives in blocks of a few hundred samples, and code that resets the filter's memory at every block plays a small switch-on thump hundreds of times a second. Code that shares one memory between left and right channels quietly mixes them.

So a shipped filter defines who owns the state, what its start value is, and when it may be reset. The standard test is to stream the same recording in several different block sizes and compare against one uninterrupted run. Every difference is a state bug found before a customer finds it.

Lab 23 · One big loop against a chain of biquads
Try this firstSet the order to 16 with 12 coefficient bits and one polynomial, and read how far the rounding model says the poles move. Then press biquad cascade and read the same pill, changing nothing else.
Same design, different arithmetic, different safety. In one big polynomial the rounding of every coefficient leans on every pole, and the movement grows quickly with order. In the chain, each biquad's rounding can only disturb its own pole pair. That is the whole argument for the chain, and it costs nothing but bookkeeping.
Lab 24 · Budget fixed-point headroom
Try this firstWith an 8-bit word, set the input peak to 0.8 and the internal gain to 2, and read the internal peak and stored output pills. Then switch the overflow policy from saturate to wrap and watch what the stored number becomes.
Saturation fails a little and wraparound fails completely. The saturated output is wrong by the amount that did not fit. The wrapped output is wrong by nearly the whole scale, and in the wrong direction. Neither is a substitute for scaling the signal so the overflow never happens, which is what the word headroom means in a datasheet.
Why is a high-order feedback filter usually built as a chain of biquads rather than one big loop?
The chain quarantines the rounding. A biquad's two coefficients control its own pole pair and nothing else, so storing them a little wrong moves that pair a little. In one high-order polynomial the poles depend on every coefficient together, and a single rounded value can push a pole near the circle across it. Same mathematics, safer arithmetic.
Step 17

Change the sample rate

Sometimes the list itself is the wrong speed. A recording made at 96,000 samples a second has to play on equipment that expects 48,000, or a sensor read fast has to be logged slow. Halving the rate sounds easy: keep every second sample, throw the rest away. Keeping every Mth sample is called decimation, and done naively it is a trap. The course's opening rule said a list can only hold wiggles up to half its sample rate, a ceiling called the Nyquist limit. Thin the list and that ceiling drops with it.

The trap is what happens to the frequencies above the new, lower ceiling. They do not disappear. They come back disguised as slower waves that were never in the signal, the aliasing that Sound and Signals is built around. So the rule of this step: low pass first, down to the new ceiling, and only then throw samples away. The filter is doing exactly its Step 7 job, and the first lab lets you skip it and watch the disguised waves appear.

Going the other way, inserting samples to raise the rate, is interpolation. It needs the same filter for the mirrored reason: the inserted samples carry ghost copies of the signal that must be smoothed away. Real converters chain both to manage awkward ratios, and they lean on one big saving. Most of the outputs a naive chain computes are thrown away a step later. A polyphase arrangement reorders the same multiplications so the discarded outputs are never computed at all. The second lab counts what that saves.

Where do all these different rates come from?

History and physics, in layers. Music settled on 44,100 samples a second because of how early digital audio was stored on video equipment, while film sound settled on 48,000. Telephone speech runs at 8,000, because long ago that was expensive enough. Radio hardware samples in the millions because its signals wiggle in the millions.

Any system touching two of those worlds converts between them, so rate changing is not an exotic corner. A phone call playing through a laptop speaker may cross three rates on its way to the air.

Why does thinning the list lower the ceiling?

Because the ceiling was never about the signal, it was about the spacing of the samples. The fastest wave a list can record is up on one sample, down on the next. Keep every fourth sample and the gap between samples is four times longer. Up on one kept sample and down on the next is now a wave four times slower than before.

A 20,000 cycle wave in a list sampled at 48,000 is comfortably under the old ceiling of 24,000. Decimate by four and the new ceiling is 6,000. The wave cannot be recorded, so it folds back and lands at 4,000, indistinguishable from a real 4,000. The lab's safe pill is checking exactly this arithmetic.

Two clocks that both say 48,000 and disagree

Two devices both labelled 48 kHz run on two different crystals, and no two crystals agree exactly. One side of a cable produces samples a hair faster than the other consumes them. A buffer between them slowly fills, or slowly drains, and eventually something has to give. Dropping or repeating a whole sample gives an audible click.

The cure is asynchronous rate conversion: measure the true ratio between the two clocks, continuously, and resample by that ever-drifting factor so no sample is ever dropped whole. It is this step's machinery run with a ratio that is never a neat fraction and never quite constant.

Lab 25 · Decimate without aliasing
Try this firstTake the 48 kHz input with the anti-alias filter off, choose divide by 4 and the 3 kHz band, and read the safe pill. Then switch the filter on and read it again, and work out from the new Nyquist pill why the 10 kHz band can never be made safe at this factor.
Downsampling lowers the ceiling, so clear the room first. The filter removes everything above the new Nyquist limit before samples are discarded, and then nothing is left to fold back. A wanted band that is itself wider than the new ceiling cannot be saved by any filter. The factor is wrong, not the filter.
Lab 26 · Count the polyphase saving
Try this firstSet up L of 160 and M of 147 with 127 taps, and compare the naive and polyphase work pills. Then drop to the small ratios and watch the saving shrink, which says when the reorganisation is worth its complexity.
Never compute a sample you are about to discard. The naive chain inserts, filters everything, then throws most of it away. Polyphase is the same convolution with its terms regrouped so only surviving outputs are ever touched. The answers are identical to the last bit, which is what makes it an optimisation rather than an approximation.
You are about to keep every fourth sample of a list and discard the rest. What must happen first?
Low pass first, always. Keeping every fourth sample drops the ceiling to a quarter of the old one, and any content above the new ceiling folds back into the survivors as counterfeit slow waves. Filtered first, the region above the new ceiling is empty and the thinning is harmless. This ordering is not a preference, it is the whole difference between resampling and ruining.
Step 18

Filters that learn as they run

Every filter so far had its weights chosen before the first sample arrived. Some jobs cannot work that way. Noise cancelling headphones do not know in advance what today's aeroplane sounds like, and a speakerphone does not know the shape of your room's echo. An adaptive filter starts with weights that are wrong, measures its own error, and nudges every weight a little in the direction that shrinks it, on every single sample. The standard nudging rule is called LMS, short for least mean squares. The size of the nudge is the step size.

The step size is Step 2's dial reborn. Tiny nudges learn slowly and settle clean. Big nudges learn fast and jitter around the answer, and past a limit the loop of nudges goes unstable in exactly Step 11's way. There is also a harder condition. The filter can only cancel what it can predict, so it needs a reference: a second signal related to the unwanted part. The microphone on the outside of a noise cancelling headphone is one, hearing the roar before your ear does. With an unrelated reference, no step size can help, and the first lab measures that flatly.

A cousin of the same idea tracks things rather than sounds. A Kalman filter keeps a running best guess of a hidden state, a drone's position say. Every tick it mixes two ingredients: what its model of the physics predicts, and what a noisy sensor just measured. The mix is set by one number, the Kalman gain, worked out from how uncertain each side currently is. A trustworthy sensor pulls the gain up; a trustworthy model pulls it down. The second lab lets you push both and watch the balance move.

Where is LMS running near me right now?

On every phone call you make. The far end's voice comes out of your speaker, bounces round the room, and re-enters your microphone, and without cancellation the other person hears themselves half a second late. An adaptive filter learns the room's echo from the known speaker signal and subtracts it, relearning continuously as you move.

Noise cancelling headphones, hearing aids taming feedback whistle, and modems learning the shape of a telephone line are the same loop at different speeds. In each case the filter is cheap and ready-made, and the engineering is in choosing the reference and the step size.

What exactly does the Kalman gain trade away?

Freshness against steadiness. A gain near one says believe the sensor, so the estimate follows every measurement including its noise: fast and jittery. A gain near zero says believe the model, so the estimate glides smoothly and reacts late when the world does something the model did not expect. It is the window length of Step 2 and the g of Step 10 wearing better mathematics.

The difference from those dials is that nobody turns this one by hand. The filter carries an estimate of its own uncertainty and computes the gain from it each tick, so the balance shifts on its own as conditions change.

When can no filter recover the state?

When the state never leaves a trace in anything measured. A drone's height cannot be estimated from a compass, however clean the compass is, because height never affects it. Whether a state's effects eventually show up in the sensors is called observability, and it is a property of the physical arrangement, not of the filter's cleverness.

The trap in practice is buying a better version of the same blind sensor. Ten times less noise on the compass is still zero information about height. The fix is a different sensor, or a different motion that makes the hidden state leave fingerprints, and no tuning session can substitute for either.

Lab 27 · Tune the learning speed
Try this firstWith the reference correlated, step the step size from 0.01 to 0.1 to 0.8, watching the error curve fall faster and the residual pill creep up. Then try 1.2, and then set the reference to no at any step size and see what the curve refuses to do.
Learning speed is bought with leftover jitter, and past a limit with stability. That much is Step 2 again. The deeper lesson is the reference. With one that actually carries news about the noise, every stable step size gets there eventually. With an unrelated one, the error never falls at all. No dial fixes a filter that has nothing to learn from.
Lab 28 · Balance model against sensor
Try this firstSet process uncertainty low and measurement uncertainty high, and read the Kalman gain and the two weight pills. Then swap the two settings and watch the trust flow to the other side of the bar.
The gain is nothing but a statement of comparative trust. Noisy sensor, steady world: low gain, lean on the prediction. Twitchy world, good sensor: high gain, follow the measurements. The two uncertainty settings are assumptions you feed in, and a Kalman filter given wrong assumptions is smooth, confident and wrong, which is worse than noisy and right.
A drone's position sensor suddenly becomes much noisier in bad weather. What should happen to the Kalman gain?
Smaller. The gain balances the two uncertainties, and the sensor's just went up. Each reading now deserves a smaller vote, so the filter trusts its physics further and follows the jitter less. When the weather clears and the sensor settles, the gain climbs back on its own. That automatic rebalancing is the whole point of carrying the uncertainties along.
Step 19

Nonlinear and learned denoisers

Every filter in this course so far has obeyed Step 4's two rules. Double the input and the output doubles; the sum of two signals gives the sum of their outputs. Filters that break those rules are called nonlinear, and one of them embarrasses every weighted sum in this course. A median filter slides a window along like Step 1's, but instead of averaging the samples it sorts them and keeps the middle one. A lone spike of interference is never the middle value, so it vanishes without a trace, while the average would smear it over its neighbours.

The price of breaking the rules is losing the tools. A nonlinear filter has no frequency response, because what it does to a sine depends on what else is in the signal, so one curve can no longer describe it. Testing has to move to the cases the job cares about: spikes, edges, faults. The same goes further for learned denoisers, filters whose behaviour comes from training on examples rather than from chosen weights. They can use context no weighted sum can, and they can also delete quiet real events, or invent convincing detail that was never measured.

So the last skill of the course is not building a filter but deciding whether one may ship. The second lab is a release gate with three measured conditions. How much of the real world did the test set cover, how many of the events that matter survived, and does the thing run fast enough. Fail any one and the product falls back to the plain measured filter from the rest of this course. Boring, linear, and understood is a strong default.

Why does sorting beat averaging on a spike?

Because an average lets every sample vote with its size, so one absurd sample drags the answer in proportion to how absurd it is. A three-sample average with a spike of 30 in it reports 10, which is the spike smeared into three samples of nonsense. The median only asks which value is in the middle. The spike sits at the extreme end of the sorted three, so it never touches the answer at all.

The trade is that on smooth wobbly noise, the kind Step 1 fought, the median does no better than the average and costs a sort per sample. The shape of the failure selects the tool.

Where do learned denoisers actually help?

Where the signal has structure a weighted sum cannot know. A photograph's noise sits next to textures, edges and repeated patterns. A model that has seen millions of photographs can tell grain from grass better than any fixed set of weights. Night-mode photos on a phone, denoised medical scans, and speech pulled out of a crowded room all lean on learned models today.

The same strength is the risk. A model that knows what photographs usually look like will helpfully invent usual-looking detail where the measurement was only noise. For a holiday photo that is fine, and for a scan a diagnosis rests on, it is not.

A deployment check someone else can rerun

Whatever the filter is, ship its test as well as its code. Save the raw and filtered recordings, the exact coefficients or model version, the sample rate and the block size. Save the state reset policy and the timing figures too, and keep the labelled test set. After every change, replay the same corpus and compare against the promises of Step 15.

When a design tool or a model proposes a filter, treat the proposal as a hypothesis. Measure its response the way Step 6 did, its stability the way Step 11 did, its overflow the way Step 16 did, and its task accuracy against the labels. A suggestion is not a measurement.

Lab 29 · Average or median for a spike
Try this firstSet the spike to height 30 with average selected, read what lands in the centre and its neighbours, then press median and read both again. Then drop the spike to 3 and see whether the difference between the two tools still matters.
The failure shape selects the tool. The average turns one absurd sample into three wrong ones, and the median deletes it outright, because a lone extreme can never be the middle value. On gentle wobble the two tie and the average is cheaper. Choose by the fault you actually suffer, not by which filter is cleverer.
Lab 30 · Gate a learned denoiser
Try this firstSet coverage to 95 per cent, event recall to 99 per cent and latency to 5 ms, and read the release gate pill. Then break one condition at a time and watch which single failure is enough to block the release.
Judge the downstream task, not the sound. A denoiser that makes audio lovelier while eating one alarm chirp in a hundred fails the job the alarm exists for. The gate is three measurements and a rule, no taste involved, and when it blocks, the system ships the plain measured filter instead. An understood filter beating a promising one is a result, not a disappointment.
A learned denoiser makes recordings sound much cleaner, but tests show it removes 8 per cent of alarm chirps. Is it ready to ship?
No. The alarms are the reason the system exists, and the denoiser deletes one in twelve of them. Clean-sounding audio is a side effect, not the requirement. This is the course's last measurement lesson: a filter is judged against the promises written for its task, and a clean-sounding failure is still a failure.
Step 20

Set your own weights

Seven weights, one feedback coefficient, and nothing marked. The three charts under the sliders are the three views of a filter this course has built up. What comes out when a single 1 goes in, what it does to each frequency. What it does to a real signal.

Watch the top chart carefully when the feedback is off and again when it is on. Without feedback it is a copy of your weights. With feedback it is not, because the output is going back round, and that is the visible difference between FIR and IIR in one picture.

Three things worth trying, since a sandbox with no plan is only sliders. Make the weights add to zero and watch what happens to a flat input. Set every weight to zero except the first and then turn the feedback up, which is the whole of Step 10 in two moves. And put a large negative weight next to a large positive one, which sharpens rather than smooths, and see what it does to the noise.

What am I actually looking at in the three charts?

The sticks at the top are the impulse response: one 1 was sent in and those are the numbers that came out. The curve in the middle is the frequency response, and every point on it is a sine that was built at that frequency, run through your filter, and measured. The line chart at the bottom is the same noisy test signal from Step 2, with your filter applied.

The pills report a flat input and the fastest possible wiggle, which are the two ends of the frequency curve. Those two numbers on their own tell you whether you have built a low pass or a high pass, before you look at anything in between.

Why does the impulse response stop matching my weights when feedback is on?

Because the weights are no longer the only thing acting on the spike. The spike passes through the weights once, and then whatever came out is fed back round and added to the next output, and so on. The tail you see after the seventh stick is the loop talking to itself.

This is why the impulse response is the honest description and the weight list is not. Ask a filter what it does by sending a spike into it, and it answers for everything it contains, including the parts that are not written in the weight list.

What has been left out of this course?

Two things above all. The first is how anybody arrives at a set of weights on purpose rather than by dragging sliders, which is called filter design. The usual routes are two. Sample the shape you want and taper it, as Step 9 does, or let a program search for the weights that best match a target curve. The second gap is how to see a frequency response without running one sine at a time, and that is the whole subject of the next course.

Also missing: filters whose weights change while they run, which is how noise cancelling headphones work. Filters that change the sample rate as they go. And the arithmetic problems that come from storing coefficients in a fixed number of bits. Each of those starts from exactly what is in front of you here.

Lab 31 · Your own weights
Try this firstPress Nothing but feedback and look at how long the top stick chart's tail is, given that only one weight is not zero. Then drag feedback g back down to 0.00 and watch the tail collapse to a single stick.
Nothing here is being marked. The preset called Sharpen is the one worth staring at: its weights add to one, so a flat input passes untouched, and yet it makes the noise very much worse. A filter that leaves steady things alone can still be the wrong filter, and the frequency curve is where you see why.
You are given a filter as a list of seven weights and asked whether it will make a noisy signal cleaner. What is the quickest useful check, before running it on anything?
Two sums answer it. The plain sum is the gain at a flat input, because a flat input multiplies every weight by the same number. The alternating sum is the gain at the fastest wiggle the samples can hold. That wiggle is plus one, minus one, plus one, so it flips the sign of every other weight as it goes. If the plain sum is much the larger, it smooths. If the alternating sum is, it sharpens. Those are the two ends of the frequency curve, worked out with a pencil.

What you can do now

  • Work out one output sample of a moving average by hand, and say which input samples went into it.
  • Say what a longer window buys and what it costs, in wobble, in lateness and in flattened features.
  • Write a filter as a list of weights, and say what the sum of those weights does to a steady input.
  • Explain the flip in convolution as the consequence of every input sample dropping a copy of the weight list into the output.
  • Measure a filter you did not write by sending one spike into it, and say why that tells you everything.
  • Turn a low pass into a high pass by changing a sign, and predict which of the two you are holding from the weights alone.
  • Measure a frequency response directly, one sine at a time, and say why the tallest sample is the wrong reading to take.
  • Read any low pass as a shelf, a knee, a fall and a floor, and place a wall, a tone knob and an equaliser on that one picture.
  • Read passband, cutoff, stopband and roll-off off a measured curve, and explain why a tone at the cutoff is not silent.
  • Estimate what a sharper edge will cost in taps and in multiplications per sample.
  • Describe a recursive filter as a running total that forgets, and say what it buys over an FIR and what it gives up.
  • Say why an FIR cannot become unstable and a recursive filter can, and where the boundary is.
  • Recognise ringing as the price of a sharp edge, and choose a symmetric FIR when the timing of an event has to survive.
  • Connect an RC circuit's differential equation to its exact sampled pole, and check whether an approximation stays stable at the chosen timestep.
  • Read pole radius and angle as decay and oscillation, place zeros to reject a tone, and turn a plain-language requirement into passband, stopband, delay and compute limits.
  • Choose a filter family, implement a high-order IIR as biquads, and test coefficient rounding, overflow, saturation and persistent internal state.
  • Change sample rates without aliasing, explain why polyphase code avoids wasted work, and decide when an adaptive, state-estimation, nonlinear or learned filter is justified.

Where this goes

  • The Frequency Domain. This course measured a response one sine at a time, which works and is slow. The next one works out every frequency in a signal at once, by hand on eight samples first, and then explains why the fast version changed computing.
  • Modulation. Putting data on a wave, and taking it off again. Nearly every step of that needs a filter, and by then the filter is the easy part.
  • A Radio Made of Software. A receiver with no tuning circuit in it, where the job of hearing one station and not its neighbour is done entirely by weights like the ones in Step 9.
  • Embedded Systems. Where the multiplications counted in Step 9 turn into a real budget on a real chip, with a battery and a deadline.
  • Control Systems. Poles, differential equations, estimation and stability return there, but the filtered signal now closes a loop around a physical machine.