MCPcopy Create free account
hub / github.com/FastLED/FastLED / computeRMS

Method computeRMS

src/fl/audio/audio_reactive.cpp.hpp:752–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750}
751
752float Reactive::computeRMS(const fl::vector<fl::i16>& samples) {
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}
763
764// SpectralFluxDetector implementation
765SpectralFluxDetector::SpectralFluxDetector()

Callers

nothing calls this directly

Calls 3

sqrtfFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected