Changeset 40ed6a7 for src/onset/onset.c
- Timestamp:
- Mar 26, 2017, 5:38:09 PM (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:
- b63c7d3
- Parents:
- fa3edc6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
rfa3edc6 r40ed6a7 49 49 uint_t apply_compression; 50 50 smpl_t lambda_compression; 51 uint_t apply_a daptive_whitening;51 uint_t apply_awhitening; /**< apply adaptive spectral whitening */ 52 52 aubio_spectral_whitening_t *spectral_whitening; 53 53 }; … … 62 62 } 63 63 */ 64 if (o->apply_a daptive_whitening) {64 if (o->apply_awhitening) { 65 65 aubio_spectral_whitening_do(o->spectral_whitening, o->fftgrain); 66 66 } 67 67 if (o->apply_compression) { 68 cvec_logmag(o->fftgrain, o-> apply_compression);68 cvec_logmag(o->fftgrain, o->lambda_compression); 69 69 } 70 70 aubio_specdesc_do (o->od, o->fftgrain, o->desc); … … 118 118 } 119 119 120 uint_t aubio_onset_set_adaptive_whitening (aubio_onset_t *o, uint_t apply_adaptive_whitening) 121 { 122 o->apply_adaptive_whitening = apply_adaptive_whitening; 123 return AUBIO_OK; 124 } 125 126 uint_t aubio_onset_get_adaptive_whitening (aubio_onset_t *o) 127 { 128 return o->apply_adaptive_whitening; 120 uint_t aubio_onset_set_awhitening (aubio_onset_t *o, uint_t enable) 121 { 122 o->apply_awhitening = enable == 1 ? 1 : 0; 123 return AUBIO_OK; 124 } 125 126 smpl_t aubio_onset_get_awhitening (aubio_onset_t *o) 127 { 128 return o->apply_awhitening; 129 } 130 131 uint_t aubio_onset_set_logmag_compression (aubio_onset_t *o, smpl_t lambda) 132 { 133 if (lambda < 0.) { 134 return AUBIO_FAIL; 135 } 136 o->lambda_compression = lambda; 137 o->apply_compression = (o->lambda_compression > 0.) ? 1 : 0; 138 return AUBIO_OK; 139 } 140 141 smpl_t aubio_onset_get_logmag_compression (aubio_onset_t *o) 142 { 143 return o->apply_compression ? o->lambda_compression : 0; 129 144 } 130 145 … … 267 282 aubio_onset_set_minioi_ms (o, 50.); 268 283 aubio_onset_set_silence (o, -70.); 269 aubio_onset_set_adaptive_whitening (o, 0);270 271 o->apply_compression = 0;272 o->lambda_compression = 1.;284 // disable spectral whitening 285 aubio_onset_set_awhitening (o, 0); 286 // disable logarithmic magnitude 287 aubio_onset_set_logmag_compression (o, 0.); 273 288 274 289 /* method specific optimisations */
Note: See TracChangeset
for help on using the changeset viewer.