Changeset c23e591
- Timestamp:
- Mar 11, 2017, 4:57:49 AM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 42f1cd01
- Parents:
- 90e25cc
- Location:
- src/spectral
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/specdesc.c
r90e25cc rc23e591 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); 33 34 void aubio_specdesc_specdiff(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); 34 35 void aubio_specdesc_kl(aubio_specdesc_t *o, const cvec_t * fftgrain, fvec_t * onset); … … 58 59 aubio_onset_complex, /**< complex domain */ 59 60 aubio_onset_phase, /**< phase fast */ 61 aubio_onset_wphase, /**< weighted phase */ 60 62 aubio_onset_kl, /**< Kullback Liebler */ 61 63 aubio_onset_mkl, /**< modified Kullback Liebler */ … … 158 160 onset->data[0] = aubio_hist_mean(o->histog); 159 161 //onset->data[0] = fvec_mean(o->dev1); 162 } 163 164 /* weighted phase */ 165 void 166 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); 160 179 } 161 180 … … 251 270 else if (strcmp (onset_mode, "phase") == 0) 252 271 onset_type = aubio_onset_phase; 272 else if (strcmp (onset_mode, "wphase") == 0) 273 onset_type = aubio_onset_wphase; 253 274 else if (strcmp (onset_mode, "mkl") == 0) 254 275 onset_type = aubio_onset_mkl; … … 292 313 break; 293 314 case aubio_onset_phase: 315 case aubio_onset_wphase: 294 316 o->dev1 = new_fvec(rsize); 295 317 o->theta1 = new_fvec(rsize); … … 326 348 o->funcpointer = aubio_specdesc_phase; 327 349 break; 350 case aubio_onset_wphase: 351 o->funcpointer = aubio_specdesc_wphase; 352 break; 328 353 case aubio_onset_specdiff: 329 354 o->funcpointer = aubio_specdesc_specdiff; … … 379 404 break; 380 405 case aubio_onset_phase: 406 case aubio_onset_wphase: 381 407 del_fvec(o->dev1); 382 408 del_fvec(o->theta1); -
src/spectral/specdesc.h
r90e25cc rc23e591 60 60 Hong-Kong, 2003. 61 61 62 \b \p wphase : Weighted Phase Deviation onset detection function 63 64 S. Dixon. Onset detection revisited. In Proceedings of the 9th International 65 Conference on Digital Audio Ef- fects (DAFx) , pages 133–137, 2006. 66 67 http://www.eecs.qmul.ac.uk/~simond/pub/2006/dafx.pdf 68 62 69 \b \p specdiff : Spectral difference method onset detection function 63 70
Note: See TracChangeset
for help on using the changeset viewer.