Added all the F4 libraries to the project
[fw/stlink] / exampleF4 / CMSIS / DSP_Lib / Source / FilteringFunctions / arm_iir_lattice_init_q31.c
1 /*-----------------------------------------------------------------------------   
2 * Copyright (C) 2010 ARM Limited. All rights reserved.   
3 *   
4 * $Date:        15. July 2011  
5 * $Revision:    V1.0.10  
6 *   
7 * Project:          CMSIS DSP Library   
8 * Title:        arm_iir_lattice_init_q31.c   
9 *   
10 * Description:  Initialization function for the Q31 IIR lattice filter.   
11 *   
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 *  
14 * Version 1.0.10 2011/7/15 
15 *    Big Endian support added and Merged M0 and M3/M4 Source code.  
16 *   
17 * Version 1.0.3 2010/11/29  
18 *    Re-organized the CMSIS folders and updated documentation.   
19 *    
20 * Version 1.0.2 2010/11/11   
21 *    Documentation updated.    
22 *   
23 * Version 1.0.1 2010/10/05    
24 *    Production release and review comments incorporated.   
25 *   
26 * Version 1.0.0 2010/09/20    
27 *    Production release and review comments incorporated   
28 *   
29 * Version 0.0.7  2010/06/10    
30 *    Misra-C changes done   
31 * ---------------------------------------------------------------------------*/
32
33 #include "arm_math.h"
34
35 /**   
36  * @ingroup groupFilters   
37  */
38
39 /**   
40  * @addtogroup IIR_Lattice   
41  * @{   
42  */
43
44   /**   
45    * @brief Initialization function for the Q31 IIR lattice filter.   
46    * @param[in] *S points to an instance of the Q31 IIR lattice structure.   
47    * @param[in] numStages number of stages in the filter.   
48    * @param[in] *pkCoeffs points to the reflection coefficient buffer.  The array is of length numStages.   
49    * @param[in] *pvCoeffs points to the ladder coefficient buffer.  The array is of length numStages+1.   
50    * @param[in] *pState points to the state buffer.  The array is of length numStages+blockSize.   
51    * @param[in] blockSize number of samples to process.   
52    * @return none.   
53    */
54
55 void arm_iir_lattice_init_q31(
56   arm_iir_lattice_instance_q31 * S,
57   uint16_t numStages,
58   q31_t * pkCoeffs,
59   q31_t * pvCoeffs,
60   q31_t * pState,
61   uint32_t blockSize)
62 {
63   /* Assign filter taps */
64   S->numStages = numStages;
65
66   /* Assign reflection coefficient pointer */
67   S->pkCoeffs = pkCoeffs;
68
69   /* Assign ladder coefficient pointer */
70   S->pvCoeffs = pvCoeffs;
71
72   /* Clear state buffer and size is always blockSize + numStages */
73   memset(pState, 0, (numStages + blockSize) * sizeof(q31_t));
74
75   /* Assign state pointer */
76   S->pState = pState;
77
78
79 }
80
81 /**   
82  * @} end of IIR_Lattice group   
83  */