float getBassEnergy() const FL_NO_EXCEPT
Get current bass energy (0.0-1.0)
float mPreviousTrebleEnergy
float mBassEnergy
Current band energies.
void detectBeats(span< const float > frequencyBins) FL_NO_EXCEPT
Detect beats in all frequency bands.
static constexpr size MID_BIN_START
bool isTrebleBeat() const FL_NO_EXCEPT
Check if a treble beat was detected in the last frame.
u32 mCurrentFrame
Current frame counter.
const Stats & getStats() const FL_NO_EXCEPT
float getMidEnergy() const FL_NO_EXCEPT
Get current mid energy (0.0-1.0)
bool isMultiBandBeat() const FL_NO_EXCEPT
Check if multiple bands triggered simultaneously (strong beat)
MultiBandBeatDetectorConfig mConfig
MultiBandBeat() FL_NO_EXCEPT
void reset() FL_NO_EXCEPT
Reset internal state (clear history, reset cooldowns)
bool mBassBeat
Beat detection flags for current frame.
static constexpr size TREBLE_BIN_END
float getTrebleEnergy() const FL_NO_EXCEPT
Get current treble energy (0.0-1.0)
static constexpr size TREBLE_BIN_START
u32 mBassCooldown
Beat cooldown counters (prevent double-triggering)
static constexpr size BASS_BIN_END
void configure(const MultiBandBeatDetectorConfig &config) FL_NO_EXCEPT
Configure the multi-band beat detector.
float calculateMidEnergy(span< const float > frequencyBins) const FL_NO_EXCEPT
Calculate energy for mid band (bins 6-7)
bool detectBandBeat(float currentEnergy, float previousEnergy, float threshold, u32 &cooldownCounter) FL_NO_EXCEPT
Detect beat in a specific frequency band.
float mPreviousBassEnergy
Previous band energies (for energy increase calculation)
bool isMidBeat() const FL_NO_EXCEPT
Check if a mid beat was detected in the last frame.
static constexpr size MID_BIN_END
float calculateBassEnergy(span< const float > frequencyBins) const FL_NO_EXCEPT
Calculate energy for bass band (bins 0-1)
float calculateTrebleEnergy(span< const float > frequencyBins) const FL_NO_EXCEPT
Calculate energy for treble band (bins 14-15)
static constexpr size BASS_BIN_START
Frequency bin indices for each band.
bool isBassBeat() const FL_NO_EXCEPT
Check if a bass beat was detected in the last frame.
Get statistics (for debugging/monitoring)
float correlationBoost
Cross-band correlation boost (0.0-1.0) Added to threshold when multiple bands trigger together.
u32 beatCooldownFrames
Minimum cooldown between beats in same band (frames) Prevents double-triggering on same beat.
float midThreshold
Mid beat threshold (0.0-1.0) Energy increase required to trigger mid beat.
float trebleThreshold
Treble beat threshold (0.0-1.0) Energy increase required to trigger treble beat.
bool enableCrossBandCorrelation
Enable cross-band correlation Boosts confidence when multiple bands trigger simultaneously.
float bassThreshold
Bass beat threshold (0.0-1.0) Energy increase required to trigger bass beat.
Configuration for multi-band beat detection.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Base definition for an LED controller.