GestureSynth.me

Music calculator

Notch Filter Coefficient Calculator

Design a digital notch biquad from frequency, Q and sample rate. Get normalized numerator and denominator coefficients with an explicit sign convention.

notch filter coefficient calculator

Notch Filter Coefficient Calculator guide

To remove a narrow component in an audio stream, first identify its frequency in the recording. Enter the frequency, selectivity Q and the rate at which the recurrence will run. The five coefficients describe one second-order section. They are ready for implementations whose denominator is written as 1 + a1 z⁻¹ + a2 z⁻².

Play the instrument ↑
Default result
b0 = 0.993516006935

Calculation and units

Using the Audio EQ Cookbook notch form, set ω = 2πf/fs and α = sin(ω)/(2Q). The unnormalized numerator is [1, −2cos(ω), 1] and the denominator is [1+α, −2cos(ω), 1−α]. Divide both arrays by 1+α. The zeros lie on the unit circle at the target frequency; Q controls the placement of the poles and the width of attenuation.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Mains hum at 50 Hz

Notch frequency (Hz) = 50 · Filter Q = 30 · Sample rate (Hz) = 48000.

b0 = 0.999890929598. b1 = -1.999739027197 · b2 = 0.999890929598 · a0 = 1 · a1 = -1.999739027197 · a2 = 0.999781859196. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

A narrow notch can target a stationary mains component. Check the spectrum first for drift and harmonics.

Mains hum at 60 Hz

Notch frequency (Hz) = 60 · Filter Q = 30 · Sample rate (Hz) = 48000.

b0 = 0.999869118784. b1 = -1.999676560931 · b2 = 0.999869118784 · a0 = 1 · a1 = -1.999676560931 · a2 = 0.999738237568. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

Changing the centre shifts the zeros. Harmonics at multiples of the mains frequency require separate treatment.

Kilohertz test tone

Notch frequency (Hz) = 1000 · Filter Q = 10 · Sample rate (Hz) = 48000.

b0 = 0.993516006935. b1 = -1.970032679537 · b2 = 0.993516006935 · a0 = 1 · a1 = -1.970032679537 · a2 = 0.987032013871. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

Feed a synthetic tone through the recurrence to validate sign convention before using the filter on a recording.

Broad notch

Notch frequency (Hz) = 1000 · Filter Q = 2 · Sample rate (Hz) = 48000.

b0 = 0.968399621224. b1 = -1.920229656437 · b2 = 0.968399621224 · a0 = 1 · a1 = -1.920229656437 · a2 = 0.936799242447. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

Lower Q broadens attenuation around the null, affecting more nearby notes.

Narrow notch

Notch frequency (Hz) = 1000 · Filter Q = 80 · Sample rate (Hz) = 48000.

b0 = 0.999184876267. b1 = -1.981273422275 · b2 = 0.999184876267 · a0 = 1 · a1 = -1.981273422275 · a2 = 0.998369752535. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

A higher Q gives a longer transient. Run the test tone long enough for the steady-state response to emerge.

Alternate project rate

Notch frequency (Hz) = 1000 · Filter Q = 10 · Sample rate (Hz) = 44100.

b0 = 0.992950334723. b1 = -1.965778476856 · b2 = 0.992950334723 · a0 = 1 · a1 = -1.965778476856 · a2 = 0.985900669446. Denominator uses positive coefficient notation: 1 + a1 z⁻¹ + a2 z⁻².

A sample-rate change alters the normalized frequency. Recompute all coefficients together when switching sessions.

Interpreting the result

Run an impulse test and compare its spectrum with the intended response before filtering a full take. A recurrence that adds stored feedback coefficients needs the negative of the displayed a1 and a2. Preserve adequate numerical precision for very low frequencies or high Q. Coefficient rounding can limit the depth of a real notch.

When comparing two Q settings, apply both to the same sustained test signal and keep your measurement window fixed. A short FFT can make two narrow notches appear identical. An impulse response or a stepped sine sweep with adequate settling can reveal the difference between coefficient behavior and insufficient measurement resolution.

Measurement and model limits

Sample rate and centre frequency must be in hertz. A centre specified in radians per sample or as a fraction of Nyquist needs conversion before entry.

Answers before you play

Common questions

Which entries repeat?

The numerator is symmetric, so b2 equals b0. After normalization a1 also equals b1 for this specific notch design.

Does a mains-frequency setting remove its harmonics?

One section targets one centre frequency. Check the spectrum for harmonics before deciding whether other sections are needed.

Why does the tone persist briefly?

A narrow section needs time to settle. Initial conditions and frequency drift can both leave energy near the design frequency.

Can I reuse coefficients after resampling?

Recalculate with the new sample rate. The same numbers locate a zero at the same normalized frequency, which now corresponds to different hertz.