frac32buffer.bipolar in
frac32buffer.bipolar L
frac32buffer.bipolar H
int32_t lp = 0;
int32_t r = 137;
int32_t a = 1 << 27;
int32_t as = 1 << 27;
int32_t as2 = 1 << 27;
// 1/4 chance to change filter coef
if ((r = r * 69069 + 1) > (0x40000000)) {
// random filter coefficient
a = (r = r * 69069 + 1) & 0x01FFFFFF;
}
// smoothed filter coefficient
// q27 q27 q22 q27
as = ___SMMLA(4 << 21, a - as, as >> 5) << 5;
as2 = ___SMMLA(4 << 21, as - as2, as2 >> 5) << 5;
// low pass
// q27 q27 q22 q27
lp = ___SMMLA(as2, inlet_in - lp, lp >> 5) << 5;
outlet_L = lp;
outlet_H = inlet_in - lp;