Ignore:
Timestamp:
Mar 3, 2013, 7:37:43 PM (8 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-filterbank_mel.c

    r26775a3 r6938a20  
    1 #define AUBIO_UNSTABLE 1
    2 
    3 #include <stdio.h>
    41#include <aubio.h>
    52
    6 int
    7 main (void)
     3int main ()
    84{
    9   /* allocate some memory */
     5  uint_t samplerate = 16000; // samplerate of signal to filter
    106  uint_t win_s = 512; // fft size
    117  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 */
    14   fmat_t *coeffs = NULL;
    15   smpl_t samplerate = 16000.;
    168
    17   /* allocate fft and other memory space */
     9  cvec_t *in_spec = new_cvec (win_s); // input vector of samples
     10  fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
     11  fmat_t *coeffs; // pointer to the coefficients
     12
     13  // create filterbank object
    1814  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
    1915
    20   /* assign Mel-frequency coefficients */
     16  // assign Mel-frequency coefficients
    2117  aubio_filterbank_set_mel_coeffs_slaney (o, samplerate);
    2218
    2319  coeffs = aubio_filterbank_get_coeffs (o);
    2420
    25   fmat_print (coeffs);
    26 
    27   //fprintf(stderr, "%f\n", fvec_sum(coeffs));
    28 
    2921  aubio_filterbank_do (o, in_spec, out_filters);
    3022
    31   fvec_print(in_spec);
    32   fvec_print(out_filters);
     23  // fmat_print (coeffs);
     24  // cvec_print(in_spec);
     25  // fvec_print(out_filters);
    3326
    3427  del_aubio_filterbank (o);
Note: See TracChangeset for help on using the changeset viewer.