Index: src/spectral/filterbank_mel.c
===================================================================
--- src/spectral/filterbank_mel.c	(revision bc3c51bccfaa4d3f2b26ec029a38eebf9e1a0488)
+++ src/spectral/filterbank_mel.c	(revision 1e37adec4dc504c99185e178b4a16934e53b6c55)
@@ -27,6 +27,6 @@
 
 void
-aubio_filterbank_set_mel_coeffs (aubio_filterbank_t * fb, smpl_t samplerate,
-    smpl_t freq_min, smpl_t freq_max)
+aubio_filterbank_set_mel_coeffs (aubio_filterbank_t * fb, fvec_t * freqs,
+    smpl_t samplerate)
 {
 
@@ -34,50 +34,27 @@
   uint_t n_filters = filters->channels, win_s = filters->length;
 
-  /* Malcolm Slaney parameters */
-  smpl_t lowestFrequency = 133.3333;
-  smpl_t linearSpacing = 66.66666666;
-  smpl_t logSpacing = 1.0711703;
+  uint_t fn;                    /* filter counter */
+  uint_t bin;                   /* bin counter */
 
-  uint_t linearFilters = 13;
-  uint_t logFilters = 27;
-  uint_t allFilters = linearFilters + logFilters;
-
-  /* throw a warning if filterbank object fb is too short */
-  if (allFilters > n_filters) {
-    AUBIO_WRN ("not enough Mel filters, got %d but %d needed\n",
-        n_filters, allFilters);
+  /* freqs define the bands of triangular overlapping windows.
+     throw a warning if filterbank object fb is too short. */
+  if (freqs->length - 2 > n_filters) {
+    AUBIO_WRN ("not enough filters, %d allocated but %d requested\n",
+        n_filters, freqs->length - 2);
   }
 
-  /* buffers for computing filter frequencies */
-  fvec_t *freqs = new_fvec (allFilters + 2, 1);
-
   /* convenience reference to lower/center/upper frequency for each triangle */
-  fvec_t *lower_freqs = new_fvec (allFilters, 1);
-  fvec_t *upper_freqs = new_fvec (allFilters, 1);
-  fvec_t *center_freqs = new_fvec (allFilters, 1);
+  fvec_t *lower_freqs = new_fvec (n_filters, 1);
+  fvec_t *upper_freqs = new_fvec (n_filters, 1);
+  fvec_t *center_freqs = new_fvec (n_filters, 1);
 
   /* height of each triangle */
-  fvec_t *triangle_heights = new_fvec (allFilters, 1);
+  fvec_t *triangle_heights = new_fvec (n_filters, 1);
 
   /* lookup table of each bin frequency in hz */
   fvec_t *fft_freqs = new_fvec (win_s, 1);
 
-  uint_t fn;                    /* filter counter */
-  uint_t bin;                   /* bin counter */
-
-  /* first step: filling all the linear filter frequencies */
-  for (fn = 0; fn < linearFilters; fn++) {
-    freqs->data[0][fn] = lowestFrequency + fn * linearSpacing;
-  }
-  smpl_t lastlinearCF = freqs->data[0][fn - 1];
-
-  /* second step: filling all the log filter frequencies */
-  for (fn = 0; fn < logFilters + 2; fn++) {
-    freqs->data[0][fn + linearFilters] =
-        lastlinearCF * (POW (logSpacing, fn + 1));
-  }
-
   /* fill up the lower/center/upper */
-  for (fn = 0; fn < allFilters; fn++) {
+  for (fn = 0; fn < n_filters; fn++) {
     lower_freqs->data[0][fn] = freqs->data[0][fn];
     center_freqs->data[0][fn] = freqs->data[0][fn + 1];
@@ -86,5 +63,5 @@
 
   /* compute triangle heights so that each triangle has unit area */
-  for (fn = 0; fn < allFilters; fn++) {
+  for (fn = 0; fn < n_filters; fn++) {
     triangle_heights->data[0][fn] =
         2. / (upper_freqs->data[0][fn] - lower_freqs->data[0][fn]);
@@ -144,5 +121,4 @@
 
   /* destroy temporarly allocated vectors */
-  del_fvec (freqs);
   del_fvec (lower_freqs);
   del_fvec (upper_freqs);
@@ -153,2 +129,41 @@
 
 }
+
+void
+aubio_filterbank_set_mel_coeffs_slaney (aubio_filterbank_t * fb,
+    smpl_t samplerate)
+{
+  /* Malcolm Slaney parameters */
+  smpl_t lowestFrequency = 133.3333;
+  smpl_t linearSpacing = 66.66666666;
+  smpl_t logSpacing = 1.0711703;
+
+  uint_t linearFilters = 13;
+  uint_t logFilters = 27;
+  uint_t n_filters = linearFilters + logFilters;
+
+  uint_t fn;                    /* filter counter */
+  uint_t bin;                   /* bin counter */
+
+  /* buffers to compute filter frequencies */
+  fvec_t *freqs = new_fvec (n_filters + 2, 1);
+
+  /* first step: fill all the linear filter frequencies */
+  for (fn = 0; fn < linearFilters; fn++) {
+    freqs->data[0][fn] = lowestFrequency + fn * linearSpacing;
+  }
+  smpl_t lastlinearCF = freqs->data[0][fn - 1];
+
+  /* second step: fill all the log filter frequencies */
+  for (fn = 0; fn < logFilters + 2; fn++) {
+    freqs->data[0][fn + linearFilters] =
+        lastlinearCF * (POW (logSpacing, fn + 1));
+  }
+
+  /* now compute the actual coefficients */
+  aubio_filterbank_set_mel_coeffs (fb, freqs, samplerate);
+
+  /* destroy vector used to store frequency limits */
+  del_fvec (freqs);
+
+}
Index: src/spectral/filterbank_mel.h
===================================================================
--- src/spectral/filterbank_mel.h	(revision bc3c51bccfaa4d3f2b26ec029a38eebf9e1a0488)
+++ src/spectral/filterbank_mel.h	(revision 1e37adec4dc504c99185e178b4a16934e53b6c55)
@@ -44,13 +44,25 @@
 /** filterbank initialization for mel filters
 
-  \param n_filters number of filters
-  \param win_s window size
+  \param fb filterbank object
+  \param freqs arbitrary array of boundary frequencies
   \param samplerate audio sampling rate
-  \param freq_min lowest filter frequency
-  \param freq_max highest filter frequency
+
+  This function computes the coefficients of the filterbank based on the
+  boundaries found in freqs, in Hz, and using triangular overlapping windows.
 
 */
 void aubio_filterbank_set_mel_coeffs (aubio_filterbank_t * fb,
-    smpl_t samplerate, smpl_t freq_min, smpl_t freq_max);
+    fvec_t * freqs, smpl_t samplerate);
+
+/** filterbank initialization for Mel filters using Slaney's coefficients
+
+  \param fb filterbank object
+  \param samplerate audio sampling rate
+
+  This function fills the filterbank coefficients according to Malcolm Slaney.
+
+*/
+void aubio_filterbank_set_mel_coeffs_slaney (aubio_filterbank_t * fb,
+    smpl_t samplerate);
 
 #ifdef __cplusplus
Index: src/spectral/mfcc.c
===================================================================
--- src/spectral/mfcc.c	(revision bc3c51bccfaa4d3f2b26ec029a38eebf9e1a0488)
+++ src/spectral/mfcc.c	(revision 1e37adec4dc504c99185e178b4a16934e53b6c55)
@@ -63,5 +63,5 @@
   /** filterbank allocation */
   mfcc->fb = new_aubio_filterbank(n_filters, mfcc->win_s);
-  aubio_filterbank_set_mel_coeffs(mfcc->fb, samplerate, lowfreq, highfreq);
+  aubio_filterbank_set_mel_coeffs_slaney(mfcc->fb, samplerate);
 
   /** allocating space for fft object (used for dct) */
Index: swig/aubio.i
===================================================================
--- swig/aubio.i	(revision bc3c51bccfaa4d3f2b26ec029a38eebf9e1a0488)
+++ swig/aubio.i	(revision 1e37adec4dc504c99185e178b4a16934e53b6c55)
@@ -163,5 +163,6 @@
 /* filterbank */
 aubio_filterbank_t * new_aubio_filterbank(uint_t win_s, uint_t channels);
-void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, uint_t samplerate, smpl_t freq_min, smpl_t freq_max);
+void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, fvec_t *freqs, uint_t samplerate);
+void aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, uint_t samplerate);
 void del_aubio_filterbank(aubio_filterbank_t * fb);
 void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out);
