From a7bc90050ef71e9df53d113ae224144c1222e007 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 2 Sep 2022 13:48:46 +0200 Subject: [PATCH] Fix the DC gain compensation in SC --- plugins/spectral_compressor/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/spectral_compressor/src/lib.rs b/plugins/spectral_compressor/src/lib.rs index 4fe17b4b..e9b123c4 100644 --- a/plugins/spectral_compressor/src/lib.rs +++ b/plugins/spectral_compressor/src/lib.rs @@ -534,8 +534,11 @@ fn process_stft_main( if params.global.dc_filter.value { complex_fft_buffer[..first_non_dc_bin_idx].fill(Complex32::default()); } else { + // The `output_gain` parameter also contains gain compensation for the windowingq, we don't + // want to compensate for that + let output_gain_recip = params.global.output_gain.value.recip(); for bin in complex_fft_buffer[..first_non_dc_bin_idx].iter_mut() { - *bin *= -output_gain; + *bin *= output_gain_recip; } }