1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010 ARM Limited. All rights reserved.
7 * Project: CMSIS DSP Library
8 * Title: arm_fir_sparse_init_q31.c
10 * Description: Q31 sparse FIR filter initialization function.
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 * Version 1.0.10 2011/7/15
15 * Big Endian support added and Merged M0 and M3/M4 Source code.
17 * Version 1.0.3 2010/11/29
18 * Re-organized the CMSIS folders and updated documentation.
20 * Version 1.0.2 2010/11/11
21 * Documentation updated.
23 * Version 1.0.1 2010/10/05
24 * Production release and review comments incorporated.
26 * Version 1.0.0 2010/09/20
27 * Production release and review comments incorporated
29 * Version 0.0.7 2010/06/10
30 * Misra-C changes done
31 * ---------------------------------------------------------------------------*/
36 * @ingroup groupFilters
40 * @addtogroup FIR_Sparse
45 * @brief Initialization function for the Q31 sparse FIR filter.
46 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
47 * @param[in] numTaps number of nonzero coefficients in the filter.
48 * @param[in] *pCoeffs points to the array of filter coefficients.
49 * @param[in] *pState points to the state buffer.
50 * @param[in] *pTapDelay points to the array of offset times.
51 * @param[in] maxDelay maximum offset time supported.
52 * @param[in] blockSize number of samples that will be processed per block.
57 * <code>pCoeffs</code> holds the filter coefficients and has length <code>numTaps</code>.
58 * <code>pState</code> holds the filter's state variables and must be of length
59 * <code>maxDelay + blockSize</code>, where <code>maxDelay</code>
60 * is the maximum number of delay line values.
61 * <code>blockSize</code> is the number of words processed by <code>arm_fir_sparse_q31()</code> function.
64 void arm_fir_sparse_init_q31(
65 arm_fir_sparse_instance_q31 * S,
73 /* Assign filter taps */
76 /* Assign coefficient pointer */
79 /* Assign TapDelay pointer */
80 S->pTapDelay = pTapDelay;
83 S->maxDelay = maxDelay;
85 /* reset the stateIndex to 0 */
88 /* Clear state buffer and size is always maxDelay + blockSize */
89 memset(pState, 0, (maxDelay + blockSize) * sizeof(q31_t));
91 /* Assign state pointer */
97 * @} end of FIR_Sparse group