From 1e707c832ebae8549e40d7bf5ee375a5fa01a053 Mon Sep 17 00:00:00 2001 From: markster Date: Tue, 29 Jan 2002 17:40:45 +0000 Subject: Version 0.1.6 from FTP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@51 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- mec.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'mec.h') diff --git a/mec.h b/mec.h index 779d949..3148ee9 100755 --- a/mec.h +++ b/mec.h @@ -23,15 +23,17 @@ #ifndef _MEC_H #define _MEC_H -#define NUM_TAPS 64 /* Must be power of two */ +/* You have to express the size of the echo canceller in taps as + a power of 2 (6 = 64 taps, 7 = 128 taps, 8 = 256 taps) */ +#define NUM_TAPS_POW2 6 /* Size of echo canceller in power of 2 (taps) */ +#define NUM_TAPS (1 << NUM_TAPS_POW2) /* Actual number of taps */ #define TAP_MASK (NUM_TAPS-1) - -#define SIGMA_LU_POW 6 -#define SIGMA_LY_POW 6 -#define SIGMA_YT_POW 5 -#define SIGMA_ST_POW 5 +#define SIGMA_LU_POW NUM_TAPS_POW2 +#define SIGMA_LY_POW NUM_TAPS_POW2 +#define SIGMA_YT_POW (NUM_TAPS_POW2 - 1) +#define SIGMA_ST_POW (NUM_TAPS_POW2 - 1) #define BETA_POW 8 @@ -142,7 +144,7 @@ static INLINE short process_cc(mark_ec *ec, short tx, short txabs, short rx, sho pos = (pos - 1) & TAP_MASK; } - r_hat >>= 18; + r_hat >>= 16; if (ec->hangt > 0) ec->hangt--; -- cgit v1.2.3