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

Side by Side Diff: webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.h

Issue 2419563003: Add algorithm for Residual Echo Detector. (Closed)
Patch Set: Merged residual_echo_detector and echo_detector. 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_NORMALIZED_COVARIANCE_ESTI MATOR_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_NORMALIZED_COVARIANCE_ESTI MATOR_H_
13
14 namespace webrtc {
15
16 // This class iteratively estimates the normalized covariance between two
17 // signals.
18 class NormalizedCovarianceEstimator {
19 public:
20 void Update(float x,
21 float x_mean,
22 float x_var,
23 float y,
24 float y_mean,
25 float y_var);
26 // This function returns an estimate of the Pearson product-moment correlation
27 // coefficient of the two signals.
28 float normalized_cross_correlation() const {
29 return normalized_cross_correlation_;
30 }
31 // This function resets the estimated values to zero.
32 void Clear();
33
34 private:
35 float normalized_cross_correlation_ = 0.f;
36 // Estimate of the covariance value.
37 float covariance_ = 0.f;
38 };
39
40 } // namespace webrtc
41
42 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_NORMALIZED_COVARIANCE_E STIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698