From 85b5766ba62b2ffdbe0acd8222653dc1cb32c7ae Mon Sep 17 00:00:00 2001 From: "aluebs@webrtc.org" Date: Wed, 24 Sep 2014 14:18:03 +0000 Subject: Call NS AnalyzeCaptureAudio before AEC This attenuates the noise pumping generated from the NS adapting to the AEC comfort noise. When there is echo present the AEC suppresses it and adds comfort noise. This is underestimated on purpose to avoid adding more than the original background noise. The NS has to be called after the AEC, because every non-linear processing before it can ruin its performance. Therefore the noise estimation can adapt to this comfort noise, making it less aggressive and generating noise pumping. By putting the noise estimation analysis stage from the NS before the AEC, this effect can be avoided. This has been tested manually on recordings where noise pumping was present: Two long recordings done in our team by bjornv and kwiberg plus the most noisy (5) recordings in the QA set. On the other hand, one risk of doing this is to not adapt to the comfort noise and therefore suppress too much. As verified in the tested files, this is not a problem in practice. BUG=webrtc:3763 R=andrew@webrtc.org, bjornv@webrtc.org Review URL: https://webrtc-codereview.appspot.com/24679004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7289 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/audio_processing/audio_processing_impl.cc | 2 +- .../test/audio_processing_unittest.cc | 36 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc index 659b794a..49a7d4f5 100644 --- a/modules/audio_processing/audio_processing_impl.cc +++ b/modules/audio_processing/audio_processing_impl.cc @@ -482,12 +482,12 @@ int AudioProcessingImpl::ProcessStreamLocked() { RETURN_ON_ERR(high_pass_filter_->ProcessCaptureAudio(ca)); RETURN_ON_ERR(gain_control_->AnalyzeCaptureAudio(ca)); + RETURN_ON_ERR(noise_suppression_->AnalyzeCaptureAudio(ca)); RETURN_ON_ERR(echo_cancellation_->ProcessCaptureAudio(ca)); if (echo_control_mobile_->is_enabled() && noise_suppression_->is_enabled()) { ca->CopyLowPassToReference(); } - RETURN_ON_ERR(noise_suppression_->AnalyzeCaptureAudio(ca)); RETURN_ON_ERR(noise_suppression_->ProcessCaptureAudio(ca)); RETURN_ON_ERR(echo_control_mobile_->ProcessCaptureAudio(ca)); RETURN_ON_ERR(voice_detection_->ProcessCaptureAudio(ca)); diff --git a/modules/audio_processing/test/audio_processing_unittest.cc b/modules/audio_processing/test/audio_processing_unittest.cc index af63bde3..3a35fe5b 100644 --- a/modules/audio_processing/test/audio_processing_unittest.cc +++ b/modules/audio_processing/test/audio_processing_unittest.cc @@ -2325,25 +2325,25 @@ TEST_P(AudioProcessingTest, Formats) { #if defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) INSTANTIATE_TEST_CASE_P( CommonFormats, AudioProcessingTest, testing::Values( - std::tr1::make_tuple(48000, 48000, 48000, 25), - std::tr1::make_tuple(48000, 48000, 32000, 25), - std::tr1::make_tuple(48000, 48000, 16000, 25), - std::tr1::make_tuple(48000, 44100, 48000, 20), - std::tr1::make_tuple(48000, 44100, 32000, 20), - std::tr1::make_tuple(48000, 44100, 16000, 20), - std::tr1::make_tuple(48000, 32000, 48000, 25), - std::tr1::make_tuple(48000, 32000, 32000, 25), - std::tr1::make_tuple(48000, 32000, 16000, 25), - std::tr1::make_tuple(48000, 16000, 48000, 25), - std::tr1::make_tuple(48000, 16000, 32000, 25), - std::tr1::make_tuple(48000, 16000, 16000, 25), + std::tr1::make_tuple(48000, 48000, 48000, 20), + std::tr1::make_tuple(48000, 48000, 32000, 20), + std::tr1::make_tuple(48000, 48000, 16000, 20), + std::tr1::make_tuple(48000, 44100, 48000, 15), + std::tr1::make_tuple(48000, 44100, 32000, 15), + std::tr1::make_tuple(48000, 44100, 16000, 15), + std::tr1::make_tuple(48000, 32000, 48000, 20), + std::tr1::make_tuple(48000, 32000, 32000, 20), + std::tr1::make_tuple(48000, 32000, 16000, 20), + std::tr1::make_tuple(48000, 16000, 48000, 20), + std::tr1::make_tuple(48000, 16000, 32000, 20), + std::tr1::make_tuple(48000, 16000, 16000, 20), std::tr1::make_tuple(44100, 48000, 48000, 20), std::tr1::make_tuple(44100, 48000, 32000, 20), std::tr1::make_tuple(44100, 48000, 16000, 20), - std::tr1::make_tuple(44100, 44100, 48000, 20), - std::tr1::make_tuple(44100, 44100, 32000, 20), - std::tr1::make_tuple(44100, 44100, 16000, 20), + std::tr1::make_tuple(44100, 44100, 48000, 15), + std::tr1::make_tuple(44100, 44100, 32000, 15), + std::tr1::make_tuple(44100, 44100, 16000, 15), std::tr1::make_tuple(44100, 32000, 48000, 20), std::tr1::make_tuple(44100, 32000, 32000, 20), std::tr1::make_tuple(44100, 32000, 16000, 20), @@ -2360,9 +2360,9 @@ INSTANTIATE_TEST_CASE_P( std::tr1::make_tuple(32000, 32000, 48000, 30), std::tr1::make_tuple(32000, 32000, 32000, 0), std::tr1::make_tuple(32000, 32000, 16000, 30), - std::tr1::make_tuple(32000, 16000, 48000, 25), - std::tr1::make_tuple(32000, 16000, 32000, 25), - std::tr1::make_tuple(32000, 16000, 16000, 25), + std::tr1::make_tuple(32000, 16000, 48000, 20), + std::tr1::make_tuple(32000, 16000, 32000, 20), + std::tr1::make_tuple(32000, 16000, 16000, 20), std::tr1::make_tuple(16000, 48000, 48000, 25), std::tr1::make_tuple(16000, 48000, 32000, 25), -- cgit v1.2.3