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

Method db

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

Source from the content-addressed store, hash-verified

63fl::span<const float> Bins::raw() const { return mBinsRaw; }
64
65fl::span<const float> Bins::db() const {
66 if (!mDbDirty) {
67 return mBinsDb;
68 }
69 if (mBinsDb.capacity() == 0) {
70 mBinsDb = pool().acquire(mBands);
71 }
72 mBinsDb.resize(mBinsRaw.size());
73 for (fl::size i = 0; i < mBinsRaw.size(); ++i) {
74 float x = mBinsRaw[i];
75 mBinsDb[i] = (x > 0.0f) ? 20.0f * fl::log10f(x) : 0.0f;
76 }
77 mDbDirty = false;
78 return mBinsDb;
79}
80
81fl::span<const float> Bins::rawNormalized() const {
82 if (!mNormalizedDirty) {

Callers 6

string.cpp.hppFile · 0.80
strstream.cpp.hppFile · 0.80
FL_TEST_FILEFunction · 0.80
loopFunction · 0.80
drawSpectrumBarsFunction · 0.80
drawRadialSpectrumFunction · 0.80

Calls 5

log10fFunction · 0.85
capacityMethod · 0.45
acquireMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected