feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/timestretchfix/ffmpeg5
Last change
on this file since cbe7809 was
cbe7809,
checked in by Paul Brossier <piem@piem.org>, 5 years ago
|
[tests] improve test-filter coverage
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[4e9101e] | 1 | #include <aubio.h> |
---|
| 2 | |
---|
[158e031] | 3 | int main (void) |
---|
[bd1a630] | 4 | { |
---|
[d770fd2] | 5 | uint_t win_s = 16; // window size |
---|
| 6 | uint_t impulse_at = win_s / 2; |
---|
[3684ab4] | 7 | fvec_t *in = new_fvec (win_s); // input buffer |
---|
| 8 | fvec_t *out = new_fvec (win_s); // input buffer |
---|
[4e9101e] | 9 | |
---|
[aea235c] | 10 | aubio_filter_t *o = new_aubio_filter_c_weighting (44100); |
---|
[f7af440] | 11 | |
---|
[cbe7809] | 12 | if (new_aubio_filter(0)) return 1; |
---|
[a114fe0] | 13 | |
---|
[cbe7809] | 14 | if (aubio_filter_get_samplerate(o) != 44100) return 1; |
---|
[a114fe0] | 15 | |
---|
[cbe7809] | 16 | if (aubio_filter_set_c_weighting (o, -1) == 0) return 1; |
---|
[a114fe0] | 17 | |
---|
[cbe7809] | 18 | if (aubio_filter_set_c_weighting (0, 32000) == 0) return 1; |
---|
[f7af440] | 19 | |
---|
[d770fd2] | 20 | in->data[impulse_at] = 0.5; |
---|
[bd1a630] | 21 | fvec_print (in); |
---|
| 22 | aubio_filter_do (o, in); |
---|
| 23 | fvec_print (in); |
---|
| 24 | del_aubio_filter (o); |
---|
[4e9101e] | 25 | |
---|
[3684ab4] | 26 | o = new_aubio_filter_a_weighting (32000); |
---|
[f7af440] | 27 | |
---|
[cbe7809] | 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; |
---|
[f7af440] | 31 | |
---|
[d770fd2] | 32 | in->data[impulse_at] = 0.5; |
---|
[bd1a630] | 33 | fvec_print (in); |
---|
| 34 | aubio_filter_do_outplace (o, in, out); |
---|
| 35 | fvec_print (out); |
---|
| 36 | |
---|
[3684ab4] | 37 | aubio_filter_set_a_weighting (o, 32000); |
---|
[d770fd2] | 38 | in->data[impulse_at] = 0.5; |
---|
[bd1a630] | 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); |
---|
[3684ab4] | 45 | del_aubio_filter (o); |
---|
[bd1a630] | 46 | aubio_cleanup (); |
---|
| 47 | |
---|
| 48 | return 0; |
---|
[4e9101e] | 49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.