AEC3: Delay estimator adapts even when estimated echo saturates

Speeds up adaptation of the matched filter of the delay estimator by
allowing the estimated echo and the error signal (microphone minus
estimated echo) to be saturated. Only microphone saturation pauses
the filter adaptation.

Bug: webrtc:9773
Change-Id: I8b8400539fde3ee821f36a95818bece02ddd626b
Reviewed-on: https://webrtc-review.googlesource.com/101341
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24802}
This commit is contained in:
Gustaf Ullberg
2018-09-24 14:54:32 +02:00
committed by Commit Bot
parent c5744b8b21
commit 3f6077d22f

View File

@ -93,11 +93,7 @@ void MatchedFilterCore_NEON(size_t x_start_index,
// Compute the matched filter error.
float e = y[i] - s;
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
s >= 32000.f || s <= -32000.f || e >= 32000.f ||
e <= -32000.f;
e = std::min(32767.f, std::max(-32768.f, e));
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f;
(*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.
@ -209,11 +205,7 @@ void MatchedFilterCore_SSE2(size_t x_start_index,
// Compute the matched filter error.
float e = y[i] - s;
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
s >= 32000.f || s <= -32000.f || e >= 32000.f ||
e <= -32000.f;
e = std::min(32767.f, std::max(-32768.f, e));
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f;
(*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.
@ -281,11 +273,7 @@ void MatchedFilterCore(size_t x_start_index,
// Compute the matched filter error.
float e = y[i] - s;
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
s >= 32000.f || s <= -32000.f || e >= 32000.f ||
e <= -32000.f;
e = std::min(32767.f, std::max(-32768.f, e));
const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f;
(*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.