Changeset c71aa44 for tests/src/pitch/test-pitchyinfft.c
- Timestamp:
- Mar 3, 2013, 5:47:05 PM (12 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:
- 248da64
- Parents:
- e230bb4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/pitch/test-pitchyinfft.c
re230bb4 rc71aa44 1 1 #define AUBIO_UNSTABLE 1 2 3 // this file uses the unstable aubio api, please use aubio_pitch instead 4 // see src/pitch/pitch.h and tests/src/pitch/test-pitch.c 2 5 3 6 #include <aubio.h> 4 7 5 int main(){ 6 /* allocate some memory */ 7 uint_t win_s = 1024; /* window size */ 8 fvec_t * in = new_fvec (win_s); /* input buffer */ 9 fvec_t * out = new_fvec (1); /* output pitch periods */ 10 aubio_pitchyinfft_t * o = new_aubio_pitchyinfft(win_s); 11 aubio_pitchyinfft_set_tolerance (o, 0.2); 12 uint_t i = 0; 8 int main () 9 { 10 uint_t n = 10; // compute n times 11 uint_t win_s = 1024; // window size 12 // create some vectors 13 fvec_t * in = new_fvec (win_s); // input buffer 14 fvec_t * out = new_fvec (1); // output candidates 15 // create pitch object 16 aubio_pitchyinfft_t *p = new_aubio_pitchyinfft(win_s); 17 aubio_pitchyinfft_set_tolerance (p, 0.2); 13 18 14 while (i < 10) { 15 aubio_pitchyinfft_do (o,in,out); 16 i++; 17 }; 19 while ( n-- ) { 20 aubio_pitchyinfft_do (p, in,out); 21 }; 18 22 19 del_aubio_pitchyinfft(o); 20 del_fvec(in); 21 del_fvec(out); 22 aubio_cleanup(); 23 fvec_print(out); 23 24 24 return 0; 25 del_fvec(in); 26 del_fvec(out); 27 del_aubio_pitchyinfft(p); 28 aubio_cleanup(); 29 30 return 0; 25 31 } 26
Note: See TracChangeset
for help on using the changeset viewer.