[xiph-commits] r17938 - trunk/ghost/monty/chirp

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Apr 27 18:36:20 PDT 2011


Author: xiphmont
Date: 2011-04-27 18:36:20 -0700 (Wed, 27 Apr 2011)
New Revision: 17938

Modified:
   trunk/ghost/monty/chirp/chirp.c
   trunk/ghost/monty/chirp/chirpgraph.c
   trunk/ghost/monty/chirp/chirptest.c
Log:
fixes to graphing


Modified: trunk/ghost/monty/chirp/chirp.c
===================================================================
--- trunk/ghost/monty/chirp/chirp.c	2011-04-27 21:04:50 UTC (rev 17937)
+++ trunk/ghost/monty/chirp/chirp.c	2011-04-28 01:36:20 UTC (rev 17938)
@@ -347,7 +347,7 @@
         }
       }
     }
-    iter_limit--;
+    if(flag)iter_limit--;
   }
   return iter_limit;
 }
@@ -580,7 +580,7 @@
 
 
     }
-    iter_limit--;
+    if(flag)iter_limit--;
   }
 
   for(i=0;i<n;i++){

Modified: trunk/ghost/monty/chirp/chirpgraph.c
===================================================================
--- trunk/ghost/monty/chirp/chirpgraph.c	2011-04-27 21:04:50 UTC (rev 17937)
+++ trunk/ghost/monty/chirp/chirpgraph.c	2011-04-28 01:36:20 UTC (rev 17938)
@@ -355,7 +355,7 @@
           snprintf(buf,80,"%d",i);
           cairo_text_extents(c, buf, &extents);
           cairo_move_to(c,px+w/2-extents.width*.5,legendy+toppad+legendh*.625+extents.height/2);
-          cairo_set_source_rgba(c,1,1,1,.7);
+          cairo_set_source_rgba(c,1,1,1,.9);
           cairo_text_path (c, buf);
           cairo_stroke_preserve(c);
           cairo_set_source_rgb(c,0,0,0);
@@ -414,7 +414,7 @@
 
         cairo_text_extents(c, buf, &extents);
         cairo_move_to(c,px+w/2-extents.width*.5,legendy+toppad+legendh*.625+extents.height/2);
-        cairo_set_source_rgba(c,1,1,1,.7);
+        cairo_set_source_rgba(c,1,1,1,.9);
         cairo_text_path (c, buf);
         cairo_stroke_preserve(c);
         cairo_set_source_rgb(c,0,0,0);

Modified: trunk/ghost/monty/chirp/chirptest.c
===================================================================
--- trunk/ghost/monty/chirp/chirptest.c	2011-04-27 21:04:50 UTC (rev 17937)
+++ trunk/ghost/monty/chirp/chirptest.c	2011-04-28 01:36:20 UTC (rev 17938)
@@ -234,7 +234,7 @@
       rms_acc += ee*ee;
     }
     arg->rms_error[y] = sqrt(rms_acc)/sqrt(e_acc);
-    arg->iterations[y] = arg->max_iterations-ret-1;
+    arg->iterations[y] = arg->max_iterations-ret;
     feclearexcept(FE_ALL_EXCEPT);
     feenableexcept(except);
 
@@ -569,34 +569,49 @@
                (arg->subtitle1!=0)+(arg->subtitle2!=0)+(arg->subtitle3!=0),
                arg->fontsize);
 
-  if(!(arg->x_dim==DIM_ESTIMATE_A || arg->y_dim==DIM_ESTIMATE_A) &&
-     arg->min_est_A != arg->max_est_A) est_swept=1;
-  if(!(arg->x_dim==DIM_ESTIMATE_P || arg->y_dim==DIM_ESTIMATE_P) &&
-     arg->min_est_P != arg->max_est_P) est_swept=1;
-  if(!(arg->x_dim==DIM_ESTIMATE_W || arg->y_dim==DIM_ESTIMATE_W) &&
-     arg->min_est_W != arg->max_est_W) est_swept=1;
-  if(!(arg->x_dim==DIM_ESTIMATE_dA || arg->y_dim==DIM_ESTIMATE_dA) &&
-     arg->min_est_dA != arg->max_est_dA) est_swept=1;
-  if(!(arg->x_dim==DIM_ESTIMATE_dW || arg->y_dim==DIM_ESTIMATE_dW) &&
-     arg->min_est_dW != arg->max_est_dW) est_swept=1;
-  if(!(arg->x_dim==DIM_ESTIMATE_ddA || arg->y_dim==DIM_ESTIMATE_ddA) &&
-     arg->min_est_ddA != arg->max_est_ddA) est_swept=1;
+  if(arg->sweep_steps>1){
+    if(!(arg->x_dim==DIM_ESTIMATE_A || arg->y_dim==DIM_ESTIMATE_A) &&
+       arg->min_est_A != arg->max_est_A) est_swept=1;
+    if(!(arg->x_dim==DIM_ESTIMATE_P || arg->y_dim==DIM_ESTIMATE_P) &&
+       arg->min_est_P != arg->max_est_P) est_swept=1;
+    if(!(arg->x_dim==DIM_ESTIMATE_W || arg->y_dim==DIM_ESTIMATE_W) &&
+       arg->min_est_W != arg->max_est_W) est_swept=1;
+    if(!(arg->x_dim==DIM_ESTIMATE_dA || arg->y_dim==DIM_ESTIMATE_dA) &&
+       arg->min_est_dA != arg->max_est_dA) est_swept=1;
+    if(!(arg->x_dim==DIM_ESTIMATE_dW || arg->y_dim==DIM_ESTIMATE_dW) &&
+       arg->min_est_dW != arg->max_est_dW) est_swept=1;
+    if(!(arg->x_dim==DIM_ESTIMATE_ddA || arg->y_dim==DIM_ESTIMATE_ddA) &&
+       arg->min_est_ddA != arg->max_est_ddA) est_swept=1;
 
-  if(!(arg->x_dim==DIM_CHIRP_A || arg->y_dim==DIM_CHIRP_A) &&
+    if(!(arg->x_dim==DIM_CHIRP_A || arg->y_dim==DIM_CHIRP_A) &&
+       arg->min_chirp_A != arg->max_chirp_A) chirp_swept=1;
+    if(!(arg->x_dim==DIM_CHIRP_P || arg->y_dim==DIM_CHIRP_P) &&
+       arg->min_chirp_P != arg->max_chirp_P) chirp_swept=1;
+    if(!(arg->x_dim==DIM_CHIRP_W || arg->y_dim==DIM_CHIRP_W) &&
+       arg->min_chirp_W != arg->max_chirp_W) chirp_swept=1;
+    if(!(arg->x_dim==DIM_CHIRP_dA || arg->y_dim==DIM_CHIRP_dA) &&
+       arg->min_chirp_dA != arg->max_chirp_dA) chirp_swept=1;
+    if(!(arg->x_dim==DIM_CHIRP_dW || arg->y_dim==DIM_CHIRP_dW) &&
+       arg->min_chirp_dW != arg->max_chirp_dW) chirp_swept=1;
+    if(!(arg->x_dim==DIM_CHIRP_ddA || arg->y_dim==DIM_CHIRP_ddA) &&
+       arg->min_chirp_ddA != arg->max_chirp_ddA) chirp_swept=1;
+  }
+
+  swept = est_swept | chirp_swept;
+
+  if(arg->y_dim==DIM_CHIRP_A &&
      arg->min_chirp_A != arg->max_chirp_A) chirp_swept=1;
-  if(!(arg->x_dim==DIM_CHIRP_P || arg->y_dim==DIM_CHIRP_P) &&
+  if(arg->y_dim==DIM_CHIRP_P &&
      arg->min_chirp_P != arg->max_chirp_P) chirp_swept=1;
-  if(!(arg->x_dim==DIM_CHIRP_W || arg->y_dim==DIM_CHIRP_W) &&
+  if(arg->y_dim==DIM_CHIRP_W &&
      arg->min_chirp_W != arg->max_chirp_W) chirp_swept=1;
-  if(!(arg->x_dim==DIM_CHIRP_dA || arg->y_dim==DIM_CHIRP_dA) &&
+  if(arg->y_dim==DIM_CHIRP_dA &&
      arg->min_chirp_dA != arg->max_chirp_dA) chirp_swept=1;
-  if(!(arg->x_dim==DIM_CHIRP_dW || arg->y_dim==DIM_CHIRP_dW) &&
+  if(arg->y_dim==DIM_CHIRP_dW &&
      arg->min_chirp_dW != arg->max_chirp_dW) chirp_swept=1;
-  if(!(arg->x_dim==DIM_CHIRP_ddA || arg->y_dim==DIM_CHIRP_ddA) &&
+  if(arg->y_dim==DIM_CHIRP_ddA &&
      arg->min_chirp_ddA != arg->max_chirp_ddA) chirp_swept=1;
 
-  swept = est_swept | chirp_swept;
-
   if(arg->graph_convergence_max)
     cC = draw_page(!swept?"Convergence":"Worst Case Convergence",
                    arg->subtitle1,
@@ -1106,7 +1121,7 @@
 
     /* window */        window_functions.sine,
     /* fit_tol */       .000001,
-    /* gauss_seidel */  0,
+    /* gauss_seidel */  1,
     /* fit_W */         1,
     /* fit_dA */        1,
     /* fit_dW */        1,
@@ -1139,7 +1154,7 @@
     /* ch P range */    0.,1.-1./32.,
     /* ch W range */    0.,10.,
     /* ch dA range */   0.,0.,
-    /* ch dW range */   -1.2,1.2,
+    /* ch dW range */   -2.4,2.4,
     /* ch ddA range */  0.,0.,
 
     /* converge max */    1,
@@ -1162,27 +1177,35 @@
   };
 
   w_e("linear-dW-vs-W",&arg);
-  arg.nonlinear=1;
+  arg.fit_nonlinear=1;
+  arg.subtitle1="Partial nonlinear estimation, no ddA fit",
   w_e("partial-nonlinear-dW-vs-W",&arg);
-  arg.nonlinear=2;
+  arg.subtitle1="Full nonlinear estimation, no ddA fit",
+  arg.fit_nonlinear=2;
+  //arg.fit_dW_alpha=1.75;
   w_e("full-nonlinear-dW-vs-W",&arg);
+  //arg.fit_dW_alpha=1.;
 
-  arg.nonlinear=0;
+  arg.subtitle1="Linear estimation, no ddA fit",
+  arg.fit_nonlinear=0;
   arg.yaxis_label="initial distance from W (cycles/block)";
   arg.y_dim = DIM_ESTIMATE_W;
   arg.min_est_W = -1.2;
   arg.max_est_W =  1.2;
-  arg.min_chirp_dW=-1.;
-  arg.max_chirp_dW=1.;
+  arg.min_chirp_dW=0.;
+  arg.max_chirp_dW=0.;
 
   w_e("linear-estW-vs-W",&arg);
-  arg.nonlinear=1;
+  arg.subtitle1="Partial nonlinear estimation, no ddA fit",
+  arg.fit_nonlinear=1;
   w_e("partial-nonlinear-estW-vs-W",&arg);
-  arg.nonlinear=2;
+  arg.subtitle1="Full nonlinear estimation, no ddA fit",
+  arg.fit_nonlinear=2;
+  //arg.fit_dW_alpha=1.75;
   w_e("full-nonlinear-estW-vs-W",&arg);
+  //arg.fit_dW_alpha=1.;
+  arg.fit_nonlinear=0;
 
-  arg.nonlinear=0;
-
   return 0;
 }
 



More information about the commits mailing list