return loudness;
}
+smpl_t aubio_zero_crossing_rate(fvec_t * input) {
+ uint_t i=0,j;
+ uint_t zcr = 0;
+ for ( j = 1; j < input->length; j++ ) {
+ // previous was negative
+ if( input->data[i][j-1] <= 0. ) {
+ if ( input->data[i][j] > 0. ) {
+ zcr += 1;
+ }
+ //previous was positive
+ } else if ( input->data[i][j] <= 0. ){
+ zcr += 1;
+ }
+ }
+ return zcr/(smpl_t)input->length;
+}
+
void aubio_autocorr(fvec_t * input, fvec_t * output){
uint_t i = 0, j = 0, length = input->length;
smpl_t * data = input->data[0];
* calculate normalised autocorrelation function
*/
void aubio_autocorr(fvec_t * input, fvec_t * output);
+/**
+ * zero-crossing rate (number of zero cross per sample)
+ */
+smpl_t aubio_zero_crossing_rate(fvec_t * input);
/**
* clean up cached memory at the end of program
*