|
|
@ -207,11 +207,11 @@ void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b, |
|
|
|
+ weight_coeff_b * in_b[i]; |
|
|
|
+ weight_coeff_b * in_b[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ff_adaptive_gain_control(float *buf_out, float speech_energ, |
|
|
|
void ff_adaptive_gain_control(float *out, const float *in, float speech_energ, |
|
|
|
int size, float alpha, float *gain_mem) |
|
|
|
int size, float alpha, float *gain_mem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
float postfilter_energ = ff_dot_productf(buf_out, buf_out, size); |
|
|
|
float postfilter_energ = ff_dot_productf(in, in, size); |
|
|
|
float gain_scale_factor = 1.0; |
|
|
|
float gain_scale_factor = 1.0; |
|
|
|
float mem = *gain_mem; |
|
|
|
float mem = *gain_mem; |
|
|
|
|
|
|
|
|
|
|
@ -222,7 +222,7 @@ void ff_adaptive_gain_control(float *buf_out, float speech_energ, |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < size; i++) { |
|
|
|
for (i = 0; i < size; i++) { |
|
|
|
mem = alpha * mem + gain_scale_factor; |
|
|
|
mem = alpha * mem + gain_scale_factor; |
|
|
|
buf_out[i] *= mem; |
|
|
|
out[i] = in[i] * mem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
*gain_mem = mem; |
|
|
|
*gain_mem = mem; |
|
|
|