feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 8f68dfb was
8f68dfb,
checked in by Paul Brossier <piem@piem.org>, 11 years ago
|
tests/src/spectral/: improve test examples
|
-
Property mode set to
100644
|
File size:
913 bytes
|
Rev | Line | |
---|
[21f0655] | 1 | #define AUBIO_UNSTABLE 1 |
---|
| 2 | |
---|
[38e9732] | 3 | #include <stdio.h> |
---|
[afc584d] | 4 | #include <aubio.h> |
---|
| 5 | |
---|
| 6 | int |
---|
| 7 | main (void) |
---|
| 8 | { |
---|
| 9 | /* allocate some memory */ |
---|
[8f68dfb] | 10 | uint_t win_s = 512; // fft size |
---|
| 11 | 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 */ |
---|
[aea235c] | 14 | fmat_t *coeffs = NULL; |
---|
[afc584d] | 15 | smpl_t samplerate = 16000.; |
---|
| 16 | |
---|
| 17 | /* allocate fft and other memory space */ |
---|
| 18 | aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); |
---|
| 19 | |
---|
| 20 | /* assign Mel-frequency coefficients */ |
---|
| 21 | aubio_filterbank_set_mel_coeffs_slaney (o, samplerate); |
---|
| 22 | |
---|
| 23 | coeffs = aubio_filterbank_get_coeffs (o); |
---|
| 24 | |
---|
[8f68dfb] | 25 | fmat_print (coeffs); |
---|
[afc584d] | 26 | |
---|
[38e9732] | 27 | //fprintf(stderr, "%f\n", fvec_sum(coeffs)); |
---|
[afc584d] | 28 | |
---|
[8f68dfb] | 29 | aubio_filterbank_do (o, in_spec, out_filters); |
---|
| 30 | |
---|
| 31 | fvec_print(in_spec); |
---|
| 32 | fvec_print(out_filters); |
---|
[afc584d] | 33 | |
---|
| 34 | del_aubio_filterbank (o); |
---|
[8f68dfb] | 35 | del_cvec (in_spec); |
---|
| 36 | del_fvec (out_filters); |
---|
[afc584d] | 37 | aubio_cleanup (); |
---|
| 38 | |
---|
| 39 | return 0; |
---|
| 40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.