|
FastLED 3.9.15
|
NoiseFloorTracker maintains an adaptive estimate of the background noise floor for audio signals, with hysteresis to prevent "noise chasing" where the floor continuously adjusts to the signal level.
Features:
How it works:
Usage:
Definition at line 70 of file noise_floor_tracker.h.
#include <noise_floor_tracker.h>
Collaboration diagram for fl::audio::NoiseFloorTracker:Classes | |
| struct | Stats |
| Get current statistics (for monitoring/debugging) More... | |
Public Member Functions | |
| NoiseFloorTracker () FL_NOEXCEPT | |
| NoiseFloorTracker (const NoiseFloorTrackerConfig &config) FL_NOEXCEPT | |
| ~NoiseFloorTracker () FL_NOEXCEPT | |
| void | configure (const NoiseFloorTrackerConfig &config) FL_NOEXCEPT |
| Configure the noise floor tracker. | |
| float | getFloor () const FL_NOEXCEPT |
| Get current noise floor estimate. | |
| const Stats & | getStats () const FL_NOEXCEPT |
| bool | isAboveFloor (float level) const FL_NOEXCEPT |
| Check if signal is above noise floor + margin. | |
| float | normalize (float level) const FL_NOEXCEPT |
| Normalize signal by removing noise floor. | |
| void | reset () FL_NOEXCEPT |
| Reset noise floor to initial state. | |
| void | update (float timedomainLevel, float frequencydomainLevel=-1.0f) FL_NOEXCEPT |
| Update noise floor estimate with new observation. | |
Private Member Functions | |
| float | combineDomains (float timeLevel, float freqLevel) const FL_NOEXCEPT |
| Calculate combined metric from time and frequency domains. | |
| void | updateFloor (float level) FL_NOEXCEPT |
| Update floor estimate based on current observation. | |
Private Attributes | |
| u32 | mBelowFloorCount = 0 |
| Count of consecutive samples below floor (for slow attack) | |
| NoiseFloorTrackerConfig | mConfig |
| float | mCurrentFloor = 100.0f |
| Current noise floor estimate. | |
| float | mLastHysteresisFloor = 0.0f |
| Floor value at last hysteresis trigger Used to enforce hysteresis margin before allowing floor to rise. | |
| Stats | mStats |
Static Private Attributes | |
| static constexpr u32 | BELOW_FLOOR_THRESHOLD = 10 |
| Threshold for considering signal "consistently low". | |