From a0b6bc0f658438cb74ea463c5d86fa538c4f23c2 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 24 Aug 2005 00:45:04 +0000 Subject: Small fixes for mec2 echo can from #6937 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@744 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- mec2.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mec2.h b/mec2.h index c138d7f..b340622 100755 --- a/mec2.h +++ b/mec2.h @@ -163,6 +163,7 @@ static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) { // reset the near-end speech detector // ec->s_tilde_i = 0; + ec->y_tilde_i = 0; ec->HCNTR_d = (int)0; // exit gracefully @@ -239,9 +240,10 @@ static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig /* compute the new convergence factor */ - Py_i = (ec->Ly_i >> DEFAULT_SIGMA_LY_I) * (ec->Ly_i >> DEFAULT_SIGMA_LY_I); - Py_i >>= 15; - if (ec->HCNTR_d > 0) { + if (!ec->HCNTR_d) { + Py_i = (ec->Ly_i >> DEFAULT_SIGMA_LY_I) * (ec->Ly_i >> DEFAULT_SIGMA_LY_I); + Py_i >>= 15; + } else { Py_i = (1 << 15); } -- cgit v1.2.3