mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix normalization in biquad->LP FIR conversion
This commit is contained in:
@@ -379,7 +379,7 @@ impl FirCoefficients {
|
|||||||
// Since this final filter will be symmetrical around `impulse_response[CENTER_IDX]`, we
|
// Since this final filter will be symmetrical around `impulse_response[CENTER_IDX]`, we
|
||||||
// can simply normalize based on that fact:
|
// can simply normalize based on that fact:
|
||||||
let would_be_impulse_response_sum =
|
let would_be_impulse_response_sum =
|
||||||
impulse_response.iter().skip(CENTER_IDX - 1).sum::<f32x2>() * f32x2::splat(2.0)
|
(impulse_response.iter().skip(CENTER_IDX).sum::<f32x2>() * f32x2::splat(2.0))
|
||||||
- impulse_response[CENTER_IDX];
|
- impulse_response[CENTER_IDX];
|
||||||
let would_be_impulse_response_recip = would_be_impulse_response_sum.recip();
|
let would_be_impulse_response_recip = would_be_impulse_response_sum.recip();
|
||||||
for sample in &mut impulse_response {
|
for sample in &mut impulse_response {
|
||||||
|
|||||||
Reference in New Issue
Block a user