FastLED 3.10.8
Loading...
Searching...
No Matches
fl::audio::detector::EnergyAnalyzer Class Reference

Detailed Description

Definition at line 12 of file energy_analyzer.h.

#include <energy_analyzer.h>

+ Inheritance diagram for fl::audio::detector::EnergyAnalyzer:
+ Collaboration diagram for fl::audio::detector::EnergyAnalyzer:

Public Member Functions

 EnergyAnalyzer () FL_NO_EXCEPT
 
 ~EnergyAnalyzer () FL_NO_EXCEPT override
 
void fireCallbacks () FL_NO_EXCEPT override
 
float getAverageEnergy () const FL_NO_EXCEPT
 
float getMaxEnergy () const FL_NO_EXCEPT
 
float getMinEnergy () const FL_NO_EXCEPT
 
const char * getName () const FL_NO_EXCEPT override
 
float getNormalizedRMS () const FL_NO_EXCEPT
 
float getPeak () const FL_NO_EXCEPT
 
float getRMS () const FL_NO_EXCEPT
 
bool needsFFT () const FL_NO_EXCEPT override
 
void reset () FL_NO_EXCEPT override
 
void setHistorySize (int size) FL_NO_EXCEPT
 
void setPeakDecay (float decay) FL_NO_EXCEPT
 
void update (shared_ptr< Context > context) FL_NO_EXCEPT override
 
- Public Member Functions inherited from fl::audio::Detector
virtual ~Detector () FL_NO_EXCEPT=default
 
virtual bool needsFFTHistory () const FL_NO_EXCEPT
 
virtual void setSampleRate (int) FL_NO_EXCEPT
 

Public Attributes

function_list< void(float avgEnergy)> onAverageEnergy
 
function_list< void(float rms)> onEnergy
 
function_list< void(float normalizedRms)> onNormalizedEnergy
 
function_list< void(float peak)> onPeak
 

Private Member Functions

void updateAverage (float energy) FL_NO_EXCEPT
 
void updatePeak (float energy, u32 timestamp) FL_NO_EXCEPT
 

Private Attributes

float mAverageEnergy
 
float mCurrentRMS
 
MovingAverage< float, 0 > mEnergyAvg {43}
 
u32 mLastPeakTime
 
float mMaxEnergy
 
float mMinEnergy
 
float mNormalizedRMS = 0.0f
 
float mPeak
 
float mPeakDecay
 
AttackDecayFilter< float > mRunningMaxFilter {0.001f, 2.0f, 1.0f}
 

Static Private Attributes

static constexpr u32 PEAK_HOLD_MS = 50
 

The documentation for this class was generated from the following files: