#include "fvec.h"
#include "fmat.h"
#include "cvec.h"
+#include "vecutils.h"
#include "spectral/filterbank.h"
#include "mathutils.h"
uint_t win_s;
uint_t n_filters;
fmat_t *filters;
+ smpl_t norm;
+ smpl_t power;
};
aubio_filterbank_t *
/* allocate filter tables, a matrix of length win_s and of height n_filters */
fb->filters = new_fmat (n_filters, win_s / 2 + 1);
+ fb->norm = 1;
+
+ fb->power = 1;
+
return fb;
}
tmp.length = in->length;
tmp.data = in->norm;
+ if (f->power != 1.) fvec_pow(&tmp, f->power);
+
fmat_vecmul(f->filters, &tmp, out);
return;
fmat_copy(filter_coeffs, f->filters);
return 0;
}
+
+uint_t
+aubio_filterbank_set_norm (aubio_filterbank_t *f, smpl_t norm)
+{
+ if (norm != 0 && norm != 1) return AUBIO_FAIL;
+ f->norm = norm;
+ return AUBIO_OK;
+}
+
+smpl_t
+aubio_filterbank_get_norm (aubio_filterbank_t *f)
+{
+ return f->norm;
+}
+
+uint_t
+aubio_filterbank_set_power (aubio_filterbank_t *f, smpl_t power)
+{
+ f->power = power;
+ return AUBIO_OK;
+}
+
+smpl_t
+aubio_filterbank_get_power (aubio_filterbank_t *f)
+{
+ return f->norm;
+}
*/
uint_t aubio_filterbank_set_coeffs (aubio_filterbank_t * f, const fmat_t * filters);
+uint_t aubio_filterbank_set_norm (aubio_filterbank_t *f, smpl_t norm);
+
+smpl_t aubio_filterbank_get_norm (aubio_filterbank_t *f);
+
+uint_t aubio_filterbank_set_power (aubio_filterbank_t *f, smpl_t power);
+
+smpl_t aubio_filterbank_get_power (aubio_filterbank_t *f);
+
#ifdef __cplusplus
}
#endif