/*
|
* eq.h
|
* Description:
|
*
|
* Created on: 2014-10-8
|
* Author: Graydon
|
* Modify:
|
*/
|
|
#ifndef EQ_H_
|
#define EQ_H_
|
|
typedef enum {
|
eq_lpf,
|
eq_hpf,
|
eq_bpf_pq, //(constant skirt gain, peak gain = Q)
|
eq_bpf_zero, //(constant 0 dB peak gain)
|
eq_notch,
|
eq_apf,
|
eq_peaking_eq, //peq_peak_3dB
|
eq_lowshelf,
|
eq_highshelf,
|
eq_geq,
|
eq_constQ, //peq_zero_3dB
|
eq_count,
|
}eq_type_t;
|
|
typedef enum{
|
peq_zero_3dB, //bw at 3dB frequency
|
peq_middle,
|
peq_peak_3dB, //bw at above or below peaking 3dB frequency
|
}peq_bw;
|
|
/*description: Create ParametricEQ handle.
|
*@param1: sample rate
|
*@param2: sample number per frame
|
*@param3: The number of ParametricEQ sections
|
*return: The handle
|
*/
|
void* alg_eq_create(int smpRate,int smpNum,int nsections);
|
|
/*description: ParametricEQ handle.
|
*@param1: sample rate
|
*return: none
|
*/
|
void alg_eq_destroy(void* h);
|
|
/*description: Set ParametricEQ 's param.
|
*@param1: ParametricEQ handle
|
*@param2: select the section from total sections of ParametricEQ
|
*@param3: ParametricEQ's frequency
|
*@param4: ParametricEQ's Gain
|
*@param5: ParametricEQ's Q
|
*return: None
|
*/
|
void alg_eq_set_param(void* h,int nsection,eq_type_t type ,int bypass,float freqency,float gain,float Q);
|
|
/*description: ParametricEQ process function.
|
*@param1: ParametricEQ handle
|
*@param2: audio data Input
|
*@param3: proceeded data output
|
*return: 0-successful
|
*/
|
int alg_eq_filter(void* h , const float *data_in, float *data_out);
|
float alg_geq_get_q(void* h, int nsections, int oct_type);
|
void callEQcoeffs(eq_type_t type , float f0,float g,float q,int fs, __OUT float *b,__OUT float *a);
|
void call_peaking_eq2(peq_bw bw_type ,float fc, float gain, float q, int fs, __OUT float *coef_b, __OUT float *coef_a);
|
void alg_eq_acc_coeffs(int smpRate, int nsection ,eq_type_t type,float freqency,float gain,float q, __OUT float* pcoeffs);
|
|
#endif /* EQ_H_ */
|