feature/crepe_org
Last change
on this file since 378852b was
cbe7809,
checked in by Paul Brossier <piem@piem.org>, 6 years ago
|
[tests] improve test-filter coverage
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #include <aubio.h> |
---|
2 | |
---|
3 | int main (void) |
---|
4 | { |
---|
5 | uint_t win_s = 16; // window size |
---|
6 | uint_t impulse_at = win_s / 2; |
---|
7 | fvec_t *in = new_fvec (win_s); // input buffer |
---|
8 | fvec_t *out = new_fvec (win_s); // input buffer |
---|
9 | |
---|
10 | aubio_filter_t *o = new_aubio_filter_c_weighting (44100); |
---|
11 | |
---|
12 | if (new_aubio_filter(0)) return 1; |
---|
13 | |
---|
14 | if (aubio_filter_get_samplerate(o) != 44100) return 1; |
---|
15 | |
---|
16 | if (aubio_filter_set_c_weighting (o, -1) == 0) return 1; |
---|
17 | |
---|
18 | if (aubio_filter_set_c_weighting (0, 32000) == 0) return 1; |
---|
19 | |
---|
20 | in->data[impulse_at] = 0.5; |
---|
21 | fvec_print (in); |
---|
22 | aubio_filter_do (o, in); |
---|
23 | fvec_print (in); |
---|
24 | del_aubio_filter (o); |
---|
25 | |
---|
26 | o = new_aubio_filter_a_weighting (32000); |
---|
27 | |
---|
28 | if (aubio_filter_set_a_weighting (o, -1) == 0) return 1; |
---|
29 | |
---|
30 | if (aubio_filter_set_a_weighting (0, 32000) == 0) return 1; |
---|
31 | |
---|
32 | in->data[impulse_at] = 0.5; |
---|
33 | fvec_print (in); |
---|
34 | aubio_filter_do_outplace (o, in, out); |
---|
35 | fvec_print (out); |
---|
36 | |
---|
37 | aubio_filter_set_a_weighting (o, 32000); |
---|
38 | in->data[impulse_at] = 0.5; |
---|
39 | fvec_print (in); |
---|
40 | aubio_filter_do_filtfilt (o, in, out); |
---|
41 | fvec_print (out); |
---|
42 | |
---|
43 | del_fvec (in); |
---|
44 | del_fvec (out); |
---|
45 | del_aubio_filter (o); |
---|
46 | aubio_cleanup (); |
---|
47 | |
---|
48 | return 0; |
---|
49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.