FastLED 3.10.8
Loading...
Searching...
No Matches

◆ logRebinRange()

void fl::audio::fft::Context::logRebinRange ( const u16 * mag,
int fftN,
float fs,
int binStart,
int binEnd,
u32 * rawBinsI,
const fl::vector< u8 > & lut )
inlineprivate

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

1107 {
1108 const int numRawBins = fftN / 2 + 1;
1109 // Compute loop bounds to skip out-of-range FFT bins
1110 const u16x16 rawBinHz(fs / static_cast<float>(fftN));
1111 const u16x16 halfBin = rawBinHz >> 1;
1112 const u16x16 loEdge(mLogBinEdges[binStart]);
1113 const u16x16 hiEdge(mLogBinEdges[binEnd]);
1114
1115 int kStart = 0;
1116 if (loEdge > halfBin) {
1117 kStart = static_cast<int>(
1118 u16x16::ceil((loEdge - halfBin) / rawBinHz).to_int());
1119 }
1120 int kEnd = static_cast<int>(
1121 u16x16::ceil((hiEdge + halfBin) / rawBinHz).to_int());
1122 if (kEnd > numRawBins) kEnd = numRawBins;
1123
1124 for (int k = kStart; k < kEnd; ++k) {
1125 rawBinsI[lut[k]] += static_cast<u32>(mag[k]);
1126 }
1127 }
fl::vector< float > mLogBinEdges
constexpr u32 to_int() const FL_NO_EXCEPT
Definition u16x16.h:61
static constexpr FASTLED_FORCE_INLINE u16x16 ceil(u16x16 x) FL_NO_EXCEPT
Definition u16x16.h:142

References fl::u16x16::ceil(), fl::FL_NO_EXCEPT, mLogBinEdges, and fl::u16x16::to_int().

Referenced by runHybrid(), runLogRebin(), and runOctaveWise().

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