[xiph-commits] r18001 - trunk/chirptest

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed May 25 05:59:48 PDT 2011


Author: xiphmont
Date: 2011-05-25 05:59:48 -0700 (Wed, 25 May 2011)
New Revision: 18001

Modified:
   trunk/chirptest/chirp.c
   trunk/chirptest/chirptest.c
Log:
OK, begin committing the final multichirp tests...


Modified: trunk/chirptest/chirp.c
===================================================================
--- trunk/chirptest/chirp.c	2011-05-23 20:02:50 UTC (rev 18000)
+++ trunk/chirptest/chirp.c	2011-05-25 12:59:48 UTC (rev 18001)
@@ -84,10 +84,10 @@
 }
 
 static float dWtoEi(float A, float P, float dW){
-  return -A*dW*sin(P);
+  return -A*dW*sinf(P);
 }
 static float dWtoFi(float A, float P, float dW){
-  return -A*dW*cos(P);
+  return -A*dW*cosf(P);
 }
 
 static float dAtoCi(float P, float dA){
@@ -97,10 +97,10 @@
   return -dA*sinf(P);
 }
 static float ddAtoEi(float P, float ddA){
-  return ddA*cos(P);
+  return ddA*cosf(P);
 }
 static float ddAtoFi(float P, float ddA){
-  return -ddA*sin(P);
+  return -ddA*sinf(P);
 }
 
 /* fully nonlinear estimation iterator; it restarts the basis
@@ -284,7 +284,7 @@
          (eP*eP + fP*fP)>1e10){
         /* mark this chirp inactive */
         c->A=-1;
-        break;
+        continue;
       }
 
       {

Modified: trunk/chirptest/chirptest.c
===================================================================
--- trunk/chirptest/chirptest.c	2011-05-23 20:02:50 UTC (rev 18000)
+++ trunk/chirptest/chirptest.c	2011-05-25 12:59:48 UTC (rev 18001)
@@ -2995,6 +2995,9 @@
 
 #if 1
   /* Two chirp discrimination graphs ****************************************/
+  /* First, graphs using a poor initial estimate with a zero
+     amplitude.  This defeats the sorting/energy subtraction and
+     illustrates sidelobe capture. */
   /* A vs W *****************************************************************/
   init_arg(&arg);
 
@@ -3005,10 +3008,10 @@
   arg.sweep_steps=128;
 
   arg.x_dim=DIM_CHIRP_W;
-  arg.chirp.W_0 = -25;
-  arg.chirp.W_1 = +25;
+  arg.chirp.W_0 = 0;
+  arg.chirp.W_1 = +20;
   arg.chirp.W_rel = 1; /* relative to alt chirp W */
-  arg.x_major = 5;
+  arg.x_major = 1;
   arg.x_minor = .5;
   arg.xaxis_label = "test chirp relative W (cycles/block)";
 
@@ -3019,56 +3022,96 @@
   arg.y_minor = 5;
   arg.yaxis_label = "test chirp amplitude (dB)";
 
+  arg.fit_nonlinear=0;
+  arg.window = window_functions.rectangle;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-0A-",&arg);
 
-  arg.est.A_rel = 1;
-  arg.est_alt.A_rel = 1;
+  arg.fit_nonlinear=1;
+  arg.window = window_functions.rectangle;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-0A-",&arg);
 
-  arg.est.W_0 = arg.est.W_1 = 1;
-  arg.est_alt.W_0 = arg.est_alt.W_1 = -1;
+  arg.fit_nonlinear=2;
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 2.25;
+  arg.window = window_functions.rectangle;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.711;
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.618;
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.5;
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-0A-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.554;
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-0A-",&arg);
 
+  /* Alter the above graphs to use an estimate with accurate
+     amplitude */
+  arg.est.A_rel=1;
+  arg.est_alt.A_rel=1;
+
   arg.fit_nonlinear=0;
   arg.window = window_functions.rectangle;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.sine;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.hanning;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.tgauss_deep;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.maxwell1;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
 
   arg.fit_nonlinear=1;
   arg.window = window_functions.rectangle;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.sine;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.hanning;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.tgauss_deep;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.window = window_functions.maxwell1;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
 
   arg.fit_nonlinear=2;
   arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 2.25;
   arg.window = window_functions.rectangle;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.711;
   arg.window = window_functions.sine;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.618;
   arg.window = window_functions.hanning;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.5;
   arg.window = window_functions.tgauss_deep;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
   arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.554;
   arg.window = window_functions.maxwell1;
-  graph_1chirp("2ch-",&arg);
+  graph_1chirp("2ch-AA-",&arg);
 
+
   /* dW vs W *****************************************************************/
-
+#if 0
   arg.sweep_steps=32;
   arg.chirp.A_0 = arg.chirp.A_1 = 0.;
 
@@ -3129,8 +3172,8 @@
       graph_1chirp(buf,&arg);
     }
   }
-
 #endif
+#endif
 
   return 0;
 }



More information about the commits mailing list