Every Future has a Founding

One-pole filters, shelves and all-passes

The one-pole recurrence and its frequency response, the corner, the complementary high-pass, shelves, the comb, and the all-pass that colours nothing.

9 minutes read

1881 words

Contents13

A filter is a rule that treats fast changes in a signal differently from slow ones. The simplest rule that does so keeps one number in memory and moves it a fixed fraction of the way towards each new sample. Everything on this page is that rule and its mirror image. The last of them rearranges a delay so that it moves a click in time and leaves every steady tone at its level.

Assumed knowledge

The sample rate and the sine wave as a test signal, from signals and samples . The time constant, from decibels and exponential decay .

The section on the frequency response uses the exponential form of a complex number and its modulus. A reader who takes equation (5) on trust can skip the derivation above it and lose nothing later.

Ground covered

The one-pole recurrence and what it does to a jump in the input. Its frequency response, found by feeding it a complex sine. The corner, and the coefficient that puts the corner where it is wanted. The pole, and the notation that names it. The high-pass that costs one subtraction. Low and high shelves, and the three-band gain built from a pair. The comb, which is the echo loop read as a filter. The all-pass, which moves a click in time and leaves every steady tone at its level. Filters in series.

The recurrence

Keep a number ss and, for each new sample, move it a fraction cc of the way from where it is to the sample.

s[n]=s[n1]+c(x[n]s[n1]),0<c1(1) s[n] = s[n-1] + c\,\big(x[n] - s[n-1]\big), \qquad 0 < c \le 1 \tag{1}

Rearranged, that is

s[n]=(1c)s[n1]+cx[n].(2) s[n] = (1-c)\,s[n-1] + c\,x[n]. \tag{2}

When the input jumps from 0 to 1 and stays there, ss climbs towards 1 with the remaining distance multiplied by (1c)(1-c) every sample. That is the decay of equation (9) on the previous page. The output lags the input and rounds off its corners. A signal that wobbles up and down faster than ss can follow is averaged away, and one that moves slowly is followed. That is a low-pass filter, meaning low frequencies pass and high ones are reduced. The name one-pole is explained under equation (7).

Response to a sine

To find by how much a given frequency is reduced, feed the filter a sine of that frequency and compare the output with the input. The arithmetic is easier with the complex signal

x[n]=eiωn,ω=2πffs,(3) x[n] = e^{i\omega n}, \qquad \omega = \frac{2\pi f}{f_s}, \tag{3}

whose real part is the cosine wave of frequency ff and whose imaginary part is the sine. The filter is linear, so it acts on the real and imaginary parts separately, and whatever it does to eiωne^{i\omega n} it does to both.

Try the guess that the output is the same signal scaled by some complex number HH , so that s[n]=Heiωns[n] = H\,e^{i\omega n} . Putting that into equation (2) gives

Heiωn=(1c)Heiω(n1)+ceiωn. H\,e^{i\omega n} = (1-c)\,H\,e^{i\omega(n-1)} + c\,e^{i\omega n}.

Divide through by eiωne^{i\omega n} , which leaves eiωe^{-i\omega} behind on the first term, and solve for HH .

H(ω)=c1(1c)eiω(4) H(\omega) = \frac{c}{1 - (1-c)\,e^{-i\omega}} \tag{4}

The guess was right, and H(ω)H(\omega) is the filter’s frequency response. Its modulus is the factor by which a sine of frequency ff is scaled, and its argument is the angle by which that sine is shifted. Multiplying top and bottom by the conjugate of the denominator gives the modulus squared.

H(ω)2=c212(1c)cosω+(1c)2(5) \big|H(\omega)\big|^2 = \frac{c^2}{1 - 2(1-c)\cos\omega + (1-c)^2} \tag{5}

At ω=0\omega = 0 , which is a constant input, equation (5) is 1, so a constant passes unchanged. At ω=π\omega = \pi , the highest frequency a sampled signal holds, it is (c/(2c))2\big(c/(2-c)\big)^2 , which is small when cc is small. In between it falls steadily.

The corner

The frequency at which the response has fallen to 1/21/\sqrt2 , three decibels down, is the corner fcf_c . The coefficient that puts the corner at a wanted place is

c=1e2πfc/fs.(6) c = 1 - e^{-2\pi f_c / f_s}. \tag{6}

Equation (6) is equation (6) of the previous page with τ=1/(2πfc)\tau = 1/(2\pi f_c) seconds. That τ\tau is the time constant of the resistor-and-capacitor circuit whose corner is fcf_c . The discrete filter inherits it.1 For corners well below the sample rate the match is close. At fs=48000f_s = 48\,000 and fc=250f_c = 250 , equation (6) gives c=0.0322c = 0.0322 and a measured three-decibel point of 250.0250.0 hertz. At fc=4000f_c = 4000 it gives c=0.4076c = 0.4076 and a three-decibel point of 40954095 hertz, which is 2.4 per cent high. Above the corner the response falls by six decibels per doubling of frequency.

2026-09-05T01:28:21.296363 image/svg+xml Matplotlib v3.11.1, https://matplotlib.org/
Equation (5) at three settings of the coefficient, with the corner of each marked at three decibels down. Above its corner every curve falls by six decibels per doubling of frequency, which is why the three lines run parallel.

A notation

It is usual to write z=eiωz = e^{i\omega} and to read z1z^{-1} as one sample of delay, since multiplying eiωne^{i\omega n} by eiωe^{-i\omega} gives eiω(n1)e^{i\omega(n-1)} . Equation (4) then becomes

H(z)=c1(1c)z1,(7) H(z) = \frac{c}{1 - (1-c)\,z^{-1}}, \tag{7}

and the value of zz that makes the denominator vanish, z=1cz = 1 - c , is the filter’s pole. One pole is what makes this a one-pole filter. A pole inside the unit circle, at z<1|z| < 1 , means the filter settles, and this one sits at distance 1c1 - c from the origin. Filters in series multiply their H(z)H(z) , which is the first reason to write it this way. The numerator and the denominator also say which delayed samples the recurrence uses.2

The complementary high-pass

Subtract the low-pass output from the input.

h[n]=x[n]s[n](8) h[n] = x[n] - s[n] \tag{8}

What remains is what the low-pass removed, which is the fast part. Its response is 1H(z)1 - H(z) , and gathering that over a common denominator gives

Hhp(z)=(1c)(1z1)1(1c)z1.(9) H_{\mathrm{hp}}(z) = \frac{(1-c)\,(1 - z^{-1})}{1 - (1-c)\,z^{-1}}. \tag{9}

The factor (1z1)(1 - z^{-1}) is zero at z=1z = 1 , so a constant is removed entirely. The corner is the same fcf_c , and above it the response rises to nearly 1. This is a high-pass filter, and it needs no memory of its own beyond the low-pass it is built from.

Shelves

A shelf turns one band up or down by a chosen factor GG and leaves the rest alone. Add G1G - 1 times the low-passed signal to the input.

y[n]=x[n]+(G1)s[n],Hls(z)=1+(G1)H(z)(10) y[n] = x[n] + (G - 1)\,s[n], \qquad H_{\mathrm{ls}}(z) = 1 + (G-1)\,H(z) \tag{10}

Below the corner H1H \approx 1 and the gain is GG . Far above it H0H \approx 0 and the gain is 1. That is a low shelf. Adding G1G - 1 times the high-passed signal instead gives a high shelf, with gain 1 below the corner and close to GG above it.

y[n]=x[n]+(G1)h[n],Hhs(z)=1+(G1)(1H(z))(11) y[n] = x[n] + (G - 1)\,h[n], \qquad H_{\mathrm{hs}}(z) = 1 + (G-1)\,\big(1 - H(z)\big) \tag{11}

The gain above the corner is close to GG rather than equal to it. By equation (5) the low-pass at the top of the band is c/(2c)c/(2-c) rather than zero, so the high shelf reaches 1+(G1)(1c/(2c))1 + (G-1)(1 - c/(2-c)) there. For a corner at 40004000 hertz and fs=48000f_s = 48\,000 the factor 1c/(2c)1 - c/(2-c) is 0.7440.744 . Two shelves in series, one low and one high, divide the spectrum into three regions with three gains. That is how a reverb gives bass, middle and treble three different decay times.

The comb

The echo loop of signals and samples ,

y[n]=x[n]+gy[nM],(12) y[n] = x[n] + g\,y[n - M], \tag{12}

is a filter as well. The same substitution as before gives its response.

H(z)=11gzM,H(ω)=11geiωM(13) H(z) = \frac{1}{1 - g\,z^{-M}}, \qquad \big|H(\omega)\big| = \frac{1}{\big|1 - g\,e^{-i\omega M}\big|} \tag{13}

The denominator is smallest, at 1g1 - g , whenever ωM\omega M is a multiple of 2π2\pi , which happens at the frequencies f=kfs/Mf = k f_s / M . There the response peaks at 1/(1g)1/(1-g) . Halfway between two peaks it is 1/(1+g)1/(1+g) . Drawn against frequency the response is a row of equally spaced spikes fs/Mf_s / M hertz apart, called a comb.3 A single echo therefore has a pitch. Everything a reverb does with its delay lines is arranged to blur those spikes into a smooth response.

The all-pass

Take the comb’s memory ww and read it out with one extra term.

w[n]=x[n]+gw[nM],y[n]=w[nM]gw[n](14) w[n] = x[n] + g\,w[n - M], \qquad y[n] = w[n - M] - g\,w[n] \tag{14}

The response is then

H(z)=zMg1gzM.(15) H(z) = \frac{z^{-M} - g}{1 - g\,z^{-M}}. \tag{15}

On the unit circle, where zM=eiωMz^{-M} = e^{-i\omega M} , write the numerator as eiωM(1geiωM)e^{-i\omega M}\,(1 - g\,e^{i\omega M}) . The bracket is the complex conjugate of the denominator, so the two have the same modulus, and the leading factor has modulus 1. The quotient therefore has modulus 1 as well.

H(ω)=1for every ω(16) \big|H(\omega)\big| = 1 \quad \text{for every } \omega \tag{16}

Every steady tone comes out exactly as loud as it went in. What changes is the timing. An impulse comes out as g-g at once, then (1g2)(1 - g^2) after MM samples, then g(1g2)g(1-g^2) after 2M2M . Each later arrival is gg times the one before it.

h[n]={gn=0(1g2)gk1n=kM, k10otherwise(17) h[n] = \begin{cases} -g & n = 0 \\ (1 - g^2)\,g^{k-1} & n = kM,\ k \ge 1 \\ 0 & \text{otherwise} \end{cases} \tag{17}

The squares of those numbers add to exactly 1, as they must when no frequency is boosted or cut. An all-pass is therefore a way to spread one click into a cluster of smaller clicks without colouring the sound. A chain of them with different MM spreads that click into a dense cloud. Reverbs use such a chain to raise the density of the input before it enters the main loop.4

Filters in series

Two filters one after the other have the response H1(z)H2(z)H_1(z)\,H_2(z) , so their magnitudes multiply and their decibel values add. A low shelf, a high shelf and a gain in series give the three-band gain described under equation (11). Eight all-passes in series are still an all-pass, because a product of terms each of modulus 1 has modulus 1.

Figure sources

One script draws the figure. It evaluates equation (5) directly at three settings of cc , each computed from equation (6). The three-decibel point marked on each curve is measured from the curve rather than taken from the requested corner. It needs NumPy and Matplotlib.

filters.py
uv run --with numpy --with matplotlib python3 filters.py

Further reading

The low-pass filter, its circuit and the discrete form of it.1

The all-pass and the comb, and the structures built from them.4 3

The notation of equation (7) taken further.2


  1. Low-pass filter. Wikipedia. Retrieved 5 September 2026. https://en.wikipedia.org/wiki/Low-pass_filter (opens in a new tab)  ↩︎ ↩︎

  2. Z-transform. Wikipedia. Retrieved 5 September 2026. https://en.wikipedia.org/wiki/Z-transform (opens in a new tab)  ↩︎ ↩︎

  3. Comb filter. Wikipedia. Retrieved 5 September 2026. https://en.wikipedia.org/wiki/Comb_filter (opens in a new tab)  ↩︎ ↩︎

  4. All-pass filter. Wikipedia. Retrieved 5 September 2026. https://en.wikipedia.org/wiki/All-pass_filter (opens in a new tab)  ↩︎ ↩︎

Tags