Changeset fc6c831
- Timestamp:
- Nov 24, 2007, 10:47:15 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:
- 6c7d49b
- Parents:
- e2da295
- Location:
- src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
re2da295 rfc6c831 15 15 spectral/fft.h \ 16 16 spectral/tss.h \ 17 spectral/spectral_centroid.h \ 17 18 pitch/pitchdetection.h \ 18 19 pitch/pitchmcomb.h \ … … 58 59 spectral/tss.c \ 59 60 spectral/tss.h \ 61 spectral/spectral_centroid.c \ 62 spectral/spectral_centroid.h \ 60 63 pitch/pitchdetection.c \ 61 64 pitch/pitchdetection.h \ -
src/aubio.h
re2da295 rfc6c831 60 60 #include "types.h" 61 61 #include "sample.h" 62 #include "spectral/fft.h"63 #include "spectral/phasevoc.h"64 62 #include "mathutils.h" 65 63 #include "utils/scale.h" … … 69 67 #include "temporal/biquad.h" 70 68 #include "temporal/filter.h" 69 #include "spectral/filterbank.h" 70 #include "spectral/mfcc.h" 71 #include "spectral/fft.h" 72 #include "spectral/phasevoc.h" 73 #include "spectral/spectral_centroid.h" 71 74 #include "pitch/pitchdetection.h" 72 75 #include "pitch/pitchmcomb.h" … … 80 83 #include "tempo/beattracking.h" 81 84 #include "tempo/tempo.h" 82 #include "spectral/filterbank.h"83 #include "spectral/mfcc.h"84 85 85 86 #ifdef __cplusplus -
src/mathutils.c
re2da295 rfc6c831 433 433 } 434 434 435 smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate) {436 uint_t i=0, j;437 smpl_t sum = 0., sc = 0.;438 for ( j = 0; j < spectrum->length; j++ ) {439 sum += spectrum->norm[i][j];440 }441 if (sum == 0.) return 0.;442 for ( j = 0; j < spectrum->length; j++ ) {443 sc += (smpl_t)j * spectrum->norm[i][j];444 }445 return sc / sum * samplerate / (smpl_t)(spectrum->length);446 }447 448 435 void aubio_autocorr(fvec_t * input, fvec_t * output) { 449 436 uint_t i = 0, j = 0, length = input->length; -
src/mathutils.h
re2da295 rfc6c831 209 209 smpl_t aubio_zero_crossing_rate(fvec_t * input); 210 210 /** 211 * spectrum centroid computed on a cvec212 */213 smpl_t aubio_spectral_centroid(cvec_t * input, smpl_t samplerate);214 /**215 211 * clean up cached memory at the end of program 216 212 *
Note: See TracChangeset
for help on using the changeset viewer.