29 mStats.currentFloor = 100.0f;
32 mStats.samplesProcessed = 0;
33 mStats.inHysteresis =
false;
42 float combinedLevel =
combineDomains(timedomainLevel, frequencydomainLevel);
45 if (
mStats.samplesProcessed == 0) {
46 mStats.minObserved = combinedLevel;
47 mStats.maxObserved = combinedLevel;
68 return fl::max(0.0f, normalized);
86 const float decayAlpha =
mConfig.decayRate;
90 mStats.inHysteresis =
false;
100 const float attackAlpha = 1.0f -
mConfig.attackRate;
104 mStats.inHysteresis =
false;
109 mStats.inHysteresis =
true;
119 if (freqLevel < 0.0f) {
124 const float w =
mConfig.crossDomainWeight;
125 return (1.0f - w) * timeLevel + w * freqLevel;
void configure(const NoiseFloorTrackerConfig &config) FL_NO_EXCEPT
Configure the noise floor tracker.
void reset() FL_NO_EXCEPT
Reset noise floor to initial state.
NoiseFloorTracker() FL_NO_EXCEPT
bool isAboveFloor(float level) const FL_NO_EXCEPT
Check if signal is above noise floor + margin.
float mCurrentFloor
Current noise floor estimate.
float normalize(float level) const FL_NO_EXCEPT
Normalize signal by removing noise floor.
void updateFloor(float level) FL_NO_EXCEPT
Update floor estimate based on current observation.
NoiseFloorTrackerConfig mConfig
~NoiseFloorTracker() FL_NO_EXCEPT
void update(float timedomainLevel, float frequencydomainLevel=-1.0f) FL_NO_EXCEPT
Update noise floor estimate with new observation.
float combineDomains(float timeLevel, float freqLevel) const FL_NO_EXCEPT
Calculate combined metric from time and frequency domains.
float mLastHysteresisFloor
Floor value at last hysteresis trigger Used to enforce hysteresis margin before allowing floor to ris...
u32 mBelowFloorCount
Count of consecutive samples below floor (for slow attack)
Configuration for noise floor tracking.
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Base definition for an LED controller.