[xiph-commits] r18002 - trunk/chirptest

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu May 26 11:05:55 PDT 2011


Author: xiphmont
Date: 2011-05-26 11:05:55 -0700 (Thu, 26 May 2011)
New Revision: 18002

Modified:
   trunk/chirptest/chirptest.c
Log:
A few more multichirp graphs



Modified: trunk/chirptest/chirptest.c
===================================================================
--- trunk/chirptest/chirptest.c	2011-05-25 12:59:48 UTC (rev 18001)
+++ trunk/chirptest/chirptest.c	2011-05-26 18:05:55 UTC (rev 18002)
@@ -40,6 +40,7 @@
   float W_0;
   float W_1;
   int   W_rel;
+  int   W_trunc;
 
   float dA_0;
   float dA_1;
@@ -2108,6 +2109,7 @@
           if(arg->chirp_alt.dA_rel) chirps[ym+1].dA += chirps[ym].dA;
           if(arg->chirp_alt.dW_rel) chirps[ym+1].dW += chirps[ym].dW;
           if(arg->chirp_alt.ddA_rel) chirps[ym+1].ddA += chirps[ym].ddA;
+          if(arg->chirp_alt.W_trunc) chirps[ym+1].W = rint(chirps[ym+1].W);
 
           /* chirp can be relative to alt chirp */
           if(arg->chirp.A_rel)
@@ -2126,7 +2128,9 @@
           if(arg->est_alt.dA_rel) estimates[ym+1].dA += chirps[ym+1].dA;
           if(arg->est_alt.dW_rel) estimates[ym+1].dW += chirps[ym+1].dW;
           if(arg->est_alt.ddA_rel) estimates[ym+1].ddA += chirps[ym+1].ddA;
+          if(arg->est_alt.W_trunc) estimates[ym+1].W = rint(estimates[ym+1].W);
         }
+        if(arg->chirp.W_trunc) chirps[ym].W = rint(chirps[ym].W);
 
         /* estimate can be relative to chirp */
         if(arg->est.A_rel) estimates[ym].A =
@@ -2136,6 +2140,7 @@
         if(arg->est.dA_rel) estimates[ym].dA += chirps[ym].dA;
         if(arg->est.dW_rel) estimates[ym].dW += chirps[ym].dW;
         if(arg->est.ddA_rel) estimates[ym].ddA += chirps[ym].ddA;
+        if(arg->est.W_trunc) estimates[ym].W = rint(estimates[ym].W);
 
       }
 
@@ -2533,7 +2538,7 @@
     (rel_param){
       /* est A range */  -999.,-999.,  0, /* relative flag */
       /* est P range */     0.,  0.,  0, /* relative flag */
-      /* est W range */     0.,  0.,  1, /* relative flag */
+      /* est W range */     0.,  0.,  1,  0,/* rel, trunc */
       /* est dA range */    0.,  0.,  0, /* relative flag */
       /* est dW range */    0.,  0.,  0, /* relative flag */
       /* est ddA range */   0.,  0.,  0, /* relative flag */
@@ -2543,7 +2548,7 @@
     (rel_param){
       /* ch A range */    0.,0., 0,
       /* ch P range */    0.,1.-1./32., 0,
-      /* ch W range */    0.,0., 0,
+      /* ch W range */    0.,0., 0, 0,
       /* ch dA range */   0.,0., 0,
       /* ch dW range */   0.,0., 0,
       /* ch ddA range */  0.,0., 0,
@@ -2553,7 +2558,7 @@
     (rel_param){
       /* alt est A range */  -999.,-999.,  0, /* relative flag */
       /* alt est P range */     0.,  0.,  0, /* relative flag */
-      /* alt est W range */     0.,  0.,  1, /* relative flag */
+      /* alt est W range */     0.,  0.,  1, 0, /* rel, trunc */
       /* alt est dA range */    0.,  0.,  0, /* relative flag */
       /* alt est dW range */    0.,  0.,  0, /* relative flag */
       /* alt est ddA range */   0.,  0.,  0, /* relative flag */
@@ -2563,7 +2568,7 @@
     (rel_param){
       /* alt ch A range */    0.,0., 0,
       /* alt ch P range */    0.,1.-1./32., 0,
-      /* alt ch W range */    0.,0., 0,
+      /* alt ch W range */    0.,0., 0, 0,
       /* alt ch dA range */   0.,0., 0,
       /* alt ch dW range */   0.,0., 0,
       /* alt ch ddA range */  0.,0., 0,
@@ -3109,7 +3114,60 @@
   arg.window = window_functions.maxwell1;
   graph_1chirp("2ch-AA-",&arg);
 
+  /* Simulate an estimate taken from an initial FFT  */
+  arg.est.A_rel=1;
+  arg.est_alt.A_rel=1;
+  arg.est.A_0=arg.est.A_1=-.01;
+  arg.est_alt.A_0=arg.est_alt.A_1=0;
 
+  arg.est_alt.P_rel=1;
+  arg.est.P_0=arg.est.P_1=0;
+  arg.est_alt.P_0=arg.est_alt.P_1=0;
+
+  arg.est.W_trunc=1;
+
+  arg.fit_nonlinear=0;
+  arg.window = window_functions.rectangle;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-FF-",&arg);
+
+  arg.fit_nonlinear=1;
+  arg.window = window_functions.rectangle;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-FF-",&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-FF-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.711;
+  arg.window = window_functions.sine;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.618;
+  arg.window = window_functions.hanning;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.5;
+  arg.window = window_functions.tgauss_deep;
+  graph_1chirp("2ch-FF-",&arg);
+  arg.fit_dW_alpha_0 = arg.fit_dW_alpha_1 = 1.554;
+  arg.window = window_functions.maxwell1;
+  graph_1chirp("2ch-FF-",&arg);
+
+
   /* dW vs W *****************************************************************/
 #if 0
   arg.sweep_steps=32;



More information about the commits mailing list