Fix the DC gain compensation in SC
This commit is contained in:
parent
f231be1b1e
commit
a7bc90050e
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue