temporal/filter.h File Reference

Digital filter. More...

Go to the source code of this file.

Typedefs

typedef struct _aubio_filter_t aubio_filter_t
 Digital filter.

Functions

void aubio_filter_do (aubio_filter_t *f, fvec_t *in)
 filter input vector (in-place)
void aubio_filter_do_outplace (aubio_filter_t *f, fvec_t *in, fvec_t *out)
 filter input vector (out-of-place)
void aubio_filter_do_filtfilt (aubio_filter_t *f, fvec_t *in, fvec_t *tmp)
 filter input vector forward and backward
lvec_taubio_filter_get_feedback (aubio_filter_t *f)
 returns a pointer to feedback coefficients $ a_i $
lvec_taubio_filter_get_feedforward (aubio_filter_t *f)
 returns a pointer to feedforward coefficients $ b_i $
uint_t aubio_filter_get_order (aubio_filter_t *f)
 get order of the filter
uint_t aubio_filter_get_samplerate (aubio_filter_t *f)
 get sampling rate of the filter
uint_t aubio_filter_set_samplerate (aubio_filter_t *f, uint_t samplerate)
 get sampling rate of the filter
void aubio_filter_do_reset (aubio_filter_t *f)
 reset filter memory
aubio_filter_tnew_aubio_filter (uint_t order)
 create new filter object
void del_aubio_filter (aubio_filter_t *f)
 delete a filter object


Detailed Description

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 Documentation

typedef struct _aubio_filter_t aubio_filter_t


Function Documentation

void aubio_filter_do ( aubio_filter_t f,
fvec_t in 
)

filter input vector (in-place)

Parameters:
f filter object as returned by new_aubio_filter()
in input vector to filter
Examples:
temporal/test-biquad.c, and temporal/test-filter.c.

void aubio_filter_do_filtfilt ( aubio_filter_t f,
fvec_t in,
fvec_t tmp 
)

filter input vector forward and backward

Parameters:
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
Examples:
temporal/test-biquad.c, and temporal/test-filter.c.

void aubio_filter_do_outplace ( aubio_filter_t f,
fvec_t in,
fvec_t out 
)

filter input vector (out-of-place)

Parameters:
f filter object as returned by new_aubio_filter()
in input vector to filter
out output vector to store filtered input
Examples:
temporal/test-biquad.c, and temporal/test-filter.c.

void aubio_filter_do_reset ( aubio_filter_t f  ) 

reset filter memory

Parameters:
f filter object as returned by new_aubio_filter()

lvec_t* aubio_filter_get_feedback ( aubio_filter_t f  ) 

returns a pointer to feedback coefficients $ a_i $

Parameters:
f filter object to get parameters from
Returns:
a pointer to the $ a_0 ... a_i ... a_P $ coefficients

lvec_t* aubio_filter_get_feedforward ( aubio_filter_t f  ) 

returns a pointer to feedforward coefficients $ b_i $

Parameters:
f filter object to get coefficients from
Returns:
a pointer to the $ b_0 ... b_i ... b_P $ coefficients

uint_t aubio_filter_get_order ( aubio_filter_t f  ) 

get order of the filter

Parameters:
f filter to get order from
Returns:
the order of the filter

uint_t aubio_filter_get_samplerate ( aubio_filter_t f  ) 

get sampling rate of the filter

Parameters:
f filter to get sampling rate from
Returns:
the sampling rate of the filter, in Hz

uint_t aubio_filter_set_samplerate ( aubio_filter_t f,
uint_t  samplerate 
)

get sampling rate of the filter

Parameters:
f filter to get sampling rate from
samplerate sample rate to set the filter to
Returns:
the sampling rate of the filter, in Hz

void del_aubio_filter ( aubio_filter_t f  ) 

delete a filter object

Parameters:
f filter object to delete
Examples:
temporal/test-a_weighting.c, temporal/test-biquad.c, temporal/test-c_weighting.c, and temporal/test-filter.c.

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.

Parameters:
order order of the filter (number of coefficients)
Returns:
the newly created filter object
Examples:
temporal/test-a_weighting.c, and temporal/test-c_weighting.c.


Generated on Mon Jan 16 21:51:31 2017 for aubio by  doxygen 1.5.6