From: Paul Brossier Date: Sun, 30 Aug 2009 15:11:05 +0000 (+0200) Subject: src/tempo/beattracking.c: remove unused fvec_getperiod function X-Git-Tag: bzr2git~373 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54f2a70ad9036deb5799b912b0f0ed083db953f2;p=aubio.git src/tempo/beattracking.c: remove unused fvec_getperiod function --- diff --git a/src/tempo/beattracking.c b/src/tempo/beattracking.c index c062ac3f..2f6ce279 100644 --- a/src/tempo/beattracking.c +++ b/src/tempo/beattracking.c @@ -24,7 +24,6 @@ uint_t fvec_gettimesig(smpl_t * acf, uint_t acflen, uint_t gp); void aubio_beattracking_checkstate(aubio_beattracking_t * bt); -smpl_t fvec_getperiod(aubio_beattracking_t * bt); struct _aubio_beattracking_t { fvec_t * rwv; /** rayleigh weight vector - rayleigh distribution function */ @@ -37,8 +36,6 @@ struct _aubio_beattracking_t { fvec_t * phout; uint_t timesig; /** time signature of input, set to zero until context dependent model activated */ uint_t step; - fvec_t * locacf; /** vector to store harmonics of filterbank of acf */ - fvec_t * inds; /** vector for max index outputs for each harmonic */ uint_t rayparam; /** Rayleigh parameter */ uint_t lastbeat; sint_t counter; @@ -66,7 +63,6 @@ aubio_beattracking_t * new_aubio_beattracking(uint_t winlen, * 1 onset frame [128] */ uint_t step = winlen/4; /* 1.5 seconds */ - uint_t maxnumelem = 4; /* max number of index output */ p->lastbeat = 0; p->counter = 0; p->flagstep = 0; @@ -87,9 +83,6 @@ aubio_beattracking_t * new_aubio_beattracking(uint_t winlen, p->timesig = 0; - p->inds = new_fvec(maxnumelem,channels); - p->locacf = new_fvec(winlen,channels); - /* exponential weighting, dfwv = 0.5 when i = 43 */ for (i=0;idfwv->data[0][i] = (EXP((LOG(2.0)/rayparam)*(i+1))) @@ -114,8 +107,6 @@ void del_aubio_beattracking(aubio_beattracking_t * p) { del_fvec(p->acfout); del_fvec(p->phwv); del_fvec(p->phout); - del_fvec(p->locacf); - del_fvec(p->inds); AUBIO_FREE(p); } @@ -138,9 +129,6 @@ void aubio_beattracking_do(aubio_beattracking_t * bt, fvec_t * dfframe, fvec_t * //number of harmonics in shift invariant comb filterbank uint_t numelem = 4; - //smpl_t myperiod = 0.; - //smpl_t * out = output->data[0]; - //parameters for making s.i.c.f.b. uint_t a,b; //beat alignment @@ -191,11 +179,6 @@ void aubio_beattracking_do(aubio_beattracking_t * bt, fvec_t * dfframe, fvec_t * //rp = (maxindex==127) ? 43 : maxindex; //rayparam bt->rp = (maxindex==bt->acfout->length-1) ? bt->rayparam : maxindex; //rayparam - // get float period - //myperiod = fvec_getperiod(bt); - //AUBIO_DBG("\nrp = %d myperiod = %f\n",bt->rp,myperiod); - //AUBIO_DBG("accurate tempo is %f bpm\n",5168./myperiod); - /* activate biased filterbank */ aubio_beattracking_checkstate(bt); bp = bt->bp; @@ -266,64 +249,6 @@ uint_t fvec_gettimesig(smpl_t * acf, uint_t acflen, uint_t gp){ return (three_energy > four_energy) ? 3 : 4; } -smpl_t fvec_getperiod(aubio_beattracking_t * bt){ - /*function to make a more accurate beat period measurement.*/ - - smpl_t period = 0.; - smpl_t maxval = 0.; - uint_t numelem = 4; - - sint_t a,b; - uint_t i,j; - uint_t acfmi = bt->rp; //acfout max index - uint_t maxind = 0; - - if(!bt->timesig) - numelem = 4; - else - numelem = bt->timesig; - - for (i=0;iinds->data[0][i] = 0.; - - for (i=0;ilocacf->length;i++) // initialize - bt->locacf->data[0][i] = 0.; - - // get appropriate acf elements from acf and store in locacf - for (a=1;a<=4;a++){ - for(b=(1-a);blocacf->data[0][a*(acfmi)+b-1] = - bt->acf->data[0][a*(acfmi)+b-1]; - } - } - - for(i=0;ilocacf->data[0][j]>maxval){ - maxval = bt->locacf->data[0][j]; - maxind = j; - } - //bt->locacf->data[0][maxind] = 0.; - bt->locacf->data[0][j] = 0.; - } - //AUBIO_DBG("\n maxind is %d\n",maxind); - bt->inds->data[0][i] = maxind; - - } - - for (i=0;iinds->data[0][i]/(i+1.);} - - period = period/numelem; - - return (period); -} - - void aubio_beattracking_checkstate(aubio_beattracking_t * bt) { uint_t i,j,a,b; uint_t flagconst = 0;