FastLED 3.10.8
Loading...
Searching...
No Matches

◆ calculateEnergyFlux() [2/2]

float fl::audio::detector::Transient::calculateEnergyFlux ( float currentEnergy)
private

Definition at line 101 of file transient.cpp.hpp.

101 {
102 // Calculate positive energy flux (increase in energy)
103 float flux = fl::max(0.0f, currentEnergy - mPreviousEnergy);
104
105 // Normalize by previous energy to get relative change
106 if (mPreviousEnergy > 1e-6f) {
107 flux = flux / mPreviousEnergy;
108 }
109
110 return flux;
111}
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
Definition math.h:75

References fl::FL_NO_EXCEPT, fl::max(), and mPreviousEnergy.

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: