Changeset 77db425 for src/tempo/beattracking.c
- Timestamp:
- Nov 26, 2013, 4:18:57 AM (10 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- 2dbcafa
- Parents:
- 18f14f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tempo/beattracking.c
r18f14f9 r77db425 32 32 struct _aubio_beattracking_t 33 33 { 34 uint_t hop_size; /** length of one tempo detection function sample, in audio samples */ 35 uint_t samplerate; /** samplerate of the original signal */ 34 36 fvec_t *rwv; /** rayleigh weighting for beat period in general model */ 35 37 fvec_t *dfwv; /** exponential weighting for beat alignment in general model */ … … 55 57 56 58 aubio_beattracking_t * 57 new_aubio_beattracking (uint_t winlen )59 new_aubio_beattracking (uint_t winlen, uint_t hop_size, uint_t samplerate) 58 60 { 59 61 60 62 aubio_beattracking_t *p = AUBIO_NEW (aubio_beattracking_t); 61 63 uint_t i = 0; 62 /* parameter for rayleigh weight vector - sets preferred tempo to 63 * 120bpm [43] */ 64 smpl_t rayparam = 48. / 512. * winlen; 64 p->hop_size = hop_size; 65 p->samplerate = samplerate; 66 /* default value for rayleigh weighting - sets preferred tempo to 120bpm */ 67 smpl_t rayparam = 60. * samplerate / 120. / hop_size; 65 68 smpl_t dfwvnorm = EXP ((LOG (2.0) / rayparam) * (winlen + 2)); 66 69 /* length over which beat period is found [128] */ … … 415 418 aubio_beattracking_get_bpm (aubio_beattracking_t * bt) 416 419 { 417 if (bt->bp != 0 && bt->timesig != 0 && bt->counter == 0 && bt->flagstep == 0) {418 return 5168. / fvec_quadratic_peak_pos (bt->acfout, bt->bp);420 if (bt->bp != 0) { 421 return 60. * bt->samplerate/ bt->bp / bt->hop_size; 419 422 } else { 420 423 return 0.;
Note: See TracChangeset
for help on using the changeset viewer.