source:
tests/src/spectral/test-filterbank.c
@
75f9fff
Last change on this file since 75f9fff was 158e031, checked in by , 11 years ago | |
---|---|
|
|
File size: 898 bytes |
Rev | Line | |
---|---|---|
[addc9ec] | 1 | #include <aubio.h> |
2 | ||
[158e031] | 3 | int main (void) |
[6938a20] | 4 | { |
[8f68dfb] | 5 | uint_t win_s = 1024; // window size |
6 | uint_t n_filters = 13; // number of filters | |
[addc9ec] | 7 | |
[6938a20] | 8 | cvec_t *in_spec = new_cvec (win_s); // input vector of samples |
9 | fvec_t *out_filters = new_fvec (n_filters); // per-band outputs | |
10 | ||
11 | // create filterbank object | |
[addc9ec] | 12 | aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); |
13 | ||
[845c435] | 14 | // apply filterbank ten times |
15 | uint_t n = 10; | |
16 | while (n) { | |
17 | aubio_filterbank_do (o, in_spec, out_filters); | |
18 | n--; | |
19 | } | |
[addc9ec] | 20 | |
[845c435] | 21 | // print out filterbank coeffs |
22 | fmat_t *coeffs; // pointer to the coefficients | |
23 | coeffs = aubio_filterbank_get_coeffs (o); | |
24 | fmat_print (coeffs); | |
[addc9ec] | 25 | |
[a4c1e86] | 26 | aubio_filterbank_set_coeffs (o, coeffs); |
27 | coeffs = aubio_filterbank_get_coeffs (o); | |
28 | fmat_print (coeffs); | |
29 | ||
[845c435] | 30 | //fvec_print (out_filters); |
[addc9ec] | 31 | |
[845c435] | 32 | // clean up |
[addc9ec] | 33 | del_aubio_filterbank (o); |
[6938a20] | 34 | del_cvec (in_spec); |
35 | del_fvec (out_filters); | |
[addc9ec] | 36 | aubio_cleanup (); |
37 | ||
38 | return 0; | |
39 | } |
Note: See TracBrowser
for help on using the repository browser.