[filterbank] fix mel htk mode
authorPaul Brossier <piem@piem.org>
Sat, 17 Nov 2018 10:40:32 +0000 (11:40 +0100)
committerPaul Brossier <piem@piem.org>
Sat, 17 Nov 2018 10:40:32 +0000 (11:40 +0100)
python/ext/py-filterbank.c
src/spectral/filterbank_mel.c

index 22547a2..56e21ed 100644 (file)
@@ -218,8 +218,8 @@ Py_filterbank_set_mel_coeffs_htk (Py_filterbank * self, PyObject *args)
     return NULL;
   }
 
-  err = aubio_filterbank_set_mel_coeffs_htk (self->o,
-      freq_min, freq_max, samplerate);
+  err = aubio_filterbank_set_mel_coeffs_htk (self->o, samplerate,
+      freq_min, freq_max);
   if (err > 0) {
     if (PyErr_Occurred() == NULL) {
       PyErr_SetString (PyExc_ValueError, "error running set_mel_coeffs_htk");
index 7e5a08c..6b51915 100644 (file)
@@ -285,7 +285,7 @@ aubio_filterbank_set_mel_coeffs_htk (aubio_filterbank_t * fb, smpl_t samplerate,
 
   for (m = 0; m < n_bands + 2; m++)
   {
-    freqs->data[m] = MIN(aubio_meltohz_htk(step * m), samplerate/2.);
+    freqs->data[m] = MIN(aubio_meltohz_htk(start + step * m), samplerate/2.);
   }
 
   retval = aubio_filterbank_set_triangle_bands (fb, freqs, samplerate);