Changeset 3aac194 for tests/src/spectral/test-dct.c
- Timestamp:
- Sep 15, 2018, 4:27:29 PM (6 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
- Children:
- c9ca2608
- Parents:
- d8b1161 (diff), 95e3cba (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/spectral/test-dct.c
rd8b1161 r3aac194 1 #include <aubio.h> 1 #include <math.h> 2 #include "aubio.h" 3 #include "utils_tests.h" 2 4 3 5 int main (void) … … 5 7 int return_code = 0; 6 8 uint_t win_s = 32; // window size 7 uint_t i, n_iters = 10; // number of iterations9 uint_t i, j, n_iters = 10; // number of iterations 8 10 // create dct object 9 11 aubio_dct_t * dct = new_aubio_dct(win_s); … … 11 13 fvec_t * in = new_fvec (win_s); // input buffer 12 14 fvec_t * dctout = new_fvec (win_s); // output buffer 15 fvec_t * out = new_fvec (win_s); // input buffer 13 16 14 17 if (!dct || !in || !dctout) { … … 20 23 for (i = 0; i < n_iters; i++) { 21 24 aubio_dct_do (dct, in, dctout); 22 aubio_dct_rdo (dct, dctout, in); 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 } 23 31 } 32 33 fvec_print(in); 24 34 fvec_print(dctout); 25 fvec_print(in); 35 fvec_print(out); 36 26 37 del_fvec(dctout); 27 38 del_fvec(in); 39 del_fvec(out); 40 del_aubio_dct(dct); 28 41 29 del_aubio_dct(dct);30 42 return return_code; 31 43 }
Note: See TracChangeset
for help on using the changeset viewer.