src/spectral/filterbank.c: move log10 to mfcc.c
authorPaul Brossier <piem@piem.org>
Mon, 28 Sep 2009 19:19:40 +0000 (21:19 +0200)
committerPaul Brossier <piem@piem.org>
Mon, 28 Sep 2009 19:19:40 +0000 (21:19 +0200)
src/spectral/filterbank.c
src/spectral/mfcc.c

index 98348ddb37ab7df1d32560782a8c16dcd93affb5..62cd572a6ac8d3731ba7949695002126b5f228ff 100644 (file)
@@ -25,8 +25,6 @@
 #include "spectral/filterbank.h"
 #include "mathutils.h"
 
-#define VERY_SMALL_NUMBER 2e-42
-
 /** \brief A structure to store a set of n_filters filters of lenghts win_s */
 struct aubio_filterbank_t_
 {
@@ -78,12 +76,6 @@ aubio_filterbank_do (aubio_filterbank_t * f, cvec_t * in, fvec_t * out)
       for (j = 0; j < in->length; j++) {
         out->data[i][fn] += in->norm[i][j] * f->filters->data[fn][j];
       }
-
-      /* threshold to VERY_SMALL_NUMBER to avoid log oveflow */
-      out->data[i][fn] = MAX (VERY_SMALL_NUMBER, out->data[i][fn]);
-
-      /* compute logarithm */
-      out->data[i][fn] = LOG10 (out->data[i][fn]);
     }
   }
 
index b086080acb31e7c450bb01a17454a6b422b6f368..b3f8a0a51d8595870d29999997577b07e1e3e225 100644 (file)
@@ -22,6 +22,7 @@
 #include "aubio_priv.h"
 #include "fvec.h"
 #include "cvec.h"
+#include "mathutils.h"
 #include "spectral/fft.h"
 #include "spectral/filterbank_mel.h"
 #include "spectral/mfcc.h"
@@ -101,6 +102,12 @@ aubio_mfcc_do (aubio_mfcc_t * mf, cvec_t * in, fvec_t * out)
   /* compute filterbank */
   aubio_filterbank_do (mf->fb, in, mf->in_dct);
 
+  /* compute log10 */
+  fvec_log10 (mf->in_dct);
+
+  /* raise power */
+  //vec_pow (mf->in_dct, 3.);
+
   /* zeros output */
   fvec_zeros(out);