Changeset 51ee670
- Timestamp:
- Sep 25, 2009, 4:26:14 AM (15 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:
- e4d0f8f
- Parents:
- ff9d00c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/test-hist.c
rff9d00c r51ee670 1 1 #include <aubio.h> 2 2 #include <stdlib.h> 3 4 void print_array(fvec_t *f);5 void print_array(fvec_t *f){6 uint_t i,j;7 for (i=0;i<f->channels;i++){8 for (j=0;j<f->length;j++){9 printf("%f, ", f->data[i][j]);10 }11 printf(";\n");12 }13 }14 3 15 4 int main( int argc, char** argv ) … … 17 6 uint_t length; 18 7 for (length = 1; length < 10; length ++ ) { 19 fvec_t *t = new_fvec(length,5);20 8 aubio_hist_t *o = new_aubio_hist(0, 1, length, 5); 21 aubio_window(t->data[0],t->length,aubio_win_hanning); 22 aubio_window(t->data[1],t->length,aubio_win_hanningz); 23 aubio_window(t->data[2],t->length,aubio_win_blackman); 24 aubio_window(t->data[3],t->length,aubio_win_blackman_harris); 25 aubio_window(t->data[4],t->length,aubio_win_hamming); 26 print_array(t); 9 fvec_t *t = new_aubio_window(length,aubio_win_hanning); 27 10 aubio_hist_do(o,t); 28 print_array(t);11 fvec_print(t); 29 12 aubio_hist_do_notnull(o,t); 30 print_array(t);13 fvec_print(t); 31 14 aubio_hist_dyn_notnull(o,t); 32 print_array(t); 15 fvec_print(t); 16 del_fvec(t); 17 t = new_aubio_window(length,aubio_win_hanningz); 18 aubio_hist_do(o,t); 19 fvec_print(t); 20 aubio_hist_do_notnull(o,t); 21 fvec_print(t); 22 aubio_hist_dyn_notnull(o,t); 23 fvec_print(t); 33 24 del_aubio_hist(o); 34 25 del_fvec(t);
Note: See TracChangeset
for help on using the changeset viewer.