source: tests/src/spectral/test-mfcc.c @ 39a7b26

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

src/cvec.h: improve cvec_t api

  • Property mode set to 100644
File size: 685 bytes
Line 
1#include <aubio.h>
2
3int main ()
4{
5  uint_t win_s = 512; // fft size
6  uint_t n_filters = 40; // number of filters
7  uint_t n_coefs = 13; // number of coefficients
8  smpl_t samplerate = 16000.; // samplerate
9  cvec_t *in = new_cvec (win_s); // input buffer
10  fvec_t *out = new_fvec (n_coefs); // output coefficients
11
12  // create mfcc object
13  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coefs, samplerate);
14
15  cvec_set_all_norm (in, 1.);
16  aubio_mfcc_do (o, in, out);
17  fvec_print (out);
18
19  cvec_set_all_norm (in, .5);
20  aubio_mfcc_do (o, in, out);
21  fvec_print (out);
22
23  // clean up
24  del_aubio_mfcc (o);
25  del_cvec (in);
26  del_fvec (out);
27  aubio_cleanup ();
28
29  return 0;
30}
Note: See TracBrowser for help on using the repository browser.