source: tests/src/spectral/test-mfcc.c @ 4bb2e74

feature/cnnfeature/crepefeature/timestretchfix/ffmpeg5
Last change on this file since 4bb2e74 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
RevLine 
[0028ea7]1#include <aubio.h>
2
[158e031]3int main (void)
[0028ea7]4{
[6938a20]5  uint_t win_s = 512; // fft size
6  uint_t n_filters = 40; // number of filters
[b174319]7  uint_t n_coeffs = 13; // number of coefficients
[6938a20]8  smpl_t samplerate = 16000.; // samplerate
9  cvec_t *in = new_cvec (win_s); // input buffer
[b174319]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;
[0028ea7]16
[6938a20]17  // create mfcc object
[b174319]18  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coeffs, samplerate);
[0028ea7]19
[5d10ac1]20  cvec_norm_set_all (in, 1.);
[0028ea7]21  aubio_mfcc_do (o, in, out);
[38e9732]22  fvec_print (out);
[6938a20]23
[5d10ac1]24  cvec_norm_set_all (in, .5);
[38e9732]25  aubio_mfcc_do (o, in, out);
[0028ea7]26  fvec_print (out);
27
[6938a20]28  // clean up
[0028ea7]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.