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

Method binToFreq

src/fl/audio/fft/fft.cpp.hpp:104–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102int Bins::sampleRate() const { return mSampleRate; }
103
104float Bins::binToFreq(int i) const {
105 int nbands = static_cast<int>(mBinsRaw.size());
106 if (nbands <= 1) return mFmin;
107 float m = fl::logf(mFmax / mFmin);
108 return mFmin * fl::expf(m * static_cast<float>(i) / static_cast<float>(nbands - 1));
109}
110
111int Bins::freqToBin(float freq) const {
112 int nbands = static_cast<int>(mBinsRaw.size());

Callers 5

updateMethod · 0.80
FL_TEST_FILEFunction · 0.80
runAccuracyTestFunction · 0.80
runSweepFunction · 0.80

Calls 3

logfFunction · 0.85
expfFunction · 0.85
sizeMethod · 0.45

Tested by 1

runSweepFunction · 0.64