Changes in / [3aac194:95e3cba]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/mfcc.c
r3aac194 r95e3cba 29 29 #include "spectral/filterbank.h" 30 30 #include "spectral/filterbank_mel.h" 31 #include "spectral/dct.h"32 31 #include "spectral/mfcc.h" 33 34 #undef HAVE_SLOW_DCT35 32 36 33 /** Internal structure for mfcc object */ … … 44 41 aubio_filterbank_t *fb; /** filter bank */ 45 42 fvec_t *in_dct; /** input buffer for dct * [fb->n_filters] */ 46 #if defined(HAVE_SLOW_DCT)47 43 fmat_t *dct_coeffs; /** DCT transform n_filters * n_coeffs */ 48 #else49 aubio_dct_t *dct;50 fvec_t *output;51 #endif52 44 }; 53 45 … … 60 52 /* allocate space for mfcc object */ 61 53 aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t); 62 #if defined(HAVE_SLOW_DCT)63 54 smpl_t scaling; 64 55 65 56 uint_t i, j; 66 #endif67 57 68 58 mfcc->win_s = win_s; … … 78 68 mfcc->in_dct = new_fvec (n_filters); 79 69 80 #if defined(HAVE_SLOW_DCT)81 70 mfcc->dct_coeffs = new_fmat (n_coefs, n_filters); 82 71 … … 91 80 mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.; 92 81 } 93 #else94 mfcc->dct = new_aubio_dct (n_filters);95 mfcc->output = new_fvec (n_filters);96 #endif97 82 98 83 return mfcc; … … 108 93 /* delete buffers */ 109 94 del_fvec (mf->in_dct); 110 #if defined(HAVE_SLOW_DCT)111 95 del_fmat (mf->dct_coeffs); 112 #else113 del_aubio_dct (mf->dct);114 del_fvec (mf->output);115 #endif116 96 117 97 /* delete mfcc object */ … … 133 113 134 114 /* compute mfccs */ 135 #if defined(HAVE_SLOW_DCT)136 115 fmat_vecmul(mf->dct_coeffs, mf->in_dct, out); 137 #else138 aubio_dct_do(mf->dct, mf->in_dct, mf->output);139 // copy only first n_coeffs elements140 // TODO assert mf->output->length == n_coeffs141 fvec_t tmp;142 tmp.data = mf->output->data;143 tmp.length = out->length;144 fvec_copy(&tmp, out);145 #endif146 116 147 117 return;
Note: See TracChangeset
for help on using the changeset viewer.