diff options
-rwxr-xr-x | mec.h | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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--; |