feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 6938a20 was
6938a20,
checked in by Paul Brossier <piem@piem.org>, 11 years ago
|
tests/src/spectral/: improve examples
|
-
Property mode set to
100644
|
File size:
844 bytes
|
Rev | Line | |
---|
[afc584d] | 1 | #include <aubio.h> |
---|
| 2 | |
---|
[6938a20] | 3 | int main () |
---|
[afc584d] | 4 | { |
---|
[6938a20] | 5 | uint_t samplerate = 16000; // samplerate of signal to filter |
---|
[8f68dfb] | 6 | uint_t win_s = 512; // fft size |
---|
| 7 | uint_t n_filters = 40; // number of filters |
---|
[afc584d] | 8 | |
---|
[6938a20] | 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 |
---|
[afc584d] | 14 | aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); |
---|
| 15 | |
---|
[6938a20] | 16 | // assign Mel-frequency coefficients |
---|
[afc584d] | 17 | aubio_filterbank_set_mel_coeffs_slaney (o, samplerate); |
---|
| 18 | |
---|
| 19 | coeffs = aubio_filterbank_get_coeffs (o); |
---|
| 20 | |
---|
[8f68dfb] | 21 | aubio_filterbank_do (o, in_spec, out_filters); |
---|
| 22 | |
---|
[6938a20] | 23 | // fmat_print (coeffs); |
---|
| 24 | // cvec_print(in_spec); |
---|
| 25 | // fvec_print(out_filters); |
---|
[afc584d] | 26 | |
---|
| 27 | del_aubio_filterbank (o); |
---|
[8f68dfb] | 28 | del_cvec (in_spec); |
---|
| 29 | del_fvec (out_filters); |
---|
[afc584d] | 30 | aubio_cleanup (); |
---|
| 31 | |
---|
| 32 | return 0; |
---|
| 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.