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

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sun May 1 17:38:09 PDT 2011


Author: xiphmont
Date: 2011-05-01 17:38:09 -0700 (Sun, 01 May 2011)
New Revision: 17948

Modified:
   trunk/ghost/monty/chirp/chirp.c
   trunk/ghost/monty/chirp/chirptest.c
Log:
Push more rational convergence criteria for our purposes


Modified: trunk/ghost/monty/chirp/chirp.c
===================================================================
--- trunk/ghost/monty/chirp/chirp.c	2011-04-30 19:04:54 UTC (rev 17947)
+++ trunk/ghost/monty/chirp/chirp.c	2011-05-02 00:38:09 UTC (rev 17948)
@@ -322,8 +322,7 @@
           ee += ddAtoEi(c->P,ddA);
           ff += ddAtoFi(c->P,ddA);
         }
-        move = (move + cc*cc + dd*dd + ee*ee + ff*ff) /
-          (c->A*c->A + fit_limit*fit_limit);
+        move = move + cc*cc + dd*dd + ee*ee + ff*ff;
         if(fit_limit>0 && move>fit_limit*fit_limit)flag=1;
         if(fit_limit<0 && move>1e-14)flag=1;
       }
@@ -598,7 +597,6 @@
       /* base convergence on basis projection movement this
          iteration, but only consider the contribution of terms we fit. */
       {
-        float A2 = ch[i].A*ch[i].A;
         float move;
         float cc=0,dd=0;
         float ee=0,ff=0;
@@ -622,7 +620,7 @@
           ee += ddAtoEi(ch[i].P,ddA);
           ff += ddAtoFi(ch[i].P,ddA);
         }
-        move = (tmpa*tmpa + tmpb*tmpb + cc*cc + dd*dd + ee*ee + ff*ff) / (A2 + fit_limit*fit_limit);
+        move = tmpa*tmpa + tmpb*tmpb + cc*cc + dd*dd + ee*ee + ff*ff;
         if(fit_limit>0 && move>fit_limit*fit_limit)flag=1;
         if(fit_limit<0 && move>1e-14)flag=1;
       }
@@ -842,26 +840,23 @@
         i=n;
       }
 
+      ai[i] += tmpa;
+      bi[i] += tmpb;
+      ci[i] += tmpc;
+      di[i] += tmpd;
+      ei[i] += tmpe;
+      fi[i] += tmpf;
+
       /* base convergence on basis projection movement this
          iteration */
       {
-        float A2 = ai[i]*ai[i]+bi[i]*bi[i];
-        float move = (tmpa*tmpa + tmpb*tmpb)/(A2 + fit_limit*fit_limit) +
-          (tmpc*tmpc + tmpd*tmpd)/(A2 + fit_limit*fit_limit) +
-          (tmpe*tmpe + tmpf*tmpf)/(A2 + fit_limit*fit_limit);
+        float move = tmpa*tmpa + tmpb*tmpb +tmpc*tmpc + tmpd*tmpd + tmpe*tmpe + tmpf*tmpf;
 
         if(fit_limit>0 && move>fit_limit*fit_limit)flag=1;
         if(fit_limit<0 && move>1e-14)flag=1;
       }
 
 
-      ai[i] += tmpa;
-      bi[i] += tmpb;
-      ci[i] += tmpc;
-      di[i] += tmpd;
-      ei[i] += tmpe;
-      fi[i] += tmpf;
-
     }
     if(flag)iter_limit--;
   }

Modified: trunk/ghost/monty/chirp/chirptest.c
===================================================================
--- trunk/ghost/monty/chirp/chirptest.c	2011-04-30 19:04:54 UTC (rev 17947)
+++ trunk/ghost/monty/chirp/chirptest.c	2011-05-02 00:38:09 UTC (rev 17948)
@@ -1121,7 +1121,7 @@
     /* yaxis label */   "dW (cycles/block)",
 
     /* blocksize */     128,
-    /* threads */       8,
+    /* threads */       32,
 
     /* window */        window_functions.sine,
     /* fit_tol */       .000001,
@@ -1162,7 +1162,7 @@
     /* ch ddA range */  0.,0.,
 
     /* converge max */    1,
-    /* converge del */    1,
+    /* converge del */    0,
     /* max A error */     1,
     /* A error delta */   0,
     /* max P error */     1,
@@ -1263,7 +1263,46 @@
   arg.subtitle3 = "maxwell (optimized) window";
   w_e("full-nonlinear-estW-vs-W-maxwell",&arg);
 
+  /* 1, 1.5, 2nd order */
+  arg.min_est_W = -3;
+  arg.max_est_W =  3;
+  arg.max_chirp_W =  10;
+  arg.window = window_functions.hanning;
+  arg.subtitle3 = "hanning window";
+  arg.fit_dW = 0;
+  arg.fit_dA = 0;
 
+  arg.fit_nonlinear = 2;
+  arg.subtitle1="Fully nonlinear estimation, half-order fit (W only)";
+  w_e("nonlinear-estW-vs-W-.5order",&arg);
+
+  arg.fit_dA=1;
+
+  arg.fit_nonlinear = 0;
+  arg.subtitle1="Linear estimation, first-order fit";
+  w_e("linear-estW-vs-W-1order",&arg);
+
+  arg.fit_nonlinear = 2;
+  arg.subtitle1="Fully nonlinear estimation, first-order fit";
+  w_e("nonlinear-estW-vs-W-1order",&arg);
+
+  arg.fit_dW=1;
+
+  arg.fit_nonlinear = 2;
+  arg.subtitle1="Fully nonlinear estimation, 1.5th-order fit (dW only)";
+  w_e("nonlinear-estW-vs-W-1.5order",&arg);
+
+  arg.fit_ddA=1;
+
+  arg.fit_nonlinear = 0;
+  arg.subtitle1="Linear estimation, second-order fit";
+  w_e("linear-estW-vs-W-2order",&arg);
+
+  arg.fit_nonlinear = 2;
+  arg.subtitle1="Fully nonlinear estimation, second-order fit";
+  w_e("nonlinear-estW-vs-W-2order",&arg);
+
+
   return 0;
 }
 



More information about the commits mailing list