Ignore:
Timestamp:
Mar 3, 2013, 7:37:43 PM (12 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:
9547247
Parents:
26775a3
Message:

tests/src/spectral/: improve examples

File:
1 edited

Legend:

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

    r26775a3 r6938a20  
    1 #define AUBIO_UNSTABLE 1
    2 
    3 #include <stdio.h>
    41#include <aubio.h>
    52
    6 int main (void) {
     3int main ()
     4{
    75  uint_t win_s = 1024; // window size
    86  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 */
    11   fmat_t *coeffs = NULL;
    127
    13   // create filterbank
     8  cvec_t *in_spec = new_cvec (win_s); // input vector of samples
     9  fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
     10  fmat_t *coeffs; // pointer to the coefficients
     11
     12  // create filterbank object
    1413  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
    1514
    1615  coeffs = aubio_filterbank_get_coeffs (o);
    17   if (coeffs == NULL) {
    18     return -1;
    19   }
    2016
    21   /*
    22   if (fvec_max (coeffs) != 0.) {
    23     return -1;
    24   }
     17  aubio_filterbank_do (o, in_spec, out_filters);
    2518
    26   if (fvec_min (coeffs) != 0.) {
    27     return -1;
    28   }
    29   */
    30 
    31   fmat_print (coeffs);
    32 
    33   aubio_filterbank_do (o, in, out);
     19  // fmat_print (coeffs);
     20  // cvec_print(in_spec);
     21  // fvec_print(out_filters);
    3422
    3523  del_aubio_filterbank (o);
    36   del_cvec (in);
    37   del_fvec (out);
     24  del_cvec (in_spec);
     25  del_fvec (out_filters);
    3826  aubio_cleanup ();
    3927
Note: See TracChangeset for help on using the changeset viewer.