rename vec_min and vec_min_elem to fvec_min and fvec_max_elem
authorPaul Brossier <piem@piem.org>
Thu, 1 Oct 2009 23:11:37 +0000 (01:11 +0200)
committerPaul Brossier <piem@piem.org>
Thu, 1 Oct 2009 23:11:37 +0000 (01:11 +0200)
src/mathutils.c
src/mathutils.h
src/pitch/pitchyin.c
src/pitch/pitchyinfft.c
src/utils/hist.c
swig/aubio.i
tests/src/test-filterbank.c

index 1f8f395..5cd6fe5 100644 (file)
@@ -110,7 +110,7 @@ smpl_t fvec_max(fvec_t *s) {
   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 @@ smpl_t vec_min(fvec_t *s) {
   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 @@ smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha) {
 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;
     }
index 3e47446..6014756 100644 (file)
@@ -77,12 +77,12 @@ smpl_t fvec_max(fvec_t *s);
  *
  * \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 
index 28da6ec..78d13ff 100644 (file)
@@ -109,7 +109,7 @@ smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t * yin, smpl_t tol){
       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;
 }
 
index 862a483..8d8d031 100644 (file)
@@ -119,7 +119,7 @@ smpl_t aubio_pitchyinfft_detect(aubio_pitchyinfft_t * p, fvec_t * input, smpl_t
     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;
index 9e8d270..50ee970 100644 (file)
@@ -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_do_notnull (aubio_hist_t *s, fvec_t *input) {
 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);
 
index 3933391..8900bf1 100644 (file)
@@ -131,8 +131,8 @@ fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype);
 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);
index 44c9704..ba66a23 100644 (file)
@@ -24,7 +24,7 @@ main (void)
     return -1;
   }
 
-  if (vec_min (coeffs) != 0.) {
+  if (fvec_min (coeffs) != 0.) {
     return -1;
   }