From 2f64b0eb35fd560567f08ac95d974014ea353fac Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 2 Oct 2009 01:11:37 +0200 Subject: [PATCH] rename vec_min and vec_min_elem to fvec_min and fvec_max_elem --- src/mathutils.c | 6 +++--- src/mathutils.h | 4 ++-- src/pitch/pitchyin.c | 2 +- src/pitch/pitchyinfft.c | 2 +- src/utils/hist.c | 4 ++-- swig/aubio.i | 4 ++-- tests/src/test-filterbank.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mathutils.c b/src/mathutils.c index 1f8f3954..5cd6fe57 100644 --- a/src/mathutils.c +++ b/src/mathutils.c @@ -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;jdata[i][j] -= mini; } diff --git a/src/mathutils.h b/src/mathutils.h index 3e474468..6014756f 100644 --- a/src/mathutils.h +++ b/src/mathutils.h @@ -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 diff --git a/src/pitch/pitchyin.c b/src/pitch/pitchyin.c index 28da6ec4..78d13ff3 100644 --- a/src/pitch/pitchyin.c +++ b/src/pitch/pitchyin.c @@ -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; } diff --git a/src/pitch/pitchyinfft.c b/src/pitch/pitchyinfft.c index 862a4837..8d8d0314 100644 --- a/src/pitch/pitchyinfft.c +++ b/src/pitch/pitchyinfft.c @@ -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; diff --git a/src/utils/hist.c b/src/utils/hist.c index 9e8d2709..50ee9705 100644 --- 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_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); diff --git a/swig/aubio.i b/swig/aubio.i index 3933391c..8900bf14 100644 --- a/swig/aubio.i +++ b/swig/aubio.i @@ -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); diff --git a/tests/src/test-filterbank.c b/tests/src/test-filterbank.c index 44c97042..ba66a23a 100644 --- a/tests/src/test-filterbank.c +++ b/tests/src/test-filterbank.c @@ -24,7 +24,7 @@ main (void) return -1; } - if (vec_min (coeffs) != 0.) { + if (fvec_min (coeffs) != 0.) { return -1; } -- 2.26.2