Correct the FFT windowing when computing the AEC NLP gain

This CL adds an nonwindowed spectrum of the linear filter error
to use in the NLP computation.

Bug: webrtc:8661
Change-Id: I45bc9bb3eb8eeac0c5d6adb414638eb12b635a27
Reviewed-on: https://webrtc-review.googlesource.com/38701
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21583}
This commit is contained in:
Per Åhgren
2018-01-11 10:29:49 +01:00
committed by Commit Bot
parent e357a4dd4e
commit d20639f1f6
10 changed files with 66 additions and 41 deletions

View File

@ -157,8 +157,8 @@ void EchoRemoverImpl::ProcessCapture(
FftData comfort_noise;
FftData high_band_comfort_noise;
SubtractorOutput subtractor_output;
FftData& E_main = subtractor_output.E_main;
auto& E2_main = subtractor_output.E2_main;
FftData& E_main_nonwindowed = subtractor_output.E_main_nonwindowed;
auto& E2_main = subtractor_output.E2_main_nonwindowed;
auto& E2_shadow = subtractor_output.E2_shadow;
auto& e_main = subtractor_output.e_main;
@ -170,8 +170,9 @@ void EchoRemoverImpl::ProcessCapture(
&subtractor_output);
// Compute spectra.
fft_.ZeroPaddedFft(y0, &Y);
LinearEchoPower(E_main, Y, &S2_linear);
// fft_.ZeroPaddedFft(y0, Aec3Fft::Window::kHanning, &Y);
fft_.ZeroPaddedFft(y0, Aec3Fft::Window::kRectangular, &Y);
LinearEchoPower(E_main_nonwindowed, Y, &S2_linear);
Y.Spectrum(optimization_, Y2);
// Update the AEC state information.