source: tests/src/spectral/test-filterbank_mel.c @ 986131d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 986131d was 986131d, checked in by Eduard Müller <mueller.eduard@googlemail.com>, 7 years ago

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 954 bytes
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  aubio_init();
6 
7  uint_t samplerate = 16000; // samplerate of signal to filter
8  uint_t win_s = 512; // fft size
9  uint_t n_filters = 40; // number of filters
10
11  cvec_t *in_spec = new_cvec (win_s); // input vector of samples
12  fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
13
14  // create filterbank object
15  aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
16
17  // assign Mel-frequency coefficients
18  aubio_filterbank_set_mel_coeffs_slaney (o, samplerate);
19
20  // apply filterbank ten times
21  uint_t n = 10;
22  while (n) {
23    aubio_filterbank_do (o, in_spec, out_filters);
24    n--;
25  }
26
27  // print out filter coefficients
28  fmat_t *coeffs; // pointer to the coefficients
29  coeffs = aubio_filterbank_get_coeffs (o);
30  fmat_print (coeffs);
31
32  //fvec_print (out_filters);
33
34  del_aubio_filterbank (o);
35  del_cvec (in_spec);
36  del_fvec (out_filters);
37 
38  aubio_cleanup ();
39
40  return 0;
41}
Note: See TracBrowser for help on using the repository browser.