source: tests/src/spectral/test-filterbank.c @ e97d0b3

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since e97d0b3 was 845c435, checked in by Paul Brossier <piem@piem.org>, 11 years ago

tests/src/spectral/test-filterbank*: improve comments, print coeffs

  • Property mode set to 100644
File size: 783 bytes
Line 
1#include <aubio.h>
2
3int main ()
4{
5  uint_t win_s = 1024; // window size
6  uint_t n_filters = 13; // number of filters
7
8  cvec_t *in_spec = new_cvec (win_s); // input vector of samples
9  fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
10
11  // create filterbank object
12  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
13
14  // apply filterbank ten times
15  uint_t n = 10;
16  while (n) {
17    aubio_filterbank_do (o, in_spec, out_filters);
18    n--;
19  }
20
21  // print out filterbank coeffs
22  fmat_t *coeffs; // pointer to the coefficients
23  coeffs = aubio_filterbank_get_coeffs (o);
24  fmat_print (coeffs);
25
26  //fvec_print (out_filters);
27
28  // clean up
29  del_aubio_filterbank (o);
30  del_cvec (in_spec);
31  del_fvec (out_filters);
32  aubio_cleanup ();
33
34  return 0;
35}
Note: See TracBrowser for help on using the repository browser.