136 float threshold, u32& cooldownCounter);
float mPreviousTrebleEnergy
bool detectBandBeat(float currentEnergy, float previousEnergy, float threshold, u32 &cooldownCounter)
Detect beat in a specific frequency band.
float mBassEnergy
Current band energies.
static constexpr size MID_BIN_START
u32 mCurrentFrame
Current frame counter.
void reset()
Reset internal state (clear history, reset cooldowns)
float getMidEnergy() const
Get current mid energy (0.0-1.0)
bool isBassBeat() const
Check if a bass beat was detected in the last frame.
float calculateMidEnergy(span< const float > frequencyBins) const
Calculate energy for mid band (bins 6-7)
float getTrebleEnergy() const
Get current treble energy (0.0-1.0)
MultiBandBeatDetectorConfig mConfig
bool isMultiBandBeat() const
Check if multiple bands triggered simultaneously (strong beat)
MultiBandBeat() FL_NOEXCEPT
bool mBassBeat
Beat detection flags for current frame.
static constexpr size TREBLE_BIN_END
bool isMidBeat() const
Check if a mid beat was detected in the last frame.
static constexpr size TREBLE_BIN_START
float getBassEnergy() const
Get current bass energy (0.0-1.0)
u32 mBassCooldown
Beat cooldown counters (prevent double-triggering)
static constexpr size BASS_BIN_END
float calculateBassEnergy(span< const float > frequencyBins) const
Calculate energy for bass band (bins 0-1)
const Stats & getStats() const
float mPreviousBassEnergy
Previous band energies (for energy increase calculation)
bool isTrebleBeat() const
Check if a treble beat was detected in the last frame.
static constexpr size MID_BIN_END
void configure(const MultiBandBeatDetectorConfig &config)
Configure the multi-band beat detector.
static constexpr size BASS_BIN_START
Frequency bin indices for each band.
float calculateTrebleEnergy(span< const float > frequencyBins) const
Calculate energy for treble band (bins 14-15)
void detectBeats(span< const float > frequencyBins)
Detect beats in all frequency bands.
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.
Base definition for an LED controller.