Ignore:
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>
    42
    53int main (void)
     
    75  int return_code = 0;
    86  uint_t win_s = 32; // window size
    9   uint_t i, j, n_iters = 10; // number of iterations
     7  uint_t i, n_iters = 10; // number of iterations
    108  // create dct object
    119  aubio_dct_t * dct = new_aubio_dct(win_s);
     
    1311  fvec_t * in = new_fvec (win_s); // input buffer
    1412  fvec_t * dctout = new_fvec (win_s); // output buffer
    15   fvec_t * out = new_fvec (win_s); // input buffer
    1613
    1714  if (!dct || !in || !dctout) {
     
    2320  for (i = 0; i < n_iters; i++) {
    2421    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);
    3123  }
    32 
     24  fvec_print(dctout);
    3325  fvec_print(in);
    34   fvec_print(dctout);
    35   fvec_print(out);
    36 
    3726  del_fvec(dctout);
    3827  del_fvec(in);
    39   del_fvec(out);
     28
    4029  del_aubio_dct(dct);
    41 
    4230  return return_code;
    4331}
Note: See TracChangeset for help on using the changeset viewer.