STA328
User programmable processing
7
User programmable processing
7.1
EQ - biquad equation
The biquads use the equation that follows. This is diagrammed in Figure 18 below.
Y[n] = 2(b0/2)X[n] + 2(b1/2)X[n - 1] + b2X[n - 2] - 2(a1/2)Y[n - 1] - a2Y[n - 2]
= b0X[n] + b1X[n - 1] + b2X[n - 2] - a1Y[n - 1] - a2Y[n - 2]
where Y[n] represents the output and X[n] represents the input. Multipliers are 28-bit signed
fractional multipliers, with coefficient values in the range of 0x800000 (-1) to 0x7FFFFF
(0.9999998808).
Coefficients stored in the user defined coefficient RAM are referenced in the following
manner:
" CxHy0 = b1/2
" CxHy1 = b2
" CxHy2 = -a1/2
" CxHy3 = -a2
" CxHy4 = b0/2
The x represents the channel and the y the biquad number. For example C3H41 is the b0/2
coefficient in the fourth biquad for channel 3
Figure 18. Biquad filter
b0 /2
2
Z -1
b1 /2
2
Z -1
b2
+
Z -1
+
2
-a1 /2
Z -1
+
-a2
7.2
Pre-scale
The pre-scale block which precedes the first biquad is used for attenuation when filters are
designed that boost frequencies above 0 dBFS. This is a single 28-bit signed multiplier, with
0x800000 = -1 and 0x7FFFFF = 0.9999998808. By default, all pre-scale factors are set to
0x7FFFFF.
7.3
Post-scale
The STA328 provides one additional multiplication after the last interpolation stage and
before the distortion compensation on each channel. This is a 24-bit signed fractional
multiplier. The scale factor for this multiplier is loaded into RAM using the same I2C registers
as the biquad coefficients and the mix. All channels can use the same settings as channel 1
by setting the post-scale link bit.
45/57