source: tests/src/test-filterbank.c @ addc9ec

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

test-filterbank.c: add trivial test for filterbank object

  • Property mode set to 100644
File size: 855 bytes
Line 
1#include <aubio.h>
2
3int
4main (void)
5{
6  /* allocate some memory */
7  uint_t win_s = 1024;          /* window size */
8  uint_t channels = 2;          /* number of channel */
9  uint_t n_filters = 13;        /* number of filters */
10  cvec_t *in = new_cvec (win_s, channels);      /* input buffer */
11  fvec_t *out = new_fvec (win_s, channels);     /* input buffer */
12  fvec_t *coeffs = NULL;
13
14  /* allocate fft and other memory space */
15  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
16
17  coeffs = aubio_filterbank_get_coeffs (o);
18  if (coeffs == NULL) {
19    return -1;
20  }
21
22  if (vec_max (coeffs) != 0.) {
23    return -1;
24  }
25
26  if (vec_min (coeffs) != 0.) {
27    return -1;
28  }
29
30  // fvec_print (coeffs);
31
32  aubio_filterbank_do (o, in, out);
33
34  del_aubio_filterbank (o);
35  del_cvec (in);
36  del_fvec (out);
37  aubio_cleanup ();
38
39  return 0;
40}
Note: See TracBrowser for help on using the repository browser.