shithub: aubio

Download patch

ref: 8b285248f7f73e12764df073de9a8e0e1e8209e0
parent: 47eabeb1dd57f7d65b8cba07a314bcd093b6b1c7
author: Paul Brossier <piem@piem.org>
date: Thu Oct 1 21:05:26 EDT 2009

src/mathutils.c: rename vec_mean to fvec_mean

--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -83,7 +83,7 @@
   return phase + TWO_PI * (1. + FLOOR(-(phase+PI)/TWO_PI));
 }
 
-smpl_t vec_mean(fvec_t *s) {
+smpl_t fvec_mean(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = 0.0f;
   for (i=0; i < s->channels; i++)
--- a/src/mathutils.h
+++ b/src/mathutils.h
@@ -67,7 +67,7 @@
  *
  * \bug mono 
  */
-smpl_t vec_mean(fvec_t *s);
+smpl_t fvec_mean(fvec_t *s);
 /** returns the max of a vector
  *
  * \bug mono 
--- a/src/onset/onsetdetection.c
+++ b/src/onset/onsetdetection.c
@@ -119,7 +119,7 @@
     aubio_hist_weight(o->histog);
     /* its mean is the result */
     onset->data[i][0] = aubio_hist_mean(o->histog);  
-    //onset->data[i][0] = vec_mean(o->dev1);
+    //onset->data[i][0] = fvec_mean(o->dev1);
   }
 }
 
--- a/src/onset/peakpick.c
+++ b/src/onset/peakpick.c
@@ -93,7 +93,7 @@
 
 	/* calculate mean and median for onset_proc */
 	/* for (i=0;i<onset_proc->channels;i++) { */
-	mean = vec_mean(onset_proc);
+	mean = fvec_mean(onset_proc);
 	/* copy to scratch */
 	for (j = 0; j < length; j++)
 		scratch->data[i][j] = onset_proc->data[i][j];
@@ -160,7 +160,7 @@
 	t->win_post  = 5;
 	t->win_pre   = 1;
 
-	t->thresholdfn = (aubio_thresholdfn_t)(vec_median); /* (vec_mean); */
+	t->thresholdfn = (aubio_thresholdfn_t)(vec_median); /* (fvec_mean); */
 	t->pickerfn = (aubio_pickerfn_t)(vec_peakpick);
 
 	t->scratch = new_fvec(t->win_post+t->win_pre+1,1);
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -129,7 +129,7 @@
 
 fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype);
 smpl_t aubio_unwrap2pi (smpl_t phase);
-smpl_t vec_mean(fvec_t *s);
+smpl_t fvec_mean(fvec_t *s);
 smpl_t vec_max(fvec_t *s);
 smpl_t vec_min(fvec_t *s);
 uint_t vec_min_elem(fvec_t *s);