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

◆ computeRMS()

float fl::audio::Reactive::computeRMS ( const fl::vector< fl::i16 > & samples)
private

Definition at line 752 of file audio_reactive.cpp.hpp.

752 {
753 if (samples.empty()) return 0.0f;
754
755 float sumSquares = 0.0f;
756 for (const auto& sample : samples) {
757 float f = static_cast<float>(sample);
758 sumSquares += f * f;
759 }
760
761 return sqrtf(sumSquares / samples.size());
762}
bool empty() const FL_NO_EXCEPT
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode) FL_NO_EXCEPT
Sample a pixel from a 2D CRGB grid at floating-point coordinates.
float sqrtf(float value) FL_NO_EXCEPT
Definition math.h:461

References fl::FL_NO_EXCEPT, fl::sample(), and fl::sqrtf().

+ Here is the call graph for this function: