summaryrefslogtreecommitdiff
path: root/mec.h
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-01-29 17:40:45 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-01-29 17:40:45 +0000
commit1e707c832ebae8549e40d7bf5ee375a5fa01a053 (patch)
tree2ed217ec1b2d1192a6aaf936b767c9ea887623e4 /mec.h
parent5093a31d2a974b6340983e17d8fb8a9cea06a559 (diff)
Version 0.1.6 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@51 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'mec.h')
-rwxr-xr-xmec.h16
1 files changed, 9 insertions, 7 deletions
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--;