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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h

Issue 1207353002: Add new variance update option and unittests for intelligibility (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Renamed tests + minor changes Created 5 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
Index: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
index 8125707f120981c40817152a80bcbea43f2e3006..ee59584e3e412c83109f6cf97f88a5f20352f678 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
@@ -83,6 +83,8 @@ class IntelligibilityEnhancer {
AudioSource source_;
};
friend class TransformCallback;
+ FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestErbCreation);
+ FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestSolveForGains);
// Sends streams to ProcessClearBlock or ProcessNoiseBlock based on source.
void DispatchAudio(AudioSource source,
@@ -97,6 +99,12 @@ class IntelligibilityEnhancer {
// Computes and sets modified gains.
void AnalyzeClearBlock(float power_target);
+ // Bisection search for optimal |lambda|.
+ void SolveForLambda(float power_target, float power_bot, float power_top);
+
+ // Transforms freq gains to ERB gains.
+ void UpdateErbGains();
+
// Updates variance calculation for noise input with |in_block|.
void ProcessNoiseBlock(const std::complex<float>* in_block,
std::complex<float>* out_block);
@@ -127,6 +135,8 @@ class IntelligibilityEnhancer {
static const float kConfigRho; // Default production and interpretation SNR.
static const float kKbdAlpha;
static const float kGainChangeLimit;
+ static const float kLambdaBot; // Extreme values in bisection
+ static const float kLambdaTop; // search for lambda.
const int freqs_; // Num frequencies in frequency domain.
const int window_size_; // Window size in samples; also the block size.

Powered by Google App Engine
This is Rietveld 408576698