Changes in tests/src/spectral/test-dct.c [52c1de9:9338e18]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/spectral/test-dct.c
r52c1de9 r9338e18 1 #include <math.h> 2 #include "aubio.h" 3 #include "utils_tests.h" 1 #include <aubio.h> 4 2 5 3 int main (void) … … 7 5 int return_code = 0; 8 6 uint_t win_s = 32; // window size 9 uint_t i, j,n_iters = 10; // number of iterations7 uint_t i, n_iters = 10; // number of iterations 10 8 // create dct object 11 9 aubio_dct_t * dct = new_aubio_dct(win_s); … … 13 11 fvec_t * in = new_fvec (win_s); // input buffer 14 12 fvec_t * dctout = new_fvec (win_s); // output buffer 15 fvec_t * out = new_fvec (win_s); // input buffer16 13 17 14 if (!dct || !in || !dctout) { … … 23 20 for (i = 0; i < n_iters; i++) { 24 21 aubio_dct_do (dct, in, dctout); 25 aubio_dct_rdo (dct, dctout, out); 26 for (j = 0; j < in->length; j++) { 27 if (fabsf(in->data[j] - out->data[j]) > 10.e-4) { 28 fprintf(stderr, "dct reconstruction failed\n"); 29 } 30 } 22 aubio_dct_rdo (dct, dctout, in); 31 23 } 32 24 fvec_print(dctout); 33 25 fvec_print(in); 34 fvec_print(dctout);35 fvec_print(out);36 37 26 del_fvec(dctout); 38 27 del_fvec(in); 39 del_fvec(out); 28 40 29 del_aubio_dct(dct); 41 42 30 return return_code; 43 31 }
Note: See TracChangeset
for help on using the changeset viewer.