Intel IPP support for aubio
[aubio.git] / tests / src / spectral / test-filterbank.c
1 #include <aubio.h>
2
3 int main (void)
4 {
5   aubio_init();
6   
7   uint_t win_s = 1024; // window size
8   uint_t n_filters = 13; // number of filters
9
10   cvec_t *in_spec = new_cvec (win_s); // input vector of samples
11   fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
12
13   // create filterbank object
14   aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
15
16   // apply filterbank ten times
17   uint_t n = 10;
18   while (n) {
19     aubio_filterbank_do (o, in_spec, out_filters);
20     n--;
21   }
22
23   // print out filterbank coeffs
24   fmat_t *coeffs; // pointer to the coefficients
25   coeffs = aubio_filterbank_get_coeffs (o);
26   fmat_print (coeffs);
27
28   aubio_filterbank_set_coeffs (o, coeffs);
29   coeffs = aubio_filterbank_get_coeffs (o);
30   fmat_print (coeffs);
31
32   //fvec_print (out_filters);
33
34   // clean up
35   del_aubio_filterbank (o);
36   del_cvec (in_spec);
37   del_fvec (out_filters);
38   
39   aubio_cleanup ();
40
41   return 0;
42 }