Only update Intelligibility Enhancer gains every 10 chunks

This reduces its complexity by a factor of 2.7x total.
The mean error introduced by this is in the 6 different noise scenarios and 6 different speech signals tested is below -52dB.

Review-Url: https://codereview.webrtc.org/2035213002
Cr-Commit-Position: refs/heads/master@{#13072}
This commit is contained in:
aluebs 2016-06-08 09:53:18 -07:00 committed by Commit bot
parent b6439396bf
commit e8f8f6037c
2 changed files with 5 additions and 1 deletions

View File

@ -40,6 +40,7 @@ const float kRho = 0.0004f; // Default production and interpretation SNR.
const float kPowerNormalizationFactor = 1.f / (1 << 30);
const float kMaxActiveSNR = 128.f; // 21dB
const float kMinInactiveSNR = 32.f; // 15dB
const size_t kGainUpdatePeriod = 10u;
// Returns dot product of vectors |a| and |b| with size |length|.
float DotProduct(const float* a, const float* b, size_t length) {
@ -88,6 +89,7 @@ IntelligibilityEnhancer::IntelligibilityEnhancer(int sample_rate_hz,
is_speech_(false),
snr_(kMaxActiveSNR),
is_active_(false),
num_chunks_(0u),
noise_estimation_buffer_(num_noise_bins),
noise_estimation_queue_(kMaxNumNoiseEstimatesToBuffer,
std::vector<float>(num_noise_bins),
@ -144,7 +146,7 @@ void IntelligibilityEnhancer::ProcessAudioBlock(
clear_power_estimator_.Step(in_block[0]);
}
SnrBasedEffectActivation();
if (is_active_) {
if (is_active_ && num_chunks_++ % kGainUpdatePeriod == 0) {
MapToErbBands(clear_power_estimator_.power().data(), render_filter_bank_,
filtered_clear_pow_.data());
MapToErbBands(noise_power_estimator_.power().data(), capture_filter_bank_,

View File

@ -112,6 +112,8 @@ class IntelligibilityEnhancer : public LappedTransform::Callback {
float snr_;
bool is_active_;
size_t num_chunks_;
std::vector<float> noise_estimation_buffer_;
SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>
noise_estimation_queue_;