source: tests/src/test-filterbank_mel.c @ e8ae95ac

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

tests/src/: various updates

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