Your Equation

Library / Signal processing and digital filters / DSP-36

Signal processing and digital filters

One output step of a normalised biquad

Next output of a second-order IIR section with denominator 1 + a1z⁻¹ + a2z⁻² (divide all coefficients by a0 first if a0 ≠ 1).

Ref
DSP-36
Rev
v1
Field
Signal processing and digital filters
Result
y[n] [V]

A second-order recursive section computes y[n] = b₀x[n] + b₁x[n − 1] + b₂x[n − 2] − a₁y[n − 1] − a₂y[n − 2]. The feed-forward part uses the latest inputs and the feedback part uses the previous outputs, with the denominator normalised to 1 + a₁z⁻¹ + a₂z⁻². If a₀ is not 1, divide every coefficient by it first.

Next output of a second-order IIR section with denominator 1 + a1z⁻¹ + a2z⁻² (divide all coefficients by a0 first if a0 ≠ 1). The inputs are the three newest input samples (newest first, slots 0 to 2) and the previous two outputs (newest first).

Calculator

Solve for
V
−22
−22
−22
V
−1010
V
−1010
V
−1010
−22
−11
V
−1010
V
−1010
  • Feed-forward part, b₀x[n] + b₁x[n − 1] + b₂x[n − 2]0.4 V
  • Feedback part, a₁y[n − 1] + a₂y[n − 2]−0.36 V
  • Stability margin of the denominator0.6

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.

Output sample (V) current value 0.76 V
y[n-1]Previous outputKey driver
−4.645.36
b1Numerator coefficient b₁
−3.444.56
b0Numerator coefficient b₀
−1.442.56
x[n]Current input
−1.442.56
a1Denominator coefficient a₁
−1.241.96
x[n-1]Previous input
−0.441.56
y[n-2]Output two samples back
−0.21.8
x[n-2]Input two samples back
−0.241.76
a2Denominator coefficient a₂
0.41.2
b2Numerator coefficient b₂
  • The next output is 0.76 V: 0.4 V from the inputs and 0.36 V from the fed-back outputs.
  • The denominator is stable, so the fed-back part dies away if the input stops.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing (V)Local stepChange in result
y[n-1] Previous output−10 to 10 V−4.645.3610+0.4 V+26.3 %
b1 Numerator coefficient b₁−2 to 2 −3.444.568+0.08 +21.1 %
b0 Numerator coefficient b₀−2 to 2 −1.442.564+0.08 +10.5 %
x[n] Current input−10 to 10 V−1.442.564+0.4 V+10.5 %
a1 Denominator coefficient a₁−2 to 2 −1.241.963.2+0.08 −8.42 %
x[n-1] Previous input−10 to 10 V−0.441.562+0.4 V+5.26 %
y[n-2] Output two samples back−10 to 10 V−0.21.82+0.4 V−5.26 %
x[n-2] Input two samples back−10 to 10 V−0.241.762+0.4 V+5.26 %
a2 Denominator coefficient a₂−1 to 1 0.41.20.8+0.04 −2.11 %
b2 Numerator coefficient b₂−2 to 2 0.760.760+0.08 0 %

Sweep of Current input

Current input (V)Output sample (V)
−10−1.44
−7.5−0.94
−5−0.44
−2.50.06
00.56
2.51.06
51.56
7.52.06
102.56

Sweep one variable

Output sample (V)Hover, touch, or use the arrow keys on the chart
−1012 −10−50510 Current input (V) now 0.76

Variables and how each one contributes

y[n]

Output sample

Result · V

What the equation gives you. Everything else feeds it.

b0

Numerator coefficient b₀

· typical −2 to 2

The numerator coefficient for the current input. Scales the effect of the newest input sample directly. Raising it by 10 % (to 0.22) moves the result by +2.63 %, from 0.76 to 0.78 V.

b1

Numerator coefficient b₁

· typical −2 to 2

The numerator coefficient for the previous input. Weights x[n − 1] in the output. Raising it by 10 % (to 0.11) moves the result by +2.63 %, from 0.76 to 0.78 V.

b2

Numerator coefficient b₂

· typical −2 to 2

The numerator coefficient for the input two samples back. Weights x[n − 2] in the output. Raising it by 10 % (to 0.11) moves the result by +0 %, from 0.76 to 0.76 V.

x[n]

Current input

V · typical −10 to 10

The current input x[n], in V. Enters through b₀. Raising it by 10 % (to 1.1) moves the result by +2.63 %, from 0.76 to 0.78 V.

x[n-1]

Previous input

V · typical −10 to 10

The previous input x[n − 1], in V. Enters through b₁. Raising it by 10 % (to 2.2) moves the result by +2.63 %, from 0.76 to 0.78 V.

x[n-2]

Input two samples back

V · typical −10 to 10

The input x[n − 2], in V. Enters through b₂. Raising it by 10 % (to 0) moves the result by +0 %, from 0.76 to 0.76 V.

a1

Denominator coefficient a₁

· typical −2 to 2

The first denominator coefficient. Feeds back the previous output with the opposite sign; it sets the pole angle together with a₂. Raising it by 10 % (to −0.55) moves the result by +5.26 %, from 0.76 to 0.8 V.

a2

Denominator coefficient a₂

· typical −1 to 1

The second denominator coefficient. Feeds back the output from two samples ago; it sets the pole radius squared. Raising it by 10 % (to 0.11) moves the result by −0.526 %, from 0.76 to 0.756 V.

y[n-1]

Previous output

V · typical −10 to 10

The previous output y[n − 1], in V. Is fed back through −a₁. Raising it by 10 % (to 0.88) moves the result by +5.26 %, from 0.76 to 0.8 V.

y[n-2]

Output two samples back

V · typical −10 to 10

The output y[n − 2], in V. Is fed back through −a₂. Raising it by 10 % (to 0.44) moves the result by −0.526 %, from 0.76 to 0.756 V.

Worked example with the values above

  1. Feed-forward: 0.2 × 1 + 0.1 × 2 + 0.1 × 0 = 0.4 V.
  2. Feedback: −0.5 × 0.8 + 0.1 × 0.4 = −0.36 V.
  3. y[n] = 0.4 − (−0.36) = 0.76 V.

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

Related formulas

Practise this formula