echo-cancel: Use proper float constants in adrian-aec

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
Peter Meerwald 2013-02-13 17:26:55 +01:00 committed by Tanu Kaskinen
parent 8d9c41e84c
commit 90276fe18d

View file

@ -33,7 +33,7 @@
/* Vector Dot Product */ /* Vector Dot Product */
static REAL dotp(REAL a[], REAL b[]) static REAL dotp(REAL a[], REAL b[])
{ {
REAL sum0 = 0.0, sum1 = 0.0; REAL sum0 = 0.0f, sum1 = 0.0f;
int j; int j;
for (j = 0; j < NLMS_LEN; j += 2) { for (j = 0; j < NLMS_LEN; j += 2) {
@ -138,11 +138,11 @@ static float AEC_dtd(AEC *a, REAL d, REAL x)
a->xslow += ALPHASLOW * (fabsf(x) - a->xslow); a->xslow += ALPHASLOW * (fabsf(x) - a->xslow);
if (a->xfast < M70dB_PCM) { if (a->xfast < M70dB_PCM) {
return 0.0; // no Spk signal return 0.0f; // no Spk signal
} }
if (a->dfast < M70dB_PCM) { if (a->dfast < M70dB_PCM) {
return 0.0; // no Mic signal return 0.0f; // no Mic signal
} }
// ratio of NFRs // ratio of NFRs
@ -206,7 +206,7 @@ static REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize)
// optimize: iterative dotp(xf, xf) // optimize: iterative dotp(xf, xf)
a->dotp_xf_xf += (a->xf[a->j] * a->xf[a->j] - a->xf[a->j + NLMS_LEN - 1] * a->xf[a->j + NLMS_LEN - 1]); a->dotp_xf_xf += (a->xf[a->j] * a->xf[a->j] - a->xf[a->j + NLMS_LEN - 1] * a->xf[a->j + NLMS_LEN - 1]);
if (stepsize > 0.0) { if (stepsize > 0.0f) {
// calculate variable step size // calculate variable step size
REAL mikro_ef = stepsize * ef / a->dotp_xf_xf; REAL mikro_ef = stepsize * ef / a->dotp_xf_xf;