- Timestamp:
- Nov 21, 2007, 12:01:22 PM (17 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:
- 862d78f
- Parents:
- ec2fa2a
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onsetdetection.c
rec2fa2a rfabb7cd 196 196 } 197 197 198 /* Spectral flux */ 199 void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){ 200 uint_t i, j; 201 for (i=0;i<fftgrain->channels;i++) { 202 onset->data[i][0] = 0.; 203 for (j=0;j<fftgrain->length;j++) { 204 if (fftgrain->norm[i][j] > o->oldmag->data[i][j]) 205 onset->data[i][0] += fftgrain->norm[i][j] - o->oldmag->data[i][j]; 206 o->oldmag->data[i][j] = fftgrain->norm[i][j]; 207 } 208 } 209 } 210 198 211 /* Generic function pointing to the choosen one */ 199 212 void … … 243 256 case aubio_onset_kl: 244 257 case aubio_onset_mkl: 258 case aubio_onset_specflux: 245 259 o->oldmag = new_fvec(rsize,channels); 246 260 break; … … 274 288 case aubio_onset_mkl: 275 289 o->funcpointer = aubio_onsetdetection_mkl; 290 break; 291 case aubio_onset_specflux: 292 o->funcpointer = aubio_onsetdetection_specflux; 276 293 break; 277 294 default: -
src/onsetdetection.h
rec2fa2a rfabb7cd 48 48 aubio_onset_kl, /**< Kullback Liebler */ 49 49 aubio_onset_mkl, /**< modified Kullback Liebler */ 50 aubio_onset_specflux, /**< spectral flux */ 50 51 } aubio_onsetdetection_type; 51 52 … … 137 138 */ 138 139 void aubio_onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 140 /** Spectral Flux 141 142 Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th 143 International Conference on Digital Audio Effects'' (DAFx-06), Montreal, 144 Canada, 2006. 145 146 \param o onset detection object as returned by new_aubio_onsetdetection() 147 \param fftgrain input spectral frame 148 \param onset output onset detection function 149 150 */ 151 void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 139 152 /** execute onset detection function on a spectral frame 140 153
Note: See TracChangeset
for help on using the changeset viewer.