annotate f103c8/Drivers/CMSIS/Include/arm_math.h @ 2:0c59e7a7782a

Working on GPIO and RCC
author cin
date Mon, 16 Jan 2017 11:04:47 +0300
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1 /* ----------------------------------------------------------------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4 * $Date: 20. October 2015
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5 * $Revision: V1.4.5 b
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7 * Project: CMSIS DSP Library
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
8 * Title: arm_math.h
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
9 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
10 * Description: Public header file for CMSIS DSP Library
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
11 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
13 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
14 * Redistribution and use in source and binary forms, with or without
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
15 * modification, are permitted provided that the following conditions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
16 * are met:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
17 * - Redistributions of source code must retain the above copyright
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
18 * notice, this list of conditions and the following disclaimer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
19 * - Redistributions in binary form must reproduce the above copyright
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
20 * notice, this list of conditions and the following disclaimer in
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
21 * the documentation and/or other materials provided with the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
22 * distribution.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
23 * - Neither the name of ARM LIMITED nor the names of its contributors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
24 * may be used to endorse or promote products derived from this
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
25 * software without specific prior written permission.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
26 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
38 * POSSIBILITY OF SUCH DAMAGE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
39 * -------------------------------------------------------------------- */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
40
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
41 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
42 \mainpage CMSIS DSP Software Library
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
43 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
44 * Introduction
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
45 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
46 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
47 * This user manual describes the CMSIS DSP software library,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
48 * a suite of common signal processing functions for use on Cortex-M processor based devices.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
49 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
50 * The library is divided into a number of functions each covering a specific category:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
51 * - Basic math functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
52 * - Fast math functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
53 * - Complex math functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
54 * - Filters
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
55 * - Matrix functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
56 * - Transforms
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
57 * - Motor control functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
58 * - Statistical functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
59 * - Support functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
60 * - Interpolation functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
61 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
62 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
63 * 32-bit integer and 32-bit floating-point values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
64 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
65 * Using the Library
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
66 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
67 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
68 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
69 * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
70 * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
71 * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
72 * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
73 * - arm_cortexM7l_math.lib (Little endian on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
74 * - arm_cortexM7b_math.lib (Big endian on Cortex-M7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
75 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
76 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
77 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
78 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
79 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
80 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
81 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
82 * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
83 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
84 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
85 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
86 * public header file <code> arm_math.h</code> for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
87 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
88 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
89 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
90 * Examples
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
91 * --------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
92 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
93 * The library ships with a number of examples which demonstrate how to use the library functions.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
94 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
95 * Toolchain Support
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
96 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
97 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
98 * The library has been developed and tested with MDK-ARM version 5.14.0.0
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
99 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
100 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
101 * Building the Library
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
102 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
103 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
104 * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the <code>CMSIS\\DSP_Lib\\Source\\ARM</code> folder.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
105 * - arm_cortexM_math.uvprojx
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
106 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
107 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
108 * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
109 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
110 * Pre-processor Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
111 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
112 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
113 * Each library project have differant pre-processor macros.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
114 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
115 * - UNALIGNED_SUPPORT_DISABLE:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
116 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
117 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
118 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
119 * - ARM_MATH_BIG_ENDIAN:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
120 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
121 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
122 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
123 * - ARM_MATH_MATRIX_CHECK:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
124 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
125 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
126 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
127 * - ARM_MATH_ROUNDING:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
128 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
129 * Define macro ARM_MATH_ROUNDING for rounding on support functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
130 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
131 * - ARM_MATH_CMx:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
132 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
133 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
134 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
135 * ARM_MATH_CM7 for building the library on cortex-M7.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
136 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
137 * - __FPU_PRESENT:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
138 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
139 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
140 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
141 * <hr>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
142 * CMSIS-DSP in ARM::CMSIS Pack
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
143 * -----------------------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
144 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
145 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
146 * |File/Folder |Content |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
147 * |------------------------------|------------------------------------------------------------------------|
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
148 * |\b CMSIS\\Documentation\\DSP | This documentation |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
149 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
150 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
151 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
152 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
153 * <hr>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
154 * Revision History of CMSIS-DSP
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
155 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
156 * Please refer to \ref ChangeLog_pg.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
157 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
158 * Copyright Notice
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
159 * ------------
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
160 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
161 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
162 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
163
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
164
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
165 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
166 * @defgroup groupMath Basic Math Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
167 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
168
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
169 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
170 * @defgroup groupFastMath Fast Math Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
171 * This set of functions provides a fast approximation to sine, cosine, and square root.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
172 * As compared to most of the other functions in the CMSIS math library, the fast math functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
173 * operate on individual values and not arrays.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
174 * There are separate functions for Q15, Q31, and floating-point data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
175 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
176 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
177
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
178 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
179 * @defgroup groupCmplxMath Complex Math Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
180 * This set of functions operates on complex data vectors.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
181 * The data in the complex arrays is stored in an interleaved fashion
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
182 * (real, imag, real, imag, ...).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
183 * In the API functions, the number of samples in a complex array refers
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
184 * to the number of complex values; the array contains twice this number of
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
185 * real values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
186 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
187
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
188 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
189 * @defgroup groupFilters Filtering Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
190 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
191
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
192 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
193 * @defgroup groupMatrix Matrix Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
194 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
195 * This set of functions provides basic matrix math operations.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
196 * The functions operate on matrix data structures. For example,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
197 * the type
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
198 * definition for the floating-point matrix structure is shown
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
199 * below:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
200 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
201 * typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
202 * {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
203 * uint16_t numRows; // number of rows of the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
204 * uint16_t numCols; // number of columns of the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
205 * float32_t *pData; // points to the data of the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
206 * } arm_matrix_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
207 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
208 * There are similar definitions for Q15 and Q31 data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
209 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
210 * The structure specifies the size of the matrix and then points to
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
211 * an array of data. The array is of size <code>numRows X numCols</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
212 * and the values are arranged in row order. That is, the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
213 * matrix element (i, j) is stored at:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
214 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
215 * pData[i*numCols + j]
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
216 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
217 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
218 * \par Init Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
219 * There is an associated initialization function for each type of matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
220 * data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
221 * The initialization function sets the values of the internal structure fields.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
222 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
223 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
224 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
225 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
226 * Use of the initialization function is optional. However, if initialization function is used
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
227 * then the instance structure cannot be placed into a const data section.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
228 * To place the instance structure in a const data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
229 * section, manually initialize the data structure. For example:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
230 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
231 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
232 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
233 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
234 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
235 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
236 * specifies the number of columns, and <code>pData</code> points to the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
237 * data array.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
238 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
239 * \par Size Checking
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
240 * By default all of the matrix functions perform size checking on the input and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
241 * output matrices. For example, the matrix addition function verifies that the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
242 * two input matrices and the output matrix all have the same number of rows and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
243 * columns. If the size check fails the functions return:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
244 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
245 * ARM_MATH_SIZE_MISMATCH
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
246 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
247 * Otherwise the functions return
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
248 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
249 * ARM_MATH_SUCCESS
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
250 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
251 * There is some overhead associated with this matrix size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
252 * The matrix size checking is enabled via the \#define
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
253 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
254 * ARM_MATH_MATRIX_CHECK
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
255 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
256 * within the library project settings. By default this macro is defined
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
257 * and size checking is enabled. By changing the project settings and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
258 * undefining this macro size checking is eliminated and the functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
259 * run a bit faster. With size checking disabled the functions always
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
260 * return <code>ARM_MATH_SUCCESS</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
261 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
262
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
263 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
264 * @defgroup groupTransforms Transform Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
265 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
266
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
267 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
268 * @defgroup groupController Controller Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
269 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
270
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
271 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
272 * @defgroup groupStats Statistics Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
273 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
274 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
275 * @defgroup groupSupport Support Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
276 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
277
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
278 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
279 * @defgroup groupInterpolation Interpolation Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
280 * These functions perform 1- and 2-dimensional interpolation of data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
281 * Linear interpolation is used for 1-dimensional data and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
282 * bilinear interpolation is used for 2-dimensional data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
283 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
284
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
285 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
286 * @defgroup groupExamples Examples
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
287 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
288 #ifndef _ARM_MATH_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
289 #define _ARM_MATH_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
290
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
291 /* ignore some GCC warnings */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
292 #if defined ( __GNUC__ )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
293 #pragma GCC diagnostic push
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
294 #pragma GCC diagnostic ignored "-Wsign-conversion"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
295 #pragma GCC diagnostic ignored "-Wconversion"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
296 #pragma GCC diagnostic ignored "-Wunused-parameter"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
297 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
298
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
299 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
300
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
301 #if defined(ARM_MATH_CM7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
302 #include "core_cm7.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
303 #elif defined (ARM_MATH_CM4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
304 #include "core_cm4.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
305 #elif defined (ARM_MATH_CM3)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
306 #include "core_cm3.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
307 #elif defined (ARM_MATH_CM0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
308 #include "core_cm0.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
309 #define ARM_MATH_CM0_FAMILY
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
310 #elif defined (ARM_MATH_CM0PLUS)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
311 #include "core_cm0plus.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
312 #define ARM_MATH_CM0_FAMILY
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
313 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
314 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
315 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
316
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
317 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
318 #include "string.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
319 #include "math.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
320 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
321 extern "C"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
322 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
323 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
324
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
325
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
326 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
327 * @brief Macros required for reciprocal calculation in Normalized LMS
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
328 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
329
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
330 #define DELTA_Q31 (0x100)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
331 #define DELTA_Q15 0x5
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
332 #define INDEX_MASK 0x0000003F
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
333 #ifndef PI
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
334 #define PI 3.14159265358979f
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
335 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
336
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
337 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
338 * @brief Macros required for SINE and COSINE Fast math approximations
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
339 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
340
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
341 #define FAST_MATH_TABLE_SIZE 512
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
342 #define FAST_MATH_Q31_SHIFT (32 - 10)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
343 #define FAST_MATH_Q15_SHIFT (16 - 10)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
344 #define CONTROLLER_Q31_SHIFT (32 - 9)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
345 #define TABLE_SIZE 256
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
346 #define TABLE_SPACING_Q31 0x400000
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
347 #define TABLE_SPACING_Q15 0x80
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
348
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
349 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
350 * @brief Macros required for SINE and COSINE Controller functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
351 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
352 /* 1.31(q31) Fixed value of 2/360 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
353 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
354 #define INPUT_SPACING 0xB60B61
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
355
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
356 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
357 * @brief Macro for Unaligned Support
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
358 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
359 #ifndef UNALIGNED_SUPPORT_DISABLE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
360 #define ALIGN4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
361 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
362 #if defined (__GNUC__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
363 #define ALIGN4 __attribute__((aligned(4)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
364 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
365 #define ALIGN4 __align(4)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
366 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
367 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
368
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
369 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
370 * @brief Error status returned by some functions in the library.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
371 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
372
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
373 typedef enum
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
374 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
375 ARM_MATH_SUCCESS = 0, /**< No error */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
376 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
377 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
378 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
379 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
380 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
381 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
382 } arm_status;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
383
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
384 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
385 * @brief 8-bit fractional data type in 1.7 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
386 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
387 typedef int8_t q7_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
388
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
389 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
390 * @brief 16-bit fractional data type in 1.15 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
391 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
392 typedef int16_t q15_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
393
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
394 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
395 * @brief 32-bit fractional data type in 1.31 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
396 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
397 typedef int32_t q31_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
398
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
399 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
400 * @brief 64-bit fractional data type in 1.63 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
401 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
402 typedef int64_t q63_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
403
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
404 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
405 * @brief 32-bit floating-point type definition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
406 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
407 typedef float float32_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
408
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
409 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
410 * @brief 64-bit floating-point type definition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
411 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
412 typedef double float64_t;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
413
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
414 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
415 * @brief definition to read/write two 16 bit values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
416 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
417 #if defined __CC_ARM
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
418 #define __SIMD32_TYPE int32_t __packed
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
419 #define CMSIS_UNUSED __attribute__((unused))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
420
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
421 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
422 #define __SIMD32_TYPE int32_t
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
423 #define CMSIS_UNUSED __attribute__((unused))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
424
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
425 #elif defined __GNUC__
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
426 #define __SIMD32_TYPE int32_t
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
427 #define CMSIS_UNUSED __attribute__((unused))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
428
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
429 #elif defined __ICCARM__
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
430 #define __SIMD32_TYPE int32_t __packed
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
431 #define CMSIS_UNUSED
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
432
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
433 #elif defined __CSMC__
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
434 #define __SIMD32_TYPE int32_t
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
435 #define CMSIS_UNUSED
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
436
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
437 #elif defined __TASKING__
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
438 #define __SIMD32_TYPE __unaligned int32_t
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
439 #define CMSIS_UNUSED
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
440
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
441 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
442 #error Unknown compiler
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
443 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
444
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
445 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
446 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
447 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
448 #define __SIMD64(addr) (*(int64_t **) & (addr))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
449
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
450 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
451 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
452 * @brief definition to pack two 16 bit values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
453 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
454 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
455 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
456 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
457 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
458
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
459 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
460
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
461
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
462 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
463 * @brief definition to pack four 8 bit values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
464 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
465 #ifndef ARM_MATH_BIG_ENDIAN
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
466
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
467 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
468 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
469 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
470 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
471 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
472
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
473 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
474 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
475 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
476 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
477
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
478 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
479
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
480
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
481 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
482 * @brief Clips Q63 to Q31 values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
483 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
484 static __INLINE q31_t clip_q63_to_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
485 q63_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
486 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
487 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
488 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
489 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
490
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
491 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
492 * @brief Clips Q63 to Q15 values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
493 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
494 static __INLINE q15_t clip_q63_to_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
495 q63_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
496 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
497 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
498 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
499 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
500
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
501 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
502 * @brief Clips Q31 to Q7 values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
503 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
504 static __INLINE q7_t clip_q31_to_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
505 q31_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
506 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
507 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
508 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
509 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
510
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
511 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
512 * @brief Clips Q31 to Q15 values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
513 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
514 static __INLINE q15_t clip_q31_to_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
515 q31_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
516 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
517 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
518 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
519 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
520
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
521 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
522 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
523 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
524
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
525 static __INLINE q63_t mult32x64(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
526 q63_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
527 q31_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
528 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
529 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
530 (((q63_t) (x >> 32) * y)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
531 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
532
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
533 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
534 #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
535 #define __CLZ __clz
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
536 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
537 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
538 /* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
539 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
540 static __INLINE uint32_t __CLZ(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
541 q31_t data);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
542
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
543 static __INLINE uint32_t __CLZ(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
544 q31_t data)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
545 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
546 uint32_t count = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
547 uint32_t mask = 0x80000000;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
548
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
549 while((data & mask) == 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
550 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
551 count += 1u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
552 mask = mask >> 1u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
553 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
554
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
555 return (count);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
556 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
557 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
558
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
559 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
560 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
561 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
562
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
563 static __INLINE uint32_t arm_recip_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
564 q31_t in,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
565 q31_t * dst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
566 q31_t * pRecipTable)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
567 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
568 q31_t out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
569 uint32_t tempVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
570 uint32_t index, i;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
571 uint32_t signBits;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
572
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
573 if(in > 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
574 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
575 signBits = ((uint32_t) (__CLZ( in) - 1));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
576 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
577 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
578 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
579 signBits = ((uint32_t) (__CLZ(-in) - 1));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
580 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
581
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
582 /* Convert input sample to 1.31 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
583 in = (in << signBits);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
584
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
585 /* calculation of index for initial approximated Val */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
586 index = (uint32_t)(in >> 24);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
587 index = (index & INDEX_MASK);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
588
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
589 /* 1.31 with exp 1 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
590 out = pRecipTable[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
591
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
592 /* calculation of reciprocal value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
593 /* running approximation for two iterations */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
594 for (i = 0u; i < 2u; i++)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
595 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
596 tempVal = (uint32_t) (((q63_t) in * out) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
597 tempVal = 0x7FFFFFFFu - tempVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
598 /* 1.31 with exp 1 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
599 /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
600 out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
601 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
602
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
603 /* write output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
604 *dst = out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
605
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
606 /* return num of signbits of out = 1/in value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
607 return (signBits + 1u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
608 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
609
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
610
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
611 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
612 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
613 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
614 static __INLINE uint32_t arm_recip_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
615 q15_t in,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
616 q15_t * dst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
617 q15_t * pRecipTable)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
618 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
619 q15_t out = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
620 uint32_t tempVal = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
621 uint32_t index = 0, i = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
622 uint32_t signBits = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
623
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
624 if(in > 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
625 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
626 signBits = ((uint32_t)(__CLZ( in) - 17));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
627 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
628 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
629 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
630 signBits = ((uint32_t)(__CLZ(-in) - 17));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
631 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
632
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
633 /* Convert input sample to 1.15 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
634 in = (in << signBits);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
635
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
636 /* calculation of index for initial approximated Val */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
637 index = (uint32_t)(in >> 8);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
638 index = (index & INDEX_MASK);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
639
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
640 /* 1.15 with exp 1 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
641 out = pRecipTable[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
642
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
643 /* calculation of reciprocal value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
644 /* running approximation for two iterations */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
645 for (i = 0u; i < 2u; i++)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
646 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
647 tempVal = (uint32_t) (((q31_t) in * out) >> 15);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
648 tempVal = 0x7FFFu - tempVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
649 /* 1.15 with exp 1 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
650 out = (q15_t) (((q31_t) out * tempVal) >> 14);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
651 /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
652 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
653
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
654 /* write output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
655 *dst = out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
656
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
657 /* return num of signbits of out = 1/in value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
658 return (signBits + 1);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
659 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
660
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
661
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
662 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
663 * @brief C custom defined intrinisic function for only M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
664 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
665 #if defined(ARM_MATH_CM0_FAMILY)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
666 static __INLINE q31_t __SSAT(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
667 q31_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
668 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
669 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
670 int32_t posMax, negMin;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
671 uint32_t i;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
672
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
673 posMax = 1;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
674 for (i = 0; i < (y - 1); i++)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
675 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
676 posMax = posMax * 2;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
677 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
678
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
679 if(x > 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
680 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
681 posMax = (posMax - 1);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
682
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
683 if(x > posMax)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
684 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
685 x = posMax;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
686 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
687 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
688 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
689 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
690 negMin = -posMax;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
691
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
692 if(x < negMin)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
693 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
694 x = negMin;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
695 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
696 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
697 return (x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
698 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
699 #endif /* end of ARM_MATH_CM0_FAMILY */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
700
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
701
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
702 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
703 * @brief C custom defined intrinsic function for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
704 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
705 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
706
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
707 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
708 * @brief C custom defined QADD8 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
709 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
710 static __INLINE uint32_t __QADD8(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
711 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
712 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
713 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
714 q31_t r, s, t, u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
715
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
716 r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
717 s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
718 t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
719 u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
720
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
721 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
722 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
723
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
724
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
725 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
726 * @brief C custom defined QSUB8 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
727 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
728 static __INLINE uint32_t __QSUB8(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
729 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
730 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
731 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
732 q31_t r, s, t, u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
733
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
734 r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
735 s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
736 t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
737 u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
738
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
739 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
740 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
741
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
742
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
743 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
744 * @brief C custom defined QADD16 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
745 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
746 static __INLINE uint32_t __QADD16(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
747 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
748 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
749 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
750 /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
751 q31_t r = 0, s = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
752
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
753 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
754 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
755
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
756 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
757 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
758
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
759
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
760 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
761 * @brief C custom defined SHADD16 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
762 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
763 static __INLINE uint32_t __SHADD16(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
764 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
765 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
766 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
767 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
768
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
769 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
770 s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
771
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
772 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
773 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
774
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
775
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
776 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
777 * @brief C custom defined QSUB16 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
778 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
779 static __INLINE uint32_t __QSUB16(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
780 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
781 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
782 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
783 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
784
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
785 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
786 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
787
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
788 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
789 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
790
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
791
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
792 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
793 * @brief C custom defined SHSUB16 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
794 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
795 static __INLINE uint32_t __SHSUB16(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
796 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
797 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
798 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
799 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
800
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
801 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
802 s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
803
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
804 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
805 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
806
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
807
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
808 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
809 * @brief C custom defined QASX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
810 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
811 static __INLINE uint32_t __QASX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
812 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
813 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
814 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
815 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
816
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
817 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
818 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
819
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
820 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
821 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
822
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
823
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
824 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
825 * @brief C custom defined SHASX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
826 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
827 static __INLINE uint32_t __SHASX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
828 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
829 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
830 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
831 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
832
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
833 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
834 s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
836 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
837 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
838
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
839
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
840 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
841 * @brief C custom defined QSAX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
842 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
843 static __INLINE uint32_t __QSAX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
844 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
845 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
846 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
847 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
848
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
849 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
850 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
851
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
852 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
853 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
854
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
855
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
856 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
857 * @brief C custom defined SHSAX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
858 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
859 static __INLINE uint32_t __SHSAX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
860 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
861 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
862 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
863 q31_t r, s;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
864
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
865 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
866 s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
867
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
868 return ((uint32_t)((s << 16) | (r )));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
869 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
870
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
871
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
872 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
873 * @brief C custom defined SMUSDX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
874 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
875 static __INLINE uint32_t __SMUSDX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
876 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
877 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
878 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
879 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
880 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
881 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
882
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
883 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
884 * @brief C custom defined SMUADX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
885 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
886 static __INLINE uint32_t __SMUADX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
887 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
888 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
889 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
890 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
891 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
892 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
893
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
894
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
895 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
896 * @brief C custom defined QADD for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
897 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
898 static __INLINE int32_t __QADD(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
899 int32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
900 int32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
901 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
902 return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
903 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
904
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
905
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
906 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
907 * @brief C custom defined QSUB for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
908 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
909 static __INLINE int32_t __QSUB(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
910 int32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
911 int32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
912 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
913 return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
914 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
915
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
916
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
917 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
918 * @brief C custom defined SMLAD for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
919 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
920 static __INLINE uint32_t __SMLAD(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
921 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
922 uint32_t y,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
923 uint32_t sum)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
924 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
925 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
926 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
927 ( ((q31_t)sum ) ) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
928 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
929
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
930
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
931 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
932 * @brief C custom defined SMLADX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
933 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
934 static __INLINE uint32_t __SMLADX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
935 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
936 uint32_t y,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
937 uint32_t sum)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
938 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
939 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
940 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
941 ( ((q31_t)sum ) ) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
942 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
943
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
944
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
945 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
946 * @brief C custom defined SMLSDX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
947 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
948 static __INLINE uint32_t __SMLSDX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
949 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
950 uint32_t y,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
951 uint32_t sum)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
952 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
953 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
954 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
955 ( ((q31_t)sum ) ) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
956 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
957
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
958
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
959 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
960 * @brief C custom defined SMLALD for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
961 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
962 static __INLINE uint64_t __SMLALD(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
963 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
964 uint32_t y,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
965 uint64_t sum)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
966 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
967 /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
968 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
969 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
970 ( ((q63_t)sum ) ) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
971 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
972
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
973
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
974 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
975 * @brief C custom defined SMLALDX for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
976 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
977 static __INLINE uint64_t __SMLALDX(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
978 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
979 uint32_t y,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
980 uint64_t sum)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
981 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
982 /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
983 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
984 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
985 ( ((q63_t)sum ) ) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
986 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
987
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
988
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
989 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
990 * @brief C custom defined SMUAD for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
991 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
992 static __INLINE uint32_t __SMUAD(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
993 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
994 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
995 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
996 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
997 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
998 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
999
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1000
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1001 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1002 * @brief C custom defined SMUSD for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1003 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1004 static __INLINE uint32_t __SMUSD(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1005 uint32_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1006 uint32_t y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1007 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1008 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) -
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1009 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1010 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1012
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1013 /*
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1014 * @brief C custom defined SXTB16 for M3 and M0 processors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1015 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1016 static __INLINE uint32_t __SXTB16(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1017 uint32_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1018 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1019 return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) |
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1020 ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) ));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1021 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1022
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1023 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1024
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1025
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1026 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1027 * @brief Instance structure for the Q7 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1028 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1029 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1030 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1031 uint16_t numTaps; /**< number of filter coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1032 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1033 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1034 } arm_fir_instance_q7;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1035
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1036 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1037 * @brief Instance structure for the Q15 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1038 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1039 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1040 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1041 uint16_t numTaps; /**< number of filter coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1042 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1043 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1044 } arm_fir_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1045
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1046 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1047 * @brief Instance structure for the Q31 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1048 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1049 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1050 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1051 uint16_t numTaps; /**< number of filter coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1052 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1053 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1054 } arm_fir_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1055
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1056 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1057 * @brief Instance structure for the floating-point FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1058 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1059 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1060 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1061 uint16_t numTaps; /**< number of filter coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1062 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1063 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1064 } arm_fir_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1065
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1066
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1067 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1068 * @brief Processing function for the Q7 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1069 * @param[in] S points to an instance of the Q7 FIR filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1070 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1071 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1072 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1073 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1074 void arm_fir_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1075 const arm_fir_instance_q7 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1076 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1077 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1078 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1079
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1080
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1081 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1082 * @brief Initialization function for the Q7 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1083 * @param[in,out] S points to an instance of the Q7 FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1084 * @param[in] numTaps Number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1085 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1086 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1087 * @param[in] blockSize number of samples that are processed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1088 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1089 void arm_fir_init_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1090 arm_fir_instance_q7 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1091 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1092 q7_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1093 q7_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1094 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1095
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1096
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1097 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1098 * @brief Processing function for the Q15 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1099 * @param[in] S points to an instance of the Q15 FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1100 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1101 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1102 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1103 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1104 void arm_fir_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1105 const arm_fir_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1106 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1107 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1108 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1109
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1110
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1111 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1112 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1113 * @param[in] S points to an instance of the Q15 FIR filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1114 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1115 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1116 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1117 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1118 void arm_fir_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1119 const arm_fir_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1120 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1121 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1122 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1123
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1124
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1125 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1126 * @brief Initialization function for the Q15 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1127 * @param[in,out] S points to an instance of the Q15 FIR filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1128 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1129 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1130 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1131 * @param[in] blockSize number of samples that are processed at a time.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1132 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1133 * <code>numTaps</code> is not a supported value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1134 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1135 arm_status arm_fir_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1136 arm_fir_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1137 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1138 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1139 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1140 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1141
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1142
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1143 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1144 * @brief Processing function for the Q31 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1145 * @param[in] S points to an instance of the Q31 FIR filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1146 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1147 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1148 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1149 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1150 void arm_fir_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1151 const arm_fir_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1152 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1153 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1154 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1155
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1156
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1157 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1158 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1159 * @param[in] S points to an instance of the Q31 FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1160 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1161 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1162 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1163 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1164 void arm_fir_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1165 const arm_fir_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1166 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1167 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1168 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1169
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1170
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1171 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1172 * @brief Initialization function for the Q31 FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1173 * @param[in,out] S points to an instance of the Q31 FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1174 * @param[in] numTaps Number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1175 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1176 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1177 * @param[in] blockSize number of samples that are processed at a time.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1178 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1179 void arm_fir_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1180 arm_fir_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1181 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1182 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1183 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1184 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1185
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1186
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1187 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1188 * @brief Processing function for the floating-point FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1189 * @param[in] S points to an instance of the floating-point FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1190 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1191 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1192 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1193 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1194 void arm_fir_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1195 const arm_fir_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1196 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1197 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1198 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1199
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1200
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1201 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1202 * @brief Initialization function for the floating-point FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1203 * @param[in,out] S points to an instance of the floating-point FIR filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1204 * @param[in] numTaps Number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1205 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1206 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1207 * @param[in] blockSize number of samples that are processed at a time.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1208 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1209 void arm_fir_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1210 arm_fir_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1211 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1212 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1213 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1214 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1215
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1216
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1217 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1218 * @brief Instance structure for the Q15 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1219 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1220 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1221 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1222 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1223 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1224 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1225 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1226 } arm_biquad_casd_df1_inst_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1227
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1228 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1229 * @brief Instance structure for the Q31 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1230 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1231 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1232 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1233 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1234 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1235 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1236 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1237 } arm_biquad_casd_df1_inst_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1238
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1239 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1240 * @brief Instance structure for the floating-point Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1241 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1242 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1243 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1244 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1245 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1246 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1247 } arm_biquad_casd_df1_inst_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1248
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1249
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1250 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1251 * @brief Processing function for the Q15 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1252 * @param[in] S points to an instance of the Q15 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1253 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1254 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1255 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1256 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1257 void arm_biquad_cascade_df1_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1258 const arm_biquad_casd_df1_inst_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1259 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1260 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1261 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1262
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1263
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1264 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1265 * @brief Initialization function for the Q15 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1266 * @param[in,out] S points to an instance of the Q15 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1267 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1268 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1269 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1270 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1271 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1272 void arm_biquad_cascade_df1_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1273 arm_biquad_casd_df1_inst_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1274 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1275 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1276 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1277 int8_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1278
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1279
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1280 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1281 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1282 * @param[in] S points to an instance of the Q15 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1283 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1284 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1285 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1286 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1287 void arm_biquad_cascade_df1_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1288 const arm_biquad_casd_df1_inst_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1289 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1290 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1291 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1292
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1293
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1294 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1295 * @brief Processing function for the Q31 Biquad cascade filter
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1296 * @param[in] S points to an instance of the Q31 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1297 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1298 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1299 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1300 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1301 void arm_biquad_cascade_df1_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1302 const arm_biquad_casd_df1_inst_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1303 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1304 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1305 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1306
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1307
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1308 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1309 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1310 * @param[in] S points to an instance of the Q31 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1311 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1312 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1313 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1314 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1315 void arm_biquad_cascade_df1_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1316 const arm_biquad_casd_df1_inst_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1317 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1318 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1319 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1320
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1321
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1322 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1323 * @brief Initialization function for the Q31 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1324 * @param[in,out] S points to an instance of the Q31 Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1325 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1326 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1327 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1328 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1329 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1330 void arm_biquad_cascade_df1_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1331 arm_biquad_casd_df1_inst_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1332 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1333 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1334 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1335 int8_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1336
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1337
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1338 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1339 * @brief Processing function for the floating-point Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1340 * @param[in] S points to an instance of the floating-point Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1341 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1342 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1343 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1344 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1345 void arm_biquad_cascade_df1_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1346 const arm_biquad_casd_df1_inst_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1347 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1348 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1349 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1350
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1351
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1352 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1353 * @brief Initialization function for the floating-point Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1354 * @param[in,out] S points to an instance of the floating-point Biquad cascade structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1355 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1356 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1357 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1358 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1359 void arm_biquad_cascade_df1_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1360 arm_biquad_casd_df1_inst_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1361 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1362 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1363 float32_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1364
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1365
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1366 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1367 * @brief Instance structure for the floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1368 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1369 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1370 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1371 uint16_t numRows; /**< number of rows of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1372 uint16_t numCols; /**< number of columns of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1373 float32_t *pData; /**< points to the data of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1374 } arm_matrix_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1375
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1376
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1377 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1378 * @brief Instance structure for the floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1379 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1380 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1381 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1382 uint16_t numRows; /**< number of rows of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1383 uint16_t numCols; /**< number of columns of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1384 float64_t *pData; /**< points to the data of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1385 } arm_matrix_instance_f64;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1386
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1387 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1388 * @brief Instance structure for the Q15 matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1389 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1390 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1391 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1392 uint16_t numRows; /**< number of rows of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1393 uint16_t numCols; /**< number of columns of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1394 q15_t *pData; /**< points to the data of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1395 } arm_matrix_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1396
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1397 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1398 * @brief Instance structure for the Q31 matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1399 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1400 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1401 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1402 uint16_t numRows; /**< number of rows of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1403 uint16_t numCols; /**< number of columns of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1404 q31_t *pData; /**< points to the data of the matrix. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1405 } arm_matrix_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1406
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1407
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1408 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1409 * @brief Floating-point matrix addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1410 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1411 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1412 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1413 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1414 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1415 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1416 arm_status arm_mat_add_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1417 const arm_matrix_instance_f32 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1418 const arm_matrix_instance_f32 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1419 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1420
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1421
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1422 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1423 * @brief Q15 matrix addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1424 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1425 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1426 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1427 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1428 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1429 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1430 arm_status arm_mat_add_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1431 const arm_matrix_instance_q15 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1432 const arm_matrix_instance_q15 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1433 arm_matrix_instance_q15 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1434
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1435
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1436 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1437 * @brief Q31 matrix addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1438 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1439 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1440 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1441 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1442 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1443 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1444 arm_status arm_mat_add_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1445 const arm_matrix_instance_q31 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1446 const arm_matrix_instance_q31 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1447 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1448
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1449
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1450 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1451 * @brief Floating-point, complex, matrix multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1452 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1453 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1454 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1455 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1456 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1457 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1458 arm_status arm_mat_cmplx_mult_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1459 const arm_matrix_instance_f32 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1460 const arm_matrix_instance_f32 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1461 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1462
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1463
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1464 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1465 * @brief Q15, complex, matrix multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1466 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1467 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1468 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1469 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1470 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1471 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1472 arm_status arm_mat_cmplx_mult_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1473 const arm_matrix_instance_q15 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1474 const arm_matrix_instance_q15 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1475 arm_matrix_instance_q15 * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1476 q15_t * pScratch);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1477
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1478
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1479 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1480 * @brief Q31, complex, matrix multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1481 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1482 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1483 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1484 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1485 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1486 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1487 arm_status arm_mat_cmplx_mult_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1488 const arm_matrix_instance_q31 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1489 const arm_matrix_instance_q31 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1490 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1491
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1492
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1493 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1494 * @brief Floating-point matrix transpose.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1495 * @param[in] pSrc points to the input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1496 * @param[out] pDst points to the output matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1497 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1498 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1499 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1500 arm_status arm_mat_trans_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1501 const arm_matrix_instance_f32 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1502 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1503
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1504
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1505 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1506 * @brief Q15 matrix transpose.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1507 * @param[in] pSrc points to the input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1508 * @param[out] pDst points to the output matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1509 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1510 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1511 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1512 arm_status arm_mat_trans_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1513 const arm_matrix_instance_q15 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1514 arm_matrix_instance_q15 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1515
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1516
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1517 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1518 * @brief Q31 matrix transpose.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1519 * @param[in] pSrc points to the input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1520 * @param[out] pDst points to the output matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1521 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1522 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1523 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1524 arm_status arm_mat_trans_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1525 const arm_matrix_instance_q31 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1526 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1527
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1528
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1529 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1530 * @brief Floating-point matrix multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1531 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1532 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1533 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1534 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1535 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1536 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1537 arm_status arm_mat_mult_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1538 const arm_matrix_instance_f32 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1539 const arm_matrix_instance_f32 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1540 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1541
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1542
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1543 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1544 * @brief Q15 matrix multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1545 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1546 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1547 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1548 * @param[in] pState points to the array for storing intermediate results
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1549 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1550 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1551 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1552 arm_status arm_mat_mult_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1553 const arm_matrix_instance_q15 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1554 const arm_matrix_instance_q15 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1555 arm_matrix_instance_q15 * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1556 q15_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1557
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1558
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1559 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1560 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1561 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1562 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1563 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1564 * @param[in] pState points to the array for storing intermediate results
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1565 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1566 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1567 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1568 arm_status arm_mat_mult_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1569 const arm_matrix_instance_q15 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1570 const arm_matrix_instance_q15 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1571 arm_matrix_instance_q15 * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1572 q15_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1573
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1574
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1575 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1576 * @brief Q31 matrix multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1577 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1578 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1579 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1580 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1581 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1582 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1583 arm_status arm_mat_mult_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1584 const arm_matrix_instance_q31 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1585 const arm_matrix_instance_q31 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1586 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1587
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1588
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1589 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1590 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1591 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1592 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1593 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1594 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1595 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1596 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1597 arm_status arm_mat_mult_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1598 const arm_matrix_instance_q31 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1599 const arm_matrix_instance_q31 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1600 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1601
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1602
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1603 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1604 * @brief Floating-point matrix subtraction
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1605 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1606 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1607 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1608 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1609 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1610 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1611 arm_status arm_mat_sub_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1612 const arm_matrix_instance_f32 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1613 const arm_matrix_instance_f32 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1614 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1615
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1616
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1617 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1618 * @brief Q15 matrix subtraction
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1619 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1620 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1621 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1622 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1623 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1624 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1625 arm_status arm_mat_sub_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1626 const arm_matrix_instance_q15 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1627 const arm_matrix_instance_q15 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1628 arm_matrix_instance_q15 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1629
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1630
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1631 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1632 * @brief Q31 matrix subtraction
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1633 * @param[in] pSrcA points to the first input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1634 * @param[in] pSrcB points to the second input matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1635 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1636 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1637 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1638 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1639 arm_status arm_mat_sub_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1640 const arm_matrix_instance_q31 * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1641 const arm_matrix_instance_q31 * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1642 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1643
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1644
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1645 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1646 * @brief Floating-point matrix scaling.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1647 * @param[in] pSrc points to the input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1648 * @param[in] scale scale factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1649 * @param[out] pDst points to the output matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1650 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1651 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1652 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1653 arm_status arm_mat_scale_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1654 const arm_matrix_instance_f32 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1655 float32_t scale,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1656 arm_matrix_instance_f32 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1657
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1658
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1659 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1660 * @brief Q15 matrix scaling.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1661 * @param[in] pSrc points to input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1662 * @param[in] scaleFract fractional portion of the scale factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1663 * @param[in] shift number of bits to shift the result by
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1664 * @param[out] pDst points to output matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1665 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1666 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1667 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1668 arm_status arm_mat_scale_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1669 const arm_matrix_instance_q15 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1670 q15_t scaleFract,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1671 int32_t shift,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1672 arm_matrix_instance_q15 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1673
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1674
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1675 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1676 * @brief Q31 matrix scaling.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1677 * @param[in] pSrc points to input matrix
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1678 * @param[in] scaleFract fractional portion of the scale factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1679 * @param[in] shift number of bits to shift the result by
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1680 * @param[out] pDst points to output matrix structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1681 * @return The function returns either
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1682 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1683 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1684 arm_status arm_mat_scale_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1685 const arm_matrix_instance_q31 * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1686 q31_t scaleFract,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1687 int32_t shift,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1688 arm_matrix_instance_q31 * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1689
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1690
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1691 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1692 * @brief Q31 matrix initialization.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1693 * @param[in,out] S points to an instance of the floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1694 * @param[in] nRows number of rows in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1695 * @param[in] nColumns number of columns in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1696 * @param[in] pData points to the matrix data array.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1697 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1698 void arm_mat_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1699 arm_matrix_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1700 uint16_t nRows,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1701 uint16_t nColumns,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1702 q31_t * pData);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1703
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1704
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1705 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1706 * @brief Q15 matrix initialization.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1707 * @param[in,out] S points to an instance of the floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1708 * @param[in] nRows number of rows in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1709 * @param[in] nColumns number of columns in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1710 * @param[in] pData points to the matrix data array.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1711 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1712 void arm_mat_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1713 arm_matrix_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1714 uint16_t nRows,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1715 uint16_t nColumns,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1716 q15_t * pData);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1717
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1718
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1719 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1720 * @brief Floating-point matrix initialization.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1721 * @param[in,out] S points to an instance of the floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1722 * @param[in] nRows number of rows in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1723 * @param[in] nColumns number of columns in the matrix.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1724 * @param[in] pData points to the matrix data array.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1725 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1726 void arm_mat_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1727 arm_matrix_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1728 uint16_t nRows,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1729 uint16_t nColumns,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1730 float32_t * pData);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1731
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1732
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1733
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1734 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1735 * @brief Instance structure for the Q15 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1736 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1737 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1738 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1739 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1740 #ifdef ARM_MATH_CM0_FAMILY
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1741 q15_t A1;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1742 q15_t A2;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1743 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1744 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1745 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1746 q15_t state[3]; /**< The state array of length 3. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1747 q15_t Kp; /**< The proportional gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1748 q15_t Ki; /**< The integral gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1749 q15_t Kd; /**< The derivative gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1750 } arm_pid_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1751
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1752 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1753 * @brief Instance structure for the Q31 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1754 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1755 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1756 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1757 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1758 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1759 q31_t A2; /**< The derived gain, A2 = Kd . */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1760 q31_t state[3]; /**< The state array of length 3. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1761 q31_t Kp; /**< The proportional gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1762 q31_t Ki; /**< The integral gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1763 q31_t Kd; /**< The derivative gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1764 } arm_pid_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1765
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1766 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1767 * @brief Instance structure for the floating-point PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1768 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1769 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1770 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1771 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1772 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1773 float32_t A2; /**< The derived gain, A2 = Kd . */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1774 float32_t state[3]; /**< The state array of length 3. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1775 float32_t Kp; /**< The proportional gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1776 float32_t Ki; /**< The integral gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1777 float32_t Kd; /**< The derivative gain. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1778 } arm_pid_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1779
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1780
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1781
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1782 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1783 * @brief Initialization function for the floating-point PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1784 * @param[in,out] S points to an instance of the PID structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1785 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1786 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1787 void arm_pid_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1788 arm_pid_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1789 int32_t resetStateFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1790
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1791
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1792 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1793 * @brief Reset function for the floating-point PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1794 * @param[in,out] S is an instance of the floating-point PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1795 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1796 void arm_pid_reset_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1797 arm_pid_instance_f32 * S);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1798
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1799
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1800 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1801 * @brief Initialization function for the Q31 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1802 * @param[in,out] S points to an instance of the Q15 PID structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1803 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1804 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1805 void arm_pid_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1806 arm_pid_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1807 int32_t resetStateFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1808
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1809
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1810 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1811 * @brief Reset function for the Q31 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1812 * @param[in,out] S points to an instance of the Q31 PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1813 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1814
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1815 void arm_pid_reset_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1816 arm_pid_instance_q31 * S);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1817
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1818
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1819 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1820 * @brief Initialization function for the Q15 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1821 * @param[in,out] S points to an instance of the Q15 PID structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1822 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1823 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1824 void arm_pid_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1825 arm_pid_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1826 int32_t resetStateFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1827
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1828
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1829 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1830 * @brief Reset function for the Q15 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1831 * @param[in,out] S points to an instance of the q15 PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1832 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1833 void arm_pid_reset_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1834 arm_pid_instance_q15 * S);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1836
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1837 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1838 * @brief Instance structure for the floating-point Linear Interpolate function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1839 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1840 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1841 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1842 uint32_t nValues; /**< nValues */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1843 float32_t x1; /**< x1 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1844 float32_t xSpacing; /**< xSpacing */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1845 float32_t *pYData; /**< pointer to the table of Y values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1846 } arm_linear_interp_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1847
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1848 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1849 * @brief Instance structure for the floating-point bilinear interpolation function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1850 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1851 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1852 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1853 uint16_t numRows; /**< number of rows in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1854 uint16_t numCols; /**< number of columns in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1855 float32_t *pData; /**< points to the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1856 } arm_bilinear_interp_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1857
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1858 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1859 * @brief Instance structure for the Q31 bilinear interpolation function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1860 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1861 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1862 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1863 uint16_t numRows; /**< number of rows in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1864 uint16_t numCols; /**< number of columns in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1865 q31_t *pData; /**< points to the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1866 } arm_bilinear_interp_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1867
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1868 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1869 * @brief Instance structure for the Q15 bilinear interpolation function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1870 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1871 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1872 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1873 uint16_t numRows; /**< number of rows in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1874 uint16_t numCols; /**< number of columns in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1875 q15_t *pData; /**< points to the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1876 } arm_bilinear_interp_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1877
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1878 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1879 * @brief Instance structure for the Q15 bilinear interpolation function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1880 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1881 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1882 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1883 uint16_t numRows; /**< number of rows in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1884 uint16_t numCols; /**< number of columns in the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1885 q7_t *pData; /**< points to the data table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1886 } arm_bilinear_interp_instance_q7;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1887
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1888
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1889 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1890 * @brief Q7 vector multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1891 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1892 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1893 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1894 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1895 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1896 void arm_mult_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1897 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1898 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1899 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1900 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1901
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1902
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1903 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1904 * @brief Q15 vector multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1905 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1906 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1907 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1908 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1909 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1910 void arm_mult_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1911 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1912 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1913 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1914 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1915
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1916
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1917 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1918 * @brief Q31 vector multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1919 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1920 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1921 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1922 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1923 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1924 void arm_mult_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1925 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1926 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1927 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1928 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1929
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1930
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1931 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1932 * @brief Floating-point vector multiplication.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1933 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1934 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1935 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1936 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1937 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1938 void arm_mult_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1939 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1940 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1941 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1942 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1943
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1944
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1945 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1946 * @brief Instance structure for the Q15 CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1947 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1948 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1949 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1950 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1951 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1952 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1953 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1954 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1955 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1956 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1957 } arm_cfft_radix2_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1958
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1959 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1960 arm_status arm_cfft_radix2_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1961 arm_cfft_radix2_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1962 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1963 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1964 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1965
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1966 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1967 void arm_cfft_radix2_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1968 const arm_cfft_radix2_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1969 q15_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1970
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1971
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1972 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1973 * @brief Instance structure for the Q15 CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1974 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1975 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1976 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1977 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1978 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1979 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1980 q15_t *pTwiddle; /**< points to the twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1981 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1982 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1983 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1984 } arm_cfft_radix4_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1985
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1986 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1987 arm_status arm_cfft_radix4_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1988 arm_cfft_radix4_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1989 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1990 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1991 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1992
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1993 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1994 void arm_cfft_radix4_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1995 const arm_cfft_radix4_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1996 q15_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1997
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1998 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1999 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2000 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2001 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2002 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2003 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2004 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2005 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2006 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2007 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2008 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2009 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2010 } arm_cfft_radix2_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2012 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2013 arm_status arm_cfft_radix2_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2014 arm_cfft_radix2_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2015 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2016 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2017 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2018
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2019 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2020 void arm_cfft_radix2_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2021 const arm_cfft_radix2_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2022 q31_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2023
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2024 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2025 * @brief Instance structure for the Q31 CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2026 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2027 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2028 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2029 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2030 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2031 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2032 q31_t *pTwiddle; /**< points to the twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2033 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2034 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2035 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2036 } arm_cfft_radix4_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2037
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2038 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2039 void arm_cfft_radix4_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2040 const arm_cfft_radix4_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2041 q31_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2042
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2043 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2044 arm_status arm_cfft_radix4_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2045 arm_cfft_radix4_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2046 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2047 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2048 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2049
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2050 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2051 * @brief Instance structure for the floating-point CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2052 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2053 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2054 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2055 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2056 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2057 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2058 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2059 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2060 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2061 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2062 float32_t onebyfftLen; /**< value of 1/fftLen. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2063 } arm_cfft_radix2_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2064
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2065 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2066 arm_status arm_cfft_radix2_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2067 arm_cfft_radix2_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2068 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2069 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2070 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2071
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2072 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2073 void arm_cfft_radix2_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2074 const arm_cfft_radix2_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2075 float32_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2076
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2077 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2078 * @brief Instance structure for the floating-point CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2079 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2080 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2081 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2082 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2083 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2084 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2085 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2086 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2087 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2088 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2089 float32_t onebyfftLen; /**< value of 1/fftLen. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2090 } arm_cfft_radix4_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2091
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2092 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2093 arm_status arm_cfft_radix4_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2094 arm_cfft_radix4_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2095 uint16_t fftLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2096 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2097 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2098
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2099 /* Deprecated */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2100 void arm_cfft_radix4_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2101 const arm_cfft_radix4_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2102 float32_t * pSrc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2103
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2104 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2105 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2106 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2107 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2108 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2109 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2110 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2111 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2112 uint16_t bitRevLength; /**< bit reversal table length. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2113 } arm_cfft_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2114
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2115 void arm_cfft_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2116 const arm_cfft_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2117 q15_t * p1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2118 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2119 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2120
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2121 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2122 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2123 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2124 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2125 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2126 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2127 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2128 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2129 uint16_t bitRevLength; /**< bit reversal table length. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2130 } arm_cfft_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2131
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2132 void arm_cfft_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2133 const arm_cfft_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2134 q31_t * p1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2135 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2136 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2137
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2138 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2139 * @brief Instance structure for the floating-point CFFT/CIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2140 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2141 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2142 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2143 uint16_t fftLen; /**< length of the FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2144 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2145 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2146 uint16_t bitRevLength; /**< bit reversal table length. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2147 } arm_cfft_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2148
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2149 void arm_cfft_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2150 const arm_cfft_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2151 float32_t * p1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2152 uint8_t ifftFlag,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2153 uint8_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2154
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2155 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2156 * @brief Instance structure for the Q15 RFFT/RIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2157 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2158 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2159 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2160 uint32_t fftLenReal; /**< length of the real FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2161 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2162 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2163 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2164 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2165 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2166 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2167 } arm_rfft_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2168
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2169 arm_status arm_rfft_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2170 arm_rfft_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2171 uint32_t fftLenReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2172 uint32_t ifftFlagR,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2173 uint32_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2174
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2175 void arm_rfft_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2176 const arm_rfft_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2177 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2178 q15_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2179
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2180 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2181 * @brief Instance structure for the Q31 RFFT/RIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2182 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2183 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2184 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2185 uint32_t fftLenReal; /**< length of the real FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2186 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2187 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2188 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2189 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2190 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2191 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2192 } arm_rfft_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2193
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2194 arm_status arm_rfft_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2195 arm_rfft_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2196 uint32_t fftLenReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2197 uint32_t ifftFlagR,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2198 uint32_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2199
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2200 void arm_rfft_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2201 const arm_rfft_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2202 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2203 q31_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2204
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2205 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2206 * @brief Instance structure for the floating-point RFFT/RIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2207 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2208 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2209 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2210 uint32_t fftLenReal; /**< length of the real FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2211 uint16_t fftLenBy2; /**< length of the complex FFT. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2212 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2213 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2214 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2215 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2216 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2217 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2218 } arm_rfft_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2219
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2220 arm_status arm_rfft_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2221 arm_rfft_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2222 arm_cfft_radix4_instance_f32 * S_CFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2223 uint32_t fftLenReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2224 uint32_t ifftFlagR,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2225 uint32_t bitReverseFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2226
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2227 void arm_rfft_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2228 const arm_rfft_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2229 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2230 float32_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2231
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2232 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2233 * @brief Instance structure for the floating-point RFFT/RIFFT function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2234 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2235 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2236 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2237 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2238 uint16_t fftLenRFFT; /**< length of the real sequence */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2239 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2240 } arm_rfft_fast_instance_f32 ;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2241
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2242 arm_status arm_rfft_fast_init_f32 (
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2243 arm_rfft_fast_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2244 uint16_t fftLen);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2245
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2246 void arm_rfft_fast_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2247 arm_rfft_fast_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2248 float32_t * p, float32_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2249 uint8_t ifftFlag);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2250
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2251 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2252 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2253 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2254 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2255 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2256 uint16_t N; /**< length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2257 uint16_t Nby2; /**< half of the length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2258 float32_t normalize; /**< normalizing factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2259 float32_t *pTwiddle; /**< points to the twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2260 float32_t *pCosFactor; /**< points to the cosFactor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2261 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2262 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2263 } arm_dct4_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2264
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2265
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2266 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2267 * @brief Initialization function for the floating-point DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2268 * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2269 * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2270 * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2271 * @param[in] N length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2272 * @param[in] Nby2 half of the length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2273 * @param[in] normalize normalizing factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2274 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported transform length.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2275 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2276 arm_status arm_dct4_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2277 arm_dct4_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2278 arm_rfft_instance_f32 * S_RFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2279 arm_cfft_radix4_instance_f32 * S_CFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2280 uint16_t N,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2281 uint16_t Nby2,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2282 float32_t normalize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2283
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2284
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2285 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2286 * @brief Processing function for the floating-point DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2287 * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2288 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2289 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2290 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2291 void arm_dct4_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2292 const arm_dct4_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2293 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2294 float32_t * pInlineBuffer);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2295
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2296
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2297 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2298 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2299 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2300 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2301 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2302 uint16_t N; /**< length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2303 uint16_t Nby2; /**< half of the length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2304 q31_t normalize; /**< normalizing factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2305 q31_t *pTwiddle; /**< points to the twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2306 q31_t *pCosFactor; /**< points to the cosFactor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2307 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2308 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2309 } arm_dct4_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2310
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2311
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2312 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2313 * @brief Initialization function for the Q31 DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2314 * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2315 * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2316 * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2317 * @param[in] N length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2318 * @param[in] Nby2 half of the length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2319 * @param[in] normalize normalizing factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2320 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2321 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2322 arm_status arm_dct4_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2323 arm_dct4_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2324 arm_rfft_instance_q31 * S_RFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2325 arm_cfft_radix4_instance_q31 * S_CFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2326 uint16_t N,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2327 uint16_t Nby2,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2328 q31_t normalize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2329
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2330
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2331 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2332 * @brief Processing function for the Q31 DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2333 * @param[in] S points to an instance of the Q31 DCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2334 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2335 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2336 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2337 void arm_dct4_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2338 const arm_dct4_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2339 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2340 q31_t * pInlineBuffer);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2341
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2342
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2343 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2344 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2345 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2346 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2347 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2348 uint16_t N; /**< length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2349 uint16_t Nby2; /**< half of the length of the DCT4. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2350 q15_t normalize; /**< normalizing factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2351 q15_t *pTwiddle; /**< points to the twiddle factor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2352 q15_t *pCosFactor; /**< points to the cosFactor table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2353 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2354 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2355 } arm_dct4_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2356
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2357
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2358 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2359 * @brief Initialization function for the Q15 DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2360 * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2361 * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2362 * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2363 * @param[in] N length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2364 * @param[in] Nby2 half of the length of the DCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2365 * @param[in] normalize normalizing factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2366 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2367 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2368 arm_status arm_dct4_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2369 arm_dct4_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2370 arm_rfft_instance_q15 * S_RFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2371 arm_cfft_radix4_instance_q15 * S_CFFT,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2372 uint16_t N,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2373 uint16_t Nby2,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2374 q15_t normalize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2375
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2376
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2377 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2378 * @brief Processing function for the Q15 DCT4/IDCT4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2379 * @param[in] S points to an instance of the Q15 DCT4 structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2380 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2381 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2382 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2383 void arm_dct4_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2384 const arm_dct4_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2385 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2386 q15_t * pInlineBuffer);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2387
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2388
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2389 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2390 * @brief Floating-point vector addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2391 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2392 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2393 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2394 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2395 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2396 void arm_add_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2397 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2398 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2399 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2400 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2401
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2402
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2403 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2404 * @brief Q7 vector addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2405 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2406 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2407 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2408 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2409 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2410 void arm_add_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2411 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2412 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2413 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2414 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2415
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2416
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2417 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2418 * @brief Q15 vector addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2419 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2420 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2421 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2422 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2423 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2424 void arm_add_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2425 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2426 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2427 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2428 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2429
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2430
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2431 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2432 * @brief Q31 vector addition.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2433 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2434 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2435 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2436 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2437 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2438 void arm_add_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2439 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2440 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2441 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2442 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2443
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2444
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2445 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2446 * @brief Floating-point vector subtraction.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2447 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2448 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2449 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2450 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2451 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2452 void arm_sub_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2453 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2454 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2455 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2456 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2457
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2458
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2459 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2460 * @brief Q7 vector subtraction.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2461 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2462 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2463 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2464 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2465 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2466 void arm_sub_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2467 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2468 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2469 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2470 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2471
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2472
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2473 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2474 * @brief Q15 vector subtraction.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2475 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2476 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2477 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2478 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2479 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2480 void arm_sub_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2481 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2482 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2483 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2484 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2485
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2486
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2487 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2488 * @brief Q31 vector subtraction.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2489 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2490 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2491 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2492 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2493 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2494 void arm_sub_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2495 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2496 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2497 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2498 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2499
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2500
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2501 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2502 * @brief Multiplies a floating-point vector by a scalar.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2503 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2504 * @param[in] scale scale factor to be applied
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2505 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2506 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2507 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2508 void arm_scale_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2509 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2510 float32_t scale,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2511 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2512 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2513
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2514
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2515 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2516 * @brief Multiplies a Q7 vector by a scalar.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2517 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2518 * @param[in] scaleFract fractional portion of the scale value
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2519 * @param[in] shift number of bits to shift the result by
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2520 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2521 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2522 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2523 void arm_scale_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2524 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2525 q7_t scaleFract,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2526 int8_t shift,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2527 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2528 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2529
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2530
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2531 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2532 * @brief Multiplies a Q15 vector by a scalar.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2533 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2534 * @param[in] scaleFract fractional portion of the scale value
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2535 * @param[in] shift number of bits to shift the result by
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2536 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2537 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2538 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2539 void arm_scale_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2540 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2541 q15_t scaleFract,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2542 int8_t shift,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2543 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2544 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2545
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2546
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2547 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2548 * @brief Multiplies a Q31 vector by a scalar.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2549 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2550 * @param[in] scaleFract fractional portion of the scale value
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2551 * @param[in] shift number of bits to shift the result by
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2552 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2553 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2554 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2555 void arm_scale_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2556 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2557 q31_t scaleFract,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2558 int8_t shift,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2559 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2560 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2561
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2562
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2563 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2564 * @brief Q7 vector absolute value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2565 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2566 * @param[out] pDst points to the output buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2567 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2568 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2569 void arm_abs_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2570 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2571 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2572 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2573
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2574
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2575 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2576 * @brief Floating-point vector absolute value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2577 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2578 * @param[out] pDst points to the output buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2579 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2580 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2581 void arm_abs_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2582 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2583 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2584 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2585
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2586
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2587 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2588 * @brief Q15 vector absolute value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2589 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2590 * @param[out] pDst points to the output buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2591 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2592 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2593 void arm_abs_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2594 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2595 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2596 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2597
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2598
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2599 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2600 * @brief Q31 vector absolute value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2601 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2602 * @param[out] pDst points to the output buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2603 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2604 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2605 void arm_abs_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2606 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2607 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2608 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2609
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2610
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2611 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2612 * @brief Dot product of floating-point vectors.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2613 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2614 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2615 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2616 * @param[out] result output result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2617 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2618 void arm_dot_prod_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2619 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2620 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2621 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2622 float32_t * result);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2623
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2624
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2625 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2626 * @brief Dot product of Q7 vectors.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2627 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2628 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2629 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2630 * @param[out] result output result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2631 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2632 void arm_dot_prod_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2633 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2634 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2635 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2636 q31_t * result);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2637
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2638
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2639 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2640 * @brief Dot product of Q15 vectors.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2641 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2642 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2643 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2644 * @param[out] result output result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2645 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2646 void arm_dot_prod_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2647 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2648 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2649 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2650 q63_t * result);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2651
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2652
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2653 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2654 * @brief Dot product of Q31 vectors.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2655 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2656 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2657 * @param[in] blockSize number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2658 * @param[out] result output result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2659 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2660 void arm_dot_prod_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2661 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2662 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2663 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2664 q63_t * result);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2665
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2666
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2667 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2668 * @brief Shifts the elements of a Q7 vector a specified number of bits.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2669 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2670 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2671 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2672 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2673 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2674 void arm_shift_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2675 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2676 int8_t shiftBits,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2677 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2678 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2679
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2680
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2681 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2682 * @brief Shifts the elements of a Q15 vector a specified number of bits.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2683 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2684 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2685 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2686 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2687 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2688 void arm_shift_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2689 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2690 int8_t shiftBits,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2691 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2692 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2693
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2694
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2695 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2696 * @brief Shifts the elements of a Q31 vector a specified number of bits.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2697 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2698 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2699 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2700 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2701 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2702 void arm_shift_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2703 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2704 int8_t shiftBits,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2705 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2706 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2707
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2708
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2709 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2710 * @brief Adds a constant offset to a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2711 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2712 * @param[in] offset is the offset to be added
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2713 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2714 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2715 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2716 void arm_offset_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2717 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2718 float32_t offset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2719 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2720 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2721
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2722
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2723 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2724 * @brief Adds a constant offset to a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2725 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2726 * @param[in] offset is the offset to be added
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2727 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2728 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2729 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2730 void arm_offset_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2731 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2732 q7_t offset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2733 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2734 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2735
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2736
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2737 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2738 * @brief Adds a constant offset to a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2739 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2740 * @param[in] offset is the offset to be added
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2741 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2742 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2743 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2744 void arm_offset_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2745 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2746 q15_t offset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2747 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2748 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2749
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2750
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2751 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2752 * @brief Adds a constant offset to a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2753 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2754 * @param[in] offset is the offset to be added
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2755 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2756 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2757 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2758 void arm_offset_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2759 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2760 q31_t offset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2761 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2762 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2763
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2764
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2765 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2766 * @brief Negates the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2767 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2768 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2769 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2770 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2771 void arm_negate_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2772 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2773 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2774 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2775
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2776
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2777 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2778 * @brief Negates the elements of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2779 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2780 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2781 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2782 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2783 void arm_negate_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2784 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2785 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2786 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2787
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2788
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2789 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2790 * @brief Negates the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2791 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2792 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2793 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2794 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2795 void arm_negate_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2796 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2797 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2798 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2799
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2800
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2801 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2802 * @brief Negates the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2803 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2804 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2805 * @param[in] blockSize number of samples in the vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2806 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2807 void arm_negate_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2808 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2809 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2810 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2811
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2812
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2813 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2814 * @brief Copies the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2815 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2816 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2817 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2818 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2819 void arm_copy_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2820 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2821 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2822 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2823
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2824
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2825 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2826 * @brief Copies the elements of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2827 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2828 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2829 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2830 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2831 void arm_copy_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2832 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2833 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2834 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2836
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2837 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2838 * @brief Copies the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2839 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2840 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2841 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2842 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2843 void arm_copy_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2844 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2845 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2846 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2847
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2848
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2849 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2850 * @brief Copies the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2851 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2852 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2853 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2854 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2855 void arm_copy_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2856 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2857 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2858 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2859
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2860
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2861 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2862 * @brief Fills a constant value into a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2863 * @param[in] value input value to be filled
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2864 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2865 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2866 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2867 void arm_fill_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2868 float32_t value,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2869 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2870 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2871
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2872
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2873 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2874 * @brief Fills a constant value into a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2875 * @param[in] value input value to be filled
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2876 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2877 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2878 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2879 void arm_fill_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2880 q7_t value,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2881 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2882 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2883
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2884
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2885 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2886 * @brief Fills a constant value into a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2887 * @param[in] value input value to be filled
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2888 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2889 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2890 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2891 void arm_fill_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2892 q15_t value,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2893 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2894 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2895
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2896
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2897 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2898 * @brief Fills a constant value into a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2899 * @param[in] value input value to be filled
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2900 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2901 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2902 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2903 void arm_fill_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2904 q31_t value,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2905 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2906 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2907
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2908
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2909 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2910 * @brief Convolution of floating-point sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2911 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2912 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2913 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2914 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2915 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2916 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2917 void arm_conv_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2918 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2919 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2920 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2921 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2922 float32_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2923
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2924
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2925 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2926 * @brief Convolution of Q15 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2927 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2928 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2929 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2930 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2931 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2932 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2933 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2934 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2935 void arm_conv_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2936 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2937 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2938 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2939 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2940 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2941 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2942 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2943
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2944
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2945 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2946 * @brief Convolution of Q15 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2947 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2948 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2949 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2950 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2951 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2952 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2953 void arm_conv_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2954 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2955 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2956 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2957 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2958 q15_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2959
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2960
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2961 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2962 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2963 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2964 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2965 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2966 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2967 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2968 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2969 void arm_conv_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2970 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2971 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2972 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2973 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2974 q15_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2975
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2976
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2977 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2978 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2979 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2980 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2981 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2982 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2983 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2984 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2985 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2986 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2987 void arm_conv_fast_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2988 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2989 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2990 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2991 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2992 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2993 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2994 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2995
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2996
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2997 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2998 * @brief Convolution of Q31 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2999 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3000 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3001 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3002 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3003 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3004 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3005 void arm_conv_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3006 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3007 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3008 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3009 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3010 q31_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3012
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3013 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3014 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3015 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3016 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3017 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3018 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3019 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3020 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3021 void arm_conv_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3022 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3023 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3024 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3025 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3026 q31_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3027
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3028
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3029 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3030 * @brief Convolution of Q7 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3031 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3032 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3033 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3034 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3035 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3036 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3037 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3038 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3039 void arm_conv_opt_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3040 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3041 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3042 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3043 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3044 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3045 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3046 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3047
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3048
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3049 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3050 * @brief Convolution of Q7 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3051 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3052 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3053 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3054 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3055 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3056 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3057 void arm_conv_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3058 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3059 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3060 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3061 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3062 q7_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3063
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3064
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3065 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3066 * @brief Partial convolution of floating-point sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3067 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3068 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3069 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3070 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3071 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3072 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3073 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3074 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3075 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3076 arm_status arm_conv_partial_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3077 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3078 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3079 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3080 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3081 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3082 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3083 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3084
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3085
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3086 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3087 * @brief Partial convolution of Q15 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3088 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3089 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3090 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3091 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3092 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3093 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3094 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3095 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3096 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3097 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3098 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3099 arm_status arm_conv_partial_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3100 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3101 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3102 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3103 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3104 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3105 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3106 uint32_t numPoints,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3107 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3108 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3109
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3110
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3111 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3112 * @brief Partial convolution of Q15 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3113 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3114 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3115 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3116 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3117 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3118 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3119 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3120 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3121 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3122 arm_status arm_conv_partial_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3123 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3124 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3125 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3126 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3127 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3128 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3129 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3130
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3131
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3132 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3133 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3134 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3135 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3136 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3137 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3138 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3139 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3140 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3141 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3142 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3143 arm_status arm_conv_partial_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3144 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3145 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3146 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3147 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3148 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3149 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3150 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3151
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3152
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3153 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3154 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3155 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3156 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3157 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3158 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3159 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3160 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3161 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3162 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3163 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3164 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3165 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3166 arm_status arm_conv_partial_fast_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3167 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3168 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3169 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3170 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3171 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3172 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3173 uint32_t numPoints,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3174 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3175 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3176
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3177
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3178 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3179 * @brief Partial convolution of Q31 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3180 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3181 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3182 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3183 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3184 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3185 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3186 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3187 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3188 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3189 arm_status arm_conv_partial_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3190 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3191 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3192 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3193 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3194 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3195 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3196 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3197
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3198
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3199 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3200 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3201 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3202 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3203 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3204 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3205 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3206 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3207 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3208 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3209 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3210 arm_status arm_conv_partial_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3211 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3212 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3213 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3214 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3215 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3216 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3217 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3218
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3219
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3220 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3221 * @brief Partial convolution of Q7 sequences
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3222 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3223 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3224 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3225 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3226 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3227 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3228 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3229 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3230 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3231 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3232 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3233 arm_status arm_conv_partial_opt_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3234 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3235 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3236 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3237 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3238 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3239 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3240 uint32_t numPoints,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3241 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3242 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3243
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3244
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3245 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3246 * @brief Partial convolution of Q7 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3247 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3248 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3249 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3250 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3251 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3252 * @param[in] firstIndex is the first output sample to start with.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3253 * @param[in] numPoints is the number of output points to be computed.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3254 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3255 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3256 arm_status arm_conv_partial_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3257 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3258 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3259 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3260 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3261 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3262 uint32_t firstIndex,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3263 uint32_t numPoints);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3264
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3265
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3266 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3267 * @brief Instance structure for the Q15 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3268 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3269 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3270 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3271 uint8_t M; /**< decimation factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3272 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3273 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3274 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3275 } arm_fir_decimate_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3276
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3277 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3278 * @brief Instance structure for the Q31 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3279 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3280 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3281 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3282 uint8_t M; /**< decimation factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3283 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3284 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3285 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3286 } arm_fir_decimate_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3287
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3288 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3289 * @brief Instance structure for the floating-point FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3290 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3291 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3292 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3293 uint8_t M; /**< decimation factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3294 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3295 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3296 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3297 } arm_fir_decimate_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3298
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3299
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3300 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3301 * @brief Processing function for the floating-point FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3302 * @param[in] S points to an instance of the floating-point FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3303 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3304 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3305 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3306 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3307 void arm_fir_decimate_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3308 const arm_fir_decimate_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3309 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3310 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3311 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3312
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3313
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3314 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3315 * @brief Initialization function for the floating-point FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3316 * @param[in,out] S points to an instance of the floating-point FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3317 * @param[in] numTaps number of coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3318 * @param[in] M decimation factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3319 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3320 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3321 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3322 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3323 * <code>blockSize</code> is not a multiple of <code>M</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3324 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3325 arm_status arm_fir_decimate_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3326 arm_fir_decimate_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3327 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3328 uint8_t M,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3329 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3330 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3331 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3332
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3333
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3334 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3335 * @brief Processing function for the Q15 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3336 * @param[in] S points to an instance of the Q15 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3337 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3338 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3339 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3340 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3341 void arm_fir_decimate_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3342 const arm_fir_decimate_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3343 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3344 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3345 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3346
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3347
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3348 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3349 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3350 * @param[in] S points to an instance of the Q15 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3351 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3352 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3353 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3354 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3355 void arm_fir_decimate_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3356 const arm_fir_decimate_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3357 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3358 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3359 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3360
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3361
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3362 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3363 * @brief Initialization function for the Q15 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3364 * @param[in,out] S points to an instance of the Q15 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3365 * @param[in] numTaps number of coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3366 * @param[in] M decimation factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3367 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3368 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3369 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3370 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3371 * <code>blockSize</code> is not a multiple of <code>M</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3372 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3373 arm_status arm_fir_decimate_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3374 arm_fir_decimate_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3375 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3376 uint8_t M,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3377 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3378 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3379 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3380
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3381
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3382 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3383 * @brief Processing function for the Q31 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3384 * @param[in] S points to an instance of the Q31 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3385 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3386 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3387 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3388 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3389 void arm_fir_decimate_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3390 const arm_fir_decimate_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3391 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3392 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3393 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3394
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3395 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3396 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3397 * @param[in] S points to an instance of the Q31 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3398 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3399 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3400 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3401 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3402 void arm_fir_decimate_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3403 arm_fir_decimate_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3404 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3405 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3406 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3407
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3408
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3409 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3410 * @brief Initialization function for the Q31 FIR decimator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3411 * @param[in,out] S points to an instance of the Q31 FIR decimator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3412 * @param[in] numTaps number of coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3413 * @param[in] M decimation factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3414 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3415 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3416 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3417 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3418 * <code>blockSize</code> is not a multiple of <code>M</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3419 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3420 arm_status arm_fir_decimate_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3421 arm_fir_decimate_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3422 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3423 uint8_t M,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3424 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3425 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3426 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3427
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3428
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3429 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3430 * @brief Instance structure for the Q15 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3431 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3432 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3433 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3434 uint8_t L; /**< upsample factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3435 uint16_t phaseLength; /**< length of each polyphase filter component. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3436 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3437 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3438 } arm_fir_interpolate_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3439
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3440 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3441 * @brief Instance structure for the Q31 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3442 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3443 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3444 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3445 uint8_t L; /**< upsample factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3446 uint16_t phaseLength; /**< length of each polyphase filter component. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3447 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3448 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3449 } arm_fir_interpolate_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3450
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3451 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3452 * @brief Instance structure for the floating-point FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3453 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3454 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3455 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3456 uint8_t L; /**< upsample factor. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3457 uint16_t phaseLength; /**< length of each polyphase filter component. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3458 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3459 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3460 } arm_fir_interpolate_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3461
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3462
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3463 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3464 * @brief Processing function for the Q15 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3465 * @param[in] S points to an instance of the Q15 FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3466 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3467 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3468 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3469 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3470 void arm_fir_interpolate_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3471 const arm_fir_interpolate_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3472 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3473 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3474 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3475
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3476
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3477 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3478 * @brief Initialization function for the Q15 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3479 * @param[in,out] S points to an instance of the Q15 FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3480 * @param[in] L upsample factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3481 * @param[in] numTaps number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3482 * @param[in] pCoeffs points to the filter coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3483 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3484 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3485 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3486 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3487 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3488 arm_status arm_fir_interpolate_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3489 arm_fir_interpolate_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3490 uint8_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3491 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3492 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3493 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3494 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3495
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3496
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3497 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3498 * @brief Processing function for the Q31 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3499 * @param[in] S points to an instance of the Q15 FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3500 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3501 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3502 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3503 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3504 void arm_fir_interpolate_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3505 const arm_fir_interpolate_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3506 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3507 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3508 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3509
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3510
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3511 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3512 * @brief Initialization function for the Q31 FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3513 * @param[in,out] S points to an instance of the Q31 FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3514 * @param[in] L upsample factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3515 * @param[in] numTaps number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3516 * @param[in] pCoeffs points to the filter coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3517 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3518 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3519 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3520 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3521 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3522 arm_status arm_fir_interpolate_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3523 arm_fir_interpolate_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3524 uint8_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3525 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3526 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3527 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3528 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3529
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3530
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3531 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3532 * @brief Processing function for the floating-point FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3533 * @param[in] S points to an instance of the floating-point FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3534 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3535 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3536 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3537 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3538 void arm_fir_interpolate_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3539 const arm_fir_interpolate_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3540 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3541 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3542 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3543
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3544
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3545 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3546 * @brief Initialization function for the floating-point FIR interpolator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3547 * @param[in,out] S points to an instance of the floating-point FIR interpolator structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3548 * @param[in] L upsample factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3549 * @param[in] numTaps number of filter coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3550 * @param[in] pCoeffs points to the filter coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3551 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3552 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3553 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3554 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3555 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3556 arm_status arm_fir_interpolate_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3557 arm_fir_interpolate_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3558 uint8_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3559 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3560 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3561 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3562 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3563
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3564
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3565 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3566 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3567 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3568 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3569 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3570 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3571 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3572 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3573 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3574 } arm_biquad_cas_df1_32x64_ins_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3575
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3576
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3577 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3578 * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3579 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3580 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3581 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3582 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3583 void arm_biquad_cas_df1_32x64_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3584 const arm_biquad_cas_df1_32x64_ins_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3585 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3586 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3587 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3588
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3589
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3590 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3591 * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3592 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3593 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3594 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3595 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3596 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3597 void arm_biquad_cas_df1_32x64_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3598 arm_biquad_cas_df1_32x64_ins_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3599 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3600 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3601 q63_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3602 uint8_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3603
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3604
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3605 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3606 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3607 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3608 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3609 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3610 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3611 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3612 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3613 } arm_biquad_cascade_df2T_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3614
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3615 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3616 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3617 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3618 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3619 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3620 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3621 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3622 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3623 } arm_biquad_cascade_stereo_df2T_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3624
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3625 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3626 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3627 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3628 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3629 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3630 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3631 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3632 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3633 } arm_biquad_cascade_df2T_instance_f64;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3634
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3635
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3636 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3637 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3638 * @param[in] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3639 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3640 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3641 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3642 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3643 void arm_biquad_cascade_df2T_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3644 const arm_biquad_cascade_df2T_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3645 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3646 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3647 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3648
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3649
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3650 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3651 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3652 * @param[in] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3653 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3654 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3655 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3656 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3657 void arm_biquad_cascade_stereo_df2T_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3658 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3659 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3660 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3661 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3662
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3663
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3664 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3665 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3666 * @param[in] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3667 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3668 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3669 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3670 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3671 void arm_biquad_cascade_df2T_f64(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3672 const arm_biquad_cascade_df2T_instance_f64 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3673 float64_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3674 float64_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3675 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3676
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3677
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3678 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3679 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3680 * @param[in,out] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3681 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3682 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3683 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3684 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3685 void arm_biquad_cascade_df2T_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3686 arm_biquad_cascade_df2T_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3687 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3688 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3689 float32_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3690
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3691
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3692 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3693 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3694 * @param[in,out] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3695 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3696 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3697 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3698 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3699 void arm_biquad_cascade_stereo_df2T_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3700 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3701 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3702 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3703 float32_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3704
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3705
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3706 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3707 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3708 * @param[in,out] S points to an instance of the filter data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3709 * @param[in] numStages number of 2nd order stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3710 * @param[in] pCoeffs points to the filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3711 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3712 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3713 void arm_biquad_cascade_df2T_init_f64(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3714 arm_biquad_cascade_df2T_instance_f64 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3715 uint8_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3716 float64_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3717 float64_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3718
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3719
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3720 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3721 * @brief Instance structure for the Q15 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3722 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3723 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3724 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3725 uint16_t numStages; /**< number of filter stages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3726 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3727 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3728 } arm_fir_lattice_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3729
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3730 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3731 * @brief Instance structure for the Q31 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3732 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3733 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3734 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3735 uint16_t numStages; /**< number of filter stages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3736 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3737 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3738 } arm_fir_lattice_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3739
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3740 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3741 * @brief Instance structure for the floating-point FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3742 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3743 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3744 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3745 uint16_t numStages; /**< number of filter stages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3746 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3747 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3748 } arm_fir_lattice_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3749
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3750
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3751 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3752 * @brief Initialization function for the Q15 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3753 * @param[in] S points to an instance of the Q15 FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3754 * @param[in] numStages number of filter stages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3755 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3756 * @param[in] pState points to the state buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3757 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3758 void arm_fir_lattice_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3759 arm_fir_lattice_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3760 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3761 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3762 q15_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3763
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3764
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3765 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3766 * @brief Processing function for the Q15 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3767 * @param[in] S points to an instance of the Q15 FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3768 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3769 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3770 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3771 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3772 void arm_fir_lattice_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3773 const arm_fir_lattice_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3774 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3775 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3776 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3777
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3778
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3779 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3780 * @brief Initialization function for the Q31 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3781 * @param[in] S points to an instance of the Q31 FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3782 * @param[in] numStages number of filter stages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3783 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3784 * @param[in] pState points to the state buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3785 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3786 void arm_fir_lattice_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3787 arm_fir_lattice_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3788 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3789 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3790 q31_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3791
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3792
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3793 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3794 * @brief Processing function for the Q31 FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3795 * @param[in] S points to an instance of the Q31 FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3796 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3797 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3798 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3799 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3800 void arm_fir_lattice_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3801 const arm_fir_lattice_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3802 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3803 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3804 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3805
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3806
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3807 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3808 * @brief Initialization function for the floating-point FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3809 * @param[in] S points to an instance of the floating-point FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3810 * @param[in] numStages number of filter stages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3811 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3812 * @param[in] pState points to the state buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3813 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3814 void arm_fir_lattice_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3815 arm_fir_lattice_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3816 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3817 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3818 float32_t * pState);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3819
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3820
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3821 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3822 * @brief Processing function for the floating-point FIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3823 * @param[in] S points to an instance of the floating-point FIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3824 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3825 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3826 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3827 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3828 void arm_fir_lattice_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3829 const arm_fir_lattice_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3830 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3831 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3832 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3833
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3834
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3835 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3836 * @brief Instance structure for the Q15 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3837 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3838 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3839 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3840 uint16_t numStages; /**< number of stages in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3841 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3842 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3843 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3844 } arm_iir_lattice_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3845
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3846 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3847 * @brief Instance structure for the Q31 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3848 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3849 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3850 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3851 uint16_t numStages; /**< number of stages in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3852 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3853 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3854 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3855 } arm_iir_lattice_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3856
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3857 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3858 * @brief Instance structure for the floating-point IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3859 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3860 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3861 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3862 uint16_t numStages; /**< number of stages in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3863 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3864 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3865 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3866 } arm_iir_lattice_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3867
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3868
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3869 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3870 * @brief Processing function for the floating-point IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3871 * @param[in] S points to an instance of the floating-point IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3872 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3873 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3874 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3875 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3876 void arm_iir_lattice_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3877 const arm_iir_lattice_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3878 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3879 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3880 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3881
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3882
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3883 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3884 * @brief Initialization function for the floating-point IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3885 * @param[in] S points to an instance of the floating-point IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3886 * @param[in] numStages number of stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3887 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3888 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3889 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3890 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3891 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3892 void arm_iir_lattice_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3893 arm_iir_lattice_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3894 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3895 float32_t * pkCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3896 float32_t * pvCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3897 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3898 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3899
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3900
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3901 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3902 * @brief Processing function for the Q31 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3903 * @param[in] S points to an instance of the Q31 IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3904 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3905 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3906 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3907 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3908 void arm_iir_lattice_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3909 const arm_iir_lattice_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3910 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3911 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3912 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3913
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3914
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3915 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3916 * @brief Initialization function for the Q31 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3917 * @param[in] S points to an instance of the Q31 IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3918 * @param[in] numStages number of stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3919 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3920 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3921 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3922 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3923 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3924 void arm_iir_lattice_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3925 arm_iir_lattice_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3926 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3927 q31_t * pkCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3928 q31_t * pvCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3929 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3930 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3931
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3932
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3933 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3934 * @brief Processing function for the Q15 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3935 * @param[in] S points to an instance of the Q15 IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3936 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3937 * @param[out] pDst points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3938 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3939 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3940 void arm_iir_lattice_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3941 const arm_iir_lattice_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3942 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3943 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3944 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3945
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3946
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3947 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3948 * @brief Initialization function for the Q15 IIR lattice filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3949 * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3950 * @param[in] numStages number of stages in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3951 * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3952 * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3953 * @param[in] pState points to state buffer. The array is of length numStages+blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3954 * @param[in] blockSize number of samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3955 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3956 void arm_iir_lattice_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3957 arm_iir_lattice_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3958 uint16_t numStages,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3959 q15_t * pkCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3960 q15_t * pvCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3961 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3962 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3963
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3964
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3965 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3966 * @brief Instance structure for the floating-point LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3967 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3968 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3969 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3970 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3971 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3972 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3973 float32_t mu; /**< step size that controls filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3974 } arm_lms_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3975
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3976
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3977 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3978 * @brief Processing function for floating-point LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3979 * @param[in] S points to an instance of the floating-point LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3980 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3981 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3982 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3983 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3984 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3985 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3986 void arm_lms_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3987 const arm_lms_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3988 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3989 float32_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3990 float32_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3991 float32_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3992 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3993
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3994
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3995 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3996 * @brief Initialization function for floating-point LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3997 * @param[in] S points to an instance of the floating-point LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3998 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3999 * @param[in] pCoeffs points to the coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4000 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4001 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4002 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4003 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4004 void arm_lms_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4005 arm_lms_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4006 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4007 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4008 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4009 float32_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4010 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4012
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4013 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4014 * @brief Instance structure for the Q15 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4015 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4016 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4017 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4018 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4019 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4020 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4021 q15_t mu; /**< step size that controls filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4022 uint32_t postShift; /**< bit shift applied to coefficients. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4023 } arm_lms_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4024
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4025
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4026 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4027 * @brief Initialization function for the Q15 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4028 * @param[in] S points to an instance of the Q15 LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4029 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4030 * @param[in] pCoeffs points to the coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4031 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4032 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4033 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4034 * @param[in] postShift bit shift applied to coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4035 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4036 void arm_lms_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4037 arm_lms_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4038 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4039 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4040 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4041 q15_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4042 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4043 uint32_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4044
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4045
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4046 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4047 * @brief Processing function for Q15 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4048 * @param[in] S points to an instance of the Q15 LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4049 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4050 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4051 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4052 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4053 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4054 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4055 void arm_lms_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4056 const arm_lms_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4057 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4058 q15_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4059 q15_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4060 q15_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4061 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4062
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4063
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4064 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4065 * @brief Instance structure for the Q31 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4066 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4067 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4068 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4069 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4070 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4071 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4072 q31_t mu; /**< step size that controls filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4073 uint32_t postShift; /**< bit shift applied to coefficients. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4074 } arm_lms_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4075
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4076
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4077 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4078 * @brief Processing function for Q31 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4079 * @param[in] S points to an instance of the Q15 LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4080 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4081 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4082 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4083 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4084 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4085 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4086 void arm_lms_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4087 const arm_lms_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4088 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4089 q31_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4090 q31_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4091 q31_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4092 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4093
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4094
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4095 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4096 * @brief Initialization function for Q31 LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4097 * @param[in] S points to an instance of the Q31 LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4098 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4099 * @param[in] pCoeffs points to coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4100 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4101 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4102 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4103 * @param[in] postShift bit shift applied to coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4104 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4105 void arm_lms_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4106 arm_lms_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4107 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4108 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4109 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4110 q31_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4111 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4112 uint32_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4113
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4114
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4115 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4116 * @brief Instance structure for the floating-point normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4117 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4118 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4119 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4120 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4121 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4122 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4123 float32_t mu; /**< step size that control filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4124 float32_t energy; /**< saves previous frame energy. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4125 float32_t x0; /**< saves previous input sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4126 } arm_lms_norm_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4127
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4128
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4129 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4130 * @brief Processing function for floating-point normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4131 * @param[in] S points to an instance of the floating-point normalized LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4132 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4133 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4134 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4135 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4136 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4137 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4138 void arm_lms_norm_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4139 arm_lms_norm_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4140 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4141 float32_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4142 float32_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4143 float32_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4144 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4145
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4146
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4147 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4148 * @brief Initialization function for floating-point normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4149 * @param[in] S points to an instance of the floating-point LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4150 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4151 * @param[in] pCoeffs points to coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4152 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4153 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4154 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4155 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4156 void arm_lms_norm_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4157 arm_lms_norm_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4158 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4159 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4160 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4161 float32_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4162 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4163
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4164
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4165 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4166 * @brief Instance structure for the Q31 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4167 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4168 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4169 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4170 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4171 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4172 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4173 q31_t mu; /**< step size that controls filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4174 uint8_t postShift; /**< bit shift applied to coefficients. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4175 q31_t *recipTable; /**< points to the reciprocal initial value table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4176 q31_t energy; /**< saves previous frame energy. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4177 q31_t x0; /**< saves previous input sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4178 } arm_lms_norm_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4179
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4180
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4181 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4182 * @brief Processing function for Q31 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4183 * @param[in] S points to an instance of the Q31 normalized LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4184 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4185 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4186 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4187 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4188 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4189 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4190 void arm_lms_norm_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4191 arm_lms_norm_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4192 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4193 q31_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4194 q31_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4195 q31_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4196 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4197
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4198
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4199 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4200 * @brief Initialization function for Q31 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4201 * @param[in] S points to an instance of the Q31 normalized LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4202 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4203 * @param[in] pCoeffs points to coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4204 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4205 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4206 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4207 * @param[in] postShift bit shift applied to coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4208 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4209 void arm_lms_norm_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4210 arm_lms_norm_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4211 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4212 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4213 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4214 q31_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4215 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4216 uint8_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4217
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4218
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4219 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4220 * @brief Instance structure for the Q15 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4221 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4222 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4223 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4224 uint16_t numTaps; /**< Number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4225 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4226 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4227 q15_t mu; /**< step size that controls filter coefficient updates. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4228 uint8_t postShift; /**< bit shift applied to coefficients. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4229 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4230 q15_t energy; /**< saves previous frame energy. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4231 q15_t x0; /**< saves previous input sample. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4232 } arm_lms_norm_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4233
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4234
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4235 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4236 * @brief Processing function for Q15 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4237 * @param[in] S points to an instance of the Q15 normalized LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4238 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4239 * @param[in] pRef points to the block of reference data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4240 * @param[out] pOut points to the block of output data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4241 * @param[out] pErr points to the block of error data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4242 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4243 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4244 void arm_lms_norm_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4245 arm_lms_norm_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4246 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4247 q15_t * pRef,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4248 q15_t * pOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4249 q15_t * pErr,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4250 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4251
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4252
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4253 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4254 * @brief Initialization function for Q15 normalized LMS filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4255 * @param[in] S points to an instance of the Q15 normalized LMS filter structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4256 * @param[in] numTaps number of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4257 * @param[in] pCoeffs points to coefficient buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4258 * @param[in] pState points to state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4259 * @param[in] mu step size that controls filter coefficient updates.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4260 * @param[in] blockSize number of samples to process.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4261 * @param[in] postShift bit shift applied to coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4262 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4263 void arm_lms_norm_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4264 arm_lms_norm_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4265 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4266 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4267 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4268 q15_t mu,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4269 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4270 uint8_t postShift);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4271
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4272
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4273 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4274 * @brief Correlation of floating-point sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4275 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4276 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4277 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4278 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4279 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4280 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4281 void arm_correlate_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4282 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4283 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4284 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4285 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4286 float32_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4287
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4288
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4289 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4290 * @brief Correlation of Q15 sequences
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4291 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4292 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4293 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4294 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4295 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4296 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4297 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4298 void arm_correlate_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4299 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4300 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4301 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4302 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4303 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4304 q15_t * pScratch);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4305
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4306
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4307 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4308 * @brief Correlation of Q15 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4309 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4310 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4311 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4312 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4313 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4314 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4315
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4316 void arm_correlate_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4317 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4318 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4319 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4320 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4321 q15_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4322
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4323
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4324 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4325 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4326 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4327 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4328 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4329 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4330 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4331 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4332
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4333 void arm_correlate_fast_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4334 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4335 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4336 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4337 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4338 q15_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4339
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4340
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4341 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4342 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4343 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4344 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4345 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4346 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4347 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4348 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4349 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4350 void arm_correlate_fast_opt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4351 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4352 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4353 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4354 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4355 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4356 q15_t * pScratch);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4357
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4358
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4359 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4360 * @brief Correlation of Q31 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4361 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4362 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4363 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4364 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4365 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4366 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4367 void arm_correlate_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4368 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4369 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4370 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4371 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4372 q31_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4373
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4374
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4375 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4376 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4377 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4378 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4379 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4380 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4381 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4382 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4383 void arm_correlate_fast_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4384 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4385 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4386 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4387 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4388 q31_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4389
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4390
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4391 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4392 * @brief Correlation of Q7 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4393 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4394 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4395 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4396 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4397 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4398 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4399 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4400 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4401 void arm_correlate_opt_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4402 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4403 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4404 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4405 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4406 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4407 q15_t * pScratch1,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4408 q15_t * pScratch2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4409
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4410
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4411 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4412 * @brief Correlation of Q7 sequences.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4413 * @param[in] pSrcA points to the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4414 * @param[in] srcALen length of the first input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4415 * @param[in] pSrcB points to the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4416 * @param[in] srcBLen length of the second input sequence.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4417 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4418 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4419 void arm_correlate_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4420 q7_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4421 uint32_t srcALen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4422 q7_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4423 uint32_t srcBLen,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4424 q7_t * pDst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4425
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4426
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4427 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4428 * @brief Instance structure for the floating-point sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4429 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4430 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4431 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4432 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4433 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4434 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4435 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4436 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4437 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4438 } arm_fir_sparse_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4439
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4440 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4441 * @brief Instance structure for the Q31 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4442 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4443 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4444 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4445 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4446 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4447 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4448 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4449 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4450 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4451 } arm_fir_sparse_instance_q31;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4452
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4453 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4454 * @brief Instance structure for the Q15 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4455 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4456 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4457 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4458 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4459 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4460 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4461 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4462 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4463 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4464 } arm_fir_sparse_instance_q15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4465
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4466 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4467 * @brief Instance structure for the Q7 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4468 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4469 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4470 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4471 uint16_t numTaps; /**< number of coefficients in the filter. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4472 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4473 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4474 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4475 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4476 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4477 } arm_fir_sparse_instance_q7;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4478
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4479
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4480 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4481 * @brief Processing function for the floating-point sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4482 * @param[in] S points to an instance of the floating-point sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4483 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4484 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4485 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4486 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4487 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4488 void arm_fir_sparse_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4489 arm_fir_sparse_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4490 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4491 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4492 float32_t * pScratchIn,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4493 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4494
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4495
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4496 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4497 * @brief Initialization function for the floating-point sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4498 * @param[in,out] S points to an instance of the floating-point sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4499 * @param[in] numTaps number of nonzero coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4500 * @param[in] pCoeffs points to the array of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4501 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4502 * @param[in] pTapDelay points to the array of offset times.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4503 * @param[in] maxDelay maximum offset time supported.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4504 * @param[in] blockSize number of samples that will be processed per block.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4505 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4506 void arm_fir_sparse_init_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4507 arm_fir_sparse_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4508 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4509 float32_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4510 float32_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4511 int32_t * pTapDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4512 uint16_t maxDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4513 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4514
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4515
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4516 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4517 * @brief Processing function for the Q31 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4518 * @param[in] S points to an instance of the Q31 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4519 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4520 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4521 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4522 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4523 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4524 void arm_fir_sparse_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4525 arm_fir_sparse_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4526 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4527 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4528 q31_t * pScratchIn,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4529 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4530
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4531
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4532 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4533 * @brief Initialization function for the Q31 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4534 * @param[in,out] S points to an instance of the Q31 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4535 * @param[in] numTaps number of nonzero coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4536 * @param[in] pCoeffs points to the array of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4537 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4538 * @param[in] pTapDelay points to the array of offset times.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4539 * @param[in] maxDelay maximum offset time supported.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4540 * @param[in] blockSize number of samples that will be processed per block.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4541 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4542 void arm_fir_sparse_init_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4543 arm_fir_sparse_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4544 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4545 q31_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4546 q31_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4547 int32_t * pTapDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4548 uint16_t maxDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4549 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4550
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4551
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4552 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4553 * @brief Processing function for the Q15 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4554 * @param[in] S points to an instance of the Q15 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4555 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4556 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4557 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4558 * @param[in] pScratchOut points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4559 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4560 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4561 void arm_fir_sparse_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4562 arm_fir_sparse_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4563 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4564 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4565 q15_t * pScratchIn,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4566 q31_t * pScratchOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4567 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4568
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4569
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4570 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4571 * @brief Initialization function for the Q15 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4572 * @param[in,out] S points to an instance of the Q15 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4573 * @param[in] numTaps number of nonzero coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4574 * @param[in] pCoeffs points to the array of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4575 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4576 * @param[in] pTapDelay points to the array of offset times.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4577 * @param[in] maxDelay maximum offset time supported.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4578 * @param[in] blockSize number of samples that will be processed per block.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4579 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4580 void arm_fir_sparse_init_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4581 arm_fir_sparse_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4582 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4583 q15_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4584 q15_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4585 int32_t * pTapDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4586 uint16_t maxDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4587 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4588
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4589
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4590 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4591 * @brief Processing function for the Q7 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4592 * @param[in] S points to an instance of the Q7 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4593 * @param[in] pSrc points to the block of input data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4594 * @param[out] pDst points to the block of output data
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4595 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4596 * @param[in] pScratchOut points to a temporary buffer of size blockSize.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4597 * @param[in] blockSize number of input samples to process per call.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4598 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4599 void arm_fir_sparse_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4600 arm_fir_sparse_instance_q7 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4601 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4602 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4603 q7_t * pScratchIn,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4604 q31_t * pScratchOut,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4605 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4606
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4607
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4608 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4609 * @brief Initialization function for the Q7 sparse FIR filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4610 * @param[in,out] S points to an instance of the Q7 sparse FIR structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4611 * @param[in] numTaps number of nonzero coefficients in the filter.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4612 * @param[in] pCoeffs points to the array of filter coefficients.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4613 * @param[in] pState points to the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4614 * @param[in] pTapDelay points to the array of offset times.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4615 * @param[in] maxDelay maximum offset time supported.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4616 * @param[in] blockSize number of samples that will be processed per block.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4617 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4618 void arm_fir_sparse_init_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4619 arm_fir_sparse_instance_q7 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4620 uint16_t numTaps,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4621 q7_t * pCoeffs,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4622 q7_t * pState,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4623 int32_t * pTapDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4624 uint16_t maxDelay,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4625 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4626
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4627
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4628 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4629 * @brief Floating-point sin_cos function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4630 * @param[in] theta input value in degrees
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4631 * @param[out] pSinVal points to the processed sine output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4632 * @param[out] pCosVal points to the processed cos output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4633 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4634 void arm_sin_cos_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4635 float32_t theta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4636 float32_t * pSinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4637 float32_t * pCosVal);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4638
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4639
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4640 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4641 * @brief Q31 sin_cos function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4642 * @param[in] theta scaled input value in degrees
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4643 * @param[out] pSinVal points to the processed sine output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4644 * @param[out] pCosVal points to the processed cosine output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4645 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4646 void arm_sin_cos_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4647 q31_t theta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4648 q31_t * pSinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4649 q31_t * pCosVal);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4650
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4651
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4652 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4653 * @brief Floating-point complex conjugate.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4654 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4655 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4656 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4657 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4658 void arm_cmplx_conj_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4659 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4660 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4661 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4662
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4663 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4664 * @brief Q31 complex conjugate.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4665 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4666 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4667 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4668 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4669 void arm_cmplx_conj_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4670 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4671 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4672 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4673
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4674
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4675 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4676 * @brief Q15 complex conjugate.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4677 * @param[in] pSrc points to the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4678 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4679 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4680 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4681 void arm_cmplx_conj_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4682 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4683 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4684 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4685
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4686
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4687 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4688 * @brief Floating-point complex magnitude squared
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4689 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4690 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4691 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4692 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4693 void arm_cmplx_mag_squared_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4694 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4695 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4696 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4697
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4698
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4699 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4700 * @brief Q31 complex magnitude squared
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4701 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4702 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4703 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4704 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4705 void arm_cmplx_mag_squared_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4706 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4707 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4708 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4709
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4710
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4711 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4712 * @brief Q15 complex magnitude squared
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4713 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4714 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4715 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4716 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4717 void arm_cmplx_mag_squared_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4718 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4719 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4720 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4721
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4722
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4723 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4724 * @ingroup groupController
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4725 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4726
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4727 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4728 * @defgroup PID PID Motor Control
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4729 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4730 * A Proportional Integral Derivative (PID) controller is a generic feedback control
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4731 * loop mechanism widely used in industrial control systems.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4732 * A PID controller is the most commonly used type of feedback controller.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4733 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4734 * This set of functions implements (PID) controllers
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4735 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4736 * of data and each call to the function returns a single processed value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4737 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4738 * is the input sample value. The functions return the output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4739 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4740 * \par Algorithm:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4741 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4742 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4743 * A0 = Kp + Ki + Kd
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4744 * A1 = (-Kp ) - (2 * Kd )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4745 * A2 = Kd </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4746 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4747 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4748 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4749 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4750 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4751 * \image html PID.gif "Proportional Integral Derivative Controller"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4752 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4753 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4754 * The PID controller calculates an "error" value as the difference between
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4755 * the measured output and the reference input.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4756 * The controller attempts to minimize the error by adjusting the process control inputs.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4757 * The proportional value determines the reaction to the current error,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4758 * the integral value determines the reaction based on the sum of recent errors,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4759 * and the derivative value determines the reaction based on the rate at which the error has been changing.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4760 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4761 * \par Instance Structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4762 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4763 * A separate instance structure must be defined for each PID Controller.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4764 * There are separate instance structure declarations for each of the 3 supported data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4765 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4766 * \par Reset Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4767 * There is also an associated reset function for each data type which clears the state array.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4768 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4769 * \par Initialization Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4770 * There is also an associated initialization function for each data type.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4771 * The initialization function performs the following operations:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4772 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4773 * - Zeros out the values in the state buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4774 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4775 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4776 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4777 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4778 * \par Fixed-Point Behavior
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4779 * Care must be taken when using the fixed-point versions of the PID Controller functions.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4780 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4781 * Refer to the function specific documentation below for usage guidelines.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4782 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4783
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4784 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4785 * @addtogroup PID
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4786 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4787 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4788
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4789 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4790 * @brief Process function for the floating-point PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4791 * @param[in,out] S is an instance of the floating-point PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4792 * @param[in] in input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4793 * @return out processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4794 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4795 static __INLINE float32_t arm_pid_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4796 arm_pid_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4797 float32_t in)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4798 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4799 float32_t out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4800
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4801 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4802 out = (S->A0 * in) +
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4803 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4804
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4805 /* Update state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4806 S->state[1] = S->state[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4807 S->state[0] = in;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4808 S->state[2] = out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4809
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4810 /* return to application */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4811 return (out);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4812
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4813 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4814
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4815 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4816 * @brief Process function for the Q31 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4817 * @param[in,out] S points to an instance of the Q31 PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4818 * @param[in] in input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4819 * @return out processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4820 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4821 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4822 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4823 * The function is implemented using an internal 64-bit accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4824 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4825 * Thus, if the accumulator result overflows it wraps around rather than clip.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4826 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4827 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4828 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4829 static __INLINE q31_t arm_pid_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4830 arm_pid_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4831 q31_t in)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4832 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4833 q63_t acc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4834 q31_t out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4836 /* acc = A0 * x[n] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4837 acc = (q63_t) S->A0 * in;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4838
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4839 /* acc += A1 * x[n-1] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4840 acc += (q63_t) S->A1 * S->state[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4841
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4842 /* acc += A2 * x[n-2] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4843 acc += (q63_t) S->A2 * S->state[1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4844
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4845 /* convert output to 1.31 format to add y[n-1] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4846 out = (q31_t) (acc >> 31u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4847
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4848 /* out += y[n-1] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4849 out += S->state[2];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4850
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4851 /* Update state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4852 S->state[1] = S->state[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4853 S->state[0] = in;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4854 S->state[2] = out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4855
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4856 /* return to application */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4857 return (out);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4858 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4859
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4860
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4861 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4862 * @brief Process function for the Q15 PID Control.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4863 * @param[in,out] S points to an instance of the Q15 PID Control structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4864 * @param[in] in input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4865 * @return out processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4866 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4867 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4868 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4869 * The function is implemented using a 64-bit internal accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4870 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4871 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4872 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4873 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4874 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4875 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4876 static __INLINE q15_t arm_pid_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4877 arm_pid_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4878 q15_t in)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4879 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4880 q63_t acc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4881 q15_t out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4882
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4883 #ifndef ARM_MATH_CM0_FAMILY
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4884 __SIMD32_TYPE *vstate;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4885
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4886 /* Implementation of PID controller */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4887
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4888 /* acc = A0 * x[n] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4889 acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4890
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4891 /* acc += A1 * x[n-1] + A2 * x[n-2] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4892 vstate = __SIMD32_CONST(S->state);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4893 acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4894 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4895 /* acc = A0 * x[n] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4896 acc = ((q31_t) S->A0) * in;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4897
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4898 /* acc += A1 * x[n-1] + A2 * x[n-2] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4899 acc += (q31_t) S->A1 * S->state[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4900 acc += (q31_t) S->A2 * S->state[1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4901 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4902
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4903 /* acc += y[n-1] */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4904 acc += (q31_t) S->state[2] << 15;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4905
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4906 /* saturate the output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4907 out = (q15_t) (__SSAT((acc >> 15), 16));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4908
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4909 /* Update state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4910 S->state[1] = S->state[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4911 S->state[0] = in;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4912 S->state[2] = out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4913
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4914 /* return to application */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4915 return (out);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4916 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4917
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4918 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4919 * @} end of PID group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4920 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4921
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4922
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4923 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4924 * @brief Floating-point matrix inverse.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4925 * @param[in] src points to the instance of the input floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4926 * @param[out] dst points to the instance of the output floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4927 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4928 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4929 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4930 arm_status arm_mat_inverse_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4931 const arm_matrix_instance_f32 * src,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4932 arm_matrix_instance_f32 * dst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4933
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4934
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4935 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4936 * @brief Floating-point matrix inverse.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4937 * @param[in] src points to the instance of the input floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4938 * @param[out] dst points to the instance of the output floating-point matrix structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4939 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4940 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4941 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4942 arm_status arm_mat_inverse_f64(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4943 const arm_matrix_instance_f64 * src,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4944 arm_matrix_instance_f64 * dst);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4945
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4946
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4947
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4948 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4949 * @ingroup groupController
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4950 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4951
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4952 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4953 * @defgroup clarke Vector Clarke Transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4954 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4955 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4956 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4957 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4958 * \image html clarke.gif Stator current space vector and its components in (a,b).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4959 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4960 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4961 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4962 * The function operates on a single sample of data and each call to the function returns the processed output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4963 * The library provides separate functions for Q31 and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4964 * \par Algorithm
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4965 * \image html clarkeFormula.gif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4966 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4967 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4968 * \par Fixed-Point Behavior
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4969 * Care must be taken when using the Q31 version of the Clarke transform.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4970 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4971 * Refer to the function specific documentation below for usage guidelines.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4972 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4973
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4974 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4975 * @addtogroup clarke
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4976 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4977 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4978
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4979 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4980 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4981 * @brief Floating-point Clarke transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4982 * @param[in] Ia input three-phase coordinate <code>a</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4983 * @param[in] Ib input three-phase coordinate <code>b</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4984 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4985 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4986 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4987 static __INLINE void arm_clarke_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4988 float32_t Ia,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4989 float32_t Ib,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4990 float32_t * pIalpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4991 float32_t * pIbeta)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4992 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4993 /* Calculate pIalpha using the equation, pIalpha = Ia */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4994 *pIalpha = Ia;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4995
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4996 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4997 *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4998 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4999
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5000
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5001 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5002 * @brief Clarke transform for Q31 version
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5003 * @param[in] Ia input three-phase coordinate <code>a</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5004 * @param[in] Ib input three-phase coordinate <code>b</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5005 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5006 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5007 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5008 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5009 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5010 * The function is implemented using an internal 32-bit accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5011 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5012 * There is saturation on the addition, hence there is no risk of overflow.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5013 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5014 static __INLINE void arm_clarke_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5015 q31_t Ia,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5016 q31_t Ib,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5017 q31_t * pIalpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5018 q31_t * pIbeta)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5019 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5020 q31_t product1, product2; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5021
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5022 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5023 *pIalpha = Ia;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5024
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5025 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5026 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5027
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5028 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5029 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5030
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5031 /* pIbeta is calculated by adding the intermediate products */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5032 *pIbeta = __QADD(product1, product2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5033 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5034
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5035 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5036 * @} end of clarke group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5037 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5038
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5039 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5040 * @brief Converts the elements of the Q7 vector to Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5041 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5042 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5043 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5044 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5045 void arm_q7_to_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5046 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5047 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5048 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5049
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5050
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5051
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5052 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5053 * @ingroup groupController
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5054 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5055
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5056 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5057 * @defgroup inv_clarke Vector Inverse Clarke Transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5058 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5059 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5060 * The function operates on a single sample of data and each call to the function returns the processed output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5061 * The library provides separate functions for Q31 and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5062 * \par Algorithm
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5063 * \image html clarkeInvFormula.gif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5064 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5065 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5066 * \par Fixed-Point Behavior
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5067 * Care must be taken when using the Q31 version of the Clarke transform.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5068 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5069 * Refer to the function specific documentation below for usage guidelines.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5070 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5071
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5072 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5073 * @addtogroup inv_clarke
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5074 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5075 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5076
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5077 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5078 * @brief Floating-point Inverse Clarke transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5079 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5080 * @param[in] Ibeta input two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5081 * @param[out] pIa points to output three-phase coordinate <code>a</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5082 * @param[out] pIb points to output three-phase coordinate <code>b</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5083 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5084 static __INLINE void arm_inv_clarke_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5085 float32_t Ialpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5086 float32_t Ibeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5087 float32_t * pIa,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5088 float32_t * pIb)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5089 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5090 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5091 *pIa = Ialpha;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5092
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5093 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5094 *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5095 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5096
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5097
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5098 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5099 * @brief Inverse Clarke transform for Q31 version
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5100 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5101 * @param[in] Ibeta input two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5102 * @param[out] pIa points to output three-phase coordinate <code>a</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5103 * @param[out] pIb points to output three-phase coordinate <code>b</code>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5104 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5105 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5106 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5107 * The function is implemented using an internal 32-bit accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5108 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5109 * There is saturation on the subtraction, hence there is no risk of overflow.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5110 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5111 static __INLINE void arm_inv_clarke_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5112 q31_t Ialpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5113 q31_t Ibeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5114 q31_t * pIa,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5115 q31_t * pIb)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5116 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5117 q31_t product1, product2; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5118
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5119 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5120 *pIa = Ialpha;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5121
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5122 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5123 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5124
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5125 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5126 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5127
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5128 /* pIb is calculated by subtracting the products */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5129 *pIb = __QSUB(product2, product1);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5130 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5131
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5132 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5133 * @} end of inv_clarke group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5134 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5135
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5136 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5137 * @brief Converts the elements of the Q7 vector to Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5138 * @param[in] pSrc input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5139 * @param[out] pDst output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5140 * @param[in] blockSize number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5141 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5142 void arm_q7_to_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5143 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5144 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5145 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5146
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5147
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5148
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5149 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5150 * @ingroup groupController
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5151 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5152
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5153 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5154 * @defgroup park Vector Park Transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5155 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5156 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5157 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5158 * from the stationary to the moving reference frame and control the spatial relationship between
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5159 * the stator vector current and rotor flux vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5160 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5161 * current vector and the relationship from the two reference frames:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5162 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5163 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5164 * The function operates on a single sample of data and each call to the function returns the processed output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5165 * The library provides separate functions for Q31 and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5166 * \par Algorithm
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5167 * \image html parkFormula.gif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5168 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5169 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5170 * cosine and sine values of theta (rotor flux position).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5171 * \par Fixed-Point Behavior
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5172 * Care must be taken when using the Q31 version of the Park transform.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5173 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5174 * Refer to the function specific documentation below for usage guidelines.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5175 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5176
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5177 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5178 * @addtogroup park
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5179 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5180 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5181
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5182 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5183 * @brief Floating-point Park transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5184 * @param[in] Ialpha input two-phase vector coordinate alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5185 * @param[in] Ibeta input two-phase vector coordinate beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5186 * @param[out] pId points to output rotor reference frame d
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5187 * @param[out] pIq points to output rotor reference frame q
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5188 * @param[in] sinVal sine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5189 * @param[in] cosVal cosine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5190 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5191 * The function implements the forward Park transform.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5192 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5193 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5194 static __INLINE void arm_park_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5195 float32_t Ialpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5196 float32_t Ibeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5197 float32_t * pId,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5198 float32_t * pIq,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5199 float32_t sinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5200 float32_t cosVal)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5201 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5202 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5203 *pId = Ialpha * cosVal + Ibeta * sinVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5204
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5205 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5206 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5207 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5208
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5209
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5210 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5211 * @brief Park transform for Q31 version
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5212 * @param[in] Ialpha input two-phase vector coordinate alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5213 * @param[in] Ibeta input two-phase vector coordinate beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5214 * @param[out] pId points to output rotor reference frame d
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5215 * @param[out] pIq points to output rotor reference frame q
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5216 * @param[in] sinVal sine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5217 * @param[in] cosVal cosine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5218 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5219 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5220 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5221 * The function is implemented using an internal 32-bit accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5222 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5223 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5224 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5225 static __INLINE void arm_park_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5226 q31_t Ialpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5227 q31_t Ibeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5228 q31_t * pId,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5229 q31_t * pIq,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5230 q31_t sinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5231 q31_t cosVal)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5232 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5233 q31_t product1, product2; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5234 q31_t product3, product4; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5235
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5236 /* Intermediate product is calculated by (Ialpha * cosVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5237 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5238
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5239 /* Intermediate product is calculated by (Ibeta * sinVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5240 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5241
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5242
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5243 /* Intermediate product is calculated by (Ialpha * sinVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5244 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5245
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5246 /* Intermediate product is calculated by (Ibeta * cosVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5247 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5248
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5249 /* Calculate pId by adding the two intermediate products 1 and 2 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5250 *pId = __QADD(product1, product2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5251
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5252 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5253 *pIq = __QSUB(product4, product3);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5254 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5255
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5256 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5257 * @} end of park group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5258 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5259
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5260 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5261 * @brief Converts the elements of the Q7 vector to floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5262 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5263 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5264 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5265 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5266 void arm_q7_to_float(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5267 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5268 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5269 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5270
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5271
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5272 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5273 * @ingroup groupController
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5274 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5275
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5276 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5277 * @defgroup inv_park Vector Inverse Park transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5278 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5279 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5280 * The function operates on a single sample of data and each call to the function returns the processed output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5281 * The library provides separate functions for Q31 and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5282 * \par Algorithm
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5283 * \image html parkInvFormula.gif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5284 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5285 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5286 * cosine and sine values of theta (rotor flux position).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5287 * \par Fixed-Point Behavior
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5288 * Care must be taken when using the Q31 version of the Park transform.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5289 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5290 * Refer to the function specific documentation below for usage guidelines.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5291 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5292
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5293 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5294 * @addtogroup inv_park
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5295 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5296 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5297
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5298 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5299 * @brief Floating-point Inverse Park transform
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5300 * @param[in] Id input coordinate of rotor reference frame d
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5301 * @param[in] Iq input coordinate of rotor reference frame q
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5302 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5303 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5304 * @param[in] sinVal sine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5305 * @param[in] cosVal cosine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5306 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5307 static __INLINE void arm_inv_park_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5308 float32_t Id,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5309 float32_t Iq,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5310 float32_t * pIalpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5311 float32_t * pIbeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5312 float32_t sinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5313 float32_t cosVal)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5314 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5315 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5316 *pIalpha = Id * cosVal - Iq * sinVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5317
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5318 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5319 *pIbeta = Id * sinVal + Iq * cosVal;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5320 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5321
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5322
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5323 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5324 * @brief Inverse Park transform for Q31 version
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5325 * @param[in] Id input coordinate of rotor reference frame d
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5326 * @param[in] Iq input coordinate of rotor reference frame q
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5327 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5328 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5329 * @param[in] sinVal sine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5330 * @param[in] cosVal cosine value of rotation angle theta
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5331 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5332 * <b>Scaling and Overflow Behavior:</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5333 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5334 * The function is implemented using an internal 32-bit accumulator.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5335 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5336 * There is saturation on the addition, hence there is no risk of overflow.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5337 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5338 static __INLINE void arm_inv_park_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5339 q31_t Id,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5340 q31_t Iq,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5341 q31_t * pIalpha,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5342 q31_t * pIbeta,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5343 q31_t sinVal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5344 q31_t cosVal)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5345 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5346 q31_t product1, product2; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5347 q31_t product3, product4; /* Temporary variables used to store intermediate results */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5348
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5349 /* Intermediate product is calculated by (Id * cosVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5350 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5351
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5352 /* Intermediate product is calculated by (Iq * sinVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5353 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5354
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5355
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5356 /* Intermediate product is calculated by (Id * sinVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5357 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5358
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5359 /* Intermediate product is calculated by (Iq * cosVal) */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5360 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5361
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5362 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5363 *pIalpha = __QSUB(product1, product2);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5364
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5365 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5366 *pIbeta = __QADD(product4, product3);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5367 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5368
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5369 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5370 * @} end of Inverse park group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5371 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5372
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5373
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5374 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5375 * @brief Converts the elements of the Q31 vector to floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5376 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5377 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5378 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5379 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5380 void arm_q31_to_float(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5381 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5382 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5383 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5384
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5385 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5386 * @ingroup groupInterpolation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5387 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5388
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5389 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5390 * @defgroup LinearInterpolate Linear Interpolation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5391 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5392 * Linear interpolation is a method of curve fitting using linear polynomials.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5393 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5394 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5395 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5396 * \image html LinearInterp.gif "Linear interpolation"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5397 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5398 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5399 * A Linear Interpolate function calculates an output value(y), for the input(x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5400 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5401 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5402 * \par Algorithm:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5403 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5404 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5405 * where x0, x1 are nearest values of input x
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5406 * y0, y1 are nearest values to output y
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5407 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5408 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5409 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5410 * This set of functions implements Linear interpolation process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5411 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5412 * sample of data and each call to the function returns a single processed value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5413 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5414 * <code>x</code> is the input sample value. The functions returns the output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5415 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5416 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5417 * if x is outside of the table boundary, Linear interpolation returns first value of the table
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5418 * if x is below input range and returns last value of table if x is above range.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5419 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5420
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5421 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5422 * @addtogroup LinearInterpolate
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5423 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5424 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5425
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5426 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5427 * @brief Process function for the floating-point Linear Interpolation Function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5428 * @param[in,out] S is an instance of the floating-point Linear Interpolation structure
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5429 * @param[in] x input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5430 * @return y processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5431 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5432 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5433 static __INLINE float32_t arm_linear_interp_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5434 arm_linear_interp_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5435 float32_t x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5436 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5437 float32_t y;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5438 float32_t x0, x1; /* Nearest input values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5439 float32_t y0, y1; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5440 float32_t xSpacing = S->xSpacing; /* spacing between input values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5441 int32_t i; /* Index variable */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5442 float32_t *pYData = S->pYData; /* pointer to output table */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5443
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5444 /* Calculation of index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5445 i = (int32_t) ((x - S->x1) / xSpacing);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5446
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5447 if(i < 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5448 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5449 /* Iniatilize output for below specified range as least output value of table */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5450 y = pYData[0];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5451 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5452 else if((uint32_t)i >= S->nValues)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5453 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5454 /* Iniatilize output for above specified range as last output value of table */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5455 y = pYData[S->nValues - 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5456 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5457 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5458 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5459 /* Calculation of nearest input values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5460 x0 = S->x1 + i * xSpacing;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5461 x1 = S->x1 + (i + 1) * xSpacing;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5462
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5463 /* Read of nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5464 y0 = pYData[i];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5465 y1 = pYData[i + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5466
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5467 /* Calculation of output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5468 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5469
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5470 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5471
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5472 /* returns output value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5473 return (y);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5474 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5475
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5476
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5477 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5478 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5479 * @brief Process function for the Q31 Linear Interpolation Function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5480 * @param[in] pYData pointer to Q31 Linear Interpolation table
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5481 * @param[in] x input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5482 * @param[in] nValues number of table values
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5483 * @return y processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5484 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5485 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5486 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5487 * This function can support maximum of table size 2^12.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5488 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5489 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5490 static __INLINE q31_t arm_linear_interp_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5491 q31_t * pYData,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5492 q31_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5493 uint32_t nValues)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5494 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5495 q31_t y; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5496 q31_t y0, y1; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5497 q31_t fract; /* fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5498 int32_t index; /* Index to read nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5499
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5500 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5501 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5502 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5503 index = ((x & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5504
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5505 if(index >= (int32_t)(nValues - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5506 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5507 return (pYData[nValues - 1]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5508 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5509 else if(index < 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5510 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5511 return (pYData[0]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5512 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5513 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5514 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5515 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5516 /* shift left by 11 to keep fract in 1.31 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5517 fract = (x & 0x000FFFFF) << 11;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5518
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5519 /* Read two nearest output values from the index in 1.31(q31) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5520 y0 = pYData[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5521 y1 = pYData[index + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5522
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5523 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5524 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5525
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5526 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5527 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5528
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5529 /* Convert y to 1.31 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5530 return (y << 1u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5531 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5532 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5533
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5534
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5535 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5536 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5537 * @brief Process function for the Q15 Linear Interpolation Function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5538 * @param[in] pYData pointer to Q15 Linear Interpolation table
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5539 * @param[in] x input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5540 * @param[in] nValues number of table values
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5541 * @return y processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5542 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5543 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5544 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5545 * This function can support maximum of table size 2^12.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5546 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5547 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5548 static __INLINE q15_t arm_linear_interp_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5549 q15_t * pYData,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5550 q31_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5551 uint32_t nValues)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5552 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5553 q63_t y; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5554 q15_t y0, y1; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5555 q31_t fract; /* fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5556 int32_t index; /* Index to read nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5557
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5558 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5559 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5560 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5561 index = ((x & (int32_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5562
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5563 if(index >= (int32_t)(nValues - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5564 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5565 return (pYData[nValues - 1]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5566 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5567 else if(index < 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5568 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5569 return (pYData[0]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5570 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5571 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5572 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5573 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5574 /* fract is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5575 fract = (x & 0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5576
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5577 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5578 y0 = pYData[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5579 y1 = pYData[index + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5580
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5581 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5582 y = ((q63_t) y0 * (0xFFFFF - fract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5583
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5584 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5585 y += ((q63_t) y1 * (fract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5586
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5587 /* convert y to 1.15 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5588 return (q15_t) (y >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5589 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5590 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5591
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5592
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5593 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5594 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5595 * @brief Process function for the Q7 Linear Interpolation Function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5596 * @param[in] pYData pointer to Q7 Linear Interpolation table
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5597 * @param[in] x input sample to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5598 * @param[in] nValues number of table values
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5599 * @return y processed output sample.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5600 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5601 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5602 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5603 * This function can support maximum of table size 2^12.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5604 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5605 static __INLINE q7_t arm_linear_interp_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5606 q7_t * pYData,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5607 q31_t x,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5608 uint32_t nValues)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5609 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5610 q31_t y; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5611 q7_t y0, y1; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5612 q31_t fract; /* fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5613 uint32_t index; /* Index to read nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5614
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5615 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5616 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5617 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5618 if (x < 0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5619 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5620 return (pYData[0]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5621 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5622 index = (x >> 20) & 0xfff;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5623
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5624 if(index >= (nValues - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5625 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5626 return (pYData[nValues - 1]);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5627 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5628 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5629 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5630 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5631 /* fract is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5632 fract = (x & 0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5633
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5634 /* Read two nearest output values from the index and are in 1.7(q7) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5635 y0 = pYData[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5636 y1 = pYData[index + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5637
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5638 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5639 y = ((y0 * (0xFFFFF - fract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5640
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5641 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5642 y += (y1 * fract);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5643
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5644 /* convert y to 1.7(q7) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5645 return (q7_t) (y >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5646 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5647 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5648
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5649 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5650 * @} end of LinearInterpolate group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5651 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5652
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5653 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5654 * @brief Fast approximation to the trigonometric sine function for floating-point data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5655 * @param[in] x input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5656 * @return sin(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5657 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5658 float32_t arm_sin_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5659 float32_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5660
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5661
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5662 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5663 * @brief Fast approximation to the trigonometric sine function for Q31 data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5664 * @param[in] x Scaled input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5665 * @return sin(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5666 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5667 q31_t arm_sin_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5668 q31_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5669
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5670
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5671 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5672 * @brief Fast approximation to the trigonometric sine function for Q15 data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5673 * @param[in] x Scaled input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5674 * @return sin(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5675 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5676 q15_t arm_sin_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5677 q15_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5678
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5679
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5680 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5681 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5682 * @param[in] x input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5683 * @return cos(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5684 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5685 float32_t arm_cos_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5686 float32_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5687
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5688
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5689 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5690 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5691 * @param[in] x Scaled input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5692 * @return cos(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5693 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5694 q31_t arm_cos_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5695 q31_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5696
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5697
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5698 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5699 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5700 * @param[in] x Scaled input value in radians.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5701 * @return cos(x).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5702 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5703 q15_t arm_cos_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5704 q15_t x);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5705
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5706
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5707 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5708 * @ingroup groupFastMath
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5709 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5710
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5711
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5712 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5713 * @defgroup SQRT Square Root
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5714 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5715 * Computes the square root of a number.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5716 * There are separate functions for Q15, Q31, and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5717 * The square root function is computed using the Newton-Raphson algorithm.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5718 * This is an iterative algorithm of the form:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5719 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5720 * x1 = x0 - f(x0)/f'(x0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5721 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5722 * where <code>x1</code> is the current estimate,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5723 * <code>x0</code> is the previous estimate, and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5724 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5725 * For the square root function, the algorithm reduces to:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5726 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5727 * x0 = in/2 [initial guess]
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5728 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5729 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5730 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5731
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5732
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5733 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5734 * @addtogroup SQRT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5735 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5736 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5737
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5738 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5739 * @brief Floating-point square root function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5740 * @param[in] in input value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5741 * @param[out] pOut square root of input value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5742 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5743 * <code>in</code> is negative value and returns zero output for negative values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5744 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5745 static __INLINE arm_status arm_sqrt_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5746 float32_t in,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5747 float32_t * pOut)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5748 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5749 if(in >= 0.0f)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5750 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5751
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5752 #if (__FPU_USED == 1) && defined ( __CC_ARM )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5753 *pOut = __sqrtf(in);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5754 #elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5755 *pOut = __builtin_sqrtf(in);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5756 #elif (__FPU_USED == 1) && defined(__GNUC__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5757 *pOut = __builtin_sqrtf(in);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5758 #elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5759 __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5760 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5761 *pOut = sqrtf(in);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5762 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5763
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5764 return (ARM_MATH_SUCCESS);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5765 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5766 else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5767 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5768 *pOut = 0.0f;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5769 return (ARM_MATH_ARGUMENT_ERROR);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5770 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5771 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5772
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5773
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5774 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5775 * @brief Q31 square root function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5776 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5777 * @param[out] pOut square root of input value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5778 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5779 * <code>in</code> is negative value and returns zero output for negative values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5780 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5781 arm_status arm_sqrt_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5782 q31_t in,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5783 q31_t * pOut);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5784
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5785
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5786 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5787 * @brief Q15 square root function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5788 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5789 * @param[out] pOut square root of input value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5790 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5791 * <code>in</code> is negative value and returns zero output for negative values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5792 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5793 arm_status arm_sqrt_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5794 q15_t in,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5795 q15_t * pOut);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5796
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5797 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5798 * @} end of SQRT group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5799 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5800
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5801
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5802 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5803 * @brief floating-point Circular write function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5804 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5805 static __INLINE void arm_circularWrite_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5806 int32_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5807 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5808 uint16_t * writeOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5809 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5810 const int32_t * src,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5811 int32_t srcInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5812 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5813 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5814 uint32_t i = 0u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5815 int32_t wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5816
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5817 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5818 * to the current location where the input samples to be copied */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5819 wOffset = *writeOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5820
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5821 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5822 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5823
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5824 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5825 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5826 /* copy the input sample to the circular buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5827 circBuffer[wOffset] = *src;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5828
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5829 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5830 src += srcInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5831
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5832 /* Circularly update wOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5833 wOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5834 if(wOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5835 wOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5836
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5837 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5838 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5839 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5840
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5841 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5842 *writeOffset = (uint16_t)wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5843 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5844
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5845
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5846
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5847 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5848 * @brief floating-point Circular Read function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5849 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5850 static __INLINE void arm_circularRead_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5851 int32_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5852 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5853 int32_t * readOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5854 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5855 int32_t * dst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5856 int32_t * dst_base,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5857 int32_t dst_length,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5858 int32_t dstInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5859 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5860 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5861 uint32_t i = 0u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5862 int32_t rOffset, dst_end;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5863
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5864 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5865 * to the current location from where the input samples to be read */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5866 rOffset = *readOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5867 dst_end = (int32_t) (dst_base + dst_length);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5868
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5869 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5870 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5871
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5872 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5873 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5874 /* copy the sample from the circular buffer to the destination buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5875 *dst = circBuffer[rOffset];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5876
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5877 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5878 dst += dstInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5879
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5880 if(dst == (int32_t *) dst_end)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5881 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5882 dst = dst_base;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5883 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5884
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5885 /* Circularly update rOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5886 rOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5887
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5888 if(rOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5889 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5890 rOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5891 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5892
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5893 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5894 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5895 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5896
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5897 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5898 *readOffset = rOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5899 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5900
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5901
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5902 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5903 * @brief Q15 Circular write function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5904 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5905 static __INLINE void arm_circularWrite_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5906 q15_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5907 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5908 uint16_t * writeOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5909 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5910 const q15_t * src,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5911 int32_t srcInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5912 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5913 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5914 uint32_t i = 0u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5915 int32_t wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5916
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5917 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5918 * to the current location where the input samples to be copied */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5919 wOffset = *writeOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5920
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5921 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5922 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5923
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5924 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5925 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5926 /* copy the input sample to the circular buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5927 circBuffer[wOffset] = *src;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5928
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5929 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5930 src += srcInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5931
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5932 /* Circularly update wOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5933 wOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5934 if(wOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5935 wOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5936
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5937 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5938 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5939 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5940
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5941 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5942 *writeOffset = (uint16_t)wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5943 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5944
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5945
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5946 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5947 * @brief Q15 Circular Read function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5948 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5949 static __INLINE void arm_circularRead_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5950 q15_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5951 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5952 int32_t * readOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5953 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5954 q15_t * dst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5955 q15_t * dst_base,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5956 int32_t dst_length,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5957 int32_t dstInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5958 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5959 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5960 uint32_t i = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5961 int32_t rOffset, dst_end;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5962
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5963 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5964 * to the current location from where the input samples to be read */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5965 rOffset = *readOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5966
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5967 dst_end = (int32_t) (dst_base + dst_length);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5968
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5969 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5970 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5971
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5972 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5973 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5974 /* copy the sample from the circular buffer to the destination buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5975 *dst = circBuffer[rOffset];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5976
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5977 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5978 dst += dstInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5979
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5980 if(dst == (q15_t *) dst_end)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5981 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5982 dst = dst_base;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5983 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5984
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5985 /* Circularly update wOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5986 rOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5987
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5988 if(rOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5989 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5990 rOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5991 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5992
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5993 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5994 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5995 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5996
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5997 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5998 *readOffset = rOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5999 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6000
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6001
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6002 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6003 * @brief Q7 Circular write function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6004 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6005 static __INLINE void arm_circularWrite_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6006 q7_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6007 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6008 uint16_t * writeOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6009 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6010 const q7_t * src,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6011 int32_t srcInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6012 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6013 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6014 uint32_t i = 0u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6015 int32_t wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6016
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6017 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6018 * to the current location where the input samples to be copied */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6019 wOffset = *writeOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6020
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6021 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6022 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6023
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6024 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6025 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6026 /* copy the input sample to the circular buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6027 circBuffer[wOffset] = *src;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6028
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6029 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6030 src += srcInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6031
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6032 /* Circularly update wOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6033 wOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6034 if(wOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6035 wOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6036
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6037 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6038 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6039 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6040
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6041 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6042 *writeOffset = (uint16_t)wOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6043 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6044
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6045
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6046 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6047 * @brief Q7 Circular Read function.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6048 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6049 static __INLINE void arm_circularRead_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6050 q7_t * circBuffer,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6051 int32_t L,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6052 int32_t * readOffset,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6053 int32_t bufferInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6054 q7_t * dst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6055 q7_t * dst_base,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6056 int32_t dst_length,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6057 int32_t dstInc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6058 uint32_t blockSize)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6059 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6060 uint32_t i = 0;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6061 int32_t rOffset, dst_end;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6062
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6063 /* Copy the value of Index pointer that points
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6064 * to the current location from where the input samples to be read */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6065 rOffset = *readOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6066
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6067 dst_end = (int32_t) (dst_base + dst_length);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6068
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6069 /* Loop over the blockSize */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6070 i = blockSize;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6071
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6072 while(i > 0u)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6073 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6074 /* copy the sample from the circular buffer to the destination buffer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6075 *dst = circBuffer[rOffset];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6076
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6077 /* Update the input pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6078 dst += dstInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6079
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6080 if(dst == (q7_t *) dst_end)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6081 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6082 dst = dst_base;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6083 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6084
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6085 /* Circularly update rOffset. Watch out for positive and negative value */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6086 rOffset += bufferInc;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6087
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6088 if(rOffset >= L)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6089 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6090 rOffset -= L;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6091 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6092
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6093 /* Decrement the loop counter */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6094 i--;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6095 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6096
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6097 /* Update the index pointer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6098 *readOffset = rOffset;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6099 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6100
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6101
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6102 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6103 * @brief Sum of the squares of the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6104 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6105 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6106 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6107 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6108 void arm_power_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6109 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6110 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6111 q63_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6112
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6113
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6114 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6115 * @brief Sum of the squares of the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6116 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6117 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6118 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6119 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6120 void arm_power_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6121 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6122 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6123 float32_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6124
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6125
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6126 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6127 * @brief Sum of the squares of the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6128 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6129 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6130 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6131 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6132 void arm_power_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6133 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6134 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6135 q63_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6136
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6137
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6138 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6139 * @brief Sum of the squares of the elements of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6140 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6141 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6142 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6143 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6144 void arm_power_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6145 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6146 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6147 q31_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6148
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6149
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6150 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6151 * @brief Mean value of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6152 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6153 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6154 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6155 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6156 void arm_mean_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6157 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6158 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6159 q7_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6160
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6161
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6162 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6163 * @brief Mean value of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6164 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6165 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6166 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6167 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6168 void arm_mean_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6169 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6170 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6171 q15_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6172
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6173
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6174 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6175 * @brief Mean value of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6176 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6177 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6178 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6179 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6180 void arm_mean_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6181 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6182 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6183 q31_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6184
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6185
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6186 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6187 * @brief Mean value of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6188 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6189 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6190 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6191 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6192 void arm_mean_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6193 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6194 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6195 float32_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6196
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6197
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6198 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6199 * @brief Variance of the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6200 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6201 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6202 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6203 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6204 void arm_var_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6205 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6206 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6207 float32_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6208
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6209
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6210 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6211 * @brief Variance of the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6212 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6213 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6214 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6215 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6216 void arm_var_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6217 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6218 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6219 q31_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6220
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6221
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6222 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6223 * @brief Variance of the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6224 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6225 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6226 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6227 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6228 void arm_var_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6229 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6230 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6231 q15_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6232
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6233
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6234 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6235 * @brief Root Mean Square of the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6236 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6237 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6238 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6239 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6240 void arm_rms_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6241 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6242 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6243 float32_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6244
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6245
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6246 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6247 * @brief Root Mean Square of the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6248 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6249 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6250 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6251 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6252 void arm_rms_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6253 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6254 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6255 q31_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6256
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6257
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6258 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6259 * @brief Root Mean Square of the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6260 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6261 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6262 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6263 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6264 void arm_rms_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6265 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6266 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6267 q15_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6268
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6269
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6270 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6271 * @brief Standard deviation of the elements of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6272 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6273 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6274 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6275 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6276 void arm_std_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6277 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6278 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6279 float32_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6280
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6281
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6282 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6283 * @brief Standard deviation of the elements of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6284 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6285 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6286 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6287 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6288 void arm_std_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6289 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6290 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6291 q31_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6292
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6293
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6294 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6295 * @brief Standard deviation of the elements of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6296 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6297 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6298 * @param[out] pResult is output value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6299 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6300 void arm_std_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6301 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6302 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6303 q15_t * pResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6304
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6305
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6306 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6307 * @brief Floating-point complex magnitude
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6308 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6309 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6310 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6311 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6312 void arm_cmplx_mag_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6313 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6314 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6315 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6316
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6317
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6318 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6319 * @brief Q31 complex magnitude
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6320 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6321 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6322 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6323 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6324 void arm_cmplx_mag_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6325 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6326 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6327 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6328
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6329
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6330 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6331 * @brief Q15 complex magnitude
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6332 * @param[in] pSrc points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6333 * @param[out] pDst points to the real output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6334 * @param[in] numSamples number of complex samples in the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6335 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6336 void arm_cmplx_mag_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6337 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6338 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6339 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6340
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6341
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6342 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6343 * @brief Q15 complex dot product
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6344 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6345 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6346 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6347 * @param[out] realResult real part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6348 * @param[out] imagResult imaginary part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6349 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6350 void arm_cmplx_dot_prod_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6351 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6352 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6353 uint32_t numSamples,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6354 q31_t * realResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6355 q31_t * imagResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6356
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6357
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6358 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6359 * @brief Q31 complex dot product
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6360 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6361 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6362 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6363 * @param[out] realResult real part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6364 * @param[out] imagResult imaginary part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6365 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6366 void arm_cmplx_dot_prod_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6367 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6368 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6369 uint32_t numSamples,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6370 q63_t * realResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6371 q63_t * imagResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6372
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6373
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6374 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6375 * @brief Floating-point complex dot product
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6376 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6377 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6378 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6379 * @param[out] realResult real part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6380 * @param[out] imagResult imaginary part of the result returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6381 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6382 void arm_cmplx_dot_prod_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6383 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6384 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6385 uint32_t numSamples,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6386 float32_t * realResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6387 float32_t * imagResult);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6388
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6389
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6390 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6391 * @brief Q15 complex-by-real multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6392 * @param[in] pSrcCmplx points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6393 * @param[in] pSrcReal points to the real input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6394 * @param[out] pCmplxDst points to the complex output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6395 * @param[in] numSamples number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6396 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6397 void arm_cmplx_mult_real_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6398 q15_t * pSrcCmplx,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6399 q15_t * pSrcReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6400 q15_t * pCmplxDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6401 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6402
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6403
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6404 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6405 * @brief Q31 complex-by-real multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6406 * @param[in] pSrcCmplx points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6407 * @param[in] pSrcReal points to the real input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6408 * @param[out] pCmplxDst points to the complex output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6409 * @param[in] numSamples number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6410 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6411 void arm_cmplx_mult_real_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6412 q31_t * pSrcCmplx,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6413 q31_t * pSrcReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6414 q31_t * pCmplxDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6415 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6416
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6417
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6418 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6419 * @brief Floating-point complex-by-real multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6420 * @param[in] pSrcCmplx points to the complex input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6421 * @param[in] pSrcReal points to the real input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6422 * @param[out] pCmplxDst points to the complex output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6423 * @param[in] numSamples number of samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6424 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6425 void arm_cmplx_mult_real_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6426 float32_t * pSrcCmplx,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6427 float32_t * pSrcReal,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6428 float32_t * pCmplxDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6429 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6430
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6431
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6432 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6433 * @brief Minimum value of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6434 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6435 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6436 * @param[out] result is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6437 * @param[in] index is the array index of the minimum value in the input buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6438 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6439 void arm_min_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6440 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6441 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6442 q7_t * result,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6443 uint32_t * index);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6444
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6445
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6446 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6447 * @brief Minimum value of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6448 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6449 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6450 * @param[out] pResult is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6451 * @param[in] pIndex is the array index of the minimum value in the input buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6452 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6453 void arm_min_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6454 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6455 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6456 q15_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6457 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6458
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6459
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6460 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6461 * @brief Minimum value of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6462 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6463 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6464 * @param[out] pResult is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6465 * @param[out] pIndex is the array index of the minimum value in the input buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6466 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6467 void arm_min_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6468 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6469 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6470 q31_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6471 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6472
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6473
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6474 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6475 * @brief Minimum value of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6476 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6477 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6478 * @param[out] pResult is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6479 * @param[out] pIndex is the array index of the minimum value in the input buffer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6480 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6481 void arm_min_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6482 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6483 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6484 float32_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6485 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6486
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6487
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6488 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6489 * @brief Maximum value of a Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6490 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6491 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6492 * @param[out] pResult maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6493 * @param[out] pIndex index of maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6494 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6495 void arm_max_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6496 q7_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6497 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6498 q7_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6499 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6500
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6501
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6502 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6503 * @brief Maximum value of a Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6504 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6505 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6506 * @param[out] pResult maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6507 * @param[out] pIndex index of maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6508 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6509 void arm_max_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6510 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6511 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6512 q15_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6513 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6514
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6515
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6516 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6517 * @brief Maximum value of a Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6518 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6519 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6520 * @param[out] pResult maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6521 * @param[out] pIndex index of maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6522 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6523 void arm_max_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6524 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6525 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6526 q31_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6527 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6528
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6529
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6530 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6531 * @brief Maximum value of a floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6532 * @param[in] pSrc points to the input buffer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6533 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6534 * @param[out] pResult maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6535 * @param[out] pIndex index of maximum value returned here
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6536 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6537 void arm_max_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6538 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6539 uint32_t blockSize,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6540 float32_t * pResult,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6541 uint32_t * pIndex);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6542
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6543
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6544 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6545 * @brief Q15 complex-by-complex multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6546 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6547 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6548 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6549 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6550 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6551 void arm_cmplx_mult_cmplx_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6552 q15_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6553 q15_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6554 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6555 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6556
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6557
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6558 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6559 * @brief Q31 complex-by-complex multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6560 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6561 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6562 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6563 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6564 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6565 void arm_cmplx_mult_cmplx_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6566 q31_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6567 q31_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6568 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6569 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6570
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6571
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6572 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6573 * @brief Floating-point complex-by-complex multiplication
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6574 * @param[in] pSrcA points to the first input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6575 * @param[in] pSrcB points to the second input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6576 * @param[out] pDst points to the output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6577 * @param[in] numSamples number of complex samples in each vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6578 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6579 void arm_cmplx_mult_cmplx_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6580 float32_t * pSrcA,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6581 float32_t * pSrcB,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6582 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6583 uint32_t numSamples);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6584
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6585
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6586 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6587 * @brief Converts the elements of the floating-point vector to Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6588 * @param[in] pSrc points to the floating-point input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6589 * @param[out] pDst points to the Q31 output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6590 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6591 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6592 void arm_float_to_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6593 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6594 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6595 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6596
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6597
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6598 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6599 * @brief Converts the elements of the floating-point vector to Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6600 * @param[in] pSrc points to the floating-point input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6601 * @param[out] pDst points to the Q15 output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6602 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6603 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6604 void arm_float_to_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6605 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6606 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6607 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6608
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6609
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6610 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6611 * @brief Converts the elements of the floating-point vector to Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6612 * @param[in] pSrc points to the floating-point input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6613 * @param[out] pDst points to the Q7 output vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6614 * @param[in] blockSize length of the input vector
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6615 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6616 void arm_float_to_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6617 float32_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6618 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6619 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6620
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6621
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6622 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6623 * @brief Converts the elements of the Q31 vector to Q15 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6624 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6625 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6626 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6627 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6628 void arm_q31_to_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6629 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6630 q15_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6631 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6632
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6633
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6634 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6635 * @brief Converts the elements of the Q31 vector to Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6636 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6637 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6638 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6639 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6640 void arm_q31_to_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6641 q31_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6642 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6643 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6644
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6645
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6646 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6647 * @brief Converts the elements of the Q15 vector to floating-point vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6648 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6649 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6650 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6651 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6652 void arm_q15_to_float(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6653 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6654 float32_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6655 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6656
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6657
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6658 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6659 * @brief Converts the elements of the Q15 vector to Q31 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6660 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6661 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6662 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6663 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6664 void arm_q15_to_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6665 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6666 q31_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6667 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6668
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6669
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6670 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6671 * @brief Converts the elements of the Q15 vector to Q7 vector.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6672 * @param[in] pSrc is input pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6673 * @param[out] pDst is output pointer
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6674 * @param[in] blockSize is the number of samples to process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6675 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6676 void arm_q15_to_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6677 q15_t * pSrc,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6678 q7_t * pDst,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6679 uint32_t blockSize);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6680
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6681
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6682 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6683 * @ingroup groupInterpolation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6684 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6685
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6686 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6687 * @defgroup BilinearInterpolate Bilinear Interpolation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6688 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6689 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6690 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6691 * determines values between the grid points.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6692 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6693 * Bilinear interpolation is often used in image processing to rescale images.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6694 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6695 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6696 * <b>Algorithm</b>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6697 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6698 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6699 * For floating-point, the instance structure is defined as:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6700 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6701 * typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6702 * {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6703 * uint16_t numRows;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6704 * uint16_t numCols;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6705 * float32_t *pData;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6706 * } arm_bilinear_interp_instance_f32;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6707 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6708 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6709 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6710 * where <code>numRows</code> specifies the number of rows in the table;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6711 * <code>numCols</code> specifies the number of columns in the table;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6712 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6713 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6714 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6715 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6716 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6717 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6718 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6719 * XF = floor(x)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6720 * YF = floor(y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6721 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6722 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6723 * The interpolated output point is computed as:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6724 * <pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6725 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6726 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6727 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6728 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6729 * </pre>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6730 * Note that the coordinates (x, y) contain integer and fractional components.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6731 * The integer components specify which portion of the table to use while the
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6732 * fractional components control the interpolation processor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6733 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6734 * \par
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6735 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6736 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6737
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6738 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6739 * @addtogroup BilinearInterpolate
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6740 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6741 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6742
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6743
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6744 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6745 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6746 * @brief Floating-point bilinear interpolation.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6747 * @param[in,out] S points to an instance of the interpolation structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6748 * @param[in] X interpolation coordinate.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6749 * @param[in] Y interpolation coordinate.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6750 * @return out interpolated value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6751 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6752 static __INLINE float32_t arm_bilinear_interp_f32(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6753 const arm_bilinear_interp_instance_f32 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6754 float32_t X,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6755 float32_t Y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6756 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6757 float32_t out;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6758 float32_t f00, f01, f10, f11;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6759 float32_t *pData = S->pData;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6760 int32_t xIndex, yIndex, index;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6761 float32_t xdiff, ydiff;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6762 float32_t b1, b2, b3, b4;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6763
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6764 xIndex = (int32_t) X;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6765 yIndex = (int32_t) Y;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6766
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6767 /* Care taken for table outside boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6768 /* Returns zero output when values are outside table boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6769 if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6770 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6771 return (0);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6772 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6773
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6774 /* Calculation of index for two nearest points in X-direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6775 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6776
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6777
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6778 /* Read two nearest points in X-direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6779 f00 = pData[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6780 f01 = pData[index + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6781
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6782 /* Calculation of index for two nearest points in Y-direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6783 index = (xIndex - 1) + (yIndex) * S->numCols;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6784
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6785
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6786 /* Read two nearest points in Y-direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6787 f10 = pData[index];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6788 f11 = pData[index + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6789
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6790 /* Calculation of intermediate values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6791 b1 = f00;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6792 b2 = f01 - f00;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6793 b3 = f10 - f00;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6794 b4 = f00 - f01 - f10 + f11;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6795
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6796 /* Calculation of fractional part in X */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6797 xdiff = X - xIndex;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6798
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6799 /* Calculation of fractional part in Y */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6800 ydiff = Y - yIndex;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6801
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6802 /* Calculation of bi-linear interpolated output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6803 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6804
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6805 /* return to application */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6806 return (out);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6807 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6808
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6809
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6810 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6811 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6812 * @brief Q31 bilinear interpolation.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6813 * @param[in,out] S points to an instance of the interpolation structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6814 * @param[in] X interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6815 * @param[in] Y interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6816 * @return out interpolated value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6817 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6818 static __INLINE q31_t arm_bilinear_interp_q31(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6819 arm_bilinear_interp_instance_q31 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6820 q31_t X,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6821 q31_t Y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6822 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6823 q31_t out; /* Temporary output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6824 q31_t acc = 0; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6825 q31_t xfract, yfract; /* X, Y fractional parts */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6826 q31_t x1, x2, y1, y2; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6827 int32_t rI, cI; /* Row and column indices */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6828 q31_t *pYData = S->pData; /* pointer to output table values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6829 uint32_t nCols = S->numCols; /* num of rows */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6830
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6831 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6832 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6833 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6834 rI = ((X & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6836 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6837 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6838 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6839 cI = ((Y & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6840
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6841 /* Care taken for table outside boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6842 /* Returns zero output when values are outside table boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6843 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6844 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6845 return (0);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6846 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6847
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6848 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6849 /* shift left xfract by 11 to keep 1.31 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6850 xfract = (X & 0x000FFFFF) << 11u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6851
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6852 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6853 x1 = pYData[(rI) + (int32_t)nCols * (cI) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6854 x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6855
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6856 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6857 /* shift left yfract by 11 to keep 1.31 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6858 yfract = (Y & 0x000FFFFF) << 11u;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6859
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6860 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6861 y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6862 y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6863
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6864 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6865 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6866 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6867
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6868 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6869 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6870 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6871
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6872 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6873 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6874 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6875
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6876 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6877 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6878 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6879
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6880 /* Convert acc to 1.31(q31) format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6881 return ((q31_t)(acc << 2));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6882 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6883
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6884
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6885 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6886 * @brief Q15 bilinear interpolation.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6887 * @param[in,out] S points to an instance of the interpolation structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6888 * @param[in] X interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6889 * @param[in] Y interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6890 * @return out interpolated value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6891 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6892 static __INLINE q15_t arm_bilinear_interp_q15(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6893 arm_bilinear_interp_instance_q15 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6894 q31_t X,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6895 q31_t Y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6896 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6897 q63_t acc = 0; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6898 q31_t out; /* Temporary output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6899 q15_t x1, x2, y1, y2; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6900 q31_t xfract, yfract; /* X, Y fractional parts */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6901 int32_t rI, cI; /* Row and column indices */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6902 q15_t *pYData = S->pData; /* pointer to output table values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6903 uint32_t nCols = S->numCols; /* num of rows */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6904
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6905 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6906 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6907 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6908 rI = ((X & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6909
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6910 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6911 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6912 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6913 cI = ((Y & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6914
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6915 /* Care taken for table outside boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6916 /* Returns zero output when values are outside table boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6917 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6918 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6919 return (0);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6920 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6921
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6922 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6923 /* xfract should be in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6924 xfract = (X & 0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6925
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6926 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6927 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6928 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6929
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6930 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6931 /* yfract should be in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6932 yfract = (Y & 0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6933
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6934 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6935 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6936 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6937
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6938 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6939
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6940 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6941 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6942 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6943 acc = ((q63_t) out * (0xFFFFF - yfract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6944
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6945 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6946 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6947 acc += ((q63_t) out * (xfract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6948
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6949 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6950 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6951 acc += ((q63_t) out * (yfract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6952
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6953 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6954 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6955 acc += ((q63_t) out * (yfract));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6956
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6957 /* acc is in 13.51 format and down shift acc by 36 times */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6958 /* Convert out to 1.15 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6959 return ((q15_t)(acc >> 36));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6960 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6961
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6962
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6963 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6964 * @brief Q7 bilinear interpolation.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6965 * @param[in,out] S points to an instance of the interpolation structure.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6966 * @param[in] X interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6967 * @param[in] Y interpolation coordinate in 12.20 format.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6968 * @return out interpolated value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6969 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6970 static __INLINE q7_t arm_bilinear_interp_q7(
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6971 arm_bilinear_interp_instance_q7 * S,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6972 q31_t X,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6973 q31_t Y)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6974 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6975 q63_t acc = 0; /* output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6976 q31_t out; /* Temporary output */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6977 q31_t xfract, yfract; /* X, Y fractional parts */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6978 q7_t x1, x2, y1, y2; /* Nearest output values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6979 int32_t rI, cI; /* Row and column indices */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6980 q7_t *pYData = S->pData; /* pointer to output table values */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6981 uint32_t nCols = S->numCols; /* num of rows */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6982
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6983 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6984 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6985 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6986 rI = ((X & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6987
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6988 /* Input is in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6989 /* 12 bits for the table index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6990 /* Index value calculation */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6991 cI = ((Y & (q31_t)0xFFF00000) >> 20);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6992
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6993 /* Care taken for table outside boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6994 /* Returns zero output when values are outside table boundary */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6995 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6996 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6997 return (0);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6998 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6999
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7000 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7001 /* xfract should be in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7002 xfract = (X & (q31_t)0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7003
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7004 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7005 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7006 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7007
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7008 /* 20 bits for the fractional part */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7009 /* yfract should be in 12.20 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7010 yfract = (Y & (q31_t)0x000FFFFF);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7012 /* Read two nearest output values from the index */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7013 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7014 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7015
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7016 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7017 out = ((x1 * (0xFFFFF - xfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7018 acc = (((q63_t) out * (0xFFFFF - yfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7019
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7020 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7021 out = ((x2 * (0xFFFFF - yfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7022 acc += (((q63_t) out * (xfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7023
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7024 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7025 out = ((y1 * (0xFFFFF - xfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7026 acc += (((q63_t) out * (yfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7027
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7028 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7029 out = ((y2 * (yfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7030 acc += (((q63_t) out * (xfract)));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7031
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7032 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7033 return ((q7_t)(acc >> 40));
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7034 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7035
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7036 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7037 * @} end of BilinearInterpolate group
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7038 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7039
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7040
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7041 /* SMMLAR */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7042 #define multAcc_32x32_keep32_R(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7043 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7044
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7045 /* SMMLSR */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7046 #define multSub_32x32_keep32_R(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7047 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7048
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7049 /* SMMULR */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7050 #define mult_32x32_keep32_R(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7051 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7052
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7053 /* SMMLA */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7054 #define multAcc_32x32_keep32(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7055 a += (q31_t) (((q63_t) x * y) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7056
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7057 /* SMMLS */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7058 #define multSub_32x32_keep32(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7059 a -= (q31_t) (((q63_t) x * y) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7060
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7061 /* SMMUL */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7062 #define mult_32x32_keep32(a, x, y) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7063 a = (q31_t) (((q63_t) x * y ) >> 32)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7064
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7065
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7066 #if defined ( __CC_ARM )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7067 /* Enter low optimization region - place directly above function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7068 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7069 #define LOW_OPTIMIZATION_ENTER \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7070 _Pragma ("push") \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7071 _Pragma ("O1")
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7072 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7073 #define LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7074 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7075
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7076 /* Exit low optimization region - place directly after end of function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7077 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7078 #define LOW_OPTIMIZATION_EXIT \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7079 _Pragma ("pop")
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7080 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7081 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7082 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7083
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7084 /* Enter low optimization region - place directly above function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7085 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7086
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7087 /* Exit low optimization region - place directly after end of function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7088 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7089
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7090 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7091 #define LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7092 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7093 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7094 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7095
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7096 #elif defined(__GNUC__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7097 #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7098 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7099 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7100 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7101
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7102 #elif defined(__ICCARM__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7103 /* Enter low optimization region - place directly above function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7104 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7105 #define LOW_OPTIMIZATION_ENTER \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7106 _Pragma ("optimize=low")
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7107 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7108 #define LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7109 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7110
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7111 /* Exit low optimization region - place directly after end of function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7112 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7113
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7114 /* Enter low optimization region - place directly above function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7115 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7116 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7117 _Pragma ("optimize=low")
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7118 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7119 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7120 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7121
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7122 /* Exit low optimization region - place directly after end of function definition */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7123 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7124
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7125 #elif defined(__CSMC__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7126 #define LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7127 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7128 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7129 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7130
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7131 #elif defined(__TASKING__)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7132 #define LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7133 #define LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7134 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7135 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7136
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7137 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7138
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7139
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7140 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7141 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7142 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7143
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7144
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7145 #if defined ( __GNUC__ )
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7146 #pragma GCC diagnostic pop
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7147 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7148
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7149 #endif /* _ARM_MATH_H */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7150
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7151 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7152 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7153 * End of file.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7154 */