Loading...
Searching...
No Matches
temporal/test-biquad.c
#include <aubio.h>
int main (void)
{
uint_t win_s = 64; // window size
// create biquad filter with `b0`, `b1`, `b2`, `a1`, `a2`
aubio_filter_t * o = new_aubio_filter_biquad(0.3,0.2,0.1,0.2,0.3);
fvec_t * in_vec = new_fvec (win_s); // input buffer
fvec_t * tmp_vec = new_fvec (win_s); // temporary buffer
fvec_t * out_vec = new_fvec (win_s); // output buffer
uint_t times = 100;
while ( times-- ) {
// copy to out, then filter out
aubio_filter_do_outplace(o, in_vec, out_vec);
// in-place filtering
aubio_filter_do(o, in_vec);
// in-place filtering
aubio_filter_do_filtfilt(o, in_vec, out_vec);
fvec_print(in_vec);
}
// memory clean-up, one for each new
del_aubio_filter(o);
del_fvec(in_vec);
del_fvec(tmp_vec);
del_fvec(out_vec);
return 0;
}
aubio.h
Global aubio include file.
new_aubio_filter_biquad
aubio_filter_t * new_aubio_filter_biquad(lsmp_t b0, lsmp_t b1, lsmp_t b2, lsmp_t a1, lsmp_t a2)
create biquad filter with b0, b1, b2, a1, a2 coeffs
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
aubio_filter_do
void aubio_filter_do(aubio_filter_t *f, fvec_t *in)
filter input vector (in-place)
aubio_filter_do_filtfilt
void aubio_filter_do_filtfilt(aubio_filter_t *f, fvec_t *in, fvec_t *tmp)
filter input vector forward and backward
aubio_filter_do_outplace
void aubio_filter_do_outplace(aubio_filter_t *f, const fvec_t *in, fvec_t *out)
filter input vector (out-of-place)
new_fvec
fvec_t * new_fvec(uint_t length)
fvec_t buffer creation function
del_fvec
void del_fvec(fvec_t *s)
fvec_t buffer deletion function
fvec_print
void fvec_print(const fvec_t *s)
print out fvec data
fvec_t
Buffer for real data.
Definition fvec.h:67
uint_t
unsigned int uint_t
unsigned integer
Definition types.h:60