source: tests/src/test-filterbank_mel.c @ 1cc007c

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

tests/src/test-filterbank_mel.c: added filterbank_mel test

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