Corrected the detection of narrowband render signals

This CL corrects the bug that only looked at narrowband
render signals above 900 Hz and only assumed that the
influence of such lasted for 6 blocks, which resulted
in filter divergence and echo leakage.


Bug: webrtc:9008,chromium:821670
Change-Id: I9b2635d24b260e9d9a8c5c088ab663e03fb93c42
Reviewed-on: https://webrtc-review.googlesource.com/61800
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22434}
This commit is contained in:
Per Åhgren
2018-03-14 23:23:47 +01:00
committed by Commit Bot
parent ee205f5bba
commit 971de07713
9 changed files with 35 additions and 26 deletions

View File

@ -14,6 +14,7 @@
#include <array>
#include <memory>
#include "api/audio/echo_canceller3_config.h"
#include "api/optional.h"
#include "modules/audio_processing/aec3/aec3_common.h"
#include "modules/audio_processing/aec3/render_buffer.h"
@ -24,7 +25,7 @@ namespace webrtc {
// Provides functionality for analyzing the properties of the render signal.
class RenderSignalAnalyzer {
public:
RenderSignalAnalyzer();
explicit RenderSignalAnalyzer(const EchoCanceller3Config& config);
~RenderSignalAnalyzer();
// Updates the render signal analysis with the most recent render signal.
@ -46,6 +47,7 @@ class RenderSignalAnalyzer {
rtc::Optional<int> NarrowPeakBand() const { return narrow_peak_band_; }
private:
const int strong_peak_freeze_duration_;
std::array<size_t, kFftLengthBy2 - 1> narrow_band_counters_;
rtc::Optional<int> narrow_peak_band_;
size_t narrow_peak_counter_;