Changes in / [3aac194:95e3cba]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/mfcc.c

    r3aac194 r95e3cba  
    2929#include "spectral/filterbank.h"
    3030#include "spectral/filterbank_mel.h"
    31 #include "spectral/dct.h"
    3231#include "spectral/mfcc.h"
    33 
    34 #undef HAVE_SLOW_DCT
    3532
    3633/** Internal structure for mfcc object */
     
    4441  aubio_filterbank_t *fb;   /** filter bank */
    4542  fvec_t *in_dct;           /** input buffer for dct * [fb->n_filters] */
    46 #if defined(HAVE_SLOW_DCT)
    4743  fmat_t *dct_coeffs;       /** DCT transform n_filters * n_coeffs */
    48 #else
    49   aubio_dct_t *dct;
    50   fvec_t *output;
    51 #endif
    5244};
    5345
     
    6052  /* allocate space for mfcc object */
    6153  aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t);
    62 #if defined(HAVE_SLOW_DCT)
    6354  smpl_t scaling;
    6455
    6556  uint_t i, j;
    66 #endif
    6757
    6858  mfcc->win_s = win_s;
     
    7868  mfcc->in_dct = new_fvec (n_filters);
    7969
    80 #if defined(HAVE_SLOW_DCT)
    8170  mfcc->dct_coeffs = new_fmat (n_coefs, n_filters);
    8271
     
    9180    mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.;
    9281  }
    93 #else
    94   mfcc->dct = new_aubio_dct (n_filters);
    95   mfcc->output = new_fvec (n_filters);
    96 #endif
    9782
    9883  return mfcc;
     
    10893  /* delete buffers */
    10994  del_fvec (mf->in_dct);
    110 #if defined(HAVE_SLOW_DCT)
    11195  del_fmat (mf->dct_coeffs);
    112 #else
    113   del_aubio_dct (mf->dct);
    114   del_fvec (mf->output);
    115 #endif
    11696
    11797  /* delete mfcc object */
     
    133113
    134114  /* compute mfccs */
    135 #if defined(HAVE_SLOW_DCT)
    136115  fmat_vecmul(mf->dct_coeffs, mf->in_dct, out);
    137 #else
    138   aubio_dct_do(mf->dct, mf->in_dct, mf->output);
    139   // copy only first n_coeffs elements
    140   // TODO assert mf->output->length == n_coeffs
    141   fvec_t tmp;
    142   tmp.data = mf->output->data;
    143   tmp.length = out->length;
    144   fvec_copy(&tmp, out);
    145 #endif
    146116
    147117  return;
Note: See TracChangeset for help on using the changeset viewer.