From 765edc34257a439bb3d9acc7d4c6aaf205b4e11f Mon Sep 17 00:00:00 2001 From: ivoc Date: Thu, 17 Nov 2016 07:10:16 -0800 Subject: [PATCH] Update the alpha value in the echo detector. BUG=webrtc:6525 Review-Url: https://codereview.webrtc.org/2506643002 Cr-Commit-Position: refs/heads/master@{#15136} --- .../echo_detector/mean_variance_estimator.cc | 2 +- .../echo_detector/mean_variance_estimator_unittest.cc | 6 +++--- .../echo_detector/normalized_covariance_estimator.cc | 2 +- .../audio_processing/residual_echo_detector_unittest.cc | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator.cc b/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator.cc index e1236159e1..06baf68b8a 100644 --- a/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator.cc +++ b/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator.cc @@ -18,7 +18,7 @@ namespace webrtc { namespace { // Parameter controlling the adaptation speed. -constexpr float kAlpha = 0.01f; +constexpr float kAlpha = 0.001f; } // namespace diff --git a/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator_unittest.cc b/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator_unittest.cc index ec4350f45e..ba45745606 100644 --- a/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator_unittest.cc +++ b/webrtc/modules/audio_processing/echo_detector/mean_variance_estimator_unittest.cc @@ -31,7 +31,7 @@ TEST(MeanVarianceEstimatorTests, InsertTwoValues) { TEST(MeanVarianceEstimatorTests, InsertZeroes) { MeanVarianceEstimator test_estimator; // Insert the same value many times. - for (size_t i = 0; i < 10000; i++) { + for (size_t i = 0; i < 20000; i++) { test_estimator.Update(0.f); } EXPECT_EQ(test_estimator.mean(), 0.f); @@ -40,7 +40,7 @@ TEST(MeanVarianceEstimatorTests, InsertZeroes) { TEST(MeanVarianceEstimatorTests, ConstantValueTest) { MeanVarianceEstimator test_estimator; - for (size_t i = 0; i < 10000; i++) { + for (size_t i = 0; i < 20000; i++) { test_estimator.Update(3.f); } // The mean should be close to three, and the standard deviation should be @@ -51,7 +51,7 @@ TEST(MeanVarianceEstimatorTests, ConstantValueTest) { TEST(MeanVarianceEstimatorTests, AlternatingValueTest) { MeanVarianceEstimator test_estimator; - for (size_t i = 0; i < 10000; i++) { + for (size_t i = 0; i < 20000; i++) { test_estimator.Update(1.f); test_estimator.Update(-1.f); } diff --git a/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc b/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc index aad806d0e4..0b8b68bfbd 100644 --- a/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc +++ b/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc @@ -14,7 +14,7 @@ namespace webrtc { namespace { // Parameter controlling the adaptation speed. -constexpr float kAlpha = 0.01f; +constexpr float kAlpha = 0.001f; } // namespace diff --git a/webrtc/modules/audio_processing/residual_echo_detector_unittest.cc b/webrtc/modules/audio_processing/residual_echo_detector_unittest.cc index cde731d769..0784a4f9f7 100644 --- a/webrtc/modules/audio_processing/residual_echo_detector_unittest.cc +++ b/webrtc/modules/audio_processing/residual_echo_detector_unittest.cc @@ -91,8 +91,8 @@ TEST(ResidualEchoDetectorTests, EchoWithRenderClockDrift) { // render buffer, clock drift can only be discovered after a certain delay. // A growing buffer can be caused by jitter or clock drift and it's not // possible to make this decision right away. For this reason we only expect - // an echo likelihood of 80% in this test. - EXPECT_GT(echo_detector.echo_likelihood(), 0.8f); + // an echo likelihood of 75% in this test. + EXPECT_GT(echo_detector.echo_likelihood(), 0.75f); } TEST(ResidualEchoDetectorTests, EchoWithCaptureClockDrift) {