shithub: aubio

Download patch

ref: 1d518202c5dcde687d0f2ead94c9425a536422e8
parent: 04cd251fc22b43a76e04781f13219bbe0585533e
author: Paul Brossier <piem@piem.org>
date: Sat Nov 17 06:40:32 EST 2018

[filterbank] fix mel htk mode

--- a/python/ext/py-filterbank.c
+++ b/python/ext/py-filterbank.c
@@ -218,8 +218,8 @@
     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");
--- a/src/spectral/filterbank_mel.c
+++ b/src/spectral/filterbank_mel.c
@@ -285,7 +285,7 @@
 
   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);