|
FastLED 3.10.8
|
Transient - Detects sharp attack transients in audio.
Transients are rapid increases in energy that indicate the start of a sound, such as drum hits, plucked strings, or any percussive element. This detector uses spectral flux and energy envelope analysis to identify attack events.
Definition at line 21 of file transient.h.
#include <transient.h>
Inheritance diagram for fl::audio::detector::Transient:
Collaboration diagram for fl::audio::detector::Transient:Public Types | |
| using | TransientCallback = void(*)() |
| using | TransientStrengthCallback = void(*)(float strength) |
Public Attributes | |
| function_list< void(float strength)> | onAttack |
| TransientStrengthCallback | onAttack = nullptr |
| function_list< void()> | onTransient |
| TransientCallback | onTransient = nullptr |
| function_list< void(float strength)> | onTransientWithStrength |
| TransientStrengthCallback | onTransientWithStrength = nullptr |
Private Member Functions | |
| float | calculateEnergyFlux (float currentEnergy) |
| float | calculateEnergyFlux (float currentEnergy) FL_NO_EXCEPT |
| float | calculateHighFreqEnergy (const fft::Bins &fft) |
| float | calculateHighFreqEnergy (const fft::Bins &fft) FL_NO_EXCEPT |
| bool | detectTransient (float flux, u32 timestamp) |
| bool | detectTransient (float flux, u32 timestamp) FL_NO_EXCEPT |
| void | updateAttackTime (float flux) |
| void | updateAttackTime (float flux) FL_NO_EXCEPT |
Private Attributes | |
| float | mAttackTime |
| float | mCurrentEnergy |
| deque< float > | mEnergyHistory |
| fl::vector< float > | mEnergyHistory |
| HampelFilter< float, 7 > | mEnergyOutlierFilter {2.5f} |
| u32 | mLastTransientTime |
| u32 | mMinIntervalMs |
| float | mPreviousEnergy |
| vector< float > | mPreviousHighFreq |
| fl::vector< float > | mPreviousHighFreq |
| shared_ptr< const fft::Bins > | mRetainedFFT |
| float | mSensitivity |
| float | mStrength |
| float | mThreshold |
| bool | mTransientDetected |
Static Private Attributes | |
| static constexpr size | ENERGY_HISTORY_SIZE = 5 |
| static constexpr size_t | ENERGY_HISTORY_SIZE = 32 |