FastLED 3.9.15
Loading...
Searching...
No Matches
AudioFftParity.ino File Reference

Detailed Description

Sanity test for the ESP-DSP real-FFT backend in fl::audio::fft.

Validates that detail::espDspRealForward() produces mathematically correct output for several known test signals. Does NOT compare against kiss_fftr directly (kiss defaults to FIXED16 int16 on FastLED; ESP-DSP is float32, so scale/precision differ). Instead checks known analytic properties:

sine_single: delta at bin k, ~0 elsewhere. Peak|mag > 10 × next|mag. impulse: uniform magnitude across all bins (flat spectrum). dc: only bin 0 non-zero; bins 1..N/2 effectively zero. zero_input: all bins zero.

The ESP-DSP backend is auto-detected via FL_HAS_INCLUDE("esp_dsp.h") — no opt-in #define needed. ESP32 variants whose toolchain does not ship esp_dsp.h (esp32c2 / esp32s2 / esp32h2 / esp32c5) fall through to the empty-sketch path below and build cleanly. See issues #2308 / #2629.

Usage (ESP32 only): bash compile esp32s3 –examples AudioFftParity bash debug AudioFftParity –expect FFT_PARITY_PASS –fail-on FFT_PARITY_FAIL or: bash autoresearch esp32s3 ... (wire up a custom expect via –expect)

Definition in file AudioFftParity.ino.

#include <Arduino.h>
#include <FastLED.h>
#include "fl/math/math.h"
#include "fl/audio/fft/fft_backend.h"
+ Include dependency graph for AudioFftParity.ino:

Go to the source code of this file.

Functions

void loop ()
 
void setup ()