SimuVeda

Engineering ยท Simulator 098

Audio Filtering

Filters let some frequencies through and hold others back. Choose a filter type, its cutoff and sharpness, and see its frequency response from deep bass to high treble. A test signal of mains hum, a musical note and hiss shows what survives; press "Play sound" to hear the filtered mix.

How the model works

A filter's frequency response |resp(f)| says how much it scales a sine wave of frequency f. It is usually shown in decibels, 20 logโ‚โ‚€|H|: โˆ’6 dB halves the amplitude, โˆ’20 dB is one tenth, โˆ’40 dB one hundredth.

Low-pass and high-pass filters here are Butterworth designs, as flat as possible in the passband. At the cutoff f_c the response is โˆ’3 dB, and beyond it falls by 20 dB per decade (6 dB per octave) for every order:

|H_LP(f)| = 1 / โˆš(1 + (f / f_c)^(2n))

A band-pass filter keeps a band around fโ‚€ whose width is fโ‚€ / Q; a notch removes a narrow band, useful for mains hum at 50 or 60 Hz. Higher Q means a narrower band:

band-pass: |H| = (f/(Q fโ‚€)) / โˆš((1 โˆ’ (f/fโ‚€)ยฒ)ยฒ + (f/(Q fโ‚€))ยฒ)

The simplest electronic low-pass, a resistor and capacitor, is first order with f_c = 1 / (2ฯ€RC).

Responses are for the ideal analog filters; the sound uses the browser's digital biquad filters, which match closely below about 10 kHz. Sound plays only when you press the button; keep the volume low.

Guided experiments

  1. Low-pass, second order. Cutoff 1 kHz. Prediction: โˆ’3 dB at 1 kHz and โˆ’40 dB at 10 kHz, so the 5 kHz hiss drops by about 28 dB while the 440 Hz note passes almost untouched.
  2. Steeper slope. The same cutoff with order 4. Prediction: still โˆ’3 dB at 1 kHz, but โˆ’80 dB at 10 kHz and about โˆ’56 dB at 5 kHz.
  3. Remove hum. A notch at 50 Hz with Q = 10. Prediction: the 50 Hz hum vanishes while the 440 Hz note and the hiss are barely touched (less than 0.1 dB).
  4. Band-pass. Centred on 440 Hz with Q = 5. Prediction: the bandwidth is 440 / 5 = 88 Hz; the note passes at 0 dB, the hum drops by about 33 dB and the hiss by about 35 dB.

Challenge

A guitar pedal uses a resistor of 1.6 kฮฉ and a capacitor of 100 nF as a first-order low-pass filter. What is its cutoff frequency, and how much does it reduce a 10 kHz component?

Reveal the explanation

f_c = 1 / (2ฯ€ ร— 1600 ร— 100ร—10โปโน) โ‰ˆ 995 Hz. At 10 kHz, f/f_c โ‰ˆ 10, so |H| = 1/โˆš(1 + 100) โ‰ˆ 0.0995, about โˆ’20 dB: a first-order filter falls by only 20 dB per decade. Compare the order-2 setting in the simulator, which gives โˆ’40 dB.

References

  • Butterworth, S. (1930), "On the theory of filter amplifiers", Wireless Engineer 7: 536โ€“541.
  • Horowitz, P. and Hill, W., The Art of Electronics, 3rd ed. (2015), ch. 6.
  • Bristow-Johnson, R., "Cookbook formulae for audio EQ biquad filter coefficients" (W3C Audio EQ Cookbook, 2021).