smpl_t lastlinearCF;
/* buffers to compute filter frequencies */
- fvec_t *freqs = new_fvec (n_filters + 2);
+ fvec_t *freqs;
+
+ if (samplerate <= 0) {
+ AUBIO_ERR("filterbank: set_mel_coeffs_slaney samplerate should be > 0\n");
+ return AUBIO_FAIL;
+ }
+
+ freqs = new_fvec (n_filters + 2);
/* first step: fill all the linear filter frequencies */
for (fn = 0; fn < linearFilters; fn++) {
fmat_t *coeffs = aubio_filterbank_get_coeffs(fb);
uint_t n_bands = coeffs->height;
- if (aubio_filterbank_check_freqs(fb, samplerate, &freq_min, &freq_max)) {
+ if (aubio_filterbank_check_freqs(fb, samplerate, &start, &end)) {
return AUBIO_FAIL;
}
fmat_t *coeffs = aubio_filterbank_get_coeffs(fb);
uint_t n_bands = coeffs->height;
- if (aubio_filterbank_check_freqs(fb, samplerate, &freq_min, &freq_max)) {
+ if (aubio_filterbank_check_freqs(fb, samplerate, &start, &end)) {
return AUBIO_FAIL;
}