Ignore:
Timestamp:
Mar 3, 2013, 7:37:43 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
9547247
Parents:
26775a3
Message:

tests/src/spectral/: improve examples

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/spectral/test-mfcc.c

    r26775a3 r6938a20  
    11#include <aubio.h>
    22
    3 int
    4 main (void)
     3int main ()
    54{
    6   /* allocate some memory */
    7   uint_t win_s = 512;           /* fft size */
    8   uint_t n_filters = 40;        /* number of filters */
    9   uint_t n_coefs = 13;          /* number of coefficients */
    10   cvec_t *in = new_cvec (win_s);      /* input buffer */
    11   fvec_t *out = new_fvec (n_coefs);     /* input buffer */
    12   smpl_t samplerate = 16000.;
     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
    1311
    14   /* allocate fft and other memory space */
     12  // create mfcc object
    1513  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coefs, samplerate);
    1614
    1715  cvec_set (in, 1.);
    18 
    19   aubio_mfcc_do (o, in, out);
    20   fvec_print (out);
    2116  aubio_mfcc_do (o, in, out);
    2217  fvec_print (out);
    2318
     19  cvec_set (in, .5);
     20  aubio_mfcc_do (o, in, out);
     21  fvec_print (out);
     22
     23  // clean up
    2424  del_aubio_mfcc (o);
    2525  del_cvec (in);
Note: See TracChangeset for help on using the changeset viewer.