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

Side by Side Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc

Issue 2087623003: Fine tune the IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: relax tolerance 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 namespace { 25 namespace {
26 26
27 const size_t kErbResolution = 2; 27 const size_t kErbResolution = 2;
28 const int kWindowSizeMs = 16; 28 const int kWindowSizeMs = 16;
29 const int kChunkSizeMs = 10; // Size provided by APM. 29 const int kChunkSizeMs = 10; // Size provided by APM.
30 const float kClipFreqKhz = 0.2f; 30 const float kClipFreqKhz = 0.2f;
31 const float kKbdAlpha = 1.5f; 31 const float kKbdAlpha = 1.5f;
32 const float kLambdaBot = -1.f; // Extreme values in bisection 32 const float kLambdaBot = -1.f; // Extreme values in bisection
33 const float kLambdaTop = -1e-5f; // search for lamda. 33 const float kLambdaTop = -1e-5f; // search for lamda.
34 const float kVoiceProbabilityThreshold = 0.02f; 34 const float kVoiceProbabilityThreshold = 0.5f;
35 // Number of chunks after voice activity which is still considered speech. 35 // Number of chunks after voice activity which is still considered speech.
36 const size_t kSpeechOffsetDelay = 80; 36 const size_t kSpeechOffsetDelay = 10;
37 const float kDecayRate = 0.994f; // Power estimation decay rate. 37 const float kDecayRate = 0.995f; // Power estimation decay rate.
38 const float kMaxRelativeGainChange = 0.006f; 38 const float kMaxRelativeGainChange = 0.005f;
39 const float kRho = 0.0004f; // Default production and interpretation SNR. 39 const float kRho = 0.0004f; // Default production and interpretation SNR.
40 const float kPowerNormalizationFactor = 1.f / (1 << 30); 40 const float kPowerNormalizationFactor = 1.f / (1 << 30);
41 const float kMaxActiveSNR = 128.f; // 21dB 41 const float kMaxActiveSNR = 128.f; // 21dB
42 const float kMinInactiveSNR = 32.f; // 15dB 42 const float kMinInactiveSNR = 32.f; // 15dB
43 const size_t kGainUpdatePeriod = 10u; 43 const size_t kGainUpdatePeriod = 10u;
44 44
45 // Returns dot product of vectors |a| and |b| with size |length|. 45 // Returns dot product of vectors |a| and |b| with size |length|.
46 float DotProduct(const float* a, const float* b, size_t length) { 46 float DotProduct(const float* a, const float* b, size_t length) {
47 float ret = 0.f; 47 float ret = 0.f;
48 for (size_t i = 0; i < length; ++i) { 48 for (size_t i = 0; i < length; ++i) {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 vad_.ProcessChunk(audio_s16_.data(), chunk_length_, sample_rate_hz_); 344 vad_.ProcessChunk(audio_s16_.data(), chunk_length_, sample_rate_hz_);
345 if (vad_.last_voice_probability() > kVoiceProbabilityThreshold) { 345 if (vad_.last_voice_probability() > kVoiceProbabilityThreshold) {
346 chunks_since_voice_ = 0; 346 chunks_since_voice_ = 0;
347 } else if (chunks_since_voice_ < kSpeechOffsetDelay) { 347 } else if (chunks_since_voice_ < kSpeechOffsetDelay) {
348 ++chunks_since_voice_; 348 ++chunks_since_voice_;
349 } 349 }
350 return chunks_since_voice_ < kSpeechOffsetDelay; 350 return chunks_since_voice_ < kSpeechOffsetDelay;
351 } 351 }
352 352
353 } // namespace webrtc 353 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698