Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: webrtc/modules/audio_processing/residual_echo_detector.cc

Issue 2503843004: Add a reliability term to the echo detector. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_processing/residual_echo_detector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/residual_echo_detector.cc
diff --git a/webrtc/modules/audio_processing/residual_echo_detector.cc b/webrtc/modules/audio_processing/residual_echo_detector.cc
index 66b34ff10541c02550cf1f8ee65af319b3965aae..f72e3aedd8d54f04f157b589ebb0d22622820118 100644
--- a/webrtc/modules/audio_processing/residual_echo_detector.cc
+++ b/webrtc/modules/audio_processing/residual_echo_detector.cc
@@ -25,6 +25,7 @@ float Power(rtc::ArrayView<const float> input) {
constexpr size_t kLookbackFrames = 650;
// TODO(ivoc): Verify the size of this buffer.
constexpr size_t kRenderBufferSize = 30;
+constexpr float kAlpha = 0.001f;
} // namespace
@@ -100,6 +101,8 @@ void ResidualEchoDetector::AnalyzeCaptureAudio(
echo_likelihood_ = std::max(
echo_likelihood_, covariances_[delay].normalized_cross_correlation());
}
+ reliability_ = (1.0f - kAlpha) * reliability_ + kAlpha * 1.0f;
hlundin-webrtc 2016/11/16 09:46:30 How long until this converges to close enough to 1
ivoc 2016/11/16 12:30:38 After about a minute the reliability is at 0.9975
hlundin-webrtc 2016/11/17 08:14:45 Neither am I...
+ echo_likelihood_ *= reliability_;
int echo_percentage = static_cast<int>(echo_likelihood_ * 100);
RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ResidualEchoDetector.EchoLikelihood",
echo_percentage, 0, 100, 100 /* number of bins */);
« no previous file with comments | « webrtc/modules/audio_processing/residual_echo_detector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698