Changeset 3502119 for src/spectral/specdesc.c
- Timestamp:
- Apr 5, 2017, 11:49:57 AM (7 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:
- c3b1a7d
- Parents:
- 0eca01f (diff), c82859f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/specdesc.c
r0eca01f r3502119 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; … … 271 292 else if (strcmp (onset_mode, "rolloff") == 0) 272 293 onset_type = aubio_specmethod_rolloff; 294 else if (strcmp (onset_mode, "old_default") == 0) 295 onset_type = aubio_onset_default; 273 296 else if (strcmp (onset_mode, "default") == 0) 274 297 onset_type = aubio_onset_default; … … 292 315 break; 293 316 case aubio_onset_phase: 317 case aubio_onset_wphase: 294 318 o->dev1 = new_fvec(rsize); 295 319 o->theta1 = new_fvec(rsize); … … 326 350 o->funcpointer = aubio_specdesc_phase; 327 351 break; 352 case aubio_onset_wphase: 353 o->funcpointer = aubio_specdesc_wphase; 354 break; 328 355 case aubio_onset_specdiff: 329 356 o->funcpointer = aubio_specdesc_specdiff; … … 379 406 break; 380 407 case aubio_onset_phase: 408 case aubio_onset_wphase: 381 409 del_fvec(o->dev1); 382 410 del_fvec(o->theta1);
Note: See TracChangeset
for help on using the changeset viewer.