shithub: aubio

Download patch

ref: 2f64b0eb35fd560567f08ac95d974014ea353fac
parent: 1e2c82fd0b63807b7d7068b5886aa53b96b7c605
author: Paul Brossier <piem@piem.org>
date: Thu Oct 1 21:11:37 EDT 2009

rename vec_min and vec_min_elem to fvec_min and fvec_max_elem

--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -110,7 +110,7 @@
   return tmp;
 }
 
-smpl_t vec_min(fvec_t *s) {
+smpl_t fvec_min(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = s->data[0][0];
   for (i=0; i < s->channels; i++)
@@ -119,7 +119,7 @@
   return tmp;
 }
 
-uint_t vec_min_elem(fvec_t *s) {
+uint_t fvec_min_elem(fvec_t *s) {
   uint_t i,j=0, pos=0.;
   smpl_t tmp = s->data[0][0];
   for (i=0; i < s->channels; i++)
@@ -183,7 +183,7 @@
 void vec_dc_removal(fvec_t * mag) {
     smpl_t mini = 0.;
     uint_t length = mag->length, i=0, j;
-    mini = vec_min(mag);
+    mini = fvec_min(mag);
     for (j=0;j<length;j++) {
       mag->data[i][j] -= mini;
     }
--- a/src/mathutils.h
+++ b/src/mathutils.h
@@ -77,12 +77,12 @@
  *
  * \bug mono 
  */
-smpl_t vec_min(fvec_t *s);
+smpl_t fvec_min(fvec_t *s);
 /** returns the index of the min of a vector
  *
  * \bug mono 
  */
-uint_t vec_min_elem(fvec_t *s);
+uint_t fvec_min_elem(fvec_t *s);
 /** returns the index of the max of a vector
  *
  * \bug mono 
--- a/src/pitch/pitchyin.c
+++ b/src/pitch/pitchyin.c
@@ -109,7 +109,7 @@
       return vec_quadint(yin,period,1);
     }
   }
-  return vec_quadint(yin,vec_min_elem(yin),1);
+  return vec_quadint(yin,fvec_min_elem(yin),1);
   //return 0;
 }
 
--- a/src/pitch/pitchyinfft.c
+++ b/src/pitch/pitchyinfft.c
@@ -119,7 +119,7 @@
     tmp += yin->data[0][tau];
     yin->data[0][tau] *= tau/tmp;
   }
-  tau = vec_min_elem(yin);
+  tau = fvec_min_elem(yin);
   if (yin->data[0][tau] < tol) {
     /* no interpolation */
     //return tau;
--- a/src/utils/hist.c
+++ b/src/utils/hist.c
@@ -19,7 +19,7 @@
 #include "aubio_priv.h"
 #include "fvec.h"
 #include "utils/scale.h"
-#include "mathutils.h" //vec_min fvec_max
+#include "mathutils.h" //fvec_min fvec_max
 #include "utils/hist.h"
 
 /********
@@ -108,7 +108,7 @@
 void aubio_hist_dyn_notnull (aubio_hist_t *s, fvec_t *input) {
   uint_t i,j;
   sint_t tmp = 0;
-  smpl_t ilow = vec_min(input);
+  smpl_t ilow = fvec_min(input);
   smpl_t ihig = fvec_max(input);
   smpl_t step = (ihig-ilow)/(smpl_t)(s->nelems);
 
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -131,8 +131,8 @@
 smpl_t aubio_unwrap2pi (smpl_t phase);
 smpl_t fvec_mean(fvec_t *s);
 smpl_t fvec_max(fvec_t *s);
-smpl_t vec_min(fvec_t *s);
-uint_t vec_min_elem(fvec_t *s);
+smpl_t fvec_min(fvec_t *s);
+uint_t fvec_min_elem(fvec_t *s);
 uint_t fvec_max_elem(fvec_t *s);
 void vec_shift(fvec_t *s);
 smpl_t vec_sum(fvec_t *s);
--- a/tests/src/test-filterbank.c
+++ b/tests/src/test-filterbank.c
@@ -24,7 +24,7 @@
     return -1;
   }
 
-  if (vec_min (coeffs) != 0.) {
+  if (fvec_min (coeffs) != 0.) {
     return -1;
   }