Changeset e83dd0e
- Timestamp:
- Apr 18, 2007, 1:19:46 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:
- 05468516
- Parents:
- 5507e9d (diff), 970ef94 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r5507e9d re83dd0e 458 458 } 459 459 460 smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate) { 461 uint_t i=0, j; 462 smpl_t sum = 0., sc = 0.; 463 for ( j = 0; j < spectrum->length; j++ ) { 464 sum += spectrum->norm[i][j]; 465 } 466 if (sum == 0.) return 0.; 467 for ( j = 0; j < spectrum->length; j++ ) { 468 sc += (smpl_t)j * spectrum->norm[i][j]; 469 } 470 return sc / sum * samplerate / (smpl_t)(spectrum->length); 471 } 472 460 473 void aubio_autocorr(fvec_t * input, fvec_t * output){ 461 474 uint_t i = 0, j = 0, length = input->length; -
src/mathutils.h
r5507e9d re83dd0e 209 209 smpl_t aubio_zero_crossing_rate(fvec_t * input); 210 210 /** 211 * spectrum centroid computed on a cvec 212 */ 213 smpl_t aubio_spectral_centroid(cvec_t * input, smpl_t samplerate); 214 /** 211 215 * clean up cached memory at the end of program 212 216 * -
swig/aubio.i
r5507e9d re83dd0e 147 147 void aubio_autocorr(fvec_t * in, fvec_t * acf); 148 148 smpl_t aubio_zero_crossing_rate(fvec_t * input); 149 smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate); 149 150 150 151 /* scale */
Note: See TracChangeset
for help on using the changeset viewer.