From 2062e489d684e82ec7cd5e0994fc39f96b353eb2 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 23 Sep 2009 18:37:24 +0200 Subject: [PATCH] src/spectral/filterbank*.c: reduce filterbank size to n/2+1, other half is always empty --- src/spectral/filterbank.c | 2 +- src/spectral/filterbank_mel.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spectral/filterbank.c b/src/spectral/filterbank.c index e97a18ec..97127b75 100644 --- a/src/spectral/filterbank.c +++ b/src/spectral/filterbank.c @@ -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; } diff --git a/src/spectral/filterbank_mel.c b/src/spectral/filterbank_mel.c index 9ee91248..5cdba18e 100644 --- a/src/spectral/filterbank_mel.c +++ b/src/spectral/filterbank_mel.c @@ -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 */ -- 2.26.2