FastLED 3.9.15
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 1010 of file fft_impl.cpp.hpp.

1012 {
1013 const int numRawBins = fftN / 2 + 1;
1014 // Compute loop bounds to skip out-of-range FFT bins
1015 const u16x16 rawBinHz(fs / static_cast<float>(fftN));
1016 const u16x16 halfBin = rawBinHz >> 1;
1017 const u16x16 loEdge(mLogBinEdges[binStart]);
1018 const u16x16 hiEdge(mLogBinEdges[binEnd]);
1019
1020 int kStart = 0;
1021 if (loEdge > halfBin) {
1022 kStart = static_cast<int>(
1023 u16x16::ceil((loEdge - halfBin) / rawBinHz).to_int());
1024 }
1025 int kEnd = static_cast<int>(
1026 u16x16::ceil((hiEdge + halfBin) / rawBinHz).to_int());
1027 if (kEnd > numRawBins) kEnd = numRawBins;
1028
1029 for (int k = kStart; k < kEnd; ++k) {
1030 rawBinsI[lut[k]] += static_cast<u32>(mag[k]);
1031 }
1032 }
fl::vector< float > mLogBinEdges
static constexpr FASTLED_FORCE_INLINE u16x16 ceil(u16x16 x) FL_NOEXCEPT
Definition u16x16.h:133
constexpr u32 to_int() const FL_NOEXCEPT
Definition u16x16.h:60

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

Referenced by runHybrid(), and runLogRebin().

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