19 #ifndef FASTDEPUKFB_H_ 20 #define FASTDEPUKFB_H_ 30 double c1, c2, c3, c4;
31 double d1, d2, d3, d4;
40 n_l[0]=(fc+fc*pl)/d_l[0];
41 n_l[1]=(-c1*fc-c1*pl-c1*fc*pl)/d_l[0];
42 d_l[1]=(-2*c4*fc)/d_l[0];
43 d_l[2]=(c3*fc)/d_l[0];
53 n_u[0]=(d1*fc-d1*fc*pu)/d_u[0];
54 n_u[1]=d2*(-fc+pu+pu*fc)/d_u[0];
55 d_u[1]=(-2*d4*fc)/d_u[0];
64 double z1=0.0, z2=0.0;
65 bzero(out, (
int)
rint(
fs/2.0)*
sizeof(
double));
69 out[0] = n_u[0] - d_u[0]*out[0] + z1;
70 z1 = n_u[1] - d_u[1]*out[0] + z2;
73 for (
int i=1;i<(int)
rint(
fs/2.0);i++){
74 out[i] = - d_u[0]*out[i] + z1;
75 z1 = - d_u[1]*out[i] + z2;
81 bzero(out, (
int)
rint(fc)*
sizeof(
double));
85 out[0] = n_l[0] - d_l[0]*out[0] + z1;
86 z1 = n_l[1] - d_l[1]*out[0] + z2;
89 for (
int i=1;i<(int)
rint(fc);i++){
90 out[i] = - d_l[0]*out[i] + z1;
91 z1 = - d_l[1]*out[i] + z2;
96 void afZ(
double fc,
int whichFilter,
double pl,
double pu){
97 double *filt=
w[whichFilter];
103 virtual void af(
double fc,
int whichFilter){
104 cout<<
"FastDepUKFB::af"<<endl;
112 init(sampleFreq, fCnt);
116 #endif //FASTDEPUKFB_H_
virtual void af(double fc, int whichFilter)
Auditory Filter procedure.
void findIIRCoeff(double fc, double pl, double pu)
FastDepUKFB(int sampleFreq, int fCnt=50)
int fs
The sample frequency.
void init(int sampleFreq, int fCnt=50)
void afZ(double fc, int whichFilter, double pl, double pu)
void filter(double fc, double *out)