Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(896)

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc

Issue 2112553003: Compensate for the LevelController gain in the IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
index 852357e2da97a66837f0a30a7ded2cc21a7b8fd4..45f338c642540acaabf8fb96652b55c28f51cce0 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
@@ -407,18 +407,17 @@ TEST_F(IntelligibilityEnhancerTest, TestSolveForGains) {
}
TEST_F(IntelligibilityEnhancerTest, TestNoiseGainHasExpectedResult) {
- const int kGainDB = 6;
- const float kGainFactor = std::pow(10.f, kGainDB / 20.f);
+ const float kGain = 2.f;
const float kTolerance = 0.007f;
std::vector<float> noise(kNumNoiseBins);
std::vector<float> noise_psd(kNumNoiseBins);
std::generate(noise.begin(), noise.end(), float_rand);
for (size_t i = 0; i < kNumNoiseBins; ++i) {
- noise_psd[i] = kGainFactor * kGainFactor * noise[i] * noise[i];
+ noise_psd[i] = kGain * kGain * noise[i] * noise[i];
}
float* clear_cursor = clear_data_.data();
for (size_t i = 0; i < kNumFramesToProcess; ++i) {
- enh_->SetCaptureNoiseEstimate(noise, kGainDB);
+ enh_->SetCaptureNoiseEstimate(noise, kGain);
enh_->ProcessRenderAudio(&clear_cursor, kSampleRate, kNumChannels);
}
const std::vector<float>& estimated_psd =
« no previous file with comments | « webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698