diff --git a/modules/audio_processing/aec3/suppression_gain.cc b/modules/audio_processing/aec3/suppression_gain.cc index 110c23279d..fbd2e405d9 100644 --- a/modules/audio_processing/aec3/suppression_gain.cc +++ b/modules/audio_processing/aec3/suppression_gain.cc @@ -26,21 +26,6 @@ namespace webrtc { namespace { -// Reduce gain to avoid narrow band echo leakage. -void NarrowBandAttenuation(int narrow_bin, - const std::array& nearend, - const std::array& echo, - std::array* gain) { - // TODO(peah): Verify that the condition below is not too conservative. - if (10.f * echo[narrow_bin] > nearend[narrow_bin]) { - const int upper_bin = - std::min(narrow_bin + 6, static_cast(kFftLengthBy2Plus1 - 1)); - for (int k = std::max(0, narrow_bin - 6); k <= upper_bin; ++k) { - (*gain)[k] = std::min((*gain)[k], 0.001f); - } - } -} - // Adjust the gains according to the presence of known external filters. void AdjustForExternalFilters(std::array* gain) { // Limit the low frequency gains to avoid the impact of the high-pass filter @@ -271,7 +256,6 @@ void AdjustNonConvergedFrequencies( // TODO(peah): Add further optimizations, in particular for the divisions. void SuppressionGain::LowerBandGain( bool low_noise_render, - const rtc::Optional& narrow_peak_band, const AecState& aec_state, const std::array& nearend, const std::array& echo, @@ -321,9 +305,6 @@ void SuppressionGain::LowerBandGain( linear_echo_estimate, nearend, weighted_echo, masker, min_gain, max_gain, one_by_weighted_echo, gain); AdjustForExternalFilters(gain); - if (narrow_peak_band) { - NarrowBandAttenuation(*narrow_peak_band, nearend, weighted_echo, gain); - } } // Adjust the gain for frequencies which have not yet converged. @@ -379,8 +360,8 @@ void SuppressionGain::GetGain( bool low_noise_render = low_render_detector_.Detect(render); const rtc::Optional narrow_peak_band = render_signal_analyzer.NarrowPeakBand(); - LowerBandGain(low_noise_render, narrow_peak_band, aec_state, nearend_spectrum, - echo_spectrum, comfort_noise_spectrum, low_band_gain); + LowerBandGain(low_noise_render, aec_state, nearend_spectrum, echo_spectrum, + comfort_noise_spectrum, low_band_gain); const float gain_upper_bound = aec_state.SuppressionGainLimit(); if (gain_upper_bound < 1.f) { diff --git a/modules/audio_processing/aec3/suppression_gain.h b/modules/audio_processing/aec3/suppression_gain.h index 59eeb35857..23121a2324 100644 --- a/modules/audio_processing/aec3/suppression_gain.h +++ b/modules/audio_processing/aec3/suppression_gain.h @@ -47,7 +47,6 @@ class SuppressionGain { private: void LowerBandGain(bool stationary_with_low_power, - const rtc::Optional& narrow_peak_band, const AecState& aec_state, const std::array& nearend, const std::array& echo,