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

@ -44,7 +44,8 @@ TEST(Aec3Fft, NullIfftOutput) {
TEST(Aec3Fft, NullZeroPaddedFftOutput) {
Aec3Fft fft;
std::array<float, kFftLengthBy2> x;
EXPECT_DEATH(fft.ZeroPaddedFft(x, nullptr), "");
EXPECT_DEATH(fft.ZeroPaddedFft(x, Aec3Fft::Window::kRectangular, nullptr),
"");
}
// Verifies that the check for input length in ZeroPaddedFft works.
@ -52,7 +53,7 @@ TEST(Aec3Fft, ZeroPaddedFftWrongInputLength) {
Aec3Fft fft;
FftData X;
std::array<float, kFftLengthBy2 - 1> x;
EXPECT_DEATH(fft.ZeroPaddedFft(x, &X), "");
EXPECT_DEATH(fft.ZeroPaddedFft(x, Aec3Fft::Window::kRectangular, &X), "");
}
// Verifies that the check for non-null output in PaddedFft works.
@ -167,7 +168,7 @@ TEST(Aec3Fft, ZeroPaddedFft) {
x_in[j] = v++;
x_ref[j + kFftLengthBy2] = x_in[j] * 64.f;
}
fft.ZeroPaddedFft(x_in, &X);
fft.ZeroPaddedFft(x_in, Aec3Fft::Window::kRectangular, &X);
fft.Ifft(X, &x_out);
for (size_t j = 0; j < x_out.size(); ++j) {
EXPECT_NEAR(x_ref[j], x_out[j], 0.1f);