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
|
Line | |
---|
1 | #define AUBIO_UNSTABLE 1 |
---|
2 | |
---|
3 | #include <stdio.h> |
---|
4 | #include <aubio.h> |
---|
5 | |
---|
6 | int |
---|
7 | main (void) |
---|
8 | { |
---|
9 | /* allocate some memory */ |
---|
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 */ |
---|
14 | fmat_t *coeffs = NULL; |
---|
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 | |
---|
25 | fmat_print (coeffs); |
---|
26 | |
---|
27 | //fprintf(stderr, "%f\n", fvec_sum(coeffs)); |
---|
28 | |
---|
29 | aubio_filterbank_do (o, in_spec, out_filters); |
---|
30 | |
---|
31 | fvec_print(in_spec); |
---|
32 | fvec_print(out_filters); |
---|
33 | |
---|
34 | del_aubio_filterbank (o); |
---|
35 | del_cvec (in_spec); |
---|
36 | del_fvec (out_filters); |
---|
37 | aubio_cleanup (); |
---|
38 | |
---|
39 | return 0; |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.