FastLED 3.9.15
Loading...
Searching...
No Matches

◆ computeRMS()

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

Definition at line 398 of file audio_reactive.cpp.

398 {
399 if (samples.empty()) return 0.0f;
400
401 float sumSquares = 0.0f;
402 for (const auto& sample : samples) {
403 float f = static_cast<float>(sample);
404 sumSquares += f * f;
405 }
406
407 return sqrtf(sumSquares / samples.size());
408}
bool empty() const
Definition vector.h:547

References fl::HeapVector< T, Allocator >::empty(), and fl::HeapVector< T, Allocator >::size().

+ Here is the call graph for this function: