}
}
+/* Spectral flux */
+void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){
+ uint_t i, j;
+ for (i=0;i<fftgrain->channels;i++) {
+ onset->data[i][0] = 0.;
+ for (j=0;j<fftgrain->length;j++) {
+ if (fftgrain->norm[i][j] > o->oldmag->data[i][j])
+ onset->data[i][0] += fftgrain->norm[i][j] - o->oldmag->data[i][j];
+ o->oldmag->data[i][j] = fftgrain->norm[i][j];
+ }
+ }
+}
+
/* Generic function pointing to the choosen one */
void
aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain,
break;
case aubio_onset_kl:
case aubio_onset_mkl:
+ case aubio_onset_specflux:
o->oldmag = new_fvec(rsize,channels);
break;
default:
case aubio_onset_mkl:
o->funcpointer = aubio_onsetdetection_mkl;
break;
+ case aubio_onset_specflux:
+ o->funcpointer = aubio_onsetdetection_specflux;
+ break;
default:
break;
}
aubio_onset_phase, /**< phase fast */
aubio_onset_kl, /**< Kullback Liebler */
aubio_onset_mkl, /**< modified Kullback Liebler */
+ aubio_onset_specflux, /**< spectral flux */
} aubio_onsetdetection_type;
/** onsetdetection structure */
*/
void aubio_onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+/** Spectral Flux
+
+ Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th
+ International Conference on Digital Audio Effects'' (DAFx-06), Montreal,
+ Canada, 2006.
+
+ \param o onset detection object as returned by new_aubio_onsetdetection()
+ \param fftgrain input spectral frame
+ \param onset output onset detection function
+
+*/
+void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
/** execute onset detection function on a spectral frame
Generic function to compute onset detection.