← All problems

IIR Biquad Filter (Direct Form II Transposed)

Hard · Sequential · SystemVerilog

Implement a second-order IIR biquad filter in Direct Form II Transposed. The filter realizes the transfer function:

$H(z) = \frac{b0 + b1 \cdot z^{-1} + b2 \cdot z^{-2}}{1 + a1 \cdot z^{-1} + a2 \cdot z^{-2}}$

where the denominator coefficient $a0$ is normalized to 1. All data samples and coefficients are represented in signed Q1.15 fixed-point format (1 sign bit, 0 integer bits, 15 fractional bits), carried in {W}-bit and {CW}-bit signed vectors respectively.

**Direct Form II Transposed update equations**

On each valid clock cycle the filter computes, in order:

$y[n] = b0 \cdot x[n] + w1[n-1]$ $w1[n] = b1 \cdot x[n] - a1 \cdot y[n] + w2[n-1]$ $w2[n] = b2 \cdot x[n] - a2 \cdot y[n]$

Open this challenge in the editor →