source: tests/src/spectral/test-filterbank_mel.c @ 6938a20

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 6938a20 was 6938a20, checked in by Paul Brossier <piem@piem.org>, 7 years ago

tests/src/spectral/: improve examples

  • Property mode set to 100644
File size: 844 bytes
Line 
1#include <aubio.h>
2
3int main ()
4{
5  uint_t samplerate = 16000; // samplerate of signal to filter
6  uint_t win_s = 512; // fft size
7  uint_t n_filters = 40; // number of filters
8
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
14  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
15
16  // assign Mel-frequency coefficients
17  aubio_filterbank_set_mel_coeffs_slaney (o, samplerate);
18
19  coeffs = aubio_filterbank_get_coeffs (o);
20
21  aubio_filterbank_do (o, in_spec, out_filters);
22
23  // fmat_print (coeffs);
24  // cvec_print(in_spec);
25  // fvec_print(out_filters);
26
27  del_aubio_filterbank (o);
28  del_cvec (in_spec);
29  del_fvec (out_filters);
30  aubio_cleanup ();
31
32  return 0;
33}
Note: See TracBrowser for help on using the repository browser.