Skip to content

Commit

Permalink
Call NS AnalyzeCaptureAudio before AEC
Browse files Browse the repository at this point in the history
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@7289 4adac7df-926f-26a2-2b94-8c16560cd09d
  • Loading branch information
aluebs@webrtc.org committed Sep 24, 2014
1 parent 70e2d11 commit a0ce9fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
Binary file modified data/audio_processing/output_data_float.pb
Binary file not shown.
2 changes: 1 addition & 1 deletion webrtc/modules/audio_processing/audio_processing_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
36 changes: 18 additions & 18 deletions webrtc/modules/audio_processing/test/audio_processing_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit a0ce9fa

Please sign in to comment.