XCORE SDK
XCORE Software Development Kit
|
Classes | |
struct | dcoe_chan_state_t |
DC Offset Elimination (DCOE) State. More... | |
Functions | |
void | dcoe_state_init (dcoe_chan_state_t state[], const unsigned chan_count) |
Initialize DCOE states. More... | |
void | dcoe_filter (int32_t new_output[], dcoe_chan_state_t state[], int32_t new_input[], const unsigned chan_count) |
Apply DCOE filter. More... | |
void dcoe_filter | ( | int32_t | new_output[], |
dcoe_chan_state_t | state[], | ||
int32_t | new_input[], | ||
const unsigned | chan_count | ||
) |
Apply DCOE filter.
Applies the DC offset elimination filter to get a new output sample and updates the filter state.
For correct behavior, this function should be called once per sample (here "sample" refers to a vector-valued quantity containing one element for each audio channel) of that stream.
The index of each array (state
, new_input
and new_output
) corresponds to the audio channel. The update associated with each audio channel is independent of each other audio channel.
The equation used for each channel is:
where t
is the current sample time index, y[]
is the output signal, x[]
is the input signal, and R
is (255.0/256)
.
To filter a sample in-place use the same array for both the new_input
and new_output
arguments.
[out] | new_output | Array into which the output sample will be placed. |
[in] | state | DC offset elimination state vector. |
[in] | new_input | New input sample. |
[in] | chan_count | Number of channels to be processed. |
void dcoe_state_init | ( | dcoe_chan_state_t | state[], |
const unsigned | chan_count | ||
) |
Initialize DCOE states.
The DC offset elimination state needs to be intialized before the filter can be applied. This function initializes it.
For correct behavior, the state vector state
must persist between audio samples and is supplied with each call to dcoe_filter()
.
[in] | state | Array of dcoe_chan_state_t to be initialized. |
[in] | chan_count | Number of elements in state . |