AEC3: Adaptive handling of echo path with strong high-frequency gain

This CL adds adaptive handling of platforms where the echo path has
a strong gain above 10 kHz. A configurable offset is adaptively applied
depending on the amount of echo and mode of the echo suppressor.

Bug: webrtc:9663
Change-Id: I27dde6dc23b04a76a3be8c49d7fc9e226b9137e6
Reviewed-on: https://webrtc-review.googlesource.com/95947
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24448}
This commit is contained in:
Per Åhgren
2018-08-27 14:19:35 +02:00
committed by Commit Bot
parent 01a89904c0
commit fde4aa9909
6 changed files with 114 additions and 67 deletions

View File

@ -28,11 +28,13 @@ namespace aec3 {
TEST(SuppressionGain, NullOutputGains) {
std::array<float, kFftLengthBy2Plus1> E2;
std::array<float, kFftLengthBy2Plus1> R2;
std::array<float, kFftLengthBy2Plus1> S2;
std::array<float, kFftLengthBy2Plus1> N2;
FftData E;
FftData Y;
E2.fill(0.f);
R2.fill(0.f);
S2.fill(0.1f);
N2.fill(0.f);
E.re.fill(0.f);
E.im.fill(0.f);
@ -43,7 +45,7 @@ TEST(SuppressionGain, NullOutputGains) {
AecState aec_state(EchoCanceller3Config{});
EXPECT_DEATH(
SuppressionGain(EchoCanceller3Config{}, DetectOptimization(), 16000)
.GetGain(E2, R2, N2, E, Y,
.GetGain(E2, S2, R2, N2, E, Y,
RenderSignalAnalyzer((EchoCanceller3Config{})), aec_state,
std::vector<std::vector<float>>(
3, std::vector<float>(kBlockSize, 0.f)),
@ -60,6 +62,7 @@ TEST(SuppressionGain, BasicGainComputation) {
RenderSignalAnalyzer analyzer(EchoCanceller3Config{});
float high_bands_gain;
std::array<float, kFftLengthBy2Plus1> E2;
std::array<float, kFftLengthBy2Plus1> S2;
std::array<float, kFftLengthBy2Plus1> Y2;
std::array<float, kFftLengthBy2Plus1> R2;
std::array<float, kFftLengthBy2Plus1> N2;
@ -81,6 +84,7 @@ TEST(SuppressionGain, BasicGainComputation) {
E2.fill(10.f);
Y2.fill(10.f);
R2.fill(0.1f);
S2.fill(0.1f);
N2.fill(100.f);
output.Reset();
y.fill(0.f);
@ -102,7 +106,7 @@ TEST(SuppressionGain, BasicGainComputation) {
subtractor.FilterImpulseResponse(),
*render_delay_buffer->GetRenderBuffer(), E2, Y2, output,
y);
suppression_gain.GetGain(E2, R2, N2, E, Y, analyzer, aec_state, x,
suppression_gain.GetGain(E2, S2, R2, N2, E, Y, analyzer, aec_state, x,
&high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
@ -112,6 +116,7 @@ TEST(SuppressionGain, BasicGainComputation) {
E2.fill(100.f);
Y2.fill(100.f);
R2.fill(0.1f);
S2.fill(0.1f);
N2.fill(0.f);
E.re.fill(sqrtf(E2[0]));
Y.re.fill(sqrtf(Y2[0]));
@ -121,7 +126,7 @@ TEST(SuppressionGain, BasicGainComputation) {
subtractor.FilterImpulseResponse(),
*render_delay_buffer->GetRenderBuffer(), E2, Y2, output,
y);
suppression_gain.GetGain(E2, R2, N2, E, Y, analyzer, aec_state, x,
suppression_gain.GetGain(E2, S2, R2, N2, E, Y, analyzer, aec_state, x,
&high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
@ -133,7 +138,7 @@ TEST(SuppressionGain, BasicGainComputation) {
E.re.fill(sqrtf(E2[0]));
for (int k = 0; k < 10; ++k) {
suppression_gain.GetGain(E2, R2, N2, E, Y, analyzer, aec_state, x,
suppression_gain.GetGain(E2, S2, R2, N2, E, Y, analyzer, aec_state, x,
&high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),