aubio 0.4.9

Loading...
Searching...
No Matches
temporal/test-c_weighting.c
#include <aubio.h>
int main (void)
{
aubio_filter_t * f;
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_c_weighting (samplerate);
del_aubio_filter (f);
f = new_aubio_filter (5);
aubio_filter_set_c_weighting (f, samplerate);
del_aubio_filter (f);
}
// samplerate unknown
f = new_aubio_filter_c_weighting (4200);
if (!f) {
//PRINT_WRN ("failed creating C-weighting filter with samplerate=4200Hz");
}
// order to small
f = new_aubio_filter (2);
if (aubio_filter_set_c_weighting (f, samplerate) != 0) {
//PRINT_WRN ("failed setting filter to C-weighting");
}
del_aubio_filter (f);
// order to big
f = new_aubio_filter (12);
if (aubio_filter_set_c_weighting (f, samplerate) != 0) {
//PRINT_WRN ("failed setting filter to C-weighting");
}
del_aubio_filter (f);
return 0;
}
aubio.h
Global aubio include file.
aubio_filter_set_c_weighting
uint_t aubio_filter_set_c_weighting(aubio_filter_t *f, uint_t samplerate)
set feedback and feedforward coefficients of a C-weighting filter
new_aubio_filter_c_weighting
aubio_filter_t * new_aubio_filter_c_weighting(uint_t samplerate)
create new C-design filter
new_aubio_filter
aubio_filter_t * new_aubio_filter(uint_t order)
create new filter object
aubio_filter_t
struct _aubio_filter_t aubio_filter_t
Digital filter.
Definition: filter.h:72
del_aubio_filter
void del_aubio_filter(aubio_filter_t *f)
delete a filter object
uint_t
unsigned int uint_t
unsigned integer
Definition: types.h:60