Changes in src/spectral/specdesc.c [c23e591:2763582]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/specdesc.c
rc23e591 r2763582 31 31 void aubio_specdesc_complex(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); 32 32 void aubio_specdesc_phase(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); 33 void aubio_specdesc_wphase(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset);34 33 void aubio_specdesc_specdiff(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); 35 34 void aubio_specdesc_kl(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); … … 59 58 aubio_onset_complex, /**< complex domain */ 60 59 aubio_onset_phase, /**< phase fast */ 61 aubio_onset_wphase, /**< weighted phase */62 60 aubio_onset_kl, /**< Kullback Liebler */ 63 61 aubio_onset_mkl, /**< modified Kullback Liebler */ … … 160 158 onset->data[0] = aubio_hist_mean(o->histog); 161 159 //onset->data[0] = fvec_mean(o->dev1); 162 }163 164 /* weighted phase */165 void166 aubio_specdesc_wphase(aubio_specdesc_t *o,167 const cvec_t *fftgrain, fvec_t *onset) {168 uint_t i;169 aubio_specdesc_phase(o, fftgrain, onset);170 for (i = 0; i < fftgrain->length; i++) {171 o->dev1->data[i] *= fftgrain->norm[i];172 }173 /* apply o->histogram */174 aubio_hist_dyn_notnull(o->histog,o->dev1);175 /* weight it */176 aubio_hist_weight(o->histog);177 /* its mean is the result */178 onset->data[0] = aubio_hist_mean(o->histog);179 160 } 180 161 … … 270 251 else if (strcmp (onset_mode, "phase") == 0) 271 252 onset_type = aubio_onset_phase; 272 else if (strcmp (onset_mode, "wphase") == 0)273 onset_type = aubio_onset_wphase;274 253 else if (strcmp (onset_mode, "mkl") == 0) 275 254 onset_type = aubio_onset_mkl; … … 313 292 break; 314 293 case aubio_onset_phase: 315 case aubio_onset_wphase:316 294 o->dev1 = new_fvec(rsize); 317 295 o->theta1 = new_fvec(rsize); … … 348 326 o->funcpointer = aubio_specdesc_phase; 349 327 break; 350 case aubio_onset_wphase:351 o->funcpointer = aubio_specdesc_wphase;352 break;353 328 case aubio_onset_specdiff: 354 329 o->funcpointer = aubio_specdesc_specdiff; … … 404 379 break; 405 380 case aubio_onset_phase: 406 case aubio_onset_wphase:407 381 del_fvec(o->dev1); 408 382 del_fvec(o->theta1);
Note: See TracChangeset
for help on using the changeset viewer.