Index: examples/aubiomfcc.c
===================================================================
--- examples/aubiomfcc.c	(revision 45134c5d80f69a506f3619ce88fbafc1b2a54434)
+++ examples/aubiomfcc.c	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -23,4 +23,7 @@
 fvec_t * mfcc_out;
 aubio_mfcc_t * mfcc;
+
+uint_t n_filters = 20;
+uint_t n_coefs = 11;
 
 unsigned int pos = 0; /*frames%dspblocksize*/
@@ -65,16 +68,18 @@
       */
       
-      uint_t filter_cnt;
+      uint_t coef_cnt;
       if (output_filename == NULL) {
-        if(frames >= 4) {
-          outmsg("%f\t",(frames-4)*overlap_size/(float)samplerate);
-        } else if (frames < 4) {
-          outmsg("%f\t",0.);
+//         if(frames >= 4) {
+//           outmsg("%f\t",(frames-4)*overlap_size/(float)samplerate);
+//         } 
+//         else if (frames < 4) {
+//           outmsg("%f\t",0.);
+//         }
+        //outmsg("%f ",mfcc_out->data[0][0]);
+        
+        /*for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) {
+          outmsg("%f ",mfcc_out->data[0][coef_cnt]);
         }
-        outmsg("%f",mfcc_out->data[0][0]);
-        for (filter_cnt = 1; filter_cnt < mfcc_out->length; filter_cnt++) {
-          outmsg(",%f",mfcc_out->data[0][filter_cnt]);
-        }
-        outmsg("\n");
+        outmsg("\n");/*/
       }
 }
@@ -82,13 +87,14 @@
 int main(int argc, char **argv) {
   // params
-  uint_t n_filters = 11;
+  //uint_t n_filters = 40;
+  //uint_t n_coefs = 15;
+
   examples_common_init(argc,argv);
-  smpl_t lowfreq = 0.;
-  smpl_t highfreq = samplerate;
-  mfcc_out = new_fvec(n_filters,channels);
+  smpl_t lowfreq = 133.333f;
+  smpl_t highfreq = 44100.f;
+  mfcc_out = new_fvec(n_coefs,channels);
   
   //populating the filter
-  mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, lowfreq, highfreq,
-      channels);
+  mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, n_coefs , lowfreq, highfreq, channels);
 
   //process
Index: examples/plotfb.py
===================================================================
--- examples/plotfb.py	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
+++ examples/plotfb.py	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+import pylab
+import numpy
+import sys
+
+filename=sys.argv[1]
+
+mat = pylab.load(filename)
+nmat= numpy.array(mat)
+print numpy.shape(nmat)
+
+pylab.hold(True)
+
+n_filters=numpy.shape(nmat)[0]
+for i in range(n_filters):
+  pylab.plot(nmat[i,:])
+
+
+pylab.hold(False)
+pylab.show()
Index: examples/plotmat.py
===================================================================
--- examples/plotmat.py	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
+++ examples/plotmat.py	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import pylab
+import numpy
+import sys
+
+filename=sys.argv[1]
+
+mat=pylab.load(filename)
+nmat=numpy.array(mat).T
+print numpy.shape(nmat)
+
+
+pylab.matshow(nmat, cmap=pylab.cm.gray, aspect='auto')
+#pylab.imshow(nmat, cmap=pylab.cm.gray, aspect='auto', interpolation=False)
+#pylab.contour(nmat, cmap=pylab.cm.gray, aspect='auto')
+
+pylab.show()
Index: examples/utils.c
===================================================================
--- examples/utils.c	(revision 45134c5d80f69a506f3619ce88fbafc1b2a54434)
+++ examples/utils.c	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -60,18 +60,4 @@
 int isonset = 0;
 aubio_pickpeak_t * parms;
-
-/* mfcc objects */
-//parameters
-uint_t n_filters=20;
-smpl_t lowfreq=80.f;
-smpl_t highfreq=18000.f;
-// filterbank object
-aubio_filterbank_t * mf;
-
-// DCT mfft and result storage
-aubio_mfft_t * fft_dct;
-cvec_t * fftgrain_dct;
-smpl_t * mfcc_outbuf[11];
-
 
 /* pitch objects */
@@ -314,7 +300,5 @@
   fftgrain  = new_cvec(buffer_size, channels);
 
-  //init for mfcc process
-  fftgrain_dct= new_cvec(n_filters, channels);
-
+  
   if (usepitch) {
     pitchdet = new_aubio_pitchdetection(buffer_size*4, 
@@ -330,8 +314,4 @@
   pv = new_aubio_pvoc(buffer_size, overlap_size, channels);
   
-  // dct phase vocoder
-  //TODO: check size
-  fft_dct = new_aubio_mfft(n_filters, channels);
-
   /* onsets */
   parms = new_aubio_peakpicker(threshold);
@@ -367,8 +347,4 @@
   del_fvec(onset);
   del_fvec(woodblock);
-  
-  //mffc related
-  del_aubio_mfft(fft_dct);
-  del_cvec(fftgrain_dct);
   
   aubio_cleanup();
Index: src/filterbank.c
===================================================================
--- src/filterbank.c	(revision 45134c5d80f69a506f3619ce88fbafc1b2a54434)
+++ src/filterbank.c	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -26,4 +26,6 @@
 #include "sample.h"
 #include "filterbank.h"
+
+#include "stdio.h"
 
 #define USE_EQUAL_GAIN 1
@@ -54,4 +56,11 @@
 
 aubio_filterbank_t * new_aubio_filterbank_mfcc(uint_t n_filters, uint_t win_s, smpl_t samplerate, smpl_t freq_min, smpl_t freq_max){
+  
+  uint_t writelog=1;
+
+  FILE * mlog;
+  if(writelog==1) mlog=fopen("filterbank.txt","w");
+  
+
   smpl_t nyquist = samplerate/2.;
   uint_t style = 1;
@@ -142,4 +151,14 @@
     for(k = next_peak + 1; k < fb->win_s; k++)
       fb->filters[n]->data[0][k]=0.f;
+
+    if(writelog){
+      //dumping filter values
+      smpl_t area_tmp=0.f;
+      for(k = 0; k < fb->win_s; k++){
+        fprintf(mlog,"%f ",fb->filters[n]->data[0][k]);
+      }
+      fprintf(mlog,"\n");
+    }
+
   }
 
@@ -148,4 +167,6 @@
   free(height_norm);
   free(fft_peak);
+
+  if(mlog) fclose(mlog);
 
   return fb;
Index: src/mfcc.c
===================================================================
--- src/mfcc.c	(revision 45134c5d80f69a506f3619ce88fbafc1b2a54434)
+++ src/mfcc.c	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -34,5 +34,6 @@
   uint_t samplerate;        /** sample rate (needed?) */
   uint_t channels;          /** number of channels */
-  uint_t n_coefs;           /** number of coefficients (= fb->n_filters/2 +1) */
+  uint_t n_filters;         /** number of  *filters */
+  uint_t n_coefs;           /** number of coefficients (<= n_filters/2 +1) */
   smpl_t lowfreq;           /** lowest frequency for filters */ 
   smpl_t highfreq;          /** highest frequency for filters */
@@ -44,14 +45,15 @@
 
 
-aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate ,uint_t n_coefs, smpl_t lowfreq, smpl_t highfreq, uint_t channels){
+aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate, uint_t n_filters, uint_t n_coefs, smpl_t lowfreq, smpl_t highfreq, uint_t channels){
   /** allocating space for mfcc object */
   aubio_mfcc_t * mfcc = AUBIO_NEW(aubio_mfcc_t);
 
   //we need (n_coefs-1)*2 filters to obtain n_coefs coefficients after dct
-  uint_t n_filters = (n_coefs-1)*2;
+  //uint_t n_filters = (n_coefs-1)*2;
   
   mfcc->win_s=win_s;
   mfcc->samplerate=samplerate;
   mfcc->channels=channels;
+  mfcc->n_filters=n_filters;
   mfcc->n_coefs=n_coefs;
   mfcc->lowfreq=lowfreq;
@@ -102,6 +104,6 @@
     aubio_mfft_do (mf->fft_dct, in, mf->fftgrain_dct);
     //extract real part of fft grain
-    //for(i=0; i<mf->n_coefs ;i++){
-    for(i=0; i<out->length;i++){
+    for(i=0; i<mf->n_coefs ;i++){
+    //for(i=0; i<out->length;i++){
       out->data[0][i]= mf->fftgrain_dct->norm[0][i]
         *COS(mf->fftgrain_dct->phas[0][i]);
Index: src/mfcc.h
===================================================================
--- src/mfcc.h	(revision 45134c5d80f69a506f3619ce88fbafc1b2a54434)
+++ src/mfcc.h	(revision 7a46bf6cec4e3b9ce9f40ff1db3a98933e016c56)
@@ -45,5 +45,5 @@
 
 */
-aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate ,uint_t n_coefs, smpl_t lowfreq, smpl_t highfreq, uint_t channels);
+aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate, uint_t n_filters, uint_t n_coefs, smpl_t lowfreq, smpl_t highfreq, uint_t channels);
 /** delete mfcc object
 
