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

Method calculateLogFrequencies

src/fl/audio/frequency_bin_mapper.cpp.hpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void FrequencyBinMapper::calculateLogFrequencies() {
51 const size numBins = static_cast<size>(mConfig.mode);
52 const float logMin = fl::logf(mConfig.minFrequency);
53 const float logMax = fl::logf(mConfig.maxFrequency);
54 const float logStep = (logMax - logMin) / static_cast<float>(numBins);
55
56 // Calculate logarithmically-spaced bin edges
57 for (size i = 0; i <= numBins; ++i) {
58 float logFreq = logMin + static_cast<float>(i) * logStep;
59 float freq = fl::expf(logFreq);
60 mBinFrequencies.push_back(freq);
61 }
62}
63
64void FrequencyBinMapper::calculateLinearFrequencies() {
65 const size numBins = static_cast<size>(mConfig.mode);

Callers

nothing calls this directly

Calls 3

logfFunction · 0.85
expfFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected