neural_residual_echo_estimator.h (1986B)
1 /* 2 * Copyright (c) 2025 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 API_AUDIO_NEURAL_RESIDUAL_ECHO_ESTIMATOR_H_ 12 #define API_AUDIO_NEURAL_RESIDUAL_ECHO_ESTIMATOR_H_ 13 14 #include <array> 15 16 #include "api/array_view.h" 17 18 namespace webrtc { 19 20 // Interface for a neural residual echo estimator module injected into the echo 21 // canceller. 22 // This estimator estimates the echo residual that is not fully removed by the 23 // linear AEC3 estimator. 24 class NeuralResidualEchoEstimator { 25 public: 26 virtual ~NeuralResidualEchoEstimator() {} 27 // Estimates residual echo power spectrum in the signal after linear AEC 28 // subtraction. Returns two estimates: 29 // * R2: A conservative estimate. 30 // * R2_unbounded: A less conservative estimate. 31 // 32 // Input signals: 33 // * x: Render signal (time-domain) 34 // * y: Microphone signal (time-domain) 35 // * e: Output from linear subtraction stage (time-domain) 36 // 37 // Input power spectra: 38 // * S2: Linear echo estimate 39 // * Y2: Microphone input 40 // * E2: Output of linear stage 41 virtual void Estimate(ArrayView<const float> x, 42 ArrayView<const std::array<float, 64>> y, 43 ArrayView<const std::array<float, 64>> e, 44 ArrayView<const std::array<float, 65>> S2, 45 ArrayView<const std::array<float, 65>> Y2, 46 ArrayView<const std::array<float, 65>> E2, 47 ArrayView<std::array<float, 65>> R2, 48 ArrayView<std::array<float, 65>> R2_unbounded) = 0; 49 }; 50 } // namespace webrtc 51 52 #endif // API_AUDIO_NEURAL_RESIDUAL_ECHO_ESTIMATOR_H_