From d37400c106cac10492ba20c10ab62a7e42b00280 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 28 Sep 2009 21:19:40 +0200 Subject: [PATCH] src/spectral/filterbank.c: move log10 to mfcc.c --- src/spectral/filterbank.c | 8 -------- src/spectral/mfcc.c | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/spectral/filterbank.c b/src/spectral/filterbank.c index 98348ddb..62cd572a 100644 --- a/src/spectral/filterbank.c +++ b/src/spectral/filterbank.c @@ -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]); } } diff --git a/src/spectral/mfcc.c b/src/spectral/mfcc.c index b086080a..b3f8a0a5 100644 --- a/src/spectral/mfcc.c +++ b/src/spectral/mfcc.c @@ -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); -- 2.26.2