Write your own filter, and watch what it does
One line of maths is a low-pass filter. The figures on this page run that line in your browser: they show what it does to every frequency and to a single click, and they change as you turn its knob. Press Play it to hear the same filter on a bass line.
- You'll writea filter in one line, with
y': the output one sample ago. - You'll seeits Response (what it does to each frequency) and its Impulse (what one click becomes).
- You'll hearfour of them in a row, with feedback, ring as their poles slide out to the unit circle.
1One line
Every sample, the output y moves a share a of the way from where it was, y', towards the input x:
module OnePole in x out y setting a: 0.08, from 0.005 to 1 y = y' + a * (x - y')end
A fast wiggle in x is gone before y has moved far, and a slow one is followed almost exactly. Slow passes, fast doesn't: that's a low-pass filter.
2Why the click tells you everything
Send in one click, a single 1 and then silence. The first output is a. After that the input is 0, so each sample keeps 1 − a of the one before: a fade that never quite ends. That fade is the filter's impulse response.
Any sound is a row of clicks of different sizes, so the filter's output is its impulse response added up for each one. The Response view is worked out from the impulse response itself (SynthMaker plays the module one click and measures it), so what you see is what you hear.
3Four in a row, and feedback
Put four of the same line in a row and you get a steeper low-pass. Now take the last output, one sample ago, and subtract a share of it from the input, feedback * y':
module Ladder in x out y setting a: 0.1, from 0.005 to 1 setting feedback: 0, from 0 to 4.4 s1 = s1' + a * (x - feedback * y' - s1') s2 = s2' + a * (s1 - s2') s3 = s3' + a * (s2 - s3') y = y' + a * (s3 - y')end
Each stage lags a little behind its input, and at one frequency the four lags add up to half a cycle: there the part fed back is upside down, so subtracting it adds to it. Turn feedback up and that frequency grows a peak.
Try it
- In figure 1.1, turn a right down: the corner drops below 200 Hz and the click becomes a slow fade.
- In figure 1.2, play it and turn feedback up while the bass line plays: the filter starts to sing.
- Open either in SynthMaker, open the filter's code, and change a line: play it and hear what your change does.
Remember
y = y' + a * (x - y')is a low-pass filter: each sample moves a share of the way.- The impulse response (one click in) says everything about a filter like this; its Response is worked out from it.
- Feedback slides poles towards the unit circle; near it the filter rings, and on it the sound would never stop.