[zaptel-commits] qwell: trunk r2526 - in /trunk: kb1ec.h kb1ec_const.h mg2ec.h mg2ec_const.h

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Thu May 17 10:17:43 MST 2007


Author: qwell
Date: Thu May 17 12:17:42 2007
New Revision: 2526

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2526
Log:
Add support for "Timed Agressive Echo Cancellation" for mg2 and kb1.

Issue 9703, patch by SoloFlyer.

Modified:
    trunk/kb1ec.h
    trunk/kb1ec_const.h
    trunk/mg2ec.h
    trunk/mg2ec_const.h

Modified: trunk/kb1ec.h
URL: http://svn.digium.com/view/zaptel/trunk/kb1ec.h?view=diff&rev=2526&r1=2525&r2=2526
==============================================================================
--- trunk/kb1ec.h (original)
+++ trunk/kb1ec.h Thu May 17 12:17:42 2007
@@ -435,6 +435,9 @@
 
 #ifndef NO_ECHO_SUPPRESSOR
 #ifdef AGGRESSIVE_SUPPRESSOR
+#ifdef AGGRESSIVE_TIMELIMIT
+	if (ec->i_d < AGGRESSIVE_TIMELIMIT ) {
+#endif
 	if ((ec->HCNTR_d < AGGRESSIVE_HCNTR) && (ec->Ly_i > (ec->Lu_i << 1))) {
 		for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
 			u = u * (ec->Lu_i >> DEFAULT_SIGMA_LU_I) / ((ec->Ly_i >> (DEFAULT_SIGMA_LY_I)) + 1);
@@ -446,7 +449,12 @@
 		++ec->cntr_residualcorrected_frames;
 #endif
 	}
-#else
+#ifdef AGGRESSIVE_TIMELIMIT
+	}
+	else {
+#endif
+#endif
+#if (defined AGGRESSIVE_SUPPRESSOR  && defined AGGRESSIVE_TIMELIMIT) || !defined AGGRESSIVE_SUPPRESSOR
 	if (ec->HCNTR_d == 0) { 
 		if ((ec->Ly_i/(ec->Lu_i + 1)) > DEFAULT_SUPPR_I) {
 			for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
@@ -465,6 +473,9 @@
 		}
 #endif
 	}
+#ifdef AGGRESSIVE_TIMELIMIT
+	}
+#endif
 #endif	
 #endif  
 

Modified: trunk/kb1ec_const.h
URL: http://svn.digium.com/view/zaptel/trunk/kb1ec_const.h?view=diff&rev=2526&r1=2525&r2=2526
==============================================================================
--- trunk/kb1ec_const.h (original)
+++ trunk/kb1ec_const.h Thu May 17 12:17:42 2007
@@ -57,6 +57,12 @@
  #define RESIDUAL_SUPRESSION_PASSES 1
 #endif
 
+/* If defined then agressive echo cancellation will only be used for
+ * this amount of time then we will go back to normal cancelation.
+ * This is helpful if you have bad echo while training
+ */
+/* #define AGGRESSIVE_TIMELIMIT 150000 */ /* 8 = 1ms */
+
 
 /***************************************************************/
 /* The following knobs are not implemented in the current code */

Modified: trunk/mg2ec.h
URL: http://svn.digium.com/view/zaptel/trunk/mg2ec.h?view=diff&rev=2526&r1=2525&r2=2526
==============================================================================
--- trunk/mg2ec.h (original)
+++ trunk/mg2ec.h Thu May 17 12:17:42 2007
@@ -556,6 +556,9 @@
 
 #ifndef NO_ECHO_SUPPRESSOR
 #ifdef AGGRESSIVE_SUPPRESSOR
+#ifdef AGGRESSIVE_TIMELIMIT
+	if (ec->i_d < AGGRESSIVE_TIMELIMIT ) {
+#endif
 	if ((ec->HCNTR_d < AGGRESSIVE_HCNTR) && (ec->Ly_i > (ec->Lu_i << 1))) {
 		for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
 			u = u * (ec->Lu_i >> DEFAULT_SIGMA_LU_I) / ((ec->Ly_i >> (DEFAULT_SIGMA_LY_I)) + 1);
@@ -567,7 +570,12 @@
 		++ec->cntr_residualcorrected_frames;
 #endif
 	}
-#else
+#ifdef AGGRESSIVE_TIMELIMIT
+	}
+	else {
+#endif
+#endif
+#if (defined AGGRESSIVE_SUPPRESSOR  && defined AGGRESSIVE_TIMELIMIT) || !defined AGGRESSIVE_SUPPRESSOR
 	if (ec->HCNTR_d == 0) { 
 		if ((ec->Ly_i/(ec->Lu_i + 1)) > DEFAULT_SUPPR_I) {
 			for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
@@ -586,6 +594,9 @@
 		}
 #endif
 	}
+#ifdef AGGRESSIVE_TIMELIMIT
+	}
+#endif
 #endif	
 #endif  
 

Modified: trunk/mg2ec_const.h
URL: http://svn.digium.com/view/zaptel/trunk/mg2ec_const.h?view=diff&rev=2526&r1=2525&r2=2526
==============================================================================
--- trunk/mg2ec_const.h (original)
+++ trunk/mg2ec_const.h Thu May 17 12:17:42 2007
@@ -74,6 +74,12 @@
 /* Backup coefficients every this number of samples */
 #define BACKUP 256
 
+/* If defined then agressive echo cancellation will only be used for
+ * this amount of time then we will go back to normal cancelation.
+ * This is helpful if you have bad echo while training
+ */
+/* #define AGGRESSIVE_TIMELIMIT 150000 */ /* 8 = 1ms */
+
 /***************************************************************/
 /* The following knobs are not implemented in the current code */
 



More information about the zaptel-commits mailing list