ref: f19db54741e591f6f2111dd9687391967efb5983
parent: bde4f641feff4cabff716064342ce600d762ce4d
parent: 117465d2f0320412d956861124cfc926fa7f1c5a
author: Paul Brossier <piem@piem.org>
date: Mon Dec 3 10:23:54 EST 2018
Merge branch 'fix/mfcc_params'
--- a/python/tests/test_mfcc.py
+++ b/python/tests/test_mfcc.py
@@ -116,13 +116,15 @@
def test_set_scale(self):
buf_size, n_filters, n_coeffs, samplerate = 512, 20, 10, 16000
m = mfcc(buf_size, n_filters, n_coeffs, samplerate)
- m.set_scale(10.)
+ m.set_scale(10.5)
+ assert m.get_scale() == 10.5
m(cvec(buf_size))
def test_set_power(self):
buf_size, n_filters, n_coeffs, samplerate = 512, 20, 10, 16000
m = mfcc(buf_size, n_filters, n_coeffs, samplerate)
- m.set_power(2.)
+ m.set_power(2.5)
+ assert m.get_power() == 2.5
m(cvec(buf_size))
def test_set_mel_coeffs(self):
--- a/src/spectral/filterbank.c
+++ b/src/spectral/filterbank.c
@@ -130,5 +130,5 @@
smpl_t
aubio_filterbank_get_power (aubio_filterbank_t *f)
{
- return f->norm;
+ return f->power;
}
--- a/src/spectral/mfcc.c
+++ b/src/spectral/mfcc.c
@@ -143,7 +143,7 @@
return aubio_filterbank_set_power(mf->fb, power);
}
-uint_t aubio_mfcc_get_power (aubio_mfcc_t *mf)
+smpl_t aubio_mfcc_get_power (aubio_mfcc_t *mf)
{
return aubio_filterbank_get_power(mf->fb);
}
@@ -154,7 +154,7 @@
return AUBIO_OK;
}
-uint_t aubio_mfcc_get_scale (aubio_mfcc_t *mf)
+smpl_t aubio_mfcc_get_scale (aubio_mfcc_t *mf)
{
return mf->scale;
}
--- a/src/spectral/mfcc.h
+++ b/src/spectral/mfcc.h
@@ -92,7 +92,7 @@
See aubio_filterbank_get_power().
*/
-uint_t aubio_mfcc_get_power (aubio_mfcc_t *mf);
+smpl_t aubio_mfcc_get_power (aubio_mfcc_t *mf);
/** set scaling parameter
@@ -111,7 +111,7 @@
\return current scaling parameter. Defaults to `1`.
*/
-uint_t aubio_mfcc_get_scale (aubio_mfcc_t *mf);
+smpl_t aubio_mfcc_get_scale (aubio_mfcc_t *mf);
/** Mel filterbank initialization