From: Paul Brossier Date: Wed, 23 Sep 2009 16:37:24 +0000 (+0200) Subject: src/spectral/filterbank*.c: reduce filterbank size to n/2+1, other half is always... X-Git-Tag: bzr2git~331 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2062e489d684e82ec7cd5e0994fc39f96b353eb2;p=aubio.git src/spectral/filterbank*.c: reduce filterbank size to n/2+1, other half is always empty --- 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 */