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

◆ rms()

float rms ( Slice< const int16_t > data)

Definition at line 77 of file Audio.ino.

77 {
78 double sumSq = 0.0;
79 const int N = data.size();
80 for (int i = 0; i < N; ++i) {
81 int32_t x32 = int32_t(data[i]);
82 sumSq += x32 * x32;
83 }
84 float rms = sqrt(float(sumSq) / N);
85 return rms;
86}
float rms(Slice< const int16_t > data)
Definition Audio.ino:77
size_t size() const
Definition slice.h:90

References rms(), and fl::Slice< T >::size().

Referenced by loop(), and rms().

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