FastLED 3.9.15
Loading...
Searching...
No Matches

◆ computeTargetGain()

float fl::audio::AutoGain::computeTargetGain ( )
private

Compute target gain from peak envelope.

Definition at line 148 of file auto_gain.cpp.hpp.

148 {
149 const float peakEnv = mPeakEnvelope.value();
150
151 // Avoid division by very small numbers
152 if (peakEnv < 1.0f) {
153 return mConfig.maxGain; // Signal is essentially silent
154 }
155
156 return mConfig.targetRMSLevel / peakEnv;
157}
AttackDecayFilter< float > mPeakEnvelope
Peak envelope tracker: fast attack (10ms), slow decay (preset-dependent)
Definition auto_gain.h:152
AutoGainConfig mConfig
Definition auto_gain.h:140

References mConfig, and mPeakEnvelope.

Referenced by process().

+ Here is the caller graph for this function: