added mfcc binding
authorAmaury Hazan <mahmoudax@gmail.org>
Wed, 12 Sep 2007 17:36:11 +0000 (19:36 +0200)
committerAmaury Hazan <mahmoudax@gmail.org>
Wed, 12 Sep 2007 17:36:11 +0000 (19:36 +0200)
examples/utils.c
src/filterbank.c
swig/aubio.i

index fff16abdd0955d3246baef97b556eb85089b9bc0..9fd6eafb9f4fc974b40bd235da80566d2426fbd9 100644 (file)
@@ -43,6 +43,8 @@ smpl_t silence                        = -90.;
 // uint_t overlap_size                   = 256;
 uint_t buffer_size                    = 1024;
 uint_t overlap_size                   = 512;
+// uint_t buffer_size                    = 2048;
+// uint_t overlap_size                   = 1024;
 uint_t channels                       = 1;
 uint_t samplerate                     = 44100;
 
index fdc549edb9aa7502fa6756864568ff8164dfb9a7..d79bb1540b3541c229a8743d14b9e8109d210c79 100644 (file)
@@ -224,32 +224,24 @@ aubio_filterbank_t * new_aubio_filterbank_mfcc2(uint_t n_filters, uint_t win_s,
   AUBIO_DBG("filter tables frequencies\n");
   for(filter_cnt=0; filter_cnt<allFilters; filter_cnt++)
     AUBIO_DBG("filter n. %d %f %f %f %f\n",filter_cnt, lower_freqs->data[0][filter_cnt], center_freqs->data[0][filter_cnt], upper_freqs->data[0][filter_cnt], triangle_heights->data[0][filter_cnt]);
-  
-  
+
   //filling the fft_freqs lookup table, which assigns the frequency in hz to each bin
-  
   for(bin_cnt=0; bin_cnt<win_s; bin_cnt++){
-    
     //TODO: check the formula!
-    
     fft_freqs->data[0][bin_cnt]= (smpl_t)samplerate* (smpl_t)bin_cnt/ (smpl_t)win_s;
-
   }
-  
-  
+
   //building each filter table
   for(filter_cnt=0; filter_cnt<allFilters; filter_cnt++){
 
     //TODO:check special case : lower freq =0
-    
     //calculating rise increment in mag/Hz
     smpl_t riseInc= triangle_heights->data[0][filter_cnt]/(center_freqs->data[0][filter_cnt]-lower_freqs->data[0][filter_cnt]);
     
-    //zeroing begining of filter
-    AUBIO_DBG("\nfilter %d",filter_cnt);
 
+    AUBIO_DBG("\nfilter %d",filter_cnt);
+    //zeroing begining of filter
     AUBIO_DBG("\nzero begin\n");
-    
     for(bin_cnt=0; bin_cnt<win_s-1; bin_cnt++){
       //zeroing beigining of array
       fb->filters[filter_cnt]->data[0][bin_cnt]=0.f;
index 7810f6192fc5d0fa13e57f11c2768e283324f976..df1b1b25446b3fd19e8ebfeff587ba7fc7011fe7 100644 (file)
@@ -148,6 +148,14 @@ void aubio_autocorr(fvec_t * in, fvec_t * acf);
 smpl_t aubio_zero_crossing_rate(fvec_t * input);
 smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate);
 
+/* filterbank */
+
+/* mfcc */
+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);
+void del_aubio_mfcc(aubio_mfcc_t *mf);
+void aubio_mfcc_do(aubio_mfcc_t *mf, cvec_t *in, fvec_t *out);
+
+
 /* scale */
 extern aubio_scale_t * new_aubio_scale(smpl_t flow, smpl_t fhig, smpl_t ilow, smpl_t ihig      );
 extern void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, smpl_t olow, smpl_t ohig);