src/spectral/filterbank*.c: reduce filterbank size to n/2+1, other half is always...
authorPaul Brossier <piem@piem.org>
Wed, 23 Sep 2009 16:37:24 +0000 (18:37 +0200)
committerPaul Brossier <piem@piem.org>
Wed, 23 Sep 2009 16:37:24 +0000 (18:37 +0200)
src/spectral/filterbank.c
src/spectral/filterbank_mel.c

index e97a18ecb51c208512c3a1352a15267098cde26a..97127b75c9a2fae2833d915d5d3fcc4b1f8d52f6 100644 (file)
@@ -44,7 +44,7 @@ new_aubio_filterbank (uint_t n_filters, uint_t win_s)
   fb->n_filters = n_filters;
 
   /* allocate filter tables, an fvec of length win_s and of filter_cnt channel */
-  fb->filters = new_fvec (win_s, n_filters);
+  fb->filters = new_fvec (win_s / 2 + 1, n_filters);
 
   return fb;
 }
index 9ee912487b4df97312ffdc1892131c5a7e880d5b..5cdba18e4e2fc20ba6630dd016c5ab66784b8aab 100644 (file)
@@ -69,7 +69,7 @@ aubio_filterbank_set_mel_coeffs (aubio_filterbank_t * fb, fvec_t * freqs,
 
   /* fill fft_freqs lookup table, which assigns the frequency in hz to each bin */
   for (bin = 0; bin < win_s; bin++) {
-    fft_freqs->data[0][bin] = aubio_bintofreq (bin, samplerate, win_s);
+    fft_freqs->data[0][bin] = aubio_bintofreq (bin, samplerate, (win_s - 1) * 2);
   }
 
   /* zeroing of all filters */