fmat_t *coeffs = aubio_filterbank_get_coeffs(fb);
uint_t n_bands = coeffs->height;
+ if (samplerate <= 0) {
+ AUBIO_ERR("filterbank: set_mel_coeffs samplerate should be > 0\n");
+ return AUBIO_FAIL;
+ }
if (freq_max < 0) {
AUBIO_ERR("filterbank: set_mel_coeffs freq_max should be > 0\n");
return AUBIO_FAIL;
} else {
start = aubio_hztomel(freq_min);
}
- if (n_bands <= 0) {
- AUBIO_ERR("filterbank: set_mel_coeffs n_bands should be > 0\n");
- return AUBIO_FAIL;
- }
freqs = new_fvec(n_bands + 2);
step = (end - start) / (n_bands + 1);
fmat_t *coeffs = aubio_filterbank_get_coeffs(fb);
uint_t n_bands = coeffs->height;
+ if (samplerate <= 0) {
+ AUBIO_ERR("filterbank: set_mel_coeffs samplerate should be > 0\n");
+ return AUBIO_FAIL;
+ }
if (freq_max < 0) {
AUBIO_ERR("filterbank: set_mel_coeffs freq_max should be > 0\n");
return AUBIO_FAIL;
} else {
start = aubio_hztomel_htk(freq_min);
}
- if (n_bands <= 0) {
- AUBIO_ERR("filterbank: set_mel_coeffs n_bands should be > 0\n");
- return AUBIO_FAIL;
- }
freqs = new_fvec (n_bands + 2);
step = (end - start) / (n_bands + 1);