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) {
* \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 */
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 */
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);