source: examples/tests/test-hist.c @ 4e9101e

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 4e9101e was 4e9101e, checked in by Paul Brossier <piem@altern.org>, 15 years ago

add tests for most function
add tests for most function

  • Property mode set to 100644
File size: 961 bytes
Line 
1#include <aubio.h>
2#include <stdlib.h>
3
4void print_array(fvec_t *f);
5void print_array(fvec_t *f){
6  uint 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
15int main( int argc, char** argv )
16{
17  uint_t length;
18  for (length = 1; length < 10; length ++ ) {
19    fvec_t *t = new_fvec(length,5);
20    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);
27    aubio_hist_do(o,t);
28    print_array(t);
29    aubio_hist_do_notnull(o,t);
30    print_array(t);
31    aubio_hist_dyn_notnull(o,t);
32    print_array(t);
33    del_aubio_hist(o);
34    del_fvec(t);
35  }
36  return 0;
37}
38
Note: See TracBrowser for help on using the repository browser.