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

Method computeBinCenters

src/fl/audio/detector/equalizer.cpp.hpp:114–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void EqualizerDetector::computeBinCenters(float* out) const {
115 // Log-spaced bin centers matching Bins::binToFreq formula
116 float fmin = mConfig.minFreq;
117 float fmax = mConfig.maxFreq;
118 if (fmax <= fmin) fmax = fmin * 2.0f;
119 float m = fl::logf(fmax / fmin);
120 for (int i = 0; i < kNumBins; ++i) {
121 out[i] = fmin * fl::expf(m * static_cast<float>(i) / static_cast<float>(kNumBins - 1));
122 }
123}
124
125void EqualizerDetector::recomputePinkNoiseGains() {
126 float binCenters[kNumBins];

Callers

nothing calls this directly

Calls 2

logfFunction · 0.85
expfFunction · 0.85

Tested by

no test coverage detected