source: tests/src/test-filterbank_mel.c @ 21f0655

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

tests/src: add AUBIO_UNSTABLE where needed

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