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

◆ buildLogBinLut()

void fl::audio::fft::Context::buildLogBinLut ( fl::vector< u8 > & lut,
int fftN,
float fs,
int binStart,
int binEnd )
inlineprivate

Definition at line 429 of file fft_impl.cpp.hpp.

430 {
431 const int numRawBins = fftN / 2 + 1;
432 lut.resize(numRawBins);
433 const u16x16 rawBinHz(fs / static_cast<float>(fftN));
434
435 for (int k = 0; k < numRawBins; ++k) {
436 u16x16 freq = rawBinHz * static_cast<u32>(k);
437
438 int lo = binStart, hi = binEnd - 1;
439 while (lo < hi) {
440 int mid = (lo + hi + 1) / 2;
441 if (mLogBinEdgesQ16[mid] <= freq)
442 lo = mid;
443 else
444 hi = mid - 1;
445 }
446 lut[k] = static_cast<u8>(lo);
447 }
448 }
fl::vector< u16x16 > mLogBinEdgesQ16
void resize(fl::size n) FL_NOEXCEPT
Definition vector.h:593
unsigned char u8
Definition stdint.h:131

References mLogBinEdgesQ16, and fl::vector< T >::resize().

Referenced by initHybrid(), and initLogRebin().

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