source: tests/src/spectral/test-mfcc.c @ 92c85b12

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 92c85b12 was b174319, checked in by Paul Brossier <piem@piem.org>, 6 years ago

[tests] add calls to new_aubio_mfcc with wrong input parameters

  • Property mode set to 100644
File size: 981 bytes
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  uint_t win_s = 512; // fft size
6  uint_t n_filters = 40; // number of filters
7  uint_t n_coeffs = 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_coeffs); // output coefficients
11
12  if (new_aubio_mfcc(    0, n_filters, n_coeffs, samplerate)) return 1;
13  if (new_aubio_mfcc(win_s,         0, n_coeffs, samplerate)) return 1;
14  if (new_aubio_mfcc(win_s, n_filters,        0, samplerate)) return 1;
15  if (new_aubio_mfcc(win_s, n_filters, n_coeffs,          0)) return 1;
16
17  // create mfcc object
18  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coeffs, samplerate);
19
20  cvec_norm_set_all (in, 1.);
21  aubio_mfcc_do (o, in, out);
22  fvec_print (out);
23
24  cvec_norm_set_all (in, .5);
25  aubio_mfcc_do (o, in, out);
26  fvec_print (out);
27
28  // clean up
29  del_aubio_mfcc (o);
30  del_cvec (in);
31  del_fvec (out);
32  aubio_cleanup ();
33
34  return 0;
35}
Note: See TracBrowser for help on using the repository browser.