init
This commit is contained in:
commit
2c2202e60d
2491 files changed
+1295990
No files matched your search
@@ -0,0 +1,52 @@
|
||||
#ifndef FX_EQUALIZER_H
|
||||
#define FX_EQUALIZER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FX_EQ_NUM_BANDS 10U
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float freq_hz; /* frequence centrale de la bande */
|
||||
float gain_db; /* -24.0 a +24.0 dB */
|
||||
float q; /* facteur de qualite, typiquement 0.5 a 5.0 */
|
||||
} FxEqBand;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool enabled;
|
||||
FxEqBand bands[FX_EQ_NUM_BANDS];
|
||||
} FxEqualizerParams;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* coefficients biquad mis en cache, recalcules seulement si les parametres changent */
|
||||
float b0, b1, b2, a1, a2;
|
||||
/* dernieres valeurs de parametres utilisees pour calculer les coefficients ci-dessus */
|
||||
float last_freq_hz;
|
||||
float last_gain_db;
|
||||
float last_q;
|
||||
} FxEqBandState;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FxEqBandState band_state[FX_EQ_NUM_BANDS];
|
||||
/* etat du filtre (direct form 1), par bande */
|
||||
float x1[FX_EQ_NUM_BANDS];
|
||||
float x2[FX_EQ_NUM_BANDS];
|
||||
float y1[FX_EQ_NUM_BANDS];
|
||||
float y2[FX_EQ_NUM_BANDS];
|
||||
} FxEqualizerState;
|
||||
|
||||
void FxEqualizer_Init(FxEqualizerState *state, FxEqualizerParams *params);
|
||||
float FxEqualizer_Process(FxEqualizerState *state, const FxEqualizerParams *params, float input);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FX_EQUALIZER_H */
|
||||
Reference in new issue
Block a user