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

Method updateAdaptiveThreshold

src/fl/audio/detector/beat.cpp.hpp:104–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void Beat::updateAdaptiveThreshold() {
105 // O(1) running average via MovingAverage filter
106 float mean = mFluxAvg.update(mSpectralFlux);
107 mAdaptiveThreshold = mean * mThreshold * mSensitivity;
108}
109
110bool Beat::detectBeat(u32 timestamp) {
111 // Use adaptive threshold with an absolute floor. The floor handles

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected