ref: 9ef3c6e531d0b937f18abc3aacd550946c682ace
parent: 693de50ac5ab978671b9a84ca8f1cb83a5bba77c
author: Paul Brossier <piem@piem.org>
date: Fri Nov 9 14:14:26 EST 2018
[filterbank] add a warning for duplicate freqs, improve nyquist warning
--- a/src/spectral/filterbank_mel.c
+++ b/src/spectral/filterbank_mel.c
@@ -60,11 +60,14 @@
return AUBIO_FAIL;
} else if (freqs->data[fn] > samplerate / 2) {
AUBIO_WRN("filterbank_mel: freqs should contain only "
- "values > samplerate / 2.\n");
+ "values < samplerate / 2.\n");
} else if (fn > 0 && freqs->data[fn] < freqs->data[fn-1]) {
AUBIO_ERR("filterbank_mel: freqs should be a list of frequencies "
"sorted from low to high, but freq[%d] < freq[%d-1]\n", fn, fn);
return AUBIO_FAIL;
+ } else if (fn > 0 && freqs->data[fn] == freqs->data[fn-1]) {
+ AUBIO_WRN("filterbank_mel: set_triangle_bands received a list "
+ "with twice the frequency %f\n", freqs->data[fn]);
}
}