XCORE SDK
XCORE Software Development Kit
|
Functions | |
void | xs3_filter_fir_s32_init (xs3_filter_fir_s32_t *filter, int32_t *sample_buffer, const unsigned tap_count, const int32_t *coefficients, const right_shift_t shift) |
Initialize a 32-bit FIR filter. More... | |
void | xs3_filter_fir_s32_add_sample (xs3_filter_fir_s32_t *filter, const int32_t new_sample) |
Add a new input sample to a 32-bit FIR filter without processing an output sample. More... | |
int32_t | xs3_filter_fir_s32 (xs3_filter_fir_s32_t *filter, const int32_t new_sample) |
void | xs3_filter_fir_s16_init (xs3_filter_fir_s16_t *filter, int16_t *sample_buffer, const unsigned tap_count, const int16_t *coefficients, const right_shift_t shift) |
Initialize a 16-bit FIR filter. More... | |
void | xs3_filter_fir_s16_add_sample (xs3_filter_fir_s16_t *filter, const int16_t new_sample) |
Add a new input sample to a 16-bit FIR filter without processing an output sample. More... | |
int16_t | xs3_filter_fir_s16 (xs3_filter_fir_s16_t *filter, const int16_t new_sample) |
int32_t | xs3_filter_biquad_s32 (xs3_biquad_filter_s32_t *filter, const int32_t new_sample) |
int32_t | xs3_filter_biquads_s32 (xs3_biquad_filter_s32_t biquads[], const unsigned block_count, const int32_t new_sample) |
int32_t xs3_filter_biquad_s32 | ( | xs3_biquad_filter_s32_t * | filter, |
const int32_t | new_sample | ||
) |
This function implements a 32-bit Biquad filter.
The new input sample new_sample
is added to this filter's state, and a new output sample is computed and returned as specified in xs3_biquad_filter_s32_t
.
This function processes a single filter block containing (up to) 8 biquad filter sections. For biquad filters containing 2 or more filter blocks (more than 8 biquad filter sections), see xs3_filter_biquads_s32().
[in,out] | filter | Filter to be processed |
[in] | new_sample | New input sample to be processed by filter |
int32_t xs3_filter_biquads_s32 | ( | xs3_biquad_filter_s32_t | biquads[], |
const unsigned | block_count, | ||
const int32_t | new_sample | ||
) |
This function implements a 32-bit Biquad filter.
The new input sample new_sample
is added to this filter's state, and a new output sample is computed and returned as specified in xs3_biquad_filter_s32_t
.
This function processes one or more filter blocks, with each block containing up to 8 biquad filter sections.
[in,out] | biquads | Filter blocks to be processed |
[in] | block_count | Number of filter blocks in biquads |
[in] | new_sample | New input sample to be processed by filter |
int16_t xs3_filter_fir_s16 | ( | xs3_filter_fir_s16_t * | filter, |
const int16_t | new_sample | ||
) |
This function implements a Finite Impulse Response (FIR) filter.
The new input sample new_sample
is added to this filter's state, and a new output sample is computed and returned as specified in xs3_filter_fir_s16_t
.
With a large number of filter taps, this function takes approximately 3 thread cycles per 16 filter taps.
[in,out] | filter | Filter to be processed |
[in] | new_sample | New input sample to be processed by filter |
void xs3_filter_fir_s16_add_sample | ( | xs3_filter_fir_s16_t * | filter, |
const int16_t | new_sample | ||
) |
Add a new input sample to a 16-bit FIR filter without processing an output sample.
This function adds a new input sample to filter
's state without computing a new output sample.
See xs3_filter_fir_s16_t
for more information about FIR filters and their operation.
[in,out] | filter | Filter struct to have the sample added |
[in] | new_sample | Sample to be added to filter 's history |
void xs3_filter_fir_s16_init | ( | xs3_filter_fir_s16_t * | filter, |
int16_t * | sample_buffer, | ||
const unsigned | tap_count, | ||
const int16_t * | coefficients, | ||
const right_shift_t | shift | ||
) |
Initialize a 16-bit FIR filter.
Before xs3_filter_fir_s16() or xs3_filter_fir_s16_add_sample() can be used on a filter it must be initialized with a call to this function.
sample_buffer
and coefficients
must be at least 2 * tap_count
bytes long, and aligned to a 4-byte (word) boundary.
See xs3_filter_fir_s16_t
for more information about 16-bit FIR filters and their operation.
[out] | filter | Filter struct to be initialized |
[in] | sample_buffer | Buffer used by the filter to contain state information. Must be at least tap_count elements long |
[in] | tap_count | Order of the FIR filter; number of filter taps |
[in] | coefficients | Array containing filter coefficients |
[in] | shift | Unsigned arithmetic right-shift applied to accumulator to get filter output sample |
int32_t xs3_filter_fir_s32 | ( | xs3_filter_fir_s32_t * | filter, |
const int32_t | new_sample | ||
) |
This function implements a Finite Impulse Response (FIR) filter.
The new input sample new_sample
is added to this filter's state, and a new output sample is computed and returned as specified in xs3_filter_fir_s32_t
.
With a large number of filter taps, this function takes approximately 3 thread cycles per 8 filter taps.
[in,out] | filter | Filter to be processed |
[in] | new_sample | New input sample to be processed by filter |
void xs3_filter_fir_s32_add_sample | ( | xs3_filter_fir_s32_t * | filter, |
const int32_t | new_sample | ||
) |
Add a new input sample to a 32-bit FIR filter without processing an output sample.
This function adds a new input sample to filter
's state without computing a new output sample. This is a constant- time operation and can be used to quickly pre-load a filter with sample data.
See xs3_filter_fir_s32_t
for more information about FIR filters and their operation.
[in,out] | filter | Filter struct to have the sample added |
[in] | new_sample | Sample to be added to filter 's history |
void xs3_filter_fir_s32_init | ( | xs3_filter_fir_s32_t * | filter, |
int32_t * | sample_buffer, | ||
const unsigned | tap_count, | ||
const int32_t * | coefficients, | ||
const right_shift_t | shift | ||
) |
Initialize a 32-bit FIR filter.
Before xs3_filter_fir_s32() or xs3_filter_fir_s32_add_sample() can be used on a filter it must be initialized with a call to this function.
sample_buffer
and coefficients
must be at least 4 * tap_count
bytes long, and aligned to a 4-byte (word) boundary.
See xs3_filter_fir_s32_t
for more information about 32-bit FIR filters and their operation.
[out] | filter | Filter struct to be initialized |
[in] | sample_buffer | Buffer used by the filter to contain state information. Must be at least tap_count elements long |
[in] | tap_count | Order of the FIR filter; number of filter taps |
[in] | coefficients | Array containing filter coefficients. |
[in] | shift | Unsigned arithmetic right-shift applied to accumulator to get filter output sample |