aubio 0.4.9
temporal/test-a_weighting.c
#include <aubio.h>
int main (void)
{
uint_t rates[] = { 8000, 16000, 22050, 44100, 96000, 192000};
uint_t nrates = 6;
uint_t samplerate, i = 0;
for ( samplerate = rates[i]; i < nrates ; i++ ) {
f = new_aubio_filter_a_weighting (samplerate);
}
// samplerate unknown
if (!f) {
//PRINT_MSG ("failed creating A-weighting filter with samplerate=4200Hz\n");
}
// order to small
if (aubio_filter_set_a_weighting (f, samplerate) != 0) {
//PRINT_MSG ("failed setting filter to A-weighting\n");
}
// order to big
f = new_aubio_filter (12);
if (aubio_filter_set_a_weighting (f, samplerate) != 0) {
//PRINT_MSG ("failed setting filter to A-weighting\n");
}
return 0;
}
aubio_filter_t * new_aubio_filter_a_weighting(uint_t samplerate)
create new A-design filter
uint_t aubio_filter_set_a_weighting(aubio_filter_t *f, uint_t samplerate)
set feedback and feedforward coefficients of a A-weighting filter
Global aubio include file.
aubio_filter_t * new_aubio_filter(uint_t order)
create new filter object
struct _aubio_filter_t aubio_filter_t
Digital filter.
Definition: filter.h:72
void del_aubio_filter(aubio_filter_t *f)
delete a filter object
unsigned int uint_t
unsigned integer
Definition: types.h:60