aubio 0.4.9
Loading...
Searching...
No Matches
spectral/test-filterbank_mel.c
#include <aubio.h>
int main (void)
{
uint_t samplerate = 16000; // samplerate of signal to filter
uint_t win_s = 512; // fft size
uint_t n_filters = 40; // number of filters
cvec_t *in_spec = new_cvec (win_s); // input vector of samples
fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
// create filterbank object
aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
// assign Mel-frequency coefficients
// apply filterbank ten times
uint_t n = 10;
while (n) {
aubio_filterbank_do (o, in_spec, out_filters);
n--;
}
// print out filter coefficients
fmat_t *coeffs; // pointer to the coefficients
fmat_print (coeffs);
//fvec_print (out_filters);
del_cvec (in_spec);
del_fvec (out_filters);
return 0;
}
Global aubio include file.
cvec_t * new_cvec(uint_t length)
cvec_t buffer creation function
void del_cvec(cvec_t *s)
cvec_t buffer deletion function
void del_aubio_filterbank(aubio_filterbank_t *f)
destroy filterbank object
aubio_filterbank_t * new_aubio_filterbank(uint_t n_filters, uint_t win_s)
create filterbank object
fmat_t * aubio_filterbank_get_coeffs(const aubio_filterbank_t *f)
return a pointer to the matrix object containing all filter coefficients
struct _aubio_filterbank_t aubio_filterbank_t
filterbank object
Definition filterbank.h:45
void aubio_filterbank_do(aubio_filterbank_t *f, const cvec_t *in, fvec_t *out)
compute filterbank
uint_t aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, smpl_t samplerate)
filterbank initialization for Mel filters using Slaney's coefficients
void fmat_print(const fmat_t *s)
print out fmat data
fvec_t * new_fvec(uint_t length)
fvec_t buffer creation function
void del_fvec(fvec_t *s)
fvec_t buffer deletion function
void aubio_cleanup(void)
clean up cached memory at the end of program
Vector of real-valued phase and spectrum data.
Definition cvec.h:63
Buffer for real data.
Definition fmat.h:40
Buffer for real data.
Definition fvec.h:67
unsigned int uint_t
unsigned integer
Definition types.h:60