source:
tests/src/test-filterbank.c
@
fc759f3
Last change on this file since fc759f3 was aea235c, checked in by , 15 years ago | |
---|---|
|
|
File size: 833 bytes |
Rev | Line | |
---|---|---|
[21f0655] | 1 | #define AUBIO_UNSTABLE 1 |
2 | ||
[d57c879] | 3 | #include <stdio.h> |
[addc9ec] | 4 | #include <aubio.h> |
5 | ||
6 | int | |
7 | main (void) | |
8 | { | |
9 | /* allocate some memory */ | |
10 | uint_t win_s = 1024; /* window size */ | |
11 | uint_t n_filters = 13; /* number of filters */ | |
[aea235c] | 12 | cvec_t *in = new_cvec (win_s); /* input buffer */ |
13 | fvec_t *out = new_fvec (win_s); /* input buffer */ | |
14 | fmat_t *coeffs = NULL; | |
[addc9ec] | 15 | |
16 | /* allocate fft and other memory space */ | |
17 | aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); | |
18 | ||
19 | coeffs = aubio_filterbank_get_coeffs (o); | |
20 | if (coeffs == NULL) { | |
21 | return -1; | |
22 | } | |
23 | ||
[aea235c] | 24 | /* |
[1e2c82f] | 25 | if (fvec_max (coeffs) != 0.) { |
[addc9ec] | 26 | return -1; |
27 | } | |
28 | ||
[2f64b0e] | 29 | if (fvec_min (coeffs) != 0.) { |
[addc9ec] | 30 | return -1; |
31 | } | |
[aea235c] | 32 | */ |
[addc9ec] | 33 | |
[aea235c] | 34 | fmat_print (coeffs); |
[addc9ec] | 35 | |
36 | aubio_filterbank_do (o, in, out); | |
37 | ||
38 | del_aubio_filterbank (o); | |
39 | del_cvec (in); | |
40 | del_fvec (out); | |
41 | aubio_cleanup (); | |
42 | ||
43 | return 0; | |
44 | } |
Note: See TracBrowser
for help on using the repository browser.