- Timestamp:
- Apr 17, 2007, 9:59:15 PM (18 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:
- 5507e9d
- Parents:
- 3fd2dc1
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r3fd2dc1 rfff2bee 441 441 } 442 442 443 smpl_t aubio_zero_crossing_rate(fvec_t * input) { 444 uint_t i=0,j; 445 uint_t zcr = 0; 446 for ( j = 1; j < input->length; j++ ) { 447 // previous was negative 448 if( input->data[i][j-1] <= 0. ) { 449 if ( input->data[i][j] > 0. ) { 450 zcr += 1; 451 } 452 //previous was positive 453 } else if ( input->data[i][j] <= 0. ){ 454 zcr += 1; 455 } 456 } 457 return zcr/(smpl_t)input->length; 458 } 459 443 460 void aubio_autocorr(fvec_t * input, fvec_t * output){ 444 461 uint_t i = 0, j = 0, length = input->length; -
src/mathutils.h
r3fd2dc1 rfff2bee 205 205 void aubio_autocorr(fvec_t * input, fvec_t * output); 206 206 /** 207 * zero-crossing rate (number of zero cross per sample) 208 */ 209 smpl_t aubio_zero_crossing_rate(fvec_t * input); 210 /** 207 211 * clean up cached memory at the end of program 208 212 *
Note: See TracChangeset
for help on using the changeset viewer.