CMSIS-DSP
Verison 1.1.0
CMSIS DSP Software Library
|
Functions | |
void | arm_fir_sparse_f32 (arm_fir_sparse_instance_f32 *S, float32_t *pSrc, float32_t *pDst, float32_t *pScratchIn, uint32_t blockSize) |
Processing function for the floating-point sparse FIR filter. | |
void | arm_fir_sparse_init_f32 (arm_fir_sparse_instance_f32 *S, uint16_t numTaps, float32_t *pCoeffs, float32_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize) |
Initialization function for the floating-point sparse FIR filter. | |
void | arm_fir_sparse_init_q15 (arm_fir_sparse_instance_q15 *S, uint16_t numTaps, q15_t *pCoeffs, q15_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize) |
Initialization function for the Q15 sparse FIR filter. | |
void | arm_fir_sparse_init_q31 (arm_fir_sparse_instance_q31 *S, uint16_t numTaps, q31_t *pCoeffs, q31_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize) |
Initialization function for the Q31 sparse FIR filter. | |
void | arm_fir_sparse_init_q7 (arm_fir_sparse_instance_q7 *S, uint16_t numTaps, q7_t *pCoeffs, q7_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize) |
Initialization function for the Q7 sparse FIR filter. | |
void | arm_fir_sparse_q15 (arm_fir_sparse_instance_q15 *S, q15_t *pSrc, q15_t *pDst, q15_t *pScratchIn, q31_t *pScratchOut, uint32_t blockSize) |
Processing function for the Q15 sparse FIR filter. | |
void | arm_fir_sparse_q31 (arm_fir_sparse_instance_q31 *S, q31_t *pSrc, q31_t *pDst, q31_t *pScratchIn, uint32_t blockSize) |
Processing function for the Q31 sparse FIR filter. | |
void | arm_fir_sparse_q7 (arm_fir_sparse_instance_q7 *S, q7_t *pSrc, q7_t *pDst, q7_t *pScratchIn, q31_t *pScratchOut, uint32_t blockSize) |
Processing function for the Q7 sparse FIR filter. |
This group of functions implements sparse FIR filters. Sparse FIR filters are equivalent to standard FIR filters except that most of the coefficients are equal to zero. Sparse filters are used for simulating reflections in communications and audio applications.
There are separate functions for Q7, Q15, Q31, and floating-point data types. The functions operate on blocks of input and output data and each call to the function processes blockSize
samples through the filter. pSrc
and pDst
points to input and output arrays respectively containing blockSize
values.
pTapDelay
which specifies the locations of the non-zero coefficients. This is in addition to the coefficient array b
. The implementation essentially skips the multiplications by zero and leads to an efficient realization. y[n] = b[0] * x[n-pTapDelay[0]] + b[1] * x[n-pTapDelay[1]] + b[2] * x[n-pTapDelay[2]] + ...+ b[numTaps-1] * x[n-pTapDelay[numTaps-1]]
pCoeffs
points to a coefficient array of size numTaps
; pTapDelay
points to an array of nonzero indices and is also of size numTaps
; pState
points to a state array of size maxDelay + blockSize
, where maxDelay
is the largest offset value that is ever used in the pTapDelay
array. Some of the processing functions also require temporary working buffers.arm_fir_sparse_instance_f32 S = {numTaps, 0, pState, pCoeffs, maxDelay, pTapDelay}; arm_fir_sparse_instance_q31 S = {numTaps, 0, pState, pCoeffs, maxDelay, pTapDelay}; arm_fir_sparse_instance_q15 S = {numTaps, 0, pState, pCoeffs, maxDelay, pTapDelay}; arm_fir_sparse_instance_q7 S = {numTaps, 0, pState, pCoeffs, maxDelay, pTapDelay};
void arm_fir_sparse_f32 | ( | arm_fir_sparse_instance_f32 * | S, |
float32_t * | pSrc, | ||
float32_t * | pDst, | ||
float32_t * | pScratchIn, | ||
uint32_t | blockSize | ||
) |
[in] | *S | points to an instance of the floating-point sparse FIR structure. |
[in] | *pSrc | points to the block of input data. |
[out] | *pDst | points to the block of output data |
[in] | *pScratchIn | points to a temporary buffer of size blockSize. |
[in] | blockSize | number of input samples to process per call. |
References arm_circularRead_f32(), arm_circularWrite_f32(), blockSize, arm_fir_sparse_instance_f32::maxDelay, arm_fir_sparse_instance_f32::numTaps, arm_fir_sparse_instance_f32::pCoeffs, arm_fir_sparse_instance_f32::pState, arm_fir_sparse_instance_f32::pTapDelay, and arm_fir_sparse_instance_f32::stateIndex.
void arm_fir_sparse_init_f32 | ( | arm_fir_sparse_instance_f32 * | S, |
uint16_t | numTaps, | ||
float32_t * | pCoeffs, | ||
float32_t * | pState, | ||
int32_t * | pTapDelay, | ||
uint16_t | maxDelay, | ||
uint32_t | blockSize | ||
) |
[in,out] | *S | points to an instance of the floating-point sparse FIR structure. |
[in] | numTaps | number of nonzero coefficients in the filter. |
[in] | *pCoeffs | points to the array of filter coefficients. |
[in] | *pState | points to the state buffer. |
[in] | *pTapDelay | points to the array of offset times. |
[in] | maxDelay | maximum offset time supported. |
[in] | blockSize | number of samples that will be processed per block. |
Description:
pCoeffs
holds the filter coefficients and has length numTaps
. pState
holds the filter's state variables and must be of length maxDelay + blockSize
, where maxDelay
is the maximum number of delay line values. blockSize
is the number of samples processed by the arm_fir_sparse_f32()
function. References arm_fir_sparse_instance_f32::maxDelay, arm_fir_sparse_instance_f32::numTaps, arm_fir_sparse_instance_f32::pCoeffs, arm_fir_sparse_instance_f32::pState, arm_fir_sparse_instance_f32::pTapDelay, and arm_fir_sparse_instance_f32::stateIndex.
void arm_fir_sparse_init_q15 | ( | arm_fir_sparse_instance_q15 * | S, |
uint16_t | numTaps, | ||
q15_t * | pCoeffs, | ||
q15_t * | pState, | ||
int32_t * | pTapDelay, | ||
uint16_t | maxDelay, | ||
uint32_t | blockSize | ||
) |
[in,out] | *S | points to an instance of the Q15 sparse FIR structure. |
[in] | numTaps | number of nonzero coefficients in the filter. |
[in] | *pCoeffs | points to the array of filter coefficients. |
[in] | *pState | points to the state buffer. |
[in] | *pTapDelay | points to the array of offset times. |
[in] | maxDelay | maximum offset time supported. |
[in] | blockSize | number of samples that will be processed per block. |
Description:
pCoeffs
holds the filter coefficients and has length numTaps
. pState
holds the filter's state variables and must be of length maxDelay + blockSize
, where maxDelay
is the maximum number of delay line values. blockSize
is the number of words processed by arm_fir_sparse_q15()
function. References arm_fir_sparse_instance_q15::maxDelay, arm_fir_sparse_instance_q15::numTaps, arm_fir_sparse_instance_q15::pCoeffs, arm_fir_sparse_instance_q15::pState, arm_fir_sparse_instance_q15::pTapDelay, and arm_fir_sparse_instance_q15::stateIndex.
void arm_fir_sparse_init_q31 | ( | arm_fir_sparse_instance_q31 * | S, |
uint16_t | numTaps, | ||
q31_t * | pCoeffs, | ||
q31_t * | pState, | ||
int32_t * | pTapDelay, | ||
uint16_t | maxDelay, | ||
uint32_t | blockSize | ||
) |
[in,out] | *S | points to an instance of the Q31 sparse FIR structure. |
[in] | numTaps | number of nonzero coefficients in the filter. |
[in] | *pCoeffs | points to the array of filter coefficients. |
[in] | *pState | points to the state buffer. |
[in] | *pTapDelay | points to the array of offset times. |
[in] | maxDelay | maximum offset time supported. |
[in] | blockSize | number of samples that will be processed per block. |
Description:
pCoeffs
holds the filter coefficients and has length numTaps
. pState
holds the filter's state variables and must be of length maxDelay + blockSize
, where maxDelay
is the maximum number of delay line values. blockSize
is the number of words processed by arm_fir_sparse_q31()
function. References arm_fir_sparse_instance_q31::maxDelay, arm_fir_sparse_instance_q31::numTaps, arm_fir_sparse_instance_q31::pCoeffs, arm_fir_sparse_instance_q31::pState, arm_fir_sparse_instance_q31::pTapDelay, and arm_fir_sparse_instance_q31::stateIndex.
void arm_fir_sparse_init_q7 | ( | arm_fir_sparse_instance_q7 * | S, |
uint16_t | numTaps, | ||
q7_t * | pCoeffs, | ||
q7_t * | pState, | ||
int32_t * | pTapDelay, | ||
uint16_t | maxDelay, | ||
uint32_t | blockSize | ||
) |
[in,out] | *S | points to an instance of the Q7 sparse FIR structure. |
[in] | numTaps | number of nonzero coefficients in the filter. |
[in] | *pCoeffs | points to the array of filter coefficients. |
[in] | *pState | points to the state buffer. |
[in] | *pTapDelay | points to the array of offset times. |
[in] | maxDelay | maximum offset time supported. |
[in] | blockSize | number of samples that will be processed per block. |
Description:
pCoeffs
holds the filter coefficients and has length numTaps
. pState
holds the filter's state variables and must be of length maxDelay + blockSize
, where maxDelay
is the maximum number of delay line values. blockSize
is the number of samples processed by the arm_fir_sparse_q7()
function. References arm_fir_sparse_instance_q7::maxDelay, arm_fir_sparse_instance_q7::numTaps, arm_fir_sparse_instance_q7::pCoeffs, arm_fir_sparse_instance_q7::pState, arm_fir_sparse_instance_q7::pTapDelay, and arm_fir_sparse_instance_q7::stateIndex.
void arm_fir_sparse_q15 | ( | arm_fir_sparse_instance_q15 * | S, |
q15_t * | pSrc, | ||
q15_t * | pDst, | ||
q15_t * | pScratchIn, | ||
q31_t * | pScratchOut, | ||
uint32_t | blockSize | ||
) |
[in] | *S | points to an instance of the Q15 sparse FIR structure. |
[in] | *pSrc | points to the block of input data. |
[out] | *pDst | points to the block of output data |
[in] | *pScratchIn | points to a temporary buffer of size blockSize. |
[in] | *pScratchOut | points to a temporary buffer of size blockSize. |
[in] | blockSize | number of input samples to process per call. |
Scaling and Overflow Behavior:
References __SIMD32, arm_circularRead_q15(), arm_circularWrite_q15(), blockSize, arm_fir_sparse_instance_q15::maxDelay, arm_fir_sparse_instance_q15::numTaps, arm_fir_sparse_instance_q15::pCoeffs, arm_fir_sparse_instance_q15::pState, arm_fir_sparse_instance_q15::pTapDelay, and arm_fir_sparse_instance_q15::stateIndex.
void arm_fir_sparse_q31 | ( | arm_fir_sparse_instance_q31 * | S, |
q31_t * | pSrc, | ||
q31_t * | pDst, | ||
q31_t * | pScratchIn, | ||
uint32_t | blockSize | ||
) |
[in] | *S | points to an instance of the Q31 sparse FIR structure. |
[in] | *pSrc | points to the block of input data. |
[out] | *pDst | points to the block of output data |
[in] | *pScratchIn | points to a temporary buffer of size blockSize. |
[in] | blockSize | number of input samples to process per call. |
Scaling and Overflow Behavior:
References arm_circularRead_f32(), arm_circularWrite_f32(), blockSize, arm_fir_sparse_instance_q31::maxDelay, arm_fir_sparse_instance_q31::numTaps, arm_fir_sparse_instance_q31::pCoeffs, arm_fir_sparse_instance_q31::pState, arm_fir_sparse_instance_q31::pTapDelay, and arm_fir_sparse_instance_q31::stateIndex.
void arm_fir_sparse_q7 | ( | arm_fir_sparse_instance_q7 * | S, |
q7_t * | pSrc, | ||
q7_t * | pDst, | ||
q7_t * | pScratchIn, | ||
q31_t * | pScratchOut, | ||
uint32_t | blockSize | ||
) |
[in] | *S | points to an instance of the Q7 sparse FIR structure. |
[in] | *pSrc | points to the block of input data. |
[out] | *pDst | points to the block of output data |
[in] | *pScratchIn | points to a temporary buffer of size blockSize. |
[in] | *pScratchOut | points to a temporary buffer of size blockSize. |
[in] | blockSize | number of input samples to process per call. |
Scaling and Overflow Behavior:
References __PACKq7, __SIMD32, arm_circularRead_q7(), arm_circularWrite_q7(), blockSize, arm_fir_sparse_instance_q7::maxDelay, arm_fir_sparse_instance_q7::numTaps, arm_fir_sparse_instance_q7::pCoeffs, arm_fir_sparse_instance_q7::pState, arm_fir_sparse_instance_q7::pTapDelay, and arm_fir_sparse_instance_q7::stateIndex.