diff options
-rwxr-xr-x | mec2.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); } |