From: Paul Brossier Date: Sat, 17 Nov 2018 13:59:54 +0000 (+0100) Subject: [mfcc] remove note about power, add scale X-Git-Tag: 0.4.8~31^2~7 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=d66d2ac3f386467f0da5809224c973c74b8533f0;p=aubio.git [mfcc] remove note about power, add scale --- diff --git a/src/spectral/mfcc.c b/src/spectral/mfcc.c index 0b832a0c..f9df81ad 100644 --- a/src/spectral/mfcc.c +++ b/src/spectral/mfcc.c @@ -51,6 +51,7 @@ struct _aubio_mfcc_t aubio_dct_t *dct; fvec_t *output; #endif + smpl_t scale; }; @@ -97,6 +98,8 @@ new_aubio_mfcc (uint_t win_s, uint_t n_filters, uint_t n_coefs, mfcc->output = new_fvec (n_filters); #endif + mfcc->scale = 1.; + return mfcc; } @@ -127,14 +130,14 @@ aubio_mfcc_do (aubio_mfcc_t * mf, const cvec_t * in, fvec_t * out) #ifndef HAVE_SLOW_DCT fvec_t tmp; #endif + /* compute filterbank */ aubio_filterbank_do (mf->fb, in, mf->in_dct); /* compute log10 */ fvec_log10 (mf->in_dct); - /* raise power */ - //fvec_pow (mf->in_dct, 3.); + if (mf->scale != 1) fvec_mul (mf->in_dct, mf->scale); /* compute mfccs */ #if defined(HAVE_SLOW_DCT) @@ -161,6 +164,17 @@ uint_t aubio_mfcc_get_power (aubio_mfcc_t *mf) return aubio_filterbank_get_power(mf->fb); } +uint_t aubio_mfcc_set_scale (aubio_mfcc_t *mf, smpl_t scale) +{ + mf->scale = scale; + return AUBIO_OK; +} + +uint_t aubio_mfcc_get_scale (aubio_mfcc_t *mf) +{ + return mf->scale; +} + uint_t aubio_mfcc_set_mel_coeffs (aubio_mfcc_t *mf, smpl_t freq_min, smpl_t freq_max) {