annotate Common/Drivers/CMSIS_v210/arm_math.h @ 56:bab006305b58

language updates
author heinrichsweikamp
date Tue, 07 Aug 2018 17:03:36 +0200
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /* ----------------------------------------------------------------------
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 * Copyright (C) 2010 ARM Limited. All rights reserved.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * $Date: 15. July 2011
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * $Revision: V1.0.10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * Project: CMSIS DSP Library
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 * Title: arm_math.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 * Description: Public header file for CMSIS DSP Library
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * Version 1.0.10 2011/7/15
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * Big Endian support added and Merged M0 and M3/M4 Source code.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * Version 1.0.3 2010/11/29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * Re-organized the CMSIS folders and updated documentation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * Version 1.0.2 2010/11/11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * Documentation updated.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 * Version 1.0.1 2010/10/05
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * Production release and review comments incorporated.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * Version 1.0.0 2010/09/20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * Production release and review comments incorporated.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * -------------------------------------------------------------------- */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 \mainpage CMSIS DSP Software Library
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * <b>Introduction</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 * This user manual describes the CMSIS DSP software library,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 * a suite of common signal processing functions for use on Cortex-M processor based devices.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 * The library is divided into a number of modules each covering a specific category:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 * - Basic math functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 * - Fast math functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 * - Complex math functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 * - Filters
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 * - Matrix functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 * - Transforms
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 * - Motor control functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 * - Statistical functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 * - Support functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 * - Interpolation functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 * 32-bit integer and 32-bit floating-point values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 * <b>Processor Support</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 * The library is completely written in C and is fully CMSIS compliant.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 * High performance is achieved through maximum use of Cortex-M4 intrinsics.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 * The supplied library source code also builds and runs on the Cortex-M3 and Cortex-M0 processor,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 * with the DSP intrinsics being emulated through software.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 * <b>Toolchain Support</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 * The library has been developed and tested with MDK-ARM version 4.21.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 * <b>Using the Library</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 * - arm_cortexM0b_math.lib (Big endian on Cortex-M3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 * public header file <code> arm_math.h</code> for Cortex-M4/M3/M0 with little endian and big endian. Same header file will be used for floating point unit(FPU) variants.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 * Define the appropriate pre processor MACRO ARM_MATH_CM4 or ARM_MATH_CM3 or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 * ARM_MATH_CM0 depending on the target processor in the application.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 * <b>Examples</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 * The library ships with a number of examples which demonstrate how to use the library functions.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 * <b>Building the Library</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 * The library installer contains project files to re build libraries on MDK Tool chain in the <code>CMSIS\DSP_Lib\Source\ARM</code> folder.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 * - arm_cortexM0b_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 * - arm_cortexM0l_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 * - arm_cortexM3b_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 * - arm_cortexM3l_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 * - arm_cortexM4b_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 * - arm_cortexM4l_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 * - arm_cortexM4bf_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 * - arm_cortexM4lf_math.uvproj
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 * Each library project have differant pre-processor macros.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 * <b>ARM_MATH_CMx:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 * and ARM_MATH_CM0 for building library on cortex-M0 target.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 * <b>ARM_MATH_BIG_ENDIAN:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 * <b>ARM_MATH_MATRIX_CHECK:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 * Define macro for checking on the input and output sizes of matrices
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 * <b>ARM_MATH_ROUNDING:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 * Define macro for rounding on support functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 * <b>__FPU_PRESENT:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 * The project can be built by opening the appropriate project in MDK-ARM 4.21 chain and defining the optional pre processor MACROs detailed above.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 * <b>Copyright Notice</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 * Copyright (C) 2010 ARM Limited. All rights reserved.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 * @defgroup groupMath Basic Math Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 * @defgroup groupFastMath Fast Math Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 * This set of functions provides a fast approximation to sine, cosine, and square root.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 * As compared to most of the other functions in the CMSIS math library, the fast math functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 * operate on individual values and not arrays.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 * There are separate functions for Q15, Q31, and floating-point data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 * @defgroup groupCmplxMath Complex Math Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 * This set of functions operates on complex data vectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 * The data in the complex arrays is stored in an interleaved fashion
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 * (real, imag, real, imag, ...).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 * In the API functions, the number of samples in a complex array refers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 * to the number of complex values; the array contains twice this number of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 * real values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 * @defgroup groupFilters Filtering Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 * @defgroup groupMatrix Matrix Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 * This set of functions provides basic matrix math operations.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 * The functions operate on matrix data structures. For example,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 * the type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 * definition for the floating-point matrix structure is shown
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 * below:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 * typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 * {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 * uint16_t numRows; // number of rows of the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 * uint16_t numCols; // number of columns of the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 * float32_t *pData; // points to the data of the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 * } arm_matrix_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 * There are similar definitions for Q15 and Q31 data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 * The structure specifies the size of the matrix and then points to
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 * an array of data. The array is of size <code>numRows X numCols</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 * and the values are arranged in row order. That is, the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 * matrix element (i, j) is stored at:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 * pData[i*numCols + j]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 * \par Init Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 * There is an associated initialization function for each type of matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 * data structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 * The initialization function sets the values of the internal structure fields.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 * Use of the initialization function is optional. However, if initialization function is used
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 * then the instance structure cannot be placed into a const data section.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 * To place the instance structure in a const data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 * section, manually initialize the data structure. For example:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 * specifies the number of columns, and <code>pData</code> points to the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 * data array.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 * \par Size Checking
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 * By default all of the matrix functions perform size checking on the input and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 * output matrices. For example, the matrix addition function verifies that the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 * two input matrices and the output matrix all have the same number of rows and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 * columns. If the size check fails the functions return:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 * ARM_MATH_SIZE_MISMATCH
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 * Otherwise the functions return
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 * ARM_MATH_SUCCESS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 * There is some overhead associated with this matrix size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 * The matrix size checking is enabled via the #define
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 * ARM_MATH_MATRIX_CHECK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 * within the library project settings. By default this macro is defined
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 * and size checking is enabled. By changing the project settings and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 * undefining this macro size checking is eliminated and the functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 * run a bit faster. With size checking disabled the functions always
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 * return <code>ARM_MATH_SUCCESS</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 * @defgroup groupTransforms Transform Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 * @defgroup groupController Controller Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 * @defgroup groupStats Statistics Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 * @defgroup groupSupport Support Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 * @defgroup groupInterpolation Interpolation Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 * These functions perform 1- and 2-dimensional interpolation of data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 * Linear interpolation is used for 1-dimensional data and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 * bilinear interpolation is used for 2-dimensional data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 * @defgroup groupExamples Examples
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 #ifndef _ARM_MATH_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 #define _ARM_MATH_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 #if defined (ARM_MATH_CM4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 #include "core_cm4.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 #elif defined (ARM_MATH_CM3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 #include "core_cm3.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 #elif defined (ARM_MATH_CM0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 #include "core_cm0.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 #include "ARMCM4.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 #warning "Define either ARM_MATH_CM4 OR ARM_MATH_CM3...By Default building on ARM_MATH_CM4....."
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 #include "string.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 #include "math.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 extern "C"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 * @brief Macros required for reciprocal calculation in Normalized LMS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 #define DELTA_Q31 (0x100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 #define DELTA_Q15 0x5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 #define INDEX_MASK 0x0000003F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 #define PI 3.14159265358979f
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 * @brief Macros required for SINE and COSINE Fast math approximations
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 #define TABLE_SIZE 256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 #define TABLE_SPACING_Q31 0x800000
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 #define TABLE_SPACING_Q15 0x80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 * @brief Macros required for SINE and COSINE Controller functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 /* 1.31(q31) Fixed value of 2/360 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 #define INPUT_SPACING 0xB60B61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 * @brief Error status returned by some functions in the library.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 ARM_MATH_SUCCESS = 0, /**< No error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 } arm_status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 * @brief 8-bit fractional data type in 1.7 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 typedef int8_t q7_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 * @brief 16-bit fractional data type in 1.15 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 typedef int16_t q15_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 * @brief 32-bit fractional data type in 1.31 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 typedef int32_t q31_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 * @brief 64-bit fractional data type in 1.63 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 typedef int64_t q63_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 * @brief 32-bit floating-point type definition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 typedef float float32_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 * @brief 64-bit floating-point type definition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 typedef double float64_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 * @brief definition to read/write two 16 bit values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 #define __SIMD32(addr) (*(int32_t **) & (addr))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 * @brief definition to pack two 16 bit values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 * @brief definition to pack four 8 bit values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #ifndef ARM_MATH_BIG_ENDIAN
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 * @brief Clips Q63 to Q31 values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 static __INLINE q31_t clip_q63_to_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 q63_t x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 * @brief Clips Q63 to Q15 values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 static __INLINE q15_t clip_q63_to_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 q63_t x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 * @brief Clips Q31 to Q7 values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 static __INLINE q7_t clip_q31_to_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 q31_t x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 * @brief Clips Q31 to Q15 values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 static __INLINE q15_t clip_q31_to_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 q31_t x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 static __INLINE q63_t mult32x64(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 q63_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 (((q63_t) (x >> 32) * y)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 #if defined (ARM_MATH_CM0) && defined ( __CC_ARM )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 #define __CLZ __clz
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 #if defined (ARM_MATH_CM0) && ((defined (__ICCARM__)) ||(defined (__GNUC__)) || defined (__TASKING__) )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 static __INLINE uint32_t __CLZ(q31_t data);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 static __INLINE uint32_t __CLZ(q31_t data)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 uint32_t count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 uint32_t mask = 0x80000000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 while((data & mask) == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 count += 1u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 mask = mask >> 1u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 return(count);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 * @brief Function to Calculates 1/in(reciprocal) value of Q31 Data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 static __INLINE uint32_t arm_recip_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 q31_t in,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 q31_t * dst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 q31_t * pRecipTable)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 uint32_t out, tempVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 uint32_t index, i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 uint32_t signBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 if(in > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 signBits = __CLZ(in) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 signBits = __CLZ(-in) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 /* Convert input sample to 1.31 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 in = in << signBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 /* calculation of index for initial approximated Val */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 index = (uint32_t) (in >> 24u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 index = (index & INDEX_MASK);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 /* 1.31 with exp 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 out = pRecipTable[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 /* calculation of reciprocal value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 /* running approximation for two iterations */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 for (i = 0u; i < 2u; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 tempVal = (q31_t) (((q63_t) in * out) >> 31u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 tempVal = 0x7FFFFFFF - tempVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 /* 1.31 with exp 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 //out = (q31_t) (((q63_t) out * tempVal) >> 30u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 /* write output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 *dst = out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 /* return num of signbits of out = 1/in value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 return (signBits + 1u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 * @brief Function to Calculates 1/in(reciprocal) value of Q15 Data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 static __INLINE uint32_t arm_recip_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 q15_t in,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 q15_t * dst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 q15_t * pRecipTable)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 uint32_t out = 0, tempVal = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 uint32_t index = 0, i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 uint32_t signBits = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 if(in > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 signBits = __CLZ(in) - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 signBits = __CLZ(-in) - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 /* Convert input sample to 1.15 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 in = in << signBits;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 /* calculation of index for initial approximated Val */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 index = in >> 8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 index = (index & INDEX_MASK);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 /* 1.15 with exp 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 out = pRecipTable[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 /* calculation of reciprocal value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 /* running approximation for two iterations */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 for (i = 0; i < 2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 tempVal = (q15_t) (((q31_t) in * out) >> 15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 tempVal = 0x7FFF - tempVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 /* 1.15 with exp 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 out = (q15_t) (((q31_t) out * tempVal) >> 14);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 /* write output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 *dst = out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 /* return num of signbits of out = 1/in value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 return (signBits + 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 * @brief C custom defined intrinisic function for only M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 #if defined(ARM_MATH_CM0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 static __INLINE q31_t __SSAT(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 uint32_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 int32_t posMax, negMin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 uint32_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 posMax = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 for (i = 0; i < (y - 1); i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 posMax = posMax * 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 if(x > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 posMax = (posMax - 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 if(x > posMax)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 x = posMax;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 negMin = -posMax;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 if(x < negMin)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 x = negMin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 return (x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 #endif /* end of ARM_MATH_CM0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 * @brief C custom defined intrinsic function for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 * @brief C custom defined QADD8 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 static __INLINE q31_t __QADD8(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 q7_t r, s, t, u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 r = (char) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 s = (char) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 r = __SSAT((q31_t) (r + s), 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 sum = (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) |
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 * @brief C custom defined QSUB8 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 static __INLINE q31_t __QSUB8(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 q31_t r, s, t, u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 r = (char) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 s = (char) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 r = __SSAT((r - s), 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 sum =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r & 0x000000FF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 * @brief C custom defined QADD16 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 * @brief C custom defined QADD16 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 static __INLINE q31_t __QADD16(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 r = __SSAT(r + s, 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 * @brief C custom defined SHADD16 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 static __INLINE q31_t __SHADD16(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 r = ((r >> 1) + (s >> 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 s = ((q31_t) ((x >> 17) + (y >> 17))) << 16;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 * @brief C custom defined QSUB16 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 static __INLINE q31_t __QSUB16(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 r = __SSAT(r - s, 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 * @brief C custom defined SHSUB16 for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 static __INLINE q31_t __SHSUB16(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 q31_t diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 r = ((r >> 1) - (s >> 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 s = (((x >> 17) - (y >> 17)) << 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 diff = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 return diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 * @brief C custom defined QASX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 static __INLINE q31_t __QASX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 q31_t sum = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 sum = ((sum + clip_q31_to_q15((q31_t) ((short) (x >> 16) + (short) y))) << 16) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 clip_q31_to_q15((q31_t) ((short) x - (short) (y >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 * @brief C custom defined SHASX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 static __INLINE q31_t __SHASX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 r = ((r >> 1) - (y >> 17));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 s = (((x >> 17) + (s >> 1)) << 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 * @brief C custom defined QSAX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 static __INLINE q31_t __QSAX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 q31_t sum = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 sum = ((sum + clip_q31_to_q15((q31_t) ((short) (x >> 16) - (short) y))) << 16) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 clip_q31_to_q15((q31_t) ((short) x + (short) (y >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 * @brief C custom defined SHSAX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 static __INLINE q31_t __SHSAX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 q31_t sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 q31_t r, s;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 r = (short) x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 s = (short) y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 r = ((r >> 1) + (y >> 17));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 s = (((x >> 17) - (s >> 1)) << 16);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 return sum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 * @brief C custom defined SMUSDX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 static __INLINE q31_t __SMUSDX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 return ((q31_t)(((short) x * (short) (y >> 16)) -
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 ((short) (x >> 16) * (short) y)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 * @brief C custom defined SMUADX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 static __INLINE q31_t __SMUADX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 return ((q31_t)(((short) x * (short) (y >> 16)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 ((short) (x >> 16) * (short) y)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 * @brief C custom defined QADD for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 static __INLINE q31_t __QADD(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 return clip_q63_to_q31((q63_t) x + y);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 * @brief C custom defined QSUB for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 static __INLINE q31_t __QSUB(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 return clip_q63_to_q31((q63_t) x - y);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 * @brief C custom defined SMLAD for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 static __INLINE q31_t __SMLAD(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 q31_t y,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 q31_t sum)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 return (sum + ((short) (x >> 16) * (short) (y >> 16)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 ((short) x * (short) y));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 * @brief C custom defined SMLADX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 static __INLINE q31_t __SMLADX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 q31_t y,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 q31_t sum)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 return (sum + ((short) (x >> 16) * (short) (y)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 ((short) x * (short) (y >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 * @brief C custom defined SMLSDX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 static __INLINE q31_t __SMLSDX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 q31_t y,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 q31_t sum)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 return (sum - ((short) (x >> 16) * (short) (y)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 ((short) x * (short) (y >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 * @brief C custom defined SMLALD for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 static __INLINE q63_t __SMLALD(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 q31_t y,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 q63_t sum)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 return (sum + ((short) (x >> 16) * (short) (y >> 16)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 ((short) x * (short) y));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 * @brief C custom defined SMLALDX for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 static __INLINE q63_t __SMLALDX(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 q31_t y,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 q63_t sum)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 return (sum + ((short) (x >> 16) * (short) y)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 ((short) x * (short) (y >> 16));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 * @brief C custom defined SMUAD for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 static __INLINE q31_t __SMUAD(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 return (((x >> 16) * (y >> 16)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 (((x << 16) >> 16) * ((y << 16) >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 * @brief C custom defined SMUSD for M3 and M0 processors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 static __INLINE q31_t __SMUSD(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959 q31_t x,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 q31_t y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 return (-((x >> 16) * (y >> 16)) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 (((x << 16) >> 16) * ((y << 16) >> 16)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 #endif /* (ARM_MATH_CM3) || defined (ARM_MATH_CM0) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 * @brief Instance structure for the Q7 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 uint16_t numTaps; /**< number of filter coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 } arm_fir_instance_q7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 * @brief Instance structure for the Q15 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 uint16_t numTaps; /**< number of filter coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 } arm_fir_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 * @brief Instance structure for the Q31 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 uint16_t numTaps; /**< number of filter coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 } arm_fir_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 * @brief Instance structure for the floating-point FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 uint16_t numTaps; /**< number of filter coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 } arm_fir_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 * @brief Processing function for the Q7 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 * @param[in] *S points to an instance of the Q7 FIR filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 void arm_fir_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 const arm_fir_instance_q7 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 * @brief Initialization function for the Q7 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 * @param[in,out] *S points to an instance of the Q7 FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 * @param[in] numTaps Number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 * @param[in] blockSize number of samples that are processed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 void arm_fir_init_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 arm_fir_instance_q7 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 q7_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 q7_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 * @brief Processing function for the Q15 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 * @param[in] *S points to an instance of the Q15 FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 void arm_fir_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055 const arm_fir_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 * @param[in] *S points to an instance of the Q15 FIR filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 void arm_fir_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 const arm_fir_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 * @brief Initialization function for the Q15 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 * @param[in] blockSize number of samples that are processed at a time.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 * <code>numTaps</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085 arm_status arm_fir_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 arm_fir_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 * @brief Processing function for the Q31 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 * @param[in] *S points to an instance of the Q31 FIR filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 void arm_fir_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 const arm_fir_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 * @param[in] *S points to an instance of the Q31 FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 void arm_fir_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 const arm_fir_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 * @brief Initialization function for the Q31 FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 * @param[in,out] *S points to an instance of the Q31 FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 * @param[in] numTaps Number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 * @param[in] blockSize number of samples that are processed at a time.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 void arm_fir_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 arm_fir_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 * @brief Processing function for the floating-point FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 * @param[in] *S points to an instance of the floating-point FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 void arm_fir_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 const arm_fir_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 * @brief Initialization function for the floating-point FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 * @param[in] numTaps Number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 * @param[in] blockSize number of samples that are processed at a time.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 void arm_fir_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 arm_fir_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 * @brief Instance structure for the Q15 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 } arm_biquad_casd_df1_inst_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 * @brief Instance structure for the Q31 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 } arm_biquad_casd_df1_inst_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 * @brief Instance structure for the floating-point Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 } arm_biquad_casd_df1_inst_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 * @brief Processing function for the Q15 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 void arm_biquad_cascade_df1_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 const arm_biquad_casd_df1_inst_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 * @brief Initialization function for the Q15 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 * @param[in] numStages number of 2nd order stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 void arm_biquad_cascade_df1_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 arm_biquad_casd_df1_inst_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 uint8_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 int8_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 void arm_biquad_cascade_df1_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 const arm_biquad_casd_df1_inst_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 * @brief Processing function for the Q31 Biquad cascade filter
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 void arm_biquad_cascade_df1_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 const arm_biquad_casd_df1_inst_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 void arm_biquad_cascade_df1_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 const arm_biquad_casd_df1_inst_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 * @brief Initialization function for the Q31 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 * @param[in] numStages number of 2nd order stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 void arm_biquad_cascade_df1_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 arm_biquad_casd_df1_inst_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 uint8_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 int8_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 * @brief Processing function for the floating-point Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 * @param[in] *S points to an instance of the floating-point Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 void arm_biquad_cascade_df1_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 const arm_biquad_casd_df1_inst_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 * @brief Initialization function for the floating-point Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 * @param[in] numStages number of 2nd order stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 void arm_biquad_cascade_df1_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 arm_biquad_casd_df1_inst_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 uint8_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 float32_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 * @brief Instance structure for the floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 uint16_t numRows; /**< number of rows of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 uint16_t numCols; /**< number of columns of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 float32_t *pData; /**< points to the data of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 } arm_matrix_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 * @brief Instance structure for the Q15 matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 uint16_t numRows; /**< number of rows of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 uint16_t numCols; /**< number of columns of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 q15_t *pData; /**< points to the data of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 } arm_matrix_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357 * @brief Instance structure for the Q31 matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362 uint16_t numRows; /**< number of rows of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 uint16_t numCols; /**< number of columns of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 q31_t *pData; /**< points to the data of the matrix. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366 } arm_matrix_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371 * @brief Floating-point matrix addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 arm_status arm_mat_add_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 const arm_matrix_instance_f32 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381 const arm_matrix_instance_f32 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382 arm_matrix_instance_f32 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 * @brief Q15 matrix addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 arm_status arm_mat_add_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 const arm_matrix_instance_q15 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 const arm_matrix_instance_q15 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 arm_matrix_instance_q15 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 * @brief Q31 matrix addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407 arm_status arm_mat_add_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408 const arm_matrix_instance_q31 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409 const arm_matrix_instance_q31 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 * @brief Floating-point matrix transpose.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 * @param[in] *pSrc points to the input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416 * @param[out] *pDst points to the output matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 arm_status arm_mat_trans_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 const arm_matrix_instance_f32 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 arm_matrix_instance_f32 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427 * @brief Q15 matrix transpose.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 * @param[in] *pSrc points to the input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 * @param[out] *pDst points to the output matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 arm_status arm_mat_trans_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 const arm_matrix_instance_q15 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 arm_matrix_instance_q15 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439 * @brief Q31 matrix transpose.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 * @param[in] *pSrc points to the input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 * @param[out] *pDst points to the output matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 arm_status arm_mat_trans_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 const arm_matrix_instance_q31 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452 * @brief Floating-point matrix multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 arm_status arm_mat_mult_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 const arm_matrix_instance_f32 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 const arm_matrix_instance_f32 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463 arm_matrix_instance_f32 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 * @brief Q15 matrix multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 arm_status arm_mat_mult_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475 const arm_matrix_instance_q15 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 const arm_matrix_instance_q15 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1477 arm_matrix_instance_q15 * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478 q15_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1481 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485 * @param[in] *pState points to the array for storing intermediate results
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1487 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1488 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1490 arm_status arm_mat_mult_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1491 const arm_matrix_instance_q15 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1492 const arm_matrix_instance_q15 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1493 arm_matrix_instance_q15 * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1494 q15_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1496 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 * @brief Q31 matrix multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1498 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1501 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1502 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1503 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1505 arm_status arm_mat_mult_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506 const arm_matrix_instance_q31 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 const arm_matrix_instance_q31 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519 arm_status arm_mat_mult_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 const arm_matrix_instance_q31 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 const arm_matrix_instance_q31 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 * @brief Floating-point matrix subtraction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 arm_status arm_mat_sub_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 const arm_matrix_instance_f32 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536 const arm_matrix_instance_f32 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 arm_matrix_instance_f32 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 * @brief Q15 matrix subtraction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1542 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 arm_status arm_mat_sub_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549 const arm_matrix_instance_q15 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1550 const arm_matrix_instance_q15 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 arm_matrix_instance_q15 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554 * @brief Q31 matrix subtraction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555 * @param[in] *pSrcA points to the first input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556 * @param[in] *pSrcB points to the second input matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 arm_status arm_mat_sub_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 const arm_matrix_instance_q31 * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 const arm_matrix_instance_q31 * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568 * @brief Floating-point matrix scaling.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 * @param[in] *pSrc points to the input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570 * @param[in] scale scale factor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 * @param[out] *pDst points to the output matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576 arm_status arm_mat_scale_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 const arm_matrix_instance_f32 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 float32_t scale,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 arm_matrix_instance_f32 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 * @brief Q15 matrix scaling.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 * @param[in] *pSrc points to input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 * @param[in] scaleFract fractional portion of the scale factor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 * @param[in] shift number of bits to shift the result by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 * @param[out] *pDst points to output matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 arm_status arm_mat_scale_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592 const arm_matrix_instance_q15 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593 q15_t scaleFract,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 int32_t shift,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595 arm_matrix_instance_q15 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 * @brief Q31 matrix scaling.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 * @param[in] *pSrc points to input matrix
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 * @param[in] scaleFract fractional portion of the scale factor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601 * @param[in] shift number of bits to shift the result by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602 * @param[out] *pDst points to output matrix structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 * @return The function returns either
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1607 arm_status arm_mat_scale_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1608 const arm_matrix_instance_q31 * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1609 q31_t scaleFract,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1610 int32_t shift,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1611 arm_matrix_instance_q31 * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1613
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615 * @brief Q31 matrix initialization.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 * @param[in,out] *S points to an instance of the floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617 * @param[in] nRows number of rows in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 * @param[in] nColumns number of columns in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1619 * @param[in] *pData points to the matrix data array.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623 void arm_mat_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624 arm_matrix_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1625 uint16_t nRows,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 uint16_t nColumns,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 q31_t *pData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630 * @brief Q15 matrix initialization.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631 * @param[in,out] *S points to an instance of the floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632 * @param[in] nRows number of rows in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633 * @param[in] nColumns number of columns in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 * @param[in] *pData points to the matrix data array.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 void arm_mat_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 arm_matrix_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1640 uint16_t nRows,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1641 uint16_t nColumns,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1642 q15_t *pData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1643
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1644 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1645 * @brief Floating-point matrix initialization.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1646 * @param[in,out] *S points to an instance of the floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1647 * @param[in] nRows number of rows in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1648 * @param[in] nColumns number of columns in the matrix.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1649 * @param[in] *pData points to the matrix data array.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653 void arm_mat_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654 arm_matrix_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 uint16_t nRows,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 uint16_t nColumns,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657 float32_t *pData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1660
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1661 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1662 * @brief Instance structure for the Q15 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1663 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1664 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1665 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1666 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1667 #ifdef ARM_MATH_CM0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668 q15_t A1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669 q15_t A2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673 q15_t state[3]; /**< The state array of length 3. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674 q15_t Kp; /**< The proportional gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675 q15_t Ki; /**< The integral gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1676 q15_t Kd; /**< The derivative gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 } arm_pid_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680 * @brief Instance structure for the Q31 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1686 q31_t A2; /**< The derived gain, A2 = Kd . */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1687 q31_t state[3]; /**< The state array of length 3. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688 q31_t Kp; /**< The proportional gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689 q31_t Ki; /**< The integral gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690 q31_t Kd; /**< The derivative gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 } arm_pid_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1695 * @brief Instance structure for the floating-point PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1696 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1697 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1698 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1699 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1700 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1701 float32_t A2; /**< The derived gain, A2 = Kd . */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1702 float32_t state[3]; /**< The state array of length 3. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1703 float32_t Kp; /**< The proportional gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1704 float32_t Ki; /**< The integral gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1705 float32_t Kd; /**< The derivative gain. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1706 } arm_pid_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1707
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1708
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1709
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1710 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1711 * @brief Initialization function for the floating-point PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1712 * @param[in,out] *S points to an instance of the PID structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1713 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1714 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1715 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1716 void arm_pid_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1717 arm_pid_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1718 int32_t resetStateFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1719
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1720 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1721 * @brief Reset function for the floating-point PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1722 * @param[in,out] *S is an instance of the floating-point PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1723 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1724 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1725 void arm_pid_reset_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1726 arm_pid_instance_f32 * S);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1728
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1729 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1730 * @brief Initialization function for the Q31 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1731 * @param[in,out] *S points to an instance of the Q15 PID structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1732 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1733 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1734 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1735 void arm_pid_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1736 arm_pid_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 int32_t resetStateFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 * @brief Reset function for the Q31 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 * @param[in,out] *S points to an instance of the Q31 PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746 void arm_pid_reset_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 arm_pid_instance_q31 * S);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1748
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750 * @brief Initialization function for the Q15 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751 * @param[in,out] *S points to an instance of the Q15 PID structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1755 void arm_pid_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1756 arm_pid_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1757 int32_t resetStateFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1759 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1760 * @brief Reset function for the Q15 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1761 * @param[in,out] *S points to an instance of the q15 PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1762 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1763 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1764 void arm_pid_reset_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1765 arm_pid_instance_q15 * S);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1768 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1769 * @brief Instance structure for the floating-point Linear Interpolate function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1770 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1771 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1772 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1773 uint32_t nValues;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1774 float32_t x1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1775 float32_t xSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1776 float32_t *pYData; /**< pointer to the table of Y values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1777 } arm_linear_interp_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1779 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1780 * @brief Instance structure for the floating-point bilinear interpolation function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1781 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1783 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1784 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1785 uint16_t numRows; /**< number of rows in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1786 uint16_t numCols; /**< number of columns in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1787 float32_t *pData; /**< points to the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1788 } arm_bilinear_interp_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1790 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1791 * @brief Instance structure for the Q31 bilinear interpolation function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1792 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1793
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1794 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1795 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1796 uint16_t numRows; /**< number of rows in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1797 uint16_t numCols; /**< number of columns in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1798 q31_t *pData; /**< points to the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1799 } arm_bilinear_interp_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1801 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1802 * @brief Instance structure for the Q15 bilinear interpolation function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1803 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1805 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1806 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1807 uint16_t numRows; /**< number of rows in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1808 uint16_t numCols; /**< number of columns in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1809 q15_t *pData; /**< points to the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1810 } arm_bilinear_interp_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1811
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1812 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1813 * @brief Instance structure for the Q15 bilinear interpolation function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1814 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1815
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1816 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1817 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1818 uint16_t numRows; /**< number of rows in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1819 uint16_t numCols; /**< number of columns in the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1820 q7_t *pData; /**< points to the data table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1821 } arm_bilinear_interp_instance_q7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1822
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1823
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1824 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1825 * @brief Q7 vector multiplication.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1826 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1827 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1828 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1829 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1830 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1831 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1832
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1833 void arm_mult_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1834 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1835 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1836 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1837 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1838
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1839 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1840 * @brief Q15 vector multiplication.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1841 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1842 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1843 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1844 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1845 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1846 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1847
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1848 void arm_mult_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1849 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1850 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1851 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1852 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1854 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1855 * @brief Q31 vector multiplication.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1856 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1857 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1858 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1859 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1860 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1861 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1862
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1863 void arm_mult_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1864 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1865 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1866 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1867 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1868
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1869 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1870 * @brief Floating-point vector multiplication.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1871 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1872 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1873 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1874 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1875 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1876 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1877
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1878 void arm_mult_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1879 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1880 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1881 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1882 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1884
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1885 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1886 * @brief Instance structure for the Q15 CFFT/CIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1887 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1888
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1889 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1890 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1891 uint16_t fftLen; /**< length of the FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1892 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1893 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1894 q15_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1895 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1896 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1897 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1898 } arm_cfft_radix4_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1899
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1900 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1901 * @brief Instance structure for the Q31 CFFT/CIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1902 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1903
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1904 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1905 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1906 uint16_t fftLen; /**< length of the FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1907 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1908 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1909 q31_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1910 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1911 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1912 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1913 } arm_cfft_radix4_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1914
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1915 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1916 * @brief Instance structure for the floating-point CFFT/CIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1917 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1918
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1919 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1920 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1921 uint16_t fftLen; /**< length of the FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1922 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1923 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1924 float32_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1925 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1926 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1927 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1928 float32_t onebyfftLen; /**< value of 1/fftLen. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1929 } arm_cfft_radix4_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1930
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1931 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1932 * @brief Processing function for the Q15 CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1933 * @param[in] *S points to an instance of the Q15 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1934 * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1935 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1936 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1937
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1938 void arm_cfft_radix4_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1939 const arm_cfft_radix4_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1940 q15_t * pSrc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1941
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1942 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1943 * @brief Initialization function for the Q15 CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1944 * @param[in,out] *S points to an instance of the Q15 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1945 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1946 * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1947 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1948 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1949 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1950
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1951 arm_status arm_cfft_radix4_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1952 arm_cfft_radix4_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1953 uint16_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1954 uint8_t ifftFlag,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1955 uint8_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1956
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1957 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1958 * @brief Processing function for the Q31 CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1959 * @param[in] *S points to an instance of the Q31 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1960 * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1961 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1962 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1963
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1964 void arm_cfft_radix4_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1965 const arm_cfft_radix4_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1966 q31_t * pSrc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1967
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1968 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1969 * @brief Initialization function for the Q31 CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1970 * @param[in,out] *S points to an instance of the Q31 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1971 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1972 * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1973 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1974 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1975 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1976
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1977 arm_status arm_cfft_radix4_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1978 arm_cfft_radix4_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1979 uint16_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1980 uint8_t ifftFlag,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1981 uint8_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1982
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1983 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1984 * @brief Processing function for the floating-point CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1985 * @param[in] *S points to an instance of the floating-point CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1986 * @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1987 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1988 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1989
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1990 void arm_cfft_radix4_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1991 const arm_cfft_radix4_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1992 float32_t * pSrc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1994 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1995 * @brief Initialization function for the floating-point CFFT/CIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1996 * @param[in,out] *S points to an instance of the floating-point CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1997 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1998 * @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1999 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2000 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2001 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2002
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2003 arm_status arm_cfft_radix4_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2004 arm_cfft_radix4_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2005 uint16_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2006 uint8_t ifftFlag,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2007 uint8_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2008
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2009
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2010
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2011 /*----------------------------------------------------------------------
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2012 * Internal functions prototypes FFT function
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2013 ----------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2015 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2016 * @brief Core function for the floating-point CFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2017 * @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2018 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2019 * @param[in] *pCoef points to the twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2020 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2021 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2022 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2023
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2024 void arm_radix4_butterfly_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2025 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2026 uint16_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2027 float32_t * pCoef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2028 uint16_t twidCoefModifier);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2029
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2030 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2031 * @brief Core function for the floating-point CIFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2032 * @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2033 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2034 * @param[in] *pCoef points to twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2035 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2036 * @param[in] onebyfftLen value of 1/fftLen.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2037 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2038 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2039
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2040 void arm_radix4_butterfly_inverse_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2041 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2042 uint16_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2043 float32_t * pCoef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2044 uint16_t twidCoefModifier,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2045 float32_t onebyfftLen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2046
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2047 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2048 * @brief In-place bit reversal function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2049 * @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2050 * @param[in] fftSize length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2051 * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2052 * @param[in] *pBitRevTab points to the bit reversal table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2053 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2054 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2055
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2056 void arm_bitreversal_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2057 float32_t *pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2058 uint16_t fftSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2059 uint16_t bitRevFactor,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2060 uint16_t *pBitRevTab);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2061
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2062 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2063 * @brief Core function for the Q31 CFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2064 * @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2065 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2066 * @param[in] *pCoef points to twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2067 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2068 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2069 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2070
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2071 void arm_radix4_butterfly_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2072 q31_t *pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2073 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2074 q31_t *pCoef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2075 uint32_t twidCoefModifier);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2076
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2077 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2078 * @brief Core function for the Q31 CIFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2079 * @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2080 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2081 * @param[in] *pCoef points to twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2082 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2083 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2084 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2085
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2086 void arm_radix4_butterfly_inverse_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2087 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2088 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2089 q31_t * pCoef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2090 uint32_t twidCoefModifier);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2091
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2092 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2093 * @brief In-place bit reversal function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2094 * @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2095 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2096 * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2097 * @param[in] *pBitRevTab points to bit reversal table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2098 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2099 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2101 void arm_bitreversal_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2102 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2103 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2104 uint16_t bitRevFactor,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2105 uint16_t *pBitRevTab);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2107 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2108 * @brief Core function for the Q15 CFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2109 * @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2110 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2111 * @param[in] *pCoef16 points to twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2112 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2113 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2114 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2115
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2116 void arm_radix4_butterfly_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2117 q15_t *pSrc16,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2118 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2119 q15_t *pCoef16,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2120 uint32_t twidCoefModifier);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2121
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2122 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2123 * @brief Core function for the Q15 CIFFT butterfly process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2124 * @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2125 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2126 * @param[in] *pCoef16 points to twiddle coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2127 * @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2128 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2129 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2131 void arm_radix4_butterfly_inverse_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2132 q15_t *pSrc16,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2133 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2134 q15_t *pCoef16,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2135 uint32_t twidCoefModifier);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2136
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2137 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2138 * @brief In-place bit reversal function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2139 * @param[in, out] *pSrc points to the in-place buffer of Q15 data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2140 * @param[in] fftLen length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2141 * @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2142 * @param[in] *pBitRevTab points to bit reversal table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2143 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2144 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2146 void arm_bitreversal_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2147 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2148 uint32_t fftLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2149 uint16_t bitRevFactor,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2150 uint16_t *pBitRevTab);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2152 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2153 * @brief Instance structure for the Q15 RFFT/RIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2154 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2156 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2157 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2158 uint32_t fftLenReal; /**< length of the real FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2159 uint32_t fftLenBy2; /**< length of the complex FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2160 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2161 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2162 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2163 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2164 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2165 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2166 } arm_rfft_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2167
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2168 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2169 * @brief Instance structure for the Q31 RFFT/RIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2170 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2172 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2173 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2174 uint32_t fftLenReal; /**< length of the real FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2175 uint32_t fftLenBy2; /**< length of the complex FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2176 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2177 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2178 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2179 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2180 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2181 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2182 } arm_rfft_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2184 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2185 * @brief Instance structure for the floating-point RFFT/RIFFT function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2186 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2188 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2189 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2190 uint32_t fftLenReal; /**< length of the real FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2191 uint16_t fftLenBy2; /**< length of the complex FFT. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2192 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2193 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2194 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2195 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2196 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2197 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2198 } arm_rfft_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2200 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2201 * @brief Processing function for the Q15 RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2202 * @param[in] *S points to an instance of the Q15 RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2203 * @param[in] *pSrc points to the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2204 * @param[out] *pDst points to the output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2205 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2206 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2207
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2208 void arm_rfft_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2209 const arm_rfft_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2210 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2211 q15_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2213 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2214 * @brief Initialization function for the Q15 RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2215 * @param[in, out] *S points to an instance of the Q15 RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2216 * @param[in] *S_CFFT points to an instance of the Q15 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2217 * @param[in] fftLenReal length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2218 * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2219 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2220 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2221 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2222
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2223 arm_status arm_rfft_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2224 arm_rfft_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2225 arm_cfft_radix4_instance_q15 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2226 uint32_t fftLenReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2227 uint32_t ifftFlagR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2228 uint32_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2230 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2231 * @brief Processing function for the Q31 RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2232 * @param[in] *S points to an instance of the Q31 RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2233 * @param[in] *pSrc points to the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2234 * @param[out] *pDst points to the output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2235 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2236 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2237
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2238 void arm_rfft_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2239 const arm_rfft_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2240 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2241 q31_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2242
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2243 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2244 * @brief Initialization function for the Q31 RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2245 * @param[in, out] *S points to an instance of the Q31 RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2246 * @param[in, out] *S_CFFT points to an instance of the Q31 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2247 * @param[in] fftLenReal length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2248 * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2249 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2250 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2251 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2253 arm_status arm_rfft_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2254 arm_rfft_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2255 arm_cfft_radix4_instance_q31 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2256 uint32_t fftLenReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2257 uint32_t ifftFlagR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2258 uint32_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2260 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2261 * @brief Initialization function for the floating-point RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2262 * @param[in,out] *S points to an instance of the floating-point RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2263 * @param[in,out] *S_CFFT points to an instance of the floating-point CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2264 * @param[in] fftLenReal length of the FFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2265 * @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2266 * @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2267 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2268 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2270 arm_status arm_rfft_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2271 arm_rfft_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2272 arm_cfft_radix4_instance_f32 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2273 uint32_t fftLenReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2274 uint32_t ifftFlagR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2275 uint32_t bitReverseFlag);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2277 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2278 * @brief Processing function for the floating-point RFFT/RIFFT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2279 * @param[in] *S points to an instance of the floating-point RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2280 * @param[in] *pSrc points to the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2281 * @param[out] *pDst points to the output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2282 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2283 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2285 void arm_rfft_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2286 const arm_rfft_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2287 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2288 float32_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2290 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2291 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2292 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2294 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2295 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2296 uint16_t N; /**< length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2297 uint16_t Nby2; /**< half of the length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2298 float32_t normalize; /**< normalizing factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2299 float32_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2300 float32_t *pCosFactor; /**< points to the cosFactor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2301 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2302 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2303 } arm_dct4_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2305 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2306 * @brief Initialization function for the floating-point DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2307 * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2308 * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2309 * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2310 * @param[in] N length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2311 * @param[in] Nby2 half of the length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2312 * @param[in] normalize normalizing factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2313 * @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.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2314 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2316 arm_status arm_dct4_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2317 arm_dct4_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2318 arm_rfft_instance_f32 * S_RFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2319 arm_cfft_radix4_instance_f32 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2320 uint16_t N,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2321 uint16_t Nby2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2322 float32_t normalize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2323
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2324 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2325 * @brief Processing function for the floating-point DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2326 * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2327 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2328 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2329 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2330 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2332 void arm_dct4_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2333 const arm_dct4_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2334 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2335 float32_t * pInlineBuffer);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2336
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2337 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2338 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2339 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2341 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2342 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2343 uint16_t N; /**< length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2344 uint16_t Nby2; /**< half of the length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2345 q31_t normalize; /**< normalizing factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2346 q31_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2347 q31_t *pCosFactor; /**< points to the cosFactor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2348 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2349 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2350 } arm_dct4_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2352 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2353 * @brief Initialization function for the Q31 DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2354 * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2355 * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2356 * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2357 * @param[in] N length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2358 * @param[in] Nby2 half of the length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2359 * @param[in] normalize normalizing factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2360 * @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.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2361 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2363 arm_status arm_dct4_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2364 arm_dct4_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2365 arm_rfft_instance_q31 * S_RFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2366 arm_cfft_radix4_instance_q31 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2367 uint16_t N,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2368 uint16_t Nby2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2369 q31_t normalize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2371 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2372 * @brief Processing function for the Q31 DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2373 * @param[in] *S points to an instance of the Q31 DCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2374 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2375 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2376 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2377 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2379 void arm_dct4_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2380 const arm_dct4_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2381 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2382 q31_t * pInlineBuffer);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2383
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2384 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2385 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2386 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2388 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2389 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2390 uint16_t N; /**< length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2391 uint16_t Nby2; /**< half of the length of the DCT4. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2392 q15_t normalize; /**< normalizing factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2393 q15_t *pTwiddle; /**< points to the twiddle factor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2394 q15_t *pCosFactor; /**< points to the cosFactor table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2395 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2396 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2397 } arm_dct4_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2399 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2400 * @brief Initialization function for the Q15 DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2401 * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2402 * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2403 * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2404 * @param[in] N length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2405 * @param[in] Nby2 half of the length of the DCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2406 * @param[in] normalize normalizing factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2407 * @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.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2408 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2410 arm_status arm_dct4_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2411 arm_dct4_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2412 arm_rfft_instance_q15 * S_RFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2413 arm_cfft_radix4_instance_q15 * S_CFFT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2414 uint16_t N,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2415 uint16_t Nby2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2416 q15_t normalize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2417
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2418 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2419 * @brief Processing function for the Q15 DCT4/IDCT4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2420 * @param[in] *S points to an instance of the Q15 DCT4 structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2421 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2422 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2423 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2424 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2425
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2426 void arm_dct4_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2427 const arm_dct4_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2428 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2429 q15_t * pInlineBuffer);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2431 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2432 * @brief Floating-point vector addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2433 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2434 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2435 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2436 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2437 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2438 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2439
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2440 void arm_add_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2441 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2442 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2443 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2444 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2446 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2447 * @brief Q7 vector addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2448 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2449 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2450 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2451 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2452 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2453 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2454
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2455 void arm_add_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2456 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2457 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2458 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2459 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2461 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2462 * @brief Q15 vector addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2463 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2464 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2465 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2466 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2467 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2468 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2469
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2470 void arm_add_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2471 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2472 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2473 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2474 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2476 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2477 * @brief Q31 vector addition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2478 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2479 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2480 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2481 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2482 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2483 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2485 void arm_add_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2486 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2487 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2488 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2489 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2491 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2492 * @brief Floating-point vector subtraction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2493 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2494 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2495 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2496 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2497 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2498 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2499
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2500 void arm_sub_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2501 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2502 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2503 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2504 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2506 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2507 * @brief Q7 vector subtraction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2508 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2509 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2510 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2511 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2512 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2513 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2514
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2515 void arm_sub_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2516 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2517 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2518 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2519 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2520
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2521 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2522 * @brief Q15 vector subtraction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2523 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2524 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2525 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2526 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2527 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2528 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2529
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2530 void arm_sub_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2531 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2532 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2533 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2534 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2535
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2536 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2537 * @brief Q31 vector subtraction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2538 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2539 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2540 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2541 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2542 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2543 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2545 void arm_sub_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2546 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2547 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2548 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2549 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2550
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2551 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2552 * @brief Multiplies a floating-point vector by a scalar.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2553 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2554 * @param[in] scale scale factor to be applied
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2555 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2556 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2557 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2558 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2560 void arm_scale_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2561 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2562 float32_t scale,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2563 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2564 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2566 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2567 * @brief Multiplies a Q7 vector by a scalar.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2568 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2569 * @param[in] scaleFract fractional portion of the scale value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2570 * @param[in] shift number of bits to shift the result by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2571 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2572 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2573 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2574 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2576 void arm_scale_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2577 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2578 q7_t scaleFract,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2579 int8_t shift,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2580 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2581 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2583 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2584 * @brief Multiplies a Q15 vector by a scalar.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2585 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2586 * @param[in] scaleFract fractional portion of the scale value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2587 * @param[in] shift number of bits to shift the result by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2588 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2589 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2590 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2591 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2593 void arm_scale_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2594 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2595 q15_t scaleFract,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2596 int8_t shift,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2597 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2598 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2600 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2601 * @brief Multiplies a Q31 vector by a scalar.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2602 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2603 * @param[in] scaleFract fractional portion of the scale value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2604 * @param[in] shift number of bits to shift the result by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2605 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2606 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2607 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2608 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2610 void arm_scale_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2611 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2612 q31_t scaleFract,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2613 int8_t shift,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2614 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2615 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2616
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2617 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2618 * @brief Q7 vector absolute value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2619 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2620 * @param[out] *pDst points to the output buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2621 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2622 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2623 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2625 void arm_abs_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2626 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2627 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2628 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2629
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2630 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2631 * @brief Floating-point vector absolute value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2632 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2633 * @param[out] *pDst points to the output buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2634 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2635 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2636 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2638 void arm_abs_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2639 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2640 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2641 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2642
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2643 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2644 * @brief Q15 vector absolute value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2645 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2646 * @param[out] *pDst points to the output buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2647 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2648 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2649 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2651 void arm_abs_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2652 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2653 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2654 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2656 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2657 * @brief Q31 vector absolute value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2658 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2659 * @param[out] *pDst points to the output buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2660 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2661 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2662 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2663
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2664 void arm_abs_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2665 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2666 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2667 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2669 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2670 * @brief Dot product of floating-point vectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2671 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2672 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2673 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2674 * @param[out] *result output result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2675 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2676 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2677
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2678 void arm_dot_prod_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2679 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2680 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2681 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2682 float32_t * result);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2683
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2684 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2685 * @brief Dot product of Q7 vectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2686 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2687 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2688 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2689 * @param[out] *result output result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2690 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2691 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2693 void arm_dot_prod_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2694 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2695 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2696 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2697 q31_t * result);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2698
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2699 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2700 * @brief Dot product of Q15 vectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2701 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2702 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2703 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2704 * @param[out] *result output result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2705 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2706 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2707
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2708 void arm_dot_prod_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2709 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2710 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2711 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2712 q63_t * result);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2713
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2714 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2715 * @brief Dot product of Q31 vectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2716 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2717 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2718 * @param[in] blockSize number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2719 * @param[out] *result output result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2720 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2721 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2722
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2723 void arm_dot_prod_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2724 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2725 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2726 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2727 q63_t * result);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2728
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2729 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2730 * @brief Shifts the elements of a Q7 vector a specified number of bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2731 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2732 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2733 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2734 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2735 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2736 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2737
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2738 void arm_shift_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2739 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2740 int8_t shiftBits,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2741 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2742 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2744 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2745 * @brief Shifts the elements of a Q15 vector a specified number of bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2746 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2747 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2748 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2749 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2750 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2751 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2753 void arm_shift_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2754 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2755 int8_t shiftBits,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2756 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2757 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2759 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2760 * @brief Shifts the elements of a Q31 vector a specified number of bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2761 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2762 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2763 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2764 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2765 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2766 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2768 void arm_shift_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2769 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2770 int8_t shiftBits,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2771 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2772 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2773
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2774 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2775 * @brief Adds a constant offset to a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2776 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2777 * @param[in] offset is the offset to be added
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2778 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2779 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2780 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2781 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2783 void arm_offset_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2784 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2785 float32_t offset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2786 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2787 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2788
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2789 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2790 * @brief Adds a constant offset to a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2791 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2792 * @param[in] offset is the offset to be added
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2793 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2794 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2795 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2796 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2798 void arm_offset_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2799 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2800 q7_t offset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2801 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2802 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2803
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2804 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2805 * @brief Adds a constant offset to a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2806 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2807 * @param[in] offset is the offset to be added
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2808 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2809 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2810 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2811 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2812
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2813 void arm_offset_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2814 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2815 q15_t offset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2816 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2817 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2818
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2819 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2820 * @brief Adds a constant offset to a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2821 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2822 * @param[in] offset is the offset to be added
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2823 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2824 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2825 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2826 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2828 void arm_offset_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2829 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2830 q31_t offset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2831 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2832 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2834 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2835 * @brief Negates the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2836 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2837 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2838 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2839 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2840 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2842 void arm_negate_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2843 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2844 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2845 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2846
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2847 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2848 * @brief Negates the elements of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2849 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2850 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2851 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2852 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2853 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2854
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2855 void arm_negate_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2856 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2857 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2858 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2859
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2860 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2861 * @brief Negates the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2862 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2863 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2864 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2865 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2866 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2868 void arm_negate_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2869 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2870 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2871 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2872
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2873 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2874 * @brief Negates the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2875 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2876 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2877 * @param[in] blockSize number of samples in the vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2878 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2879 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2880
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2881 void arm_negate_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2882 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2883 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2884 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2885 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2886 * @brief Copies the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2887 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2888 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2889 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2890 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2891 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2892 void arm_copy_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2893 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2894 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2895 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2896
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2897 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2898 * @brief Copies the elements of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2899 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2900 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2901 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2902 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2903 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2904 void arm_copy_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2905 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2906 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2907 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2908
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2909 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2910 * @brief Copies the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2911 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2912 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2913 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2914 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2915 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2916 void arm_copy_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2917 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2918 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2919 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2920
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2921 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2922 * @brief Copies the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2923 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2924 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2925 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2926 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2927 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2928 void arm_copy_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2929 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2930 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2931 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2932 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2933 * @brief Fills a constant value into a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2934 * @param[in] value input value to be filled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2935 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2936 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2937 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2938 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2939 void arm_fill_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2940 float32_t value,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2941 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2942 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2943
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2944 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2945 * @brief Fills a constant value into a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2946 * @param[in] value input value to be filled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2947 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2948 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2949 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2950 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2951 void arm_fill_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2952 q7_t value,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2953 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2954 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2955
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2956 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2957 * @brief Fills a constant value into a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2958 * @param[in] value input value to be filled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2959 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2960 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2961 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2962 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2963 void arm_fill_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2964 q15_t value,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2965 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2966 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2967
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2968 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2969 * @brief Fills a constant value into a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2970 * @param[in] value input value to be filled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2971 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2972 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2973 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2974 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2975 void arm_fill_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2976 q31_t value,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2977 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2978 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2979
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2980 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2981 * @brief Convolution of floating-point sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2982 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2983 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2984 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2985 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2986 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2987 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2988 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2989
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2990 void arm_conv_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2991 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2992 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2993 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2994 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2995 float32_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2996
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2997 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2998 * @brief Convolution of Q15 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2999 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3000 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3001 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3002 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3003 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3004 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3005 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3006
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3007 void arm_conv_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3008 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3009 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3010 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3011 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3012 q15_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3013
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3014 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3015 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3016 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3017 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3018 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3019 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3020 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3021 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3022 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3023
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3024 void arm_conv_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3025 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3026 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3027 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3028 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3029 q15_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3030
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3031 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3032 * @brief Convolution of Q31 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3033 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3034 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3035 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3036 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3037 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3038 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3039 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3040
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3041 void arm_conv_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3042 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3043 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3044 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3045 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3046 q31_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3047
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3048 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3049 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3050 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3051 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3052 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3053 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3054 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3055 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3056 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3057
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3058 void arm_conv_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3059 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3060 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3061 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3062 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3063 q31_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3064
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3065 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3066 * @brief Convolution of Q7 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3067 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3068 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3069 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3070 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3071 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3072 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3073 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3074
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3075 void arm_conv_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3076 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3077 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3078 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3079 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3080 q7_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3081
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3082 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3083 * @brief Partial convolution of floating-point sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3084 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3085 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3086 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3087 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3088 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3089 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3090 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3091 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3092 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3093
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3094 arm_status arm_conv_partial_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3095 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3096 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3097 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3098 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3099 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3100 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3101 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3102
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3103 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3104 * @brief Partial convolution of Q15 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3105 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3106 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3107 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3108 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3109 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3110 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3111 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3112 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3113 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3115 arm_status arm_conv_partial_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3116 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3117 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3118 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3119 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3120 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3121 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3122 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3124 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3125 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3126 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3127 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3128 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3129 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3130 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3131 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3132 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3133 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3134 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3136 arm_status arm_conv_partial_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3137 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3138 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3139 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3140 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3141 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3142 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3143 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3145 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3146 * @brief Partial convolution of Q31 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3147 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3148 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3149 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3150 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3151 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3152 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3153 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3154 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3155 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3157 arm_status arm_conv_partial_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3158 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3159 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3160 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3161 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3162 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3163 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3164 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3167 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3168 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3169 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3170 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3171 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3172 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3173 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3174 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3175 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3176 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3177 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3179 arm_status arm_conv_partial_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3180 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3181 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3182 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3183 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3184 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3185 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3186 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3188 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3189 * @brief Partial convolution of Q7 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3190 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3191 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3192 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3193 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3194 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3195 * @param[in] firstIndex is the first output sample to start with.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3196 * @param[in] numPoints is the number of output points to be computed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3197 * @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].
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3198 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3200 arm_status arm_conv_partial_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3201 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3202 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3203 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3204 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3205 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3206 uint32_t firstIndex,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3207 uint32_t numPoints);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3210 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3211 * @brief Instance structure for the Q15 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3212 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3214 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3216 uint8_t M; /**< decimation factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3217 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3218 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3219 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3220 } arm_fir_decimate_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3222 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3223 * @brief Instance structure for the Q31 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3224 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3226 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3227 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3228 uint8_t M; /**< decimation factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3229 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3230 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3231 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3232
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3233 } arm_fir_decimate_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3235 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3236 * @brief Instance structure for the floating-point FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3237 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3239 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3240 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3241 uint8_t M; /**< decimation factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3242 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3243 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3244 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3246 } arm_fir_decimate_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3250 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3251 * @brief Processing function for the floating-point FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3252 * @param[in] *S points to an instance of the floating-point FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3253 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3254 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3255 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3256 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3257 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3258
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3259 void arm_fir_decimate_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3260 const arm_fir_decimate_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3261 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3262 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3263 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3266 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3267 * @brief Initialization function for the floating-point FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3268 * @param[in,out] *S points to an instance of the floating-point FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3269 * @param[in] numTaps number of coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3270 * @param[in] M decimation factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3271 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3272 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3273 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3274 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3275 * <code>blockSize</code> is not a multiple of <code>M</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3278 arm_status arm_fir_decimate_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3279 arm_fir_decimate_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3280 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3281 uint8_t M,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3282 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3283 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3284 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3286 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3287 * @brief Processing function for the Q15 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3288 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3289 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3290 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3291 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3292 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3293 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3295 void arm_fir_decimate_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3296 const arm_fir_decimate_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3297 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3298 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3299 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3301 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3302 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3303 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3304 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3305 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3306 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3307 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3308 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3309
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3310 void arm_fir_decimate_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3311 const arm_fir_decimate_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3312 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3313 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3314 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3318 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3319 * @brief Initialization function for the Q15 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3320 * @param[in,out] *S points to an instance of the Q15 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3321 * @param[in] numTaps number of coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3322 * @param[in] M decimation factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3323 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3324 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3325 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3326 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3327 * <code>blockSize</code> is not a multiple of <code>M</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3328 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3329
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3330 arm_status arm_fir_decimate_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3331 arm_fir_decimate_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3332 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3333 uint8_t M,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3334 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3335 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3336 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3337
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3338 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3339 * @brief Processing function for the Q31 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3340 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3341 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3342 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3343 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3344 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3345 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3347 void arm_fir_decimate_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3348 const arm_fir_decimate_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3349 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3350 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3351 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3353 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3354 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3355 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3356 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3357 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3358 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3359 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3360 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3361
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3362 void arm_fir_decimate_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3363 arm_fir_decimate_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3364 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3365 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3366 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3369 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3370 * @brief Initialization function for the Q31 FIR decimator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3371 * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3372 * @param[in] numTaps number of coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3373 * @param[in] M decimation factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3374 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3375 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3376 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3377 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3378 * <code>blockSize</code> is not a multiple of <code>M</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3379 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3381 arm_status arm_fir_decimate_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3382 arm_fir_decimate_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3383 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3384 uint8_t M,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3385 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3386 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3387 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3388
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3391 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3392 * @brief Instance structure for the Q15 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3393 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3394
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3395 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3396 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3397 uint8_t L; /**< upsample factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3398 uint16_t phaseLength; /**< length of each polyphase filter component. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3399 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3400 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3401 } arm_fir_interpolate_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3402
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3403 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3404 * @brief Instance structure for the Q31 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3405 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3407 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3408 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3409 uint8_t L; /**< upsample factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3410 uint16_t phaseLength; /**< length of each polyphase filter component. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3411 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3412 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3413 } arm_fir_interpolate_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3415 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3416 * @brief Instance structure for the floating-point FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3417 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3418
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3419 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3420 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3421 uint8_t L; /**< upsample factor. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3422 uint16_t phaseLength; /**< length of each polyphase filter component. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3423 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3424 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3425 } arm_fir_interpolate_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3428 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3429 * @brief Processing function for the Q15 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3430 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3431 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3432 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3433 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3434 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3435 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3437 void arm_fir_interpolate_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3438 const arm_fir_interpolate_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3439 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3440 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3441 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3444 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3445 * @brief Initialization function for the Q15 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3446 * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3447 * @param[in] L upsample factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3448 * @param[in] numTaps number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3449 * @param[in] *pCoeffs points to the filter coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3450 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3451 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3452 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3453 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3454 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3456 arm_status arm_fir_interpolate_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3457 arm_fir_interpolate_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3458 uint8_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3459 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3460 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3461 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3462 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3464 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3465 * @brief Processing function for the Q31 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3466 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3467 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3468 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3469 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3470 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3471 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3473 void arm_fir_interpolate_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3474 const arm_fir_interpolate_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3475 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3476 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3477 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3479 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3480 * @brief Initialization function for the Q31 FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3481 * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3482 * @param[in] L upsample factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3483 * @param[in] numTaps number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3484 * @param[in] *pCoeffs points to the filter coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3485 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3486 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3487 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3488 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3489 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3491 arm_status arm_fir_interpolate_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3492 arm_fir_interpolate_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3493 uint8_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3494 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3495 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3496 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3497 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3499
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3500 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3501 * @brief Processing function for the floating-point FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3502 * @param[in] *S points to an instance of the floating-point FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3503 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3504 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3505 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3506 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3507 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3509 void arm_fir_interpolate_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3510 const arm_fir_interpolate_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3511 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3512 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3513 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3514
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3515 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3516 * @brief Initialization function for the floating-point FIR interpolator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3517 * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3518 * @param[in] L upsample factor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3519 * @param[in] numTaps number of filter coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3520 * @param[in] *pCoeffs points to the filter coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3521 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3522 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3523 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3524 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3525 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3526
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3527 arm_status arm_fir_interpolate_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3528 arm_fir_interpolate_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3529 uint8_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3530 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3531 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3532 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3533 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3535 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3536 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3537 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3539 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3540 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3541 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3542 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3543 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3544 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3545
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3546 } arm_biquad_cas_df1_32x64_ins_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3547
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3548
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3549 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3550 * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3551 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3552 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3553 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3554 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3555 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3557 void arm_biquad_cas_df1_32x64_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3558 const arm_biquad_cas_df1_32x64_ins_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3559 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3560 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3561 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3563
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3564 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3565 * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3566 * @param[in] numStages number of 2nd order stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3567 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3568 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3569 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3570 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3571 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3572
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3573 void arm_biquad_cas_df1_32x64_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3574 arm_biquad_cas_df1_32x64_ins_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3575 uint8_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3576 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3577 q63_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3578 uint8_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3579
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3582 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3583 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3584 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3585
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3586 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3587 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3588 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3589 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3590 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3591 } arm_biquad_cascade_df2T_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3594 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3595 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3596 * @param[in] *S points to an instance of the filter data structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3597 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3598 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3599 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3600 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3601 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3602
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3603 void arm_biquad_cascade_df2T_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3604 const arm_biquad_cascade_df2T_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3605 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3606 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3607 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3608
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3610 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3611 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3612 * @param[in,out] *S points to an instance of the filter data structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3613 * @param[in] numStages number of 2nd order stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3614 * @param[in] *pCoeffs points to the filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3615 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3616 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3617 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3618
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3619 void arm_biquad_cascade_df2T_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3620 arm_biquad_cascade_df2T_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3621 uint8_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3622 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3623 float32_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3625
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3626
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3627 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3628 * @brief Instance structure for the Q15 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3629 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3631 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3632 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3633 uint16_t numStages; /**< number of filter stages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3634 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3635 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3636 } arm_fir_lattice_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3638 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3639 * @brief Instance structure for the Q31 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3640 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3642 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3643 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3644 uint16_t numStages; /**< number of filter stages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3645 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3646 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3647 } arm_fir_lattice_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3648
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3649 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3650 * @brief Instance structure for the floating-point FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3651 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3653 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3654 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3655 uint16_t numStages; /**< number of filter stages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3656 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3657 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3658 } arm_fir_lattice_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3660 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3661 * @brief Initialization function for the Q15 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3662 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3663 * @param[in] numStages number of filter stages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3664 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3665 * @param[in] *pState points to the state buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3666 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3667 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3669 void arm_fir_lattice_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3670 arm_fir_lattice_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3671 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3672 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3673 q15_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3674
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3675
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3676 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3677 * @brief Processing function for the Q15 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3678 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3679 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3680 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3681 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3682 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3683 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3684 void arm_fir_lattice_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3685 const arm_fir_lattice_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3686 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3687 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3688 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3690 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3691 * @brief Initialization function for the Q31 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3692 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3693 * @param[in] numStages number of filter stages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3694 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3695 * @param[in] *pState points to the state buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3696 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3697 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3698
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3699 void arm_fir_lattice_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3700 arm_fir_lattice_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3701 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3702 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3703 q31_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3704
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3705
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3706 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3707 * @brief Processing function for the Q31 FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3708 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3709 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3710 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3711 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3712 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3713 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3714
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3715 void arm_fir_lattice_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3716 const arm_fir_lattice_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3717 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3718 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3719 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3721 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3722 * @brief Initialization function for the floating-point FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3723 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3724 * @param[in] numStages number of filter stages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3725 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3726 * @param[in] *pState points to the state buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3727 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3728 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3729
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3730 void arm_fir_lattice_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3731 arm_fir_lattice_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3732 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3733 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3734 float32_t * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3735
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3736 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3737 * @brief Processing function for the floating-point FIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3738 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3739 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3740 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3741 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3742 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3743 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3744
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3745 void arm_fir_lattice_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3746 const arm_fir_lattice_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3747 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3748 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3749 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3750
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3751 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3752 * @brief Instance structure for the Q15 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3753 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3754 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3755 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3756 uint16_t numStages; /**< number of stages in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3757 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3758 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3759 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3760 } arm_iir_lattice_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3761
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3762 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3763 * @brief Instance structure for the Q31 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3764 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3765 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3766 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3767 uint16_t numStages; /**< number of stages in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3768 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3769 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3770 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3771 } arm_iir_lattice_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3773 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3774 * @brief Instance structure for the floating-point IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3775 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3776 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3777 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3778 uint16_t numStages; /**< number of stages in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3779 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3780 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3781 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3782 } arm_iir_lattice_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3784 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3785 * @brief Processing function for the floating-point IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3786 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3787 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3788 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3789 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3790 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3791 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3793 void arm_iir_lattice_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3794 const arm_iir_lattice_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3795 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3796 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3797 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3798
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3799 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3800 * @brief Initialization function for the floating-point IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3801 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3802 * @param[in] numStages number of stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3803 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3804 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3805 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3806 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3807 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3808 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3809
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3810 void arm_iir_lattice_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3811 arm_iir_lattice_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3812 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3813 float32_t *pkCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3814 float32_t *pvCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3815 float32_t *pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3816 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3817
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3818
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3819 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3820 * @brief Processing function for the Q31 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3821 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3822 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3823 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3824 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3825 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3826 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3828 void arm_iir_lattice_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3829 const arm_iir_lattice_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3830 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3831 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3832 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3834
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3835 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3836 * @brief Initialization function for the Q31 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3837 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3838 * @param[in] numStages number of stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3839 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3840 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3841 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3842 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3843 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3844 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3846 void arm_iir_lattice_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3847 arm_iir_lattice_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3848 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3849 q31_t *pkCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3850 q31_t *pvCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3851 q31_t *pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3852 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3854
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3855 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3856 * @brief Processing function for the Q15 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3857 * @param[in] *S points to an instance of the Q15 IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3858 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3859 * @param[out] *pDst points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3860 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3861 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3862 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3864 void arm_iir_lattice_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3865 const arm_iir_lattice_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3866 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3867 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3868 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3869
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3871 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3872 * @brief Initialization function for the Q15 IIR lattice filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3873 * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3874 * @param[in] numStages number of stages in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3875 * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3876 * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3877 * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3878 * @param[in] blockSize number of samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3879 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3880 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3881
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3882 void arm_iir_lattice_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3883 arm_iir_lattice_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3884 uint16_t numStages,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3885 q15_t *pkCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3886 q15_t *pvCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3887 q15_t *pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3888 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3889
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3890 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3891 * @brief Instance structure for the floating-point LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3892 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3893
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3894 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3895 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3896 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3897 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3898 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3899 float32_t mu; /**< step size that controls filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3900 } arm_lms_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3901
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3902 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3903 * @brief Processing function for floating-point LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3904 * @param[in] *S points to an instance of the floating-point LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3905 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3906 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3907 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3908 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3909 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3910 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3911 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3912
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3913 void arm_lms_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3914 const arm_lms_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3915 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3916 float32_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3917 float32_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3918 float32_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3919 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3920
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3921 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3922 * @brief Initialization function for floating-point LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3923 * @param[in] *S points to an instance of the floating-point LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3924 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3925 * @param[in] *pCoeffs points to the coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3926 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3927 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3928 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3929 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3930 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3931
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3932 void arm_lms_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3933 arm_lms_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3934 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3935 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3936 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3937 float32_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3938 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3939
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3940 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3941 * @brief Instance structure for the Q15 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3942 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3943
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3944 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3945 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3946 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3947 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3948 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3949 q15_t mu; /**< step size that controls filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3950 uint32_t postShift; /**< bit shift applied to coefficients. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3951 } arm_lms_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3952
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3953
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3954 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3955 * @brief Initialization function for the Q15 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3956 * @param[in] *S points to an instance of the Q15 LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3957 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3958 * @param[in] *pCoeffs points to the coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3959 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3960 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3961 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3962 * @param[in] postShift bit shift applied to coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3963 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3964 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3965
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3966 void arm_lms_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3967 arm_lms_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3968 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3969 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3970 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3971 q15_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3972 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3973 uint32_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3974
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3975 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3976 * @brief Processing function for Q15 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3977 * @param[in] *S points to an instance of the Q15 LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3978 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3979 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3980 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3981 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3982 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3983 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3984 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3985
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3986 void arm_lms_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3987 const arm_lms_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3988 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3989 q15_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3990 q15_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3991 q15_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3992 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3994
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3995 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3996 * @brief Instance structure for the Q31 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3997 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3998
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3999 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4000 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4001 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4002 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4003 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4004 q31_t mu; /**< step size that controls filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4005 uint32_t postShift; /**< bit shift applied to coefficients. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4006
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4007 } arm_lms_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4008
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4009 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4010 * @brief Processing function for Q31 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4011 * @param[in] *S points to an instance of the Q15 LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4012 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4013 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4014 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4015 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4016 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4017 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4018 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4019
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4020 void arm_lms_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4021 const arm_lms_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4022 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4023 q31_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4024 q31_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4025 q31_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4026 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4027
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4028 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4029 * @brief Initialization function for Q31 LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4030 * @param[in] *S points to an instance of the Q31 LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4031 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4032 * @param[in] *pCoeffs points to coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4033 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4034 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4035 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4036 * @param[in] postShift bit shift applied to coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4037 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4038 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4039
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4040 void arm_lms_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4041 arm_lms_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4042 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4043 q31_t *pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4044 q31_t *pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4045 q31_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4046 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4047 uint32_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4048
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4049 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4050 * @brief Instance structure for the floating-point normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4051 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4052
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4053 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4054 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4055 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4056 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4057 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4058 float32_t mu; /**< step size that control filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4059 float32_t energy; /**< saves previous frame energy. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4060 float32_t x0; /**< saves previous input sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4061 } arm_lms_norm_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4062
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4063 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4064 * @brief Processing function for floating-point normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4065 * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4066 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4067 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4068 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4069 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4070 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4071 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4072 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4073
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4074 void arm_lms_norm_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4075 arm_lms_norm_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4076 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4077 float32_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4078 float32_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4079 float32_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4080 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4081
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4082 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4083 * @brief Initialization function for floating-point normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4084 * @param[in] *S points to an instance of the floating-point LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4085 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4086 * @param[in] *pCoeffs points to coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4087 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4088 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4089 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4090 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4091 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4092
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4093 void arm_lms_norm_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4094 arm_lms_norm_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4095 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4096 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4097 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4098 float32_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4099 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4102 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4103 * @brief Instance structure for the Q31 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4104 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4105 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4106 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4107 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4108 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4109 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4110 q31_t mu; /**< step size that controls filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4111 uint8_t postShift; /**< bit shift applied to coefficients. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4112 q31_t *recipTable; /**< points to the reciprocal initial value table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4113 q31_t energy; /**< saves previous frame energy. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4114 q31_t x0; /**< saves previous input sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4115 } arm_lms_norm_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4117 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4118 * @brief Processing function for Q31 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4119 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4120 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4121 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4122 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4123 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4124 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4125 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4126 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4128 void arm_lms_norm_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4129 arm_lms_norm_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4130 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4131 q31_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4132 q31_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4133 q31_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4134 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4136 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4137 * @brief Initialization function for Q31 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4138 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4139 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4140 * @param[in] *pCoeffs points to coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4141 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4142 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4143 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4144 * @param[in] postShift bit shift applied to coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4145 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4146 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4147
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4148 void arm_lms_norm_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4149 arm_lms_norm_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4150 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4151 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4152 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4153 q31_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4154 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4155 uint8_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4157 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4158 * @brief Instance structure for the Q15 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4159 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4161 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4162 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4163 uint16_t numTaps; /**< Number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4164 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4165 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4166 q15_t mu; /**< step size that controls filter coefficient updates. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4167 uint8_t postShift; /**< bit shift applied to coefficients. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4168 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4169 q15_t energy; /**< saves previous frame energy. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4170 q15_t x0; /**< saves previous input sample. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4171 } arm_lms_norm_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4172
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4173 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4174 * @brief Processing function for Q15 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4175 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4176 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4177 * @param[in] *pRef points to the block of reference data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4178 * @param[out] *pOut points to the block of output data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4179 * @param[out] *pErr points to the block of error data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4180 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4181 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4182 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4184 void arm_lms_norm_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4185 arm_lms_norm_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4186 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4187 q15_t * pRef,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4188 q15_t * pOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4189 q15_t * pErr,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4190 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4192
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4193 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4194 * @brief Initialization function for Q15 normalized LMS filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4195 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4196 * @param[in] numTaps number of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4197 * @param[in] *pCoeffs points to coefficient buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4198 * @param[in] *pState points to state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4199 * @param[in] mu step size that controls filter coefficient updates.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4200 * @param[in] blockSize number of samples to process.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4201 * @param[in] postShift bit shift applied to coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4202 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4203 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4205 void arm_lms_norm_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4206 arm_lms_norm_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4207 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4208 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4209 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4210 q15_t mu,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4211 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4212 uint8_t postShift);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4214 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4215 * @brief Correlation of floating-point sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4216 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4217 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4218 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4219 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4220 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4221 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4222 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4223
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4224 void arm_correlate_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4225 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4226 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4227 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4228 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4229 float32_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4231 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4232 * @brief Correlation of Q15 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4233 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4234 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4235 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4236 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4237 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4238 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4239 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4241 void arm_correlate_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4242 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4243 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4244 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4245 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4246 q15_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4248 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4249 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4250 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4251 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4252 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4253 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4254 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4255 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4256 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4258 void arm_correlate_fast_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4259 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4260 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4261 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4262 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4263 q15_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4265 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4266 * @brief Correlation of Q31 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4267 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4268 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4269 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4270 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4271 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4272 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4273 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4275 void arm_correlate_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4276 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4277 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4278 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4279 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4280 q31_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4281
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4282 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4283 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4284 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4285 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4286 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4287 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4288 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4289 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4290 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4291
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4292 void arm_correlate_fast_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4293 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4294 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4295 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4296 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4297 q31_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4299 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4300 * @brief Correlation of Q7 sequences.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4301 * @param[in] *pSrcA points to the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4302 * @param[in] srcALen length of the first input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4303 * @param[in] *pSrcB points to the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4304 * @param[in] srcBLen length of the second input sequence.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4305 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4306 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4307 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4309 void arm_correlate_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4310 q7_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4311 uint32_t srcALen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4312 q7_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4313 uint32_t srcBLen,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4314 q7_t * pDst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4316 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4317 * @brief Instance structure for the floating-point sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4318 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4319 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4320 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4321 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4322 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4323 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4324 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4325 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4326 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4327 } arm_fir_sparse_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4328
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4329 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4330 * @brief Instance structure for the Q31 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4331 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4333 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4334 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4335 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4336 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4337 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4338 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4339 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4340 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4341 } arm_fir_sparse_instance_q31;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4342
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4343 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4344 * @brief Instance structure for the Q15 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4345 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4347 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4348 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4349 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4350 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4351 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4352 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4353 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4354 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4355 } arm_fir_sparse_instance_q15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4356
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4357 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4358 * @brief Instance structure for the Q7 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4359 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4361 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4362 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4363 uint16_t numTaps; /**< number of coefficients in the filter. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4364 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4365 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4366 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4367 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4368 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4369 } arm_fir_sparse_instance_q7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4371 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4372 * @brief Processing function for the floating-point sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4373 * @param[in] *S points to an instance of the floating-point sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4374 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4375 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4376 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4377 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4378 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4379 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4381 void arm_fir_sparse_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4382 arm_fir_sparse_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4383 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4384 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4385 float32_t * pScratchIn,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4386 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4388 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4389 * @brief Initialization function for the floating-point sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4390 * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4391 * @param[in] numTaps number of nonzero coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4392 * @param[in] *pCoeffs points to the array of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4393 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4394 * @param[in] *pTapDelay points to the array of offset times.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4395 * @param[in] maxDelay maximum offset time supported.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4396 * @param[in] blockSize number of samples that will be processed per block.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4397 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4398 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4400 void arm_fir_sparse_init_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4401 arm_fir_sparse_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4402 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4403 float32_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4404 float32_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4405 int32_t * pTapDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4406 uint16_t maxDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4407 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4408
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4409 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4410 * @brief Processing function for the Q31 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4411 * @param[in] *S points to an instance of the Q31 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4412 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4413 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4414 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4415 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4416 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4417 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4418
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4419 void arm_fir_sparse_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4420 arm_fir_sparse_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4421 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4422 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4423 q31_t * pScratchIn,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4424 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4425
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4426 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4427 * @brief Initialization function for the Q31 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4428 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4429 * @param[in] numTaps number of nonzero coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4430 * @param[in] *pCoeffs points to the array of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4431 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4432 * @param[in] *pTapDelay points to the array of offset times.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4433 * @param[in] maxDelay maximum offset time supported.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4434 * @param[in] blockSize number of samples that will be processed per block.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4435 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4436 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4438 void arm_fir_sparse_init_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4439 arm_fir_sparse_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4440 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4441 q31_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4442 q31_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4443 int32_t * pTapDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4444 uint16_t maxDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4445 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4446
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4447 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4448 * @brief Processing function for the Q15 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4449 * @param[in] *S points to an instance of the Q15 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4450 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4451 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4452 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4453 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4454 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4455 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4456 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4457
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4458 void arm_fir_sparse_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4459 arm_fir_sparse_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4460 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4461 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4462 q15_t * pScratchIn,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4463 q31_t * pScratchOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4464 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4465
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4467 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4468 * @brief Initialization function for the Q15 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4469 * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4470 * @param[in] numTaps number of nonzero coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4471 * @param[in] *pCoeffs points to the array of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4472 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4473 * @param[in] *pTapDelay points to the array of offset times.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4474 * @param[in] maxDelay maximum offset time supported.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4475 * @param[in] blockSize number of samples that will be processed per block.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4476 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4477 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4479 void arm_fir_sparse_init_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4480 arm_fir_sparse_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4481 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4482 q15_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4483 q15_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4484 int32_t * pTapDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4485 uint16_t maxDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4486 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4487
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4488 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4489 * @brief Processing function for the Q7 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4490 * @param[in] *S points to an instance of the Q7 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4491 * @param[in] *pSrc points to the block of input data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4492 * @param[out] *pDst points to the block of output data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4493 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4494 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4495 * @param[in] blockSize number of input samples to process per call.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4496 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4497 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4499 void arm_fir_sparse_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4500 arm_fir_sparse_instance_q7 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4501 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4502 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4503 q7_t * pScratchIn,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4504 q31_t * pScratchOut,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4505 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4506
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4507 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4508 * @brief Initialization function for the Q7 sparse FIR filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4509 * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4510 * @param[in] numTaps number of nonzero coefficients in the filter.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4511 * @param[in] *pCoeffs points to the array of filter coefficients.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4512 * @param[in] *pState points to the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4513 * @param[in] *pTapDelay points to the array of offset times.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4514 * @param[in] maxDelay maximum offset time supported.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4515 * @param[in] blockSize number of samples that will be processed per block.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4516 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4517 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4519 void arm_fir_sparse_init_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4520 arm_fir_sparse_instance_q7 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4521 uint16_t numTaps,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4522 q7_t * pCoeffs,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4523 q7_t * pState,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4524 int32_t *pTapDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4525 uint16_t maxDelay,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4526 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4529 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4530 * @brief Floating-point sin_cos function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4531 * @param[in] theta input value in degrees
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4532 * @param[out] *pSinVal points to the processed sine output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4533 * @param[out] *pCosVal points to the processed cos output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4534 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4535 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4537 void arm_sin_cos_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4538 float32_t theta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4539 float32_t *pSinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4540 float32_t *pCcosVal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4541
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4542 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4543 * @brief Q31 sin_cos function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4544 * @param[in] theta scaled input value in degrees
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4545 * @param[out] *pSinVal points to the processed sine output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4546 * @param[out] *pCosVal points to the processed cosine output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4547 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4548 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4549
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4550 void arm_sin_cos_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4551 q31_t theta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4552 q31_t *pSinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4553 q31_t *pCosVal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4554
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4555
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4556 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4557 * @brief Floating-point complex conjugate.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4558 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4559 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4560 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4561 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4562 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4563
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4564 void arm_cmplx_conj_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4565 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4566 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4567 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4569 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4570 * @brief Q31 complex conjugate.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4571 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4572 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4573 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4574 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4575 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4577 void arm_cmplx_conj_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4578 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4579 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4580 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4582 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4583 * @brief Q15 complex conjugate.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4584 * @param[in] *pSrc points to the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4585 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4586 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4587 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4588 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4589
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4590 void arm_cmplx_conj_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4591 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4592 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4593 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4596
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4597 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4598 * @brief Floating-point complex magnitude squared
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4599 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4600 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4601 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4602 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4603 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4604
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4605 void arm_cmplx_mag_squared_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4606 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4607 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4608 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4610 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4611 * @brief Q31 complex magnitude squared
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4612 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4613 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4614 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4615 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4616 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4618 void arm_cmplx_mag_squared_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4619 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4620 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4621 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4623 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4624 * @brief Q15 complex magnitude squared
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4625 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4626 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4627 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4628 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4629 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4631 void arm_cmplx_mag_squared_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4632 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4633 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4634 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4635
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4636
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4637 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4638 * @ingroup groupController
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4639 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4640
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4641 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4642 * @defgroup PID PID Motor Control
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4643 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4644 * A Proportional Integral Derivative (PID) controller is a generic feedback control
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4645 * loop mechanism widely used in industrial control systems.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4646 * A PID controller is the most commonly used type of feedback controller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4647 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4648 * This set of functions implements (PID) controllers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4649 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4650 * of data and each call to the function returns a single processed value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4651 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4652 * is the input sample value. The functions return the output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4653 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4654 * \par Algorithm:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4655 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4656 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4657 * A0 = Kp + Ki + Kd
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4658 * A1 = (-Kp ) - (2 * Kd )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4659 * A2 = Kd </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4660 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4661 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4662 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4663 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4664 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4665 * \image html PID.gif "Proportional Integral Derivative Controller"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4666 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4667 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4668 * The PID controller calculates an "error" value as the difference between
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4669 * the measured output and the reference input.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4670 * The controller attempts to minimize the error by adjusting the process control inputs.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4671 * The proportional value determines the reaction to the current error,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4672 * the integral value determines the reaction based on the sum of recent errors,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4673 * and the derivative value determines the reaction based on the rate at which the error has been changing.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4674 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4675 * \par Instance Structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4676 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4677 * A separate instance structure must be defined for each PID Controller.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4678 * There are separate instance structure declarations for each of the 3 supported data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4679 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4680 * \par Reset Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4681 * There is also an associated reset function for each data type which clears the state array.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4682 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4683 * \par Initialization Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4684 * There is also an associated initialization function for each data type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4685 * The initialization function performs the following operations:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4686 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4687 * - Zeros out the values in the state buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4688 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4689 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4690 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4691 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4692 * \par Fixed-Point Behavior
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4693 * Care must be taken when using the fixed-point versions of the PID Controller functions.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4694 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4695 * Refer to the function specific documentation below for usage guidelines.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4696 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4698 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4699 * @addtogroup PID
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4700 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4701 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4702
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4703 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4704 * @brief Process function for the floating-point PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4705 * @param[in,out] *S is an instance of the floating-point PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4706 * @param[in] in input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4707 * @return out processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4708 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4709
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4711 static __INLINE float32_t arm_pid_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4712 arm_pid_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4713 float32_t in)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4714 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4715 float32_t out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4716
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4717 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4718 out = (S->A0 * in) +
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4719 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4721 /* Update state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4722 S->state[1] = S->state[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4723 S->state[0] = in;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4724 S->state[2] = out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4726 /* return to application */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4727 return (out);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4728
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4729 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4731 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4732 * @brief Process function for the Q31 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4733 * @param[in,out] *S points to an instance of the Q31 PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4734 * @param[in] in input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4735 * @return out processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4736 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4737 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4738 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4739 * The function is implemented using an internal 64-bit accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4740 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4741 * Thus, if the accumulator result overflows it wraps around rather than clip.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4742 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4743 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4744 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4746 static __INLINE q31_t arm_pid_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4747 arm_pid_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4748 q31_t in)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4749 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4750 q63_t acc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4751 q31_t out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4753 /* acc = A0 * x[n] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4754 acc = (q63_t) S->A0 * in;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4755
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4756 /* acc += A1 * x[n-1] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4757 acc += (q63_t) S->A1 * S->state[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4759 /* acc += A2 * x[n-2] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4760 acc += (q63_t) S->A2 * S->state[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4761
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4762 /* convert output to 1.31 format to add y[n-1] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4763 out = (q31_t) (acc >> 31u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4765 /* out += y[n-1] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4766 out += S->state[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4768 /* Update state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4769 S->state[1] = S->state[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4770 S->state[0] = in;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4771 S->state[2] = out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4773 /* return to application */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4774 return (out);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4775
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4776 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4777
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4778 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4779 * @brief Process function for the Q15 PID Control.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4780 * @param[in,out] *S points to an instance of the Q15 PID Control structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4781 * @param[in] in input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4782 * @return out processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4783 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4784 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4785 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4786 * The function is implemented using a 64-bit internal accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4787 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4788 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4789 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4790 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4791 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4792 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4793
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4794 static __INLINE q15_t arm_pid_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4795 arm_pid_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4796 q15_t in)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4797 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4798 q63_t acc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4799 q15_t out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4801 /* Implementation of PID controller */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4802
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4803 #ifdef ARM_MATH_CM0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4805 /* acc = A0 * x[n] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4806 acc = ((q31_t) S->A0 )* in ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4807
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4808 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4809
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4810 /* acc = A0 * x[n] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4811 acc = (q31_t) __SMUAD(S->A0, in);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4812
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4813 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4814
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4815 #ifdef ARM_MATH_CM0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4817 /* acc += A1 * x[n-1] + A2 * x[n-2] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4818 acc += (q31_t) S->A1 * S->state[0] ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4819 acc += (q31_t) S->A2 * S->state[1] ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4820
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4821 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4822
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4823 /* acc += A1 * x[n-1] + A2 * x[n-2] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4824 acc = __SMLALD(S->A1, (q31_t)__SIMD32(S->state), acc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4825
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4826 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4828 /* acc += y[n-1] */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4829 acc += (q31_t) S->state[2] << 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4830
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4831 /* saturate the output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4832 out = (q15_t) (__SSAT((acc >> 15), 16));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4834 /* Update state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4835 S->state[1] = S->state[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4836 S->state[0] = in;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4837 S->state[2] = out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4838
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4839 /* return to application */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4840 return (out);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4842 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4843
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4844 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4845 * @} end of PID group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4846 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4847
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4848
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4849 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4850 * @brief Floating-point matrix inverse.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4851 * @param[in] *src points to the instance of the input floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4852 * @param[out] *dst points to the instance of the output floating-point matrix structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4853 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4854 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4855 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4856
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4857 arm_status arm_mat_inverse_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4858 const arm_matrix_instance_f32 * src,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4859 arm_matrix_instance_f32 * dst);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4860
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4861
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4862
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4863 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4864 * @ingroup groupController
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4865 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4866
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4868 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4869 * @defgroup clarke Vector Clarke Transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4870 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4871 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4872 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4873 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4874 * \image html clarke.gif Stator current space vector and its components in (a,b).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4875 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4876 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4877 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4878 * The function operates on a single sample of data and each call to the function returns the processed output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4879 * The library provides separate functions for Q31 and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4880 * \par Algorithm
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4881 * \image html clarkeFormula.gif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4882 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4883 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4884 * \par Fixed-Point Behavior
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4885 * Care must be taken when using the Q31 version of the Clarke transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4886 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4887 * Refer to the function specific documentation below for usage guidelines.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4888 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4889
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4890 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4891 * @addtogroup clarke
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4892 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4893 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4894
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4895 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4896 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4897 * @brief Floating-point Clarke transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4898 * @param[in] Ia input three-phase coordinate <code>a</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4899 * @param[in] Ib input three-phase coordinate <code>b</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4900 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4901 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4902 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4903 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4905 static __INLINE void arm_clarke_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4906 float32_t Ia,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4907 float32_t Ib,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4908 float32_t * pIalpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4909 float32_t * pIbeta)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4910 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4911 /* Calculate pIalpha using the equation, pIalpha = Ia */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4912 *pIalpha = Ia;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4913
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4914 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4915 *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4916
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4917 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4918
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4919 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4920 * @brief Clarke transform for Q31 version
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4921 * @param[in] Ia input three-phase coordinate <code>a</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4922 * @param[in] Ib input three-phase coordinate <code>b</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4923 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4924 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4925 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4926 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4927 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4928 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4929 * The function is implemented using an internal 32-bit accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4930 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4931 * There is saturation on the addition, hence there is no risk of overflow.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4932 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4933
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4934 static __INLINE void arm_clarke_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4935 q31_t Ia,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4936 q31_t Ib,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4937 q31_t * pIalpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4938 q31_t * pIbeta)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4939 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4940 q31_t product1, product2; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4941
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4942 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4943 *pIalpha = Ia;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4944
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4945 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4946 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4948 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4949 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4950
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4951 /* pIbeta is calculated by adding the intermediate products */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4952 *pIbeta = __QADD(product1, product2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4953 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4955 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4956 * @} end of clarke group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4957 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4958
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4959 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4960 * @brief Converts the elements of the Q7 vector to Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4961 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4962 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4963 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4964 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4965 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4966 void arm_q7_to_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4967 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4968 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4969 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4970
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4971
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4972
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4973
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4974 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4975 * @ingroup groupController
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4976 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4977
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4978 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4979 * @defgroup inv_clarke Vector Inverse Clarke Transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4980 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4981 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4982 * The function operates on a single sample of data and each call to the function returns the processed output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4983 * The library provides separate functions for Q31 and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4984 * \par Algorithm
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4985 * \image html clarkeInvFormula.gif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4986 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4987 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4988 * \par Fixed-Point Behavior
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4989 * Care must be taken when using the Q31 version of the Clarke transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4990 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4991 * Refer to the function specific documentation below for usage guidelines.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4992 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4994 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4995 * @addtogroup inv_clarke
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4996 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4997 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4998
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4999 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5000 * @brief Floating-point Inverse Clarke transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5001 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5002 * @param[in] Ibeta input two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5003 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5004 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5005 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5006 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5007
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5008
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5009 static __INLINE void arm_inv_clarke_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5010 float32_t Ialpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5011 float32_t Ibeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5012 float32_t * pIa,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5013 float32_t * pIb)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5014 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5015 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5016 *pIa = Ialpha;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5018 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5019 *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5020
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5021 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5022
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5023 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5024 * @brief Inverse Clarke transform for Q31 version
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5025 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5026 * @param[in] Ibeta input two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5027 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5028 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5029 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5030 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5031 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5032 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5033 * The function is implemented using an internal 32-bit accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5034 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5035 * There is saturation on the subtraction, hence there is no risk of overflow.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5036 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5037
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5038 static __INLINE void arm_inv_clarke_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5039 q31_t Ialpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5040 q31_t Ibeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5041 q31_t * pIa,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5042 q31_t * pIb)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5043 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5044 q31_t product1, product2; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5045
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5046 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5047 *pIa = Ialpha;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5048
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5049 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5050 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5051
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5052 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5053 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5054
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5055 /* pIb is calculated by subtracting the products */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5056 *pIb = __QSUB(product2, product1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5057
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5058 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5060 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5061 * @} end of inv_clarke group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5062 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5063
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5064 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5065 * @brief Converts the elements of the Q7 vector to Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5066 * @param[in] *pSrc input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5067 * @param[out] *pDst output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5068 * @param[in] blockSize number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5069 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5070 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5071 void arm_q7_to_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5072 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5073 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5074 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5075
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5076
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5077
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5078 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5079 * @ingroup groupController
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5080 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5081
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5082 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5083 * @defgroup park Vector Park Transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5084 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5085 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5086 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5087 * from the stationary to the moving reference frame and control the spatial relationship between
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5088 * the stator vector current and rotor flux vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5089 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5090 * current vector and the relationship from the two reference frames:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5091 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5092 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5093 * The function operates on a single sample of data and each call to the function returns the processed output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5094 * The library provides separate functions for Q31 and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5095 * \par Algorithm
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5096 * \image html parkFormula.gif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5097 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5098 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5099 * cosine and sine values of theta (rotor flux position).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5100 * \par Fixed-Point Behavior
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5101 * Care must be taken when using the Q31 version of the Park transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5102 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5103 * Refer to the function specific documentation below for usage guidelines.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5104 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5106 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5107 * @addtogroup park
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5108 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5109 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5111 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5112 * @brief Floating-point Park transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5113 * @param[in] Ialpha input two-phase vector coordinate alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5114 * @param[in] Ibeta input two-phase vector coordinate beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5115 * @param[out] *pId points to output rotor reference frame d
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5116 * @param[out] *pIq points to output rotor reference frame q
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5117 * @param[in] sinVal sine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5118 * @param[in] cosVal cosine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5119 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5120 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5121 * The function implements the forward Park transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5122 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5123 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5124
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5125 static __INLINE void arm_park_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5126 float32_t Ialpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5127 float32_t Ibeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5128 float32_t * pId,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5129 float32_t * pIq,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5130 float32_t sinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5131 float32_t cosVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5132 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5133 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5134 *pId = Ialpha * cosVal + Ibeta * sinVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5136 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5137 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5139 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5141 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5142 * @brief Park transform for Q31 version
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5143 * @param[in] Ialpha input two-phase vector coordinate alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5144 * @param[in] Ibeta input two-phase vector coordinate beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5145 * @param[out] *pId points to output rotor reference frame d
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5146 * @param[out] *pIq points to output rotor reference frame q
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5147 * @param[in] sinVal sine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5148 * @param[in] cosVal cosine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5149 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5150 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5151 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5152 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5153 * The function is implemented using an internal 32-bit accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5154 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5155 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5156 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5158
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5159 static __INLINE void arm_park_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5160 q31_t Ialpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5161 q31_t Ibeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5162 q31_t * pId,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5163 q31_t * pIq,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5164 q31_t sinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5165 q31_t cosVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5166 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5167 q31_t product1, product2; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5168 q31_t product3, product4; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5170 /* Intermediate product is calculated by (Ialpha * cosVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5171 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5172
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5173 /* Intermediate product is calculated by (Ibeta * sinVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5174 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5177 /* Intermediate product is calculated by (Ialpha * sinVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5178 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5180 /* Intermediate product is calculated by (Ibeta * cosVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5181 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5183 /* Calculate pId by adding the two intermediate products 1 and 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5184 *pId = __QADD(product1, product2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5185
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5186 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5187 *pIq = __QSUB(product4, product3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5188 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5190 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5191 * @} end of park group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5192 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5194 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5195 * @brief Converts the elements of the Q7 vector to floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5196 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5197 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5198 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5199 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5200 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5201 void arm_q7_to_float(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5202 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5203 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5204 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5206
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5207 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5208 * @ingroup groupController
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5209 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5211 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5212 * @defgroup inv_park Vector Inverse Park transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5213 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5214 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5215 * The function operates on a single sample of data and each call to the function returns the processed output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5216 * The library provides separate functions for Q31 and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5217 * \par Algorithm
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5218 * \image html parkInvFormula.gif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5219 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5220 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5221 * cosine and sine values of theta (rotor flux position).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5222 * \par Fixed-Point Behavior
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5223 * Care must be taken when using the Q31 version of the Park transform.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5224 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5225 * Refer to the function specific documentation below for usage guidelines.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5226 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5227
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5228 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5229 * @addtogroup inv_park
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5230 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5231 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5232
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5233 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5234 * @brief Floating-point Inverse Park transform
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5235 * @param[in] Id input coordinate of rotor reference frame d
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5236 * @param[in] Iq input coordinate of rotor reference frame q
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5237 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5238 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5239 * @param[in] sinVal sine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5240 * @param[in] cosVal cosine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5241 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5242 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5244 static __INLINE void arm_inv_park_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5245 float32_t Id,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5246 float32_t Iq,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5247 float32_t * pIalpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5248 float32_t * pIbeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5249 float32_t sinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5250 float32_t cosVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5251 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5252 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5253 *pIalpha = Id * cosVal - Iq * sinVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5255 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5256 *pIbeta = Id * sinVal + Iq * cosVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5258 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5261 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5262 * @brief Inverse Park transform for Q31 version
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5263 * @param[in] Id input coordinate of rotor reference frame d
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5264 * @param[in] Iq input coordinate of rotor reference frame q
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5265 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5266 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5267 * @param[in] sinVal sine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5268 * @param[in] cosVal cosine value of rotation angle theta
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5269 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5270 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5271 * <b>Scaling and Overflow Behavior:</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5272 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5273 * The function is implemented using an internal 32-bit accumulator.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5274 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5275 * There is saturation on the addition, hence there is no risk of overflow.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5279 static __INLINE void arm_inv_park_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5280 q31_t Id,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5281 q31_t Iq,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5282 q31_t * pIalpha,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5283 q31_t * pIbeta,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5284 q31_t sinVal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5285 q31_t cosVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5286 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5287 q31_t product1, product2; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5288 q31_t product3, product4; /* Temporary variables used to store intermediate results */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5290 /* Intermediate product is calculated by (Id * cosVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5291 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5293 /* Intermediate product is calculated by (Iq * sinVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5294 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5297 /* Intermediate product is calculated by (Id * sinVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5298 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5300 /* Intermediate product is calculated by (Iq * cosVal) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5301 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5302
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5303 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5304 *pIalpha = __QSUB(product1, product2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5306 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5307 *pIbeta = __QADD(product4, product3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5309 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5311 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5312 * @} end of Inverse park group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5313 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5314
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5316 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5317 * @brief Converts the elements of the Q31 vector to floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5318 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5319 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5320 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5321 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5322 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5323 void arm_q31_to_float(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5324 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5325 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5326 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5327
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5328 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5329 * @ingroup groupInterpolation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5330 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5332 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5333 * @defgroup LinearInterpolate Linear Interpolation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5334 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5335 * Linear interpolation is a method of curve fitting using linear polynomials.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5336 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5337 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5338 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5339 * \image html LinearInterp.gif "Linear interpolation"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5340 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5341 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5342 * A Linear Interpolate function calculates an output value(y), for the input(x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5343 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5344 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5345 * \par Algorithm:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5346 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5347 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5348 * where x0, x1 are nearest values of input x
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5349 * y0, y1 are nearest values to output y
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5350 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5351 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5352 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5353 * This set of functions implements Linear interpolation process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5354 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5355 * sample of data and each call to the function returns a single processed value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5356 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5357 * <code>x</code> is the input sample value. The functions returns the output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5358 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5359 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5360 * if x is outside of the table boundary, Linear interpolation returns first value of the table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5361 * if x is below input range and returns last value of table if x is above range.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5362 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5364 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5365 * @addtogroup LinearInterpolate
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5366 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5367 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5369 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5370 * @brief Process function for the floating-point Linear Interpolation Function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5371 * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5372 * @param[in] x input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5373 * @return y processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5374 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5375 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5377 static __INLINE float32_t arm_linear_interp_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5378 arm_linear_interp_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5379 float32_t x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5380 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5382 float32_t y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5383 float32_t x0, x1; /* Nearest input values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5384 float32_t y0, y1; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5385 float32_t xSpacing = S->xSpacing; /* spacing between input values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5386 int32_t i; /* Index variable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5387 float32_t *pYData = S->pYData; /* pointer to output table */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5388
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5389 /* Calculation of index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5390 i = (x - S->x1) / xSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5391
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5392 if(i < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5393 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5394 /* Iniatilize output for below specified range as least output value of table */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5395 y = pYData[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5396 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5397 else if(i >= S->nValues)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5398 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5399 /* Iniatilize output for above specified range as last output value of table */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5400 y = pYData[S->nValues-1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5401 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5402 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5403 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5404 /* Calculation of nearest input values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5405 x0 = S->x1 + i * xSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5406 x1 = S->x1 + (i +1) * xSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5407
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5408 /* Read of nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5409 y0 = pYData[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5410 y1 = pYData[i + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5411
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5412 /* Calculation of output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5413 y = y0 + (x - x0) * ((y1 - y0)/(x1-x0));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5415 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5416
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5417 /* returns output value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5418 return (y);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5419 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5421 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5422 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5423 * @brief Process function for the Q31 Linear Interpolation Function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5424 * @param[in] *pYData pointer to Q31 Linear Interpolation table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5425 * @param[in] x input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5426 * @param[in] nValues number of table values
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5427 * @return y processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5428 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5429 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5430 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5431 * This function can support maximum of table size 2^12.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5432 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5433 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5434
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5436 static __INLINE q31_t arm_linear_interp_q31(q31_t *pYData,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5437 q31_t x, uint32_t nValues)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5438 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5439 q31_t y; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5440 q31_t y0, y1; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5441 q31_t fract; /* fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5442 int32_t index; /* Index to read nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5444 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5445 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5446 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5447 index = ((x & 0xFFF00000) >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5448
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5449 if(index >= (nValues - 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5450 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5451 return(pYData[nValues - 1]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5452 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5453 else if(index < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5454 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5455 return(pYData[0]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5456 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5457 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5458 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5459
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5460 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5461 /* shift left by 11 to keep fract in 1.31 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5462 fract = (x & 0x000FFFFF) << 11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5464 /* Read two nearest output values from the index in 1.31(q31) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5465 y0 = pYData[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5466 y1 = pYData[index + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5467
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5468 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5469 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5470
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5471 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5472 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5473
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5474 /* Convert y to 1.31 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5475 return (y << 1u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5476
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5477 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5479 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5481 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5482 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5483 * @brief Process function for the Q15 Linear Interpolation Function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5484 * @param[in] *pYData pointer to Q15 Linear Interpolation table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5485 * @param[in] x input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5486 * @param[in] nValues number of table values
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5487 * @return y processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5488 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5489 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5490 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5491 * This function can support maximum of table size 2^12.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5492 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5493 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5494
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5496 static __INLINE q15_t arm_linear_interp_q15(q15_t *pYData, q31_t x, uint32_t nValues)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5497 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5498 q63_t y; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5499 q15_t y0, y1; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5500 q31_t fract; /* fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5501 int32_t index; /* Index to read nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5502
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5503 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5504 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5505 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5506 index = ((x & 0xFFF00000) >> 20u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5508 if(index >= (nValues - 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5509 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5510 return(pYData[nValues - 1]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5511 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5512 else if(index < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5513 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5514 return(pYData[0]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5515 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5516 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5517 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5518 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5519 /* fract is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5520 fract = (x & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5521
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5522 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5523 y0 = pYData[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5524 y1 = pYData[index + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5525
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5526 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5527 y = ((q63_t) y0 * (0xFFFFF - fract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5529 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5530 y += ((q63_t) y1 * (fract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5531
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5532 /* convert y to 1.15 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5533 return (y >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5534 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5535
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5537 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5539 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5540 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5541 * @brief Process function for the Q7 Linear Interpolation Function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5542 * @param[in] *pYData pointer to Q7 Linear Interpolation table
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5543 * @param[in] x input sample to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5544 * @param[in] nValues number of table values
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5545 * @return y processed output sample.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5546 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5547 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5548 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5549 * This function can support maximum of table size 2^12.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5550 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5551
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5552
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5553 static __INLINE q7_t arm_linear_interp_q7(q7_t *pYData, q31_t x, uint32_t nValues)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5554 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5555 q31_t y; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5556 q7_t y0, y1; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5557 q31_t fract; /* fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5558 int32_t index; /* Index to read nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5560 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5561 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5562 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5563 index = ((x & 0xFFF00000) >> 20u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5566 if(index >= (nValues - 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5567 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5568 return(pYData[nValues - 1]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5569 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5570 else if(index < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5571 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5572 return(pYData[0]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5573 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5574 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5575 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5577 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5578 /* fract is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5579 fract = (x & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5581 /* Read two nearest output values from the index and are in 1.7(q7) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5582 y0 = pYData[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5583 y1 = pYData[index + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5584
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5585 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5586 y = ((y0 * (0xFFFFF - fract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5587
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5588 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5589 y += (y1 * fract);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5591 /* convert y to 1.7(q7) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5592 return (y >> 20u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5594 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5596 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5597 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5598 * @} end of LinearInterpolate group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5599 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5600
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5601 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5602 * @brief Fast approximation to the trigonometric sine function for floating-point data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5603 * @param[in] x input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5604 * @return sin(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5605 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5607 float32_t arm_sin_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5608 float32_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5610 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5611 * @brief Fast approximation to the trigonometric sine function for Q31 data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5612 * @param[in] x Scaled input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5613 * @return sin(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5614 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5616 q31_t arm_sin_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5617 q31_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5618
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5619 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5620 * @brief Fast approximation to the trigonometric sine function for Q15 data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5621 * @param[in] x Scaled input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5622 * @return sin(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5623 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5625 q15_t arm_sin_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5626 q15_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5627
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5628 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5629 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5630 * @param[in] x input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5631 * @return cos(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5632 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5634 float32_t arm_cos_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5635 float32_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5636
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5637 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5638 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5639 * @param[in] x Scaled input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5640 * @return cos(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5641 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5642
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5643 q31_t arm_cos_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5644 q31_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5645
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5646 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5647 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5648 * @param[in] x Scaled input value in radians.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5649 * @return cos(x).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5650 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5652 q15_t arm_cos_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5653 q15_t x);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5654
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5656 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5657 * @ingroup groupFastMath
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5658 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5660
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5661 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5662 * @defgroup SQRT Square Root
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5663 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5664 * Computes the square root of a number.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5665 * There are separate functions for Q15, Q31, and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5666 * The square root function is computed using the Newton-Raphson algorithm.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5667 * This is an iterative algorithm of the form:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5668 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5669 * x1 = x0 - f(x0)/f'(x0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5670 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5671 * where <code>x1</code> is the current estimate,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5672 * <code>x0</code> is the previous estimate and
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5673 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5674 * For the square root function, the algorithm reduces to:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5675 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5676 * x0 = in/2 [initial guess]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5677 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5678 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5679 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5681
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5682 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5683 * @addtogroup SQRT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5684 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5685 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5687 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5688 * @brief Floating-point square root function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5689 * @param[in] in input value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5690 * @param[out] *pOut square root of input value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5691 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5692 * <code>in</code> is negative value and returns zero output for negative values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5693 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5694
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5695 static __INLINE arm_status arm_sqrt_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5696 float32_t in, float32_t *pOut)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5697 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5698 if(in > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5699 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5701 // #if __FPU_USED
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5702 #if (__FPU_USED == 1) && defined ( __CC_ARM )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5703 *pOut = __sqrtf(in);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5704 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5705 *pOut = sqrtf(in);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5706 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5707
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5708 return (ARM_MATH_SUCCESS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5709 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5710 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5711 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5712 *pOut = 0.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5713 return (ARM_MATH_ARGUMENT_ERROR);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5714 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5715
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5716 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5717
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5719 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5720 * @brief Q31 square root function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5721 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5722 * @param[out] *pOut square root of input value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5723 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5724 * <code>in</code> is negative value and returns zero output for negative values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5725 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5726 arm_status arm_sqrt_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5727 q31_t in, q31_t *pOut);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5728
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5729 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5730 * @brief Q15 square root function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5731 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5732 * @param[out] *pOut square root of input value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5733 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5734 * <code>in</code> is negative value and returns zero output for negative values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5735 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5736 arm_status arm_sqrt_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5737 q15_t in, q15_t *pOut);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5739 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5740 * @} end of SQRT group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5741 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5742
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5744
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5746
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5747
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5748 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5749 * @brief floating-point Circular write function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5750 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5752 static __INLINE void arm_circularWrite_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5753 int32_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5754 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5755 uint16_t * writeOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5756 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5757 const int32_t * src,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5758 int32_t srcInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5759 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5760 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5761 uint32_t i = 0u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5762 int32_t wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5763
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5764 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5765 * to the current location where the input samples to be copied */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5766 wOffset = *writeOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5768 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5769 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5770
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5771 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5772 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5773 /* copy the input sample to the circular buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5774 circBuffer[wOffset] = *src;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5775
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5776 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5777 src += srcInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5779 /* Circularly update wOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5780 wOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5781 if(wOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5782 wOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5784 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5785 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5786 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5787
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5788 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5789 *writeOffset = wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5790 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5791
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5793
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5794 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5795 * @brief floating-point Circular Read function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5796 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5797 static __INLINE void arm_circularRead_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5798 int32_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5799 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5800 int32_t * readOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5801 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5802 int32_t * dst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5803 int32_t * dst_base,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5804 int32_t dst_length,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5805 int32_t dstInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5806 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5807 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5808 uint32_t i = 0u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5809 int32_t rOffset, dst_end;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5810
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5811 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5812 * to the current location from where the input samples to be read */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5813 rOffset = *readOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5814 dst_end = (int32_t) (dst_base + dst_length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5815
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5816 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5817 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5818
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5819 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5820 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5821 /* copy the sample from the circular buffer to the destination buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5822 *dst = circBuffer[rOffset];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5823
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5824 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5825 dst += dstInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5826
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5827 if(dst == (int32_t *) dst_end)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5828 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5829 dst = dst_base;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5830 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5831
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5832 /* Circularly update rOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5833 rOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5834
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5835 if(rOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5836 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5837 rOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5838 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5839
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5840 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5841 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5842 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5843
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5844 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5845 *readOffset = rOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5846 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5847
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5848 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5849 * @brief Q15 Circular write function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5850 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5851
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5852 static __INLINE void arm_circularWrite_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5853 q15_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5854 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5855 uint16_t * writeOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5856 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5857 const q15_t * src,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5858 int32_t srcInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5859 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5860 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5861 uint32_t i = 0u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5862 int32_t wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5864 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5865 * to the current location where the input samples to be copied */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5866 wOffset = *writeOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5868 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5869 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5871 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5872 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5873 /* copy the input sample to the circular buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5874 circBuffer[wOffset] = *src;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5875
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5876 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5877 src += srcInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5878
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5879 /* Circularly update wOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5880 wOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5881 if(wOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5882 wOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5884 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5885 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5886 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5887
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5888 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5889 *writeOffset = wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5890 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5892
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5893
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5894 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5895 * @brief Q15 Circular Read function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5896 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5897 static __INLINE void arm_circularRead_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5898 q15_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5899 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5900 int32_t * readOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5901 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5902 q15_t * dst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5903 q15_t * dst_base,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5904 int32_t dst_length,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5905 int32_t dstInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5906 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5907 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5908 uint32_t i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5909 int32_t rOffset, dst_end;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5910
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5911 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5912 * to the current location from where the input samples to be read */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5913 rOffset = *readOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5914
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5915 dst_end = (int32_t) (dst_base + dst_length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5916
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5917 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5918 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5919
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5920 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5921 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5922 /* copy the sample from the circular buffer to the destination buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5923 *dst = circBuffer[rOffset];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5924
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5925 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5926 dst += dstInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5927
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5928 if(dst == (q15_t *) dst_end)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5929 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5930 dst = dst_base;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5931 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5932
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5933 /* Circularly update wOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5934 rOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5935
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5936 if(rOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5937 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5938 rOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5939 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5940
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5941 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5942 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5943 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5944
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5945 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5946 *readOffset = rOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5947 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5948
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5949
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5950 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5951 * @brief Q7 Circular write function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5952 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5953
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5954 static __INLINE void arm_circularWrite_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5955 q7_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5956 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5957 uint16_t * writeOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5958 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5959 const q7_t * src,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5960 int32_t srcInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5961 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5962 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5963 uint32_t i = 0u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5964 int32_t wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5965
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5966 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5967 * to the current location where the input samples to be copied */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5968 wOffset = *writeOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5969
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5970 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5971 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5972
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5973 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5974 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5975 /* copy the input sample to the circular buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5976 circBuffer[wOffset] = *src;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5977
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5978 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5979 src += srcInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5980
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5981 /* Circularly update wOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5982 wOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5983 if(wOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5984 wOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5985
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5986 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5987 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5988 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5989
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5990 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5991 *writeOffset = wOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5992 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5994
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5995
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5996 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5997 * @brief Q7 Circular Read function.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5998 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5999 static __INLINE void arm_circularRead_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6000 q7_t * circBuffer,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6001 int32_t L,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6002 int32_t * readOffset,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6003 int32_t bufferInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6004 q7_t * dst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6005 q7_t * dst_base,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6006 int32_t dst_length,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6007 int32_t dstInc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6008 uint32_t blockSize)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6009 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6010 uint32_t i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6011 int32_t rOffset, dst_end;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6012
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6013 /* Copy the value of Index pointer that points
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6014 * to the current location from where the input samples to be read */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6015 rOffset = *readOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6016
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6017 dst_end = (int32_t) (dst_base + dst_length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6019 /* Loop over the blockSize */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6020 i = blockSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6021
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6022 while(i > 0u)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6023 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6024 /* copy the sample from the circular buffer to the destination buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6025 *dst = circBuffer[rOffset];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6026
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6027 /* Update the input pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6028 dst += dstInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6029
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6030 if(dst == (q7_t *) dst_end)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6031 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6032 dst = dst_base;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6033 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6034
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6035 /* Circularly update rOffset. Watch out for positive and negative value */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6036 rOffset += bufferInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6037
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6038 if(rOffset >= L)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6039 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6040 rOffset -= L;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6041 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6042
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6043 /* Decrement the loop counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6044 i--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6045 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6046
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6047 /* Update the index pointer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6048 *readOffset = rOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6049 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6050
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6051
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6052 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6053 * @brief Sum of the squares of the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6054 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6055 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6056 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6057 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6058 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6060 void arm_power_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6061 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6062 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6063 q63_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6064
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6065 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6066 * @brief Sum of the squares of the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6067 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6068 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6069 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6070 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6071 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6072
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6073 void arm_power_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6074 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6075 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6076 float32_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6077
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6078 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6079 * @brief Sum of the squares of the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6080 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6081 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6082 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6083 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6084 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6085
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6086 void arm_power_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6087 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6088 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6089 q63_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6090
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6091 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6092 * @brief Sum of the squares of the elements of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6093 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6094 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6095 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6096 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6097 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6098
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6099 void arm_power_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6100 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6101 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6102 q31_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6104 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6105 * @brief Mean value of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6106 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6107 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6108 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6109 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6110 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6112 void arm_mean_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6113 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6114 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6115 q7_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6117 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6118 * @brief Mean value of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6119 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6120 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6121 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6122 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6123 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6124 void arm_mean_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6125 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6126 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6127 q15_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6129 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6130 * @brief Mean value of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6131 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6132 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6133 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6134 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6135 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6136 void arm_mean_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6137 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6138 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6139 q31_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6141 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6142 * @brief Mean value of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6143 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6144 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6145 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6146 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6147 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6148 void arm_mean_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6149 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6150 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6151 float32_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6153 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6154 * @brief Variance of the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6155 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6156 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6157 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6158 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6159 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6161 void arm_var_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6162 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6163 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6164 float32_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6166 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6167 * @brief Variance of the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6168 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6169 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6170 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6171 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6172 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6174 void arm_var_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6175 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6176 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6177 q63_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6179 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6180 * @brief Variance of the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6181 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6182 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6183 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6184 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6185 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6187 void arm_var_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6188 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6189 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6190 q31_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6192 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6193 * @brief Root Mean Square of the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6194 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6195 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6196 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6197 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6198 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6200 void arm_rms_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6201 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6202 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6203 float32_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6205 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6206 * @brief Root Mean Square of the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6207 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6208 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6209 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6210 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6211 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6213 void arm_rms_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6214 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6215 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6216 q31_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6217
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6218 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6219 * @brief Root Mean Square of the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6220 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6221 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6222 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6223 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6224 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6226 void arm_rms_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6227 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6228 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6229 q15_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6231 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6232 * @brief Standard deviation of the elements of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6233 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6234 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6235 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6236 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6237 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6239 void arm_std_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6240 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6241 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6242 float32_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6244 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6245 * @brief Standard deviation of the elements of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6246 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6247 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6248 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6249 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6250 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6251
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6252 void arm_std_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6253 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6254 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6255 q31_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6257 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6258 * @brief Standard deviation of the elements of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6259 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6260 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6261 * @param[out] *pResult is output value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6262 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6263 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6265 void arm_std_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6266 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6267 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6268 q15_t * pResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6270 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6271 * @brief Floating-point complex magnitude
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6272 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6273 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6274 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6275 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6278 void arm_cmplx_mag_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6279 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6280 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6281 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6283 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6284 * @brief Q31 complex magnitude
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6285 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6286 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6287 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6288 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6289 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6291 void arm_cmplx_mag_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6292 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6293 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6294 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6296 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6297 * @brief Q15 complex magnitude
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6298 * @param[in] *pSrc points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6299 * @param[out] *pDst points to the real output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6300 * @param[in] numSamples number of complex samples in the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6301 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6302 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6304 void arm_cmplx_mag_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6305 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6306 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6307 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6309 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6310 * @brief Q15 complex dot product
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6311 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6312 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6313 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6314 * @param[out] *realResult real part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6315 * @param[out] *imagResult imaginary part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6316 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6317 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6318
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6319 void arm_cmplx_dot_prod_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6320 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6321 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6322 uint32_t numSamples,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6323 q31_t * realResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6324 q31_t * imagResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6326 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6327 * @brief Q31 complex dot product
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6328 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6329 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6330 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6331 * @param[out] *realResult real part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6332 * @param[out] *imagResult imaginary part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6333 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6334 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6336 void arm_cmplx_dot_prod_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6337 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6338 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6339 uint32_t numSamples,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6340 q63_t * realResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6341 q63_t * imagResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6342
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6343 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6344 * @brief Floating-point complex dot product
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6345 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6346 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6347 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6348 * @param[out] *realResult real part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6349 * @param[out] *imagResult imaginary part of the result returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6350 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6351 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6353 void arm_cmplx_dot_prod_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6354 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6355 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6356 uint32_t numSamples,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6357 float32_t * realResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6358 float32_t * imagResult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6360 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6361 * @brief Q15 complex-by-real multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6362 * @param[in] *pSrcCmplx points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6363 * @param[in] *pSrcReal points to the real input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6364 * @param[out] *pCmplxDst points to the complex output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6365 * @param[in] numSamples number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6366 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6367 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6369 void arm_cmplx_mult_real_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6370 q15_t * pSrcCmplx,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6371 q15_t * pSrcReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6372 q15_t * pCmplxDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6373 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6374
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6375 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6376 * @brief Q31 complex-by-real multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6377 * @param[in] *pSrcCmplx points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6378 * @param[in] *pSrcReal points to the real input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6379 * @param[out] *pCmplxDst points to the complex output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6380 * @param[in] numSamples number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6381 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6382 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6383
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6384 void arm_cmplx_mult_real_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6385 q31_t * pSrcCmplx,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6386 q31_t * pSrcReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6387 q31_t * pCmplxDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6388 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6390 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6391 * @brief Floating-point complex-by-real multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6392 * @param[in] *pSrcCmplx points to the complex input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6393 * @param[in] *pSrcReal points to the real input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6394 * @param[out] *pCmplxDst points to the complex output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6395 * @param[in] numSamples number of samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6396 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6397 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6399 void arm_cmplx_mult_real_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6400 float32_t * pSrcCmplx,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6401 float32_t * pSrcReal,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6402 float32_t * pCmplxDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6403 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6405 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6406 * @brief Minimum value of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6407 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6408 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6409 * @param[out] *result is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6410 * @param[in] index is the array index of the minimum value in the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6411 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6412 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6414 void arm_min_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6415 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6416 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6417 q7_t * result,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6418 uint32_t * index);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6420 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6421 * @brief Minimum value of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6422 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6423 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6424 * @param[out] *pResult is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6425 * @param[in] *pIndex is the array index of the minimum value in the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6426 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6427 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6429 void arm_min_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6430 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6431 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6432 q15_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6433 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6434
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6435 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6436 * @brief Minimum value of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6437 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6438 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6439 * @param[out] *pResult is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6440 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6441 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6442 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6443 void arm_min_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6444 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6445 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6446 q31_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6447 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6448
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6449 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6450 * @brief Minimum value of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6451 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6452 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6453 * @param[out] *pResult is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6454 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6455 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6456 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6457
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6458 void arm_min_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6459 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6460 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6461 float32_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6462 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6464 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6465 * @brief Maximum value of a Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6466 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6467 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6468 * @param[out] *pResult maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6469 * @param[out] *pIndex index of maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6470 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6471 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6473 void arm_max_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6474 q7_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6475 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6476 q7_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6477 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6479 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6480 * @brief Maximum value of a Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6481 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6482 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6483 * @param[out] *pResult maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6484 * @param[out] *pIndex index of maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6485 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6486 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6487
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6488 void arm_max_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6489 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6490 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6491 q15_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6492 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6494 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6495 * @brief Maximum value of a Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6496 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6497 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6498 * @param[out] *pResult maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6499 * @param[out] *pIndex index of maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6500 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6501 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6502
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6503 void arm_max_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6504 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6505 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6506 q31_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6507 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6509 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6510 * @brief Maximum value of a floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6511 * @param[in] *pSrc points to the input buffer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6512 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6513 * @param[out] *pResult maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6514 * @param[out] *pIndex index of maximum value returned here
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6515 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6516 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6517
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6518 void arm_max_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6519 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6520 uint32_t blockSize,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6521 float32_t * pResult,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6522 uint32_t * pIndex);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6524 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6525 * @brief Q15 complex-by-complex multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6526 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6527 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6528 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6529 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6530 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6531 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6533 void arm_cmplx_mult_cmplx_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6534 q15_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6535 q15_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6536 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6537 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6539 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6540 * @brief Q31 complex-by-complex multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6541 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6542 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6543 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6544 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6545 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6546 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6547
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6548 void arm_cmplx_mult_cmplx_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6549 q31_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6550 q31_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6551 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6552 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6553
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6554 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6555 * @brief Floating-point complex-by-complex multiplication
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6556 * @param[in] *pSrcA points to the first input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6557 * @param[in] *pSrcB points to the second input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6558 * @param[out] *pDst points to the output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6559 * @param[in] numSamples number of complex samples in each vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6560 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6561 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6563 void arm_cmplx_mult_cmplx_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6564 float32_t * pSrcA,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6565 float32_t * pSrcB,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6566 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6567 uint32_t numSamples);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6569 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6570 * @brief Converts the elements of the floating-point vector to Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6571 * @param[in] *pSrc points to the floating-point input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6572 * @param[out] *pDst points to the Q31 output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6573 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6574 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6575 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6576 void arm_float_to_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6577 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6578 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6579 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6581 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6582 * @brief Converts the elements of the floating-point vector to Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6583 * @param[in] *pSrc points to the floating-point input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6584 * @param[out] *pDst points to the Q15 output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6585 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6586 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6587 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6588 void arm_float_to_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6589 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6590 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6591 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6593 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6594 * @brief Converts the elements of the floating-point vector to Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6595 * @param[in] *pSrc points to the floating-point input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6596 * @param[out] *pDst points to the Q7 output vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6597 * @param[in] blockSize length of the input vector
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6598 * @return none
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6599 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6600 void arm_float_to_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6601 float32_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6602 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6603 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6604
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6605
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6606 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6607 * @brief Converts the elements of the Q31 vector to Q15 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6608 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6609 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6610 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6611 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6612 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6613 void arm_q31_to_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6614 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6615 q15_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6616 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6618 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6619 * @brief Converts the elements of the Q31 vector to Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6620 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6621 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6622 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6623 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6624 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6625 void arm_q31_to_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6626 q31_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6627 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6628 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6629
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6630 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6631 * @brief Converts the elements of the Q15 vector to floating-point vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6632 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6633 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6634 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6635 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6636 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6637 void arm_q15_to_float(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6638 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6639 float32_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6640 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6642
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6643 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6644 * @brief Converts the elements of the Q15 vector to Q31 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6645 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6646 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6647 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6648 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6649 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6650 void arm_q15_to_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6651 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6652 q31_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6653 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6654
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6656 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6657 * @brief Converts the elements of the Q15 vector to Q7 vector.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6658 * @param[in] *pSrc is input pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6659 * @param[out] *pDst is output pointer
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6660 * @param[in] blockSize is the number of samples to process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6661 * @return none.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6662 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6663 void arm_q15_to_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6664 q15_t * pSrc,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6665 q7_t * pDst,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6666 uint32_t blockSize);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6667
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6669 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6670 * @ingroup groupInterpolation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6671 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6672
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6673 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6674 * @defgroup BilinearInterpolate Bilinear Interpolation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6675 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6676 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6677 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6678 * determines values between the grid points.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6679 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6680 * Bilinear interpolation is often used in image processing to rescale images.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6681 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6682 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6683 * <b>Algorithm</b>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6684 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6685 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6686 * For floating-point, the instance structure is defined as:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6687 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6688 * typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6689 * {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6690 * uint16_t numRows;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6691 * uint16_t numCols;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6692 * float32_t *pData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6693 * } arm_bilinear_interp_instance_f32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6694 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6695 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6696 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6697 * where <code>numRows</code> specifies the number of rows in the table;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6698 * <code>numCols</code> specifies the number of columns in the table;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6699 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6700 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6701 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6702 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6703 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6704 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6705 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6706 * XF = floor(x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6707 * YF = floor(y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6708 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6709 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6710 * The interpolated output point is computed as:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6711 * <pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6712 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6713 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6714 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6715 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6716 * </pre>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6717 * Note that the coordinates (x, y) contain integer and fractional components.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6718 * The integer components specify which portion of the table to use while the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6719 * fractional components control the interpolation processor.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6720 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6721 * \par
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6722 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6723 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6724
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6725 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6726 * @addtogroup BilinearInterpolate
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6727 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6728 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6729
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6730 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6731 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6732 * @brief Floating-point bilinear interpolation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6733 * @param[in,out] *S points to an instance of the interpolation structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6734 * @param[in] X interpolation coordinate.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6735 * @param[in] Y interpolation coordinate.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6736 * @return out interpolated value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6737 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6738
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6739
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6740 static __INLINE float32_t arm_bilinear_interp_f32(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6741 const arm_bilinear_interp_instance_f32 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6742 float32_t X,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6743 float32_t Y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6744 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6745 float32_t out;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6746 float32_t f00, f01, f10, f11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6747 float32_t *pData = S->pData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6748 int32_t xIndex, yIndex, index;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6749 float32_t xdiff, ydiff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6750 float32_t b1, b2, b3, b4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6752 xIndex = (int32_t) X;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6753 yIndex = (int32_t) Y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6754
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6755 /* Care taken for table outside boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6756 /* Returns zero output when values are outside table boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6757 if(xIndex < 0 || xIndex > (S->numRows-1) || yIndex < 0 || yIndex > ( S->numCols-1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6758 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6759 return(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6760 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6761
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6762 /* Calculation of index for two nearest points in X-direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6763 index = (xIndex - 1) + (yIndex-1) * S->numCols ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6766 /* Read two nearest points in X-direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6767 f00 = pData[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6768 f01 = pData[index + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6769
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6770 /* Calculation of index for two nearest points in Y-direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6771 index = (xIndex-1) + (yIndex) * S->numCols;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6773
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6774 /* Read two nearest points in Y-direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6775 f10 = pData[index];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6776 f11 = pData[index + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6777
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6778 /* Calculation of intermediate values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6779 b1 = f00;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6780 b2 = f01 - f00;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6781 b3 = f10 - f00;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6782 b4 = f00 - f01 - f10 + f11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6784 /* Calculation of fractional part in X */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6785 xdiff = X - xIndex;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6787 /* Calculation of fractional part in Y */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6788 ydiff = Y - yIndex;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6790 /* Calculation of bi-linear interpolated output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6791 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6793 /* return to application */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6794 return (out);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6795
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6796 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6798 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6799 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6800 * @brief Q31 bilinear interpolation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6801 * @param[in,out] *S points to an instance of the interpolation structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6802 * @param[in] X interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6803 * @param[in] Y interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6804 * @return out interpolated value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6805 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6806
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6807 static __INLINE q31_t arm_bilinear_interp_q31(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6808 arm_bilinear_interp_instance_q31 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6809 q31_t X,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6810 q31_t Y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6811 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6812 q31_t out; /* Temporary output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6813 q31_t acc = 0; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6814 q31_t xfract, yfract; /* X, Y fractional parts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6815 q31_t x1, x2, y1, y2; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6816 int32_t rI, cI; /* Row and column indices */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6817 q31_t *pYData = S->pData; /* pointer to output table values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6818 uint32_t nCols = S->numCols; /* num of rows */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6819
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6820
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6821 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6822 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6823 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6824 rI = ((X & 0xFFF00000) >> 20u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6825
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6826 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6827 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6828 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6829 cI = ((Y & 0xFFF00000) >> 20u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6830
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6831 /* Care taken for table outside boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6832 /* Returns zero output when values are outside table boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6833 if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6834 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6835 return(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6836 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6837
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6838 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6839 /* shift left xfract by 11 to keep 1.31 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6840 xfract = (X & 0x000FFFFF) << 11u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6842 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6843 x1 = pYData[(rI) + nCols * (cI)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6844 x2 = pYData[(rI) + nCols * (cI) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6846 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6847 /* shift left yfract by 11 to keep 1.31 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6848 yfract = (Y & 0x000FFFFF) << 11u;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6849
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6850 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6851 y1 = pYData[(rI) + nCols * (cI + 1)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6852 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6854 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6855 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6856 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6857
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6858 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6859 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6860 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6861
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6862 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6863 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6864 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6865
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6866 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6867 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6868 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6869
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6870 /* Convert acc to 1.31(q31) format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6871 return (acc << 2u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6872
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6873 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6875 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6876 * @brief Q15 bilinear interpolation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6877 * @param[in,out] *S points to an instance of the interpolation structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6878 * @param[in] X interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6879 * @param[in] Y interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6880 * @return out interpolated value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6881 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6882
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6883 static __INLINE q15_t arm_bilinear_interp_q15(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6884 arm_bilinear_interp_instance_q15 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6885 q31_t X,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6886 q31_t Y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6887 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6888 q63_t acc = 0; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6889 q31_t out; /* Temporary output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6890 q15_t x1, x2, y1, y2; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6891 q31_t xfract, yfract; /* X, Y fractional parts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6892 int32_t rI, cI; /* Row and column indices */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6893 q15_t *pYData = S->pData; /* pointer to output table values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6894 uint32_t nCols = S->numCols; /* num of rows */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6895
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6896 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6897 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6898 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6899 rI = ((X & 0xFFF00000) >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6900
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6901 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6902 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6903 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6904 cI = ((Y & 0xFFF00000) >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6905
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6906 /* Care taken for table outside boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6907 /* Returns zero output when values are outside table boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6908 if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6909 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6910 return(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6911 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6912
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6913 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6914 /* xfract should be in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6915 xfract = (X & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6916
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6917 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6918 x1 = pYData[(rI) + nCols * (cI)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6919 x2 = pYData[(rI) + nCols * (cI) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6920
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6922 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6923 /* yfract should be in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6924 yfract = (Y & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6925
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6926 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6927 y1 = pYData[(rI) + nCols * (cI + 1)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6928 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6929
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6930 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6931
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6932 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6933 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6934 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6935 acc = ((q63_t) out * (0xFFFFF - yfract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6936
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6937 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6938 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6939 acc += ((q63_t) out * (xfract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6940
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6941 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6942 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6943 acc += ((q63_t) out * (yfract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6944
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6945 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6946 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6947 acc += ((q63_t) out * (yfract));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6948
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6949 /* acc is in 13.51 format and down shift acc by 36 times */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6950 /* Convert out to 1.15 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6951 return (acc >> 36);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6952
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6953 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6955 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6956 * @brief Q7 bilinear interpolation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6957 * @param[in,out] *S points to an instance of the interpolation structure.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6958 * @param[in] X interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6959 * @param[in] Y interpolation coordinate in 12.20 format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6960 * @return out interpolated value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6961 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6963 static __INLINE q7_t arm_bilinear_interp_q7(
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6964 arm_bilinear_interp_instance_q7 * S,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6965 q31_t X,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6966 q31_t Y)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6967 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6968 q63_t acc = 0; /* output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6969 q31_t out; /* Temporary output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6970 q31_t xfract, yfract; /* X, Y fractional parts */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6971 q7_t x1, x2, y1, y2; /* Nearest output values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6972 int32_t rI, cI; /* Row and column indices */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6973 q7_t *pYData = S->pData; /* pointer to output table values */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6974 uint32_t nCols = S->numCols; /* num of rows */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6975
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6976 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6977 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6978 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6979 rI = ((X & 0xFFF00000) >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6980
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6981 /* Input is in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6982 /* 12 bits for the table index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6983 /* Index value calculation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6984 cI = ((Y & 0xFFF00000) >> 20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6985
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6986 /* Care taken for table outside boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6987 /* Returns zero output when values are outside table boundary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6988 if(rI < 0 || rI > (S->numRows-1) || cI < 0 || cI > ( S->numCols-1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6989 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6990 return(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6991 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6992
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6993 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6994 /* xfract should be in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6995 xfract = (X & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6996
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6997 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6998 x1 = pYData[(rI) + nCols * (cI)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6999 x2 = pYData[(rI) + nCols * (cI) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7000
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7001
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7002 /* 20 bits for the fractional part */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7003 /* yfract should be in 12.20 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7004 yfract = (Y & 0x000FFFFF);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7005
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7006 /* Read two nearest output values from the index */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7007 y1 = pYData[(rI) + nCols * (cI + 1)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7008 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7009
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7010 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7011 out = ((x1 * (0xFFFFF - xfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7012 acc = (((q63_t) out * (0xFFFFF - yfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7013
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7014 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7015 out = ((x2 * (0xFFFFF - yfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7016 acc += (((q63_t) out * (xfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7018 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7019 out = ((y1 * (0xFFFFF - xfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7020 acc += (((q63_t) out * (yfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7021
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7022 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7023 out = ((y2 * (yfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7024 acc += (((q63_t) out * (xfract)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7025
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7026 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7027 return (acc >> 40);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7028
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7029 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7030
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7031 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7032 * @} end of BilinearInterpolate group
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7033 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7034
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7035
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7036
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7037
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7038
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7039
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7040 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7041 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7042 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7043
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7044
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7045 #endif /* _ARM_MATH_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7046
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7047
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7048 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7049 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7050 * End of file.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7051 */