aubio
0.4.9
|
Digital filter. More...
Go to the source code of this file.
Typedefs | |
typedef struct _aubio_filter_t | aubio_filter_t |
Digital filter. More... | |
Functions | |
void | aubio_filter_do (aubio_filter_t *f, fvec_t *in) |
filter input vector (in-place) More... | |
void | aubio_filter_do_outplace (aubio_filter_t *f, const fvec_t *in, fvec_t *out) |
filter input vector (out-of-place) More... | |
void | aubio_filter_do_filtfilt (aubio_filter_t *f, fvec_t *in, fvec_t *tmp) |
filter input vector forward and backward More... | |
lvec_t * | aubio_filter_get_feedback (const aubio_filter_t *f) |
returns a pointer to feedback coefficients \( a_i \) More... | |
lvec_t * | aubio_filter_get_feedforward (const aubio_filter_t *f) |
returns a pointer to feedforward coefficients \( b_i \) More... | |
uint_t | aubio_filter_get_order (const aubio_filter_t *f) |
get order of the filter More... | |
uint_t | aubio_filter_get_samplerate (const aubio_filter_t *f) |
get sampling rate of the filter More... | |
uint_t | aubio_filter_set_samplerate (aubio_filter_t *f, uint_t samplerate) |
get sampling rate of the filter More... | |
void | aubio_filter_do_reset (aubio_filter_t *f) |
reset filter memory More... | |
aubio_filter_t * | new_aubio_filter (uint_t order) |
create new filter object More... | |
void | del_aubio_filter (aubio_filter_t *f) |
delete a filter object More... | |
Digital filter.
This object stores a digital filter of order \(n\). It contains the following data:
For convenience, the samplerate of the input signal is also stored in the object.
Feedforward and feedback parameters can be modified using aubio_filter_get_feedback() and aubio_filter_get_feedforward().
The function aubio_filter_do_outplace() computes the following output signal \( y[n] \) from the input signal \( x[n] \):
\begin{eqnarray*} y[n] = b_0 x[n] & + & b_1 x[n-1] + b_2 x[n-2] + ... + b_P x[n-P] \\ & - & a_1 y[n-1] - a_2 y[n-2] - ... - a_P y[n-P] \\ \end{eqnarray*}
The function aubio_filter_do() executes the same computation but modifies directly the input signal (in-place).
The function aubio_filter_do_filtfilt() version runs the filter twice, first forward then backward, to compensate with the phase shifting of the forward operation.
Some convenience functions are provided:
Definition in file filter.h.
typedef struct _aubio_filter_t aubio_filter_t |
void aubio_filter_do | ( | aubio_filter_t * | f, |
fvec_t * | in | ||
) |
filter input vector (in-place)
f | filter object as returned by new_aubio_filter() |
in | input vector to filter |
void aubio_filter_do_filtfilt | ( | aubio_filter_t * | f, |
fvec_t * | in, | ||
fvec_t * | tmp | ||
) |
filter input vector forward and backward
f | aubio_filter_t object as returned by new_aubio_filter() |
in | fvec_t input vector to filter |
tmp | memory space to use for computation |
void aubio_filter_do_outplace | ( | aubio_filter_t * | f, |
const fvec_t * | in, | ||
fvec_t * | out | ||
) |
filter input vector (out-of-place)
f | filter object as returned by new_aubio_filter() |
in | input vector to filter |
out | output vector to store filtered input |
void aubio_filter_do_reset | ( | aubio_filter_t * | f | ) |
reset filter memory
f | filter object as returned by new_aubio_filter() |
lvec_t* aubio_filter_get_feedback | ( | const aubio_filter_t * | f | ) |
returns a pointer to feedback coefficients \( a_i \)
f | filter object to get parameters from |
lvec_t* aubio_filter_get_feedforward | ( | const aubio_filter_t * | f | ) |
returns a pointer to feedforward coefficients \( b_i \)
f | filter object to get coefficients from |
uint_t aubio_filter_get_order | ( | const aubio_filter_t * | f | ) |
get order of the filter
f | filter to get order from |
uint_t aubio_filter_get_samplerate | ( | const aubio_filter_t * | f | ) |
get sampling rate of the filter
f | filter to get sampling rate from |
uint_t aubio_filter_set_samplerate | ( | aubio_filter_t * | f, |
uint_t | samplerate | ||
) |
get sampling rate of the filter
f | filter to get sampling rate from |
samplerate | sample rate to set the filter to |
void del_aubio_filter | ( | aubio_filter_t * | f | ) |
delete a filter object
f | filter object to delete |
aubio_filter_t* new_aubio_filter | ( | uint_t | order | ) |
create new filter object
This function creates a new aubio_filter_t object, given the order of the filter.
order | order of the filter (number of coefficients) |