FastLED 3.9.15
Loading...
Searching...
No Matches

◆ db()

fl::span< const float > fl::audio::fft::Bins::db ( ) const

Definition at line 65 of file fft.cpp.hpp.

65 {
66 if (!mDbDirty) {
67 return mBinsDb;
68 }
69 if (mBinsDb.capacity() == 0) {
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}
static FloatVectorPool & pool() FL_NOEXCEPT
Definition fft.cpp.hpp:168
fl::vector< float > mBinsDb
Definition fft.h:113
fl::vector< float > mBinsRaw
Definition fft.h:110
fl::size mBands
Definition fft.h:109
fl::vector< float > acquire(fl::size capacity)
Definition fft.cpp.hpp:20
float log10f(float value) FL_NOEXCEPT
Definition math.h:424

References fl::audio::fft::FloatVectorPool::acquire(), fl::log10f(), mBands, mBinsDb, mBinsRaw, mDbDirty, pool(), and fl::x.

Referenced by fl::string::append(), fl::sstream::operator<<(), and operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: