shithub: aubio

Download patch

ref: 73e8f652031b9c98d01804eb751ea70d6131ab84
parent: c02a1cc58a1b936059d7acb72c6e070b6406ec75
author: Paul Brossier <piem@piem.org>
date: Tue Feb 16 16:53:28 EST 2016

src/spectral/mfcc.c: use fmat_vecmul

--- a/src/spectral/mfcc.c
+++ b/src/spectral/mfcc.c
@@ -102,8 +102,6 @@
 void
 aubio_mfcc_do (aubio_mfcc_t * mf, cvec_t * in, fvec_t * out)
 {
-  uint_t j, k;
-
   /* compute filterbank */
   aubio_filterbank_do (mf->fb, in, mf->in_dct);
 
@@ -113,16 +111,8 @@
   /* raise power */
   //fvec_pow (mf->in_dct, 3.);
 
-  /* zeros output */
-  fvec_zeros(out);
-
-  /* compute discrete cosine transform */
-  for (j = 0; j < mf->n_filters; j++) {
-    for (k = 0; k < mf->n_coefs; k++) {
-      out->data[k] += mf->in_dct->data[j]
-          * mf->dct_coeffs->data[k][j];
-    }
-  }
+  /* compute mfccs */
+  fmat_vecmul(mf->dct_coeffs, mf->in_dct, out);
 
   return;
 }