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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.