- Timestamp:
- Mar 3, 2013, 4:54:28 AM (12 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- e230bb4
- Parents:
- 8f68dfb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/temporal/test-biquad.c
r8f68dfb red1deac 1 1 #include <aubio.h> 2 2 3 int main(){ 4 /* allocate some memory */ 5 uint_t win_s = 1024; /* window size */ 6 fvec_t * in = new_fvec (win_s); /* input buffer */ 7 aubio_filter_t * o = new_aubio_filter_biquad(0.3,0.2,0.1,0.2,0.3); 3 int main () { 4 uint_t win_s = 64; // window size 8 5 9 aubio_filter_do_filtfilt(o,in,in);10 aubio_filter_do(o,in);6 // create biquad filter with `b0`, `b1`, `b2`, `a1`, `a2` 7 aubio_filter_t * o = new_aubio_filter_biquad(0.3,0.2,0.1,0.2,0.3); 11 8 12 del_aubio_filter(o); 13 del_fvec(in); 14 return 0; 9 fvec_t * in_vec = new_fvec (win_s); // input buffer 10 fvec_t * tmp_vec = new_fvec (win_s); // temporary buffer 11 fvec_t * out_vec = new_fvec (win_s); // output buffer 12 13 uint_t times = 100; 14 while ( times-- ) { 15 // copy to out, then filter out 16 aubio_filter_do_outplace(o, in_vec, out_vec); 17 // in-place filtering 18 aubio_filter_do(o, in_vec); 19 // in-place filtering 20 aubio_filter_do_filtfilt(o, in_vec, out_vec); 21 fvec_print(in_vec); 22 } 23 24 // memory clean-up, one for each new 25 del_aubio_filter(o); 26 del_fvec(in_vec); 27 del_fvec(tmp_vec); 28 del_fvec(out_vec); 29 30 return 0; 15 31 }
Note: See TracChangeset
for help on using the changeset viewer.