Changed linear filter error window in AEC3 to Hanning

Changing window type which improves the filter accuracy
at the cost of a slight reduction in convergence time.

Bug: webrtc:8661
Change-Id: Id0e5c66ec179f94471cbca0a2b8d1b94d8146ca6
Reviewed-on: https://webrtc-review.googlesource.com/34501
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21347}
This commit is contained in:
Per Åhgren 2017-12-19 10:16:58 +01:00 committed by Commit Bot
parent 1be5559fb0
commit d6c54cdc8e

View File

@ -22,20 +22,20 @@ namespace webrtc {
namespace {
const float kHamming64[64] = {
0.08f, 0.08228584f, 0.08912066f, 0.10043651f, 0.11612094f,
0.13601808f, 0.15993016f, 0.18761956f, 0.21881106f, 0.25319469f,
0.29042872f, 0.3301431f, 0.37194313f, 0.41541338f, 0.46012184f,
0.50562416f, 0.55146812f, 0.5971981f, 0.64235963f, 0.68650386f,
0.72919207f, 0.77f, 0.80852209f, 0.84437549f, 0.87720386f,
0.90668095f, 0.93251381f, 0.95444568f, 0.97225861f, 0.98577555f,
0.99486218f, 0.99942818f, 0.99942818f, 0.99486218f, 0.98577555f,
0.97225861f, 0.95444568f, 0.93251381f, 0.90668095f, 0.87720386f,
0.84437549f, 0.80852209f, 0.77f, 0.72919207f, 0.68650386f,
0.64235963f, 0.5971981f, 0.55146812f, 0.50562416f, 0.46012184f,
0.41541338f, 0.37194313f, 0.3301431f, 0.29042872f, 0.25319469f,
0.21881106f, 0.18761956f, 0.15993016f, 0.13601808f, 0.11612094f,
0.10043651f, 0.08912066f, 0.08228584f, 0.08f};
const float kHanning64[64] = {
0.f, 0.00248461f, 0.00991376f, 0.0222136f, 0.03926189f,
0.06088921f, 0.08688061f, 0.11697778f, 0.15088159f, 0.1882551f,
0.22872687f, 0.27189467f, 0.31732949f, 0.36457977f, 0.41317591f,
0.46263495f, 0.51246535f, 0.56217185f, 0.61126047f, 0.65924333f,
0.70564355f, 0.75f, 0.79187184f, 0.83084292f, 0.86652594f,
0.89856625f, 0.92664544f, 0.95048443f, 0.96984631f, 0.98453864f,
0.99441541f, 0.99937846f, 0.99937846f, 0.99441541f, 0.98453864f,
0.96984631f, 0.95048443f, 0.92664544f, 0.89856625f, 0.86652594f,
0.83084292f, 0.79187184f, 0.75f, 0.70564355f, 0.65924333f,
0.61126047f, 0.56217185f, 0.51246535f, 0.46263495f, 0.41317591f,
0.36457977f, 0.31732949f, 0.27189467f, 0.22872687f, 0.1882551f,
0.15088159f, 0.11697778f, 0.08688061f, 0.06088921f, 0.03926189f,
0.0222136f, 0.00991376f, 0.00248461f, 0.f};
void PredictionError(const Aec3Fft& fft,
const FftData& S,
@ -60,7 +60,7 @@ void PredictionError(const Aec3Fft& fft,
RTC_DCHECK_EQ(64, e->size());
RTC_DCHECK_LE(64, tmp.size());
std::transform(e->begin(), e->end(), std::begin(kHamming64), tmp.begin(),
std::transform(e->begin(), e->end(), std::begin(kHanning64), tmp.begin(),
[](float a, float b) { return a * b; });
fft.ZeroPaddedFft(rtc::ArrayView<const float>(tmp.data(), 64), E);