Changeset 40ed6a7
- 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
- Location:
- src/onset
- Files:
-
- 2 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 */ -
src/onset/onset.h
rfa3edc6 r40ed6a7 121 121 122 122 \param o onset detection object as returned by new_aubio_onset() 123 \param apply_adaptive_whitening 1 to enable, 0 to disable 124 125 */ 126 uint_t aubio_onset_set_adaptive_whitening(aubio_onset_t * o, uint_t apply_adaptive_whitening); 127 128 /** get onset detection silence threshold 129 130 \param o onset detection object as returned by new_aubio_onset() 131 132 \return adaptive whitening mode, 1 if enabled, 0 otherwise 133 134 */ 135 uint_t aubio_onset_get_adaptive_whitening(aubio_onset_t * o); 123 \param enable 1 to enable, 0 to disable 124 125 \return 0 if successful, 1 otherwise 126 127 */ 128 uint_t aubio_onset_set_awhitening(aubio_onset_t * o, uint_t enable); 129 130 /** get onset detection adaptive whitening 131 132 \param o onset detection object as returned by new_aubio_onset() 133 134 \return 1 if enabled, 0 otherwise 135 136 */ 137 smpl_t aubio_onset_get_awhitening(aubio_onset_t * o); 138 139 /** set or disable log compression 140 141 \param o onset detection object as returned by new_aubio_onset() 142 \param lambda logarithmic compression factor 143 144 \return 0 if successful, 1 otherwise 145 146 */ 147 uint_t aubio_onset_set_logmag_compression(aubio_onset_t *o, smpl_t lambda); 148 149 /** get onset detection log compression 150 */ 151 smpl_t aubio_onset_get_logmag_compression(aubio_onset_t *o); 136 152 137 153 /** set onset detection silence threshold
Note: See TracChangeset
for help on using the changeset viewer.