Library / Signal processing and digital filters / DSP-39
Signal processing and digital filters
Digital notch biquad coefficients
Coefficients of a second-order notch with centre f0 and half-power bandwidth BW, where ω₀ = 2πf0/fs, Q = f0/BW and g = 1/(1 + tan(ω₀/(2Q))).
- Ref
- DSP-39
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- g
A second-order digital notch with centre ω₀ = 2πf0/fs and half-power bandwidth BW has Q = f0/BW and g = 1/(1 + tan(ω₀/(2Q))). The numerator is g[1, −2cos ω₀, 1], with zeros on the unit circle at the notch angle, and the denominator is [1, −2g cos ω₀, 2g − 1]. So a₁ = b₁, and the gain at the centre is exactly zero.
Coefficients of a second-order notch with centre f0 and half-power bandwidth BW, where ω₀ = 2πf0/fs, Q = f0/BW and g = 1/(1 + tan(ω₀/(2Q))). Both f0 and BW are below fs/2. The page returns the gain g = b₀; b₁, a₁ and a₂ are in the derived rows.
Calculator
- b₁ (and a₁), −2g cos ω₀−1.522
- a₂, 2g − 10.8816
- Quality factor, Q = f₀/BW5
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The notch at 100 Hz with 20 BW has g = 0.9408, so b = [0.9408, −1.522, 0.9408] and a₂ = 0.8816.
- A narrower notch pushes g towards 1 and the poles towards the unit circle, so it removes less of the neighbouring spectrum but rings longer.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| BW Half-power bandwidth | 1 to 200 Hz | 0.5792 | 0.9969 | 0.4177 | +10% | −0.59 % |
| fs Sampling rate | 250 to 100,000 Hz | 0.7957 | 0.9994 | 0.2037 | +10% | +0.542 % |
| f0 Notch frequency | 10 to 490 Hz | 0.9408 | 0.9408 | 0 | +10% | 0 % |
Sweep of Half-power bandwidth
| Half-power bandwidth (Hz) | Gain g (= b₀) |
|---|---|
| 1 | 0.9969 |
| 25.88 | 0.9247 |
| 50.75 | 0.8615 |
| 75.63 | 0.8051 |
| 100.5 | 0.7538 |
| 125.4 | 0.7064 |
| 150.3 | 0.662 |
| 175.1 | 0.6198 |
| 200 | 0.5792 |
Sweep one variable
Variables and how each one contributes
Gain g (= b₀)
What the equation gives you. Everything else feeds it.
Notch frequency
The notch frequency, in Hz. Moves the notch; a higher frequency raises ω₀ and changes b₁ and a₁ through cos ω₀. Raising it by 10 % (to 110) moves the result by +0 %, from 0.9408 to 0.9408.
Half-power bandwidth
The half-power bandwidth, in Hz. A wider notch gives a smaller g, so a lower b₀ and a smaller a₂. Raising it by 10 % (to 22) moves the result by −0.59 %, from 0.9408 to 0.9353.
Sampling rate
The sampling rate, in Hz. A higher rate lowers ω₀ and the normalised bandwidth, so g rises towards 1. Raising it by 10 % (to 1,100) moves the result by +0.542 %, from 0.9408 to 0.9459.
Worked example with the values above
- Frequency: ω₀ = 2π × 100 / 1,000 = 0.62832 rad; Q = 5.
- Tangent: tan(ω₀/(2Q)) = tan(0.062832) = 0.062915.
- g = 1 / (1 + 0.062915) = 0.94081; b = g[1, −1.618, 1], a₂ = 0.88162.
Assumptions and limits
- A real, linear, time-invariant second-order section with the leading denominator coefficient normalised to one.
- Exact arithmetic; fixed-point overflow and round-off noise are not included.
Common mistakes
- Using the unnormalised a₀ ≠ 1 coefficients without dividing through.
- Taking the pole angle as the frequency of peak gain.
- Treating a stability margin close to zero as safe in finite precision.
Statistics and uncertainty
Coefficient quantisation moves poles: in fixed point or single precision, poles close to the unit circle (r above about 0.999) can drift to instability, so check the margin with the rounded coefficients.
Where it is used
- Checking and designing recursive filters such as notches and resonators.
- Estimating ringing time and oscillation frequency from pole locations.
Maths you need
- Poles: roots of the denominator polynomial in z
- Unit circle: |z| = 1, the stability boundary
- Difference equation: the time-domain form of a recursive filter