![]() |
LIBDSP Version 4.1.9
LIBDSP Software Library
|

Functions | |
| void | tpt_fir_fast_q15 (q15_t *aOutData, const tpt_fir_q15_t *aFilter, const q15_t *aInData, uint32_t aCount) |
| Processing function for the Q15 FIR filter.(fast version). | |
| void | tpt_fir_q15 (q15_t *aOutData, const tpt_fir_q15_t *aFilter, const q15_t *aInData, uint32_t aCount) |
| Processing function for the Q15 FIR filter. | |
| void | tpt_fir_q7 (q7_t *aOutData, const tpt_fir_q7_t *aFilter, const q7_t *aInData, uint32_t aCount) |
| Processing function for the Q7 FIR filter. | |
| void | tpt_fir_f32 (f32_t *aOutData, const tpt_fir_f32_t *aFilter, const f32_t *aInData, uint32_t aCount) |
| Processing function for floating-point FIR filter. | |
| void | tpt_fir_f64 (f64_t *pDst, const tpt_fir_f64_t *S, const f64_t *pSrc, uint32_t blockSize) |
| Processing function for floating-point FIR filter. | |
| void | tpt_fir_fast_q31 (q31_t *aOutData, const tpt_fir_q31_t *aFilter, const q31_t *aInData, uint32_t aCount) |
| Processing function for Q31 FIR filter.(fast version). | |
| void | tpt_fir_init_f32 (tpt_fir_f32_t *aFilter, uint16_t aTaps, const f32_t *aCoeffs, f32_t *aState, uint32_t aCount) |
| Initialization function for the floating-point FIR filter. | |
| void | tpt_fir_init_f64 (tpt_fir_f64_t *S, uint16_t numTaps, const f64_t *pCoeffs, f64_t *pState, uint32_t blockSize) |
| Initialization function for the floating-point FIR filter. | |
| void | tpt_fir_init_q15 (tpt_fir_q15_t *aFilter, uint16_t aTaps, const q15_t *aCoeffs, q15_t *aState, uint32_t aCount) |
| Initialization function for the Q15 FIR filter. | |
| void | tpt_fir_init_q31 (tpt_fir_q31_t *aFilter, uint16_t aTaps, const q31_t *aCoeffs, q31_t *aState, uint32_t aCount) |
| Initialization function for the Q31 FIR filter. | |
| void | tpt_fir_init_q7 (tpt_fir_q7_t *aFilter, uint16_t aTaps, const q7_t *aCoeffs, q7_t *aState, uint32_t aCount) |
| Initialization function for the Q7 FIR filter. | |
| void | tpt_fir_q31 (q31_t *aOutData, const tpt_fir_q31_t *aFilter, const q31_t *aInData, uint32_t aCount) |
| Processing function for Q31 FIR filter. | |
This set of functions implements Finite Impulse Response (FIR) filters 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 aCount samples through the filter. aInData and aOutData points to input and output arrays containing aCount values.
b[n] is multiplied by a state variable which equals a previous input sample x[n] at any time point n:
y[n] = b[0] * x[n] + b[1] * x[n - 1] + b[2] * x[n - 2] + ...
+ b[uTaps - 1] * x[n - uTaps + 1]
pCoeffs points to a coefficient array of size uTaps. Coefficients are stored in time reversed order:
{ b[uTaps - 1], b[uTaps - 2], ..., b[1], b[0] }
pState points to a state array of size uTaps + aCount - 1. Samples in the state buffer are stored in the time order at time point n:
{ x[n - uTaps + 1], x[n - uTaps], x[n - uTaps - 1], ...,
x[n] = aInData[0], ..., x[n + aCount - 1] = aInData[aCount - 1] }
aCount - 1. The increased state buffer length allows circular addressing, which is traditionally used in the FIR filters, to be avoided and yields a significant speed improvement. The state variables are updated after each block of data is processed; the coefficients are untouched.
tpt_fir_f32_t aFilter1 = { aTaps, aState, aCoeffs };
tpt_fir_q31_t aFilter2 = { aTaps, aState, aCoeffs };
tpt_fir_q15_t aFilter3 = { aTaps, aState, aCoeffs };
tpt_fir_q7_t aFilter4 = { aTaps, aState, aCoeffs };
where aTaps is the number of filter coefficients in the filter; aState is the address of the state buffer; aCoeffs is the address of the coefficient buffer. | void tpt_fir_f32 | ( | f32_t * | aOutData, |
| const tpt_fir_f32_t * | aFilter, | ||
| const f32_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for floating-point FIR filter.
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the floating-point FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |
| void tpt_fir_f64 | ( | f64_t * | pDst, |
| const tpt_fir_f64_t * | S, | ||
| const f64_t * | pSrc, | ||
| uint32_t | blockSize ) |
Processing function for floating-point FIR filter.
Processing function for floating-point FIR decimator.
| [out] | pDst | points to the block of output data. |
| [in] | S | points to an instance of the floating-point FIR filter structure. |
| [in] | pSrc | points to the block of input data. |
| [in] | blockSize | number of samples to process |
| void tpt_fir_fast_q15 | ( | q15_t * | aOutData, |
| const tpt_fir_q15_t * | aFilter, | ||
| const q15_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for the Q15 FIR filter.(fast version).
Processing function for the Q15 FIR filter.
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the Q15 FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |
| void tpt_fir_fast_q31 | ( | q31_t * | aOutData, |
| const tpt_fir_q31_t * | aFilter, | ||
| const q31_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for Q31 FIR filter.(fast version).
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the Q31 FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |
| void tpt_fir_init_f32 | ( | tpt_fir_f32_t * | aFilter, |
| uint16_t | aTaps, | ||
| const f32_t * | aCoeffs, | ||
| f32_t * | aState, | ||
| uint32_t | aCount ) |
Initialization function for the floating-point FIR filter.
| [in,out] | aFilter | points to an instance of the floating-point FIR filter structure. |
| [in] | aTaps | number of filter coefficients in the filter |
| [in] | aCoeffs | points to the filter coefficients buffer. |
| [in] | aState | points to the state buffer. |
| [in] | aCount | number of samples processed per call |
aCoeffs points to the array of filter coefficients stored in time reversed order:
{ b[aTaps - 1], b[aTaps - 2], ..., b[1], b[0] }
aState points to the array of state variables. aState is of length aTaps + aCount - 1 where aCount is the number of input samples processed by each call to tpt_fir_q15(). Samples in the state buffer are stored in time order at time point n:
{ x[n - aTaps + 1], x[n - aTaps + 2], ..., x[n - 1], x[n] = aInData[0],
x[n + 1] = aInData[1], ..., x[n + aCount - 1] = aInData[aCount - 1] }
| void tpt_fir_init_f64 | ( | tpt_fir_f64_t * | S, |
| uint16_t | numTaps, | ||
| const f64_t * | pCoeffs, | ||
| f64_t * | pState, | ||
| uint32_t | blockSize ) |
Initialization function for the floating-point FIR filter.
Processing function for floating-point FIR decimator.
| [in,out] | S | points to an instance of the floating-point FIR filter structure |
| [in] | numTaps | number of filter coefficients in the filter |
| [in] | pCoeffs | points to the filter coefficients buffer |
| [in] | pState | points to the state buffer |
| [in] | blockSize | number of samples processed per call |
pCoeffs points to the array of filter coefficients stored in time reversed order: {b[numTaps-1], b[numTaps-2],
b[N-2], ..., b[1], b[0]}
pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to tpt_fir_f64().| void tpt_fir_init_q15 | ( | tpt_fir_q15_t * | aFilter, |
| uint16_t | aTaps, | ||
| const q15_t * | aCoeffs, | ||
| q15_t * | aState, | ||
| uint32_t | aCount ) |
Initialization function for the Q15 FIR filter.
| [in,out] | aFilter | points to an instance of the Q15 FIR filter structure. |
| [in] | aTaps | number of filter coefficients in the filter |
| [in] | aCoeffs | points to the filter coefficients buffer. |
| [in] | aState | points to the state buffer. |
| [in] | aCount | number of samples processed per call |
aCoeffs points to the array of filter coefficients stored in time reversed order:
{ b[aTaps - 1], b[aTaps - 2], ..., b[1], b[0] }
aState points to the array of state variables. aState is of length aTaps + aCount - 1 where aCount is the number of input samples processed by each call to tpt_fir_q15(). Samples in the state buffer are stored in time order at time point n:
{ x[n - aTaps + 1], x[n - aTaps + 2], ..., x[n - 1], x[n] = aInData[0],
x[n + 1] = aInData[1], ..., x[n + aCount - 1] = aInData[aCount - 1] }
| void tpt_fir_init_q31 | ( | tpt_fir_q31_t * | aFilter, |
| uint16_t | aTaps, | ||
| const q31_t * | aCoeffs, | ||
| q31_t * | aState, | ||
| uint32_t | aCount ) |
Initialization function for the Q31 FIR filter.
| [in,out] | aFilter | points to an instance of the Q31 FIR filter structure. |
| [in] | aTaps | number of filter coefficients in the filter |
| [in] | aCoeffs | points to the filter coefficients buffer. |
| [in] | aState | points to the state buffer. |
| [in] | aCount | number of samples processed |
aCoeffs points to the array of filter coefficients stored in time reversed order:
{ b[aTaps - 1], b[aTaps - 2], ..., b[1], b[0] }
aState points to the array of state variables. aState is of length aTaps + aCount - 1 where aCount is the number of input samples processed by each call to tpt_fir_q31(). Samples in the state buffer are stored in time order at time point n:
{ x[n - aTaps + 1], x[n - aTaps + 2], ..., x[n - 1], x[n] = aInData[0],
x[n + 1] = aInData[1], ..., x[n + aCount - 1] = aInData[aCount - 1] }
| void tpt_fir_init_q7 | ( | tpt_fir_q7_t * | aFilter, |
| uint16_t | aTaps, | ||
| const q7_t * | aCoeffs, | ||
| q7_t * | aState, | ||
| uint32_t | aCount ) |
Initialization function for the Q7 FIR filter.
| [in,out] | aFilter | points to an instance of the Q7 FIR filter structure. |
| [in] | aTaps | number of filter coefficients in the filter |
| [in] | aCoeffs | points to the filter coefficients buffer. |
| [in] | aState | points to the state buffer. |
| [in] | aCount | number of samples processed per call |
aCoeffs points to the array of filter coefficients stored in time reversed order:
{ b[aTaps - 1], b[aTaps - 2], ..., b[1], b[0] }
aState points to the array of state variables. aState is of length aTaps + aCount - 1 where aCount is the number of input samples processed by each call to tpt_fir_q15(). Samples in the state buffer are stored in time order at time point n:
{ x[n - aTaps + 1], x[n - aTaps + 2], ..., x[n - 1], x[n] = aInData[0],
x[n + 1] = aInData[1], ..., x[n + aCount - 1] = aInData[aCount - 1] }
| void tpt_fir_q15 | ( | q15_t * | aOutData, |
| const tpt_fir_q15_t * | aFilter, | ||
| const q15_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for the Q15 FIR filter.
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the Q15 FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |
| void tpt_fir_q31 | ( | q31_t * | aOutData, |
| const tpt_fir_q31_t * | aFilter, | ||
| const q31_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for Q31 FIR filter.
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the Q31 FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |
| void tpt_fir_q7 | ( | q7_t * | aOutData, |
| const tpt_fir_q7_t * | aFilter, | ||
| const q7_t * | aInData, | ||
| uint32_t | aCount ) |
Processing function for the Q7 FIR filter.
| [out] | aOutData | points to the block of output data. |
| [in] | aFilter | points to an instance of the Q7 FIR filter structure. |
| [in] | aInData | points to the block of input data. |
| [in] | aCount | number of samples to process |