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

◆ fl_fft_real_forward()

void fl::audio::fft::fl_fft_real_forward ( kiss_fftr_cfg cfg,
int N,
const kiss_fft_scalar * in,
kiss_fft_cpx * out )
inline

Forward real-to-complex FFT.

Parameters
cfgKiss FFT real-to-complex plan describing the size N. Used directly by the kiss backend; the ESP-DSP backend ignores cfg and uses its own cached context keyed by N.
NLogical FFT size (must match the size cfg was allocated for). Redundant for kiss (embedded in cfg) but required for ESP-DSP because kiss_fftr_cfg is opaque.
inPointer to N real time-domain samples.
outPointer to N/2 + 1 complex frequency-domain bins.

Output format matches kiss_fftr exactly regardless of backend.

Definition at line 237 of file fft_backend.h.

239 {
240 // NOTE: even when FL_FFT_ESP_DSP_ACTIVE is 1, the dispatcher currently
241 // stays on kiss_fftr. The ESP-DSP backend below is `float`-only but
242 // kiss_fft_scalar is typedef'd to `int16_t` when FastLED's default
243 // FASTLED_FFT_PRECISION=FASTLED_FFT_FIXED16 is in effect. Auto-routing
244 // through ESP-DSP would break the int16 call sites in fft_impl.cpp.hpp.
245 //
246 // Future work: either (a) add an int16 packed-FFT variant using
247 // dsps_fft2r_sc16 to match FIXED16 mode, or (b) auto-switch the library
248 // to FASTLED_FFT_FLOAT when FL_FFT_ESP_DSP_AVAILABLE is on. Once wired,
249 // replace the below with a conditional call to detail::espDspRealForward.
250 //
251 // The ESP-DSP code is compiled in whenever the ESP32 toolchain ships
252 // esp_dsp.h (auto-detected via FL_HAS_INCLUDE) and exposed as
253 // fl::audio::fft::detail::espDspRealForward() so the AudioFftParity
254 // example can exercise it directly for validation.
255 (void)N;
256 kiss_fftr(cfg, in, out);
257}
void kiss_fftr(kiss_fftr_cfg st, const kiss_fft_scalar *timedata, kiss_fft_cpx *freqdata) FL_NOEXCEPT

References FL_NOEXCEPT, kiss_fft_scalar, and kiss_fftr().

Referenced by fl::audio::fft::Context::runHybrid(), fl::audio::fft::Context::runLogRebin(), fl::audio::fft::Context::runNaive(), and fl::audio::fft::Context::runOctaveWise().

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