FastLED 3.10.9
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 438 of file fft_impl.cpp.hpp.

439 {
440 const int numRawBins = fftN / 2 + 1;
441 lut.resize(numRawBins);
442 const u16x16 rawBinHz(fs / static_cast<float>(fftN));
443
444 for (int k = 0; k < numRawBins; ++k) {
445 u16x16 freq = rawBinHz * static_cast<u32>(k);
446
447 int lo = binStart, hi = binEnd - 1;
448 while (lo < hi) {
449 int mid = (lo + hi + 1) / 2;
450 if (mLogBinEdgesQ16[mid] <= freq)
451 lo = mid;
452 else
453 hi = mid - 1;
454 }
455 lut[k] = static_cast<u8>(lo);
456 }
457 }
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: