hopefully...

This commit is contained in:
Stefano D'Angelo 2023-01-12 17:07:14 +01:00
parent ac0d98f2da
commit 233a016ba4

View File

@ -223,13 +223,13 @@ static inline void _bw_ls2_update_mm2_params(bw_ls1_coeffs *BW_RESTRICT coeffs)
coeffs->bw_Q = (bw_pow2f_3(0.5f * coeffs->bandiwdth) * bw_sqrtf_2(coeffs->peak_gain)) * bw_rcpf_2(bw_pow2f_3(coeffs->bandiwdth) - 1.f);
bw_mm2_set_Q(&coeffs->mm2_coeffs, coeffs->bw_Q);
}
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, coeffs->peak_gain * bw_rcpf_2(coeffs->bw_Q) - 1.f);
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf_2(coeffs->bw_Q));
}
} else {
if (coeffs->param_changed & (_BW_PEAK_PARAM_PEAK_GAIN | _BW_PEAK_PARAM_Q) {
if (coeffs->param_changed & _BW_PEAK_PARAM_Q)
bw_mm2_set_Q(&coeffs->mm2_coeffs, coeffs->Q);
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, coeffs->peak_gain * bw_rcpf_2(coeffs->Q) - 1.f);
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf_2(coeffs->Q));
}
}
coeffs->param_changed = 0;