summaryrefslogtreecommitdiff
path: root/kb1ec_const.h
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-24 21:08:30 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-24 21:08:30 +0000
commit96700a26a7de67bf928b10e549d2e40ed8e1e257 (patch)
tree85df3d06a41af91b043cf62ee65e2a158ca1a0a4 /kb1ec_const.h
parentb31ad885f772a76b5d580e05171a43d7e0d4a569 (diff)
Adding new echo canceller option from kb1 based on mec2. PLEASE try
it out and give me feedback if it solves echo problems for you that wouldn't go away with any of the other echo cancellers. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@746 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kb1ec_const.h')
-rwxr-xr-xkb1ec_const.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/kb1ec_const.h b/kb1ec_const.h
new file mode 100755
index 0000000..b814657
--- /dev/null
+++ b/kb1ec_const.h
@@ -0,0 +1,81 @@
+/*
+ Important constants for tuning mec2 echo can
+ */
+#ifndef _MEC2_CONST_H
+#define _MEC2_CONST_H
+
+
+/* Convergence (aka. adaptation) speed -- higher means slower */
+#define DEFAULT_BETA1_I 2048
+
+/* Constants for various power computations */
+#define DEFAULT_SIGMA_LY_I 7
+#define DEFAULT_SIGMA_LU_I 7
+#define DEFAULT_ALPHA_ST_I 5 /* near-end speech detection sensitivity factor */
+#define DEFAULT_ALPHA_YT_I 5
+
+#define DEFAULT_CUTOFF_I 128
+
+/* Define the near-end speech hangover counter: if near-end speech
+ * is declared, hcntr is set equal to hangt (see pg. 432)
+ */
+#define DEFAULT_HANGT 600 /* in samples, so 600 samples = 75ms */
+
+/* define the residual error suppression threshold */
+#define DEFAULT_SUPPR_I 16 /* 16 = -24db */
+
+/* This is the minimum reference signal power estimate level
+ * that will result in filter adaptation.
+ * If this is too low then background noise will cause the filter
+ * coefficients to constantly be updated.
+ */
+#define MIN_UPDATE_THRESH_I 4096
+
+/* The number of samples used to update coefficients using the
+ * the block update method (M). It should be related back to the
+ * length of the echo can.
+ * ie. it only updates coefficients when (sample number MOD default_m) = 0
+ *
+ * Getting this wrong may cause an oops. Consider yourself warned!
+ */
+#define DEFAULT_M 16 /* every 16th sample */
+
+/* If AGGRESSIVE supression is enabled, then we start cancelling residual
+ * echos again even while there is potentially the very end of a near-side
+ * signal present.
+ * This defines how many samples of DEFAULT_HANGT can remain before we
+ * kick back in
+ */
+#define AGGRESSIVE_HCNTR 160 /* in samples, so 160 samples = 20ms */
+
+/* This knob controls the number of passes the residual echo supression
+ * algorithm makes.
+ */
+#ifdef AGGRESSIVE_SUPPRESSOR
+ #define RESIDUAL_SUPRESSION_PASSES 2
+#else
+ #define RESIDUAL_SUPRESSION_PASSES 1
+#endif
+
+
+/***************************************************************/
+/* The following knobs are not implemented in the current code */
+
+/* we need a dynamic level of suppression varying with the ratio of the
+ power of the echo to the power of the reference signal this is
+ done so that we have a smoother background.
+ we have a higher suppression when the power ratio is closer to
+ suppr_ceil and reduces logarithmically as we approach suppr_floor.
+ */
+#define SUPPR_FLOOR -64
+#define SUPPR_CEIL -24
+
+/* in a second departure, we calculate the residual error suppression
+ * as a percentage of the reference signal energy level. The threshold
+ * is defined in terms of dB below the reference signal.
+ */
+#define RES_SUPR_FACTOR -20
+
+
+#endif /* _MEC2_CONST_H */
+