FastLED 3.10.8
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 439 of file fft_impl.cpp.hpp.

440 {
441 const int numRawBins = fftN / 2 + 1;
442 lut.resize(numRawBins);
443 const u16x16 rawBinHz(fs / static_cast<float>(fftN));
444
445 for (int k = 0; k < numRawBins; ++k) {
446 u16x16 freq = rawBinHz * static_cast<u32>(k);
447
448 int lo = binStart, hi = binEnd - 1;
449 while (lo < hi) {
450 int mid = (lo + hi + 1) / 2;
451 if (mLogBinEdgesQ16[mid] <= freq)
452 lo = mid;
453 else
454 hi = mid - 1;
455 }
456 lut[k] = static_cast<u8>(lo);
457 }
458 }
fl::vector< u16x16 > mLogBinEdgesQ16
void resize(fl::size n) FL_NO_EXCEPT
Definition vector.h:593
unsigned char u8
Definition stdint.h:131

References fl::FL_NO_EXCEPT, and mLogBinEdgesQ16.

Referenced by initHybrid(), and initLogRebin().

+ Here is the caller graph for this function: