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

◆ rms()

float rms ( fl::span< const int16_t > data)

Definition at line 104 of file simple.h.

104 {
105 double sumSq = 0.0;
106 const int N = data.size();
107 for (int i = 0; i < N; ++i) {
108 int32_t x32 = int32_t(data[i]);
109 sumSq += x32 * x32;
110 }
111 float rms = fl::sqrt(float(sumSq) / N);
112 return rms;
113}
float rms(fl::span< const int16_t > data)
Definition simple.h:104
constexpr fl::size size() const FL_NOEXCEPT
Definition span.h:458
constexpr enable_if< is_fixed_point< T >::value, T >::type sqrt(T x) FL_NOEXCEPT
fl::i32 int32_t
Definition s16x16x4.h:220

References rms(), fl::span< T, Extent >::size(), and fl::sqrt().

Referenced by fl::audio::detector::MoodAnalyzer::calculateArousal(), fl::audio::detector::BuildupDetector::calculateBuildupIntensity(), fl::audio::detector::DropDetector::calculateDropImpact(), drawVUMeter(), loop(), fl::audio::Processor::onEnergy(), fl::audio::Reactive::processSample(), rms(), fl::audio::detector::BuildupDetector::update(), fl::audio::detector::DropDetector::update(), fl::audio::detector::EqualizerDetector::update(), fl::audio::detector::DropDetector::updateBaselines(), fl::audio::detector::DynamicsAnalyzer::updatePeak(), and fl::audio::Reactive::updateVolumeAndPeak().

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