ref: c0b295c7380f35851e124b0cedd01e7620725bec
parent: 38e973229558d1d2cee3b90d514e14daabf102a6
author: Paul Brossier <piem@piem.org>
date: Thu Oct 1 22:05:23 EDT 2009
src/mathutils.c: rename fvec_dc_removal to fvec_min_removal
--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -180,13 +180,16 @@
return POW(tmp/DF->length,1./alpha);
}
-void fvec_dc_removal(fvec_t * mag) {
- smpl_t mini = 0.;
- uint_t length = mag->length, i=0, j;
- mini = fvec_min(mag);
- for (j=0;j<length;j++) {
+void
+fvec_min_removal (fvec_t * o)
+{
+ uint_t i, j;
+ smpl_t mini = fvec_min (mag);
+ for (i = 0; i < o->channels; i++) {
+ for (j = 0; j < o->length; j++) {
mag->data[i][j] -= mini;
}
+ }
}
void fvec_alpha_normalise(fvec_t * mag, uint_t alpha) {
--- a/src/mathutils.h
+++ b/src/mathutils.h
@@ -119,8 +119,8 @@
* \bug should not use POW :(
*/
smpl_t fvec_alpha_norm(fvec_t * DF, smpl_t alpha);
-/** dc(min) removal */
-void fvec_dc_removal(fvec_t * mag);
+/** min removal */
+void fvec_min_removal(fvec_t * mag);
/** alpha normalisation */
void fvec_alpha_normalise(fvec_t * mag, uint_t alpha);
/** add a constant to all members of a vector */
--- a/src/pitch/pitchmcomb.c
+++ b/src/pitch/pitchmcomb.c
@@ -158,9 +158,9 @@
for (j=0;j<length;j++) {
mag->data[i][j] = newmag->data[i][j];
}
- fvec_dc_removal(mag); /* dc removal */
+ fvec_min_removal(mag); /* min removal */
fvec_alpha_normalise(mag,p->alpha); /* alpha normalisation */
- /* skipped */ /* low pass filtering */
+ /* skipped */ /* low pass filtering */
/** \bug fvec_moving_thres may write out of bounds */
fvec_adapt_thres(mag,tmp,p->win_post,p->win_pre); /* adaptative threshold */
fvec_add(mag,-p->threshold); /* fixed threshold */
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -139,7 +139,7 @@
smpl_t fvec_local_energy(fvec_t * f);
smpl_t fvec_local_hfc(fvec_t * f);
smpl_t fvec_alpha_norm(fvec_t * DF, smpl_t alpha);
-void fvec_dc_removal(fvec_t * mag);
+void fvec_min_removal(fvec_t * mag);
void fvec_alpha_normalise(fvec_t * mag, uint_t alpha);
void fvec_add(fvec_t * mag, smpl_t threshold);
void fvec_adapt_thres(fvec_t * vec, fvec_t * tmp, uint_t post, uint_t pre);