Changeset 8f68dfb for tests/src


Ignore:
Timestamp:
Mar 3, 2013, 4:54:04 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ed1deac
Parents:
b8c0685
Message:

tests/src/spectral/: improve test examples

Location:
tests/src/spectral
Files:
2 edited

Legend:

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

    rb8c0685 r8f68dfb  
    44#include <aubio.h>
    55
    6 int
    7 main (void)
    8 {
    9   /* allocate some memory */
    10   uint_t win_s = 1024;          /* window size */
    11   uint_t n_filters = 13;        /* number of filters */
    12   cvec_t *in = new_cvec (win_s);      /* input buffer */
    13   fvec_t *out = new_fvec (win_s);     /* input buffer */
     6int main (void) {
     7  uint_t win_s = 1024; // window size
     8  uint_t n_filters = 13; // number of filters
     9  cvec_t *in = new_cvec (win_s); // input buffer
     10  fvec_t *out = new_fvec (win_s); // vector output */
    1411  fmat_t *coeffs = NULL;
    1512
    16   /* allocate fft and other memory space */
     13  // create filterbank
    1714  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
    1815
  • tests/src/spectral/test-filterbank_mel.c

    rb8c0685 r8f68dfb  
    88{
    99  /* allocate some memory */
    10   uint_t win_s = 512;           /* fft size */
    11   uint_t n_filters = 40;        /* number of filters */
    12   cvec_t *in = new_cvec (win_s);      /* input buffer */
    13   fvec_t *out = new_fvec (win_s);     /* input buffer */
     10  uint_t win_s = 512; // fft size
     11  uint_t n_filters = 40; // number of filters
     12  cvec_t *in_spec = new_cvec (win_s); // input buffer */
     13  fvec_t *out_filters = new_fvec (n_filters); // output coeffs */
    1414  fmat_t *coeffs = NULL;
    1515  smpl_t samplerate = 16000.;
     
    2222
    2323  coeffs = aubio_filterbank_get_coeffs (o);
    24   if (coeffs == NULL) {
    25     return -1;
    26   }
    2724
    28   //fmat_print (coeffs);
     25  fmat_print (coeffs);
    2926
    3027  //fprintf(stderr, "%f\n", fvec_sum(coeffs));
    3128
    32   aubio_filterbank_do (o, in, out);
     29  aubio_filterbank_do (o, in_spec, out_filters);
     30
     31  fvec_print(in_spec);
     32  fvec_print(out_filters);
    3333
    3434  del_aubio_filterbank (o);
    35   del_cvec (in);
    36   del_fvec (out);
     35  del_cvec (in_spec);
     36  del_fvec (out_filters);
    3737  aubio_cleanup ();
    3838
Note: See TracChangeset for help on using the changeset viewer.