1
0
Fork 0

Fix the DC gain compensation in SC

This commit is contained in:
Robbert van der Helm 2022-09-02 13:48:46 +02:00
parent f231be1b1e
commit a7bc90050e

View file

@ -534,8 +534,11 @@ fn process_stft_main(
if params.global.dc_filter.value { if params.global.dc_filter.value {
complex_fft_buffer[..first_non_dc_bin_idx].fill(Complex32::default()); complex_fft_buffer[..first_non_dc_bin_idx].fill(Complex32::default());
} else { } 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() { for bin in complex_fft_buffer[..first_non_dc_bin_idx].iter_mut() {
*bin *= -output_gain; *bin *= output_gain_recip;
} }
} }