Development mbed library for MAX32630FTHR

Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Dec 16 16:27:57 2016 +0000
Revision:
3:1198227e6421
Parent:
0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:5c4d7b2438d3 1 /* ----------------------------------------------------------------------
switches 0:5c4d7b2438d3 2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
switches 0:5c4d7b2438d3 3 *
switches 0:5c4d7b2438d3 4 * $Date: 19. March 2015
switches 0:5c4d7b2438d3 5 * $Revision: V.1.4.5
switches 0:5c4d7b2438d3 6 *
switches 0:5c4d7b2438d3 7 * Project: CMSIS DSP Library
switches 0:5c4d7b2438d3 8 * Title: arm_math.h
switches 0:5c4d7b2438d3 9 *
switches 0:5c4d7b2438d3 10 * Description: Public header file for CMSIS DSP Library
switches 0:5c4d7b2438d3 11 *
switches 0:5c4d7b2438d3 12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
switches 0:5c4d7b2438d3 13 *
switches 0:5c4d7b2438d3 14 * Redistribution and use in source and binary forms, with or without
switches 0:5c4d7b2438d3 15 * modification, are permitted provided that the following conditions
switches 0:5c4d7b2438d3 16 * are met:
switches 0:5c4d7b2438d3 17 * - Redistributions of source code must retain the above copyright
switches 0:5c4d7b2438d3 18 * notice, this list of conditions and the following disclaimer.
switches 0:5c4d7b2438d3 19 * - Redistributions in binary form must reproduce the above copyright
switches 0:5c4d7b2438d3 20 * notice, this list of conditions and the following disclaimer in
switches 0:5c4d7b2438d3 21 * the documentation and/or other materials provided with the
switches 0:5c4d7b2438d3 22 * distribution.
switches 0:5c4d7b2438d3 23 * - Neither the name of ARM LIMITED nor the names of its contributors
switches 0:5c4d7b2438d3 24 * may be used to endorse or promote products derived from this
switches 0:5c4d7b2438d3 25 * software without specific prior written permission.
switches 0:5c4d7b2438d3 26 *
switches 0:5c4d7b2438d3 27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
switches 0:5c4d7b2438d3 28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
switches 0:5c4d7b2438d3 29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
switches 0:5c4d7b2438d3 30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
switches 0:5c4d7b2438d3 31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
switches 0:5c4d7b2438d3 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
switches 0:5c4d7b2438d3 33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
switches 0:5c4d7b2438d3 34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
switches 0:5c4d7b2438d3 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
switches 0:5c4d7b2438d3 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
switches 0:5c4d7b2438d3 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
switches 0:5c4d7b2438d3 38 * POSSIBILITY OF SUCH DAMAGE.
switches 0:5c4d7b2438d3 39 * -------------------------------------------------------------------- */
switches 0:5c4d7b2438d3 40
switches 0:5c4d7b2438d3 41 /**
switches 0:5c4d7b2438d3 42 \mainpage CMSIS DSP Software Library
switches 0:5c4d7b2438d3 43 *
switches 0:5c4d7b2438d3 44 * Introduction
switches 0:5c4d7b2438d3 45 * ------------
switches 0:5c4d7b2438d3 46 *
switches 0:5c4d7b2438d3 47 * This user manual describes the CMSIS DSP software library,
switches 0:5c4d7b2438d3 48 * a suite of common signal processing functions for use on Cortex-M processor based devices.
switches 0:5c4d7b2438d3 49 *
switches 0:5c4d7b2438d3 50 * The library is divided into a number of functions each covering a specific category:
switches 0:5c4d7b2438d3 51 * - Basic math functions
switches 0:5c4d7b2438d3 52 * - Fast math functions
switches 0:5c4d7b2438d3 53 * - Complex math functions
switches 0:5c4d7b2438d3 54 * - Filters
switches 0:5c4d7b2438d3 55 * - Matrix functions
switches 0:5c4d7b2438d3 56 * - Transforms
switches 0:5c4d7b2438d3 57 * - Motor control functions
switches 0:5c4d7b2438d3 58 * - Statistical functions
switches 0:5c4d7b2438d3 59 * - Support functions
switches 0:5c4d7b2438d3 60 * - Interpolation functions
switches 0:5c4d7b2438d3 61 *
switches 0:5c4d7b2438d3 62 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
switches 0:5c4d7b2438d3 63 * 32-bit integer and 32-bit floating-point values.
switches 0:5c4d7b2438d3 64 *
switches 0:5c4d7b2438d3 65 * Using the Library
switches 0:5c4d7b2438d3 66 * ------------
switches 0:5c4d7b2438d3 67 *
switches 0:5c4d7b2438d3 68 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
switches 0:5c4d7b2438d3 69 * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7)
switches 0:5c4d7b2438d3 70 * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7)
switches 0:5c4d7b2438d3 71 * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7)
switches 0:5c4d7b2438d3 72 * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7)
switches 0:5c4d7b2438d3 73 * - arm_cortexM7l_math.lib (Little endian on Cortex-M7)
switches 0:5c4d7b2438d3 74 * - arm_cortexM7b_math.lib (Big endian on Cortex-M7)
switches 0:5c4d7b2438d3 75 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
switches 0:5c4d7b2438d3 76 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
switches 0:5c4d7b2438d3 77 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
switches 0:5c4d7b2438d3 78 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
switches 0:5c4d7b2438d3 79 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
switches 0:5c4d7b2438d3 80 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
switches 0:5c4d7b2438d3 81 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+)
switches 0:5c4d7b2438d3 82 * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+)
switches 0:5c4d7b2438d3 83 *
switches 0:5c4d7b2438d3 84 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
switches 0:5c4d7b2438d3 85 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
switches 0:5c4d7b2438d3 86 * public header file <code> arm_math.h</code> for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants.
switches 0:5c4d7b2438d3 87 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
switches 0:5c4d7b2438d3 88 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
switches 0:5c4d7b2438d3 89 *
switches 0:5c4d7b2438d3 90 * Examples
switches 0:5c4d7b2438d3 91 * --------
switches 0:5c4d7b2438d3 92 *
switches 0:5c4d7b2438d3 93 * The library ships with a number of examples which demonstrate how to use the library functions.
switches 0:5c4d7b2438d3 94 *
switches 0:5c4d7b2438d3 95 * Toolchain Support
switches 0:5c4d7b2438d3 96 * ------------
switches 0:5c4d7b2438d3 97 *
switches 0:5c4d7b2438d3 98 * The library has been developed and tested with MDK-ARM version 5.14.0.0
switches 0:5c4d7b2438d3 99 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
switches 0:5c4d7b2438d3 100 *
switches 0:5c4d7b2438d3 101 * Building the Library
switches 0:5c4d7b2438d3 102 * ------------
switches 0:5c4d7b2438d3 103 *
switches 0:5c4d7b2438d3 104 * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the <code>CMSIS\\DSP_Lib\\Source\\ARM</code> folder.
switches 0:5c4d7b2438d3 105 * - arm_cortexM_math.uvprojx
switches 0:5c4d7b2438d3 106 *
switches 0:5c4d7b2438d3 107 *
switches 0:5c4d7b2438d3 108 * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above.
switches 0:5c4d7b2438d3 109 *
switches 0:5c4d7b2438d3 110 * Pre-processor Macros
switches 0:5c4d7b2438d3 111 * ------------
switches 0:5c4d7b2438d3 112 *
switches 0:5c4d7b2438d3 113 * Each library project have differant pre-processor macros.
switches 0:5c4d7b2438d3 114 *
switches 0:5c4d7b2438d3 115 * - UNALIGNED_SUPPORT_DISABLE:
switches 0:5c4d7b2438d3 116 *
switches 0:5c4d7b2438d3 117 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
switches 0:5c4d7b2438d3 118 *
switches 0:5c4d7b2438d3 119 * - ARM_MATH_BIG_ENDIAN:
switches 0:5c4d7b2438d3 120 *
switches 0:5c4d7b2438d3 121 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
switches 0:5c4d7b2438d3 122 *
switches 0:5c4d7b2438d3 123 * - ARM_MATH_MATRIX_CHECK:
switches 0:5c4d7b2438d3 124 *
switches 0:5c4d7b2438d3 125 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
switches 0:5c4d7b2438d3 126 *
switches 0:5c4d7b2438d3 127 * - ARM_MATH_ROUNDING:
switches 0:5c4d7b2438d3 128 *
switches 0:5c4d7b2438d3 129 * Define macro ARM_MATH_ROUNDING for rounding on support functions
switches 0:5c4d7b2438d3 130 *
switches 0:5c4d7b2438d3 131 * - ARM_MATH_CMx:
switches 0:5c4d7b2438d3 132 *
switches 0:5c4d7b2438d3 133 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
switches 0:5c4d7b2438d3 134 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
switches 0:5c4d7b2438d3 135 * ARM_MATH_CM7 for building the library on cortex-M7.
switches 0:5c4d7b2438d3 136 *
switches 0:5c4d7b2438d3 137 * - __FPU_PRESENT:
switches 0:5c4d7b2438d3 138 *
switches 0:5c4d7b2438d3 139 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
switches 0:5c4d7b2438d3 140 *
switches 0:5c4d7b2438d3 141 * <hr>
switches 0:5c4d7b2438d3 142 * CMSIS-DSP in ARM::CMSIS Pack
switches 0:5c4d7b2438d3 143 * -----------------------------
switches 0:5c4d7b2438d3 144 *
switches 0:5c4d7b2438d3 145 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
switches 0:5c4d7b2438d3 146 * |File/Folder |Content |
switches 0:5c4d7b2438d3 147 * |------------------------------|------------------------------------------------------------------------|
switches 0:5c4d7b2438d3 148 * |\b CMSIS\\Documentation\\DSP | This documentation |
switches 0:5c4d7b2438d3 149 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
switches 0:5c4d7b2438d3 150 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
switches 0:5c4d7b2438d3 151 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
switches 0:5c4d7b2438d3 152 *
switches 0:5c4d7b2438d3 153 * <hr>
switches 0:5c4d7b2438d3 154 * Revision History of CMSIS-DSP
switches 0:5c4d7b2438d3 155 * ------------
switches 0:5c4d7b2438d3 156 * Please refer to \ref ChangeLog_pg.
switches 0:5c4d7b2438d3 157 *
switches 0:5c4d7b2438d3 158 * Copyright Notice
switches 0:5c4d7b2438d3 159 * ------------
switches 0:5c4d7b2438d3 160 *
switches 0:5c4d7b2438d3 161 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
switches 0:5c4d7b2438d3 162 */
switches 0:5c4d7b2438d3 163
switches 0:5c4d7b2438d3 164
switches 0:5c4d7b2438d3 165 /**
switches 0:5c4d7b2438d3 166 * @defgroup groupMath Basic Math Functions
switches 0:5c4d7b2438d3 167 */
switches 0:5c4d7b2438d3 168
switches 0:5c4d7b2438d3 169 /**
switches 0:5c4d7b2438d3 170 * @defgroup groupFastMath Fast Math Functions
switches 0:5c4d7b2438d3 171 * This set of functions provides a fast approximation to sine, cosine, and square root.
switches 0:5c4d7b2438d3 172 * As compared to most of the other functions in the CMSIS math library, the fast math functions
switches 0:5c4d7b2438d3 173 * operate on individual values and not arrays.
switches 0:5c4d7b2438d3 174 * There are separate functions for Q15, Q31, and floating-point data.
switches 0:5c4d7b2438d3 175 *
switches 0:5c4d7b2438d3 176 */
switches 0:5c4d7b2438d3 177
switches 0:5c4d7b2438d3 178 /**
switches 0:5c4d7b2438d3 179 * @defgroup groupCmplxMath Complex Math Functions
switches 0:5c4d7b2438d3 180 * This set of functions operates on complex data vectors.
switches 0:5c4d7b2438d3 181 * The data in the complex arrays is stored in an interleaved fashion
switches 0:5c4d7b2438d3 182 * (real, imag, real, imag, ...).
switches 0:5c4d7b2438d3 183 * In the API functions, the number of samples in a complex array refers
switches 0:5c4d7b2438d3 184 * to the number of complex values; the array contains twice this number of
switches 0:5c4d7b2438d3 185 * real values.
switches 0:5c4d7b2438d3 186 */
switches 0:5c4d7b2438d3 187
switches 0:5c4d7b2438d3 188 /**
switches 0:5c4d7b2438d3 189 * @defgroup groupFilters Filtering Functions
switches 0:5c4d7b2438d3 190 */
switches 0:5c4d7b2438d3 191
switches 0:5c4d7b2438d3 192 /**
switches 0:5c4d7b2438d3 193 * @defgroup groupMatrix Matrix Functions
switches 0:5c4d7b2438d3 194 *
switches 0:5c4d7b2438d3 195 * This set of functions provides basic matrix math operations.
switches 0:5c4d7b2438d3 196 * The functions operate on matrix data structures. For example,
switches 0:5c4d7b2438d3 197 * the type
switches 0:5c4d7b2438d3 198 * definition for the floating-point matrix structure is shown
switches 0:5c4d7b2438d3 199 * below:
switches 0:5c4d7b2438d3 200 * <pre>
switches 0:5c4d7b2438d3 201 * typedef struct
switches 0:5c4d7b2438d3 202 * {
switches 0:5c4d7b2438d3 203 * uint16_t numRows; // number of rows of the matrix.
switches 0:5c4d7b2438d3 204 * uint16_t numCols; // number of columns of the matrix.
switches 0:5c4d7b2438d3 205 * float32_t *pData; // points to the data of the matrix.
switches 0:5c4d7b2438d3 206 * } arm_matrix_instance_f32;
switches 0:5c4d7b2438d3 207 * </pre>
switches 0:5c4d7b2438d3 208 * There are similar definitions for Q15 and Q31 data types.
switches 0:5c4d7b2438d3 209 *
switches 0:5c4d7b2438d3 210 * The structure specifies the size of the matrix and then points to
switches 0:5c4d7b2438d3 211 * an array of data. The array is of size <code>numRows X numCols</code>
switches 0:5c4d7b2438d3 212 * and the values are arranged in row order. That is, the
switches 0:5c4d7b2438d3 213 * matrix element (i, j) is stored at:
switches 0:5c4d7b2438d3 214 * <pre>
switches 0:5c4d7b2438d3 215 * pData[i*numCols + j]
switches 0:5c4d7b2438d3 216 * </pre>
switches 0:5c4d7b2438d3 217 *
switches 0:5c4d7b2438d3 218 * \par Init Functions
switches 0:5c4d7b2438d3 219 * There is an associated initialization function for each type of matrix
switches 0:5c4d7b2438d3 220 * data structure.
switches 0:5c4d7b2438d3 221 * The initialization function sets the values of the internal structure fields.
switches 0:5c4d7b2438d3 222 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
switches 0:5c4d7b2438d3 223 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
switches 0:5c4d7b2438d3 224 *
switches 0:5c4d7b2438d3 225 * \par
switches 0:5c4d7b2438d3 226 * Use of the initialization function is optional. However, if initialization function is used
switches 0:5c4d7b2438d3 227 * then the instance structure cannot be placed into a const data section.
switches 0:5c4d7b2438d3 228 * To place the instance structure in a const data
switches 0:5c4d7b2438d3 229 * section, manually initialize the data structure. For example:
switches 0:5c4d7b2438d3 230 * <pre>
switches 0:5c4d7b2438d3 231 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
switches 0:5c4d7b2438d3 232 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
switches 0:5c4d7b2438d3 233 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
switches 0:5c4d7b2438d3 234 * </pre>
switches 0:5c4d7b2438d3 235 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
switches 0:5c4d7b2438d3 236 * specifies the number of columns, and <code>pData</code> points to the
switches 0:5c4d7b2438d3 237 * data array.
switches 0:5c4d7b2438d3 238 *
switches 0:5c4d7b2438d3 239 * \par Size Checking
switches 0:5c4d7b2438d3 240 * By default all of the matrix functions perform size checking on the input and
switches 0:5c4d7b2438d3 241 * output matrices. For example, the matrix addition function verifies that the
switches 0:5c4d7b2438d3 242 * two input matrices and the output matrix all have the same number of rows and
switches 0:5c4d7b2438d3 243 * columns. If the size check fails the functions return:
switches 0:5c4d7b2438d3 244 * <pre>
switches 0:5c4d7b2438d3 245 * ARM_MATH_SIZE_MISMATCH
switches 0:5c4d7b2438d3 246 * </pre>
switches 0:5c4d7b2438d3 247 * Otherwise the functions return
switches 0:5c4d7b2438d3 248 * <pre>
switches 0:5c4d7b2438d3 249 * ARM_MATH_SUCCESS
switches 0:5c4d7b2438d3 250 * </pre>
switches 0:5c4d7b2438d3 251 * There is some overhead associated with this matrix size checking.
switches 0:5c4d7b2438d3 252 * The matrix size checking is enabled via the \#define
switches 0:5c4d7b2438d3 253 * <pre>
switches 0:5c4d7b2438d3 254 * ARM_MATH_MATRIX_CHECK
switches 0:5c4d7b2438d3 255 * </pre>
switches 0:5c4d7b2438d3 256 * within the library project settings. By default this macro is defined
switches 0:5c4d7b2438d3 257 * and size checking is enabled. By changing the project settings and
switches 0:5c4d7b2438d3 258 * undefining this macro size checking is eliminated and the functions
switches 0:5c4d7b2438d3 259 * run a bit faster. With size checking disabled the functions always
switches 0:5c4d7b2438d3 260 * return <code>ARM_MATH_SUCCESS</code>.
switches 0:5c4d7b2438d3 261 */
switches 0:5c4d7b2438d3 262
switches 0:5c4d7b2438d3 263 /**
switches 0:5c4d7b2438d3 264 * @defgroup groupTransforms Transform Functions
switches 0:5c4d7b2438d3 265 */
switches 0:5c4d7b2438d3 266
switches 0:5c4d7b2438d3 267 /**
switches 0:5c4d7b2438d3 268 * @defgroup groupController Controller Functions
switches 0:5c4d7b2438d3 269 */
switches 0:5c4d7b2438d3 270
switches 0:5c4d7b2438d3 271 /**
switches 0:5c4d7b2438d3 272 * @defgroup groupStats Statistics Functions
switches 0:5c4d7b2438d3 273 */
switches 0:5c4d7b2438d3 274 /**
switches 0:5c4d7b2438d3 275 * @defgroup groupSupport Support Functions
switches 0:5c4d7b2438d3 276 */
switches 0:5c4d7b2438d3 277
switches 0:5c4d7b2438d3 278 /**
switches 0:5c4d7b2438d3 279 * @defgroup groupInterpolation Interpolation Functions
switches 0:5c4d7b2438d3 280 * These functions perform 1- and 2-dimensional interpolation of data.
switches 0:5c4d7b2438d3 281 * Linear interpolation is used for 1-dimensional data and
switches 0:5c4d7b2438d3 282 * bilinear interpolation is used for 2-dimensional data.
switches 0:5c4d7b2438d3 283 */
switches 0:5c4d7b2438d3 284
switches 0:5c4d7b2438d3 285 /**
switches 0:5c4d7b2438d3 286 * @defgroup groupExamples Examples
switches 0:5c4d7b2438d3 287 */
switches 0:5c4d7b2438d3 288 #ifndef _ARM_MATH_H
switches 0:5c4d7b2438d3 289 #define _ARM_MATH_H
switches 0:5c4d7b2438d3 290
switches 0:5c4d7b2438d3 291 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
switches 0:5c4d7b2438d3 292
switches 0:5c4d7b2438d3 293 #if defined(ARM_MATH_CM7)
switches 0:5c4d7b2438d3 294 #include "core_cm7.h"
switches 0:5c4d7b2438d3 295 #elif defined (ARM_MATH_CM4)
switches 0:5c4d7b2438d3 296 #include "core_cm4.h"
switches 0:5c4d7b2438d3 297 #elif defined (ARM_MATH_CM3)
switches 0:5c4d7b2438d3 298 #include "core_cm3.h"
switches 0:5c4d7b2438d3 299 #elif defined (ARM_MATH_CM0)
switches 0:5c4d7b2438d3 300 #include "core_cm0.h"
switches 0:5c4d7b2438d3 301 #define ARM_MATH_CM0_FAMILY
switches 0:5c4d7b2438d3 302 #elif defined (ARM_MATH_CM0PLUS)
switches 0:5c4d7b2438d3 303 #include "core_cm0plus.h"
switches 0:5c4d7b2438d3 304 #define ARM_MATH_CM0_FAMILY
switches 0:5c4d7b2438d3 305 #else
switches 0:5c4d7b2438d3 306 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
switches 0:5c4d7b2438d3 307 #endif
switches 0:5c4d7b2438d3 308
switches 0:5c4d7b2438d3 309 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
switches 0:5c4d7b2438d3 310 #include "string.h"
switches 0:5c4d7b2438d3 311 #include "math.h"
switches 0:5c4d7b2438d3 312 #ifdef __cplusplus
switches 0:5c4d7b2438d3 313 extern "C"
switches 0:5c4d7b2438d3 314 {
switches 0:5c4d7b2438d3 315 #endif
switches 0:5c4d7b2438d3 316
switches 0:5c4d7b2438d3 317
switches 0:5c4d7b2438d3 318 /**
switches 0:5c4d7b2438d3 319 * @brief Macros required for reciprocal calculation in Normalized LMS
switches 0:5c4d7b2438d3 320 */
switches 0:5c4d7b2438d3 321
switches 0:5c4d7b2438d3 322 #define DELTA_Q31 (0x100)
switches 0:5c4d7b2438d3 323 #define DELTA_Q15 0x5
switches 0:5c4d7b2438d3 324 #define INDEX_MASK 0x0000003F
switches 0:5c4d7b2438d3 325 #ifndef PI
switches 0:5c4d7b2438d3 326 #define PI 3.14159265358979f
switches 0:5c4d7b2438d3 327 #endif
switches 0:5c4d7b2438d3 328
switches 0:5c4d7b2438d3 329 /**
switches 0:5c4d7b2438d3 330 * @brief Macros required for SINE and COSINE Fast math approximations
switches 0:5c4d7b2438d3 331 */
switches 0:5c4d7b2438d3 332
switches 0:5c4d7b2438d3 333 #define FAST_MATH_TABLE_SIZE 512
switches 0:5c4d7b2438d3 334 #define FAST_MATH_Q31_SHIFT (32 - 10)
switches 0:5c4d7b2438d3 335 #define FAST_MATH_Q15_SHIFT (16 - 10)
switches 0:5c4d7b2438d3 336 #define CONTROLLER_Q31_SHIFT (32 - 9)
switches 0:5c4d7b2438d3 337 #define TABLE_SIZE 256
switches 0:5c4d7b2438d3 338 #define TABLE_SPACING_Q31 0x400000
switches 0:5c4d7b2438d3 339 #define TABLE_SPACING_Q15 0x80
switches 0:5c4d7b2438d3 340
switches 0:5c4d7b2438d3 341 /**
switches 0:5c4d7b2438d3 342 * @brief Macros required for SINE and COSINE Controller functions
switches 0:5c4d7b2438d3 343 */
switches 0:5c4d7b2438d3 344 /* 1.31(q31) Fixed value of 2/360 */
switches 0:5c4d7b2438d3 345 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
switches 0:5c4d7b2438d3 346 #define INPUT_SPACING 0xB60B61
switches 0:5c4d7b2438d3 347
switches 0:5c4d7b2438d3 348 /**
switches 0:5c4d7b2438d3 349 * @brief Macro for Unaligned Support
switches 0:5c4d7b2438d3 350 */
switches 0:5c4d7b2438d3 351 #ifndef UNALIGNED_SUPPORT_DISABLE
switches 0:5c4d7b2438d3 352 #define ALIGN4
switches 0:5c4d7b2438d3 353 #else
switches 0:5c4d7b2438d3 354 #if defined (__GNUC__)
switches 0:5c4d7b2438d3 355 #define ALIGN4 __attribute__((aligned(4)))
switches 0:5c4d7b2438d3 356 #else
switches 0:5c4d7b2438d3 357 #define ALIGN4 __align(4)
switches 0:5c4d7b2438d3 358 #endif
switches 0:5c4d7b2438d3 359 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
switches 0:5c4d7b2438d3 360
switches 0:5c4d7b2438d3 361 /**
switches 0:5c4d7b2438d3 362 * @brief Error status returned by some functions in the library.
switches 0:5c4d7b2438d3 363 */
switches 0:5c4d7b2438d3 364
switches 0:5c4d7b2438d3 365 typedef enum
switches 0:5c4d7b2438d3 366 {
switches 0:5c4d7b2438d3 367 ARM_MATH_SUCCESS = 0, /**< No error */
switches 0:5c4d7b2438d3 368 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
switches 0:5c4d7b2438d3 369 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
switches 0:5c4d7b2438d3 370 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
switches 0:5c4d7b2438d3 371 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
switches 0:5c4d7b2438d3 372 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
switches 0:5c4d7b2438d3 373 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
switches 0:5c4d7b2438d3 374 } arm_status;
switches 0:5c4d7b2438d3 375
switches 0:5c4d7b2438d3 376 /**
switches 0:5c4d7b2438d3 377 * @brief 8-bit fractional data type in 1.7 format.
switches 0:5c4d7b2438d3 378 */
switches 0:5c4d7b2438d3 379 typedef int8_t q7_t;
switches 0:5c4d7b2438d3 380
switches 0:5c4d7b2438d3 381 /**
switches 0:5c4d7b2438d3 382 * @brief 16-bit fractional data type in 1.15 format.
switches 0:5c4d7b2438d3 383 */
switches 0:5c4d7b2438d3 384 typedef int16_t q15_t;
switches 0:5c4d7b2438d3 385
switches 0:5c4d7b2438d3 386 /**
switches 0:5c4d7b2438d3 387 * @brief 32-bit fractional data type in 1.31 format.
switches 0:5c4d7b2438d3 388 */
switches 0:5c4d7b2438d3 389 typedef int32_t q31_t;
switches 0:5c4d7b2438d3 390
switches 0:5c4d7b2438d3 391 /**
switches 0:5c4d7b2438d3 392 * @brief 64-bit fractional data type in 1.63 format.
switches 0:5c4d7b2438d3 393 */
switches 0:5c4d7b2438d3 394 typedef int64_t q63_t;
switches 0:5c4d7b2438d3 395
switches 0:5c4d7b2438d3 396 /**
switches 0:5c4d7b2438d3 397 * @brief 32-bit floating-point type definition.
switches 0:5c4d7b2438d3 398 */
switches 0:5c4d7b2438d3 399 typedef float float32_t;
switches 0:5c4d7b2438d3 400
switches 0:5c4d7b2438d3 401 /**
switches 0:5c4d7b2438d3 402 * @brief 64-bit floating-point type definition.
switches 0:5c4d7b2438d3 403 */
switches 0:5c4d7b2438d3 404 typedef double float64_t;
switches 0:5c4d7b2438d3 405
switches 0:5c4d7b2438d3 406 /**
switches 0:5c4d7b2438d3 407 * @brief definition to read/write two 16 bit values.
switches 0:5c4d7b2438d3 408 */
switches 0:5c4d7b2438d3 409 #if defined __CC_ARM
switches 0:5c4d7b2438d3 410 #define __SIMD32_TYPE int32_t __packed
switches 0:5c4d7b2438d3 411 #define CMSIS_UNUSED __attribute__((unused))
switches 0:5c4d7b2438d3 412 #elif defined __ICCARM__
switches 0:5c4d7b2438d3 413 #define __SIMD32_TYPE int32_t __packed
switches 0:5c4d7b2438d3 414 #define CMSIS_UNUSED
switches 0:5c4d7b2438d3 415 #elif defined __GNUC__
switches 0:5c4d7b2438d3 416 #define __SIMD32_TYPE int32_t
switches 0:5c4d7b2438d3 417 #define CMSIS_UNUSED __attribute__((unused))
switches 0:5c4d7b2438d3 418 #elif defined __CSMC__ /* Cosmic */
switches 0:5c4d7b2438d3 419 #define __SIMD32_TYPE int32_t
switches 0:5c4d7b2438d3 420 #define CMSIS_UNUSED
switches 0:5c4d7b2438d3 421 #elif defined __TASKING__
switches 0:5c4d7b2438d3 422 #define __SIMD32_TYPE __unaligned int32_t
switches 0:5c4d7b2438d3 423 #define CMSIS_UNUSED
switches 0:5c4d7b2438d3 424 #else
switches 0:5c4d7b2438d3 425 #error Unknown compiler
switches 0:5c4d7b2438d3 426 #endif
switches 0:5c4d7b2438d3 427
switches 0:5c4d7b2438d3 428 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
switches 0:5c4d7b2438d3 429 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
switches 0:5c4d7b2438d3 430
switches 0:5c4d7b2438d3 431 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
switches 0:5c4d7b2438d3 432
switches 0:5c4d7b2438d3 433 #define __SIMD64(addr) (*(int64_t **) & (addr))
switches 0:5c4d7b2438d3 434
switches 0:5c4d7b2438d3 435 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
switches 0:5c4d7b2438d3 436 /**
switches 0:5c4d7b2438d3 437 * @brief definition to pack two 16 bit values.
switches 0:5c4d7b2438d3 438 */
switches 0:5c4d7b2438d3 439 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
switches 0:5c4d7b2438d3 440 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
switches 0:5c4d7b2438d3 441 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
switches 0:5c4d7b2438d3 442 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
switches 0:5c4d7b2438d3 443
switches 0:5c4d7b2438d3 444 #endif
switches 0:5c4d7b2438d3 445
switches 0:5c4d7b2438d3 446
switches 0:5c4d7b2438d3 447 /**
switches 0:5c4d7b2438d3 448 * @brief definition to pack four 8 bit values.
switches 0:5c4d7b2438d3 449 */
switches 0:5c4d7b2438d3 450 #ifndef ARM_MATH_BIG_ENDIAN
switches 0:5c4d7b2438d3 451
switches 0:5c4d7b2438d3 452 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
switches 0:5c4d7b2438d3 453 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
switches 0:5c4d7b2438d3 454 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
switches 0:5c4d7b2438d3 455 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
switches 0:5c4d7b2438d3 456 #else
switches 0:5c4d7b2438d3 457
switches 0:5c4d7b2438d3 458 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
switches 0:5c4d7b2438d3 459 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
switches 0:5c4d7b2438d3 460 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
switches 0:5c4d7b2438d3 461 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
switches 0:5c4d7b2438d3 462
switches 0:5c4d7b2438d3 463 #endif
switches 0:5c4d7b2438d3 464
switches 0:5c4d7b2438d3 465
switches 0:5c4d7b2438d3 466 /**
switches 0:5c4d7b2438d3 467 * @brief Clips Q63 to Q31 values.
switches 0:5c4d7b2438d3 468 */
switches 0:5c4d7b2438d3 469 static __INLINE q31_t clip_q63_to_q31(
switches 0:5c4d7b2438d3 470 q63_t x)
switches 0:5c4d7b2438d3 471 {
switches 0:5c4d7b2438d3 472 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
switches 0:5c4d7b2438d3 473 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
switches 0:5c4d7b2438d3 474 }
switches 0:5c4d7b2438d3 475
switches 0:5c4d7b2438d3 476 /**
switches 0:5c4d7b2438d3 477 * @brief Clips Q63 to Q15 values.
switches 0:5c4d7b2438d3 478 */
switches 0:5c4d7b2438d3 479 static __INLINE q15_t clip_q63_to_q15(
switches 0:5c4d7b2438d3 480 q63_t x)
switches 0:5c4d7b2438d3 481 {
switches 0:5c4d7b2438d3 482 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
switches 0:5c4d7b2438d3 483 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
switches 0:5c4d7b2438d3 484 }
switches 0:5c4d7b2438d3 485
switches 0:5c4d7b2438d3 486 /**
switches 0:5c4d7b2438d3 487 * @brief Clips Q31 to Q7 values.
switches 0:5c4d7b2438d3 488 */
switches 0:5c4d7b2438d3 489 static __INLINE q7_t clip_q31_to_q7(
switches 0:5c4d7b2438d3 490 q31_t x)
switches 0:5c4d7b2438d3 491 {
switches 0:5c4d7b2438d3 492 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
switches 0:5c4d7b2438d3 493 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
switches 0:5c4d7b2438d3 494 }
switches 0:5c4d7b2438d3 495
switches 0:5c4d7b2438d3 496 /**
switches 0:5c4d7b2438d3 497 * @brief Clips Q31 to Q15 values.
switches 0:5c4d7b2438d3 498 */
switches 0:5c4d7b2438d3 499 static __INLINE q15_t clip_q31_to_q15(
switches 0:5c4d7b2438d3 500 q31_t x)
switches 0:5c4d7b2438d3 501 {
switches 0:5c4d7b2438d3 502 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
switches 0:5c4d7b2438d3 503 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
switches 0:5c4d7b2438d3 504 }
switches 0:5c4d7b2438d3 505
switches 0:5c4d7b2438d3 506 /**
switches 0:5c4d7b2438d3 507 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
switches 0:5c4d7b2438d3 508 */
switches 0:5c4d7b2438d3 509
switches 0:5c4d7b2438d3 510 static __INLINE q63_t mult32x64(
switches 0:5c4d7b2438d3 511 q63_t x,
switches 0:5c4d7b2438d3 512 q31_t y)
switches 0:5c4d7b2438d3 513 {
switches 0:5c4d7b2438d3 514 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
switches 0:5c4d7b2438d3 515 (((q63_t) (x >> 32) * y)));
switches 0:5c4d7b2438d3 516 }
switches 0:5c4d7b2438d3 517
switches 0:5c4d7b2438d3 518
switches 0:5c4d7b2438d3 519 //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
switches 0:5c4d7b2438d3 520 //#define __CLZ __clz
switches 0:5c4d7b2438d3 521 //#endif
switches 0:5c4d7b2438d3 522
switches 0:5c4d7b2438d3 523 //note: function can be removed when all toolchain support __CLZ for Cortex-M0
switches 0:5c4d7b2438d3 524 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
switches 0:5c4d7b2438d3 525
switches 0:5c4d7b2438d3 526 static __INLINE uint32_t __CLZ(
switches 0:5c4d7b2438d3 527 q31_t data);
switches 0:5c4d7b2438d3 528
switches 0:5c4d7b2438d3 529
switches 0:5c4d7b2438d3 530 static __INLINE uint32_t __CLZ(
switches 0:5c4d7b2438d3 531 q31_t data)
switches 0:5c4d7b2438d3 532 {
switches 0:5c4d7b2438d3 533 uint32_t count = 0;
switches 0:5c4d7b2438d3 534 uint32_t mask = 0x80000000;
switches 0:5c4d7b2438d3 535
switches 0:5c4d7b2438d3 536 while((data & mask) == 0)
switches 0:5c4d7b2438d3 537 {
switches 0:5c4d7b2438d3 538 count += 1u;
switches 0:5c4d7b2438d3 539 mask = mask >> 1u;
switches 0:5c4d7b2438d3 540 }
switches 0:5c4d7b2438d3 541
switches 0:5c4d7b2438d3 542 return (count);
switches 0:5c4d7b2438d3 543
switches 0:5c4d7b2438d3 544 }
switches 0:5c4d7b2438d3 545
switches 0:5c4d7b2438d3 546 #endif
switches 0:5c4d7b2438d3 547
switches 0:5c4d7b2438d3 548 /**
switches 0:5c4d7b2438d3 549 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
switches 0:5c4d7b2438d3 550 */
switches 0:5c4d7b2438d3 551
switches 0:5c4d7b2438d3 552 static __INLINE uint32_t arm_recip_q31(
switches 0:5c4d7b2438d3 553 q31_t in,
switches 0:5c4d7b2438d3 554 q31_t * dst,
switches 0:5c4d7b2438d3 555 q31_t * pRecipTable)
switches 0:5c4d7b2438d3 556 {
switches 0:5c4d7b2438d3 557
switches 0:5c4d7b2438d3 558 uint32_t out, tempVal;
switches 0:5c4d7b2438d3 559 uint32_t index, i;
switches 0:5c4d7b2438d3 560 uint32_t signBits;
switches 0:5c4d7b2438d3 561
switches 0:5c4d7b2438d3 562 if(in > 0)
switches 0:5c4d7b2438d3 563 {
switches 0:5c4d7b2438d3 564 signBits = __CLZ(in) - 1;
switches 0:5c4d7b2438d3 565 }
switches 0:5c4d7b2438d3 566 else
switches 0:5c4d7b2438d3 567 {
switches 0:5c4d7b2438d3 568 signBits = __CLZ(-in) - 1;
switches 0:5c4d7b2438d3 569 }
switches 0:5c4d7b2438d3 570
switches 0:5c4d7b2438d3 571 /* Convert input sample to 1.31 format */
switches 0:5c4d7b2438d3 572 in = in << signBits;
switches 0:5c4d7b2438d3 573
switches 0:5c4d7b2438d3 574 /* calculation of index for initial approximated Val */
switches 0:5c4d7b2438d3 575 index = (uint32_t) (in >> 24u);
switches 0:5c4d7b2438d3 576 index = (index & INDEX_MASK);
switches 0:5c4d7b2438d3 577
switches 0:5c4d7b2438d3 578 /* 1.31 with exp 1 */
switches 0:5c4d7b2438d3 579 out = pRecipTable[index];
switches 0:5c4d7b2438d3 580
switches 0:5c4d7b2438d3 581 /* calculation of reciprocal value */
switches 0:5c4d7b2438d3 582 /* running approximation for two iterations */
switches 0:5c4d7b2438d3 583 for (i = 0u; i < 2u; i++)
switches 0:5c4d7b2438d3 584 {
switches 0:5c4d7b2438d3 585 tempVal = (q31_t) (((q63_t) in * out) >> 31u);
switches 0:5c4d7b2438d3 586 tempVal = 0x7FFFFFFF - tempVal;
switches 0:5c4d7b2438d3 587 /* 1.31 with exp 1 */
switches 0:5c4d7b2438d3 588 //out = (q31_t) (((q63_t) out * tempVal) >> 30u);
switches 0:5c4d7b2438d3 589 out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u);
switches 0:5c4d7b2438d3 590 }
switches 0:5c4d7b2438d3 591
switches 0:5c4d7b2438d3 592 /* write output */
switches 0:5c4d7b2438d3 593 *dst = out;
switches 0:5c4d7b2438d3 594
switches 0:5c4d7b2438d3 595 /* return num of signbits of out = 1/in value */
switches 0:5c4d7b2438d3 596 return (signBits + 1u);
switches 0:5c4d7b2438d3 597
switches 0:5c4d7b2438d3 598 }
switches 0:5c4d7b2438d3 599
switches 0:5c4d7b2438d3 600 /**
switches 0:5c4d7b2438d3 601 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
switches 0:5c4d7b2438d3 602 */
switches 0:5c4d7b2438d3 603 static __INLINE uint32_t arm_recip_q15(
switches 0:5c4d7b2438d3 604 q15_t in,
switches 0:5c4d7b2438d3 605 q15_t * dst,
switches 0:5c4d7b2438d3 606 q15_t * pRecipTable)
switches 0:5c4d7b2438d3 607 {
switches 0:5c4d7b2438d3 608
switches 0:5c4d7b2438d3 609 uint32_t out = 0, tempVal = 0;
switches 0:5c4d7b2438d3 610 uint32_t index = 0, i = 0;
switches 0:5c4d7b2438d3 611 uint32_t signBits = 0;
switches 0:5c4d7b2438d3 612
switches 0:5c4d7b2438d3 613 if(in > 0)
switches 0:5c4d7b2438d3 614 {
switches 0:5c4d7b2438d3 615 signBits = __CLZ(in) - 17;
switches 0:5c4d7b2438d3 616 }
switches 0:5c4d7b2438d3 617 else
switches 0:5c4d7b2438d3 618 {
switches 0:5c4d7b2438d3 619 signBits = __CLZ(-in) - 17;
switches 0:5c4d7b2438d3 620 }
switches 0:5c4d7b2438d3 621
switches 0:5c4d7b2438d3 622 /* Convert input sample to 1.15 format */
switches 0:5c4d7b2438d3 623 in = in << signBits;
switches 0:5c4d7b2438d3 624
switches 0:5c4d7b2438d3 625 /* calculation of index for initial approximated Val */
switches 0:5c4d7b2438d3 626 index = in >> 8;
switches 0:5c4d7b2438d3 627 index = (index & INDEX_MASK);
switches 0:5c4d7b2438d3 628
switches 0:5c4d7b2438d3 629 /* 1.15 with exp 1 */
switches 0:5c4d7b2438d3 630 out = pRecipTable[index];
switches 0:5c4d7b2438d3 631
switches 0:5c4d7b2438d3 632 /* calculation of reciprocal value */
switches 0:5c4d7b2438d3 633 /* running approximation for two iterations */
switches 0:5c4d7b2438d3 634 for (i = 0; i < 2; i++)
switches 0:5c4d7b2438d3 635 {
switches 0:5c4d7b2438d3 636 tempVal = (q15_t) (((q31_t) in * out) >> 15);
switches 0:5c4d7b2438d3 637 tempVal = 0x7FFF - tempVal;
switches 0:5c4d7b2438d3 638 /* 1.15 with exp 1 */
switches 0:5c4d7b2438d3 639 out = (q15_t) (((q31_t) out * tempVal) >> 14);
switches 0:5c4d7b2438d3 640 }
switches 0:5c4d7b2438d3 641
switches 0:5c4d7b2438d3 642 /* write output */
switches 0:5c4d7b2438d3 643 *dst = out;
switches 0:5c4d7b2438d3 644
switches 0:5c4d7b2438d3 645 /* return num of signbits of out = 1/in value */
switches 0:5c4d7b2438d3 646 return (signBits + 1);
switches 0:5c4d7b2438d3 647
switches 0:5c4d7b2438d3 648 }
switches 0:5c4d7b2438d3 649
switches 0:5c4d7b2438d3 650
switches 0:5c4d7b2438d3 651 /*
switches 0:5c4d7b2438d3 652 * @brief C custom defined intrinisic function for only M0 processors
switches 0:5c4d7b2438d3 653 */
switches 0:5c4d7b2438d3 654 #if defined(ARM_MATH_CM0_FAMILY)
switches 0:5c4d7b2438d3 655
switches 0:5c4d7b2438d3 656 static __INLINE q31_t __SSAT(
switches 0:5c4d7b2438d3 657 q31_t x,
switches 0:5c4d7b2438d3 658 uint32_t y)
switches 0:5c4d7b2438d3 659 {
switches 0:5c4d7b2438d3 660 int32_t posMax, negMin;
switches 0:5c4d7b2438d3 661 uint32_t i;
switches 0:5c4d7b2438d3 662
switches 0:5c4d7b2438d3 663 posMax = 1;
switches 0:5c4d7b2438d3 664 for (i = 0; i < (y - 1); i++)
switches 0:5c4d7b2438d3 665 {
switches 0:5c4d7b2438d3 666 posMax = posMax * 2;
switches 0:5c4d7b2438d3 667 }
switches 0:5c4d7b2438d3 668
switches 0:5c4d7b2438d3 669 if(x > 0)
switches 0:5c4d7b2438d3 670 {
switches 0:5c4d7b2438d3 671 posMax = (posMax - 1);
switches 0:5c4d7b2438d3 672
switches 0:5c4d7b2438d3 673 if(x > posMax)
switches 0:5c4d7b2438d3 674 {
switches 0:5c4d7b2438d3 675 x = posMax;
switches 0:5c4d7b2438d3 676 }
switches 0:5c4d7b2438d3 677 }
switches 0:5c4d7b2438d3 678 else
switches 0:5c4d7b2438d3 679 {
switches 0:5c4d7b2438d3 680 negMin = -posMax;
switches 0:5c4d7b2438d3 681
switches 0:5c4d7b2438d3 682 if(x < negMin)
switches 0:5c4d7b2438d3 683 {
switches 0:5c4d7b2438d3 684 x = negMin;
switches 0:5c4d7b2438d3 685 }
switches 0:5c4d7b2438d3 686 }
switches 0:5c4d7b2438d3 687 return (x);
switches 0:5c4d7b2438d3 688
switches 0:5c4d7b2438d3 689
switches 0:5c4d7b2438d3 690 }
switches 0:5c4d7b2438d3 691
switches 0:5c4d7b2438d3 692 #endif /* end of ARM_MATH_CM0_FAMILY */
switches 0:5c4d7b2438d3 693
switches 0:5c4d7b2438d3 694
switches 0:5c4d7b2438d3 695
switches 0:5c4d7b2438d3 696 /*
switches 0:5c4d7b2438d3 697 * @brief C custom defined intrinsic function for M3 and M0 processors
switches 0:5c4d7b2438d3 698 */
switches 0:5c4d7b2438d3 699 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
switches 0:5c4d7b2438d3 700
switches 0:5c4d7b2438d3 701 /*
switches 0:5c4d7b2438d3 702 * @brief C custom defined QADD8 for M3 and M0 processors
switches 0:5c4d7b2438d3 703 */
switches 0:5c4d7b2438d3 704 static __INLINE q31_t __QADD8(
switches 0:5c4d7b2438d3 705 q31_t x,
switches 0:5c4d7b2438d3 706 q31_t y)
switches 0:5c4d7b2438d3 707 {
switches 0:5c4d7b2438d3 708
switches 0:5c4d7b2438d3 709 q31_t sum;
switches 0:5c4d7b2438d3 710 q7_t r, s, t, u;
switches 0:5c4d7b2438d3 711
switches 0:5c4d7b2438d3 712 r = (q7_t) x;
switches 0:5c4d7b2438d3 713 s = (q7_t) y;
switches 0:5c4d7b2438d3 714
switches 0:5c4d7b2438d3 715 r = __SSAT((q31_t) (r + s), 8);
switches 0:5c4d7b2438d3 716 s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8);
switches 0:5c4d7b2438d3 717 t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8);
switches 0:5c4d7b2438d3 718 u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8);
switches 0:5c4d7b2438d3 719
switches 0:5c4d7b2438d3 720 sum =
switches 0:5c4d7b2438d3 721 (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) |
switches 0:5c4d7b2438d3 722 (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF);
switches 0:5c4d7b2438d3 723
switches 0:5c4d7b2438d3 724 return sum;
switches 0:5c4d7b2438d3 725
switches 0:5c4d7b2438d3 726 }
switches 0:5c4d7b2438d3 727
switches 0:5c4d7b2438d3 728 /*
switches 0:5c4d7b2438d3 729 * @brief C custom defined QSUB8 for M3 and M0 processors
switches 0:5c4d7b2438d3 730 */
switches 0:5c4d7b2438d3 731 static __INLINE q31_t __QSUB8(
switches 0:5c4d7b2438d3 732 q31_t x,
switches 0:5c4d7b2438d3 733 q31_t y)
switches 0:5c4d7b2438d3 734 {
switches 0:5c4d7b2438d3 735
switches 0:5c4d7b2438d3 736 q31_t sum;
switches 0:5c4d7b2438d3 737 q31_t r, s, t, u;
switches 0:5c4d7b2438d3 738
switches 0:5c4d7b2438d3 739 r = (q7_t) x;
switches 0:5c4d7b2438d3 740 s = (q7_t) y;
switches 0:5c4d7b2438d3 741
switches 0:5c4d7b2438d3 742 r = __SSAT((r - s), 8);
switches 0:5c4d7b2438d3 743 s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8;
switches 0:5c4d7b2438d3 744 t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16;
switches 0:5c4d7b2438d3 745 u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24;
switches 0:5c4d7b2438d3 746
switches 0:5c4d7b2438d3 747 sum =
switches 0:5c4d7b2438d3 748 (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r &
switches 0:5c4d7b2438d3 749 0x000000FF);
switches 0:5c4d7b2438d3 750
switches 0:5c4d7b2438d3 751 return sum;
switches 0:5c4d7b2438d3 752 }
switches 0:5c4d7b2438d3 753
switches 0:5c4d7b2438d3 754 /*
switches 0:5c4d7b2438d3 755 * @brief C custom defined QADD16 for M3 and M0 processors
switches 0:5c4d7b2438d3 756 */
switches 0:5c4d7b2438d3 757
switches 0:5c4d7b2438d3 758 /*
switches 0:5c4d7b2438d3 759 * @brief C custom defined QADD16 for M3 and M0 processors
switches 0:5c4d7b2438d3 760 */
switches 0:5c4d7b2438d3 761 static __INLINE q31_t __QADD16(
switches 0:5c4d7b2438d3 762 q31_t x,
switches 0:5c4d7b2438d3 763 q31_t y)
switches 0:5c4d7b2438d3 764 {
switches 0:5c4d7b2438d3 765
switches 0:5c4d7b2438d3 766 q31_t sum;
switches 0:5c4d7b2438d3 767 q31_t r, s;
switches 0:5c4d7b2438d3 768
switches 0:5c4d7b2438d3 769 r = (q15_t) x;
switches 0:5c4d7b2438d3 770 s = (q15_t) y;
switches 0:5c4d7b2438d3 771
switches 0:5c4d7b2438d3 772 r = __SSAT(r + s, 16);
switches 0:5c4d7b2438d3 773 s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16;
switches 0:5c4d7b2438d3 774
switches 0:5c4d7b2438d3 775 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 776
switches 0:5c4d7b2438d3 777 return sum;
switches 0:5c4d7b2438d3 778
switches 0:5c4d7b2438d3 779 }
switches 0:5c4d7b2438d3 780
switches 0:5c4d7b2438d3 781 /*
switches 0:5c4d7b2438d3 782 * @brief C custom defined SHADD16 for M3 and M0 processors
switches 0:5c4d7b2438d3 783 */
switches 0:5c4d7b2438d3 784 static __INLINE q31_t __SHADD16(
switches 0:5c4d7b2438d3 785 q31_t x,
switches 0:5c4d7b2438d3 786 q31_t y)
switches 0:5c4d7b2438d3 787 {
switches 0:5c4d7b2438d3 788
switches 0:5c4d7b2438d3 789 q31_t sum;
switches 0:5c4d7b2438d3 790 q31_t r, s;
switches 0:5c4d7b2438d3 791
switches 0:5c4d7b2438d3 792 r = (q15_t) x;
switches 0:5c4d7b2438d3 793 s = (q15_t) y;
switches 0:5c4d7b2438d3 794
switches 0:5c4d7b2438d3 795 r = ((r >> 1) + (s >> 1));
switches 0:5c4d7b2438d3 796 s = ((q31_t) ((x >> 17) + (y >> 17))) << 16;
switches 0:5c4d7b2438d3 797
switches 0:5c4d7b2438d3 798 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 799
switches 0:5c4d7b2438d3 800 return sum;
switches 0:5c4d7b2438d3 801
switches 0:5c4d7b2438d3 802 }
switches 0:5c4d7b2438d3 803
switches 0:5c4d7b2438d3 804 /*
switches 0:5c4d7b2438d3 805 * @brief C custom defined QSUB16 for M3 and M0 processors
switches 0:5c4d7b2438d3 806 */
switches 0:5c4d7b2438d3 807 static __INLINE q31_t __QSUB16(
switches 0:5c4d7b2438d3 808 q31_t x,
switches 0:5c4d7b2438d3 809 q31_t y)
switches 0:5c4d7b2438d3 810 {
switches 0:5c4d7b2438d3 811
switches 0:5c4d7b2438d3 812 q31_t sum;
switches 0:5c4d7b2438d3 813 q31_t r, s;
switches 0:5c4d7b2438d3 814
switches 0:5c4d7b2438d3 815 r = (q15_t) x;
switches 0:5c4d7b2438d3 816 s = (q15_t) y;
switches 0:5c4d7b2438d3 817
switches 0:5c4d7b2438d3 818 r = __SSAT(r - s, 16);
switches 0:5c4d7b2438d3 819 s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16;
switches 0:5c4d7b2438d3 820
switches 0:5c4d7b2438d3 821 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 822
switches 0:5c4d7b2438d3 823 return sum;
switches 0:5c4d7b2438d3 824 }
switches 0:5c4d7b2438d3 825
switches 0:5c4d7b2438d3 826 /*
switches 0:5c4d7b2438d3 827 * @brief C custom defined SHSUB16 for M3 and M0 processors
switches 0:5c4d7b2438d3 828 */
switches 0:5c4d7b2438d3 829 static __INLINE q31_t __SHSUB16(
switches 0:5c4d7b2438d3 830 q31_t x,
switches 0:5c4d7b2438d3 831 q31_t y)
switches 0:5c4d7b2438d3 832 {
switches 0:5c4d7b2438d3 833
switches 0:5c4d7b2438d3 834 q31_t diff;
switches 0:5c4d7b2438d3 835 q31_t r, s;
switches 0:5c4d7b2438d3 836
switches 0:5c4d7b2438d3 837 r = (q15_t) x;
switches 0:5c4d7b2438d3 838 s = (q15_t) y;
switches 0:5c4d7b2438d3 839
switches 0:5c4d7b2438d3 840 r = ((r >> 1) - (s >> 1));
switches 0:5c4d7b2438d3 841 s = (((x >> 17) - (y >> 17)) << 16);
switches 0:5c4d7b2438d3 842
switches 0:5c4d7b2438d3 843 diff = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 844
switches 0:5c4d7b2438d3 845 return diff;
switches 0:5c4d7b2438d3 846 }
switches 0:5c4d7b2438d3 847
switches 0:5c4d7b2438d3 848 /*
switches 0:5c4d7b2438d3 849 * @brief C custom defined QASX for M3 and M0 processors
switches 0:5c4d7b2438d3 850 */
switches 0:5c4d7b2438d3 851 static __INLINE q31_t __QASX(
switches 0:5c4d7b2438d3 852 q31_t x,
switches 0:5c4d7b2438d3 853 q31_t y)
switches 0:5c4d7b2438d3 854 {
switches 0:5c4d7b2438d3 855
switches 0:5c4d7b2438d3 856 q31_t sum = 0;
switches 0:5c4d7b2438d3 857
switches 0:5c4d7b2438d3 858 sum =
switches 0:5c4d7b2438d3 859 ((sum +
switches 0:5c4d7b2438d3 860 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) +
switches 0:5c4d7b2438d3 861 clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16)));
switches 0:5c4d7b2438d3 862
switches 0:5c4d7b2438d3 863 return sum;
switches 0:5c4d7b2438d3 864 }
switches 0:5c4d7b2438d3 865
switches 0:5c4d7b2438d3 866 /*
switches 0:5c4d7b2438d3 867 * @brief C custom defined SHASX for M3 and M0 processors
switches 0:5c4d7b2438d3 868 */
switches 0:5c4d7b2438d3 869 static __INLINE q31_t __SHASX(
switches 0:5c4d7b2438d3 870 q31_t x,
switches 0:5c4d7b2438d3 871 q31_t y)
switches 0:5c4d7b2438d3 872 {
switches 0:5c4d7b2438d3 873
switches 0:5c4d7b2438d3 874 q31_t sum;
switches 0:5c4d7b2438d3 875 q31_t r, s;
switches 0:5c4d7b2438d3 876
switches 0:5c4d7b2438d3 877 r = (q15_t) x;
switches 0:5c4d7b2438d3 878 s = (q15_t) y;
switches 0:5c4d7b2438d3 879
switches 0:5c4d7b2438d3 880 r = ((r >> 1) - (y >> 17));
switches 0:5c4d7b2438d3 881 s = (((x >> 17) + (s >> 1)) << 16);
switches 0:5c4d7b2438d3 882
switches 0:5c4d7b2438d3 883 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 884
switches 0:5c4d7b2438d3 885 return sum;
switches 0:5c4d7b2438d3 886 }
switches 0:5c4d7b2438d3 887
switches 0:5c4d7b2438d3 888
switches 0:5c4d7b2438d3 889 /*
switches 0:5c4d7b2438d3 890 * @brief C custom defined QSAX for M3 and M0 processors
switches 0:5c4d7b2438d3 891 */
switches 0:5c4d7b2438d3 892 static __INLINE q31_t __QSAX(
switches 0:5c4d7b2438d3 893 q31_t x,
switches 0:5c4d7b2438d3 894 q31_t y)
switches 0:5c4d7b2438d3 895 {
switches 0:5c4d7b2438d3 896
switches 0:5c4d7b2438d3 897 q31_t sum = 0;
switches 0:5c4d7b2438d3 898
switches 0:5c4d7b2438d3 899 sum =
switches 0:5c4d7b2438d3 900 ((sum +
switches 0:5c4d7b2438d3 901 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) +
switches 0:5c4d7b2438d3 902 clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16)));
switches 0:5c4d7b2438d3 903
switches 0:5c4d7b2438d3 904 return sum;
switches 0:5c4d7b2438d3 905 }
switches 0:5c4d7b2438d3 906
switches 0:5c4d7b2438d3 907 /*
switches 0:5c4d7b2438d3 908 * @brief C custom defined SHSAX for M3 and M0 processors
switches 0:5c4d7b2438d3 909 */
switches 0:5c4d7b2438d3 910 static __INLINE q31_t __SHSAX(
switches 0:5c4d7b2438d3 911 q31_t x,
switches 0:5c4d7b2438d3 912 q31_t y)
switches 0:5c4d7b2438d3 913 {
switches 0:5c4d7b2438d3 914
switches 0:5c4d7b2438d3 915 q31_t sum;
switches 0:5c4d7b2438d3 916 q31_t r, s;
switches 0:5c4d7b2438d3 917
switches 0:5c4d7b2438d3 918 r = (q15_t) x;
switches 0:5c4d7b2438d3 919 s = (q15_t) y;
switches 0:5c4d7b2438d3 920
switches 0:5c4d7b2438d3 921 r = ((r >> 1) + (y >> 17));
switches 0:5c4d7b2438d3 922 s = (((x >> 17) - (s >> 1)) << 16);
switches 0:5c4d7b2438d3 923
switches 0:5c4d7b2438d3 924 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
switches 0:5c4d7b2438d3 925
switches 0:5c4d7b2438d3 926 return sum;
switches 0:5c4d7b2438d3 927 }
switches 0:5c4d7b2438d3 928
switches 0:5c4d7b2438d3 929 /*
switches 0:5c4d7b2438d3 930 * @brief C custom defined SMUSDX for M3 and M0 processors
switches 0:5c4d7b2438d3 931 */
switches 0:5c4d7b2438d3 932 static __INLINE q31_t __SMUSDX(
switches 0:5c4d7b2438d3 933 q31_t x,
switches 0:5c4d7b2438d3 934 q31_t y)
switches 0:5c4d7b2438d3 935 {
switches 0:5c4d7b2438d3 936
switches 0:5c4d7b2438d3 937 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) -
switches 0:5c4d7b2438d3 938 ((q15_t) (x >> 16) * (q15_t) y)));
switches 0:5c4d7b2438d3 939 }
switches 0:5c4d7b2438d3 940
switches 0:5c4d7b2438d3 941 /*
switches 0:5c4d7b2438d3 942 * @brief C custom defined SMUADX for M3 and M0 processors
switches 0:5c4d7b2438d3 943 */
switches 0:5c4d7b2438d3 944 static __INLINE q31_t __SMUADX(
switches 0:5c4d7b2438d3 945 q31_t x,
switches 0:5c4d7b2438d3 946 q31_t y)
switches 0:5c4d7b2438d3 947 {
switches 0:5c4d7b2438d3 948
switches 0:5c4d7b2438d3 949 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) +
switches 0:5c4d7b2438d3 950 ((q15_t) (x >> 16) * (q15_t) y)));
switches 0:5c4d7b2438d3 951 }
switches 0:5c4d7b2438d3 952
switches 0:5c4d7b2438d3 953 /*
switches 0:5c4d7b2438d3 954 * @brief C custom defined QADD for M3 and M0 processors
switches 0:5c4d7b2438d3 955 */
switches 0:5c4d7b2438d3 956 static __INLINE q31_t __QADD(
switches 0:5c4d7b2438d3 957 q31_t x,
switches 0:5c4d7b2438d3 958 q31_t y)
switches 0:5c4d7b2438d3 959 {
switches 0:5c4d7b2438d3 960 return clip_q63_to_q31((q63_t) x + y);
switches 0:5c4d7b2438d3 961 }
switches 0:5c4d7b2438d3 962
switches 0:5c4d7b2438d3 963 /*
switches 0:5c4d7b2438d3 964 * @brief C custom defined QSUB for M3 and M0 processors
switches 0:5c4d7b2438d3 965 */
switches 0:5c4d7b2438d3 966 static __INLINE q31_t __QSUB(
switches 0:5c4d7b2438d3 967 q31_t x,
switches 0:5c4d7b2438d3 968 q31_t y)
switches 0:5c4d7b2438d3 969 {
switches 0:5c4d7b2438d3 970 return clip_q63_to_q31((q63_t) x - y);
switches 0:5c4d7b2438d3 971 }
switches 0:5c4d7b2438d3 972
switches 0:5c4d7b2438d3 973 /*
switches 0:5c4d7b2438d3 974 * @brief C custom defined SMLAD for M3 and M0 processors
switches 0:5c4d7b2438d3 975 */
switches 0:5c4d7b2438d3 976 static __INLINE q31_t __SMLAD(
switches 0:5c4d7b2438d3 977 q31_t x,
switches 0:5c4d7b2438d3 978 q31_t y,
switches 0:5c4d7b2438d3 979 q31_t sum)
switches 0:5c4d7b2438d3 980 {
switches 0:5c4d7b2438d3 981
switches 0:5c4d7b2438d3 982 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
switches 0:5c4d7b2438d3 983 ((q15_t) x * (q15_t) y));
switches 0:5c4d7b2438d3 984 }
switches 0:5c4d7b2438d3 985
switches 0:5c4d7b2438d3 986 /*
switches 0:5c4d7b2438d3 987 * @brief C custom defined SMLADX for M3 and M0 processors
switches 0:5c4d7b2438d3 988 */
switches 0:5c4d7b2438d3 989 static __INLINE q31_t __SMLADX(
switches 0:5c4d7b2438d3 990 q31_t x,
switches 0:5c4d7b2438d3 991 q31_t y,
switches 0:5c4d7b2438d3 992 q31_t sum)
switches 0:5c4d7b2438d3 993 {
switches 0:5c4d7b2438d3 994
switches 0:5c4d7b2438d3 995 return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) +
switches 0:5c4d7b2438d3 996 ((q15_t) x * (q15_t) (y >> 16)));
switches 0:5c4d7b2438d3 997 }
switches 0:5c4d7b2438d3 998
switches 0:5c4d7b2438d3 999 /*
switches 0:5c4d7b2438d3 1000 * @brief C custom defined SMLSDX for M3 and M0 processors
switches 0:5c4d7b2438d3 1001 */
switches 0:5c4d7b2438d3 1002 static __INLINE q31_t __SMLSDX(
switches 0:5c4d7b2438d3 1003 q31_t x,
switches 0:5c4d7b2438d3 1004 q31_t y,
switches 0:5c4d7b2438d3 1005 q31_t sum)
switches 0:5c4d7b2438d3 1006 {
switches 0:5c4d7b2438d3 1007
switches 0:5c4d7b2438d3 1008 return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) +
switches 0:5c4d7b2438d3 1009 ((q15_t) x * (q15_t) (y >> 16)));
switches 0:5c4d7b2438d3 1010 }
switches 0:5c4d7b2438d3 1011
switches 0:5c4d7b2438d3 1012 /*
switches 0:5c4d7b2438d3 1013 * @brief C custom defined SMLALD for M3 and M0 processors
switches 0:5c4d7b2438d3 1014 */
switches 0:5c4d7b2438d3 1015 static __INLINE q63_t __SMLALD(
switches 0:5c4d7b2438d3 1016 q31_t x,
switches 0:5c4d7b2438d3 1017 q31_t y,
switches 0:5c4d7b2438d3 1018 q63_t sum)
switches 0:5c4d7b2438d3 1019 {
switches 0:5c4d7b2438d3 1020
switches 0:5c4d7b2438d3 1021 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
switches 0:5c4d7b2438d3 1022 ((q15_t) x * (q15_t) y));
switches 0:5c4d7b2438d3 1023 }
switches 0:5c4d7b2438d3 1024
switches 0:5c4d7b2438d3 1025 /*
switches 0:5c4d7b2438d3 1026 * @brief C custom defined SMLALDX for M3 and M0 processors
switches 0:5c4d7b2438d3 1027 */
switches 0:5c4d7b2438d3 1028 static __INLINE q63_t __SMLALDX(
switches 0:5c4d7b2438d3 1029 q31_t x,
switches 0:5c4d7b2438d3 1030 q31_t y,
switches 0:5c4d7b2438d3 1031 q63_t sum)
switches 0:5c4d7b2438d3 1032 {
switches 0:5c4d7b2438d3 1033
switches 0:5c4d7b2438d3 1034 return (sum + ((q15_t) (x >> 16) * (q15_t) y)) +
switches 0:5c4d7b2438d3 1035 ((q15_t) x * (q15_t) (y >> 16));
switches 0:5c4d7b2438d3 1036 }
switches 0:5c4d7b2438d3 1037
switches 0:5c4d7b2438d3 1038 /*
switches 0:5c4d7b2438d3 1039 * @brief C custom defined SMUAD for M3 and M0 processors
switches 0:5c4d7b2438d3 1040 */
switches 0:5c4d7b2438d3 1041 static __INLINE q31_t __SMUAD(
switches 0:5c4d7b2438d3 1042 q31_t x,
switches 0:5c4d7b2438d3 1043 q31_t y)
switches 0:5c4d7b2438d3 1044 {
switches 0:5c4d7b2438d3 1045
switches 0:5c4d7b2438d3 1046 return (((x >> 16) * (y >> 16)) +
switches 0:5c4d7b2438d3 1047 (((x << 16) >> 16) * ((y << 16) >> 16)));
switches 0:5c4d7b2438d3 1048 }
switches 0:5c4d7b2438d3 1049
switches 0:5c4d7b2438d3 1050 /*
switches 0:5c4d7b2438d3 1051 * @brief C custom defined SMUSD for M3 and M0 processors
switches 0:5c4d7b2438d3 1052 */
switches 0:5c4d7b2438d3 1053 static __INLINE q31_t __SMUSD(
switches 0:5c4d7b2438d3 1054 q31_t x,
switches 0:5c4d7b2438d3 1055 q31_t y)
switches 0:5c4d7b2438d3 1056 {
switches 0:5c4d7b2438d3 1057
switches 0:5c4d7b2438d3 1058 return (-((x >> 16) * (y >> 16)) +
switches 0:5c4d7b2438d3 1059 (((x << 16) >> 16) * ((y << 16) >> 16)));
switches 0:5c4d7b2438d3 1060 }
switches 0:5c4d7b2438d3 1061
switches 0:5c4d7b2438d3 1062
switches 0:5c4d7b2438d3 1063 /*
switches 0:5c4d7b2438d3 1064 * @brief C custom defined SXTB16 for M3 and M0 processors
switches 0:5c4d7b2438d3 1065 */
switches 0:5c4d7b2438d3 1066 static __INLINE q31_t __SXTB16(
switches 0:5c4d7b2438d3 1067 q31_t x)
switches 0:5c4d7b2438d3 1068 {
switches 0:5c4d7b2438d3 1069
switches 0:5c4d7b2438d3 1070 return ((((x << 24) >> 24) & 0x0000FFFF) |
switches 0:5c4d7b2438d3 1071 (((x << 8) >> 8) & 0xFFFF0000));
switches 0:5c4d7b2438d3 1072 }
switches 0:5c4d7b2438d3 1073
switches 0:5c4d7b2438d3 1074
switches 0:5c4d7b2438d3 1075 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
switches 0:5c4d7b2438d3 1076
switches 0:5c4d7b2438d3 1077
switches 0:5c4d7b2438d3 1078 /**
switches 0:5c4d7b2438d3 1079 * @brief Instance structure for the Q7 FIR filter.
switches 0:5c4d7b2438d3 1080 */
switches 0:5c4d7b2438d3 1081 typedef struct
switches 0:5c4d7b2438d3 1082 {
switches 0:5c4d7b2438d3 1083 uint16_t numTaps; /**< number of filter coefficients in the filter. */
switches 0:5c4d7b2438d3 1084 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 1085 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 1086 } arm_fir_instance_q7;
switches 0:5c4d7b2438d3 1087
switches 0:5c4d7b2438d3 1088 /**
switches 0:5c4d7b2438d3 1089 * @brief Instance structure for the Q15 FIR filter.
switches 0:5c4d7b2438d3 1090 */
switches 0:5c4d7b2438d3 1091 typedef struct
switches 0:5c4d7b2438d3 1092 {
switches 0:5c4d7b2438d3 1093 uint16_t numTaps; /**< number of filter coefficients in the filter. */
switches 0:5c4d7b2438d3 1094 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 1095 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 1096 } arm_fir_instance_q15;
switches 0:5c4d7b2438d3 1097
switches 0:5c4d7b2438d3 1098 /**
switches 0:5c4d7b2438d3 1099 * @brief Instance structure for the Q31 FIR filter.
switches 0:5c4d7b2438d3 1100 */
switches 0:5c4d7b2438d3 1101 typedef struct
switches 0:5c4d7b2438d3 1102 {
switches 0:5c4d7b2438d3 1103 uint16_t numTaps; /**< number of filter coefficients in the filter. */
switches 0:5c4d7b2438d3 1104 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 1105 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 1106 } arm_fir_instance_q31;
switches 0:5c4d7b2438d3 1107
switches 0:5c4d7b2438d3 1108 /**
switches 0:5c4d7b2438d3 1109 * @brief Instance structure for the floating-point FIR filter.
switches 0:5c4d7b2438d3 1110 */
switches 0:5c4d7b2438d3 1111 typedef struct
switches 0:5c4d7b2438d3 1112 {
switches 0:5c4d7b2438d3 1113 uint16_t numTaps; /**< number of filter coefficients in the filter. */
switches 0:5c4d7b2438d3 1114 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 1115 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 1116 } arm_fir_instance_f32;
switches 0:5c4d7b2438d3 1117
switches 0:5c4d7b2438d3 1118
switches 0:5c4d7b2438d3 1119 /**
switches 0:5c4d7b2438d3 1120 * @brief Processing function for the Q7 FIR filter.
switches 0:5c4d7b2438d3 1121 * @param[in] *S points to an instance of the Q7 FIR filter structure.
switches 0:5c4d7b2438d3 1122 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1123 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1124 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1125 * @return none.
switches 0:5c4d7b2438d3 1126 */
switches 0:5c4d7b2438d3 1127 void arm_fir_q7(
switches 0:5c4d7b2438d3 1128 const arm_fir_instance_q7 * S,
switches 0:5c4d7b2438d3 1129 q7_t * pSrc,
switches 0:5c4d7b2438d3 1130 q7_t * pDst,
switches 0:5c4d7b2438d3 1131 uint32_t blockSize);
switches 0:5c4d7b2438d3 1132
switches 0:5c4d7b2438d3 1133
switches 0:5c4d7b2438d3 1134 /**
switches 0:5c4d7b2438d3 1135 * @brief Initialization function for the Q7 FIR filter.
switches 0:5c4d7b2438d3 1136 * @param[in,out] *S points to an instance of the Q7 FIR structure.
switches 0:5c4d7b2438d3 1137 * @param[in] numTaps Number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 1138 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1139 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1140 * @param[in] blockSize number of samples that are processed.
switches 0:5c4d7b2438d3 1141 * @return none
switches 0:5c4d7b2438d3 1142 */
switches 0:5c4d7b2438d3 1143 void arm_fir_init_q7(
switches 0:5c4d7b2438d3 1144 arm_fir_instance_q7 * S,
switches 0:5c4d7b2438d3 1145 uint16_t numTaps,
switches 0:5c4d7b2438d3 1146 q7_t * pCoeffs,
switches 0:5c4d7b2438d3 1147 q7_t * pState,
switches 0:5c4d7b2438d3 1148 uint32_t blockSize);
switches 0:5c4d7b2438d3 1149
switches 0:5c4d7b2438d3 1150
switches 0:5c4d7b2438d3 1151 /**
switches 0:5c4d7b2438d3 1152 * @brief Processing function for the Q15 FIR filter.
switches 0:5c4d7b2438d3 1153 * @param[in] *S points to an instance of the Q15 FIR structure.
switches 0:5c4d7b2438d3 1154 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1155 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1156 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1157 * @return none.
switches 0:5c4d7b2438d3 1158 */
switches 0:5c4d7b2438d3 1159 void arm_fir_q15(
switches 0:5c4d7b2438d3 1160 const arm_fir_instance_q15 * S,
switches 0:5c4d7b2438d3 1161 q15_t * pSrc,
switches 0:5c4d7b2438d3 1162 q15_t * pDst,
switches 0:5c4d7b2438d3 1163 uint32_t blockSize);
switches 0:5c4d7b2438d3 1164
switches 0:5c4d7b2438d3 1165 /**
switches 0:5c4d7b2438d3 1166 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 1167 * @param[in] *S points to an instance of the Q15 FIR filter structure.
switches 0:5c4d7b2438d3 1168 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1169 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1170 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1171 * @return none.
switches 0:5c4d7b2438d3 1172 */
switches 0:5c4d7b2438d3 1173 void arm_fir_fast_q15(
switches 0:5c4d7b2438d3 1174 const arm_fir_instance_q15 * S,
switches 0:5c4d7b2438d3 1175 q15_t * pSrc,
switches 0:5c4d7b2438d3 1176 q15_t * pDst,
switches 0:5c4d7b2438d3 1177 uint32_t blockSize);
switches 0:5c4d7b2438d3 1178
switches 0:5c4d7b2438d3 1179 /**
switches 0:5c4d7b2438d3 1180 * @brief Initialization function for the Q15 FIR filter.
switches 0:5c4d7b2438d3 1181 * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
switches 0:5c4d7b2438d3 1182 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
switches 0:5c4d7b2438d3 1183 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1184 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1185 * @param[in] blockSize number of samples that are processed at a time.
switches 0:5c4d7b2438d3 1186 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
switches 0:5c4d7b2438d3 1187 * <code>numTaps</code> is not a supported value.
switches 0:5c4d7b2438d3 1188 */
switches 0:5c4d7b2438d3 1189
switches 0:5c4d7b2438d3 1190 arm_status arm_fir_init_q15(
switches 0:5c4d7b2438d3 1191 arm_fir_instance_q15 * S,
switches 0:5c4d7b2438d3 1192 uint16_t numTaps,
switches 0:5c4d7b2438d3 1193 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 1194 q15_t * pState,
switches 0:5c4d7b2438d3 1195 uint32_t blockSize);
switches 0:5c4d7b2438d3 1196
switches 0:5c4d7b2438d3 1197 /**
switches 0:5c4d7b2438d3 1198 * @brief Processing function for the Q31 FIR filter.
switches 0:5c4d7b2438d3 1199 * @param[in] *S points to an instance of the Q31 FIR filter structure.
switches 0:5c4d7b2438d3 1200 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1201 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1202 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1203 * @return none.
switches 0:5c4d7b2438d3 1204 */
switches 0:5c4d7b2438d3 1205 void arm_fir_q31(
switches 0:5c4d7b2438d3 1206 const arm_fir_instance_q31 * S,
switches 0:5c4d7b2438d3 1207 q31_t * pSrc,
switches 0:5c4d7b2438d3 1208 q31_t * pDst,
switches 0:5c4d7b2438d3 1209 uint32_t blockSize);
switches 0:5c4d7b2438d3 1210
switches 0:5c4d7b2438d3 1211 /**
switches 0:5c4d7b2438d3 1212 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 1213 * @param[in] *S points to an instance of the Q31 FIR structure.
switches 0:5c4d7b2438d3 1214 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1215 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1216 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1217 * @return none.
switches 0:5c4d7b2438d3 1218 */
switches 0:5c4d7b2438d3 1219 void arm_fir_fast_q31(
switches 0:5c4d7b2438d3 1220 const arm_fir_instance_q31 * S,
switches 0:5c4d7b2438d3 1221 q31_t * pSrc,
switches 0:5c4d7b2438d3 1222 q31_t * pDst,
switches 0:5c4d7b2438d3 1223 uint32_t blockSize);
switches 0:5c4d7b2438d3 1224
switches 0:5c4d7b2438d3 1225 /**
switches 0:5c4d7b2438d3 1226 * @brief Initialization function for the Q31 FIR filter.
switches 0:5c4d7b2438d3 1227 * @param[in,out] *S points to an instance of the Q31 FIR structure.
switches 0:5c4d7b2438d3 1228 * @param[in] numTaps Number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 1229 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1230 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1231 * @param[in] blockSize number of samples that are processed at a time.
switches 0:5c4d7b2438d3 1232 * @return none.
switches 0:5c4d7b2438d3 1233 */
switches 0:5c4d7b2438d3 1234 void arm_fir_init_q31(
switches 0:5c4d7b2438d3 1235 arm_fir_instance_q31 * S,
switches 0:5c4d7b2438d3 1236 uint16_t numTaps,
switches 0:5c4d7b2438d3 1237 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 1238 q31_t * pState,
switches 0:5c4d7b2438d3 1239 uint32_t blockSize);
switches 0:5c4d7b2438d3 1240
switches 0:5c4d7b2438d3 1241 /**
switches 0:5c4d7b2438d3 1242 * @brief Processing function for the floating-point FIR filter.
switches 0:5c4d7b2438d3 1243 * @param[in] *S points to an instance of the floating-point FIR structure.
switches 0:5c4d7b2438d3 1244 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1245 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1246 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1247 * @return none.
switches 0:5c4d7b2438d3 1248 */
switches 0:5c4d7b2438d3 1249 void arm_fir_f32(
switches 0:5c4d7b2438d3 1250 const arm_fir_instance_f32 * S,
switches 0:5c4d7b2438d3 1251 float32_t * pSrc,
switches 0:5c4d7b2438d3 1252 float32_t * pDst,
switches 0:5c4d7b2438d3 1253 uint32_t blockSize);
switches 0:5c4d7b2438d3 1254
switches 0:5c4d7b2438d3 1255 /**
switches 0:5c4d7b2438d3 1256 * @brief Initialization function for the floating-point FIR filter.
switches 0:5c4d7b2438d3 1257 * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
switches 0:5c4d7b2438d3 1258 * @param[in] numTaps Number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 1259 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1260 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1261 * @param[in] blockSize number of samples that are processed at a time.
switches 0:5c4d7b2438d3 1262 * @return none.
switches 0:5c4d7b2438d3 1263 */
switches 0:5c4d7b2438d3 1264 void arm_fir_init_f32(
switches 0:5c4d7b2438d3 1265 arm_fir_instance_f32 * S,
switches 0:5c4d7b2438d3 1266 uint16_t numTaps,
switches 0:5c4d7b2438d3 1267 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 1268 float32_t * pState,
switches 0:5c4d7b2438d3 1269 uint32_t blockSize);
switches 0:5c4d7b2438d3 1270
switches 0:5c4d7b2438d3 1271
switches 0:5c4d7b2438d3 1272 /**
switches 0:5c4d7b2438d3 1273 * @brief Instance structure for the Q15 Biquad cascade filter.
switches 0:5c4d7b2438d3 1274 */
switches 0:5c4d7b2438d3 1275 typedef struct
switches 0:5c4d7b2438d3 1276 {
switches 0:5c4d7b2438d3 1277 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 1278 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
switches 0:5c4d7b2438d3 1279 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 1280 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
switches 0:5c4d7b2438d3 1281
switches 0:5c4d7b2438d3 1282 } arm_biquad_casd_df1_inst_q15;
switches 0:5c4d7b2438d3 1283
switches 0:5c4d7b2438d3 1284
switches 0:5c4d7b2438d3 1285 /**
switches 0:5c4d7b2438d3 1286 * @brief Instance structure for the Q31 Biquad cascade filter.
switches 0:5c4d7b2438d3 1287 */
switches 0:5c4d7b2438d3 1288 typedef struct
switches 0:5c4d7b2438d3 1289 {
switches 0:5c4d7b2438d3 1290 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 1291 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
switches 0:5c4d7b2438d3 1292 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 1293 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
switches 0:5c4d7b2438d3 1294
switches 0:5c4d7b2438d3 1295 } arm_biquad_casd_df1_inst_q31;
switches 0:5c4d7b2438d3 1296
switches 0:5c4d7b2438d3 1297 /**
switches 0:5c4d7b2438d3 1298 * @brief Instance structure for the floating-point Biquad cascade filter.
switches 0:5c4d7b2438d3 1299 */
switches 0:5c4d7b2438d3 1300 typedef struct
switches 0:5c4d7b2438d3 1301 {
switches 0:5c4d7b2438d3 1302 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 1303 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
switches 0:5c4d7b2438d3 1304 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 1305
switches 0:5c4d7b2438d3 1306
switches 0:5c4d7b2438d3 1307 } arm_biquad_casd_df1_inst_f32;
switches 0:5c4d7b2438d3 1308
switches 0:5c4d7b2438d3 1309
switches 0:5c4d7b2438d3 1310
switches 0:5c4d7b2438d3 1311 /**
switches 0:5c4d7b2438d3 1312 * @brief Processing function for the Q15 Biquad cascade filter.
switches 0:5c4d7b2438d3 1313 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
switches 0:5c4d7b2438d3 1314 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1315 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1316 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1317 * @return none.
switches 0:5c4d7b2438d3 1318 */
switches 0:5c4d7b2438d3 1319
switches 0:5c4d7b2438d3 1320 void arm_biquad_cascade_df1_q15(
switches 0:5c4d7b2438d3 1321 const arm_biquad_casd_df1_inst_q15 * S,
switches 0:5c4d7b2438d3 1322 q15_t * pSrc,
switches 0:5c4d7b2438d3 1323 q15_t * pDst,
switches 0:5c4d7b2438d3 1324 uint32_t blockSize);
switches 0:5c4d7b2438d3 1325
switches 0:5c4d7b2438d3 1326 /**
switches 0:5c4d7b2438d3 1327 * @brief Initialization function for the Q15 Biquad cascade filter.
switches 0:5c4d7b2438d3 1328 * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure.
switches 0:5c4d7b2438d3 1329 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 1330 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1331 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1332 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
switches 0:5c4d7b2438d3 1333 * @return none
switches 0:5c4d7b2438d3 1334 */
switches 0:5c4d7b2438d3 1335
switches 0:5c4d7b2438d3 1336 void arm_biquad_cascade_df1_init_q15(
switches 0:5c4d7b2438d3 1337 arm_biquad_casd_df1_inst_q15 * S,
switches 0:5c4d7b2438d3 1338 uint8_t numStages,
switches 0:5c4d7b2438d3 1339 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 1340 q15_t * pState,
switches 0:5c4d7b2438d3 1341 int8_t postShift);
switches 0:5c4d7b2438d3 1342
switches 0:5c4d7b2438d3 1343
switches 0:5c4d7b2438d3 1344 /**
switches 0:5c4d7b2438d3 1345 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 1346 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
switches 0:5c4d7b2438d3 1347 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1348 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1349 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1350 * @return none.
switches 0:5c4d7b2438d3 1351 */
switches 0:5c4d7b2438d3 1352
switches 0:5c4d7b2438d3 1353 void arm_biquad_cascade_df1_fast_q15(
switches 0:5c4d7b2438d3 1354 const arm_biquad_casd_df1_inst_q15 * S,
switches 0:5c4d7b2438d3 1355 q15_t * pSrc,
switches 0:5c4d7b2438d3 1356 q15_t * pDst,
switches 0:5c4d7b2438d3 1357 uint32_t blockSize);
switches 0:5c4d7b2438d3 1358
switches 0:5c4d7b2438d3 1359
switches 0:5c4d7b2438d3 1360 /**
switches 0:5c4d7b2438d3 1361 * @brief Processing function for the Q31 Biquad cascade filter
switches 0:5c4d7b2438d3 1362 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
switches 0:5c4d7b2438d3 1363 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1364 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1365 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1366 * @return none.
switches 0:5c4d7b2438d3 1367 */
switches 0:5c4d7b2438d3 1368
switches 0:5c4d7b2438d3 1369 void arm_biquad_cascade_df1_q31(
switches 0:5c4d7b2438d3 1370 const arm_biquad_casd_df1_inst_q31 * S,
switches 0:5c4d7b2438d3 1371 q31_t * pSrc,
switches 0:5c4d7b2438d3 1372 q31_t * pDst,
switches 0:5c4d7b2438d3 1373 uint32_t blockSize);
switches 0:5c4d7b2438d3 1374
switches 0:5c4d7b2438d3 1375 /**
switches 0:5c4d7b2438d3 1376 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 1377 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
switches 0:5c4d7b2438d3 1378 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1379 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1380 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1381 * @return none.
switches 0:5c4d7b2438d3 1382 */
switches 0:5c4d7b2438d3 1383
switches 0:5c4d7b2438d3 1384 void arm_biquad_cascade_df1_fast_q31(
switches 0:5c4d7b2438d3 1385 const arm_biquad_casd_df1_inst_q31 * S,
switches 0:5c4d7b2438d3 1386 q31_t * pSrc,
switches 0:5c4d7b2438d3 1387 q31_t * pDst,
switches 0:5c4d7b2438d3 1388 uint32_t blockSize);
switches 0:5c4d7b2438d3 1389
switches 0:5c4d7b2438d3 1390 /**
switches 0:5c4d7b2438d3 1391 * @brief Initialization function for the Q31 Biquad cascade filter.
switches 0:5c4d7b2438d3 1392 * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure.
switches 0:5c4d7b2438d3 1393 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 1394 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1395 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1396 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
switches 0:5c4d7b2438d3 1397 * @return none
switches 0:5c4d7b2438d3 1398 */
switches 0:5c4d7b2438d3 1399
switches 0:5c4d7b2438d3 1400 void arm_biquad_cascade_df1_init_q31(
switches 0:5c4d7b2438d3 1401 arm_biquad_casd_df1_inst_q31 * S,
switches 0:5c4d7b2438d3 1402 uint8_t numStages,
switches 0:5c4d7b2438d3 1403 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 1404 q31_t * pState,
switches 0:5c4d7b2438d3 1405 int8_t postShift);
switches 0:5c4d7b2438d3 1406
switches 0:5c4d7b2438d3 1407 /**
switches 0:5c4d7b2438d3 1408 * @brief Processing function for the floating-point Biquad cascade filter.
switches 0:5c4d7b2438d3 1409 * @param[in] *S points to an instance of the floating-point Biquad cascade structure.
switches 0:5c4d7b2438d3 1410 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 1411 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 1412 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 1413 * @return none.
switches 0:5c4d7b2438d3 1414 */
switches 0:5c4d7b2438d3 1415
switches 0:5c4d7b2438d3 1416 void arm_biquad_cascade_df1_f32(
switches 0:5c4d7b2438d3 1417 const arm_biquad_casd_df1_inst_f32 * S,
switches 0:5c4d7b2438d3 1418 float32_t * pSrc,
switches 0:5c4d7b2438d3 1419 float32_t * pDst,
switches 0:5c4d7b2438d3 1420 uint32_t blockSize);
switches 0:5c4d7b2438d3 1421
switches 0:5c4d7b2438d3 1422 /**
switches 0:5c4d7b2438d3 1423 * @brief Initialization function for the floating-point Biquad cascade filter.
switches 0:5c4d7b2438d3 1424 * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure.
switches 0:5c4d7b2438d3 1425 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 1426 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 1427 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 1428 * @return none
switches 0:5c4d7b2438d3 1429 */
switches 0:5c4d7b2438d3 1430
switches 0:5c4d7b2438d3 1431 void arm_biquad_cascade_df1_init_f32(
switches 0:5c4d7b2438d3 1432 arm_biquad_casd_df1_inst_f32 * S,
switches 0:5c4d7b2438d3 1433 uint8_t numStages,
switches 0:5c4d7b2438d3 1434 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 1435 float32_t * pState);
switches 0:5c4d7b2438d3 1436
switches 0:5c4d7b2438d3 1437
switches 0:5c4d7b2438d3 1438 /**
switches 0:5c4d7b2438d3 1439 * @brief Instance structure for the floating-point matrix structure.
switches 0:5c4d7b2438d3 1440 */
switches 0:5c4d7b2438d3 1441
switches 0:5c4d7b2438d3 1442 typedef struct
switches 0:5c4d7b2438d3 1443 {
switches 0:5c4d7b2438d3 1444 uint16_t numRows; /**< number of rows of the matrix. */
switches 0:5c4d7b2438d3 1445 uint16_t numCols; /**< number of columns of the matrix. */
switches 0:5c4d7b2438d3 1446 float32_t *pData; /**< points to the data of the matrix. */
switches 0:5c4d7b2438d3 1447 } arm_matrix_instance_f32;
switches 0:5c4d7b2438d3 1448
switches 0:5c4d7b2438d3 1449
switches 0:5c4d7b2438d3 1450 /**
switches 0:5c4d7b2438d3 1451 * @brief Instance structure for the floating-point matrix structure.
switches 0:5c4d7b2438d3 1452 */
switches 0:5c4d7b2438d3 1453
switches 0:5c4d7b2438d3 1454 typedef struct
switches 0:5c4d7b2438d3 1455 {
switches 0:5c4d7b2438d3 1456 uint16_t numRows; /**< number of rows of the matrix. */
switches 0:5c4d7b2438d3 1457 uint16_t numCols; /**< number of columns of the matrix. */
switches 0:5c4d7b2438d3 1458 float64_t *pData; /**< points to the data of the matrix. */
switches 0:5c4d7b2438d3 1459 } arm_matrix_instance_f64;
switches 0:5c4d7b2438d3 1460
switches 0:5c4d7b2438d3 1461 /**
switches 0:5c4d7b2438d3 1462 * @brief Instance structure for the Q15 matrix structure.
switches 0:5c4d7b2438d3 1463 */
switches 0:5c4d7b2438d3 1464
switches 0:5c4d7b2438d3 1465 typedef struct
switches 0:5c4d7b2438d3 1466 {
switches 0:5c4d7b2438d3 1467 uint16_t numRows; /**< number of rows of the matrix. */
switches 0:5c4d7b2438d3 1468 uint16_t numCols; /**< number of columns of the matrix. */
switches 0:5c4d7b2438d3 1469 q15_t *pData; /**< points to the data of the matrix. */
switches 0:5c4d7b2438d3 1470
switches 0:5c4d7b2438d3 1471 } arm_matrix_instance_q15;
switches 0:5c4d7b2438d3 1472
switches 0:5c4d7b2438d3 1473 /**
switches 0:5c4d7b2438d3 1474 * @brief Instance structure for the Q31 matrix structure.
switches 0:5c4d7b2438d3 1475 */
switches 0:5c4d7b2438d3 1476
switches 0:5c4d7b2438d3 1477 typedef struct
switches 0:5c4d7b2438d3 1478 {
switches 0:5c4d7b2438d3 1479 uint16_t numRows; /**< number of rows of the matrix. */
switches 0:5c4d7b2438d3 1480 uint16_t numCols; /**< number of columns of the matrix. */
switches 0:5c4d7b2438d3 1481 q31_t *pData; /**< points to the data of the matrix. */
switches 0:5c4d7b2438d3 1482
switches 0:5c4d7b2438d3 1483 } arm_matrix_instance_q31;
switches 0:5c4d7b2438d3 1484
switches 0:5c4d7b2438d3 1485
switches 0:5c4d7b2438d3 1486
switches 0:5c4d7b2438d3 1487 /**
switches 0:5c4d7b2438d3 1488 * @brief Floating-point matrix addition.
switches 0:5c4d7b2438d3 1489 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1490 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1491 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1492 * @return The function returns either
switches 0:5c4d7b2438d3 1493 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1494 */
switches 0:5c4d7b2438d3 1495
switches 0:5c4d7b2438d3 1496 arm_status arm_mat_add_f32(
switches 0:5c4d7b2438d3 1497 const arm_matrix_instance_f32 * pSrcA,
switches 0:5c4d7b2438d3 1498 const arm_matrix_instance_f32 * pSrcB,
switches 0:5c4d7b2438d3 1499 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1500
switches 0:5c4d7b2438d3 1501 /**
switches 0:5c4d7b2438d3 1502 * @brief Q15 matrix addition.
switches 0:5c4d7b2438d3 1503 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1504 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1505 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1506 * @return The function returns either
switches 0:5c4d7b2438d3 1507 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1508 */
switches 0:5c4d7b2438d3 1509
switches 0:5c4d7b2438d3 1510 arm_status arm_mat_add_q15(
switches 0:5c4d7b2438d3 1511 const arm_matrix_instance_q15 * pSrcA,
switches 0:5c4d7b2438d3 1512 const arm_matrix_instance_q15 * pSrcB,
switches 0:5c4d7b2438d3 1513 arm_matrix_instance_q15 * pDst);
switches 0:5c4d7b2438d3 1514
switches 0:5c4d7b2438d3 1515 /**
switches 0:5c4d7b2438d3 1516 * @brief Q31 matrix addition.
switches 0:5c4d7b2438d3 1517 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1518 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1519 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1520 * @return The function returns either
switches 0:5c4d7b2438d3 1521 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1522 */
switches 0:5c4d7b2438d3 1523
switches 0:5c4d7b2438d3 1524 arm_status arm_mat_add_q31(
switches 0:5c4d7b2438d3 1525 const arm_matrix_instance_q31 * pSrcA,
switches 0:5c4d7b2438d3 1526 const arm_matrix_instance_q31 * pSrcB,
switches 0:5c4d7b2438d3 1527 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1528
switches 0:5c4d7b2438d3 1529 /**
switches 0:5c4d7b2438d3 1530 * @brief Floating-point, complex, matrix multiplication.
switches 0:5c4d7b2438d3 1531 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1532 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1533 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1534 * @return The function returns either
switches 0:5c4d7b2438d3 1535 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1536 */
switches 0:5c4d7b2438d3 1537
switches 0:5c4d7b2438d3 1538 arm_status arm_mat_cmplx_mult_f32(
switches 0:5c4d7b2438d3 1539 const arm_matrix_instance_f32 * pSrcA,
switches 0:5c4d7b2438d3 1540 const arm_matrix_instance_f32 * pSrcB,
switches 0:5c4d7b2438d3 1541 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1542
switches 0:5c4d7b2438d3 1543 /**
switches 0:5c4d7b2438d3 1544 * @brief Q15, complex, matrix multiplication.
switches 0:5c4d7b2438d3 1545 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1546 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1547 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1548 * @return The function returns either
switches 0:5c4d7b2438d3 1549 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1550 */
switches 0:5c4d7b2438d3 1551
switches 0:5c4d7b2438d3 1552 arm_status arm_mat_cmplx_mult_q15(
switches 0:5c4d7b2438d3 1553 const arm_matrix_instance_q15 * pSrcA,
switches 0:5c4d7b2438d3 1554 const arm_matrix_instance_q15 * pSrcB,
switches 0:5c4d7b2438d3 1555 arm_matrix_instance_q15 * pDst,
switches 0:5c4d7b2438d3 1556 q15_t * pScratch);
switches 0:5c4d7b2438d3 1557
switches 0:5c4d7b2438d3 1558 /**
switches 0:5c4d7b2438d3 1559 * @brief Q31, complex, matrix multiplication.
switches 0:5c4d7b2438d3 1560 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1561 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1562 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1563 * @return The function returns either
switches 0:5c4d7b2438d3 1564 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1565 */
switches 0:5c4d7b2438d3 1566
switches 0:5c4d7b2438d3 1567 arm_status arm_mat_cmplx_mult_q31(
switches 0:5c4d7b2438d3 1568 const arm_matrix_instance_q31 * pSrcA,
switches 0:5c4d7b2438d3 1569 const arm_matrix_instance_q31 * pSrcB,
switches 0:5c4d7b2438d3 1570 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1571
switches 0:5c4d7b2438d3 1572
switches 0:5c4d7b2438d3 1573 /**
switches 0:5c4d7b2438d3 1574 * @brief Floating-point matrix transpose.
switches 0:5c4d7b2438d3 1575 * @param[in] *pSrc points to the input matrix
switches 0:5c4d7b2438d3 1576 * @param[out] *pDst points to the output matrix
switches 0:5c4d7b2438d3 1577 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
switches 0:5c4d7b2438d3 1578 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1579 */
switches 0:5c4d7b2438d3 1580
switches 0:5c4d7b2438d3 1581 arm_status arm_mat_trans_f32(
switches 0:5c4d7b2438d3 1582 const arm_matrix_instance_f32 * pSrc,
switches 0:5c4d7b2438d3 1583 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1584
switches 0:5c4d7b2438d3 1585
switches 0:5c4d7b2438d3 1586 /**
switches 0:5c4d7b2438d3 1587 * @brief Q15 matrix transpose.
switches 0:5c4d7b2438d3 1588 * @param[in] *pSrc points to the input matrix
switches 0:5c4d7b2438d3 1589 * @param[out] *pDst points to the output matrix
switches 0:5c4d7b2438d3 1590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
switches 0:5c4d7b2438d3 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1592 */
switches 0:5c4d7b2438d3 1593
switches 0:5c4d7b2438d3 1594 arm_status arm_mat_trans_q15(
switches 0:5c4d7b2438d3 1595 const arm_matrix_instance_q15 * pSrc,
switches 0:5c4d7b2438d3 1596 arm_matrix_instance_q15 * pDst);
switches 0:5c4d7b2438d3 1597
switches 0:5c4d7b2438d3 1598 /**
switches 0:5c4d7b2438d3 1599 * @brief Q31 matrix transpose.
switches 0:5c4d7b2438d3 1600 * @param[in] *pSrc points to the input matrix
switches 0:5c4d7b2438d3 1601 * @param[out] *pDst points to the output matrix
switches 0:5c4d7b2438d3 1602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
switches 0:5c4d7b2438d3 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1604 */
switches 0:5c4d7b2438d3 1605
switches 0:5c4d7b2438d3 1606 arm_status arm_mat_trans_q31(
switches 0:5c4d7b2438d3 1607 const arm_matrix_instance_q31 * pSrc,
switches 0:5c4d7b2438d3 1608 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1609
switches 0:5c4d7b2438d3 1610
switches 0:5c4d7b2438d3 1611 /**
switches 0:5c4d7b2438d3 1612 * @brief Floating-point matrix multiplication
switches 0:5c4d7b2438d3 1613 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1614 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1615 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1616 * @return The function returns either
switches 0:5c4d7b2438d3 1617 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1618 */
switches 0:5c4d7b2438d3 1619
switches 0:5c4d7b2438d3 1620 arm_status arm_mat_mult_f32(
switches 0:5c4d7b2438d3 1621 const arm_matrix_instance_f32 * pSrcA,
switches 0:5c4d7b2438d3 1622 const arm_matrix_instance_f32 * pSrcB,
switches 0:5c4d7b2438d3 1623 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1624
switches 0:5c4d7b2438d3 1625 /**
switches 0:5c4d7b2438d3 1626 * @brief Q15 matrix multiplication
switches 0:5c4d7b2438d3 1627 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1628 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1629 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1630 * @param[in] *pState points to the array for storing intermediate results
switches 0:5c4d7b2438d3 1631 * @return The function returns either
switches 0:5c4d7b2438d3 1632 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1633 */
switches 0:5c4d7b2438d3 1634
switches 0:5c4d7b2438d3 1635 arm_status arm_mat_mult_q15(
switches 0:5c4d7b2438d3 1636 const arm_matrix_instance_q15 * pSrcA,
switches 0:5c4d7b2438d3 1637 const arm_matrix_instance_q15 * pSrcB,
switches 0:5c4d7b2438d3 1638 arm_matrix_instance_q15 * pDst,
switches 0:5c4d7b2438d3 1639 q15_t * pState);
switches 0:5c4d7b2438d3 1640
switches 0:5c4d7b2438d3 1641 /**
switches 0:5c4d7b2438d3 1642 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 1643 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1644 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1645 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1646 * @param[in] *pState points to the array for storing intermediate results
switches 0:5c4d7b2438d3 1647 * @return The function returns either
switches 0:5c4d7b2438d3 1648 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1649 */
switches 0:5c4d7b2438d3 1650
switches 0:5c4d7b2438d3 1651 arm_status arm_mat_mult_fast_q15(
switches 0:5c4d7b2438d3 1652 const arm_matrix_instance_q15 * pSrcA,
switches 0:5c4d7b2438d3 1653 const arm_matrix_instance_q15 * pSrcB,
switches 0:5c4d7b2438d3 1654 arm_matrix_instance_q15 * pDst,
switches 0:5c4d7b2438d3 1655 q15_t * pState);
switches 0:5c4d7b2438d3 1656
switches 0:5c4d7b2438d3 1657 /**
switches 0:5c4d7b2438d3 1658 * @brief Q31 matrix multiplication
switches 0:5c4d7b2438d3 1659 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1660 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1661 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1662 * @return The function returns either
switches 0:5c4d7b2438d3 1663 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1664 */
switches 0:5c4d7b2438d3 1665
switches 0:5c4d7b2438d3 1666 arm_status arm_mat_mult_q31(
switches 0:5c4d7b2438d3 1667 const arm_matrix_instance_q31 * pSrcA,
switches 0:5c4d7b2438d3 1668 const arm_matrix_instance_q31 * pSrcB,
switches 0:5c4d7b2438d3 1669 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1670
switches 0:5c4d7b2438d3 1671 /**
switches 0:5c4d7b2438d3 1672 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 1673 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1674 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1675 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1676 * @return The function returns either
switches 0:5c4d7b2438d3 1677 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1678 */
switches 0:5c4d7b2438d3 1679
switches 0:5c4d7b2438d3 1680 arm_status arm_mat_mult_fast_q31(
switches 0:5c4d7b2438d3 1681 const arm_matrix_instance_q31 * pSrcA,
switches 0:5c4d7b2438d3 1682 const arm_matrix_instance_q31 * pSrcB,
switches 0:5c4d7b2438d3 1683 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1684
switches 0:5c4d7b2438d3 1685
switches 0:5c4d7b2438d3 1686 /**
switches 0:5c4d7b2438d3 1687 * @brief Floating-point matrix subtraction
switches 0:5c4d7b2438d3 1688 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1689 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1690 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1691 * @return The function returns either
switches 0:5c4d7b2438d3 1692 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1693 */
switches 0:5c4d7b2438d3 1694
switches 0:5c4d7b2438d3 1695 arm_status arm_mat_sub_f32(
switches 0:5c4d7b2438d3 1696 const arm_matrix_instance_f32 * pSrcA,
switches 0:5c4d7b2438d3 1697 const arm_matrix_instance_f32 * pSrcB,
switches 0:5c4d7b2438d3 1698 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1699
switches 0:5c4d7b2438d3 1700 /**
switches 0:5c4d7b2438d3 1701 * @brief Q15 matrix subtraction
switches 0:5c4d7b2438d3 1702 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1703 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1704 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1705 * @return The function returns either
switches 0:5c4d7b2438d3 1706 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1707 */
switches 0:5c4d7b2438d3 1708
switches 0:5c4d7b2438d3 1709 arm_status arm_mat_sub_q15(
switches 0:5c4d7b2438d3 1710 const arm_matrix_instance_q15 * pSrcA,
switches 0:5c4d7b2438d3 1711 const arm_matrix_instance_q15 * pSrcB,
switches 0:5c4d7b2438d3 1712 arm_matrix_instance_q15 * pDst);
switches 0:5c4d7b2438d3 1713
switches 0:5c4d7b2438d3 1714 /**
switches 0:5c4d7b2438d3 1715 * @brief Q31 matrix subtraction
switches 0:5c4d7b2438d3 1716 * @param[in] *pSrcA points to the first input matrix structure
switches 0:5c4d7b2438d3 1717 * @param[in] *pSrcB points to the second input matrix structure
switches 0:5c4d7b2438d3 1718 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1719 * @return The function returns either
switches 0:5c4d7b2438d3 1720 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1721 */
switches 0:5c4d7b2438d3 1722
switches 0:5c4d7b2438d3 1723 arm_status arm_mat_sub_q31(
switches 0:5c4d7b2438d3 1724 const arm_matrix_instance_q31 * pSrcA,
switches 0:5c4d7b2438d3 1725 const arm_matrix_instance_q31 * pSrcB,
switches 0:5c4d7b2438d3 1726 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1727
switches 0:5c4d7b2438d3 1728 /**
switches 0:5c4d7b2438d3 1729 * @brief Floating-point matrix scaling.
switches 0:5c4d7b2438d3 1730 * @param[in] *pSrc points to the input matrix
switches 0:5c4d7b2438d3 1731 * @param[in] scale scale factor
switches 0:5c4d7b2438d3 1732 * @param[out] *pDst points to the output matrix
switches 0:5c4d7b2438d3 1733 * @return The function returns either
switches 0:5c4d7b2438d3 1734 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1735 */
switches 0:5c4d7b2438d3 1736
switches 0:5c4d7b2438d3 1737 arm_status arm_mat_scale_f32(
switches 0:5c4d7b2438d3 1738 const arm_matrix_instance_f32 * pSrc,
switches 0:5c4d7b2438d3 1739 float32_t scale,
switches 0:5c4d7b2438d3 1740 arm_matrix_instance_f32 * pDst);
switches 0:5c4d7b2438d3 1741
switches 0:5c4d7b2438d3 1742 /**
switches 0:5c4d7b2438d3 1743 * @brief Q15 matrix scaling.
switches 0:5c4d7b2438d3 1744 * @param[in] *pSrc points to input matrix
switches 0:5c4d7b2438d3 1745 * @param[in] scaleFract fractional portion of the scale factor
switches 0:5c4d7b2438d3 1746 * @param[in] shift number of bits to shift the result by
switches 0:5c4d7b2438d3 1747 * @param[out] *pDst points to output matrix
switches 0:5c4d7b2438d3 1748 * @return The function returns either
switches 0:5c4d7b2438d3 1749 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1750 */
switches 0:5c4d7b2438d3 1751
switches 0:5c4d7b2438d3 1752 arm_status arm_mat_scale_q15(
switches 0:5c4d7b2438d3 1753 const arm_matrix_instance_q15 * pSrc,
switches 0:5c4d7b2438d3 1754 q15_t scaleFract,
switches 0:5c4d7b2438d3 1755 int32_t shift,
switches 0:5c4d7b2438d3 1756 arm_matrix_instance_q15 * pDst);
switches 0:5c4d7b2438d3 1757
switches 0:5c4d7b2438d3 1758 /**
switches 0:5c4d7b2438d3 1759 * @brief Q31 matrix scaling.
switches 0:5c4d7b2438d3 1760 * @param[in] *pSrc points to input matrix
switches 0:5c4d7b2438d3 1761 * @param[in] scaleFract fractional portion of the scale factor
switches 0:5c4d7b2438d3 1762 * @param[in] shift number of bits to shift the result by
switches 0:5c4d7b2438d3 1763 * @param[out] *pDst points to output matrix structure
switches 0:5c4d7b2438d3 1764 * @return The function returns either
switches 0:5c4d7b2438d3 1765 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
switches 0:5c4d7b2438d3 1766 */
switches 0:5c4d7b2438d3 1767
switches 0:5c4d7b2438d3 1768 arm_status arm_mat_scale_q31(
switches 0:5c4d7b2438d3 1769 const arm_matrix_instance_q31 * pSrc,
switches 0:5c4d7b2438d3 1770 q31_t scaleFract,
switches 0:5c4d7b2438d3 1771 int32_t shift,
switches 0:5c4d7b2438d3 1772 arm_matrix_instance_q31 * pDst);
switches 0:5c4d7b2438d3 1773
switches 0:5c4d7b2438d3 1774
switches 0:5c4d7b2438d3 1775 /**
switches 0:5c4d7b2438d3 1776 * @brief Q31 matrix initialization.
switches 0:5c4d7b2438d3 1777 * @param[in,out] *S points to an instance of the floating-point matrix structure.
switches 0:5c4d7b2438d3 1778 * @param[in] nRows number of rows in the matrix.
switches 0:5c4d7b2438d3 1779 * @param[in] nColumns number of columns in the matrix.
switches 0:5c4d7b2438d3 1780 * @param[in] *pData points to the matrix data array.
switches 0:5c4d7b2438d3 1781 * @return none
switches 0:5c4d7b2438d3 1782 */
switches 0:5c4d7b2438d3 1783
switches 0:5c4d7b2438d3 1784 void arm_mat_init_q31(
switches 0:5c4d7b2438d3 1785 arm_matrix_instance_q31 * S,
switches 0:5c4d7b2438d3 1786 uint16_t nRows,
switches 0:5c4d7b2438d3 1787 uint16_t nColumns,
switches 0:5c4d7b2438d3 1788 q31_t * pData);
switches 0:5c4d7b2438d3 1789
switches 0:5c4d7b2438d3 1790 /**
switches 0:5c4d7b2438d3 1791 * @brief Q15 matrix initialization.
switches 0:5c4d7b2438d3 1792 * @param[in,out] *S points to an instance of the floating-point matrix structure.
switches 0:5c4d7b2438d3 1793 * @param[in] nRows number of rows in the matrix.
switches 0:5c4d7b2438d3 1794 * @param[in] nColumns number of columns in the matrix.
switches 0:5c4d7b2438d3 1795 * @param[in] *pData points to the matrix data array.
switches 0:5c4d7b2438d3 1796 * @return none
switches 0:5c4d7b2438d3 1797 */
switches 0:5c4d7b2438d3 1798
switches 0:5c4d7b2438d3 1799 void arm_mat_init_q15(
switches 0:5c4d7b2438d3 1800 arm_matrix_instance_q15 * S,
switches 0:5c4d7b2438d3 1801 uint16_t nRows,
switches 0:5c4d7b2438d3 1802 uint16_t nColumns,
switches 0:5c4d7b2438d3 1803 q15_t * pData);
switches 0:5c4d7b2438d3 1804
switches 0:5c4d7b2438d3 1805 /**
switches 0:5c4d7b2438d3 1806 * @brief Floating-point matrix initialization.
switches 0:5c4d7b2438d3 1807 * @param[in,out] *S points to an instance of the floating-point matrix structure.
switches 0:5c4d7b2438d3 1808 * @param[in] nRows number of rows in the matrix.
switches 0:5c4d7b2438d3 1809 * @param[in] nColumns number of columns in the matrix.
switches 0:5c4d7b2438d3 1810 * @param[in] *pData points to the matrix data array.
switches 0:5c4d7b2438d3 1811 * @return none
switches 0:5c4d7b2438d3 1812 */
switches 0:5c4d7b2438d3 1813
switches 0:5c4d7b2438d3 1814 void arm_mat_init_f32(
switches 0:5c4d7b2438d3 1815 arm_matrix_instance_f32 * S,
switches 0:5c4d7b2438d3 1816 uint16_t nRows,
switches 0:5c4d7b2438d3 1817 uint16_t nColumns,
switches 0:5c4d7b2438d3 1818 float32_t * pData);
switches 0:5c4d7b2438d3 1819
switches 0:5c4d7b2438d3 1820
switches 0:5c4d7b2438d3 1821
switches 0:5c4d7b2438d3 1822 /**
switches 0:5c4d7b2438d3 1823 * @brief Instance structure for the Q15 PID Control.
switches 0:5c4d7b2438d3 1824 */
switches 0:5c4d7b2438d3 1825 typedef struct
switches 0:5c4d7b2438d3 1826 {
switches 0:5c4d7b2438d3 1827 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
switches 0:5c4d7b2438d3 1828 #ifdef ARM_MATH_CM0_FAMILY
switches 0:5c4d7b2438d3 1829 q15_t A1;
switches 0:5c4d7b2438d3 1830 q15_t A2;
switches 0:5c4d7b2438d3 1831 #else
switches 0:5c4d7b2438d3 1832 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
switches 0:5c4d7b2438d3 1833 #endif
switches 0:5c4d7b2438d3 1834 q15_t state[3]; /**< The state array of length 3. */
switches 0:5c4d7b2438d3 1835 q15_t Kp; /**< The proportional gain. */
switches 0:5c4d7b2438d3 1836 q15_t Ki; /**< The integral gain. */
switches 0:5c4d7b2438d3 1837 q15_t Kd; /**< The derivative gain. */
switches 0:5c4d7b2438d3 1838 } arm_pid_instance_q15;
switches 0:5c4d7b2438d3 1839
switches 0:5c4d7b2438d3 1840 /**
switches 0:5c4d7b2438d3 1841 * @brief Instance structure for the Q31 PID Control.
switches 0:5c4d7b2438d3 1842 */
switches 0:5c4d7b2438d3 1843 typedef struct
switches 0:5c4d7b2438d3 1844 {
switches 0:5c4d7b2438d3 1845 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
switches 0:5c4d7b2438d3 1846 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
switches 0:5c4d7b2438d3 1847 q31_t A2; /**< The derived gain, A2 = Kd . */
switches 0:5c4d7b2438d3 1848 q31_t state[3]; /**< The state array of length 3. */
switches 0:5c4d7b2438d3 1849 q31_t Kp; /**< The proportional gain. */
switches 0:5c4d7b2438d3 1850 q31_t Ki; /**< The integral gain. */
switches 0:5c4d7b2438d3 1851 q31_t Kd; /**< The derivative gain. */
switches 0:5c4d7b2438d3 1852
switches 0:5c4d7b2438d3 1853 } arm_pid_instance_q31;
switches 0:5c4d7b2438d3 1854
switches 0:5c4d7b2438d3 1855 /**
switches 0:5c4d7b2438d3 1856 * @brief Instance structure for the floating-point PID Control.
switches 0:5c4d7b2438d3 1857 */
switches 0:5c4d7b2438d3 1858 typedef struct
switches 0:5c4d7b2438d3 1859 {
switches 0:5c4d7b2438d3 1860 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
switches 0:5c4d7b2438d3 1861 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
switches 0:5c4d7b2438d3 1862 float32_t A2; /**< The derived gain, A2 = Kd . */
switches 0:5c4d7b2438d3 1863 float32_t state[3]; /**< The state array of length 3. */
switches 0:5c4d7b2438d3 1864 float32_t Kp; /**< The proportional gain. */
switches 0:5c4d7b2438d3 1865 float32_t Ki; /**< The integral gain. */
switches 0:5c4d7b2438d3 1866 float32_t Kd; /**< The derivative gain. */
switches 0:5c4d7b2438d3 1867 } arm_pid_instance_f32;
switches 0:5c4d7b2438d3 1868
switches 0:5c4d7b2438d3 1869
switches 0:5c4d7b2438d3 1870
switches 0:5c4d7b2438d3 1871 /**
switches 0:5c4d7b2438d3 1872 * @brief Initialization function for the floating-point PID Control.
switches 0:5c4d7b2438d3 1873 * @param[in,out] *S points to an instance of the PID structure.
switches 0:5c4d7b2438d3 1874 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
switches 0:5c4d7b2438d3 1875 * @return none.
switches 0:5c4d7b2438d3 1876 */
switches 0:5c4d7b2438d3 1877 void arm_pid_init_f32(
switches 0:5c4d7b2438d3 1878 arm_pid_instance_f32 * S,
switches 0:5c4d7b2438d3 1879 int32_t resetStateFlag);
switches 0:5c4d7b2438d3 1880
switches 0:5c4d7b2438d3 1881 /**
switches 0:5c4d7b2438d3 1882 * @brief Reset function for the floating-point PID Control.
switches 0:5c4d7b2438d3 1883 * @param[in,out] *S is an instance of the floating-point PID Control structure
switches 0:5c4d7b2438d3 1884 * @return none
switches 0:5c4d7b2438d3 1885 */
switches 0:5c4d7b2438d3 1886 void arm_pid_reset_f32(
switches 0:5c4d7b2438d3 1887 arm_pid_instance_f32 * S);
switches 0:5c4d7b2438d3 1888
switches 0:5c4d7b2438d3 1889
switches 0:5c4d7b2438d3 1890 /**
switches 0:5c4d7b2438d3 1891 * @brief Initialization function for the Q31 PID Control.
switches 0:5c4d7b2438d3 1892 * @param[in,out] *S points to an instance of the Q15 PID structure.
switches 0:5c4d7b2438d3 1893 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
switches 0:5c4d7b2438d3 1894 * @return none.
switches 0:5c4d7b2438d3 1895 */
switches 0:5c4d7b2438d3 1896 void arm_pid_init_q31(
switches 0:5c4d7b2438d3 1897 arm_pid_instance_q31 * S,
switches 0:5c4d7b2438d3 1898 int32_t resetStateFlag);
switches 0:5c4d7b2438d3 1899
switches 0:5c4d7b2438d3 1900
switches 0:5c4d7b2438d3 1901 /**
switches 0:5c4d7b2438d3 1902 * @brief Reset function for the Q31 PID Control.
switches 0:5c4d7b2438d3 1903 * @param[in,out] *S points to an instance of the Q31 PID Control structure
switches 0:5c4d7b2438d3 1904 * @return none
switches 0:5c4d7b2438d3 1905 */
switches 0:5c4d7b2438d3 1906
switches 0:5c4d7b2438d3 1907 void arm_pid_reset_q31(
switches 0:5c4d7b2438d3 1908 arm_pid_instance_q31 * S);
switches 0:5c4d7b2438d3 1909
switches 0:5c4d7b2438d3 1910 /**
switches 0:5c4d7b2438d3 1911 * @brief Initialization function for the Q15 PID Control.
switches 0:5c4d7b2438d3 1912 * @param[in,out] *S points to an instance of the Q15 PID structure.
switches 0:5c4d7b2438d3 1913 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
switches 0:5c4d7b2438d3 1914 * @return none.
switches 0:5c4d7b2438d3 1915 */
switches 0:5c4d7b2438d3 1916 void arm_pid_init_q15(
switches 0:5c4d7b2438d3 1917 arm_pid_instance_q15 * S,
switches 0:5c4d7b2438d3 1918 int32_t resetStateFlag);
switches 0:5c4d7b2438d3 1919
switches 0:5c4d7b2438d3 1920 /**
switches 0:5c4d7b2438d3 1921 * @brief Reset function for the Q15 PID Control.
switches 0:5c4d7b2438d3 1922 * @param[in,out] *S points to an instance of the q15 PID Control structure
switches 0:5c4d7b2438d3 1923 * @return none
switches 0:5c4d7b2438d3 1924 */
switches 0:5c4d7b2438d3 1925 void arm_pid_reset_q15(
switches 0:5c4d7b2438d3 1926 arm_pid_instance_q15 * S);
switches 0:5c4d7b2438d3 1927
switches 0:5c4d7b2438d3 1928
switches 0:5c4d7b2438d3 1929 /**
switches 0:5c4d7b2438d3 1930 * @brief Instance structure for the floating-point Linear Interpolate function.
switches 0:5c4d7b2438d3 1931 */
switches 0:5c4d7b2438d3 1932 typedef struct
switches 0:5c4d7b2438d3 1933 {
switches 0:5c4d7b2438d3 1934 uint32_t nValues; /**< nValues */
switches 0:5c4d7b2438d3 1935 float32_t x1; /**< x1 */
switches 0:5c4d7b2438d3 1936 float32_t xSpacing; /**< xSpacing */
switches 0:5c4d7b2438d3 1937 float32_t *pYData; /**< pointer to the table of Y values */
switches 0:5c4d7b2438d3 1938 } arm_linear_interp_instance_f32;
switches 0:5c4d7b2438d3 1939
switches 0:5c4d7b2438d3 1940 /**
switches 0:5c4d7b2438d3 1941 * @brief Instance structure for the floating-point bilinear interpolation function.
switches 0:5c4d7b2438d3 1942 */
switches 0:5c4d7b2438d3 1943
switches 0:5c4d7b2438d3 1944 typedef struct
switches 0:5c4d7b2438d3 1945 {
switches 0:5c4d7b2438d3 1946 uint16_t numRows; /**< number of rows in the data table. */
switches 0:5c4d7b2438d3 1947 uint16_t numCols; /**< number of columns in the data table. */
switches 0:5c4d7b2438d3 1948 float32_t *pData; /**< points to the data table. */
switches 0:5c4d7b2438d3 1949 } arm_bilinear_interp_instance_f32;
switches 0:5c4d7b2438d3 1950
switches 0:5c4d7b2438d3 1951 /**
switches 0:5c4d7b2438d3 1952 * @brief Instance structure for the Q31 bilinear interpolation function.
switches 0:5c4d7b2438d3 1953 */
switches 0:5c4d7b2438d3 1954
switches 0:5c4d7b2438d3 1955 typedef struct
switches 0:5c4d7b2438d3 1956 {
switches 0:5c4d7b2438d3 1957 uint16_t numRows; /**< number of rows in the data table. */
switches 0:5c4d7b2438d3 1958 uint16_t numCols; /**< number of columns in the data table. */
switches 0:5c4d7b2438d3 1959 q31_t *pData; /**< points to the data table. */
switches 0:5c4d7b2438d3 1960 } arm_bilinear_interp_instance_q31;
switches 0:5c4d7b2438d3 1961
switches 0:5c4d7b2438d3 1962 /**
switches 0:5c4d7b2438d3 1963 * @brief Instance structure for the Q15 bilinear interpolation function.
switches 0:5c4d7b2438d3 1964 */
switches 0:5c4d7b2438d3 1965
switches 0:5c4d7b2438d3 1966 typedef struct
switches 0:5c4d7b2438d3 1967 {
switches 0:5c4d7b2438d3 1968 uint16_t numRows; /**< number of rows in the data table. */
switches 0:5c4d7b2438d3 1969 uint16_t numCols; /**< number of columns in the data table. */
switches 0:5c4d7b2438d3 1970 q15_t *pData; /**< points to the data table. */
switches 0:5c4d7b2438d3 1971 } arm_bilinear_interp_instance_q15;
switches 0:5c4d7b2438d3 1972
switches 0:5c4d7b2438d3 1973 /**
switches 0:5c4d7b2438d3 1974 * @brief Instance structure for the Q15 bilinear interpolation function.
switches 0:5c4d7b2438d3 1975 */
switches 0:5c4d7b2438d3 1976
switches 0:5c4d7b2438d3 1977 typedef struct
switches 0:5c4d7b2438d3 1978 {
switches 0:5c4d7b2438d3 1979 uint16_t numRows; /**< number of rows in the data table. */
switches 0:5c4d7b2438d3 1980 uint16_t numCols; /**< number of columns in the data table. */
switches 0:5c4d7b2438d3 1981 q7_t *pData; /**< points to the data table. */
switches 0:5c4d7b2438d3 1982 } arm_bilinear_interp_instance_q7;
switches 0:5c4d7b2438d3 1983
switches 0:5c4d7b2438d3 1984
switches 0:5c4d7b2438d3 1985 /**
switches 0:5c4d7b2438d3 1986 * @brief Q7 vector multiplication.
switches 0:5c4d7b2438d3 1987 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 1988 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 1989 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 1990 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 1991 * @return none.
switches 0:5c4d7b2438d3 1992 */
switches 0:5c4d7b2438d3 1993
switches 0:5c4d7b2438d3 1994 void arm_mult_q7(
switches 0:5c4d7b2438d3 1995 q7_t * pSrcA,
switches 0:5c4d7b2438d3 1996 q7_t * pSrcB,
switches 0:5c4d7b2438d3 1997 q7_t * pDst,
switches 0:5c4d7b2438d3 1998 uint32_t blockSize);
switches 0:5c4d7b2438d3 1999
switches 0:5c4d7b2438d3 2000 /**
switches 0:5c4d7b2438d3 2001 * @brief Q15 vector multiplication.
switches 0:5c4d7b2438d3 2002 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2003 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2004 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2005 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2006 * @return none.
switches 0:5c4d7b2438d3 2007 */
switches 0:5c4d7b2438d3 2008
switches 0:5c4d7b2438d3 2009 void arm_mult_q15(
switches 0:5c4d7b2438d3 2010 q15_t * pSrcA,
switches 0:5c4d7b2438d3 2011 q15_t * pSrcB,
switches 0:5c4d7b2438d3 2012 q15_t * pDst,
switches 0:5c4d7b2438d3 2013 uint32_t blockSize);
switches 0:5c4d7b2438d3 2014
switches 0:5c4d7b2438d3 2015 /**
switches 0:5c4d7b2438d3 2016 * @brief Q31 vector multiplication.
switches 0:5c4d7b2438d3 2017 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2018 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2019 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2020 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2021 * @return none.
switches 0:5c4d7b2438d3 2022 */
switches 0:5c4d7b2438d3 2023
switches 0:5c4d7b2438d3 2024 void arm_mult_q31(
switches 0:5c4d7b2438d3 2025 q31_t * pSrcA,
switches 0:5c4d7b2438d3 2026 q31_t * pSrcB,
switches 0:5c4d7b2438d3 2027 q31_t * pDst,
switches 0:5c4d7b2438d3 2028 uint32_t blockSize);
switches 0:5c4d7b2438d3 2029
switches 0:5c4d7b2438d3 2030 /**
switches 0:5c4d7b2438d3 2031 * @brief Floating-point vector multiplication.
switches 0:5c4d7b2438d3 2032 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2033 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2034 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2035 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2036 * @return none.
switches 0:5c4d7b2438d3 2037 */
switches 0:5c4d7b2438d3 2038
switches 0:5c4d7b2438d3 2039 void arm_mult_f32(
switches 0:5c4d7b2438d3 2040 float32_t * pSrcA,
switches 0:5c4d7b2438d3 2041 float32_t * pSrcB,
switches 0:5c4d7b2438d3 2042 float32_t * pDst,
switches 0:5c4d7b2438d3 2043 uint32_t blockSize);
switches 0:5c4d7b2438d3 2044
switches 0:5c4d7b2438d3 2045
switches 0:5c4d7b2438d3 2046
switches 0:5c4d7b2438d3 2047
switches 0:5c4d7b2438d3 2048
switches 0:5c4d7b2438d3 2049
switches 0:5c4d7b2438d3 2050 /**
switches 0:5c4d7b2438d3 2051 * @brief Instance structure for the Q15 CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2052 */
switches 0:5c4d7b2438d3 2053
switches 0:5c4d7b2438d3 2054 typedef struct
switches 0:5c4d7b2438d3 2055 {
switches 0:5c4d7b2438d3 2056 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2057 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2058 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2059 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
switches 0:5c4d7b2438d3 2060 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2061 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2062 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2063 } arm_cfft_radix2_instance_q15;
switches 0:5c4d7b2438d3 2064
switches 0:5c4d7b2438d3 2065 /* Deprecated */
switches 0:5c4d7b2438d3 2066 arm_status arm_cfft_radix2_init_q15(
switches 0:5c4d7b2438d3 2067 arm_cfft_radix2_instance_q15 * S,
switches 0:5c4d7b2438d3 2068 uint16_t fftLen,
switches 0:5c4d7b2438d3 2069 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2070 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2071
switches 0:5c4d7b2438d3 2072 /* Deprecated */
switches 0:5c4d7b2438d3 2073 void arm_cfft_radix2_q15(
switches 0:5c4d7b2438d3 2074 const arm_cfft_radix2_instance_q15 * S,
switches 0:5c4d7b2438d3 2075 q15_t * pSrc);
switches 0:5c4d7b2438d3 2076
switches 0:5c4d7b2438d3 2077
switches 0:5c4d7b2438d3 2078
switches 0:5c4d7b2438d3 2079 /**
switches 0:5c4d7b2438d3 2080 * @brief Instance structure for the Q15 CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2081 */
switches 0:5c4d7b2438d3 2082
switches 0:5c4d7b2438d3 2083 typedef struct
switches 0:5c4d7b2438d3 2084 {
switches 0:5c4d7b2438d3 2085 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2086 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2087 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2088 q15_t *pTwiddle; /**< points to the twiddle factor table. */
switches 0:5c4d7b2438d3 2089 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2090 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2091 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2092 } arm_cfft_radix4_instance_q15;
switches 0:5c4d7b2438d3 2093
switches 0:5c4d7b2438d3 2094 /* Deprecated */
switches 0:5c4d7b2438d3 2095 arm_status arm_cfft_radix4_init_q15(
switches 0:5c4d7b2438d3 2096 arm_cfft_radix4_instance_q15 * S,
switches 0:5c4d7b2438d3 2097 uint16_t fftLen,
switches 0:5c4d7b2438d3 2098 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2099 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2100
switches 0:5c4d7b2438d3 2101 /* Deprecated */
switches 0:5c4d7b2438d3 2102 void arm_cfft_radix4_q15(
switches 0:5c4d7b2438d3 2103 const arm_cfft_radix4_instance_q15 * S,
switches 0:5c4d7b2438d3 2104 q15_t * pSrc);
switches 0:5c4d7b2438d3 2105
switches 0:5c4d7b2438d3 2106 /**
switches 0:5c4d7b2438d3 2107 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2108 */
switches 0:5c4d7b2438d3 2109
switches 0:5c4d7b2438d3 2110 typedef struct
switches 0:5c4d7b2438d3 2111 {
switches 0:5c4d7b2438d3 2112 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2113 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2114 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2115 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2116 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2117 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2118 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2119 } arm_cfft_radix2_instance_q31;
switches 0:5c4d7b2438d3 2120
switches 0:5c4d7b2438d3 2121 /* Deprecated */
switches 0:5c4d7b2438d3 2122 arm_status arm_cfft_radix2_init_q31(
switches 0:5c4d7b2438d3 2123 arm_cfft_radix2_instance_q31 * S,
switches 0:5c4d7b2438d3 2124 uint16_t fftLen,
switches 0:5c4d7b2438d3 2125 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2126 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2127
switches 0:5c4d7b2438d3 2128 /* Deprecated */
switches 0:5c4d7b2438d3 2129 void arm_cfft_radix2_q31(
switches 0:5c4d7b2438d3 2130 const arm_cfft_radix2_instance_q31 * S,
switches 0:5c4d7b2438d3 2131 q31_t * pSrc);
switches 0:5c4d7b2438d3 2132
switches 0:5c4d7b2438d3 2133 /**
switches 0:5c4d7b2438d3 2134 * @brief Instance structure for the Q31 CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2135 */
switches 0:5c4d7b2438d3 2136
switches 0:5c4d7b2438d3 2137 typedef struct
switches 0:5c4d7b2438d3 2138 {
switches 0:5c4d7b2438d3 2139 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2140 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2141 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2142 q31_t *pTwiddle; /**< points to the twiddle factor table. */
switches 0:5c4d7b2438d3 2143 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2144 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2145 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2146 } arm_cfft_radix4_instance_q31;
switches 0:5c4d7b2438d3 2147
switches 0:5c4d7b2438d3 2148 /* Deprecated */
switches 0:5c4d7b2438d3 2149 void arm_cfft_radix4_q31(
switches 0:5c4d7b2438d3 2150 const arm_cfft_radix4_instance_q31 * S,
switches 0:5c4d7b2438d3 2151 q31_t * pSrc);
switches 0:5c4d7b2438d3 2152
switches 0:5c4d7b2438d3 2153 /* Deprecated */
switches 0:5c4d7b2438d3 2154 arm_status arm_cfft_radix4_init_q31(
switches 0:5c4d7b2438d3 2155 arm_cfft_radix4_instance_q31 * S,
switches 0:5c4d7b2438d3 2156 uint16_t fftLen,
switches 0:5c4d7b2438d3 2157 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2158 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2159
switches 0:5c4d7b2438d3 2160 /**
switches 0:5c4d7b2438d3 2161 * @brief Instance structure for the floating-point CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2162 */
switches 0:5c4d7b2438d3 2163
switches 0:5c4d7b2438d3 2164 typedef struct
switches 0:5c4d7b2438d3 2165 {
switches 0:5c4d7b2438d3 2166 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2167 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2168 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2169 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2170 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2171 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2172 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2173 float32_t onebyfftLen; /**< value of 1/fftLen. */
switches 0:5c4d7b2438d3 2174 } arm_cfft_radix2_instance_f32;
switches 0:5c4d7b2438d3 2175
switches 0:5c4d7b2438d3 2176 /* Deprecated */
switches 0:5c4d7b2438d3 2177 arm_status arm_cfft_radix2_init_f32(
switches 0:5c4d7b2438d3 2178 arm_cfft_radix2_instance_f32 * S,
switches 0:5c4d7b2438d3 2179 uint16_t fftLen,
switches 0:5c4d7b2438d3 2180 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2181 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2182
switches 0:5c4d7b2438d3 2183 /* Deprecated */
switches 0:5c4d7b2438d3 2184 void arm_cfft_radix2_f32(
switches 0:5c4d7b2438d3 2185 const arm_cfft_radix2_instance_f32 * S,
switches 0:5c4d7b2438d3 2186 float32_t * pSrc);
switches 0:5c4d7b2438d3 2187
switches 0:5c4d7b2438d3 2188 /**
switches 0:5c4d7b2438d3 2189 * @brief Instance structure for the floating-point CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2190 */
switches 0:5c4d7b2438d3 2191
switches 0:5c4d7b2438d3 2192 typedef struct
switches 0:5c4d7b2438d3 2193 {
switches 0:5c4d7b2438d3 2194 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2195 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
switches 0:5c4d7b2438d3 2196 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2197 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2198 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2199 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2200 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
switches 0:5c4d7b2438d3 2201 float32_t onebyfftLen; /**< value of 1/fftLen. */
switches 0:5c4d7b2438d3 2202 } arm_cfft_radix4_instance_f32;
switches 0:5c4d7b2438d3 2203
switches 0:5c4d7b2438d3 2204 /* Deprecated */
switches 0:5c4d7b2438d3 2205 arm_status arm_cfft_radix4_init_f32(
switches 0:5c4d7b2438d3 2206 arm_cfft_radix4_instance_f32 * S,
switches 0:5c4d7b2438d3 2207 uint16_t fftLen,
switches 0:5c4d7b2438d3 2208 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2209 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2210
switches 0:5c4d7b2438d3 2211 /* Deprecated */
switches 0:5c4d7b2438d3 2212 void arm_cfft_radix4_f32(
switches 0:5c4d7b2438d3 2213 const arm_cfft_radix4_instance_f32 * S,
switches 0:5c4d7b2438d3 2214 float32_t * pSrc);
switches 0:5c4d7b2438d3 2215
switches 0:5c4d7b2438d3 2216 /**
switches 0:5c4d7b2438d3 2217 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2218 */
switches 0:5c4d7b2438d3 2219
switches 0:5c4d7b2438d3 2220 typedef struct
switches 0:5c4d7b2438d3 2221 {
switches 0:5c4d7b2438d3 2222 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2223 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2224 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2225 uint16_t bitRevLength; /**< bit reversal table length. */
switches 0:5c4d7b2438d3 2226 } arm_cfft_instance_q15;
switches 0:5c4d7b2438d3 2227
switches 0:5c4d7b2438d3 2228 void arm_cfft_q15(
switches 0:5c4d7b2438d3 2229 const arm_cfft_instance_q15 * S,
switches 0:5c4d7b2438d3 2230 q15_t * p1,
switches 0:5c4d7b2438d3 2231 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2232 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2233
switches 0:5c4d7b2438d3 2234 /**
switches 0:5c4d7b2438d3 2235 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2236 */
switches 0:5c4d7b2438d3 2237
switches 0:5c4d7b2438d3 2238 typedef struct
switches 0:5c4d7b2438d3 2239 {
switches 0:5c4d7b2438d3 2240 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2241 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2242 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2243 uint16_t bitRevLength; /**< bit reversal table length. */
switches 0:5c4d7b2438d3 2244 } arm_cfft_instance_q31;
switches 0:5c4d7b2438d3 2245
switches 0:5c4d7b2438d3 2246 void arm_cfft_q31(
switches 0:5c4d7b2438d3 2247 const arm_cfft_instance_q31 * S,
switches 0:5c4d7b2438d3 2248 q31_t * p1,
switches 0:5c4d7b2438d3 2249 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2250 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2251
switches 0:5c4d7b2438d3 2252 /**
switches 0:5c4d7b2438d3 2253 * @brief Instance structure for the floating-point CFFT/CIFFT function.
switches 0:5c4d7b2438d3 2254 */
switches 0:5c4d7b2438d3 2255
switches 0:5c4d7b2438d3 2256 typedef struct
switches 0:5c4d7b2438d3 2257 {
switches 0:5c4d7b2438d3 2258 uint16_t fftLen; /**< length of the FFT. */
switches 0:5c4d7b2438d3 2259 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
switches 0:5c4d7b2438d3 2260 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
switches 0:5c4d7b2438d3 2261 uint16_t bitRevLength; /**< bit reversal table length. */
switches 0:5c4d7b2438d3 2262 } arm_cfft_instance_f32;
switches 0:5c4d7b2438d3 2263
switches 0:5c4d7b2438d3 2264 void arm_cfft_f32(
switches 0:5c4d7b2438d3 2265 const arm_cfft_instance_f32 * S,
switches 0:5c4d7b2438d3 2266 float32_t * p1,
switches 0:5c4d7b2438d3 2267 uint8_t ifftFlag,
switches 0:5c4d7b2438d3 2268 uint8_t bitReverseFlag);
switches 0:5c4d7b2438d3 2269
switches 0:5c4d7b2438d3 2270 /**
switches 0:5c4d7b2438d3 2271 * @brief Instance structure for the Q15 RFFT/RIFFT function.
switches 0:5c4d7b2438d3 2272 */
switches 0:5c4d7b2438d3 2273
switches 0:5c4d7b2438d3 2274 typedef struct
switches 0:5c4d7b2438d3 2275 {
switches 0:5c4d7b2438d3 2276 uint32_t fftLenReal; /**< length of the real FFT. */
switches 0:5c4d7b2438d3 2277 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
switches 0:5c4d7b2438d3 2278 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2279 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2280 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
switches 0:5c4d7b2438d3 2281 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
switches 0:5c4d7b2438d3 2282 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2283 } arm_rfft_instance_q15;
switches 0:5c4d7b2438d3 2284
switches 0:5c4d7b2438d3 2285 arm_status arm_rfft_init_q15(
switches 0:5c4d7b2438d3 2286 arm_rfft_instance_q15 * S,
switches 0:5c4d7b2438d3 2287 uint32_t fftLenReal,
switches 0:5c4d7b2438d3 2288 uint32_t ifftFlagR,
switches 0:5c4d7b2438d3 2289 uint32_t bitReverseFlag);
switches 0:5c4d7b2438d3 2290
switches 0:5c4d7b2438d3 2291 void arm_rfft_q15(
switches 0:5c4d7b2438d3 2292 const arm_rfft_instance_q15 * S,
switches 0:5c4d7b2438d3 2293 q15_t * pSrc,
switches 0:5c4d7b2438d3 2294 q15_t * pDst);
switches 0:5c4d7b2438d3 2295
switches 0:5c4d7b2438d3 2296 /**
switches 0:5c4d7b2438d3 2297 * @brief Instance structure for the Q31 RFFT/RIFFT function.
switches 0:5c4d7b2438d3 2298 */
switches 0:5c4d7b2438d3 2299
switches 0:5c4d7b2438d3 2300 typedef struct
switches 0:5c4d7b2438d3 2301 {
switches 0:5c4d7b2438d3 2302 uint32_t fftLenReal; /**< length of the real FFT. */
switches 0:5c4d7b2438d3 2303 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
switches 0:5c4d7b2438d3 2304 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2305 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2306 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
switches 0:5c4d7b2438d3 2307 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
switches 0:5c4d7b2438d3 2308 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2309 } arm_rfft_instance_q31;
switches 0:5c4d7b2438d3 2310
switches 0:5c4d7b2438d3 2311 arm_status arm_rfft_init_q31(
switches 0:5c4d7b2438d3 2312 arm_rfft_instance_q31 * S,
switches 0:5c4d7b2438d3 2313 uint32_t fftLenReal,
switches 0:5c4d7b2438d3 2314 uint32_t ifftFlagR,
switches 0:5c4d7b2438d3 2315 uint32_t bitReverseFlag);
switches 0:5c4d7b2438d3 2316
switches 0:5c4d7b2438d3 2317 void arm_rfft_q31(
switches 0:5c4d7b2438d3 2318 const arm_rfft_instance_q31 * S,
switches 0:5c4d7b2438d3 2319 q31_t * pSrc,
switches 0:5c4d7b2438d3 2320 q31_t * pDst);
switches 0:5c4d7b2438d3 2321
switches 0:5c4d7b2438d3 2322 /**
switches 0:5c4d7b2438d3 2323 * @brief Instance structure for the floating-point RFFT/RIFFT function.
switches 0:5c4d7b2438d3 2324 */
switches 0:5c4d7b2438d3 2325
switches 0:5c4d7b2438d3 2326 typedef struct
switches 0:5c4d7b2438d3 2327 {
switches 0:5c4d7b2438d3 2328 uint32_t fftLenReal; /**< length of the real FFT. */
switches 0:5c4d7b2438d3 2329 uint16_t fftLenBy2; /**< length of the complex FFT. */
switches 0:5c4d7b2438d3 2330 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
switches 0:5c4d7b2438d3 2331 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
switches 0:5c4d7b2438d3 2332 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
switches 0:5c4d7b2438d3 2333 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
switches 0:5c4d7b2438d3 2334 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
switches 0:5c4d7b2438d3 2335 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2336 } arm_rfft_instance_f32;
switches 0:5c4d7b2438d3 2337
switches 0:5c4d7b2438d3 2338 arm_status arm_rfft_init_f32(
switches 0:5c4d7b2438d3 2339 arm_rfft_instance_f32 * S,
switches 0:5c4d7b2438d3 2340 arm_cfft_radix4_instance_f32 * S_CFFT,
switches 0:5c4d7b2438d3 2341 uint32_t fftLenReal,
switches 0:5c4d7b2438d3 2342 uint32_t ifftFlagR,
switches 0:5c4d7b2438d3 2343 uint32_t bitReverseFlag);
switches 0:5c4d7b2438d3 2344
switches 0:5c4d7b2438d3 2345 void arm_rfft_f32(
switches 0:5c4d7b2438d3 2346 const arm_rfft_instance_f32 * S,
switches 0:5c4d7b2438d3 2347 float32_t * pSrc,
switches 0:5c4d7b2438d3 2348 float32_t * pDst);
switches 0:5c4d7b2438d3 2349
switches 0:5c4d7b2438d3 2350 /**
switches 0:5c4d7b2438d3 2351 * @brief Instance structure for the floating-point RFFT/RIFFT function.
switches 0:5c4d7b2438d3 2352 */
switches 0:5c4d7b2438d3 2353
switches 0:5c4d7b2438d3 2354 typedef struct
switches 0:5c4d7b2438d3 2355 {
switches 0:5c4d7b2438d3 2356 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
switches 0:5c4d7b2438d3 2357 uint16_t fftLenRFFT; /**< length of the real sequence */
switches 0:5c4d7b2438d3 2358 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
switches 0:5c4d7b2438d3 2359 } arm_rfft_fast_instance_f32 ;
switches 0:5c4d7b2438d3 2360
switches 0:5c4d7b2438d3 2361 arm_status arm_rfft_fast_init_f32 (
switches 0:5c4d7b2438d3 2362 arm_rfft_fast_instance_f32 * S,
switches 0:5c4d7b2438d3 2363 uint16_t fftLen);
switches 0:5c4d7b2438d3 2364
switches 0:5c4d7b2438d3 2365 void arm_rfft_fast_f32(
switches 0:5c4d7b2438d3 2366 arm_rfft_fast_instance_f32 * S,
switches 0:5c4d7b2438d3 2367 float32_t * p, float32_t * pOut,
switches 0:5c4d7b2438d3 2368 uint8_t ifftFlag);
switches 0:5c4d7b2438d3 2369
switches 0:5c4d7b2438d3 2370 /**
switches 0:5c4d7b2438d3 2371 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
switches 0:5c4d7b2438d3 2372 */
switches 0:5c4d7b2438d3 2373
switches 0:5c4d7b2438d3 2374 typedef struct
switches 0:5c4d7b2438d3 2375 {
switches 0:5c4d7b2438d3 2376 uint16_t N; /**< length of the DCT4. */
switches 0:5c4d7b2438d3 2377 uint16_t Nby2; /**< half of the length of the DCT4. */
switches 0:5c4d7b2438d3 2378 float32_t normalize; /**< normalizing factor. */
switches 0:5c4d7b2438d3 2379 float32_t *pTwiddle; /**< points to the twiddle factor table. */
switches 0:5c4d7b2438d3 2380 float32_t *pCosFactor; /**< points to the cosFactor table. */
switches 0:5c4d7b2438d3 2381 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
switches 0:5c4d7b2438d3 2382 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2383 } arm_dct4_instance_f32;
switches 0:5c4d7b2438d3 2384
switches 0:5c4d7b2438d3 2385 /**
switches 0:5c4d7b2438d3 2386 * @brief Initialization function for the floating-point DCT4/IDCT4.
switches 0:5c4d7b2438d3 2387 * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure.
switches 0:5c4d7b2438d3 2388 * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
switches 0:5c4d7b2438d3 2389 * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
switches 0:5c4d7b2438d3 2390 * @param[in] N length of the DCT4.
switches 0:5c4d7b2438d3 2391 * @param[in] Nby2 half of the length of the DCT4.
switches 0:5c4d7b2438d3 2392 * @param[in] normalize normalizing factor.
switches 0:5c4d7b2438d3 2393 * @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.
switches 0:5c4d7b2438d3 2394 */
switches 0:5c4d7b2438d3 2395
switches 0:5c4d7b2438d3 2396 arm_status arm_dct4_init_f32(
switches 0:5c4d7b2438d3 2397 arm_dct4_instance_f32 * S,
switches 0:5c4d7b2438d3 2398 arm_rfft_instance_f32 * S_RFFT,
switches 0:5c4d7b2438d3 2399 arm_cfft_radix4_instance_f32 * S_CFFT,
switches 0:5c4d7b2438d3 2400 uint16_t N,
switches 0:5c4d7b2438d3 2401 uint16_t Nby2,
switches 0:5c4d7b2438d3 2402 float32_t normalize);
switches 0:5c4d7b2438d3 2403
switches 0:5c4d7b2438d3 2404 /**
switches 0:5c4d7b2438d3 2405 * @brief Processing function for the floating-point DCT4/IDCT4.
switches 0:5c4d7b2438d3 2406 * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure.
switches 0:5c4d7b2438d3 2407 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 2408 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
switches 0:5c4d7b2438d3 2409 * @return none.
switches 0:5c4d7b2438d3 2410 */
switches 0:5c4d7b2438d3 2411
switches 0:5c4d7b2438d3 2412 void arm_dct4_f32(
switches 0:5c4d7b2438d3 2413 const arm_dct4_instance_f32 * S,
switches 0:5c4d7b2438d3 2414 float32_t * pState,
switches 0:5c4d7b2438d3 2415 float32_t * pInlineBuffer);
switches 0:5c4d7b2438d3 2416
switches 0:5c4d7b2438d3 2417 /**
switches 0:5c4d7b2438d3 2418 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
switches 0:5c4d7b2438d3 2419 */
switches 0:5c4d7b2438d3 2420
switches 0:5c4d7b2438d3 2421 typedef struct
switches 0:5c4d7b2438d3 2422 {
switches 0:5c4d7b2438d3 2423 uint16_t N; /**< length of the DCT4. */
switches 0:5c4d7b2438d3 2424 uint16_t Nby2; /**< half of the length of the DCT4. */
switches 0:5c4d7b2438d3 2425 q31_t normalize; /**< normalizing factor. */
switches 0:5c4d7b2438d3 2426 q31_t *pTwiddle; /**< points to the twiddle factor table. */
switches 0:5c4d7b2438d3 2427 q31_t *pCosFactor; /**< points to the cosFactor table. */
switches 0:5c4d7b2438d3 2428 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
switches 0:5c4d7b2438d3 2429 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2430 } arm_dct4_instance_q31;
switches 0:5c4d7b2438d3 2431
switches 0:5c4d7b2438d3 2432 /**
switches 0:5c4d7b2438d3 2433 * @brief Initialization function for the Q31 DCT4/IDCT4.
switches 0:5c4d7b2438d3 2434 * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure.
switches 0:5c4d7b2438d3 2435 * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure
switches 0:5c4d7b2438d3 2436 * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure
switches 0:5c4d7b2438d3 2437 * @param[in] N length of the DCT4.
switches 0:5c4d7b2438d3 2438 * @param[in] Nby2 half of the length of the DCT4.
switches 0:5c4d7b2438d3 2439 * @param[in] normalize normalizing factor.
switches 0:5c4d7b2438d3 2440 * @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.
switches 0:5c4d7b2438d3 2441 */
switches 0:5c4d7b2438d3 2442
switches 0:5c4d7b2438d3 2443 arm_status arm_dct4_init_q31(
switches 0:5c4d7b2438d3 2444 arm_dct4_instance_q31 * S,
switches 0:5c4d7b2438d3 2445 arm_rfft_instance_q31 * S_RFFT,
switches 0:5c4d7b2438d3 2446 arm_cfft_radix4_instance_q31 * S_CFFT,
switches 0:5c4d7b2438d3 2447 uint16_t N,
switches 0:5c4d7b2438d3 2448 uint16_t Nby2,
switches 0:5c4d7b2438d3 2449 q31_t normalize);
switches 0:5c4d7b2438d3 2450
switches 0:5c4d7b2438d3 2451 /**
switches 0:5c4d7b2438d3 2452 * @brief Processing function for the Q31 DCT4/IDCT4.
switches 0:5c4d7b2438d3 2453 * @param[in] *S points to an instance of the Q31 DCT4 structure.
switches 0:5c4d7b2438d3 2454 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 2455 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
switches 0:5c4d7b2438d3 2456 * @return none.
switches 0:5c4d7b2438d3 2457 */
switches 0:5c4d7b2438d3 2458
switches 0:5c4d7b2438d3 2459 void arm_dct4_q31(
switches 0:5c4d7b2438d3 2460 const arm_dct4_instance_q31 * S,
switches 0:5c4d7b2438d3 2461 q31_t * pState,
switches 0:5c4d7b2438d3 2462 q31_t * pInlineBuffer);
switches 0:5c4d7b2438d3 2463
switches 0:5c4d7b2438d3 2464 /**
switches 0:5c4d7b2438d3 2465 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
switches 0:5c4d7b2438d3 2466 */
switches 0:5c4d7b2438d3 2467
switches 0:5c4d7b2438d3 2468 typedef struct
switches 0:5c4d7b2438d3 2469 {
switches 0:5c4d7b2438d3 2470 uint16_t N; /**< length of the DCT4. */
switches 0:5c4d7b2438d3 2471 uint16_t Nby2; /**< half of the length of the DCT4. */
switches 0:5c4d7b2438d3 2472 q15_t normalize; /**< normalizing factor. */
switches 0:5c4d7b2438d3 2473 q15_t *pTwiddle; /**< points to the twiddle factor table. */
switches 0:5c4d7b2438d3 2474 q15_t *pCosFactor; /**< points to the cosFactor table. */
switches 0:5c4d7b2438d3 2475 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
switches 0:5c4d7b2438d3 2476 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
switches 0:5c4d7b2438d3 2477 } arm_dct4_instance_q15;
switches 0:5c4d7b2438d3 2478
switches 0:5c4d7b2438d3 2479 /**
switches 0:5c4d7b2438d3 2480 * @brief Initialization function for the Q15 DCT4/IDCT4.
switches 0:5c4d7b2438d3 2481 * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure.
switches 0:5c4d7b2438d3 2482 * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
switches 0:5c4d7b2438d3 2483 * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
switches 0:5c4d7b2438d3 2484 * @param[in] N length of the DCT4.
switches 0:5c4d7b2438d3 2485 * @param[in] Nby2 half of the length of the DCT4.
switches 0:5c4d7b2438d3 2486 * @param[in] normalize normalizing factor.
switches 0:5c4d7b2438d3 2487 * @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.
switches 0:5c4d7b2438d3 2488 */
switches 0:5c4d7b2438d3 2489
switches 0:5c4d7b2438d3 2490 arm_status arm_dct4_init_q15(
switches 0:5c4d7b2438d3 2491 arm_dct4_instance_q15 * S,
switches 0:5c4d7b2438d3 2492 arm_rfft_instance_q15 * S_RFFT,
switches 0:5c4d7b2438d3 2493 arm_cfft_radix4_instance_q15 * S_CFFT,
switches 0:5c4d7b2438d3 2494 uint16_t N,
switches 0:5c4d7b2438d3 2495 uint16_t Nby2,
switches 0:5c4d7b2438d3 2496 q15_t normalize);
switches 0:5c4d7b2438d3 2497
switches 0:5c4d7b2438d3 2498 /**
switches 0:5c4d7b2438d3 2499 * @brief Processing function for the Q15 DCT4/IDCT4.
switches 0:5c4d7b2438d3 2500 * @param[in] *S points to an instance of the Q15 DCT4 structure.
switches 0:5c4d7b2438d3 2501 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 2502 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
switches 0:5c4d7b2438d3 2503 * @return none.
switches 0:5c4d7b2438d3 2504 */
switches 0:5c4d7b2438d3 2505
switches 0:5c4d7b2438d3 2506 void arm_dct4_q15(
switches 0:5c4d7b2438d3 2507 const arm_dct4_instance_q15 * S,
switches 0:5c4d7b2438d3 2508 q15_t * pState,
switches 0:5c4d7b2438d3 2509 q15_t * pInlineBuffer);
switches 0:5c4d7b2438d3 2510
switches 0:5c4d7b2438d3 2511 /**
switches 0:5c4d7b2438d3 2512 * @brief Floating-point vector addition.
switches 0:5c4d7b2438d3 2513 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2514 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2515 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2516 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2517 * @return none.
switches 0:5c4d7b2438d3 2518 */
switches 0:5c4d7b2438d3 2519
switches 0:5c4d7b2438d3 2520 void arm_add_f32(
switches 0:5c4d7b2438d3 2521 float32_t * pSrcA,
switches 0:5c4d7b2438d3 2522 float32_t * pSrcB,
switches 0:5c4d7b2438d3 2523 float32_t * pDst,
switches 0:5c4d7b2438d3 2524 uint32_t blockSize);
switches 0:5c4d7b2438d3 2525
switches 0:5c4d7b2438d3 2526 /**
switches 0:5c4d7b2438d3 2527 * @brief Q7 vector addition.
switches 0:5c4d7b2438d3 2528 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2529 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2530 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2531 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2532 * @return none.
switches 0:5c4d7b2438d3 2533 */
switches 0:5c4d7b2438d3 2534
switches 0:5c4d7b2438d3 2535 void arm_add_q7(
switches 0:5c4d7b2438d3 2536 q7_t * pSrcA,
switches 0:5c4d7b2438d3 2537 q7_t * pSrcB,
switches 0:5c4d7b2438d3 2538 q7_t * pDst,
switches 0:5c4d7b2438d3 2539 uint32_t blockSize);
switches 0:5c4d7b2438d3 2540
switches 0:5c4d7b2438d3 2541 /**
switches 0:5c4d7b2438d3 2542 * @brief Q15 vector addition.
switches 0:5c4d7b2438d3 2543 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2544 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2545 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2546 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2547 * @return none.
switches 0:5c4d7b2438d3 2548 */
switches 0:5c4d7b2438d3 2549
switches 0:5c4d7b2438d3 2550 void arm_add_q15(
switches 0:5c4d7b2438d3 2551 q15_t * pSrcA,
switches 0:5c4d7b2438d3 2552 q15_t * pSrcB,
switches 0:5c4d7b2438d3 2553 q15_t * pDst,
switches 0:5c4d7b2438d3 2554 uint32_t blockSize);
switches 0:5c4d7b2438d3 2555
switches 0:5c4d7b2438d3 2556 /**
switches 0:5c4d7b2438d3 2557 * @brief Q31 vector addition.
switches 0:5c4d7b2438d3 2558 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2559 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2560 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2561 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2562 * @return none.
switches 0:5c4d7b2438d3 2563 */
switches 0:5c4d7b2438d3 2564
switches 0:5c4d7b2438d3 2565 void arm_add_q31(
switches 0:5c4d7b2438d3 2566 q31_t * pSrcA,
switches 0:5c4d7b2438d3 2567 q31_t * pSrcB,
switches 0:5c4d7b2438d3 2568 q31_t * pDst,
switches 0:5c4d7b2438d3 2569 uint32_t blockSize);
switches 0:5c4d7b2438d3 2570
switches 0:5c4d7b2438d3 2571 /**
switches 0:5c4d7b2438d3 2572 * @brief Floating-point vector subtraction.
switches 0:5c4d7b2438d3 2573 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2574 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2575 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2576 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2577 * @return none.
switches 0:5c4d7b2438d3 2578 */
switches 0:5c4d7b2438d3 2579
switches 0:5c4d7b2438d3 2580 void arm_sub_f32(
switches 0:5c4d7b2438d3 2581 float32_t * pSrcA,
switches 0:5c4d7b2438d3 2582 float32_t * pSrcB,
switches 0:5c4d7b2438d3 2583 float32_t * pDst,
switches 0:5c4d7b2438d3 2584 uint32_t blockSize);
switches 0:5c4d7b2438d3 2585
switches 0:5c4d7b2438d3 2586 /**
switches 0:5c4d7b2438d3 2587 * @brief Q7 vector subtraction.
switches 0:5c4d7b2438d3 2588 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2589 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2590 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2591 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2592 * @return none.
switches 0:5c4d7b2438d3 2593 */
switches 0:5c4d7b2438d3 2594
switches 0:5c4d7b2438d3 2595 void arm_sub_q7(
switches 0:5c4d7b2438d3 2596 q7_t * pSrcA,
switches 0:5c4d7b2438d3 2597 q7_t * pSrcB,
switches 0:5c4d7b2438d3 2598 q7_t * pDst,
switches 0:5c4d7b2438d3 2599 uint32_t blockSize);
switches 0:5c4d7b2438d3 2600
switches 0:5c4d7b2438d3 2601 /**
switches 0:5c4d7b2438d3 2602 * @brief Q15 vector subtraction.
switches 0:5c4d7b2438d3 2603 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2604 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2605 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2606 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2607 * @return none.
switches 0:5c4d7b2438d3 2608 */
switches 0:5c4d7b2438d3 2609
switches 0:5c4d7b2438d3 2610 void arm_sub_q15(
switches 0:5c4d7b2438d3 2611 q15_t * pSrcA,
switches 0:5c4d7b2438d3 2612 q15_t * pSrcB,
switches 0:5c4d7b2438d3 2613 q15_t * pDst,
switches 0:5c4d7b2438d3 2614 uint32_t blockSize);
switches 0:5c4d7b2438d3 2615
switches 0:5c4d7b2438d3 2616 /**
switches 0:5c4d7b2438d3 2617 * @brief Q31 vector subtraction.
switches 0:5c4d7b2438d3 2618 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2619 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2620 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2621 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2622 * @return none.
switches 0:5c4d7b2438d3 2623 */
switches 0:5c4d7b2438d3 2624
switches 0:5c4d7b2438d3 2625 void arm_sub_q31(
switches 0:5c4d7b2438d3 2626 q31_t * pSrcA,
switches 0:5c4d7b2438d3 2627 q31_t * pSrcB,
switches 0:5c4d7b2438d3 2628 q31_t * pDst,
switches 0:5c4d7b2438d3 2629 uint32_t blockSize);
switches 0:5c4d7b2438d3 2630
switches 0:5c4d7b2438d3 2631 /**
switches 0:5c4d7b2438d3 2632 * @brief Multiplies a floating-point vector by a scalar.
switches 0:5c4d7b2438d3 2633 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2634 * @param[in] scale scale factor to be applied
switches 0:5c4d7b2438d3 2635 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2636 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2637 * @return none.
switches 0:5c4d7b2438d3 2638 */
switches 0:5c4d7b2438d3 2639
switches 0:5c4d7b2438d3 2640 void arm_scale_f32(
switches 0:5c4d7b2438d3 2641 float32_t * pSrc,
switches 0:5c4d7b2438d3 2642 float32_t scale,
switches 0:5c4d7b2438d3 2643 float32_t * pDst,
switches 0:5c4d7b2438d3 2644 uint32_t blockSize);
switches 0:5c4d7b2438d3 2645
switches 0:5c4d7b2438d3 2646 /**
switches 0:5c4d7b2438d3 2647 * @brief Multiplies a Q7 vector by a scalar.
switches 0:5c4d7b2438d3 2648 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2649 * @param[in] scaleFract fractional portion of the scale value
switches 0:5c4d7b2438d3 2650 * @param[in] shift number of bits to shift the result by
switches 0:5c4d7b2438d3 2651 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2652 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2653 * @return none.
switches 0:5c4d7b2438d3 2654 */
switches 0:5c4d7b2438d3 2655
switches 0:5c4d7b2438d3 2656 void arm_scale_q7(
switches 0:5c4d7b2438d3 2657 q7_t * pSrc,
switches 0:5c4d7b2438d3 2658 q7_t scaleFract,
switches 0:5c4d7b2438d3 2659 int8_t shift,
switches 0:5c4d7b2438d3 2660 q7_t * pDst,
switches 0:5c4d7b2438d3 2661 uint32_t blockSize);
switches 0:5c4d7b2438d3 2662
switches 0:5c4d7b2438d3 2663 /**
switches 0:5c4d7b2438d3 2664 * @brief Multiplies a Q15 vector by a scalar.
switches 0:5c4d7b2438d3 2665 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2666 * @param[in] scaleFract fractional portion of the scale value
switches 0:5c4d7b2438d3 2667 * @param[in] shift number of bits to shift the result by
switches 0:5c4d7b2438d3 2668 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2669 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2670 * @return none.
switches 0:5c4d7b2438d3 2671 */
switches 0:5c4d7b2438d3 2672
switches 0:5c4d7b2438d3 2673 void arm_scale_q15(
switches 0:5c4d7b2438d3 2674 q15_t * pSrc,
switches 0:5c4d7b2438d3 2675 q15_t scaleFract,
switches 0:5c4d7b2438d3 2676 int8_t shift,
switches 0:5c4d7b2438d3 2677 q15_t * pDst,
switches 0:5c4d7b2438d3 2678 uint32_t blockSize);
switches 0:5c4d7b2438d3 2679
switches 0:5c4d7b2438d3 2680 /**
switches 0:5c4d7b2438d3 2681 * @brief Multiplies a Q31 vector by a scalar.
switches 0:5c4d7b2438d3 2682 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2683 * @param[in] scaleFract fractional portion of the scale value
switches 0:5c4d7b2438d3 2684 * @param[in] shift number of bits to shift the result by
switches 0:5c4d7b2438d3 2685 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2686 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2687 * @return none.
switches 0:5c4d7b2438d3 2688 */
switches 0:5c4d7b2438d3 2689
switches 0:5c4d7b2438d3 2690 void arm_scale_q31(
switches 0:5c4d7b2438d3 2691 q31_t * pSrc,
switches 0:5c4d7b2438d3 2692 q31_t scaleFract,
switches 0:5c4d7b2438d3 2693 int8_t shift,
switches 0:5c4d7b2438d3 2694 q31_t * pDst,
switches 0:5c4d7b2438d3 2695 uint32_t blockSize);
switches 0:5c4d7b2438d3 2696
switches 0:5c4d7b2438d3 2697 /**
switches 0:5c4d7b2438d3 2698 * @brief Q7 vector absolute value.
switches 0:5c4d7b2438d3 2699 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 2700 * @param[out] *pDst points to the output buffer
switches 0:5c4d7b2438d3 2701 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2702 * @return none.
switches 0:5c4d7b2438d3 2703 */
switches 0:5c4d7b2438d3 2704
switches 0:5c4d7b2438d3 2705 void arm_abs_q7(
switches 0:5c4d7b2438d3 2706 q7_t * pSrc,
switches 0:5c4d7b2438d3 2707 q7_t * pDst,
switches 0:5c4d7b2438d3 2708 uint32_t blockSize);
switches 0:5c4d7b2438d3 2709
switches 0:5c4d7b2438d3 2710 /**
switches 0:5c4d7b2438d3 2711 * @brief Floating-point vector absolute value.
switches 0:5c4d7b2438d3 2712 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 2713 * @param[out] *pDst points to the output buffer
switches 0:5c4d7b2438d3 2714 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2715 * @return none.
switches 0:5c4d7b2438d3 2716 */
switches 0:5c4d7b2438d3 2717
switches 0:5c4d7b2438d3 2718 void arm_abs_f32(
switches 0:5c4d7b2438d3 2719 float32_t * pSrc,
switches 0:5c4d7b2438d3 2720 float32_t * pDst,
switches 0:5c4d7b2438d3 2721 uint32_t blockSize);
switches 0:5c4d7b2438d3 2722
switches 0:5c4d7b2438d3 2723 /**
switches 0:5c4d7b2438d3 2724 * @brief Q15 vector absolute value.
switches 0:5c4d7b2438d3 2725 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 2726 * @param[out] *pDst points to the output buffer
switches 0:5c4d7b2438d3 2727 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2728 * @return none.
switches 0:5c4d7b2438d3 2729 */
switches 0:5c4d7b2438d3 2730
switches 0:5c4d7b2438d3 2731 void arm_abs_q15(
switches 0:5c4d7b2438d3 2732 q15_t * pSrc,
switches 0:5c4d7b2438d3 2733 q15_t * pDst,
switches 0:5c4d7b2438d3 2734 uint32_t blockSize);
switches 0:5c4d7b2438d3 2735
switches 0:5c4d7b2438d3 2736 /**
switches 0:5c4d7b2438d3 2737 * @brief Q31 vector absolute value.
switches 0:5c4d7b2438d3 2738 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 2739 * @param[out] *pDst points to the output buffer
switches 0:5c4d7b2438d3 2740 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2741 * @return none.
switches 0:5c4d7b2438d3 2742 */
switches 0:5c4d7b2438d3 2743
switches 0:5c4d7b2438d3 2744 void arm_abs_q31(
switches 0:5c4d7b2438d3 2745 q31_t * pSrc,
switches 0:5c4d7b2438d3 2746 q31_t * pDst,
switches 0:5c4d7b2438d3 2747 uint32_t blockSize);
switches 0:5c4d7b2438d3 2748
switches 0:5c4d7b2438d3 2749 /**
switches 0:5c4d7b2438d3 2750 * @brief Dot product of floating-point vectors.
switches 0:5c4d7b2438d3 2751 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2752 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2753 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2754 * @param[out] *result output result returned here
switches 0:5c4d7b2438d3 2755 * @return none.
switches 0:5c4d7b2438d3 2756 */
switches 0:5c4d7b2438d3 2757
switches 0:5c4d7b2438d3 2758 void arm_dot_prod_f32(
switches 0:5c4d7b2438d3 2759 float32_t * pSrcA,
switches 0:5c4d7b2438d3 2760 float32_t * pSrcB,
switches 0:5c4d7b2438d3 2761 uint32_t blockSize,
switches 0:5c4d7b2438d3 2762 float32_t * result);
switches 0:5c4d7b2438d3 2763
switches 0:5c4d7b2438d3 2764 /**
switches 0:5c4d7b2438d3 2765 * @brief Dot product of Q7 vectors.
switches 0:5c4d7b2438d3 2766 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2767 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2768 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2769 * @param[out] *result output result returned here
switches 0:5c4d7b2438d3 2770 * @return none.
switches 0:5c4d7b2438d3 2771 */
switches 0:5c4d7b2438d3 2772
switches 0:5c4d7b2438d3 2773 void arm_dot_prod_q7(
switches 0:5c4d7b2438d3 2774 q7_t * pSrcA,
switches 0:5c4d7b2438d3 2775 q7_t * pSrcB,
switches 0:5c4d7b2438d3 2776 uint32_t blockSize,
switches 0:5c4d7b2438d3 2777 q31_t * result);
switches 0:5c4d7b2438d3 2778
switches 0:5c4d7b2438d3 2779 /**
switches 0:5c4d7b2438d3 2780 * @brief Dot product of Q15 vectors.
switches 0:5c4d7b2438d3 2781 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2782 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2783 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2784 * @param[out] *result output result returned here
switches 0:5c4d7b2438d3 2785 * @return none.
switches 0:5c4d7b2438d3 2786 */
switches 0:5c4d7b2438d3 2787
switches 0:5c4d7b2438d3 2788 void arm_dot_prod_q15(
switches 0:5c4d7b2438d3 2789 q15_t * pSrcA,
switches 0:5c4d7b2438d3 2790 q15_t * pSrcB,
switches 0:5c4d7b2438d3 2791 uint32_t blockSize,
switches 0:5c4d7b2438d3 2792 q63_t * result);
switches 0:5c4d7b2438d3 2793
switches 0:5c4d7b2438d3 2794 /**
switches 0:5c4d7b2438d3 2795 * @brief Dot product of Q31 vectors.
switches 0:5c4d7b2438d3 2796 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 2797 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 2798 * @param[in] blockSize number of samples in each vector
switches 0:5c4d7b2438d3 2799 * @param[out] *result output result returned here
switches 0:5c4d7b2438d3 2800 * @return none.
switches 0:5c4d7b2438d3 2801 */
switches 0:5c4d7b2438d3 2802
switches 0:5c4d7b2438d3 2803 void arm_dot_prod_q31(
switches 0:5c4d7b2438d3 2804 q31_t * pSrcA,
switches 0:5c4d7b2438d3 2805 q31_t * pSrcB,
switches 0:5c4d7b2438d3 2806 uint32_t blockSize,
switches 0:5c4d7b2438d3 2807 q63_t * result);
switches 0:5c4d7b2438d3 2808
switches 0:5c4d7b2438d3 2809 /**
switches 0:5c4d7b2438d3 2810 * @brief Shifts the elements of a Q7 vector a specified number of bits.
switches 0:5c4d7b2438d3 2811 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2812 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
switches 0:5c4d7b2438d3 2813 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2814 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2815 * @return none.
switches 0:5c4d7b2438d3 2816 */
switches 0:5c4d7b2438d3 2817
switches 0:5c4d7b2438d3 2818 void arm_shift_q7(
switches 0:5c4d7b2438d3 2819 q7_t * pSrc,
switches 0:5c4d7b2438d3 2820 int8_t shiftBits,
switches 0:5c4d7b2438d3 2821 q7_t * pDst,
switches 0:5c4d7b2438d3 2822 uint32_t blockSize);
switches 0:5c4d7b2438d3 2823
switches 0:5c4d7b2438d3 2824 /**
switches 0:5c4d7b2438d3 2825 * @brief Shifts the elements of a Q15 vector a specified number of bits.
switches 0:5c4d7b2438d3 2826 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2827 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
switches 0:5c4d7b2438d3 2828 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2829 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2830 * @return none.
switches 0:5c4d7b2438d3 2831 */
switches 0:5c4d7b2438d3 2832
switches 0:5c4d7b2438d3 2833 void arm_shift_q15(
switches 0:5c4d7b2438d3 2834 q15_t * pSrc,
switches 0:5c4d7b2438d3 2835 int8_t shiftBits,
switches 0:5c4d7b2438d3 2836 q15_t * pDst,
switches 0:5c4d7b2438d3 2837 uint32_t blockSize);
switches 0:5c4d7b2438d3 2838
switches 0:5c4d7b2438d3 2839 /**
switches 0:5c4d7b2438d3 2840 * @brief Shifts the elements of a Q31 vector a specified number of bits.
switches 0:5c4d7b2438d3 2841 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2842 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
switches 0:5c4d7b2438d3 2843 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2844 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2845 * @return none.
switches 0:5c4d7b2438d3 2846 */
switches 0:5c4d7b2438d3 2847
switches 0:5c4d7b2438d3 2848 void arm_shift_q31(
switches 0:5c4d7b2438d3 2849 q31_t * pSrc,
switches 0:5c4d7b2438d3 2850 int8_t shiftBits,
switches 0:5c4d7b2438d3 2851 q31_t * pDst,
switches 0:5c4d7b2438d3 2852 uint32_t blockSize);
switches 0:5c4d7b2438d3 2853
switches 0:5c4d7b2438d3 2854 /**
switches 0:5c4d7b2438d3 2855 * @brief Adds a constant offset to a floating-point vector.
switches 0:5c4d7b2438d3 2856 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2857 * @param[in] offset is the offset to be added
switches 0:5c4d7b2438d3 2858 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2859 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2860 * @return none.
switches 0:5c4d7b2438d3 2861 */
switches 0:5c4d7b2438d3 2862
switches 0:5c4d7b2438d3 2863 void arm_offset_f32(
switches 0:5c4d7b2438d3 2864 float32_t * pSrc,
switches 0:5c4d7b2438d3 2865 float32_t offset,
switches 0:5c4d7b2438d3 2866 float32_t * pDst,
switches 0:5c4d7b2438d3 2867 uint32_t blockSize);
switches 0:5c4d7b2438d3 2868
switches 0:5c4d7b2438d3 2869 /**
switches 0:5c4d7b2438d3 2870 * @brief Adds a constant offset to a Q7 vector.
switches 0:5c4d7b2438d3 2871 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2872 * @param[in] offset is the offset to be added
switches 0:5c4d7b2438d3 2873 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2874 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2875 * @return none.
switches 0:5c4d7b2438d3 2876 */
switches 0:5c4d7b2438d3 2877
switches 0:5c4d7b2438d3 2878 void arm_offset_q7(
switches 0:5c4d7b2438d3 2879 q7_t * pSrc,
switches 0:5c4d7b2438d3 2880 q7_t offset,
switches 0:5c4d7b2438d3 2881 q7_t * pDst,
switches 0:5c4d7b2438d3 2882 uint32_t blockSize);
switches 0:5c4d7b2438d3 2883
switches 0:5c4d7b2438d3 2884 /**
switches 0:5c4d7b2438d3 2885 * @brief Adds a constant offset to a Q15 vector.
switches 0:5c4d7b2438d3 2886 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2887 * @param[in] offset is the offset to be added
switches 0:5c4d7b2438d3 2888 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2889 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2890 * @return none.
switches 0:5c4d7b2438d3 2891 */
switches 0:5c4d7b2438d3 2892
switches 0:5c4d7b2438d3 2893 void arm_offset_q15(
switches 0:5c4d7b2438d3 2894 q15_t * pSrc,
switches 0:5c4d7b2438d3 2895 q15_t offset,
switches 0:5c4d7b2438d3 2896 q15_t * pDst,
switches 0:5c4d7b2438d3 2897 uint32_t blockSize);
switches 0:5c4d7b2438d3 2898
switches 0:5c4d7b2438d3 2899 /**
switches 0:5c4d7b2438d3 2900 * @brief Adds a constant offset to a Q31 vector.
switches 0:5c4d7b2438d3 2901 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2902 * @param[in] offset is the offset to be added
switches 0:5c4d7b2438d3 2903 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2904 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2905 * @return none.
switches 0:5c4d7b2438d3 2906 */
switches 0:5c4d7b2438d3 2907
switches 0:5c4d7b2438d3 2908 void arm_offset_q31(
switches 0:5c4d7b2438d3 2909 q31_t * pSrc,
switches 0:5c4d7b2438d3 2910 q31_t offset,
switches 0:5c4d7b2438d3 2911 q31_t * pDst,
switches 0:5c4d7b2438d3 2912 uint32_t blockSize);
switches 0:5c4d7b2438d3 2913
switches 0:5c4d7b2438d3 2914 /**
switches 0:5c4d7b2438d3 2915 * @brief Negates the elements of a floating-point vector.
switches 0:5c4d7b2438d3 2916 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2917 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2918 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2919 * @return none.
switches 0:5c4d7b2438d3 2920 */
switches 0:5c4d7b2438d3 2921
switches 0:5c4d7b2438d3 2922 void arm_negate_f32(
switches 0:5c4d7b2438d3 2923 float32_t * pSrc,
switches 0:5c4d7b2438d3 2924 float32_t * pDst,
switches 0:5c4d7b2438d3 2925 uint32_t blockSize);
switches 0:5c4d7b2438d3 2926
switches 0:5c4d7b2438d3 2927 /**
switches 0:5c4d7b2438d3 2928 * @brief Negates the elements of a Q7 vector.
switches 0:5c4d7b2438d3 2929 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2930 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2931 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2932 * @return none.
switches 0:5c4d7b2438d3 2933 */
switches 0:5c4d7b2438d3 2934
switches 0:5c4d7b2438d3 2935 void arm_negate_q7(
switches 0:5c4d7b2438d3 2936 q7_t * pSrc,
switches 0:5c4d7b2438d3 2937 q7_t * pDst,
switches 0:5c4d7b2438d3 2938 uint32_t blockSize);
switches 0:5c4d7b2438d3 2939
switches 0:5c4d7b2438d3 2940 /**
switches 0:5c4d7b2438d3 2941 * @brief Negates the elements of a Q15 vector.
switches 0:5c4d7b2438d3 2942 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2943 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2944 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2945 * @return none.
switches 0:5c4d7b2438d3 2946 */
switches 0:5c4d7b2438d3 2947
switches 0:5c4d7b2438d3 2948 void arm_negate_q15(
switches 0:5c4d7b2438d3 2949 q15_t * pSrc,
switches 0:5c4d7b2438d3 2950 q15_t * pDst,
switches 0:5c4d7b2438d3 2951 uint32_t blockSize);
switches 0:5c4d7b2438d3 2952
switches 0:5c4d7b2438d3 2953 /**
switches 0:5c4d7b2438d3 2954 * @brief Negates the elements of a Q31 vector.
switches 0:5c4d7b2438d3 2955 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 2956 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 2957 * @param[in] blockSize number of samples in the vector
switches 0:5c4d7b2438d3 2958 * @return none.
switches 0:5c4d7b2438d3 2959 */
switches 0:5c4d7b2438d3 2960
switches 0:5c4d7b2438d3 2961 void arm_negate_q31(
switches 0:5c4d7b2438d3 2962 q31_t * pSrc,
switches 0:5c4d7b2438d3 2963 q31_t * pDst,
switches 0:5c4d7b2438d3 2964 uint32_t blockSize);
switches 0:5c4d7b2438d3 2965 /**
switches 0:5c4d7b2438d3 2966 * @brief Copies the elements of a floating-point vector.
switches 0:5c4d7b2438d3 2967 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 2968 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 2969 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 2970 * @return none.
switches 0:5c4d7b2438d3 2971 */
switches 0:5c4d7b2438d3 2972 void arm_copy_f32(
switches 0:5c4d7b2438d3 2973 float32_t * pSrc,
switches 0:5c4d7b2438d3 2974 float32_t * pDst,
switches 0:5c4d7b2438d3 2975 uint32_t blockSize);
switches 0:5c4d7b2438d3 2976
switches 0:5c4d7b2438d3 2977 /**
switches 0:5c4d7b2438d3 2978 * @brief Copies the elements of a Q7 vector.
switches 0:5c4d7b2438d3 2979 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 2980 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 2981 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 2982 * @return none.
switches 0:5c4d7b2438d3 2983 */
switches 0:5c4d7b2438d3 2984 void arm_copy_q7(
switches 0:5c4d7b2438d3 2985 q7_t * pSrc,
switches 0:5c4d7b2438d3 2986 q7_t * pDst,
switches 0:5c4d7b2438d3 2987 uint32_t blockSize);
switches 0:5c4d7b2438d3 2988
switches 0:5c4d7b2438d3 2989 /**
switches 0:5c4d7b2438d3 2990 * @brief Copies the elements of a Q15 vector.
switches 0:5c4d7b2438d3 2991 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 2992 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 2993 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 2994 * @return none.
switches 0:5c4d7b2438d3 2995 */
switches 0:5c4d7b2438d3 2996 void arm_copy_q15(
switches 0:5c4d7b2438d3 2997 q15_t * pSrc,
switches 0:5c4d7b2438d3 2998 q15_t * pDst,
switches 0:5c4d7b2438d3 2999 uint32_t blockSize);
switches 0:5c4d7b2438d3 3000
switches 0:5c4d7b2438d3 3001 /**
switches 0:5c4d7b2438d3 3002 * @brief Copies the elements of a Q31 vector.
switches 0:5c4d7b2438d3 3003 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 3004 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 3005 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 3006 * @return none.
switches 0:5c4d7b2438d3 3007 */
switches 0:5c4d7b2438d3 3008 void arm_copy_q31(
switches 0:5c4d7b2438d3 3009 q31_t * pSrc,
switches 0:5c4d7b2438d3 3010 q31_t * pDst,
switches 0:5c4d7b2438d3 3011 uint32_t blockSize);
switches 0:5c4d7b2438d3 3012 /**
switches 0:5c4d7b2438d3 3013 * @brief Fills a constant value into a floating-point vector.
switches 0:5c4d7b2438d3 3014 * @param[in] value input value to be filled
switches 0:5c4d7b2438d3 3015 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 3016 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 3017 * @return none.
switches 0:5c4d7b2438d3 3018 */
switches 0:5c4d7b2438d3 3019 void arm_fill_f32(
switches 0:5c4d7b2438d3 3020 float32_t value,
switches 0:5c4d7b2438d3 3021 float32_t * pDst,
switches 0:5c4d7b2438d3 3022 uint32_t blockSize);
switches 0:5c4d7b2438d3 3023
switches 0:5c4d7b2438d3 3024 /**
switches 0:5c4d7b2438d3 3025 * @brief Fills a constant value into a Q7 vector.
switches 0:5c4d7b2438d3 3026 * @param[in] value input value to be filled
switches 0:5c4d7b2438d3 3027 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 3028 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 3029 * @return none.
switches 0:5c4d7b2438d3 3030 */
switches 0:5c4d7b2438d3 3031 void arm_fill_q7(
switches 0:5c4d7b2438d3 3032 q7_t value,
switches 0:5c4d7b2438d3 3033 q7_t * pDst,
switches 0:5c4d7b2438d3 3034 uint32_t blockSize);
switches 0:5c4d7b2438d3 3035
switches 0:5c4d7b2438d3 3036 /**
switches 0:5c4d7b2438d3 3037 * @brief Fills a constant value into a Q15 vector.
switches 0:5c4d7b2438d3 3038 * @param[in] value input value to be filled
switches 0:5c4d7b2438d3 3039 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 3040 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 3041 * @return none.
switches 0:5c4d7b2438d3 3042 */
switches 0:5c4d7b2438d3 3043 void arm_fill_q15(
switches 0:5c4d7b2438d3 3044 q15_t value,
switches 0:5c4d7b2438d3 3045 q15_t * pDst,
switches 0:5c4d7b2438d3 3046 uint32_t blockSize);
switches 0:5c4d7b2438d3 3047
switches 0:5c4d7b2438d3 3048 /**
switches 0:5c4d7b2438d3 3049 * @brief Fills a constant value into a Q31 vector.
switches 0:5c4d7b2438d3 3050 * @param[in] value input value to be filled
switches 0:5c4d7b2438d3 3051 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 3052 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 3053 * @return none.
switches 0:5c4d7b2438d3 3054 */
switches 0:5c4d7b2438d3 3055 void arm_fill_q31(
switches 0:5c4d7b2438d3 3056 q31_t value,
switches 0:5c4d7b2438d3 3057 q31_t * pDst,
switches 0:5c4d7b2438d3 3058 uint32_t blockSize);
switches 0:5c4d7b2438d3 3059
switches 0:5c4d7b2438d3 3060 /**
switches 0:5c4d7b2438d3 3061 * @brief Convolution of floating-point sequences.
switches 0:5c4d7b2438d3 3062 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3063 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3064 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3065 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3066 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3067 * @return none.
switches 0:5c4d7b2438d3 3068 */
switches 0:5c4d7b2438d3 3069
switches 0:5c4d7b2438d3 3070 void arm_conv_f32(
switches 0:5c4d7b2438d3 3071 float32_t * pSrcA,
switches 0:5c4d7b2438d3 3072 uint32_t srcALen,
switches 0:5c4d7b2438d3 3073 float32_t * pSrcB,
switches 0:5c4d7b2438d3 3074 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3075 float32_t * pDst);
switches 0:5c4d7b2438d3 3076
switches 0:5c4d7b2438d3 3077
switches 0:5c4d7b2438d3 3078 /**
switches 0:5c4d7b2438d3 3079 * @brief Convolution of Q15 sequences.
switches 0:5c4d7b2438d3 3080 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3081 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3082 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3083 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3084 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3085 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3086 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3087 * @return none.
switches 0:5c4d7b2438d3 3088 */
switches 0:5c4d7b2438d3 3089
switches 0:5c4d7b2438d3 3090
switches 0:5c4d7b2438d3 3091 void arm_conv_opt_q15(
switches 0:5c4d7b2438d3 3092 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3093 uint32_t srcALen,
switches 0:5c4d7b2438d3 3094 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3095 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3096 q15_t * pDst,
switches 0:5c4d7b2438d3 3097 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3098 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3099
switches 0:5c4d7b2438d3 3100
switches 0:5c4d7b2438d3 3101 /**
switches 0:5c4d7b2438d3 3102 * @brief Convolution of Q15 sequences.
switches 0:5c4d7b2438d3 3103 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3104 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3105 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3106 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3107 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3108 * @return none.
switches 0:5c4d7b2438d3 3109 */
switches 0:5c4d7b2438d3 3110
switches 0:5c4d7b2438d3 3111 void arm_conv_q15(
switches 0:5c4d7b2438d3 3112 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3113 uint32_t srcALen,
switches 0:5c4d7b2438d3 3114 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3115 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3116 q15_t * pDst);
switches 0:5c4d7b2438d3 3117
switches 0:5c4d7b2438d3 3118 /**
switches 0:5c4d7b2438d3 3119 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3120 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3121 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3122 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3123 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3124 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3125 * @return none.
switches 0:5c4d7b2438d3 3126 */
switches 0:5c4d7b2438d3 3127
switches 0:5c4d7b2438d3 3128 void arm_conv_fast_q15(
switches 0:5c4d7b2438d3 3129 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3130 uint32_t srcALen,
switches 0:5c4d7b2438d3 3131 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3132 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3133 q15_t * pDst);
switches 0:5c4d7b2438d3 3134
switches 0:5c4d7b2438d3 3135 /**
switches 0:5c4d7b2438d3 3136 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3137 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3138 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3139 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3140 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3141 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3142 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3143 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3144 * @return none.
switches 0:5c4d7b2438d3 3145 */
switches 0:5c4d7b2438d3 3146
switches 0:5c4d7b2438d3 3147 void arm_conv_fast_opt_q15(
switches 0:5c4d7b2438d3 3148 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3149 uint32_t srcALen,
switches 0:5c4d7b2438d3 3150 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3151 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3152 q15_t * pDst,
switches 0:5c4d7b2438d3 3153 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3154 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3155
switches 0:5c4d7b2438d3 3156
switches 0:5c4d7b2438d3 3157
switches 0:5c4d7b2438d3 3158 /**
switches 0:5c4d7b2438d3 3159 * @brief Convolution of Q31 sequences.
switches 0:5c4d7b2438d3 3160 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3161 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3162 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3163 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3164 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3165 * @return none.
switches 0:5c4d7b2438d3 3166 */
switches 0:5c4d7b2438d3 3167
switches 0:5c4d7b2438d3 3168 void arm_conv_q31(
switches 0:5c4d7b2438d3 3169 q31_t * pSrcA,
switches 0:5c4d7b2438d3 3170 uint32_t srcALen,
switches 0:5c4d7b2438d3 3171 q31_t * pSrcB,
switches 0:5c4d7b2438d3 3172 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3173 q31_t * pDst);
switches 0:5c4d7b2438d3 3174
switches 0:5c4d7b2438d3 3175 /**
switches 0:5c4d7b2438d3 3176 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3177 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3178 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3179 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3180 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3181 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3182 * @return none.
switches 0:5c4d7b2438d3 3183 */
switches 0:5c4d7b2438d3 3184
switches 0:5c4d7b2438d3 3185 void arm_conv_fast_q31(
switches 0:5c4d7b2438d3 3186 q31_t * pSrcA,
switches 0:5c4d7b2438d3 3187 uint32_t srcALen,
switches 0:5c4d7b2438d3 3188 q31_t * pSrcB,
switches 0:5c4d7b2438d3 3189 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3190 q31_t * pDst);
switches 0:5c4d7b2438d3 3191
switches 0:5c4d7b2438d3 3192
switches 0:5c4d7b2438d3 3193 /**
switches 0:5c4d7b2438d3 3194 * @brief Convolution of Q7 sequences.
switches 0:5c4d7b2438d3 3195 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3196 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3197 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3198 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3199 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3200 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3201 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3202 * @return none.
switches 0:5c4d7b2438d3 3203 */
switches 0:5c4d7b2438d3 3204
switches 0:5c4d7b2438d3 3205 void arm_conv_opt_q7(
switches 0:5c4d7b2438d3 3206 q7_t * pSrcA,
switches 0:5c4d7b2438d3 3207 uint32_t srcALen,
switches 0:5c4d7b2438d3 3208 q7_t * pSrcB,
switches 0:5c4d7b2438d3 3209 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3210 q7_t * pDst,
switches 0:5c4d7b2438d3 3211 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3212 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3213
switches 0:5c4d7b2438d3 3214
switches 0:5c4d7b2438d3 3215
switches 0:5c4d7b2438d3 3216 /**
switches 0:5c4d7b2438d3 3217 * @brief Convolution of Q7 sequences.
switches 0:5c4d7b2438d3 3218 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3219 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3220 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3221 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3222 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
switches 0:5c4d7b2438d3 3223 * @return none.
switches 0:5c4d7b2438d3 3224 */
switches 0:5c4d7b2438d3 3225
switches 0:5c4d7b2438d3 3226 void arm_conv_q7(
switches 0:5c4d7b2438d3 3227 q7_t * pSrcA,
switches 0:5c4d7b2438d3 3228 uint32_t srcALen,
switches 0:5c4d7b2438d3 3229 q7_t * pSrcB,
switches 0:5c4d7b2438d3 3230 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3231 q7_t * pDst);
switches 0:5c4d7b2438d3 3232
switches 0:5c4d7b2438d3 3233
switches 0:5c4d7b2438d3 3234 /**
switches 0:5c4d7b2438d3 3235 * @brief Partial convolution of floating-point sequences.
switches 0:5c4d7b2438d3 3236 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3237 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3238 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3239 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3240 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3241 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3242 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3243 * @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].
switches 0:5c4d7b2438d3 3244 */
switches 0:5c4d7b2438d3 3245
switches 0:5c4d7b2438d3 3246 arm_status arm_conv_partial_f32(
switches 0:5c4d7b2438d3 3247 float32_t * pSrcA,
switches 0:5c4d7b2438d3 3248 uint32_t srcALen,
switches 0:5c4d7b2438d3 3249 float32_t * pSrcB,
switches 0:5c4d7b2438d3 3250 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3251 float32_t * pDst,
switches 0:5c4d7b2438d3 3252 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3253 uint32_t numPoints);
switches 0:5c4d7b2438d3 3254
switches 0:5c4d7b2438d3 3255 /**
switches 0:5c4d7b2438d3 3256 * @brief Partial convolution of Q15 sequences.
switches 0:5c4d7b2438d3 3257 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3258 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3259 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3260 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3261 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3262 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3263 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3264 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3265 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3266 * @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].
switches 0:5c4d7b2438d3 3267 */
switches 0:5c4d7b2438d3 3268
switches 0:5c4d7b2438d3 3269 arm_status arm_conv_partial_opt_q15(
switches 0:5c4d7b2438d3 3270 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3271 uint32_t srcALen,
switches 0:5c4d7b2438d3 3272 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3273 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3274 q15_t * pDst,
switches 0:5c4d7b2438d3 3275 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3276 uint32_t numPoints,
switches 0:5c4d7b2438d3 3277 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3278 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3279
switches 0:5c4d7b2438d3 3280
switches 0:5c4d7b2438d3 3281 /**
switches 0:5c4d7b2438d3 3282 * @brief Partial convolution of Q15 sequences.
switches 0:5c4d7b2438d3 3283 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3284 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3285 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3286 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3287 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3288 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3289 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3290 * @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].
switches 0:5c4d7b2438d3 3291 */
switches 0:5c4d7b2438d3 3292
switches 0:5c4d7b2438d3 3293 arm_status arm_conv_partial_q15(
switches 0:5c4d7b2438d3 3294 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3295 uint32_t srcALen,
switches 0:5c4d7b2438d3 3296 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3297 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3298 q15_t * pDst,
switches 0:5c4d7b2438d3 3299 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3300 uint32_t numPoints);
switches 0:5c4d7b2438d3 3301
switches 0:5c4d7b2438d3 3302 /**
switches 0:5c4d7b2438d3 3303 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3304 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3305 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3306 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3307 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3308 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3309 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3310 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3311 * @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].
switches 0:5c4d7b2438d3 3312 */
switches 0:5c4d7b2438d3 3313
switches 0:5c4d7b2438d3 3314 arm_status arm_conv_partial_fast_q15(
switches 0:5c4d7b2438d3 3315 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3316 uint32_t srcALen,
switches 0:5c4d7b2438d3 3317 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3318 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3319 q15_t * pDst,
switches 0:5c4d7b2438d3 3320 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3321 uint32_t numPoints);
switches 0:5c4d7b2438d3 3322
switches 0:5c4d7b2438d3 3323
switches 0:5c4d7b2438d3 3324 /**
switches 0:5c4d7b2438d3 3325 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3326 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3327 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3328 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3329 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3330 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3331 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3332 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3333 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3334 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3335 * @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].
switches 0:5c4d7b2438d3 3336 */
switches 0:5c4d7b2438d3 3337
switches 0:5c4d7b2438d3 3338 arm_status arm_conv_partial_fast_opt_q15(
switches 0:5c4d7b2438d3 3339 q15_t * pSrcA,
switches 0:5c4d7b2438d3 3340 uint32_t srcALen,
switches 0:5c4d7b2438d3 3341 q15_t * pSrcB,
switches 0:5c4d7b2438d3 3342 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3343 q15_t * pDst,
switches 0:5c4d7b2438d3 3344 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3345 uint32_t numPoints,
switches 0:5c4d7b2438d3 3346 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3347 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3348
switches 0:5c4d7b2438d3 3349
switches 0:5c4d7b2438d3 3350 /**
switches 0:5c4d7b2438d3 3351 * @brief Partial convolution of Q31 sequences.
switches 0:5c4d7b2438d3 3352 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3353 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3354 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3355 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3356 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3357 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3358 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3359 * @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].
switches 0:5c4d7b2438d3 3360 */
switches 0:5c4d7b2438d3 3361
switches 0:5c4d7b2438d3 3362 arm_status arm_conv_partial_q31(
switches 0:5c4d7b2438d3 3363 q31_t * pSrcA,
switches 0:5c4d7b2438d3 3364 uint32_t srcALen,
switches 0:5c4d7b2438d3 3365 q31_t * pSrcB,
switches 0:5c4d7b2438d3 3366 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3367 q31_t * pDst,
switches 0:5c4d7b2438d3 3368 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3369 uint32_t numPoints);
switches 0:5c4d7b2438d3 3370
switches 0:5c4d7b2438d3 3371
switches 0:5c4d7b2438d3 3372 /**
switches 0:5c4d7b2438d3 3373 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 3374 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3375 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3376 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3377 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3378 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3379 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3380 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3381 * @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].
switches 0:5c4d7b2438d3 3382 */
switches 0:5c4d7b2438d3 3383
switches 0:5c4d7b2438d3 3384 arm_status arm_conv_partial_fast_q31(
switches 0:5c4d7b2438d3 3385 q31_t * pSrcA,
switches 0:5c4d7b2438d3 3386 uint32_t srcALen,
switches 0:5c4d7b2438d3 3387 q31_t * pSrcB,
switches 0:5c4d7b2438d3 3388 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3389 q31_t * pDst,
switches 0:5c4d7b2438d3 3390 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3391 uint32_t numPoints);
switches 0:5c4d7b2438d3 3392
switches 0:5c4d7b2438d3 3393
switches 0:5c4d7b2438d3 3394 /**
switches 0:5c4d7b2438d3 3395 * @brief Partial convolution of Q7 sequences
switches 0:5c4d7b2438d3 3396 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3397 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3398 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3399 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3400 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3401 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3402 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3403 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 3404 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 3405 * @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].
switches 0:5c4d7b2438d3 3406 */
switches 0:5c4d7b2438d3 3407
switches 0:5c4d7b2438d3 3408 arm_status arm_conv_partial_opt_q7(
switches 0:5c4d7b2438d3 3409 q7_t * pSrcA,
switches 0:5c4d7b2438d3 3410 uint32_t srcALen,
switches 0:5c4d7b2438d3 3411 q7_t * pSrcB,
switches 0:5c4d7b2438d3 3412 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3413 q7_t * pDst,
switches 0:5c4d7b2438d3 3414 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3415 uint32_t numPoints,
switches 0:5c4d7b2438d3 3416 q15_t * pScratch1,
switches 0:5c4d7b2438d3 3417 q15_t * pScratch2);
switches 0:5c4d7b2438d3 3418
switches 0:5c4d7b2438d3 3419
switches 0:5c4d7b2438d3 3420 /**
switches 0:5c4d7b2438d3 3421 * @brief Partial convolution of Q7 sequences.
switches 0:5c4d7b2438d3 3422 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 3423 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 3424 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 3425 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 3426 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3427 * @param[in] firstIndex is the first output sample to start with.
switches 0:5c4d7b2438d3 3428 * @param[in] numPoints is the number of output points to be computed.
switches 0:5c4d7b2438d3 3429 * @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].
switches 0:5c4d7b2438d3 3430 */
switches 0:5c4d7b2438d3 3431
switches 0:5c4d7b2438d3 3432 arm_status arm_conv_partial_q7(
switches 0:5c4d7b2438d3 3433 q7_t * pSrcA,
switches 0:5c4d7b2438d3 3434 uint32_t srcALen,
switches 0:5c4d7b2438d3 3435 q7_t * pSrcB,
switches 0:5c4d7b2438d3 3436 uint32_t srcBLen,
switches 0:5c4d7b2438d3 3437 q7_t * pDst,
switches 0:5c4d7b2438d3 3438 uint32_t firstIndex,
switches 0:5c4d7b2438d3 3439 uint32_t numPoints);
switches 0:5c4d7b2438d3 3440
switches 0:5c4d7b2438d3 3441
switches 0:5c4d7b2438d3 3442
switches 0:5c4d7b2438d3 3443 /**
switches 0:5c4d7b2438d3 3444 * @brief Instance structure for the Q15 FIR decimator.
switches 0:5c4d7b2438d3 3445 */
switches 0:5c4d7b2438d3 3446
switches 0:5c4d7b2438d3 3447 typedef struct
switches 0:5c4d7b2438d3 3448 {
switches 0:5c4d7b2438d3 3449 uint8_t M; /**< decimation factor. */
switches 0:5c4d7b2438d3 3450 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 3451 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 3452 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 3453 } arm_fir_decimate_instance_q15;
switches 0:5c4d7b2438d3 3454
switches 0:5c4d7b2438d3 3455 /**
switches 0:5c4d7b2438d3 3456 * @brief Instance structure for the Q31 FIR decimator.
switches 0:5c4d7b2438d3 3457 */
switches 0:5c4d7b2438d3 3458
switches 0:5c4d7b2438d3 3459 typedef struct
switches 0:5c4d7b2438d3 3460 {
switches 0:5c4d7b2438d3 3461 uint8_t M; /**< decimation factor. */
switches 0:5c4d7b2438d3 3462 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 3463 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 3464 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 3465
switches 0:5c4d7b2438d3 3466 } arm_fir_decimate_instance_q31;
switches 0:5c4d7b2438d3 3467
switches 0:5c4d7b2438d3 3468 /**
switches 0:5c4d7b2438d3 3469 * @brief Instance structure for the floating-point FIR decimator.
switches 0:5c4d7b2438d3 3470 */
switches 0:5c4d7b2438d3 3471
switches 0:5c4d7b2438d3 3472 typedef struct
switches 0:5c4d7b2438d3 3473 {
switches 0:5c4d7b2438d3 3474 uint8_t M; /**< decimation factor. */
switches 0:5c4d7b2438d3 3475 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 3476 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 3477 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 3478
switches 0:5c4d7b2438d3 3479 } arm_fir_decimate_instance_f32;
switches 0:5c4d7b2438d3 3480
switches 0:5c4d7b2438d3 3481
switches 0:5c4d7b2438d3 3482
switches 0:5c4d7b2438d3 3483 /**
switches 0:5c4d7b2438d3 3484 * @brief Processing function for the floating-point FIR decimator.
switches 0:5c4d7b2438d3 3485 * @param[in] *S points to an instance of the floating-point FIR decimator structure.
switches 0:5c4d7b2438d3 3486 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3487 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3488 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3489 * @return none
switches 0:5c4d7b2438d3 3490 */
switches 0:5c4d7b2438d3 3491
switches 0:5c4d7b2438d3 3492 void arm_fir_decimate_f32(
switches 0:5c4d7b2438d3 3493 const arm_fir_decimate_instance_f32 * S,
switches 0:5c4d7b2438d3 3494 float32_t * pSrc,
switches 0:5c4d7b2438d3 3495 float32_t * pDst,
switches 0:5c4d7b2438d3 3496 uint32_t blockSize);
switches 0:5c4d7b2438d3 3497
switches 0:5c4d7b2438d3 3498
switches 0:5c4d7b2438d3 3499 /**
switches 0:5c4d7b2438d3 3500 * @brief Initialization function for the floating-point FIR decimator.
switches 0:5c4d7b2438d3 3501 * @param[in,out] *S points to an instance of the floating-point FIR decimator structure.
switches 0:5c4d7b2438d3 3502 * @param[in] numTaps number of coefficients in the filter.
switches 0:5c4d7b2438d3 3503 * @param[in] M decimation factor.
switches 0:5c4d7b2438d3 3504 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3505 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3506 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3507 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3508 * <code>blockSize</code> is not a multiple of <code>M</code>.
switches 0:5c4d7b2438d3 3509 */
switches 0:5c4d7b2438d3 3510
switches 0:5c4d7b2438d3 3511 arm_status arm_fir_decimate_init_f32(
switches 0:5c4d7b2438d3 3512 arm_fir_decimate_instance_f32 * S,
switches 0:5c4d7b2438d3 3513 uint16_t numTaps,
switches 0:5c4d7b2438d3 3514 uint8_t M,
switches 0:5c4d7b2438d3 3515 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 3516 float32_t * pState,
switches 0:5c4d7b2438d3 3517 uint32_t blockSize);
switches 0:5c4d7b2438d3 3518
switches 0:5c4d7b2438d3 3519 /**
switches 0:5c4d7b2438d3 3520 * @brief Processing function for the Q15 FIR decimator.
switches 0:5c4d7b2438d3 3521 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
switches 0:5c4d7b2438d3 3522 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3523 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3524 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3525 * @return none
switches 0:5c4d7b2438d3 3526 */
switches 0:5c4d7b2438d3 3527
switches 0:5c4d7b2438d3 3528 void arm_fir_decimate_q15(
switches 0:5c4d7b2438d3 3529 const arm_fir_decimate_instance_q15 * S,
switches 0:5c4d7b2438d3 3530 q15_t * pSrc,
switches 0:5c4d7b2438d3 3531 q15_t * pDst,
switches 0:5c4d7b2438d3 3532 uint32_t blockSize);
switches 0:5c4d7b2438d3 3533
switches 0:5c4d7b2438d3 3534 /**
switches 0:5c4d7b2438d3 3535 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 3536 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
switches 0:5c4d7b2438d3 3537 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3538 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3539 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3540 * @return none
switches 0:5c4d7b2438d3 3541 */
switches 0:5c4d7b2438d3 3542
switches 0:5c4d7b2438d3 3543 void arm_fir_decimate_fast_q15(
switches 0:5c4d7b2438d3 3544 const arm_fir_decimate_instance_q15 * S,
switches 0:5c4d7b2438d3 3545 q15_t * pSrc,
switches 0:5c4d7b2438d3 3546 q15_t * pDst,
switches 0:5c4d7b2438d3 3547 uint32_t blockSize);
switches 0:5c4d7b2438d3 3548
switches 0:5c4d7b2438d3 3549
switches 0:5c4d7b2438d3 3550
switches 0:5c4d7b2438d3 3551 /**
switches 0:5c4d7b2438d3 3552 * @brief Initialization function for the Q15 FIR decimator.
switches 0:5c4d7b2438d3 3553 * @param[in,out] *S points to an instance of the Q15 FIR decimator structure.
switches 0:5c4d7b2438d3 3554 * @param[in] numTaps number of coefficients in the filter.
switches 0:5c4d7b2438d3 3555 * @param[in] M decimation factor.
switches 0:5c4d7b2438d3 3556 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3557 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3558 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3559 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3560 * <code>blockSize</code> is not a multiple of <code>M</code>.
switches 0:5c4d7b2438d3 3561 */
switches 0:5c4d7b2438d3 3562
switches 0:5c4d7b2438d3 3563 arm_status arm_fir_decimate_init_q15(
switches 0:5c4d7b2438d3 3564 arm_fir_decimate_instance_q15 * S,
switches 0:5c4d7b2438d3 3565 uint16_t numTaps,
switches 0:5c4d7b2438d3 3566 uint8_t M,
switches 0:5c4d7b2438d3 3567 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 3568 q15_t * pState,
switches 0:5c4d7b2438d3 3569 uint32_t blockSize);
switches 0:5c4d7b2438d3 3570
switches 0:5c4d7b2438d3 3571 /**
switches 0:5c4d7b2438d3 3572 * @brief Processing function for the Q31 FIR decimator.
switches 0:5c4d7b2438d3 3573 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
switches 0:5c4d7b2438d3 3574 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3575 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3576 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3577 * @return none
switches 0:5c4d7b2438d3 3578 */
switches 0:5c4d7b2438d3 3579
switches 0:5c4d7b2438d3 3580 void arm_fir_decimate_q31(
switches 0:5c4d7b2438d3 3581 const arm_fir_decimate_instance_q31 * S,
switches 0:5c4d7b2438d3 3582 q31_t * pSrc,
switches 0:5c4d7b2438d3 3583 q31_t * pDst,
switches 0:5c4d7b2438d3 3584 uint32_t blockSize);
switches 0:5c4d7b2438d3 3585
switches 0:5c4d7b2438d3 3586 /**
switches 0:5c4d7b2438d3 3587 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 3588 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
switches 0:5c4d7b2438d3 3589 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3590 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3591 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3592 * @return none
switches 0:5c4d7b2438d3 3593 */
switches 0:5c4d7b2438d3 3594
switches 0:5c4d7b2438d3 3595 void arm_fir_decimate_fast_q31(
switches 0:5c4d7b2438d3 3596 arm_fir_decimate_instance_q31 * S,
switches 0:5c4d7b2438d3 3597 q31_t * pSrc,
switches 0:5c4d7b2438d3 3598 q31_t * pDst,
switches 0:5c4d7b2438d3 3599 uint32_t blockSize);
switches 0:5c4d7b2438d3 3600
switches 0:5c4d7b2438d3 3601
switches 0:5c4d7b2438d3 3602 /**
switches 0:5c4d7b2438d3 3603 * @brief Initialization function for the Q31 FIR decimator.
switches 0:5c4d7b2438d3 3604 * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
switches 0:5c4d7b2438d3 3605 * @param[in] numTaps number of coefficients in the filter.
switches 0:5c4d7b2438d3 3606 * @param[in] M decimation factor.
switches 0:5c4d7b2438d3 3607 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3608 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3609 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3610 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3611 * <code>blockSize</code> is not a multiple of <code>M</code>.
switches 0:5c4d7b2438d3 3612 */
switches 0:5c4d7b2438d3 3613
switches 0:5c4d7b2438d3 3614 arm_status arm_fir_decimate_init_q31(
switches 0:5c4d7b2438d3 3615 arm_fir_decimate_instance_q31 * S,
switches 0:5c4d7b2438d3 3616 uint16_t numTaps,
switches 0:5c4d7b2438d3 3617 uint8_t M,
switches 0:5c4d7b2438d3 3618 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 3619 q31_t * pState,
switches 0:5c4d7b2438d3 3620 uint32_t blockSize);
switches 0:5c4d7b2438d3 3621
switches 0:5c4d7b2438d3 3622
switches 0:5c4d7b2438d3 3623
switches 0:5c4d7b2438d3 3624 /**
switches 0:5c4d7b2438d3 3625 * @brief Instance structure for the Q15 FIR interpolator.
switches 0:5c4d7b2438d3 3626 */
switches 0:5c4d7b2438d3 3627
switches 0:5c4d7b2438d3 3628 typedef struct
switches 0:5c4d7b2438d3 3629 {
switches 0:5c4d7b2438d3 3630 uint8_t L; /**< upsample factor. */
switches 0:5c4d7b2438d3 3631 uint16_t phaseLength; /**< length of each polyphase filter component. */
switches 0:5c4d7b2438d3 3632 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
switches 0:5c4d7b2438d3 3633 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
switches 0:5c4d7b2438d3 3634 } arm_fir_interpolate_instance_q15;
switches 0:5c4d7b2438d3 3635
switches 0:5c4d7b2438d3 3636 /**
switches 0:5c4d7b2438d3 3637 * @brief Instance structure for the Q31 FIR interpolator.
switches 0:5c4d7b2438d3 3638 */
switches 0:5c4d7b2438d3 3639
switches 0:5c4d7b2438d3 3640 typedef struct
switches 0:5c4d7b2438d3 3641 {
switches 0:5c4d7b2438d3 3642 uint8_t L; /**< upsample factor. */
switches 0:5c4d7b2438d3 3643 uint16_t phaseLength; /**< length of each polyphase filter component. */
switches 0:5c4d7b2438d3 3644 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
switches 0:5c4d7b2438d3 3645 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
switches 0:5c4d7b2438d3 3646 } arm_fir_interpolate_instance_q31;
switches 0:5c4d7b2438d3 3647
switches 0:5c4d7b2438d3 3648 /**
switches 0:5c4d7b2438d3 3649 * @brief Instance structure for the floating-point FIR interpolator.
switches 0:5c4d7b2438d3 3650 */
switches 0:5c4d7b2438d3 3651
switches 0:5c4d7b2438d3 3652 typedef struct
switches 0:5c4d7b2438d3 3653 {
switches 0:5c4d7b2438d3 3654 uint8_t L; /**< upsample factor. */
switches 0:5c4d7b2438d3 3655 uint16_t phaseLength; /**< length of each polyphase filter component. */
switches 0:5c4d7b2438d3 3656 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
switches 0:5c4d7b2438d3 3657 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
switches 0:5c4d7b2438d3 3658 } arm_fir_interpolate_instance_f32;
switches 0:5c4d7b2438d3 3659
switches 0:5c4d7b2438d3 3660
switches 0:5c4d7b2438d3 3661 /**
switches 0:5c4d7b2438d3 3662 * @brief Processing function for the Q15 FIR interpolator.
switches 0:5c4d7b2438d3 3663 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
switches 0:5c4d7b2438d3 3664 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3665 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 3666 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3667 * @return none.
switches 0:5c4d7b2438d3 3668 */
switches 0:5c4d7b2438d3 3669
switches 0:5c4d7b2438d3 3670 void arm_fir_interpolate_q15(
switches 0:5c4d7b2438d3 3671 const arm_fir_interpolate_instance_q15 * S,
switches 0:5c4d7b2438d3 3672 q15_t * pSrc,
switches 0:5c4d7b2438d3 3673 q15_t * pDst,
switches 0:5c4d7b2438d3 3674 uint32_t blockSize);
switches 0:5c4d7b2438d3 3675
switches 0:5c4d7b2438d3 3676
switches 0:5c4d7b2438d3 3677 /**
switches 0:5c4d7b2438d3 3678 * @brief Initialization function for the Q15 FIR interpolator.
switches 0:5c4d7b2438d3 3679 * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure.
switches 0:5c4d7b2438d3 3680 * @param[in] L upsample factor.
switches 0:5c4d7b2438d3 3681 * @param[in] numTaps number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 3682 * @param[in] *pCoeffs points to the filter coefficient buffer.
switches 0:5c4d7b2438d3 3683 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3684 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3685 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3686 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
switches 0:5c4d7b2438d3 3687 */
switches 0:5c4d7b2438d3 3688
switches 0:5c4d7b2438d3 3689 arm_status arm_fir_interpolate_init_q15(
switches 0:5c4d7b2438d3 3690 arm_fir_interpolate_instance_q15 * S,
switches 0:5c4d7b2438d3 3691 uint8_t L,
switches 0:5c4d7b2438d3 3692 uint16_t numTaps,
switches 0:5c4d7b2438d3 3693 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 3694 q15_t * pState,
switches 0:5c4d7b2438d3 3695 uint32_t blockSize);
switches 0:5c4d7b2438d3 3696
switches 0:5c4d7b2438d3 3697 /**
switches 0:5c4d7b2438d3 3698 * @brief Processing function for the Q31 FIR interpolator.
switches 0:5c4d7b2438d3 3699 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
switches 0:5c4d7b2438d3 3700 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3701 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 3702 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3703 * @return none.
switches 0:5c4d7b2438d3 3704 */
switches 0:5c4d7b2438d3 3705
switches 0:5c4d7b2438d3 3706 void arm_fir_interpolate_q31(
switches 0:5c4d7b2438d3 3707 const arm_fir_interpolate_instance_q31 * S,
switches 0:5c4d7b2438d3 3708 q31_t * pSrc,
switches 0:5c4d7b2438d3 3709 q31_t * pDst,
switches 0:5c4d7b2438d3 3710 uint32_t blockSize);
switches 0:5c4d7b2438d3 3711
switches 0:5c4d7b2438d3 3712 /**
switches 0:5c4d7b2438d3 3713 * @brief Initialization function for the Q31 FIR interpolator.
switches 0:5c4d7b2438d3 3714 * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure.
switches 0:5c4d7b2438d3 3715 * @param[in] L upsample factor.
switches 0:5c4d7b2438d3 3716 * @param[in] numTaps number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 3717 * @param[in] *pCoeffs points to the filter coefficient buffer.
switches 0:5c4d7b2438d3 3718 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3719 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3720 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3721 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
switches 0:5c4d7b2438d3 3722 */
switches 0:5c4d7b2438d3 3723
switches 0:5c4d7b2438d3 3724 arm_status arm_fir_interpolate_init_q31(
switches 0:5c4d7b2438d3 3725 arm_fir_interpolate_instance_q31 * S,
switches 0:5c4d7b2438d3 3726 uint8_t L,
switches 0:5c4d7b2438d3 3727 uint16_t numTaps,
switches 0:5c4d7b2438d3 3728 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 3729 q31_t * pState,
switches 0:5c4d7b2438d3 3730 uint32_t blockSize);
switches 0:5c4d7b2438d3 3731
switches 0:5c4d7b2438d3 3732
switches 0:5c4d7b2438d3 3733 /**
switches 0:5c4d7b2438d3 3734 * @brief Processing function for the floating-point FIR interpolator.
switches 0:5c4d7b2438d3 3735 * @param[in] *S points to an instance of the floating-point FIR interpolator structure.
switches 0:5c4d7b2438d3 3736 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3737 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 3738 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3739 * @return none.
switches 0:5c4d7b2438d3 3740 */
switches 0:5c4d7b2438d3 3741
switches 0:5c4d7b2438d3 3742 void arm_fir_interpolate_f32(
switches 0:5c4d7b2438d3 3743 const arm_fir_interpolate_instance_f32 * S,
switches 0:5c4d7b2438d3 3744 float32_t * pSrc,
switches 0:5c4d7b2438d3 3745 float32_t * pDst,
switches 0:5c4d7b2438d3 3746 uint32_t blockSize);
switches 0:5c4d7b2438d3 3747
switches 0:5c4d7b2438d3 3748 /**
switches 0:5c4d7b2438d3 3749 * @brief Initialization function for the floating-point FIR interpolator.
switches 0:5c4d7b2438d3 3750 * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure.
switches 0:5c4d7b2438d3 3751 * @param[in] L upsample factor.
switches 0:5c4d7b2438d3 3752 * @param[in] numTaps number of filter coefficients in the filter.
switches 0:5c4d7b2438d3 3753 * @param[in] *pCoeffs points to the filter coefficient buffer.
switches 0:5c4d7b2438d3 3754 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3755 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 3756 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
switches 0:5c4d7b2438d3 3757 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
switches 0:5c4d7b2438d3 3758 */
switches 0:5c4d7b2438d3 3759
switches 0:5c4d7b2438d3 3760 arm_status arm_fir_interpolate_init_f32(
switches 0:5c4d7b2438d3 3761 arm_fir_interpolate_instance_f32 * S,
switches 0:5c4d7b2438d3 3762 uint8_t L,
switches 0:5c4d7b2438d3 3763 uint16_t numTaps,
switches 0:5c4d7b2438d3 3764 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 3765 float32_t * pState,
switches 0:5c4d7b2438d3 3766 uint32_t blockSize);
switches 0:5c4d7b2438d3 3767
switches 0:5c4d7b2438d3 3768 /**
switches 0:5c4d7b2438d3 3769 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
switches 0:5c4d7b2438d3 3770 */
switches 0:5c4d7b2438d3 3771
switches 0:5c4d7b2438d3 3772 typedef struct
switches 0:5c4d7b2438d3 3773 {
switches 0:5c4d7b2438d3 3774 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 3775 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
switches 0:5c4d7b2438d3 3776 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 3777 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
switches 0:5c4d7b2438d3 3778
switches 0:5c4d7b2438d3 3779 } arm_biquad_cas_df1_32x64_ins_q31;
switches 0:5c4d7b2438d3 3780
switches 0:5c4d7b2438d3 3781
switches 0:5c4d7b2438d3 3782 /**
switches 0:5c4d7b2438d3 3783 * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
switches 0:5c4d7b2438d3 3784 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3785 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3786 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 3787 * @return none.
switches 0:5c4d7b2438d3 3788 */
switches 0:5c4d7b2438d3 3789
switches 0:5c4d7b2438d3 3790 void arm_biquad_cas_df1_32x64_q31(
switches 0:5c4d7b2438d3 3791 const arm_biquad_cas_df1_32x64_ins_q31 * S,
switches 0:5c4d7b2438d3 3792 q31_t * pSrc,
switches 0:5c4d7b2438d3 3793 q31_t * pDst,
switches 0:5c4d7b2438d3 3794 uint32_t blockSize);
switches 0:5c4d7b2438d3 3795
switches 0:5c4d7b2438d3 3796
switches 0:5c4d7b2438d3 3797 /**
switches 0:5c4d7b2438d3 3798 * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
switches 0:5c4d7b2438d3 3799 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 3800 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3801 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3802 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
switches 0:5c4d7b2438d3 3803 * @return none
switches 0:5c4d7b2438d3 3804 */
switches 0:5c4d7b2438d3 3805
switches 0:5c4d7b2438d3 3806 void arm_biquad_cas_df1_32x64_init_q31(
switches 0:5c4d7b2438d3 3807 arm_biquad_cas_df1_32x64_ins_q31 * S,
switches 0:5c4d7b2438d3 3808 uint8_t numStages,
switches 0:5c4d7b2438d3 3809 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 3810 q63_t * pState,
switches 0:5c4d7b2438d3 3811 uint8_t postShift);
switches 0:5c4d7b2438d3 3812
switches 0:5c4d7b2438d3 3813
switches 0:5c4d7b2438d3 3814
switches 0:5c4d7b2438d3 3815 /**
switches 0:5c4d7b2438d3 3816 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3817 */
switches 0:5c4d7b2438d3 3818
switches 0:5c4d7b2438d3 3819 typedef struct
switches 0:5c4d7b2438d3 3820 {
switches 0:5c4d7b2438d3 3821 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 3822 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
switches 0:5c4d7b2438d3 3823 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 3824 } arm_biquad_cascade_df2T_instance_f32;
switches 0:5c4d7b2438d3 3825
switches 0:5c4d7b2438d3 3826
switches 0:5c4d7b2438d3 3827
switches 0:5c4d7b2438d3 3828 /**
switches 0:5c4d7b2438d3 3829 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3830 */
switches 0:5c4d7b2438d3 3831
switches 0:5c4d7b2438d3 3832 typedef struct
switches 0:5c4d7b2438d3 3833 {
switches 0:5c4d7b2438d3 3834 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 3835 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
switches 0:5c4d7b2438d3 3836 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 3837 } arm_biquad_cascade_stereo_df2T_instance_f32;
switches 0:5c4d7b2438d3 3838
switches 0:5c4d7b2438d3 3839
switches 0:5c4d7b2438d3 3840
switches 0:5c4d7b2438d3 3841 /**
switches 0:5c4d7b2438d3 3842 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3843 */
switches 0:5c4d7b2438d3 3844
switches 0:5c4d7b2438d3 3845 typedef struct
switches 0:5c4d7b2438d3 3846 {
switches 0:5c4d7b2438d3 3847 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
switches 0:5c4d7b2438d3 3848 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
switches 0:5c4d7b2438d3 3849 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
switches 0:5c4d7b2438d3 3850 } arm_biquad_cascade_df2T_instance_f64;
switches 0:5c4d7b2438d3 3851
switches 0:5c4d7b2438d3 3852
switches 0:5c4d7b2438d3 3853 /**
switches 0:5c4d7b2438d3 3854 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3855 * @param[in] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3856 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3857 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3858 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 3859 * @return none.
switches 0:5c4d7b2438d3 3860 */
switches 0:5c4d7b2438d3 3861
switches 0:5c4d7b2438d3 3862 void arm_biquad_cascade_df2T_f32(
switches 0:5c4d7b2438d3 3863 const arm_biquad_cascade_df2T_instance_f32 * S,
switches 0:5c4d7b2438d3 3864 float32_t * pSrc,
switches 0:5c4d7b2438d3 3865 float32_t * pDst,
switches 0:5c4d7b2438d3 3866 uint32_t blockSize);
switches 0:5c4d7b2438d3 3867
switches 0:5c4d7b2438d3 3868
switches 0:5c4d7b2438d3 3869 /**
switches 0:5c4d7b2438d3 3870 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
switches 0:5c4d7b2438d3 3871 * @param[in] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3872 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3873 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3874 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 3875 * @return none.
switches 0:5c4d7b2438d3 3876 */
switches 0:5c4d7b2438d3 3877
switches 0:5c4d7b2438d3 3878 void arm_biquad_cascade_stereo_df2T_f32(
switches 0:5c4d7b2438d3 3879 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
switches 0:5c4d7b2438d3 3880 float32_t * pSrc,
switches 0:5c4d7b2438d3 3881 float32_t * pDst,
switches 0:5c4d7b2438d3 3882 uint32_t blockSize);
switches 0:5c4d7b2438d3 3883
switches 0:5c4d7b2438d3 3884 /**
switches 0:5c4d7b2438d3 3885 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3886 * @param[in] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3887 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 3888 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 3889 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 3890 * @return none.
switches 0:5c4d7b2438d3 3891 */
switches 0:5c4d7b2438d3 3892
switches 0:5c4d7b2438d3 3893 void arm_biquad_cascade_df2T_f64(
switches 0:5c4d7b2438d3 3894 const arm_biquad_cascade_df2T_instance_f64 * S,
switches 0:5c4d7b2438d3 3895 float64_t * pSrc,
switches 0:5c4d7b2438d3 3896 float64_t * pDst,
switches 0:5c4d7b2438d3 3897 uint32_t blockSize);
switches 0:5c4d7b2438d3 3898
switches 0:5c4d7b2438d3 3899
switches 0:5c4d7b2438d3 3900 /**
switches 0:5c4d7b2438d3 3901 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3902 * @param[in,out] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3903 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 3904 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3905 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3906 * @return none
switches 0:5c4d7b2438d3 3907 */
switches 0:5c4d7b2438d3 3908
switches 0:5c4d7b2438d3 3909 void arm_biquad_cascade_df2T_init_f32(
switches 0:5c4d7b2438d3 3910 arm_biquad_cascade_df2T_instance_f32 * S,
switches 0:5c4d7b2438d3 3911 uint8_t numStages,
switches 0:5c4d7b2438d3 3912 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 3913 float32_t * pState);
switches 0:5c4d7b2438d3 3914
switches 0:5c4d7b2438d3 3915
switches 0:5c4d7b2438d3 3916 /**
switches 0:5c4d7b2438d3 3917 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3918 * @param[in,out] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3919 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 3920 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3921 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3922 * @return none
switches 0:5c4d7b2438d3 3923 */
switches 0:5c4d7b2438d3 3924
switches 0:5c4d7b2438d3 3925 void arm_biquad_cascade_stereo_df2T_init_f32(
switches 0:5c4d7b2438d3 3926 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
switches 0:5c4d7b2438d3 3927 uint8_t numStages,
switches 0:5c4d7b2438d3 3928 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 3929 float32_t * pState);
switches 0:5c4d7b2438d3 3930
switches 0:5c4d7b2438d3 3931
switches 0:5c4d7b2438d3 3932 /**
switches 0:5c4d7b2438d3 3933 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
switches 0:5c4d7b2438d3 3934 * @param[in,out] *S points to an instance of the filter data structure.
switches 0:5c4d7b2438d3 3935 * @param[in] numStages number of 2nd order stages in the filter.
switches 0:5c4d7b2438d3 3936 * @param[in] *pCoeffs points to the filter coefficients.
switches 0:5c4d7b2438d3 3937 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 3938 * @return none
switches 0:5c4d7b2438d3 3939 */
switches 0:5c4d7b2438d3 3940
switches 0:5c4d7b2438d3 3941 void arm_biquad_cascade_df2T_init_f64(
switches 0:5c4d7b2438d3 3942 arm_biquad_cascade_df2T_instance_f64 * S,
switches 0:5c4d7b2438d3 3943 uint8_t numStages,
switches 0:5c4d7b2438d3 3944 float64_t * pCoeffs,
switches 0:5c4d7b2438d3 3945 float64_t * pState);
switches 0:5c4d7b2438d3 3946
switches 0:5c4d7b2438d3 3947
switches 0:5c4d7b2438d3 3948
switches 0:5c4d7b2438d3 3949 /**
switches 0:5c4d7b2438d3 3950 * @brief Instance structure for the Q15 FIR lattice filter.
switches 0:5c4d7b2438d3 3951 */
switches 0:5c4d7b2438d3 3952
switches 0:5c4d7b2438d3 3953 typedef struct
switches 0:5c4d7b2438d3 3954 {
switches 0:5c4d7b2438d3 3955 uint16_t numStages; /**< number of filter stages. */
switches 0:5c4d7b2438d3 3956 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3957 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3958 } arm_fir_lattice_instance_q15;
switches 0:5c4d7b2438d3 3959
switches 0:5c4d7b2438d3 3960 /**
switches 0:5c4d7b2438d3 3961 * @brief Instance structure for the Q31 FIR lattice filter.
switches 0:5c4d7b2438d3 3962 */
switches 0:5c4d7b2438d3 3963
switches 0:5c4d7b2438d3 3964 typedef struct
switches 0:5c4d7b2438d3 3965 {
switches 0:5c4d7b2438d3 3966 uint16_t numStages; /**< number of filter stages. */
switches 0:5c4d7b2438d3 3967 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3968 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3969 } arm_fir_lattice_instance_q31;
switches 0:5c4d7b2438d3 3970
switches 0:5c4d7b2438d3 3971 /**
switches 0:5c4d7b2438d3 3972 * @brief Instance structure for the floating-point FIR lattice filter.
switches 0:5c4d7b2438d3 3973 */
switches 0:5c4d7b2438d3 3974
switches 0:5c4d7b2438d3 3975 typedef struct
switches 0:5c4d7b2438d3 3976 {
switches 0:5c4d7b2438d3 3977 uint16_t numStages; /**< number of filter stages. */
switches 0:5c4d7b2438d3 3978 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3979 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 3980 } arm_fir_lattice_instance_f32;
switches 0:5c4d7b2438d3 3981
switches 0:5c4d7b2438d3 3982 /**
switches 0:5c4d7b2438d3 3983 * @brief Initialization function for the Q15 FIR lattice filter.
switches 0:5c4d7b2438d3 3984 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
switches 0:5c4d7b2438d3 3985 * @param[in] numStages number of filter stages.
switches 0:5c4d7b2438d3 3986 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 3987 * @param[in] *pState points to the state buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 3988 * @return none.
switches 0:5c4d7b2438d3 3989 */
switches 0:5c4d7b2438d3 3990
switches 0:5c4d7b2438d3 3991 void arm_fir_lattice_init_q15(
switches 0:5c4d7b2438d3 3992 arm_fir_lattice_instance_q15 * S,
switches 0:5c4d7b2438d3 3993 uint16_t numStages,
switches 0:5c4d7b2438d3 3994 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 3995 q15_t * pState);
switches 0:5c4d7b2438d3 3996
switches 0:5c4d7b2438d3 3997
switches 0:5c4d7b2438d3 3998 /**
switches 0:5c4d7b2438d3 3999 * @brief Processing function for the Q15 FIR lattice filter.
switches 0:5c4d7b2438d3 4000 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
switches 0:5c4d7b2438d3 4001 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4002 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 4003 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4004 * @return none.
switches 0:5c4d7b2438d3 4005 */
switches 0:5c4d7b2438d3 4006 void arm_fir_lattice_q15(
switches 0:5c4d7b2438d3 4007 const arm_fir_lattice_instance_q15 * S,
switches 0:5c4d7b2438d3 4008 q15_t * pSrc,
switches 0:5c4d7b2438d3 4009 q15_t * pDst,
switches 0:5c4d7b2438d3 4010 uint32_t blockSize);
switches 0:5c4d7b2438d3 4011
switches 0:5c4d7b2438d3 4012 /**
switches 0:5c4d7b2438d3 4013 * @brief Initialization function for the Q31 FIR lattice filter.
switches 0:5c4d7b2438d3 4014 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
switches 0:5c4d7b2438d3 4015 * @param[in] numStages number of filter stages.
switches 0:5c4d7b2438d3 4016 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4017 * @param[in] *pState points to the state buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4018 * @return none.
switches 0:5c4d7b2438d3 4019 */
switches 0:5c4d7b2438d3 4020
switches 0:5c4d7b2438d3 4021 void arm_fir_lattice_init_q31(
switches 0:5c4d7b2438d3 4022 arm_fir_lattice_instance_q31 * S,
switches 0:5c4d7b2438d3 4023 uint16_t numStages,
switches 0:5c4d7b2438d3 4024 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 4025 q31_t * pState);
switches 0:5c4d7b2438d3 4026
switches 0:5c4d7b2438d3 4027
switches 0:5c4d7b2438d3 4028 /**
switches 0:5c4d7b2438d3 4029 * @brief Processing function for the Q31 FIR lattice filter.
switches 0:5c4d7b2438d3 4030 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
switches 0:5c4d7b2438d3 4031 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4032 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4033 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4034 * @return none.
switches 0:5c4d7b2438d3 4035 */
switches 0:5c4d7b2438d3 4036
switches 0:5c4d7b2438d3 4037 void arm_fir_lattice_q31(
switches 0:5c4d7b2438d3 4038 const arm_fir_lattice_instance_q31 * S,
switches 0:5c4d7b2438d3 4039 q31_t * pSrc,
switches 0:5c4d7b2438d3 4040 q31_t * pDst,
switches 0:5c4d7b2438d3 4041 uint32_t blockSize);
switches 0:5c4d7b2438d3 4042
switches 0:5c4d7b2438d3 4043 /**
switches 0:5c4d7b2438d3 4044 * @brief Initialization function for the floating-point FIR lattice filter.
switches 0:5c4d7b2438d3 4045 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
switches 0:5c4d7b2438d3 4046 * @param[in] numStages number of filter stages.
switches 0:5c4d7b2438d3 4047 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4048 * @param[in] *pState points to the state buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4049 * @return none.
switches 0:5c4d7b2438d3 4050 */
switches 0:5c4d7b2438d3 4051
switches 0:5c4d7b2438d3 4052 void arm_fir_lattice_init_f32(
switches 0:5c4d7b2438d3 4053 arm_fir_lattice_instance_f32 * S,
switches 0:5c4d7b2438d3 4054 uint16_t numStages,
switches 0:5c4d7b2438d3 4055 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 4056 float32_t * pState);
switches 0:5c4d7b2438d3 4057
switches 0:5c4d7b2438d3 4058 /**
switches 0:5c4d7b2438d3 4059 * @brief Processing function for the floating-point FIR lattice filter.
switches 0:5c4d7b2438d3 4060 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
switches 0:5c4d7b2438d3 4061 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4062 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4063 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4064 * @return none.
switches 0:5c4d7b2438d3 4065 */
switches 0:5c4d7b2438d3 4066
switches 0:5c4d7b2438d3 4067 void arm_fir_lattice_f32(
switches 0:5c4d7b2438d3 4068 const arm_fir_lattice_instance_f32 * S,
switches 0:5c4d7b2438d3 4069 float32_t * pSrc,
switches 0:5c4d7b2438d3 4070 float32_t * pDst,
switches 0:5c4d7b2438d3 4071 uint32_t blockSize);
switches 0:5c4d7b2438d3 4072
switches 0:5c4d7b2438d3 4073 /**
switches 0:5c4d7b2438d3 4074 * @brief Instance structure for the Q15 IIR lattice filter.
switches 0:5c4d7b2438d3 4075 */
switches 0:5c4d7b2438d3 4076 typedef struct
switches 0:5c4d7b2438d3 4077 {
switches 0:5c4d7b2438d3 4078 uint16_t numStages; /**< number of stages in the filter. */
switches 0:5c4d7b2438d3 4079 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
switches 0:5c4d7b2438d3 4080 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 4081 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
switches 0:5c4d7b2438d3 4082 } arm_iir_lattice_instance_q15;
switches 0:5c4d7b2438d3 4083
switches 0:5c4d7b2438d3 4084 /**
switches 0:5c4d7b2438d3 4085 * @brief Instance structure for the Q31 IIR lattice filter.
switches 0:5c4d7b2438d3 4086 */
switches 0:5c4d7b2438d3 4087 typedef struct
switches 0:5c4d7b2438d3 4088 {
switches 0:5c4d7b2438d3 4089 uint16_t numStages; /**< number of stages in the filter. */
switches 0:5c4d7b2438d3 4090 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
switches 0:5c4d7b2438d3 4091 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 4092 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
switches 0:5c4d7b2438d3 4093 } arm_iir_lattice_instance_q31;
switches 0:5c4d7b2438d3 4094
switches 0:5c4d7b2438d3 4095 /**
switches 0:5c4d7b2438d3 4096 * @brief Instance structure for the floating-point IIR lattice filter.
switches 0:5c4d7b2438d3 4097 */
switches 0:5c4d7b2438d3 4098 typedef struct
switches 0:5c4d7b2438d3 4099 {
switches 0:5c4d7b2438d3 4100 uint16_t numStages; /**< number of stages in the filter. */
switches 0:5c4d7b2438d3 4101 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
switches 0:5c4d7b2438d3 4102 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
switches 0:5c4d7b2438d3 4103 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
switches 0:5c4d7b2438d3 4104 } arm_iir_lattice_instance_f32;
switches 0:5c4d7b2438d3 4105
switches 0:5c4d7b2438d3 4106 /**
switches 0:5c4d7b2438d3 4107 * @brief Processing function for the floating-point IIR lattice filter.
switches 0:5c4d7b2438d3 4108 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
switches 0:5c4d7b2438d3 4109 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4110 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 4111 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4112 * @return none.
switches 0:5c4d7b2438d3 4113 */
switches 0:5c4d7b2438d3 4114
switches 0:5c4d7b2438d3 4115 void arm_iir_lattice_f32(
switches 0:5c4d7b2438d3 4116 const arm_iir_lattice_instance_f32 * S,
switches 0:5c4d7b2438d3 4117 float32_t * pSrc,
switches 0:5c4d7b2438d3 4118 float32_t * pDst,
switches 0:5c4d7b2438d3 4119 uint32_t blockSize);
switches 0:5c4d7b2438d3 4120
switches 0:5c4d7b2438d3 4121 /**
switches 0:5c4d7b2438d3 4122 * @brief Initialization function for the floating-point IIR lattice filter.
switches 0:5c4d7b2438d3 4123 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
switches 0:5c4d7b2438d3 4124 * @param[in] numStages number of stages in the filter.
switches 0:5c4d7b2438d3 4125 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4126 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
switches 0:5c4d7b2438d3 4127 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1.
switches 0:5c4d7b2438d3 4128 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4129 * @return none.
switches 0:5c4d7b2438d3 4130 */
switches 0:5c4d7b2438d3 4131
switches 0:5c4d7b2438d3 4132 void arm_iir_lattice_init_f32(
switches 0:5c4d7b2438d3 4133 arm_iir_lattice_instance_f32 * S,
switches 0:5c4d7b2438d3 4134 uint16_t numStages,
switches 0:5c4d7b2438d3 4135 float32_t * pkCoeffs,
switches 0:5c4d7b2438d3 4136 float32_t * pvCoeffs,
switches 0:5c4d7b2438d3 4137 float32_t * pState,
switches 0:5c4d7b2438d3 4138 uint32_t blockSize);
switches 0:5c4d7b2438d3 4139
switches 0:5c4d7b2438d3 4140
switches 0:5c4d7b2438d3 4141 /**
switches 0:5c4d7b2438d3 4142 * @brief Processing function for the Q31 IIR lattice filter.
switches 0:5c4d7b2438d3 4143 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
switches 0:5c4d7b2438d3 4144 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4145 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 4146 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4147 * @return none.
switches 0:5c4d7b2438d3 4148 */
switches 0:5c4d7b2438d3 4149
switches 0:5c4d7b2438d3 4150 void arm_iir_lattice_q31(
switches 0:5c4d7b2438d3 4151 const arm_iir_lattice_instance_q31 * S,
switches 0:5c4d7b2438d3 4152 q31_t * pSrc,
switches 0:5c4d7b2438d3 4153 q31_t * pDst,
switches 0:5c4d7b2438d3 4154 uint32_t blockSize);
switches 0:5c4d7b2438d3 4155
switches 0:5c4d7b2438d3 4156
switches 0:5c4d7b2438d3 4157 /**
switches 0:5c4d7b2438d3 4158 * @brief Initialization function for the Q31 IIR lattice filter.
switches 0:5c4d7b2438d3 4159 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
switches 0:5c4d7b2438d3 4160 * @param[in] numStages number of stages in the filter.
switches 0:5c4d7b2438d3 4161 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4162 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
switches 0:5c4d7b2438d3 4163 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
switches 0:5c4d7b2438d3 4164 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4165 * @return none.
switches 0:5c4d7b2438d3 4166 */
switches 0:5c4d7b2438d3 4167
switches 0:5c4d7b2438d3 4168 void arm_iir_lattice_init_q31(
switches 0:5c4d7b2438d3 4169 arm_iir_lattice_instance_q31 * S,
switches 0:5c4d7b2438d3 4170 uint16_t numStages,
switches 0:5c4d7b2438d3 4171 q31_t * pkCoeffs,
switches 0:5c4d7b2438d3 4172 q31_t * pvCoeffs,
switches 0:5c4d7b2438d3 4173 q31_t * pState,
switches 0:5c4d7b2438d3 4174 uint32_t blockSize);
switches 0:5c4d7b2438d3 4175
switches 0:5c4d7b2438d3 4176
switches 0:5c4d7b2438d3 4177 /**
switches 0:5c4d7b2438d3 4178 * @brief Processing function for the Q15 IIR lattice filter.
switches 0:5c4d7b2438d3 4179 * @param[in] *S points to an instance of the Q15 IIR lattice structure.
switches 0:5c4d7b2438d3 4180 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4181 * @param[out] *pDst points to the block of output data.
switches 0:5c4d7b2438d3 4182 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4183 * @return none.
switches 0:5c4d7b2438d3 4184 */
switches 0:5c4d7b2438d3 4185
switches 0:5c4d7b2438d3 4186 void arm_iir_lattice_q15(
switches 0:5c4d7b2438d3 4187 const arm_iir_lattice_instance_q15 * S,
switches 0:5c4d7b2438d3 4188 q15_t * pSrc,
switches 0:5c4d7b2438d3 4189 q15_t * pDst,
switches 0:5c4d7b2438d3 4190 uint32_t blockSize);
switches 0:5c4d7b2438d3 4191
switches 0:5c4d7b2438d3 4192
switches 0:5c4d7b2438d3 4193 /**
switches 0:5c4d7b2438d3 4194 * @brief Initialization function for the Q15 IIR lattice filter.
switches 0:5c4d7b2438d3 4195 * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
switches 0:5c4d7b2438d3 4196 * @param[in] numStages number of stages in the filter.
switches 0:5c4d7b2438d3 4197 * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
switches 0:5c4d7b2438d3 4198 * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
switches 0:5c4d7b2438d3 4199 * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
switches 0:5c4d7b2438d3 4200 * @param[in] blockSize number of samples to process per call.
switches 0:5c4d7b2438d3 4201 * @return none.
switches 0:5c4d7b2438d3 4202 */
switches 0:5c4d7b2438d3 4203
switches 0:5c4d7b2438d3 4204 void arm_iir_lattice_init_q15(
switches 0:5c4d7b2438d3 4205 arm_iir_lattice_instance_q15 * S,
switches 0:5c4d7b2438d3 4206 uint16_t numStages,
switches 0:5c4d7b2438d3 4207 q15_t * pkCoeffs,
switches 0:5c4d7b2438d3 4208 q15_t * pvCoeffs,
switches 0:5c4d7b2438d3 4209 q15_t * pState,
switches 0:5c4d7b2438d3 4210 uint32_t blockSize);
switches 0:5c4d7b2438d3 4211
switches 0:5c4d7b2438d3 4212 /**
switches 0:5c4d7b2438d3 4213 * @brief Instance structure for the floating-point LMS filter.
switches 0:5c4d7b2438d3 4214 */
switches 0:5c4d7b2438d3 4215
switches 0:5c4d7b2438d3 4216 typedef struct
switches 0:5c4d7b2438d3 4217 {
switches 0:5c4d7b2438d3 4218 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4219 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4220 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4221 float32_t mu; /**< step size that controls filter coefficient updates. */
switches 0:5c4d7b2438d3 4222 } arm_lms_instance_f32;
switches 0:5c4d7b2438d3 4223
switches 0:5c4d7b2438d3 4224 /**
switches 0:5c4d7b2438d3 4225 * @brief Processing function for floating-point LMS filter.
switches 0:5c4d7b2438d3 4226 * @param[in] *S points to an instance of the floating-point LMS filter structure.
switches 0:5c4d7b2438d3 4227 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4228 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4229 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4230 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4231 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4232 * @return none.
switches 0:5c4d7b2438d3 4233 */
switches 0:5c4d7b2438d3 4234
switches 0:5c4d7b2438d3 4235 void arm_lms_f32(
switches 0:5c4d7b2438d3 4236 const arm_lms_instance_f32 * S,
switches 0:5c4d7b2438d3 4237 float32_t * pSrc,
switches 0:5c4d7b2438d3 4238 float32_t * pRef,
switches 0:5c4d7b2438d3 4239 float32_t * pOut,
switches 0:5c4d7b2438d3 4240 float32_t * pErr,
switches 0:5c4d7b2438d3 4241 uint32_t blockSize);
switches 0:5c4d7b2438d3 4242
switches 0:5c4d7b2438d3 4243 /**
switches 0:5c4d7b2438d3 4244 * @brief Initialization function for floating-point LMS filter.
switches 0:5c4d7b2438d3 4245 * @param[in] *S points to an instance of the floating-point LMS filter structure.
switches 0:5c4d7b2438d3 4246 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4247 * @param[in] *pCoeffs points to the coefficient buffer.
switches 0:5c4d7b2438d3 4248 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 4249 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4250 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4251 * @return none.
switches 0:5c4d7b2438d3 4252 */
switches 0:5c4d7b2438d3 4253
switches 0:5c4d7b2438d3 4254 void arm_lms_init_f32(
switches 0:5c4d7b2438d3 4255 arm_lms_instance_f32 * S,
switches 0:5c4d7b2438d3 4256 uint16_t numTaps,
switches 0:5c4d7b2438d3 4257 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 4258 float32_t * pState,
switches 0:5c4d7b2438d3 4259 float32_t mu,
switches 0:5c4d7b2438d3 4260 uint32_t blockSize);
switches 0:5c4d7b2438d3 4261
switches 0:5c4d7b2438d3 4262 /**
switches 0:5c4d7b2438d3 4263 * @brief Instance structure for the Q15 LMS filter.
switches 0:5c4d7b2438d3 4264 */
switches 0:5c4d7b2438d3 4265
switches 0:5c4d7b2438d3 4266 typedef struct
switches 0:5c4d7b2438d3 4267 {
switches 0:5c4d7b2438d3 4268 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4269 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4270 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4271 q15_t mu; /**< step size that controls filter coefficient updates. */
switches 0:5c4d7b2438d3 4272 uint32_t postShift; /**< bit shift applied to coefficients. */
switches 0:5c4d7b2438d3 4273 } arm_lms_instance_q15;
switches 0:5c4d7b2438d3 4274
switches 0:5c4d7b2438d3 4275
switches 0:5c4d7b2438d3 4276 /**
switches 0:5c4d7b2438d3 4277 * @brief Initialization function for the Q15 LMS filter.
switches 0:5c4d7b2438d3 4278 * @param[in] *S points to an instance of the Q15 LMS filter structure.
switches 0:5c4d7b2438d3 4279 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4280 * @param[in] *pCoeffs points to the coefficient buffer.
switches 0:5c4d7b2438d3 4281 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 4282 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4283 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4284 * @param[in] postShift bit shift applied to coefficients.
switches 0:5c4d7b2438d3 4285 * @return none.
switches 0:5c4d7b2438d3 4286 */
switches 0:5c4d7b2438d3 4287
switches 0:5c4d7b2438d3 4288 void arm_lms_init_q15(
switches 0:5c4d7b2438d3 4289 arm_lms_instance_q15 * S,
switches 0:5c4d7b2438d3 4290 uint16_t numTaps,
switches 0:5c4d7b2438d3 4291 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 4292 q15_t * pState,
switches 0:5c4d7b2438d3 4293 q15_t mu,
switches 0:5c4d7b2438d3 4294 uint32_t blockSize,
switches 0:5c4d7b2438d3 4295 uint32_t postShift);
switches 0:5c4d7b2438d3 4296
switches 0:5c4d7b2438d3 4297 /**
switches 0:5c4d7b2438d3 4298 * @brief Processing function for Q15 LMS filter.
switches 0:5c4d7b2438d3 4299 * @param[in] *S points to an instance of the Q15 LMS filter structure.
switches 0:5c4d7b2438d3 4300 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4301 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4302 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4303 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4304 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4305 * @return none.
switches 0:5c4d7b2438d3 4306 */
switches 0:5c4d7b2438d3 4307
switches 0:5c4d7b2438d3 4308 void arm_lms_q15(
switches 0:5c4d7b2438d3 4309 const arm_lms_instance_q15 * S,
switches 0:5c4d7b2438d3 4310 q15_t * pSrc,
switches 0:5c4d7b2438d3 4311 q15_t * pRef,
switches 0:5c4d7b2438d3 4312 q15_t * pOut,
switches 0:5c4d7b2438d3 4313 q15_t * pErr,
switches 0:5c4d7b2438d3 4314 uint32_t blockSize);
switches 0:5c4d7b2438d3 4315
switches 0:5c4d7b2438d3 4316
switches 0:5c4d7b2438d3 4317 /**
switches 0:5c4d7b2438d3 4318 * @brief Instance structure for the Q31 LMS filter.
switches 0:5c4d7b2438d3 4319 */
switches 0:5c4d7b2438d3 4320
switches 0:5c4d7b2438d3 4321 typedef struct
switches 0:5c4d7b2438d3 4322 {
switches 0:5c4d7b2438d3 4323 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4324 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4325 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4326 q31_t mu; /**< step size that controls filter coefficient updates. */
switches 0:5c4d7b2438d3 4327 uint32_t postShift; /**< bit shift applied to coefficients. */
switches 0:5c4d7b2438d3 4328
switches 0:5c4d7b2438d3 4329 } arm_lms_instance_q31;
switches 0:5c4d7b2438d3 4330
switches 0:5c4d7b2438d3 4331 /**
switches 0:5c4d7b2438d3 4332 * @brief Processing function for Q31 LMS filter.
switches 0:5c4d7b2438d3 4333 * @param[in] *S points to an instance of the Q15 LMS filter structure.
switches 0:5c4d7b2438d3 4334 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4335 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4336 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4337 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4338 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4339 * @return none.
switches 0:5c4d7b2438d3 4340 */
switches 0:5c4d7b2438d3 4341
switches 0:5c4d7b2438d3 4342 void arm_lms_q31(
switches 0:5c4d7b2438d3 4343 const arm_lms_instance_q31 * S,
switches 0:5c4d7b2438d3 4344 q31_t * pSrc,
switches 0:5c4d7b2438d3 4345 q31_t * pRef,
switches 0:5c4d7b2438d3 4346 q31_t * pOut,
switches 0:5c4d7b2438d3 4347 q31_t * pErr,
switches 0:5c4d7b2438d3 4348 uint32_t blockSize);
switches 0:5c4d7b2438d3 4349
switches 0:5c4d7b2438d3 4350 /**
switches 0:5c4d7b2438d3 4351 * @brief Initialization function for Q31 LMS filter.
switches 0:5c4d7b2438d3 4352 * @param[in] *S points to an instance of the Q31 LMS filter structure.
switches 0:5c4d7b2438d3 4353 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4354 * @param[in] *pCoeffs points to coefficient buffer.
switches 0:5c4d7b2438d3 4355 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 4356 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4357 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4358 * @param[in] postShift bit shift applied to coefficients.
switches 0:5c4d7b2438d3 4359 * @return none.
switches 0:5c4d7b2438d3 4360 */
switches 0:5c4d7b2438d3 4361
switches 0:5c4d7b2438d3 4362 void arm_lms_init_q31(
switches 0:5c4d7b2438d3 4363 arm_lms_instance_q31 * S,
switches 0:5c4d7b2438d3 4364 uint16_t numTaps,
switches 0:5c4d7b2438d3 4365 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 4366 q31_t * pState,
switches 0:5c4d7b2438d3 4367 q31_t mu,
switches 0:5c4d7b2438d3 4368 uint32_t blockSize,
switches 0:5c4d7b2438d3 4369 uint32_t postShift);
switches 0:5c4d7b2438d3 4370
switches 0:5c4d7b2438d3 4371 /**
switches 0:5c4d7b2438d3 4372 * @brief Instance structure for the floating-point normalized LMS filter.
switches 0:5c4d7b2438d3 4373 */
switches 0:5c4d7b2438d3 4374
switches 0:5c4d7b2438d3 4375 typedef struct
switches 0:5c4d7b2438d3 4376 {
switches 0:5c4d7b2438d3 4377 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4378 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4379 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4380 float32_t mu; /**< step size that control filter coefficient updates. */
switches 0:5c4d7b2438d3 4381 float32_t energy; /**< saves previous frame energy. */
switches 0:5c4d7b2438d3 4382 float32_t x0; /**< saves previous input sample. */
switches 0:5c4d7b2438d3 4383 } arm_lms_norm_instance_f32;
switches 0:5c4d7b2438d3 4384
switches 0:5c4d7b2438d3 4385 /**
switches 0:5c4d7b2438d3 4386 * @brief Processing function for floating-point normalized LMS filter.
switches 0:5c4d7b2438d3 4387 * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
switches 0:5c4d7b2438d3 4388 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4389 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4390 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4391 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4392 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4393 * @return none.
switches 0:5c4d7b2438d3 4394 */
switches 0:5c4d7b2438d3 4395
switches 0:5c4d7b2438d3 4396 void arm_lms_norm_f32(
switches 0:5c4d7b2438d3 4397 arm_lms_norm_instance_f32 * S,
switches 0:5c4d7b2438d3 4398 float32_t * pSrc,
switches 0:5c4d7b2438d3 4399 float32_t * pRef,
switches 0:5c4d7b2438d3 4400 float32_t * pOut,
switches 0:5c4d7b2438d3 4401 float32_t * pErr,
switches 0:5c4d7b2438d3 4402 uint32_t blockSize);
switches 0:5c4d7b2438d3 4403
switches 0:5c4d7b2438d3 4404 /**
switches 0:5c4d7b2438d3 4405 * @brief Initialization function for floating-point normalized LMS filter.
switches 0:5c4d7b2438d3 4406 * @param[in] *S points to an instance of the floating-point LMS filter structure.
switches 0:5c4d7b2438d3 4407 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4408 * @param[in] *pCoeffs points to coefficient buffer.
switches 0:5c4d7b2438d3 4409 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 4410 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4411 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4412 * @return none.
switches 0:5c4d7b2438d3 4413 */
switches 0:5c4d7b2438d3 4414
switches 0:5c4d7b2438d3 4415 void arm_lms_norm_init_f32(
switches 0:5c4d7b2438d3 4416 arm_lms_norm_instance_f32 * S,
switches 0:5c4d7b2438d3 4417 uint16_t numTaps,
switches 0:5c4d7b2438d3 4418 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 4419 float32_t * pState,
switches 0:5c4d7b2438d3 4420 float32_t mu,
switches 0:5c4d7b2438d3 4421 uint32_t blockSize);
switches 0:5c4d7b2438d3 4422
switches 0:5c4d7b2438d3 4423
switches 0:5c4d7b2438d3 4424 /**
switches 0:5c4d7b2438d3 4425 * @brief Instance structure for the Q31 normalized LMS filter.
switches 0:5c4d7b2438d3 4426 */
switches 0:5c4d7b2438d3 4427 typedef struct
switches 0:5c4d7b2438d3 4428 {
switches 0:5c4d7b2438d3 4429 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4430 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4431 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4432 q31_t mu; /**< step size that controls filter coefficient updates. */
switches 0:5c4d7b2438d3 4433 uint8_t postShift; /**< bit shift applied to coefficients. */
switches 0:5c4d7b2438d3 4434 q31_t *recipTable; /**< points to the reciprocal initial value table. */
switches 0:5c4d7b2438d3 4435 q31_t energy; /**< saves previous frame energy. */
switches 0:5c4d7b2438d3 4436 q31_t x0; /**< saves previous input sample. */
switches 0:5c4d7b2438d3 4437 } arm_lms_norm_instance_q31;
switches 0:5c4d7b2438d3 4438
switches 0:5c4d7b2438d3 4439 /**
switches 0:5c4d7b2438d3 4440 * @brief Processing function for Q31 normalized LMS filter.
switches 0:5c4d7b2438d3 4441 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
switches 0:5c4d7b2438d3 4442 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4443 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4444 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4445 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4446 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4447 * @return none.
switches 0:5c4d7b2438d3 4448 */
switches 0:5c4d7b2438d3 4449
switches 0:5c4d7b2438d3 4450 void arm_lms_norm_q31(
switches 0:5c4d7b2438d3 4451 arm_lms_norm_instance_q31 * S,
switches 0:5c4d7b2438d3 4452 q31_t * pSrc,
switches 0:5c4d7b2438d3 4453 q31_t * pRef,
switches 0:5c4d7b2438d3 4454 q31_t * pOut,
switches 0:5c4d7b2438d3 4455 q31_t * pErr,
switches 0:5c4d7b2438d3 4456 uint32_t blockSize);
switches 0:5c4d7b2438d3 4457
switches 0:5c4d7b2438d3 4458 /**
switches 0:5c4d7b2438d3 4459 * @brief Initialization function for Q31 normalized LMS filter.
switches 0:5c4d7b2438d3 4460 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
switches 0:5c4d7b2438d3 4461 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4462 * @param[in] *pCoeffs points to coefficient buffer.
switches 0:5c4d7b2438d3 4463 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 4464 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4465 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4466 * @param[in] postShift bit shift applied to coefficients.
switches 0:5c4d7b2438d3 4467 * @return none.
switches 0:5c4d7b2438d3 4468 */
switches 0:5c4d7b2438d3 4469
switches 0:5c4d7b2438d3 4470 void arm_lms_norm_init_q31(
switches 0:5c4d7b2438d3 4471 arm_lms_norm_instance_q31 * S,
switches 0:5c4d7b2438d3 4472 uint16_t numTaps,
switches 0:5c4d7b2438d3 4473 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 4474 q31_t * pState,
switches 0:5c4d7b2438d3 4475 q31_t mu,
switches 0:5c4d7b2438d3 4476 uint32_t blockSize,
switches 0:5c4d7b2438d3 4477 uint8_t postShift);
switches 0:5c4d7b2438d3 4478
switches 0:5c4d7b2438d3 4479 /**
switches 0:5c4d7b2438d3 4480 * @brief Instance structure for the Q15 normalized LMS filter.
switches 0:5c4d7b2438d3 4481 */
switches 0:5c4d7b2438d3 4482
switches 0:5c4d7b2438d3 4483 typedef struct
switches 0:5c4d7b2438d3 4484 {
switches 0:5c4d7b2438d3 4485 uint16_t numTaps; /**< Number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4486 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
switches 0:5c4d7b2438d3 4487 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4488 q15_t mu; /**< step size that controls filter coefficient updates. */
switches 0:5c4d7b2438d3 4489 uint8_t postShift; /**< bit shift applied to coefficients. */
switches 0:5c4d7b2438d3 4490 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
switches 0:5c4d7b2438d3 4491 q15_t energy; /**< saves previous frame energy. */
switches 0:5c4d7b2438d3 4492 q15_t x0; /**< saves previous input sample. */
switches 0:5c4d7b2438d3 4493 } arm_lms_norm_instance_q15;
switches 0:5c4d7b2438d3 4494
switches 0:5c4d7b2438d3 4495 /**
switches 0:5c4d7b2438d3 4496 * @brief Processing function for Q15 normalized LMS filter.
switches 0:5c4d7b2438d3 4497 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
switches 0:5c4d7b2438d3 4498 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4499 * @param[in] *pRef points to the block of reference data.
switches 0:5c4d7b2438d3 4500 * @param[out] *pOut points to the block of output data.
switches 0:5c4d7b2438d3 4501 * @param[out] *pErr points to the block of error data.
switches 0:5c4d7b2438d3 4502 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4503 * @return none.
switches 0:5c4d7b2438d3 4504 */
switches 0:5c4d7b2438d3 4505
switches 0:5c4d7b2438d3 4506 void arm_lms_norm_q15(
switches 0:5c4d7b2438d3 4507 arm_lms_norm_instance_q15 * S,
switches 0:5c4d7b2438d3 4508 q15_t * pSrc,
switches 0:5c4d7b2438d3 4509 q15_t * pRef,
switches 0:5c4d7b2438d3 4510 q15_t * pOut,
switches 0:5c4d7b2438d3 4511 q15_t * pErr,
switches 0:5c4d7b2438d3 4512 uint32_t blockSize);
switches 0:5c4d7b2438d3 4513
switches 0:5c4d7b2438d3 4514
switches 0:5c4d7b2438d3 4515 /**
switches 0:5c4d7b2438d3 4516 * @brief Initialization function for Q15 normalized LMS filter.
switches 0:5c4d7b2438d3 4517 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
switches 0:5c4d7b2438d3 4518 * @param[in] numTaps number of filter coefficients.
switches 0:5c4d7b2438d3 4519 * @param[in] *pCoeffs points to coefficient buffer.
switches 0:5c4d7b2438d3 4520 * @param[in] *pState points to state buffer.
switches 0:5c4d7b2438d3 4521 * @param[in] mu step size that controls filter coefficient updates.
switches 0:5c4d7b2438d3 4522 * @param[in] blockSize number of samples to process.
switches 0:5c4d7b2438d3 4523 * @param[in] postShift bit shift applied to coefficients.
switches 0:5c4d7b2438d3 4524 * @return none.
switches 0:5c4d7b2438d3 4525 */
switches 0:5c4d7b2438d3 4526
switches 0:5c4d7b2438d3 4527 void arm_lms_norm_init_q15(
switches 0:5c4d7b2438d3 4528 arm_lms_norm_instance_q15 * S,
switches 0:5c4d7b2438d3 4529 uint16_t numTaps,
switches 0:5c4d7b2438d3 4530 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 4531 q15_t * pState,
switches 0:5c4d7b2438d3 4532 q15_t mu,
switches 0:5c4d7b2438d3 4533 uint32_t blockSize,
switches 0:5c4d7b2438d3 4534 uint8_t postShift);
switches 0:5c4d7b2438d3 4535
switches 0:5c4d7b2438d3 4536 /**
switches 0:5c4d7b2438d3 4537 * @brief Correlation of floating-point sequences.
switches 0:5c4d7b2438d3 4538 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4539 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4540 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4541 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4542 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4543 * @return none.
switches 0:5c4d7b2438d3 4544 */
switches 0:5c4d7b2438d3 4545
switches 0:5c4d7b2438d3 4546 void arm_correlate_f32(
switches 0:5c4d7b2438d3 4547 float32_t * pSrcA,
switches 0:5c4d7b2438d3 4548 uint32_t srcALen,
switches 0:5c4d7b2438d3 4549 float32_t * pSrcB,
switches 0:5c4d7b2438d3 4550 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4551 float32_t * pDst);
switches 0:5c4d7b2438d3 4552
switches 0:5c4d7b2438d3 4553
switches 0:5c4d7b2438d3 4554 /**
switches 0:5c4d7b2438d3 4555 * @brief Correlation of Q15 sequences
switches 0:5c4d7b2438d3 4556 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4557 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4558 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4559 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4560 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4561 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 4562 * @return none.
switches 0:5c4d7b2438d3 4563 */
switches 0:5c4d7b2438d3 4564 void arm_correlate_opt_q15(
switches 0:5c4d7b2438d3 4565 q15_t * pSrcA,
switches 0:5c4d7b2438d3 4566 uint32_t srcALen,
switches 0:5c4d7b2438d3 4567 q15_t * pSrcB,
switches 0:5c4d7b2438d3 4568 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4569 q15_t * pDst,
switches 0:5c4d7b2438d3 4570 q15_t * pScratch);
switches 0:5c4d7b2438d3 4571
switches 0:5c4d7b2438d3 4572
switches 0:5c4d7b2438d3 4573 /**
switches 0:5c4d7b2438d3 4574 * @brief Correlation of Q15 sequences.
switches 0:5c4d7b2438d3 4575 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4576 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4577 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4578 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4579 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4580 * @return none.
switches 0:5c4d7b2438d3 4581 */
switches 0:5c4d7b2438d3 4582
switches 0:5c4d7b2438d3 4583 void arm_correlate_q15(
switches 0:5c4d7b2438d3 4584 q15_t * pSrcA,
switches 0:5c4d7b2438d3 4585 uint32_t srcALen,
switches 0:5c4d7b2438d3 4586 q15_t * pSrcB,
switches 0:5c4d7b2438d3 4587 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4588 q15_t * pDst);
switches 0:5c4d7b2438d3 4589
switches 0:5c4d7b2438d3 4590 /**
switches 0:5c4d7b2438d3 4591 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 4592 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4593 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4594 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4595 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4596 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4597 * @return none.
switches 0:5c4d7b2438d3 4598 */
switches 0:5c4d7b2438d3 4599
switches 0:5c4d7b2438d3 4600 void arm_correlate_fast_q15(
switches 0:5c4d7b2438d3 4601 q15_t * pSrcA,
switches 0:5c4d7b2438d3 4602 uint32_t srcALen,
switches 0:5c4d7b2438d3 4603 q15_t * pSrcB,
switches 0:5c4d7b2438d3 4604 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4605 q15_t * pDst);
switches 0:5c4d7b2438d3 4606
switches 0:5c4d7b2438d3 4607
switches 0:5c4d7b2438d3 4608
switches 0:5c4d7b2438d3 4609 /**
switches 0:5c4d7b2438d3 4610 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
switches 0:5c4d7b2438d3 4611 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4612 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4613 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4614 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4615 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4616 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 4617 * @return none.
switches 0:5c4d7b2438d3 4618 */
switches 0:5c4d7b2438d3 4619
switches 0:5c4d7b2438d3 4620 void arm_correlate_fast_opt_q15(
switches 0:5c4d7b2438d3 4621 q15_t * pSrcA,
switches 0:5c4d7b2438d3 4622 uint32_t srcALen,
switches 0:5c4d7b2438d3 4623 q15_t * pSrcB,
switches 0:5c4d7b2438d3 4624 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4625 q15_t * pDst,
switches 0:5c4d7b2438d3 4626 q15_t * pScratch);
switches 0:5c4d7b2438d3 4627
switches 0:5c4d7b2438d3 4628 /**
switches 0:5c4d7b2438d3 4629 * @brief Correlation of Q31 sequences.
switches 0:5c4d7b2438d3 4630 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4631 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4632 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4633 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4634 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4635 * @return none.
switches 0:5c4d7b2438d3 4636 */
switches 0:5c4d7b2438d3 4637
switches 0:5c4d7b2438d3 4638 void arm_correlate_q31(
switches 0:5c4d7b2438d3 4639 q31_t * pSrcA,
switches 0:5c4d7b2438d3 4640 uint32_t srcALen,
switches 0:5c4d7b2438d3 4641 q31_t * pSrcB,
switches 0:5c4d7b2438d3 4642 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4643 q31_t * pDst);
switches 0:5c4d7b2438d3 4644
switches 0:5c4d7b2438d3 4645 /**
switches 0:5c4d7b2438d3 4646 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
switches 0:5c4d7b2438d3 4647 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4648 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4649 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4650 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4651 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4652 * @return none.
switches 0:5c4d7b2438d3 4653 */
switches 0:5c4d7b2438d3 4654
switches 0:5c4d7b2438d3 4655 void arm_correlate_fast_q31(
switches 0:5c4d7b2438d3 4656 q31_t * pSrcA,
switches 0:5c4d7b2438d3 4657 uint32_t srcALen,
switches 0:5c4d7b2438d3 4658 q31_t * pSrcB,
switches 0:5c4d7b2438d3 4659 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4660 q31_t * pDst);
switches 0:5c4d7b2438d3 4661
switches 0:5c4d7b2438d3 4662
switches 0:5c4d7b2438d3 4663
switches 0:5c4d7b2438d3 4664 /**
switches 0:5c4d7b2438d3 4665 * @brief Correlation of Q7 sequences.
switches 0:5c4d7b2438d3 4666 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4667 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4668 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4669 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4670 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4671 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
switches 0:5c4d7b2438d3 4672 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
switches 0:5c4d7b2438d3 4673 * @return none.
switches 0:5c4d7b2438d3 4674 */
switches 0:5c4d7b2438d3 4675
switches 0:5c4d7b2438d3 4676 void arm_correlate_opt_q7(
switches 0:5c4d7b2438d3 4677 q7_t * pSrcA,
switches 0:5c4d7b2438d3 4678 uint32_t srcALen,
switches 0:5c4d7b2438d3 4679 q7_t * pSrcB,
switches 0:5c4d7b2438d3 4680 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4681 q7_t * pDst,
switches 0:5c4d7b2438d3 4682 q15_t * pScratch1,
switches 0:5c4d7b2438d3 4683 q15_t * pScratch2);
switches 0:5c4d7b2438d3 4684
switches 0:5c4d7b2438d3 4685
switches 0:5c4d7b2438d3 4686 /**
switches 0:5c4d7b2438d3 4687 * @brief Correlation of Q7 sequences.
switches 0:5c4d7b2438d3 4688 * @param[in] *pSrcA points to the first input sequence.
switches 0:5c4d7b2438d3 4689 * @param[in] srcALen length of the first input sequence.
switches 0:5c4d7b2438d3 4690 * @param[in] *pSrcB points to the second input sequence.
switches 0:5c4d7b2438d3 4691 * @param[in] srcBLen length of the second input sequence.
switches 0:5c4d7b2438d3 4692 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
switches 0:5c4d7b2438d3 4693 * @return none.
switches 0:5c4d7b2438d3 4694 */
switches 0:5c4d7b2438d3 4695
switches 0:5c4d7b2438d3 4696 void arm_correlate_q7(
switches 0:5c4d7b2438d3 4697 q7_t * pSrcA,
switches 0:5c4d7b2438d3 4698 uint32_t srcALen,
switches 0:5c4d7b2438d3 4699 q7_t * pSrcB,
switches 0:5c4d7b2438d3 4700 uint32_t srcBLen,
switches 0:5c4d7b2438d3 4701 q7_t * pDst);
switches 0:5c4d7b2438d3 4702
switches 0:5c4d7b2438d3 4703
switches 0:5c4d7b2438d3 4704 /**
switches 0:5c4d7b2438d3 4705 * @brief Instance structure for the floating-point sparse FIR filter.
switches 0:5c4d7b2438d3 4706 */
switches 0:5c4d7b2438d3 4707 typedef struct
switches 0:5c4d7b2438d3 4708 {
switches 0:5c4d7b2438d3 4709 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4710 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
switches 0:5c4d7b2438d3 4711 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
switches 0:5c4d7b2438d3 4712 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 4713 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
switches 0:5c4d7b2438d3 4714 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4715 } arm_fir_sparse_instance_f32;
switches 0:5c4d7b2438d3 4716
switches 0:5c4d7b2438d3 4717 /**
switches 0:5c4d7b2438d3 4718 * @brief Instance structure for the Q31 sparse FIR filter.
switches 0:5c4d7b2438d3 4719 */
switches 0:5c4d7b2438d3 4720
switches 0:5c4d7b2438d3 4721 typedef struct
switches 0:5c4d7b2438d3 4722 {
switches 0:5c4d7b2438d3 4723 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4724 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
switches 0:5c4d7b2438d3 4725 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
switches 0:5c4d7b2438d3 4726 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 4727 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
switches 0:5c4d7b2438d3 4728 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4729 } arm_fir_sparse_instance_q31;
switches 0:5c4d7b2438d3 4730
switches 0:5c4d7b2438d3 4731 /**
switches 0:5c4d7b2438d3 4732 * @brief Instance structure for the Q15 sparse FIR filter.
switches 0:5c4d7b2438d3 4733 */
switches 0:5c4d7b2438d3 4734
switches 0:5c4d7b2438d3 4735 typedef struct
switches 0:5c4d7b2438d3 4736 {
switches 0:5c4d7b2438d3 4737 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4738 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
switches 0:5c4d7b2438d3 4739 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
switches 0:5c4d7b2438d3 4740 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 4741 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
switches 0:5c4d7b2438d3 4742 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4743 } arm_fir_sparse_instance_q15;
switches 0:5c4d7b2438d3 4744
switches 0:5c4d7b2438d3 4745 /**
switches 0:5c4d7b2438d3 4746 * @brief Instance structure for the Q7 sparse FIR filter.
switches 0:5c4d7b2438d3 4747 */
switches 0:5c4d7b2438d3 4748
switches 0:5c4d7b2438d3 4749 typedef struct
switches 0:5c4d7b2438d3 4750 {
switches 0:5c4d7b2438d3 4751 uint16_t numTaps; /**< number of coefficients in the filter. */
switches 0:5c4d7b2438d3 4752 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
switches 0:5c4d7b2438d3 4753 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
switches 0:5c4d7b2438d3 4754 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
switches 0:5c4d7b2438d3 4755 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
switches 0:5c4d7b2438d3 4756 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
switches 0:5c4d7b2438d3 4757 } arm_fir_sparse_instance_q7;
switches 0:5c4d7b2438d3 4758
switches 0:5c4d7b2438d3 4759 /**
switches 0:5c4d7b2438d3 4760 * @brief Processing function for the floating-point sparse FIR filter.
switches 0:5c4d7b2438d3 4761 * @param[in] *S points to an instance of the floating-point sparse FIR structure.
switches 0:5c4d7b2438d3 4762 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4763 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4764 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4765 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 4766 * @return none.
switches 0:5c4d7b2438d3 4767 */
switches 0:5c4d7b2438d3 4768
switches 0:5c4d7b2438d3 4769 void arm_fir_sparse_f32(
switches 0:5c4d7b2438d3 4770 arm_fir_sparse_instance_f32 * S,
switches 0:5c4d7b2438d3 4771 float32_t * pSrc,
switches 0:5c4d7b2438d3 4772 float32_t * pDst,
switches 0:5c4d7b2438d3 4773 float32_t * pScratchIn,
switches 0:5c4d7b2438d3 4774 uint32_t blockSize);
switches 0:5c4d7b2438d3 4775
switches 0:5c4d7b2438d3 4776 /**
switches 0:5c4d7b2438d3 4777 * @brief Initialization function for the floating-point sparse FIR filter.
switches 0:5c4d7b2438d3 4778 * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
switches 0:5c4d7b2438d3 4779 * @param[in] numTaps number of nonzero coefficients in the filter.
switches 0:5c4d7b2438d3 4780 * @param[in] *pCoeffs points to the array of filter coefficients.
switches 0:5c4d7b2438d3 4781 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 4782 * @param[in] *pTapDelay points to the array of offset times.
switches 0:5c4d7b2438d3 4783 * @param[in] maxDelay maximum offset time supported.
switches 0:5c4d7b2438d3 4784 * @param[in] blockSize number of samples that will be processed per block.
switches 0:5c4d7b2438d3 4785 * @return none
switches 0:5c4d7b2438d3 4786 */
switches 0:5c4d7b2438d3 4787
switches 0:5c4d7b2438d3 4788 void arm_fir_sparse_init_f32(
switches 0:5c4d7b2438d3 4789 arm_fir_sparse_instance_f32 * S,
switches 0:5c4d7b2438d3 4790 uint16_t numTaps,
switches 0:5c4d7b2438d3 4791 float32_t * pCoeffs,
switches 0:5c4d7b2438d3 4792 float32_t * pState,
switches 0:5c4d7b2438d3 4793 int32_t * pTapDelay,
switches 0:5c4d7b2438d3 4794 uint16_t maxDelay,
switches 0:5c4d7b2438d3 4795 uint32_t blockSize);
switches 0:5c4d7b2438d3 4796
switches 0:5c4d7b2438d3 4797 /**
switches 0:5c4d7b2438d3 4798 * @brief Processing function for the Q31 sparse FIR filter.
switches 0:5c4d7b2438d3 4799 * @param[in] *S points to an instance of the Q31 sparse FIR structure.
switches 0:5c4d7b2438d3 4800 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4801 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4802 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4803 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 4804 * @return none.
switches 0:5c4d7b2438d3 4805 */
switches 0:5c4d7b2438d3 4806
switches 0:5c4d7b2438d3 4807 void arm_fir_sparse_q31(
switches 0:5c4d7b2438d3 4808 arm_fir_sparse_instance_q31 * S,
switches 0:5c4d7b2438d3 4809 q31_t * pSrc,
switches 0:5c4d7b2438d3 4810 q31_t * pDst,
switches 0:5c4d7b2438d3 4811 q31_t * pScratchIn,
switches 0:5c4d7b2438d3 4812 uint32_t blockSize);
switches 0:5c4d7b2438d3 4813
switches 0:5c4d7b2438d3 4814 /**
switches 0:5c4d7b2438d3 4815 * @brief Initialization function for the Q31 sparse FIR filter.
switches 0:5c4d7b2438d3 4816 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
switches 0:5c4d7b2438d3 4817 * @param[in] numTaps number of nonzero coefficients in the filter.
switches 0:5c4d7b2438d3 4818 * @param[in] *pCoeffs points to the array of filter coefficients.
switches 0:5c4d7b2438d3 4819 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 4820 * @param[in] *pTapDelay points to the array of offset times.
switches 0:5c4d7b2438d3 4821 * @param[in] maxDelay maximum offset time supported.
switches 0:5c4d7b2438d3 4822 * @param[in] blockSize number of samples that will be processed per block.
switches 0:5c4d7b2438d3 4823 * @return none
switches 0:5c4d7b2438d3 4824 */
switches 0:5c4d7b2438d3 4825
switches 0:5c4d7b2438d3 4826 void arm_fir_sparse_init_q31(
switches 0:5c4d7b2438d3 4827 arm_fir_sparse_instance_q31 * S,
switches 0:5c4d7b2438d3 4828 uint16_t numTaps,
switches 0:5c4d7b2438d3 4829 q31_t * pCoeffs,
switches 0:5c4d7b2438d3 4830 q31_t * pState,
switches 0:5c4d7b2438d3 4831 int32_t * pTapDelay,
switches 0:5c4d7b2438d3 4832 uint16_t maxDelay,
switches 0:5c4d7b2438d3 4833 uint32_t blockSize);
switches 0:5c4d7b2438d3 4834
switches 0:5c4d7b2438d3 4835 /**
switches 0:5c4d7b2438d3 4836 * @brief Processing function for the Q15 sparse FIR filter.
switches 0:5c4d7b2438d3 4837 * @param[in] *S points to an instance of the Q15 sparse FIR structure.
switches 0:5c4d7b2438d3 4838 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4839 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4840 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4841 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4842 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 4843 * @return none.
switches 0:5c4d7b2438d3 4844 */
switches 0:5c4d7b2438d3 4845
switches 0:5c4d7b2438d3 4846 void arm_fir_sparse_q15(
switches 0:5c4d7b2438d3 4847 arm_fir_sparse_instance_q15 * S,
switches 0:5c4d7b2438d3 4848 q15_t * pSrc,
switches 0:5c4d7b2438d3 4849 q15_t * pDst,
switches 0:5c4d7b2438d3 4850 q15_t * pScratchIn,
switches 0:5c4d7b2438d3 4851 q31_t * pScratchOut,
switches 0:5c4d7b2438d3 4852 uint32_t blockSize);
switches 0:5c4d7b2438d3 4853
switches 0:5c4d7b2438d3 4854
switches 0:5c4d7b2438d3 4855 /**
switches 0:5c4d7b2438d3 4856 * @brief Initialization function for the Q15 sparse FIR filter.
switches 0:5c4d7b2438d3 4857 * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
switches 0:5c4d7b2438d3 4858 * @param[in] numTaps number of nonzero coefficients in the filter.
switches 0:5c4d7b2438d3 4859 * @param[in] *pCoeffs points to the array of filter coefficients.
switches 0:5c4d7b2438d3 4860 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 4861 * @param[in] *pTapDelay points to the array of offset times.
switches 0:5c4d7b2438d3 4862 * @param[in] maxDelay maximum offset time supported.
switches 0:5c4d7b2438d3 4863 * @param[in] blockSize number of samples that will be processed per block.
switches 0:5c4d7b2438d3 4864 * @return none
switches 0:5c4d7b2438d3 4865 */
switches 0:5c4d7b2438d3 4866
switches 0:5c4d7b2438d3 4867 void arm_fir_sparse_init_q15(
switches 0:5c4d7b2438d3 4868 arm_fir_sparse_instance_q15 * S,
switches 0:5c4d7b2438d3 4869 uint16_t numTaps,
switches 0:5c4d7b2438d3 4870 q15_t * pCoeffs,
switches 0:5c4d7b2438d3 4871 q15_t * pState,
switches 0:5c4d7b2438d3 4872 int32_t * pTapDelay,
switches 0:5c4d7b2438d3 4873 uint16_t maxDelay,
switches 0:5c4d7b2438d3 4874 uint32_t blockSize);
switches 0:5c4d7b2438d3 4875
switches 0:5c4d7b2438d3 4876 /**
switches 0:5c4d7b2438d3 4877 * @brief Processing function for the Q7 sparse FIR filter.
switches 0:5c4d7b2438d3 4878 * @param[in] *S points to an instance of the Q7 sparse FIR structure.
switches 0:5c4d7b2438d3 4879 * @param[in] *pSrc points to the block of input data.
switches 0:5c4d7b2438d3 4880 * @param[out] *pDst points to the block of output data
switches 0:5c4d7b2438d3 4881 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4882 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
switches 0:5c4d7b2438d3 4883 * @param[in] blockSize number of input samples to process per call.
switches 0:5c4d7b2438d3 4884 * @return none.
switches 0:5c4d7b2438d3 4885 */
switches 0:5c4d7b2438d3 4886
switches 0:5c4d7b2438d3 4887 void arm_fir_sparse_q7(
switches 0:5c4d7b2438d3 4888 arm_fir_sparse_instance_q7 * S,
switches 0:5c4d7b2438d3 4889 q7_t * pSrc,
switches 0:5c4d7b2438d3 4890 q7_t * pDst,
switches 0:5c4d7b2438d3 4891 q7_t * pScratchIn,
switches 0:5c4d7b2438d3 4892 q31_t * pScratchOut,
switches 0:5c4d7b2438d3 4893 uint32_t blockSize);
switches 0:5c4d7b2438d3 4894
switches 0:5c4d7b2438d3 4895 /**
switches 0:5c4d7b2438d3 4896 * @brief Initialization function for the Q7 sparse FIR filter.
switches 0:5c4d7b2438d3 4897 * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
switches 0:5c4d7b2438d3 4898 * @param[in] numTaps number of nonzero coefficients in the filter.
switches 0:5c4d7b2438d3 4899 * @param[in] *pCoeffs points to the array of filter coefficients.
switches 0:5c4d7b2438d3 4900 * @param[in] *pState points to the state buffer.
switches 0:5c4d7b2438d3 4901 * @param[in] *pTapDelay points to the array of offset times.
switches 0:5c4d7b2438d3 4902 * @param[in] maxDelay maximum offset time supported.
switches 0:5c4d7b2438d3 4903 * @param[in] blockSize number of samples that will be processed per block.
switches 0:5c4d7b2438d3 4904 * @return none
switches 0:5c4d7b2438d3 4905 */
switches 0:5c4d7b2438d3 4906
switches 0:5c4d7b2438d3 4907 void arm_fir_sparse_init_q7(
switches 0:5c4d7b2438d3 4908 arm_fir_sparse_instance_q7 * S,
switches 0:5c4d7b2438d3 4909 uint16_t numTaps,
switches 0:5c4d7b2438d3 4910 q7_t * pCoeffs,
switches 0:5c4d7b2438d3 4911 q7_t * pState,
switches 0:5c4d7b2438d3 4912 int32_t * pTapDelay,
switches 0:5c4d7b2438d3 4913 uint16_t maxDelay,
switches 0:5c4d7b2438d3 4914 uint32_t blockSize);
switches 0:5c4d7b2438d3 4915
switches 0:5c4d7b2438d3 4916
switches 0:5c4d7b2438d3 4917 /*
switches 0:5c4d7b2438d3 4918 * @brief Floating-point sin_cos function.
switches 0:5c4d7b2438d3 4919 * @param[in] theta input value in degrees
switches 0:5c4d7b2438d3 4920 * @param[out] *pSinVal points to the processed sine output.
switches 0:5c4d7b2438d3 4921 * @param[out] *pCosVal points to the processed cos output.
switches 0:5c4d7b2438d3 4922 * @return none.
switches 0:5c4d7b2438d3 4923 */
switches 0:5c4d7b2438d3 4924
switches 0:5c4d7b2438d3 4925 void arm_sin_cos_f32(
switches 0:5c4d7b2438d3 4926 float32_t theta,
switches 0:5c4d7b2438d3 4927 float32_t * pSinVal,
switches 0:5c4d7b2438d3 4928 float32_t * pCcosVal);
switches 0:5c4d7b2438d3 4929
switches 0:5c4d7b2438d3 4930 /*
switches 0:5c4d7b2438d3 4931 * @brief Q31 sin_cos function.
switches 0:5c4d7b2438d3 4932 * @param[in] theta scaled input value in degrees
switches 0:5c4d7b2438d3 4933 * @param[out] *pSinVal points to the processed sine output.
switches 0:5c4d7b2438d3 4934 * @param[out] *pCosVal points to the processed cosine output.
switches 0:5c4d7b2438d3 4935 * @return none.
switches 0:5c4d7b2438d3 4936 */
switches 0:5c4d7b2438d3 4937
switches 0:5c4d7b2438d3 4938 void arm_sin_cos_q31(
switches 0:5c4d7b2438d3 4939 q31_t theta,
switches 0:5c4d7b2438d3 4940 q31_t * pSinVal,
switches 0:5c4d7b2438d3 4941 q31_t * pCosVal);
switches 0:5c4d7b2438d3 4942
switches 0:5c4d7b2438d3 4943
switches 0:5c4d7b2438d3 4944 /**
switches 0:5c4d7b2438d3 4945 * @brief Floating-point complex conjugate.
switches 0:5c4d7b2438d3 4946 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 4947 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 4948 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 4949 * @return none.
switches 0:5c4d7b2438d3 4950 */
switches 0:5c4d7b2438d3 4951
switches 0:5c4d7b2438d3 4952 void arm_cmplx_conj_f32(
switches 0:5c4d7b2438d3 4953 float32_t * pSrc,
switches 0:5c4d7b2438d3 4954 float32_t * pDst,
switches 0:5c4d7b2438d3 4955 uint32_t numSamples);
switches 0:5c4d7b2438d3 4956
switches 0:5c4d7b2438d3 4957 /**
switches 0:5c4d7b2438d3 4958 * @brief Q31 complex conjugate.
switches 0:5c4d7b2438d3 4959 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 4960 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 4961 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 4962 * @return none.
switches 0:5c4d7b2438d3 4963 */
switches 0:5c4d7b2438d3 4964
switches 0:5c4d7b2438d3 4965 void arm_cmplx_conj_q31(
switches 0:5c4d7b2438d3 4966 q31_t * pSrc,
switches 0:5c4d7b2438d3 4967 q31_t * pDst,
switches 0:5c4d7b2438d3 4968 uint32_t numSamples);
switches 0:5c4d7b2438d3 4969
switches 0:5c4d7b2438d3 4970 /**
switches 0:5c4d7b2438d3 4971 * @brief Q15 complex conjugate.
switches 0:5c4d7b2438d3 4972 * @param[in] *pSrc points to the input vector
switches 0:5c4d7b2438d3 4973 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 4974 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 4975 * @return none.
switches 0:5c4d7b2438d3 4976 */
switches 0:5c4d7b2438d3 4977
switches 0:5c4d7b2438d3 4978 void arm_cmplx_conj_q15(
switches 0:5c4d7b2438d3 4979 q15_t * pSrc,
switches 0:5c4d7b2438d3 4980 q15_t * pDst,
switches 0:5c4d7b2438d3 4981 uint32_t numSamples);
switches 0:5c4d7b2438d3 4982
switches 0:5c4d7b2438d3 4983
switches 0:5c4d7b2438d3 4984
switches 0:5c4d7b2438d3 4985 /**
switches 0:5c4d7b2438d3 4986 * @brief Floating-point complex magnitude squared
switches 0:5c4d7b2438d3 4987 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 4988 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 4989 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 4990 * @return none.
switches 0:5c4d7b2438d3 4991 */
switches 0:5c4d7b2438d3 4992
switches 0:5c4d7b2438d3 4993 void arm_cmplx_mag_squared_f32(
switches 0:5c4d7b2438d3 4994 float32_t * pSrc,
switches 0:5c4d7b2438d3 4995 float32_t * pDst,
switches 0:5c4d7b2438d3 4996 uint32_t numSamples);
switches 0:5c4d7b2438d3 4997
switches 0:5c4d7b2438d3 4998 /**
switches 0:5c4d7b2438d3 4999 * @brief Q31 complex magnitude squared
switches 0:5c4d7b2438d3 5000 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 5001 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 5002 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 5003 * @return none.
switches 0:5c4d7b2438d3 5004 */
switches 0:5c4d7b2438d3 5005
switches 0:5c4d7b2438d3 5006 void arm_cmplx_mag_squared_q31(
switches 0:5c4d7b2438d3 5007 q31_t * pSrc,
switches 0:5c4d7b2438d3 5008 q31_t * pDst,
switches 0:5c4d7b2438d3 5009 uint32_t numSamples);
switches 0:5c4d7b2438d3 5010
switches 0:5c4d7b2438d3 5011 /**
switches 0:5c4d7b2438d3 5012 * @brief Q15 complex magnitude squared
switches 0:5c4d7b2438d3 5013 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 5014 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 5015 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 5016 * @return none.
switches 0:5c4d7b2438d3 5017 */
switches 0:5c4d7b2438d3 5018
switches 0:5c4d7b2438d3 5019 void arm_cmplx_mag_squared_q15(
switches 0:5c4d7b2438d3 5020 q15_t * pSrc,
switches 0:5c4d7b2438d3 5021 q15_t * pDst,
switches 0:5c4d7b2438d3 5022 uint32_t numSamples);
switches 0:5c4d7b2438d3 5023
switches 0:5c4d7b2438d3 5024
switches 0:5c4d7b2438d3 5025 /**
switches 0:5c4d7b2438d3 5026 * @ingroup groupController
switches 0:5c4d7b2438d3 5027 */
switches 0:5c4d7b2438d3 5028
switches 0:5c4d7b2438d3 5029 /**
switches 0:5c4d7b2438d3 5030 * @defgroup PID PID Motor Control
switches 0:5c4d7b2438d3 5031 *
switches 0:5c4d7b2438d3 5032 * A Proportional Integral Derivative (PID) controller is a generic feedback control
switches 0:5c4d7b2438d3 5033 * loop mechanism widely used in industrial control systems.
switches 0:5c4d7b2438d3 5034 * A PID controller is the most commonly used type of feedback controller.
switches 0:5c4d7b2438d3 5035 *
switches 0:5c4d7b2438d3 5036 * This set of functions implements (PID) controllers
switches 0:5c4d7b2438d3 5037 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
switches 0:5c4d7b2438d3 5038 * of data and each call to the function returns a single processed value.
switches 0:5c4d7b2438d3 5039 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
switches 0:5c4d7b2438d3 5040 * is the input sample value. The functions return the output value.
switches 0:5c4d7b2438d3 5041 *
switches 0:5c4d7b2438d3 5042 * \par Algorithm:
switches 0:5c4d7b2438d3 5043 * <pre>
switches 0:5c4d7b2438d3 5044 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
switches 0:5c4d7b2438d3 5045 * A0 = Kp + Ki + Kd
switches 0:5c4d7b2438d3 5046 * A1 = (-Kp ) - (2 * Kd )
switches 0:5c4d7b2438d3 5047 * A2 = Kd </pre>
switches 0:5c4d7b2438d3 5048 *
switches 0:5c4d7b2438d3 5049 * \par
switches 0:5c4d7b2438d3 5050 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
switches 0:5c4d7b2438d3 5051 *
switches 0:5c4d7b2438d3 5052 * \par
switches 0:5c4d7b2438d3 5053 * \image html PID.gif "Proportional Integral Derivative Controller"
switches 0:5c4d7b2438d3 5054 *
switches 0:5c4d7b2438d3 5055 * \par
switches 0:5c4d7b2438d3 5056 * The PID controller calculates an "error" value as the difference between
switches 0:5c4d7b2438d3 5057 * the measured output and the reference input.
switches 0:5c4d7b2438d3 5058 * The controller attempts to minimize the error by adjusting the process control inputs.
switches 0:5c4d7b2438d3 5059 * The proportional value determines the reaction to the current error,
switches 0:5c4d7b2438d3 5060 * the integral value determines the reaction based on the sum of recent errors,
switches 0:5c4d7b2438d3 5061 * and the derivative value determines the reaction based on the rate at which the error has been changing.
switches 0:5c4d7b2438d3 5062 *
switches 0:5c4d7b2438d3 5063 * \par Instance Structure
switches 0:5c4d7b2438d3 5064 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
switches 0:5c4d7b2438d3 5065 * A separate instance structure must be defined for each PID Controller.
switches 0:5c4d7b2438d3 5066 * There are separate instance structure declarations for each of the 3 supported data types.
switches 0:5c4d7b2438d3 5067 *
switches 0:5c4d7b2438d3 5068 * \par Reset Functions
switches 0:5c4d7b2438d3 5069 * There is also an associated reset function for each data type which clears the state array.
switches 0:5c4d7b2438d3 5070 *
switches 0:5c4d7b2438d3 5071 * \par Initialization Functions
switches 0:5c4d7b2438d3 5072 * There is also an associated initialization function for each data type.
switches 0:5c4d7b2438d3 5073 * The initialization function performs the following operations:
switches 0:5c4d7b2438d3 5074 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
switches 0:5c4d7b2438d3 5075 * - Zeros out the values in the state buffer.
switches 0:5c4d7b2438d3 5076 *
switches 0:5c4d7b2438d3 5077 * \par
switches 0:5c4d7b2438d3 5078 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
switches 0:5c4d7b2438d3 5079 *
switches 0:5c4d7b2438d3 5080 * \par Fixed-Point Behavior
switches 0:5c4d7b2438d3 5081 * Care must be taken when using the fixed-point versions of the PID Controller functions.
switches 0:5c4d7b2438d3 5082 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
switches 0:5c4d7b2438d3 5083 * Refer to the function specific documentation below for usage guidelines.
switches 0:5c4d7b2438d3 5084 */
switches 0:5c4d7b2438d3 5085
switches 0:5c4d7b2438d3 5086 /**
switches 0:5c4d7b2438d3 5087 * @addtogroup PID
switches 0:5c4d7b2438d3 5088 * @{
switches 0:5c4d7b2438d3 5089 */
switches 0:5c4d7b2438d3 5090
switches 0:5c4d7b2438d3 5091 /**
switches 0:5c4d7b2438d3 5092 * @brief Process function for the floating-point PID Control.
switches 0:5c4d7b2438d3 5093 * @param[in,out] *S is an instance of the floating-point PID Control structure
switches 0:5c4d7b2438d3 5094 * @param[in] in input sample to process
switches 0:5c4d7b2438d3 5095 * @return out processed output sample.
switches 0:5c4d7b2438d3 5096 */
switches 0:5c4d7b2438d3 5097
switches 0:5c4d7b2438d3 5098
switches 0:5c4d7b2438d3 5099 static __INLINE float32_t arm_pid_f32(
switches 0:5c4d7b2438d3 5100 arm_pid_instance_f32 * S,
switches 0:5c4d7b2438d3 5101 float32_t in)
switches 0:5c4d7b2438d3 5102 {
switches 0:5c4d7b2438d3 5103 float32_t out;
switches 0:5c4d7b2438d3 5104
switches 0:5c4d7b2438d3 5105 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
switches 0:5c4d7b2438d3 5106 out = (S->A0 * in) +
switches 0:5c4d7b2438d3 5107 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
switches 0:5c4d7b2438d3 5108
switches 0:5c4d7b2438d3 5109 /* Update state */
switches 0:5c4d7b2438d3 5110 S->state[1] = S->state[0];
switches 0:5c4d7b2438d3 5111 S->state[0] = in;
switches 0:5c4d7b2438d3 5112 S->state[2] = out;
switches 0:5c4d7b2438d3 5113
switches 0:5c4d7b2438d3 5114 /* return to application */
switches 0:5c4d7b2438d3 5115 return (out);
switches 0:5c4d7b2438d3 5116
switches 0:5c4d7b2438d3 5117 }
switches 0:5c4d7b2438d3 5118
switches 0:5c4d7b2438d3 5119 /**
switches 0:5c4d7b2438d3 5120 * @brief Process function for the Q31 PID Control.
switches 0:5c4d7b2438d3 5121 * @param[in,out] *S points to an instance of the Q31 PID Control structure
switches 0:5c4d7b2438d3 5122 * @param[in] in input sample to process
switches 0:5c4d7b2438d3 5123 * @return out processed output sample.
switches 0:5c4d7b2438d3 5124 *
switches 0:5c4d7b2438d3 5125 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5126 * \par
switches 0:5c4d7b2438d3 5127 * The function is implemented using an internal 64-bit accumulator.
switches 0:5c4d7b2438d3 5128 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
switches 0:5c4d7b2438d3 5129 * Thus, if the accumulator result overflows it wraps around rather than clip.
switches 0:5c4d7b2438d3 5130 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
switches 0:5c4d7b2438d3 5131 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
switches 0:5c4d7b2438d3 5132 */
switches 0:5c4d7b2438d3 5133
switches 0:5c4d7b2438d3 5134 static __INLINE q31_t arm_pid_q31(
switches 0:5c4d7b2438d3 5135 arm_pid_instance_q31 * S,
switches 0:5c4d7b2438d3 5136 q31_t in)
switches 0:5c4d7b2438d3 5137 {
switches 0:5c4d7b2438d3 5138 q63_t acc;
switches 0:5c4d7b2438d3 5139 q31_t out;
switches 0:5c4d7b2438d3 5140
switches 0:5c4d7b2438d3 5141 /* acc = A0 * x[n] */
switches 0:5c4d7b2438d3 5142 acc = (q63_t) S->A0 * in;
switches 0:5c4d7b2438d3 5143
switches 0:5c4d7b2438d3 5144 /* acc += A1 * x[n-1] */
switches 0:5c4d7b2438d3 5145 acc += (q63_t) S->A1 * S->state[0];
switches 0:5c4d7b2438d3 5146
switches 0:5c4d7b2438d3 5147 /* acc += A2 * x[n-2] */
switches 0:5c4d7b2438d3 5148 acc += (q63_t) S->A2 * S->state[1];
switches 0:5c4d7b2438d3 5149
switches 0:5c4d7b2438d3 5150 /* convert output to 1.31 format to add y[n-1] */
switches 0:5c4d7b2438d3 5151 out = (q31_t) (acc >> 31u);
switches 0:5c4d7b2438d3 5152
switches 0:5c4d7b2438d3 5153 /* out += y[n-1] */
switches 0:5c4d7b2438d3 5154 out += S->state[2];
switches 0:5c4d7b2438d3 5155
switches 0:5c4d7b2438d3 5156 /* Update state */
switches 0:5c4d7b2438d3 5157 S->state[1] = S->state[0];
switches 0:5c4d7b2438d3 5158 S->state[0] = in;
switches 0:5c4d7b2438d3 5159 S->state[2] = out;
switches 0:5c4d7b2438d3 5160
switches 0:5c4d7b2438d3 5161 /* return to application */
switches 0:5c4d7b2438d3 5162 return (out);
switches 0:5c4d7b2438d3 5163
switches 0:5c4d7b2438d3 5164 }
switches 0:5c4d7b2438d3 5165
switches 0:5c4d7b2438d3 5166 /**
switches 0:5c4d7b2438d3 5167 * @brief Process function for the Q15 PID Control.
switches 0:5c4d7b2438d3 5168 * @param[in,out] *S points to an instance of the Q15 PID Control structure
switches 0:5c4d7b2438d3 5169 * @param[in] in input sample to process
switches 0:5c4d7b2438d3 5170 * @return out processed output sample.
switches 0:5c4d7b2438d3 5171 *
switches 0:5c4d7b2438d3 5172 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5173 * \par
switches 0:5c4d7b2438d3 5174 * The function is implemented using a 64-bit internal accumulator.
switches 0:5c4d7b2438d3 5175 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
switches 0:5c4d7b2438d3 5176 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
switches 0:5c4d7b2438d3 5177 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
switches 0:5c4d7b2438d3 5178 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
switches 0:5c4d7b2438d3 5179 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
switches 0:5c4d7b2438d3 5180 */
switches 0:5c4d7b2438d3 5181
switches 0:5c4d7b2438d3 5182 static __INLINE q15_t arm_pid_q15(
switches 0:5c4d7b2438d3 5183 arm_pid_instance_q15 * S,
switches 0:5c4d7b2438d3 5184 q15_t in)
switches 0:5c4d7b2438d3 5185 {
switches 0:5c4d7b2438d3 5186 q63_t acc;
switches 0:5c4d7b2438d3 5187 q15_t out;
switches 0:5c4d7b2438d3 5188
switches 0:5c4d7b2438d3 5189 #ifndef ARM_MATH_CM0_FAMILY
switches 0:5c4d7b2438d3 5190 __SIMD32_TYPE *vstate;
switches 0:5c4d7b2438d3 5191
switches 0:5c4d7b2438d3 5192 /* Implementation of PID controller */
switches 0:5c4d7b2438d3 5193
switches 0:5c4d7b2438d3 5194 /* acc = A0 * x[n] */
switches 0:5c4d7b2438d3 5195 acc = (q31_t) __SMUAD(S->A0, in);
switches 0:5c4d7b2438d3 5196
switches 0:5c4d7b2438d3 5197 /* acc += A1 * x[n-1] + A2 * x[n-2] */
switches 0:5c4d7b2438d3 5198 vstate = __SIMD32_CONST(S->state);
switches 0:5c4d7b2438d3 5199 acc = __SMLALD(S->A1, (q31_t) *vstate, acc);
switches 0:5c4d7b2438d3 5200
switches 0:5c4d7b2438d3 5201 #else
switches 0:5c4d7b2438d3 5202 /* acc = A0 * x[n] */
switches 0:5c4d7b2438d3 5203 acc = ((q31_t) S->A0) * in;
switches 0:5c4d7b2438d3 5204
switches 0:5c4d7b2438d3 5205 /* acc += A1 * x[n-1] + A2 * x[n-2] */
switches 0:5c4d7b2438d3 5206 acc += (q31_t) S->A1 * S->state[0];
switches 0:5c4d7b2438d3 5207 acc += (q31_t) S->A2 * S->state[1];
switches 0:5c4d7b2438d3 5208
switches 0:5c4d7b2438d3 5209 #endif
switches 0:5c4d7b2438d3 5210
switches 0:5c4d7b2438d3 5211 /* acc += y[n-1] */
switches 0:5c4d7b2438d3 5212 acc += (q31_t) S->state[2] << 15;
switches 0:5c4d7b2438d3 5213
switches 0:5c4d7b2438d3 5214 /* saturate the output */
switches 0:5c4d7b2438d3 5215 out = (q15_t) (__SSAT((acc >> 15), 16));
switches 0:5c4d7b2438d3 5216
switches 0:5c4d7b2438d3 5217 /* Update state */
switches 0:5c4d7b2438d3 5218 S->state[1] = S->state[0];
switches 0:5c4d7b2438d3 5219 S->state[0] = in;
switches 0:5c4d7b2438d3 5220 S->state[2] = out;
switches 0:5c4d7b2438d3 5221
switches 0:5c4d7b2438d3 5222 /* return to application */
switches 0:5c4d7b2438d3 5223 return (out);
switches 0:5c4d7b2438d3 5224
switches 0:5c4d7b2438d3 5225 }
switches 0:5c4d7b2438d3 5226
switches 0:5c4d7b2438d3 5227 /**
switches 0:5c4d7b2438d3 5228 * @} end of PID group
switches 0:5c4d7b2438d3 5229 */
switches 0:5c4d7b2438d3 5230
switches 0:5c4d7b2438d3 5231
switches 0:5c4d7b2438d3 5232 /**
switches 0:5c4d7b2438d3 5233 * @brief Floating-point matrix inverse.
switches 0:5c4d7b2438d3 5234 * @param[in] *src points to the instance of the input floating-point matrix structure.
switches 0:5c4d7b2438d3 5235 * @param[out] *dst points to the instance of the output floating-point matrix structure.
switches 0:5c4d7b2438d3 5236 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
switches 0:5c4d7b2438d3 5237 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
switches 0:5c4d7b2438d3 5238 */
switches 0:5c4d7b2438d3 5239
switches 0:5c4d7b2438d3 5240 arm_status arm_mat_inverse_f32(
switches 0:5c4d7b2438d3 5241 const arm_matrix_instance_f32 * src,
switches 0:5c4d7b2438d3 5242 arm_matrix_instance_f32 * dst);
switches 0:5c4d7b2438d3 5243
switches 0:5c4d7b2438d3 5244
switches 0:5c4d7b2438d3 5245 /**
switches 0:5c4d7b2438d3 5246 * @brief Floating-point matrix inverse.
switches 0:5c4d7b2438d3 5247 * @param[in] *src points to the instance of the input floating-point matrix structure.
switches 0:5c4d7b2438d3 5248 * @param[out] *dst points to the instance of the output floating-point matrix structure.
switches 0:5c4d7b2438d3 5249 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
switches 0:5c4d7b2438d3 5250 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
switches 0:5c4d7b2438d3 5251 */
switches 0:5c4d7b2438d3 5252
switches 0:5c4d7b2438d3 5253 arm_status arm_mat_inverse_f64(
switches 0:5c4d7b2438d3 5254 const arm_matrix_instance_f64 * src,
switches 0:5c4d7b2438d3 5255 arm_matrix_instance_f64 * dst);
switches 0:5c4d7b2438d3 5256
switches 0:5c4d7b2438d3 5257
switches 0:5c4d7b2438d3 5258
switches 0:5c4d7b2438d3 5259 /**
switches 0:5c4d7b2438d3 5260 * @ingroup groupController
switches 0:5c4d7b2438d3 5261 */
switches 0:5c4d7b2438d3 5262
switches 0:5c4d7b2438d3 5263
switches 0:5c4d7b2438d3 5264 /**
switches 0:5c4d7b2438d3 5265 * @defgroup clarke Vector Clarke Transform
switches 0:5c4d7b2438d3 5266 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
switches 0:5c4d7b2438d3 5267 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
switches 0:5c4d7b2438d3 5268 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
switches 0:5c4d7b2438d3 5269 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
switches 0:5c4d7b2438d3 5270 * \image html clarke.gif Stator current space vector and its components in (a,b).
switches 0:5c4d7b2438d3 5271 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
switches 0:5c4d7b2438d3 5272 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
switches 0:5c4d7b2438d3 5273 *
switches 0:5c4d7b2438d3 5274 * The function operates on a single sample of data and each call to the function returns the processed output.
switches 0:5c4d7b2438d3 5275 * The library provides separate functions for Q31 and floating-point data types.
switches 0:5c4d7b2438d3 5276 * \par Algorithm
switches 0:5c4d7b2438d3 5277 * \image html clarkeFormula.gif
switches 0:5c4d7b2438d3 5278 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
switches 0:5c4d7b2438d3 5279 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
switches 0:5c4d7b2438d3 5280 * \par Fixed-Point Behavior
switches 0:5c4d7b2438d3 5281 * Care must be taken when using the Q31 version of the Clarke transform.
switches 0:5c4d7b2438d3 5282 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
switches 0:5c4d7b2438d3 5283 * Refer to the function specific documentation below for usage guidelines.
switches 0:5c4d7b2438d3 5284 */
switches 0:5c4d7b2438d3 5285
switches 0:5c4d7b2438d3 5286 /**
switches 0:5c4d7b2438d3 5287 * @addtogroup clarke
switches 0:5c4d7b2438d3 5288 * @{
switches 0:5c4d7b2438d3 5289 */
switches 0:5c4d7b2438d3 5290
switches 0:5c4d7b2438d3 5291 /**
switches 0:5c4d7b2438d3 5292 *
switches 0:5c4d7b2438d3 5293 * @brief Floating-point Clarke transform
switches 0:5c4d7b2438d3 5294 * @param[in] Ia input three-phase coordinate <code>a</code>
switches 0:5c4d7b2438d3 5295 * @param[in] Ib input three-phase coordinate <code>b</code>
switches 0:5c4d7b2438d3 5296 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5297 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5298 * @return none.
switches 0:5c4d7b2438d3 5299 */
switches 0:5c4d7b2438d3 5300
switches 0:5c4d7b2438d3 5301 static __INLINE void arm_clarke_f32(
switches 0:5c4d7b2438d3 5302 float32_t Ia,
switches 0:5c4d7b2438d3 5303 float32_t Ib,
switches 0:5c4d7b2438d3 5304 float32_t * pIalpha,
switches 0:5c4d7b2438d3 5305 float32_t * pIbeta)
switches 0:5c4d7b2438d3 5306 {
switches 0:5c4d7b2438d3 5307 /* Calculate pIalpha using the equation, pIalpha = Ia */
switches 0:5c4d7b2438d3 5308 *pIalpha = Ia;
switches 0:5c4d7b2438d3 5309
switches 0:5c4d7b2438d3 5310 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
switches 0:5c4d7b2438d3 5311 *pIbeta =
switches 0:5c4d7b2438d3 5312 ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
switches 0:5c4d7b2438d3 5313
switches 0:5c4d7b2438d3 5314 }
switches 0:5c4d7b2438d3 5315
switches 0:5c4d7b2438d3 5316 /**
switches 0:5c4d7b2438d3 5317 * @brief Clarke transform for Q31 version
switches 0:5c4d7b2438d3 5318 * @param[in] Ia input three-phase coordinate <code>a</code>
switches 0:5c4d7b2438d3 5319 * @param[in] Ib input three-phase coordinate <code>b</code>
switches 0:5c4d7b2438d3 5320 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5321 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5322 * @return none.
switches 0:5c4d7b2438d3 5323 *
switches 0:5c4d7b2438d3 5324 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5325 * \par
switches 0:5c4d7b2438d3 5326 * The function is implemented using an internal 32-bit accumulator.
switches 0:5c4d7b2438d3 5327 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
switches 0:5c4d7b2438d3 5328 * There is saturation on the addition, hence there is no risk of overflow.
switches 0:5c4d7b2438d3 5329 */
switches 0:5c4d7b2438d3 5330
switches 0:5c4d7b2438d3 5331 static __INLINE void arm_clarke_q31(
switches 0:5c4d7b2438d3 5332 q31_t Ia,
switches 0:5c4d7b2438d3 5333 q31_t Ib,
switches 0:5c4d7b2438d3 5334 q31_t * pIalpha,
switches 0:5c4d7b2438d3 5335 q31_t * pIbeta)
switches 0:5c4d7b2438d3 5336 {
switches 0:5c4d7b2438d3 5337 q31_t product1, product2; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5338
switches 0:5c4d7b2438d3 5339 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
switches 0:5c4d7b2438d3 5340 *pIalpha = Ia;
switches 0:5c4d7b2438d3 5341
switches 0:5c4d7b2438d3 5342 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
switches 0:5c4d7b2438d3 5343 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
switches 0:5c4d7b2438d3 5344
switches 0:5c4d7b2438d3 5345 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
switches 0:5c4d7b2438d3 5346 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
switches 0:5c4d7b2438d3 5347
switches 0:5c4d7b2438d3 5348 /* pIbeta is calculated by adding the intermediate products */
switches 0:5c4d7b2438d3 5349 *pIbeta = __QADD(product1, product2);
switches 0:5c4d7b2438d3 5350 }
switches 0:5c4d7b2438d3 5351
switches 0:5c4d7b2438d3 5352 /**
switches 0:5c4d7b2438d3 5353 * @} end of clarke group
switches 0:5c4d7b2438d3 5354 */
switches 0:5c4d7b2438d3 5355
switches 0:5c4d7b2438d3 5356 /**
switches 0:5c4d7b2438d3 5357 * @brief Converts the elements of the Q7 vector to Q31 vector.
switches 0:5c4d7b2438d3 5358 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 5359 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 5360 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 5361 * @return none.
switches 0:5c4d7b2438d3 5362 */
switches 0:5c4d7b2438d3 5363 void arm_q7_to_q31(
switches 0:5c4d7b2438d3 5364 q7_t * pSrc,
switches 0:5c4d7b2438d3 5365 q31_t * pDst,
switches 0:5c4d7b2438d3 5366 uint32_t blockSize);
switches 0:5c4d7b2438d3 5367
switches 0:5c4d7b2438d3 5368
switches 0:5c4d7b2438d3 5369
switches 0:5c4d7b2438d3 5370
switches 0:5c4d7b2438d3 5371 /**
switches 0:5c4d7b2438d3 5372 * @ingroup groupController
switches 0:5c4d7b2438d3 5373 */
switches 0:5c4d7b2438d3 5374
switches 0:5c4d7b2438d3 5375 /**
switches 0:5c4d7b2438d3 5376 * @defgroup inv_clarke Vector Inverse Clarke Transform
switches 0:5c4d7b2438d3 5377 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
switches 0:5c4d7b2438d3 5378 *
switches 0:5c4d7b2438d3 5379 * The function operates on a single sample of data and each call to the function returns the processed output.
switches 0:5c4d7b2438d3 5380 * The library provides separate functions for Q31 and floating-point data types.
switches 0:5c4d7b2438d3 5381 * \par Algorithm
switches 0:5c4d7b2438d3 5382 * \image html clarkeInvFormula.gif
switches 0:5c4d7b2438d3 5383 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
switches 0:5c4d7b2438d3 5384 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
switches 0:5c4d7b2438d3 5385 * \par Fixed-Point Behavior
switches 0:5c4d7b2438d3 5386 * Care must be taken when using the Q31 version of the Clarke transform.
switches 0:5c4d7b2438d3 5387 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
switches 0:5c4d7b2438d3 5388 * Refer to the function specific documentation below for usage guidelines.
switches 0:5c4d7b2438d3 5389 */
switches 0:5c4d7b2438d3 5390
switches 0:5c4d7b2438d3 5391 /**
switches 0:5c4d7b2438d3 5392 * @addtogroup inv_clarke
switches 0:5c4d7b2438d3 5393 * @{
switches 0:5c4d7b2438d3 5394 */
switches 0:5c4d7b2438d3 5395
switches 0:5c4d7b2438d3 5396 /**
switches 0:5c4d7b2438d3 5397 * @brief Floating-point Inverse Clarke transform
switches 0:5c4d7b2438d3 5398 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5399 * @param[in] Ibeta input two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5400 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
switches 0:5c4d7b2438d3 5401 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
switches 0:5c4d7b2438d3 5402 * @return none.
switches 0:5c4d7b2438d3 5403 */
switches 0:5c4d7b2438d3 5404
switches 0:5c4d7b2438d3 5405
switches 0:5c4d7b2438d3 5406 static __INLINE void arm_inv_clarke_f32(
switches 0:5c4d7b2438d3 5407 float32_t Ialpha,
switches 0:5c4d7b2438d3 5408 float32_t Ibeta,
switches 0:5c4d7b2438d3 5409 float32_t * pIa,
switches 0:5c4d7b2438d3 5410 float32_t * pIb)
switches 0:5c4d7b2438d3 5411 {
switches 0:5c4d7b2438d3 5412 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
switches 0:5c4d7b2438d3 5413 *pIa = Ialpha;
switches 0:5c4d7b2438d3 5414
switches 0:5c4d7b2438d3 5415 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
switches 0:5c4d7b2438d3 5416 *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
switches 0:5c4d7b2438d3 5417
switches 0:5c4d7b2438d3 5418 }
switches 0:5c4d7b2438d3 5419
switches 0:5c4d7b2438d3 5420 /**
switches 0:5c4d7b2438d3 5421 * @brief Inverse Clarke transform for Q31 version
switches 0:5c4d7b2438d3 5422 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5423 * @param[in] Ibeta input two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5424 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
switches 0:5c4d7b2438d3 5425 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
switches 0:5c4d7b2438d3 5426 * @return none.
switches 0:5c4d7b2438d3 5427 *
switches 0:5c4d7b2438d3 5428 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5429 * \par
switches 0:5c4d7b2438d3 5430 * The function is implemented using an internal 32-bit accumulator.
switches 0:5c4d7b2438d3 5431 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
switches 0:5c4d7b2438d3 5432 * There is saturation on the subtraction, hence there is no risk of overflow.
switches 0:5c4d7b2438d3 5433 */
switches 0:5c4d7b2438d3 5434
switches 0:5c4d7b2438d3 5435 static __INLINE void arm_inv_clarke_q31(
switches 0:5c4d7b2438d3 5436 q31_t Ialpha,
switches 0:5c4d7b2438d3 5437 q31_t Ibeta,
switches 0:5c4d7b2438d3 5438 q31_t * pIa,
switches 0:5c4d7b2438d3 5439 q31_t * pIb)
switches 0:5c4d7b2438d3 5440 {
switches 0:5c4d7b2438d3 5441 q31_t product1, product2; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5442
switches 0:5c4d7b2438d3 5443 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
switches 0:5c4d7b2438d3 5444 *pIa = Ialpha;
switches 0:5c4d7b2438d3 5445
switches 0:5c4d7b2438d3 5446 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
switches 0:5c4d7b2438d3 5447 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
switches 0:5c4d7b2438d3 5448
switches 0:5c4d7b2438d3 5449 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
switches 0:5c4d7b2438d3 5450 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
switches 0:5c4d7b2438d3 5451
switches 0:5c4d7b2438d3 5452 /* pIb is calculated by subtracting the products */
switches 0:5c4d7b2438d3 5453 *pIb = __QSUB(product2, product1);
switches 0:5c4d7b2438d3 5454
switches 0:5c4d7b2438d3 5455 }
switches 0:5c4d7b2438d3 5456
switches 0:5c4d7b2438d3 5457 /**
switches 0:5c4d7b2438d3 5458 * @} end of inv_clarke group
switches 0:5c4d7b2438d3 5459 */
switches 0:5c4d7b2438d3 5460
switches 0:5c4d7b2438d3 5461 /**
switches 0:5c4d7b2438d3 5462 * @brief Converts the elements of the Q7 vector to Q15 vector.
switches 0:5c4d7b2438d3 5463 * @param[in] *pSrc input pointer
switches 0:5c4d7b2438d3 5464 * @param[out] *pDst output pointer
switches 0:5c4d7b2438d3 5465 * @param[in] blockSize number of samples to process
switches 0:5c4d7b2438d3 5466 * @return none.
switches 0:5c4d7b2438d3 5467 */
switches 0:5c4d7b2438d3 5468 void arm_q7_to_q15(
switches 0:5c4d7b2438d3 5469 q7_t * pSrc,
switches 0:5c4d7b2438d3 5470 q15_t * pDst,
switches 0:5c4d7b2438d3 5471 uint32_t blockSize);
switches 0:5c4d7b2438d3 5472
switches 0:5c4d7b2438d3 5473
switches 0:5c4d7b2438d3 5474
switches 0:5c4d7b2438d3 5475 /**
switches 0:5c4d7b2438d3 5476 * @ingroup groupController
switches 0:5c4d7b2438d3 5477 */
switches 0:5c4d7b2438d3 5478
switches 0:5c4d7b2438d3 5479 /**
switches 0:5c4d7b2438d3 5480 * @defgroup park Vector Park Transform
switches 0:5c4d7b2438d3 5481 *
switches 0:5c4d7b2438d3 5482 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
switches 0:5c4d7b2438d3 5483 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
switches 0:5c4d7b2438d3 5484 * from the stationary to the moving reference frame and control the spatial relationship between
switches 0:5c4d7b2438d3 5485 * the stator vector current and rotor flux vector.
switches 0:5c4d7b2438d3 5486 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
switches 0:5c4d7b2438d3 5487 * current vector and the relationship from the two reference frames:
switches 0:5c4d7b2438d3 5488 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
switches 0:5c4d7b2438d3 5489 *
switches 0:5c4d7b2438d3 5490 * The function operates on a single sample of data and each call to the function returns the processed output.
switches 0:5c4d7b2438d3 5491 * The library provides separate functions for Q31 and floating-point data types.
switches 0:5c4d7b2438d3 5492 * \par Algorithm
switches 0:5c4d7b2438d3 5493 * \image html parkFormula.gif
switches 0:5c4d7b2438d3 5494 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
switches 0:5c4d7b2438d3 5495 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
switches 0:5c4d7b2438d3 5496 * cosine and sine values of theta (rotor flux position).
switches 0:5c4d7b2438d3 5497 * \par Fixed-Point Behavior
switches 0:5c4d7b2438d3 5498 * Care must be taken when using the Q31 version of the Park transform.
switches 0:5c4d7b2438d3 5499 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
switches 0:5c4d7b2438d3 5500 * Refer to the function specific documentation below for usage guidelines.
switches 0:5c4d7b2438d3 5501 */
switches 0:5c4d7b2438d3 5502
switches 0:5c4d7b2438d3 5503 /**
switches 0:5c4d7b2438d3 5504 * @addtogroup park
switches 0:5c4d7b2438d3 5505 * @{
switches 0:5c4d7b2438d3 5506 */
switches 0:5c4d7b2438d3 5507
switches 0:5c4d7b2438d3 5508 /**
switches 0:5c4d7b2438d3 5509 * @brief Floating-point Park transform
switches 0:5c4d7b2438d3 5510 * @param[in] Ialpha input two-phase vector coordinate alpha
switches 0:5c4d7b2438d3 5511 * @param[in] Ibeta input two-phase vector coordinate beta
switches 0:5c4d7b2438d3 5512 * @param[out] *pId points to output rotor reference frame d
switches 0:5c4d7b2438d3 5513 * @param[out] *pIq points to output rotor reference frame q
switches 0:5c4d7b2438d3 5514 * @param[in] sinVal sine value of rotation angle theta
switches 0:5c4d7b2438d3 5515 * @param[in] cosVal cosine value of rotation angle theta
switches 0:5c4d7b2438d3 5516 * @return none.
switches 0:5c4d7b2438d3 5517 *
switches 0:5c4d7b2438d3 5518 * The function implements the forward Park transform.
switches 0:5c4d7b2438d3 5519 *
switches 0:5c4d7b2438d3 5520 */
switches 0:5c4d7b2438d3 5521
switches 0:5c4d7b2438d3 5522 static __INLINE void arm_park_f32(
switches 0:5c4d7b2438d3 5523 float32_t Ialpha,
switches 0:5c4d7b2438d3 5524 float32_t Ibeta,
switches 0:5c4d7b2438d3 5525 float32_t * pId,
switches 0:5c4d7b2438d3 5526 float32_t * pIq,
switches 0:5c4d7b2438d3 5527 float32_t sinVal,
switches 0:5c4d7b2438d3 5528 float32_t cosVal)
switches 0:5c4d7b2438d3 5529 {
switches 0:5c4d7b2438d3 5530 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
switches 0:5c4d7b2438d3 5531 *pId = Ialpha * cosVal + Ibeta * sinVal;
switches 0:5c4d7b2438d3 5532
switches 0:5c4d7b2438d3 5533 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
switches 0:5c4d7b2438d3 5534 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
switches 0:5c4d7b2438d3 5535
switches 0:5c4d7b2438d3 5536 }
switches 0:5c4d7b2438d3 5537
switches 0:5c4d7b2438d3 5538 /**
switches 0:5c4d7b2438d3 5539 * @brief Park transform for Q31 version
switches 0:5c4d7b2438d3 5540 * @param[in] Ialpha input two-phase vector coordinate alpha
switches 0:5c4d7b2438d3 5541 * @param[in] Ibeta input two-phase vector coordinate beta
switches 0:5c4d7b2438d3 5542 * @param[out] *pId points to output rotor reference frame d
switches 0:5c4d7b2438d3 5543 * @param[out] *pIq points to output rotor reference frame q
switches 0:5c4d7b2438d3 5544 * @param[in] sinVal sine value of rotation angle theta
switches 0:5c4d7b2438d3 5545 * @param[in] cosVal cosine value of rotation angle theta
switches 0:5c4d7b2438d3 5546 * @return none.
switches 0:5c4d7b2438d3 5547 *
switches 0:5c4d7b2438d3 5548 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5549 * \par
switches 0:5c4d7b2438d3 5550 * The function is implemented using an internal 32-bit accumulator.
switches 0:5c4d7b2438d3 5551 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
switches 0:5c4d7b2438d3 5552 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
switches 0:5c4d7b2438d3 5553 */
switches 0:5c4d7b2438d3 5554
switches 0:5c4d7b2438d3 5555
switches 0:5c4d7b2438d3 5556 static __INLINE void arm_park_q31(
switches 0:5c4d7b2438d3 5557 q31_t Ialpha,
switches 0:5c4d7b2438d3 5558 q31_t Ibeta,
switches 0:5c4d7b2438d3 5559 q31_t * pId,
switches 0:5c4d7b2438d3 5560 q31_t * pIq,
switches 0:5c4d7b2438d3 5561 q31_t sinVal,
switches 0:5c4d7b2438d3 5562 q31_t cosVal)
switches 0:5c4d7b2438d3 5563 {
switches 0:5c4d7b2438d3 5564 q31_t product1, product2; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5565 q31_t product3, product4; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5566
switches 0:5c4d7b2438d3 5567 /* Intermediate product is calculated by (Ialpha * cosVal) */
switches 0:5c4d7b2438d3 5568 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
switches 0:5c4d7b2438d3 5569
switches 0:5c4d7b2438d3 5570 /* Intermediate product is calculated by (Ibeta * sinVal) */
switches 0:5c4d7b2438d3 5571 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
switches 0:5c4d7b2438d3 5572
switches 0:5c4d7b2438d3 5573
switches 0:5c4d7b2438d3 5574 /* Intermediate product is calculated by (Ialpha * sinVal) */
switches 0:5c4d7b2438d3 5575 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
switches 0:5c4d7b2438d3 5576
switches 0:5c4d7b2438d3 5577 /* Intermediate product is calculated by (Ibeta * cosVal) */
switches 0:5c4d7b2438d3 5578 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
switches 0:5c4d7b2438d3 5579
switches 0:5c4d7b2438d3 5580 /* Calculate pId by adding the two intermediate products 1 and 2 */
switches 0:5c4d7b2438d3 5581 *pId = __QADD(product1, product2);
switches 0:5c4d7b2438d3 5582
switches 0:5c4d7b2438d3 5583 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
switches 0:5c4d7b2438d3 5584 *pIq = __QSUB(product4, product3);
switches 0:5c4d7b2438d3 5585 }
switches 0:5c4d7b2438d3 5586
switches 0:5c4d7b2438d3 5587 /**
switches 0:5c4d7b2438d3 5588 * @} end of park group
switches 0:5c4d7b2438d3 5589 */
switches 0:5c4d7b2438d3 5590
switches 0:5c4d7b2438d3 5591 /**
switches 0:5c4d7b2438d3 5592 * @brief Converts the elements of the Q7 vector to floating-point vector.
switches 0:5c4d7b2438d3 5593 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 5594 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 5595 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 5596 * @return none.
switches 0:5c4d7b2438d3 5597 */
switches 0:5c4d7b2438d3 5598 void arm_q7_to_float(
switches 0:5c4d7b2438d3 5599 q7_t * pSrc,
switches 0:5c4d7b2438d3 5600 float32_t * pDst,
switches 0:5c4d7b2438d3 5601 uint32_t blockSize);
switches 0:5c4d7b2438d3 5602
switches 0:5c4d7b2438d3 5603
switches 0:5c4d7b2438d3 5604 /**
switches 0:5c4d7b2438d3 5605 * @ingroup groupController
switches 0:5c4d7b2438d3 5606 */
switches 0:5c4d7b2438d3 5607
switches 0:5c4d7b2438d3 5608 /**
switches 0:5c4d7b2438d3 5609 * @defgroup inv_park Vector Inverse Park transform
switches 0:5c4d7b2438d3 5610 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
switches 0:5c4d7b2438d3 5611 *
switches 0:5c4d7b2438d3 5612 * The function operates on a single sample of data and each call to the function returns the processed output.
switches 0:5c4d7b2438d3 5613 * The library provides separate functions for Q31 and floating-point data types.
switches 0:5c4d7b2438d3 5614 * \par Algorithm
switches 0:5c4d7b2438d3 5615 * \image html parkInvFormula.gif
switches 0:5c4d7b2438d3 5616 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
switches 0:5c4d7b2438d3 5617 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
switches 0:5c4d7b2438d3 5618 * cosine and sine values of theta (rotor flux position).
switches 0:5c4d7b2438d3 5619 * \par Fixed-Point Behavior
switches 0:5c4d7b2438d3 5620 * Care must be taken when using the Q31 version of the Park transform.
switches 0:5c4d7b2438d3 5621 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
switches 0:5c4d7b2438d3 5622 * Refer to the function specific documentation below for usage guidelines.
switches 0:5c4d7b2438d3 5623 */
switches 0:5c4d7b2438d3 5624
switches 0:5c4d7b2438d3 5625 /**
switches 0:5c4d7b2438d3 5626 * @addtogroup inv_park
switches 0:5c4d7b2438d3 5627 * @{
switches 0:5c4d7b2438d3 5628 */
switches 0:5c4d7b2438d3 5629
switches 0:5c4d7b2438d3 5630 /**
switches 0:5c4d7b2438d3 5631 * @brief Floating-point Inverse Park transform
switches 0:5c4d7b2438d3 5632 * @param[in] Id input coordinate of rotor reference frame d
switches 0:5c4d7b2438d3 5633 * @param[in] Iq input coordinate of rotor reference frame q
switches 0:5c4d7b2438d3 5634 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5635 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5636 * @param[in] sinVal sine value of rotation angle theta
switches 0:5c4d7b2438d3 5637 * @param[in] cosVal cosine value of rotation angle theta
switches 0:5c4d7b2438d3 5638 * @return none.
switches 0:5c4d7b2438d3 5639 */
switches 0:5c4d7b2438d3 5640
switches 0:5c4d7b2438d3 5641 static __INLINE void arm_inv_park_f32(
switches 0:5c4d7b2438d3 5642 float32_t Id,
switches 0:5c4d7b2438d3 5643 float32_t Iq,
switches 0:5c4d7b2438d3 5644 float32_t * pIalpha,
switches 0:5c4d7b2438d3 5645 float32_t * pIbeta,
switches 0:5c4d7b2438d3 5646 float32_t sinVal,
switches 0:5c4d7b2438d3 5647 float32_t cosVal)
switches 0:5c4d7b2438d3 5648 {
switches 0:5c4d7b2438d3 5649 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
switches 0:5c4d7b2438d3 5650 *pIalpha = Id * cosVal - Iq * sinVal;
switches 0:5c4d7b2438d3 5651
switches 0:5c4d7b2438d3 5652 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
switches 0:5c4d7b2438d3 5653 *pIbeta = Id * sinVal + Iq * cosVal;
switches 0:5c4d7b2438d3 5654
switches 0:5c4d7b2438d3 5655 }
switches 0:5c4d7b2438d3 5656
switches 0:5c4d7b2438d3 5657
switches 0:5c4d7b2438d3 5658 /**
switches 0:5c4d7b2438d3 5659 * @brief Inverse Park transform for Q31 version
switches 0:5c4d7b2438d3 5660 * @param[in] Id input coordinate of rotor reference frame d
switches 0:5c4d7b2438d3 5661 * @param[in] Iq input coordinate of rotor reference frame q
switches 0:5c4d7b2438d3 5662 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
switches 0:5c4d7b2438d3 5663 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
switches 0:5c4d7b2438d3 5664 * @param[in] sinVal sine value of rotation angle theta
switches 0:5c4d7b2438d3 5665 * @param[in] cosVal cosine value of rotation angle theta
switches 0:5c4d7b2438d3 5666 * @return none.
switches 0:5c4d7b2438d3 5667 *
switches 0:5c4d7b2438d3 5668 * <b>Scaling and Overflow Behavior:</b>
switches 0:5c4d7b2438d3 5669 * \par
switches 0:5c4d7b2438d3 5670 * The function is implemented using an internal 32-bit accumulator.
switches 0:5c4d7b2438d3 5671 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
switches 0:5c4d7b2438d3 5672 * There is saturation on the addition, hence there is no risk of overflow.
switches 0:5c4d7b2438d3 5673 */
switches 0:5c4d7b2438d3 5674
switches 0:5c4d7b2438d3 5675
switches 0:5c4d7b2438d3 5676 static __INLINE void arm_inv_park_q31(
switches 0:5c4d7b2438d3 5677 q31_t Id,
switches 0:5c4d7b2438d3 5678 q31_t Iq,
switches 0:5c4d7b2438d3 5679 q31_t * pIalpha,
switches 0:5c4d7b2438d3 5680 q31_t * pIbeta,
switches 0:5c4d7b2438d3 5681 q31_t sinVal,
switches 0:5c4d7b2438d3 5682 q31_t cosVal)
switches 0:5c4d7b2438d3 5683 {
switches 0:5c4d7b2438d3 5684 q31_t product1, product2; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5685 q31_t product3, product4; /* Temporary variables used to store intermediate results */
switches 0:5c4d7b2438d3 5686
switches 0:5c4d7b2438d3 5687 /* Intermediate product is calculated by (Id * cosVal) */
switches 0:5c4d7b2438d3 5688 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
switches 0:5c4d7b2438d3 5689
switches 0:5c4d7b2438d3 5690 /* Intermediate product is calculated by (Iq * sinVal) */
switches 0:5c4d7b2438d3 5691 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
switches 0:5c4d7b2438d3 5692
switches 0:5c4d7b2438d3 5693
switches 0:5c4d7b2438d3 5694 /* Intermediate product is calculated by (Id * sinVal) */
switches 0:5c4d7b2438d3 5695 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
switches 0:5c4d7b2438d3 5696
switches 0:5c4d7b2438d3 5697 /* Intermediate product is calculated by (Iq * cosVal) */
switches 0:5c4d7b2438d3 5698 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
switches 0:5c4d7b2438d3 5699
switches 0:5c4d7b2438d3 5700 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
switches 0:5c4d7b2438d3 5701 *pIalpha = __QSUB(product1, product2);
switches 0:5c4d7b2438d3 5702
switches 0:5c4d7b2438d3 5703 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
switches 0:5c4d7b2438d3 5704 *pIbeta = __QADD(product4, product3);
switches 0:5c4d7b2438d3 5705
switches 0:5c4d7b2438d3 5706 }
switches 0:5c4d7b2438d3 5707
switches 0:5c4d7b2438d3 5708 /**
switches 0:5c4d7b2438d3 5709 * @} end of Inverse park group
switches 0:5c4d7b2438d3 5710 */
switches 0:5c4d7b2438d3 5711
switches 0:5c4d7b2438d3 5712
switches 0:5c4d7b2438d3 5713 /**
switches 0:5c4d7b2438d3 5714 * @brief Converts the elements of the Q31 vector to floating-point vector.
switches 0:5c4d7b2438d3 5715 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 5716 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 5717 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 5718 * @return none.
switches 0:5c4d7b2438d3 5719 */
switches 0:5c4d7b2438d3 5720 void arm_q31_to_float(
switches 0:5c4d7b2438d3 5721 q31_t * pSrc,
switches 0:5c4d7b2438d3 5722 float32_t * pDst,
switches 0:5c4d7b2438d3 5723 uint32_t blockSize);
switches 0:5c4d7b2438d3 5724
switches 0:5c4d7b2438d3 5725 /**
switches 0:5c4d7b2438d3 5726 * @ingroup groupInterpolation
switches 0:5c4d7b2438d3 5727 */
switches 0:5c4d7b2438d3 5728
switches 0:5c4d7b2438d3 5729 /**
switches 0:5c4d7b2438d3 5730 * @defgroup LinearInterpolate Linear Interpolation
switches 0:5c4d7b2438d3 5731 *
switches 0:5c4d7b2438d3 5732 * Linear interpolation is a method of curve fitting using linear polynomials.
switches 0:5c4d7b2438d3 5733 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
switches 0:5c4d7b2438d3 5734 *
switches 0:5c4d7b2438d3 5735 * \par
switches 0:5c4d7b2438d3 5736 * \image html LinearInterp.gif "Linear interpolation"
switches 0:5c4d7b2438d3 5737 *
switches 0:5c4d7b2438d3 5738 * \par
switches 0:5c4d7b2438d3 5739 * A Linear Interpolate function calculates an output value(y), for the input(x)
switches 0:5c4d7b2438d3 5740 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
switches 0:5c4d7b2438d3 5741 *
switches 0:5c4d7b2438d3 5742 * \par Algorithm:
switches 0:5c4d7b2438d3 5743 * <pre>
switches 0:5c4d7b2438d3 5744 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
switches 0:5c4d7b2438d3 5745 * where x0, x1 are nearest values of input x
switches 0:5c4d7b2438d3 5746 * y0, y1 are nearest values to output y
switches 0:5c4d7b2438d3 5747 * </pre>
switches 0:5c4d7b2438d3 5748 *
switches 0:5c4d7b2438d3 5749 * \par
switches 0:5c4d7b2438d3 5750 * This set of functions implements Linear interpolation process
switches 0:5c4d7b2438d3 5751 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
switches 0:5c4d7b2438d3 5752 * sample of data and each call to the function returns a single processed value.
switches 0:5c4d7b2438d3 5753 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
switches 0:5c4d7b2438d3 5754 * <code>x</code> is the input sample value. The functions returns the output value.
switches 0:5c4d7b2438d3 5755 *
switches 0:5c4d7b2438d3 5756 * \par
switches 0:5c4d7b2438d3 5757 * if x is outside of the table boundary, Linear interpolation returns first value of the table
switches 0:5c4d7b2438d3 5758 * if x is below input range and returns last value of table if x is above range.
switches 0:5c4d7b2438d3 5759 */
switches 0:5c4d7b2438d3 5760
switches 0:5c4d7b2438d3 5761 /**
switches 0:5c4d7b2438d3 5762 * @addtogroup LinearInterpolate
switches 0:5c4d7b2438d3 5763 * @{
switches 0:5c4d7b2438d3 5764 */
switches 0:5c4d7b2438d3 5765
switches 0:5c4d7b2438d3 5766 /**
switches 0:5c4d7b2438d3 5767 * @brief Process function for the floating-point Linear Interpolation Function.
switches 0:5c4d7b2438d3 5768 * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure
switches 0:5c4d7b2438d3 5769 * @param[in] x input sample to process
switches 0:5c4d7b2438d3 5770 * @return y processed output sample.
switches 0:5c4d7b2438d3 5771 *
switches 0:5c4d7b2438d3 5772 */
switches 0:5c4d7b2438d3 5773
switches 0:5c4d7b2438d3 5774 static __INLINE float32_t arm_linear_interp_f32(
switches 0:5c4d7b2438d3 5775 arm_linear_interp_instance_f32 * S,
switches 0:5c4d7b2438d3 5776 float32_t x)
switches 0:5c4d7b2438d3 5777 {
switches 0:5c4d7b2438d3 5778
switches 0:5c4d7b2438d3 5779 float32_t y;
switches 0:5c4d7b2438d3 5780 float32_t x0, x1; /* Nearest input values */
switches 0:5c4d7b2438d3 5781 float32_t y0, y1; /* Nearest output values */
switches 0:5c4d7b2438d3 5782 float32_t xSpacing = S->xSpacing; /* spacing between input values */
switches 0:5c4d7b2438d3 5783 int32_t i; /* Index variable */
switches 0:5c4d7b2438d3 5784 float32_t *pYData = S->pYData; /* pointer to output table */
switches 0:5c4d7b2438d3 5785
switches 0:5c4d7b2438d3 5786 /* Calculation of index */
switches 0:5c4d7b2438d3 5787 i = (int32_t) ((x - S->x1) / xSpacing);
switches 0:5c4d7b2438d3 5788
switches 0:5c4d7b2438d3 5789 if(i < 0)
switches 0:5c4d7b2438d3 5790 {
switches 0:5c4d7b2438d3 5791 /* Iniatilize output for below specified range as least output value of table */
switches 0:5c4d7b2438d3 5792 y = pYData[0];
switches 0:5c4d7b2438d3 5793 }
switches 0:5c4d7b2438d3 5794 else if((uint32_t)i >= S->nValues)
switches 0:5c4d7b2438d3 5795 {
switches 0:5c4d7b2438d3 5796 /* Iniatilize output for above specified range as last output value of table */
switches 0:5c4d7b2438d3 5797 y = pYData[S->nValues - 1];
switches 0:5c4d7b2438d3 5798 }
switches 0:5c4d7b2438d3 5799 else
switches 0:5c4d7b2438d3 5800 {
switches 0:5c4d7b2438d3 5801 /* Calculation of nearest input values */
switches 0:5c4d7b2438d3 5802 x0 = S->x1 + i * xSpacing;
switches 0:5c4d7b2438d3 5803 x1 = S->x1 + (i + 1) * xSpacing;
switches 0:5c4d7b2438d3 5804
switches 0:5c4d7b2438d3 5805 /* Read of nearest output values */
switches 0:5c4d7b2438d3 5806 y0 = pYData[i];
switches 0:5c4d7b2438d3 5807 y1 = pYData[i + 1];
switches 0:5c4d7b2438d3 5808
switches 0:5c4d7b2438d3 5809 /* Calculation of output */
switches 0:5c4d7b2438d3 5810 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
switches 0:5c4d7b2438d3 5811
switches 0:5c4d7b2438d3 5812 }
switches 0:5c4d7b2438d3 5813
switches 0:5c4d7b2438d3 5814 /* returns output value */
switches 0:5c4d7b2438d3 5815 return (y);
switches 0:5c4d7b2438d3 5816 }
switches 0:5c4d7b2438d3 5817
switches 0:5c4d7b2438d3 5818 /**
switches 0:5c4d7b2438d3 5819 *
switches 0:5c4d7b2438d3 5820 * @brief Process function for the Q31 Linear Interpolation Function.
switches 0:5c4d7b2438d3 5821 * @param[in] *pYData pointer to Q31 Linear Interpolation table
switches 0:5c4d7b2438d3 5822 * @param[in] x input sample to process
switches 0:5c4d7b2438d3 5823 * @param[in] nValues number of table values
switches 0:5c4d7b2438d3 5824 * @return y processed output sample.
switches 0:5c4d7b2438d3 5825 *
switches 0:5c4d7b2438d3 5826 * \par
switches 0:5c4d7b2438d3 5827 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
switches 0:5c4d7b2438d3 5828 * This function can support maximum of table size 2^12.
switches 0:5c4d7b2438d3 5829 *
switches 0:5c4d7b2438d3 5830 */
switches 0:5c4d7b2438d3 5831
switches 0:5c4d7b2438d3 5832
switches 0:5c4d7b2438d3 5833 static __INLINE q31_t arm_linear_interp_q31(
switches 0:5c4d7b2438d3 5834 q31_t * pYData,
switches 0:5c4d7b2438d3 5835 q31_t x,
switches 0:5c4d7b2438d3 5836 uint32_t nValues)
switches 0:5c4d7b2438d3 5837 {
switches 0:5c4d7b2438d3 5838 q31_t y; /* output */
switches 0:5c4d7b2438d3 5839 q31_t y0, y1; /* Nearest output values */
switches 0:5c4d7b2438d3 5840 q31_t fract; /* fractional part */
switches 0:5c4d7b2438d3 5841 int32_t index; /* Index to read nearest output values */
switches 0:5c4d7b2438d3 5842
switches 0:5c4d7b2438d3 5843 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 5844 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 5845 /* Index value calculation */
switches 0:5c4d7b2438d3 5846 index = ((x & 0xFFF00000) >> 20);
switches 0:5c4d7b2438d3 5847
switches 0:5c4d7b2438d3 5848 if(index >= (int32_t)(nValues - 1))
switches 0:5c4d7b2438d3 5849 {
switches 0:5c4d7b2438d3 5850 return (pYData[nValues - 1]);
switches 0:5c4d7b2438d3 5851 }
switches 0:5c4d7b2438d3 5852 else if(index < 0)
switches 0:5c4d7b2438d3 5853 {
switches 0:5c4d7b2438d3 5854 return (pYData[0]);
switches 0:5c4d7b2438d3 5855 }
switches 0:5c4d7b2438d3 5856 else
switches 0:5c4d7b2438d3 5857 {
switches 0:5c4d7b2438d3 5858
switches 0:5c4d7b2438d3 5859 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 5860 /* shift left by 11 to keep fract in 1.31 format */
switches 0:5c4d7b2438d3 5861 fract = (x & 0x000FFFFF) << 11;
switches 0:5c4d7b2438d3 5862
switches 0:5c4d7b2438d3 5863 /* Read two nearest output values from the index in 1.31(q31) format */
switches 0:5c4d7b2438d3 5864 y0 = pYData[index];
switches 0:5c4d7b2438d3 5865 y1 = pYData[index + 1u];
switches 0:5c4d7b2438d3 5866
switches 0:5c4d7b2438d3 5867 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
switches 0:5c4d7b2438d3 5868 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
switches 0:5c4d7b2438d3 5869
switches 0:5c4d7b2438d3 5870 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
switches 0:5c4d7b2438d3 5871 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
switches 0:5c4d7b2438d3 5872
switches 0:5c4d7b2438d3 5873 /* Convert y to 1.31 format */
switches 0:5c4d7b2438d3 5874 return (y << 1u);
switches 0:5c4d7b2438d3 5875
switches 0:5c4d7b2438d3 5876 }
switches 0:5c4d7b2438d3 5877
switches 0:5c4d7b2438d3 5878 }
switches 0:5c4d7b2438d3 5879
switches 0:5c4d7b2438d3 5880 /**
switches 0:5c4d7b2438d3 5881 *
switches 0:5c4d7b2438d3 5882 * @brief Process function for the Q15 Linear Interpolation Function.
switches 0:5c4d7b2438d3 5883 * @param[in] *pYData pointer to Q15 Linear Interpolation table
switches 0:5c4d7b2438d3 5884 * @param[in] x input sample to process
switches 0:5c4d7b2438d3 5885 * @param[in] nValues number of table values
switches 0:5c4d7b2438d3 5886 * @return y processed output sample.
switches 0:5c4d7b2438d3 5887 *
switches 0:5c4d7b2438d3 5888 * \par
switches 0:5c4d7b2438d3 5889 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
switches 0:5c4d7b2438d3 5890 * This function can support maximum of table size 2^12.
switches 0:5c4d7b2438d3 5891 *
switches 0:5c4d7b2438d3 5892 */
switches 0:5c4d7b2438d3 5893
switches 0:5c4d7b2438d3 5894
switches 0:5c4d7b2438d3 5895 static __INLINE q15_t arm_linear_interp_q15(
switches 0:5c4d7b2438d3 5896 q15_t * pYData,
switches 0:5c4d7b2438d3 5897 q31_t x,
switches 0:5c4d7b2438d3 5898 uint32_t nValues)
switches 0:5c4d7b2438d3 5899 {
switches 0:5c4d7b2438d3 5900 q63_t y; /* output */
switches 0:5c4d7b2438d3 5901 q15_t y0, y1; /* Nearest output values */
switches 0:5c4d7b2438d3 5902 q31_t fract; /* fractional part */
switches 0:5c4d7b2438d3 5903 int32_t index; /* Index to read nearest output values */
switches 0:5c4d7b2438d3 5904
switches 0:5c4d7b2438d3 5905 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 5906 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 5907 /* Index value calculation */
switches 0:5c4d7b2438d3 5908 index = ((x & 0xFFF00000) >> 20u);
switches 0:5c4d7b2438d3 5909
switches 0:5c4d7b2438d3 5910 if(index >= (int32_t)(nValues - 1))
switches 0:5c4d7b2438d3 5911 {
switches 0:5c4d7b2438d3 5912 return (pYData[nValues - 1]);
switches 0:5c4d7b2438d3 5913 }
switches 0:5c4d7b2438d3 5914 else if(index < 0)
switches 0:5c4d7b2438d3 5915 {
switches 0:5c4d7b2438d3 5916 return (pYData[0]);
switches 0:5c4d7b2438d3 5917 }
switches 0:5c4d7b2438d3 5918 else
switches 0:5c4d7b2438d3 5919 {
switches 0:5c4d7b2438d3 5920 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 5921 /* fract is in 12.20 format */
switches 0:5c4d7b2438d3 5922 fract = (x & 0x000FFFFF);
switches 0:5c4d7b2438d3 5923
switches 0:5c4d7b2438d3 5924 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 5925 y0 = pYData[index];
switches 0:5c4d7b2438d3 5926 y1 = pYData[index + 1u];
switches 0:5c4d7b2438d3 5927
switches 0:5c4d7b2438d3 5928 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
switches 0:5c4d7b2438d3 5929 y = ((q63_t) y0 * (0xFFFFF - fract));
switches 0:5c4d7b2438d3 5930
switches 0:5c4d7b2438d3 5931 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
switches 0:5c4d7b2438d3 5932 y += ((q63_t) y1 * (fract));
switches 0:5c4d7b2438d3 5933
switches 0:5c4d7b2438d3 5934 /* convert y to 1.15 format */
switches 0:5c4d7b2438d3 5935 return (y >> 20);
switches 0:5c4d7b2438d3 5936 }
switches 0:5c4d7b2438d3 5937
switches 0:5c4d7b2438d3 5938
switches 0:5c4d7b2438d3 5939 }
switches 0:5c4d7b2438d3 5940
switches 0:5c4d7b2438d3 5941 /**
switches 0:5c4d7b2438d3 5942 *
switches 0:5c4d7b2438d3 5943 * @brief Process function for the Q7 Linear Interpolation Function.
switches 0:5c4d7b2438d3 5944 * @param[in] *pYData pointer to Q7 Linear Interpolation table
switches 0:5c4d7b2438d3 5945 * @param[in] x input sample to process
switches 0:5c4d7b2438d3 5946 * @param[in] nValues number of table values
switches 0:5c4d7b2438d3 5947 * @return y processed output sample.
switches 0:5c4d7b2438d3 5948 *
switches 0:5c4d7b2438d3 5949 * \par
switches 0:5c4d7b2438d3 5950 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
switches 0:5c4d7b2438d3 5951 * This function can support maximum of table size 2^12.
switches 0:5c4d7b2438d3 5952 */
switches 0:5c4d7b2438d3 5953
switches 0:5c4d7b2438d3 5954
switches 0:5c4d7b2438d3 5955 static __INLINE q7_t arm_linear_interp_q7(
switches 0:5c4d7b2438d3 5956 q7_t * pYData,
switches 0:5c4d7b2438d3 5957 q31_t x,
switches 0:5c4d7b2438d3 5958 uint32_t nValues)
switches 0:5c4d7b2438d3 5959 {
switches 0:5c4d7b2438d3 5960 q31_t y; /* output */
switches 0:5c4d7b2438d3 5961 q7_t y0, y1; /* Nearest output values */
switches 0:5c4d7b2438d3 5962 q31_t fract; /* fractional part */
switches 0:5c4d7b2438d3 5963 uint32_t index; /* Index to read nearest output values */
switches 0:5c4d7b2438d3 5964
switches 0:5c4d7b2438d3 5965 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 5966 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 5967 /* Index value calculation */
switches 0:5c4d7b2438d3 5968 if (x < 0)
switches 0:5c4d7b2438d3 5969 {
switches 0:5c4d7b2438d3 5970 return (pYData[0]);
switches 0:5c4d7b2438d3 5971 }
switches 0:5c4d7b2438d3 5972 index = (x >> 20) & 0xfff;
switches 0:5c4d7b2438d3 5973
switches 0:5c4d7b2438d3 5974
switches 0:5c4d7b2438d3 5975 if(index >= (nValues - 1))
switches 0:5c4d7b2438d3 5976 {
switches 0:5c4d7b2438d3 5977 return (pYData[nValues - 1]);
switches 0:5c4d7b2438d3 5978 }
switches 0:5c4d7b2438d3 5979 else
switches 0:5c4d7b2438d3 5980 {
switches 0:5c4d7b2438d3 5981
switches 0:5c4d7b2438d3 5982 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 5983 /* fract is in 12.20 format */
switches 0:5c4d7b2438d3 5984 fract = (x & 0x000FFFFF);
switches 0:5c4d7b2438d3 5985
switches 0:5c4d7b2438d3 5986 /* Read two nearest output values from the index and are in 1.7(q7) format */
switches 0:5c4d7b2438d3 5987 y0 = pYData[index];
switches 0:5c4d7b2438d3 5988 y1 = pYData[index + 1u];
switches 0:5c4d7b2438d3 5989
switches 0:5c4d7b2438d3 5990 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
switches 0:5c4d7b2438d3 5991 y = ((y0 * (0xFFFFF - fract)));
switches 0:5c4d7b2438d3 5992
switches 0:5c4d7b2438d3 5993 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
switches 0:5c4d7b2438d3 5994 y += (y1 * fract);
switches 0:5c4d7b2438d3 5995
switches 0:5c4d7b2438d3 5996 /* convert y to 1.7(q7) format */
switches 0:5c4d7b2438d3 5997 return (y >> 20u);
switches 0:5c4d7b2438d3 5998
switches 0:5c4d7b2438d3 5999 }
switches 0:5c4d7b2438d3 6000
switches 0:5c4d7b2438d3 6001 }
switches 0:5c4d7b2438d3 6002 /**
switches 0:5c4d7b2438d3 6003 * @} end of LinearInterpolate group
switches 0:5c4d7b2438d3 6004 */
switches 0:5c4d7b2438d3 6005
switches 0:5c4d7b2438d3 6006 /**
switches 0:5c4d7b2438d3 6007 * @brief Fast approximation to the trigonometric sine function for floating-point data.
switches 0:5c4d7b2438d3 6008 * @param[in] x input value in radians.
switches 0:5c4d7b2438d3 6009 * @return sin(x).
switches 0:5c4d7b2438d3 6010 */
switches 0:5c4d7b2438d3 6011
switches 0:5c4d7b2438d3 6012 float32_t arm_sin_f32(
switches 0:5c4d7b2438d3 6013 float32_t x);
switches 0:5c4d7b2438d3 6014
switches 0:5c4d7b2438d3 6015 /**
switches 0:5c4d7b2438d3 6016 * @brief Fast approximation to the trigonometric sine function for Q31 data.
switches 0:5c4d7b2438d3 6017 * @param[in] x Scaled input value in radians.
switches 0:5c4d7b2438d3 6018 * @return sin(x).
switches 0:5c4d7b2438d3 6019 */
switches 0:5c4d7b2438d3 6020
switches 0:5c4d7b2438d3 6021 q31_t arm_sin_q31(
switches 0:5c4d7b2438d3 6022 q31_t x);
switches 0:5c4d7b2438d3 6023
switches 0:5c4d7b2438d3 6024 /**
switches 0:5c4d7b2438d3 6025 * @brief Fast approximation to the trigonometric sine function for Q15 data.
switches 0:5c4d7b2438d3 6026 * @param[in] x Scaled input value in radians.
switches 0:5c4d7b2438d3 6027 * @return sin(x).
switches 0:5c4d7b2438d3 6028 */
switches 0:5c4d7b2438d3 6029
switches 0:5c4d7b2438d3 6030 q15_t arm_sin_q15(
switches 0:5c4d7b2438d3 6031 q15_t x);
switches 0:5c4d7b2438d3 6032
switches 0:5c4d7b2438d3 6033 /**
switches 0:5c4d7b2438d3 6034 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
switches 0:5c4d7b2438d3 6035 * @param[in] x input value in radians.
switches 0:5c4d7b2438d3 6036 * @return cos(x).
switches 0:5c4d7b2438d3 6037 */
switches 0:5c4d7b2438d3 6038
switches 0:5c4d7b2438d3 6039 float32_t arm_cos_f32(
switches 0:5c4d7b2438d3 6040 float32_t x);
switches 0:5c4d7b2438d3 6041
switches 0:5c4d7b2438d3 6042 /**
switches 0:5c4d7b2438d3 6043 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
switches 0:5c4d7b2438d3 6044 * @param[in] x Scaled input value in radians.
switches 0:5c4d7b2438d3 6045 * @return cos(x).
switches 0:5c4d7b2438d3 6046 */
switches 0:5c4d7b2438d3 6047
switches 0:5c4d7b2438d3 6048 q31_t arm_cos_q31(
switches 0:5c4d7b2438d3 6049 q31_t x);
switches 0:5c4d7b2438d3 6050
switches 0:5c4d7b2438d3 6051 /**
switches 0:5c4d7b2438d3 6052 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
switches 0:5c4d7b2438d3 6053 * @param[in] x Scaled input value in radians.
switches 0:5c4d7b2438d3 6054 * @return cos(x).
switches 0:5c4d7b2438d3 6055 */
switches 0:5c4d7b2438d3 6056
switches 0:5c4d7b2438d3 6057 q15_t arm_cos_q15(
switches 0:5c4d7b2438d3 6058 q15_t x);
switches 0:5c4d7b2438d3 6059
switches 0:5c4d7b2438d3 6060
switches 0:5c4d7b2438d3 6061 /**
switches 0:5c4d7b2438d3 6062 * @ingroup groupFastMath
switches 0:5c4d7b2438d3 6063 */
switches 0:5c4d7b2438d3 6064
switches 0:5c4d7b2438d3 6065
switches 0:5c4d7b2438d3 6066 /**
switches 0:5c4d7b2438d3 6067 * @defgroup SQRT Square Root
switches 0:5c4d7b2438d3 6068 *
switches 0:5c4d7b2438d3 6069 * Computes the square root of a number.
switches 0:5c4d7b2438d3 6070 * There are separate functions for Q15, Q31, and floating-point data types.
switches 0:5c4d7b2438d3 6071 * The square root function is computed using the Newton-Raphson algorithm.
switches 0:5c4d7b2438d3 6072 * This is an iterative algorithm of the form:
switches 0:5c4d7b2438d3 6073 * <pre>
switches 0:5c4d7b2438d3 6074 * x1 = x0 - f(x0)/f'(x0)
switches 0:5c4d7b2438d3 6075 * </pre>
switches 0:5c4d7b2438d3 6076 * where <code>x1</code> is the current estimate,
switches 0:5c4d7b2438d3 6077 * <code>x0</code> is the previous estimate, and
switches 0:5c4d7b2438d3 6078 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
switches 0:5c4d7b2438d3 6079 * For the square root function, the algorithm reduces to:
switches 0:5c4d7b2438d3 6080 * <pre>
switches 0:5c4d7b2438d3 6081 * x0 = in/2 [initial guess]
switches 0:5c4d7b2438d3 6082 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
switches 0:5c4d7b2438d3 6083 * </pre>
switches 0:5c4d7b2438d3 6084 */
switches 0:5c4d7b2438d3 6085
switches 0:5c4d7b2438d3 6086
switches 0:5c4d7b2438d3 6087 /**
switches 0:5c4d7b2438d3 6088 * @addtogroup SQRT
switches 0:5c4d7b2438d3 6089 * @{
switches 0:5c4d7b2438d3 6090 */
switches 0:5c4d7b2438d3 6091
switches 0:5c4d7b2438d3 6092 /**
switches 0:5c4d7b2438d3 6093 * @brief Floating-point square root function.
switches 0:5c4d7b2438d3 6094 * @param[in] in input value.
switches 0:5c4d7b2438d3 6095 * @param[out] *pOut square root of input value.
switches 0:5c4d7b2438d3 6096 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
switches 0:5c4d7b2438d3 6097 * <code>in</code> is negative value and returns zero output for negative values.
switches 0:5c4d7b2438d3 6098 */
switches 0:5c4d7b2438d3 6099
switches 0:5c4d7b2438d3 6100 static __INLINE arm_status arm_sqrt_f32(
switches 0:5c4d7b2438d3 6101 float32_t in,
switches 0:5c4d7b2438d3 6102 float32_t * pOut)
switches 0:5c4d7b2438d3 6103 {
switches 0:5c4d7b2438d3 6104 if(in >= 0.0f)
switches 0:5c4d7b2438d3 6105 {
switches 0:5c4d7b2438d3 6106
switches 0:5c4d7b2438d3 6107 // #if __FPU_USED
switches 0:5c4d7b2438d3 6108 #if (__FPU_USED == 1) && defined ( __CC_ARM )
switches 0:5c4d7b2438d3 6109 *pOut = __sqrtf(in);
switches 0:5c4d7b2438d3 6110 #else
switches 0:5c4d7b2438d3 6111 *pOut = sqrtf(in);
switches 0:5c4d7b2438d3 6112 #endif
switches 0:5c4d7b2438d3 6113
switches 0:5c4d7b2438d3 6114 return (ARM_MATH_SUCCESS);
switches 0:5c4d7b2438d3 6115 }
switches 0:5c4d7b2438d3 6116 else
switches 0:5c4d7b2438d3 6117 {
switches 0:5c4d7b2438d3 6118 *pOut = 0.0f;
switches 0:5c4d7b2438d3 6119 return (ARM_MATH_ARGUMENT_ERROR);
switches 0:5c4d7b2438d3 6120 }
switches 0:5c4d7b2438d3 6121
switches 0:5c4d7b2438d3 6122 }
switches 0:5c4d7b2438d3 6123
switches 0:5c4d7b2438d3 6124
switches 0:5c4d7b2438d3 6125 /**
switches 0:5c4d7b2438d3 6126 * @brief Q31 square root function.
switches 0:5c4d7b2438d3 6127 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
switches 0:5c4d7b2438d3 6128 * @param[out] *pOut square root of input value.
switches 0:5c4d7b2438d3 6129 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
switches 0:5c4d7b2438d3 6130 * <code>in</code> is negative value and returns zero output for negative values.
switches 0:5c4d7b2438d3 6131 */
switches 0:5c4d7b2438d3 6132 arm_status arm_sqrt_q31(
switches 0:5c4d7b2438d3 6133 q31_t in,
switches 0:5c4d7b2438d3 6134 q31_t * pOut);
switches 0:5c4d7b2438d3 6135
switches 0:5c4d7b2438d3 6136 /**
switches 0:5c4d7b2438d3 6137 * @brief Q15 square root function.
switches 0:5c4d7b2438d3 6138 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
switches 0:5c4d7b2438d3 6139 * @param[out] *pOut square root of input value.
switches 0:5c4d7b2438d3 6140 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
switches 0:5c4d7b2438d3 6141 * <code>in</code> is negative value and returns zero output for negative values.
switches 0:5c4d7b2438d3 6142 */
switches 0:5c4d7b2438d3 6143 arm_status arm_sqrt_q15(
switches 0:5c4d7b2438d3 6144 q15_t in,
switches 0:5c4d7b2438d3 6145 q15_t * pOut);
switches 0:5c4d7b2438d3 6146
switches 0:5c4d7b2438d3 6147 /**
switches 0:5c4d7b2438d3 6148 * @} end of SQRT group
switches 0:5c4d7b2438d3 6149 */
switches 0:5c4d7b2438d3 6150
switches 0:5c4d7b2438d3 6151
switches 0:5c4d7b2438d3 6152
switches 0:5c4d7b2438d3 6153
switches 0:5c4d7b2438d3 6154
switches 0:5c4d7b2438d3 6155
switches 0:5c4d7b2438d3 6156 /**
switches 0:5c4d7b2438d3 6157 * @brief floating-point Circular write function.
switches 0:5c4d7b2438d3 6158 */
switches 0:5c4d7b2438d3 6159
switches 0:5c4d7b2438d3 6160 static __INLINE void arm_circularWrite_f32(
switches 0:5c4d7b2438d3 6161 int32_t * circBuffer,
switches 0:5c4d7b2438d3 6162 int32_t L,
switches 0:5c4d7b2438d3 6163 uint16_t * writeOffset,
switches 0:5c4d7b2438d3 6164 int32_t bufferInc,
switches 0:5c4d7b2438d3 6165 const int32_t * src,
switches 0:5c4d7b2438d3 6166 int32_t srcInc,
switches 0:5c4d7b2438d3 6167 uint32_t blockSize)
switches 0:5c4d7b2438d3 6168 {
switches 0:5c4d7b2438d3 6169 uint32_t i = 0u;
switches 0:5c4d7b2438d3 6170 int32_t wOffset;
switches 0:5c4d7b2438d3 6171
switches 0:5c4d7b2438d3 6172 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6173 * to the current location where the input samples to be copied */
switches 0:5c4d7b2438d3 6174 wOffset = *writeOffset;
switches 0:5c4d7b2438d3 6175
switches 0:5c4d7b2438d3 6176 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6177 i = blockSize;
switches 0:5c4d7b2438d3 6178
switches 0:5c4d7b2438d3 6179 while(i > 0u)
switches 0:5c4d7b2438d3 6180 {
switches 0:5c4d7b2438d3 6181 /* copy the input sample to the circular buffer */
switches 0:5c4d7b2438d3 6182 circBuffer[wOffset] = *src;
switches 0:5c4d7b2438d3 6183
switches 0:5c4d7b2438d3 6184 /* Update the input pointer */
switches 0:5c4d7b2438d3 6185 src += srcInc;
switches 0:5c4d7b2438d3 6186
switches 0:5c4d7b2438d3 6187 /* Circularly update wOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6188 wOffset += bufferInc;
switches 0:5c4d7b2438d3 6189 if(wOffset >= L)
switches 0:5c4d7b2438d3 6190 wOffset -= L;
switches 0:5c4d7b2438d3 6191
switches 0:5c4d7b2438d3 6192 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6193 i--;
switches 0:5c4d7b2438d3 6194 }
switches 0:5c4d7b2438d3 6195
switches 0:5c4d7b2438d3 6196 /* Update the index pointer */
switches 0:5c4d7b2438d3 6197 *writeOffset = wOffset;
switches 0:5c4d7b2438d3 6198 }
switches 0:5c4d7b2438d3 6199
switches 0:5c4d7b2438d3 6200
switches 0:5c4d7b2438d3 6201
switches 0:5c4d7b2438d3 6202 /**
switches 0:5c4d7b2438d3 6203 * @brief floating-point Circular Read function.
switches 0:5c4d7b2438d3 6204 */
switches 0:5c4d7b2438d3 6205 static __INLINE void arm_circularRead_f32(
switches 0:5c4d7b2438d3 6206 int32_t * circBuffer,
switches 0:5c4d7b2438d3 6207 int32_t L,
switches 0:5c4d7b2438d3 6208 int32_t * readOffset,
switches 0:5c4d7b2438d3 6209 int32_t bufferInc,
switches 0:5c4d7b2438d3 6210 int32_t * dst,
switches 0:5c4d7b2438d3 6211 int32_t * dst_base,
switches 0:5c4d7b2438d3 6212 int32_t dst_length,
switches 0:5c4d7b2438d3 6213 int32_t dstInc,
switches 0:5c4d7b2438d3 6214 uint32_t blockSize)
switches 0:5c4d7b2438d3 6215 {
switches 0:5c4d7b2438d3 6216 uint32_t i = 0u;
switches 0:5c4d7b2438d3 6217 int32_t rOffset, dst_end;
switches 0:5c4d7b2438d3 6218
switches 0:5c4d7b2438d3 6219 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6220 * to the current location from where the input samples to be read */
switches 0:5c4d7b2438d3 6221 rOffset = *readOffset;
switches 0:5c4d7b2438d3 6222 dst_end = (int32_t) (dst_base + dst_length);
switches 0:5c4d7b2438d3 6223
switches 0:5c4d7b2438d3 6224 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6225 i = blockSize;
switches 0:5c4d7b2438d3 6226
switches 0:5c4d7b2438d3 6227 while(i > 0u)
switches 0:5c4d7b2438d3 6228 {
switches 0:5c4d7b2438d3 6229 /* copy the sample from the circular buffer to the destination buffer */
switches 0:5c4d7b2438d3 6230 *dst = circBuffer[rOffset];
switches 0:5c4d7b2438d3 6231
switches 0:5c4d7b2438d3 6232 /* Update the input pointer */
switches 0:5c4d7b2438d3 6233 dst += dstInc;
switches 0:5c4d7b2438d3 6234
switches 0:5c4d7b2438d3 6235 if(dst == (int32_t *) dst_end)
switches 0:5c4d7b2438d3 6236 {
switches 0:5c4d7b2438d3 6237 dst = dst_base;
switches 0:5c4d7b2438d3 6238 }
switches 0:5c4d7b2438d3 6239
switches 0:5c4d7b2438d3 6240 /* Circularly update rOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6241 rOffset += bufferInc;
switches 0:5c4d7b2438d3 6242
switches 0:5c4d7b2438d3 6243 if(rOffset >= L)
switches 0:5c4d7b2438d3 6244 {
switches 0:5c4d7b2438d3 6245 rOffset -= L;
switches 0:5c4d7b2438d3 6246 }
switches 0:5c4d7b2438d3 6247
switches 0:5c4d7b2438d3 6248 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6249 i--;
switches 0:5c4d7b2438d3 6250 }
switches 0:5c4d7b2438d3 6251
switches 0:5c4d7b2438d3 6252 /* Update the index pointer */
switches 0:5c4d7b2438d3 6253 *readOffset = rOffset;
switches 0:5c4d7b2438d3 6254 }
switches 0:5c4d7b2438d3 6255
switches 0:5c4d7b2438d3 6256 /**
switches 0:5c4d7b2438d3 6257 * @brief Q15 Circular write function.
switches 0:5c4d7b2438d3 6258 */
switches 0:5c4d7b2438d3 6259
switches 0:5c4d7b2438d3 6260 static __INLINE void arm_circularWrite_q15(
switches 0:5c4d7b2438d3 6261 q15_t * circBuffer,
switches 0:5c4d7b2438d3 6262 int32_t L,
switches 0:5c4d7b2438d3 6263 uint16_t * writeOffset,
switches 0:5c4d7b2438d3 6264 int32_t bufferInc,
switches 0:5c4d7b2438d3 6265 const q15_t * src,
switches 0:5c4d7b2438d3 6266 int32_t srcInc,
switches 0:5c4d7b2438d3 6267 uint32_t blockSize)
switches 0:5c4d7b2438d3 6268 {
switches 0:5c4d7b2438d3 6269 uint32_t i = 0u;
switches 0:5c4d7b2438d3 6270 int32_t wOffset;
switches 0:5c4d7b2438d3 6271
switches 0:5c4d7b2438d3 6272 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6273 * to the current location where the input samples to be copied */
switches 0:5c4d7b2438d3 6274 wOffset = *writeOffset;
switches 0:5c4d7b2438d3 6275
switches 0:5c4d7b2438d3 6276 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6277 i = blockSize;
switches 0:5c4d7b2438d3 6278
switches 0:5c4d7b2438d3 6279 while(i > 0u)
switches 0:5c4d7b2438d3 6280 {
switches 0:5c4d7b2438d3 6281 /* copy the input sample to the circular buffer */
switches 0:5c4d7b2438d3 6282 circBuffer[wOffset] = *src;
switches 0:5c4d7b2438d3 6283
switches 0:5c4d7b2438d3 6284 /* Update the input pointer */
switches 0:5c4d7b2438d3 6285 src += srcInc;
switches 0:5c4d7b2438d3 6286
switches 0:5c4d7b2438d3 6287 /* Circularly update wOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6288 wOffset += bufferInc;
switches 0:5c4d7b2438d3 6289 if(wOffset >= L)
switches 0:5c4d7b2438d3 6290 wOffset -= L;
switches 0:5c4d7b2438d3 6291
switches 0:5c4d7b2438d3 6292 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6293 i--;
switches 0:5c4d7b2438d3 6294 }
switches 0:5c4d7b2438d3 6295
switches 0:5c4d7b2438d3 6296 /* Update the index pointer */
switches 0:5c4d7b2438d3 6297 *writeOffset = wOffset;
switches 0:5c4d7b2438d3 6298 }
switches 0:5c4d7b2438d3 6299
switches 0:5c4d7b2438d3 6300
switches 0:5c4d7b2438d3 6301
switches 0:5c4d7b2438d3 6302 /**
switches 0:5c4d7b2438d3 6303 * @brief Q15 Circular Read function.
switches 0:5c4d7b2438d3 6304 */
switches 0:5c4d7b2438d3 6305 static __INLINE void arm_circularRead_q15(
switches 0:5c4d7b2438d3 6306 q15_t * circBuffer,
switches 0:5c4d7b2438d3 6307 int32_t L,
switches 0:5c4d7b2438d3 6308 int32_t * readOffset,
switches 0:5c4d7b2438d3 6309 int32_t bufferInc,
switches 0:5c4d7b2438d3 6310 q15_t * dst,
switches 0:5c4d7b2438d3 6311 q15_t * dst_base,
switches 0:5c4d7b2438d3 6312 int32_t dst_length,
switches 0:5c4d7b2438d3 6313 int32_t dstInc,
switches 0:5c4d7b2438d3 6314 uint32_t blockSize)
switches 0:5c4d7b2438d3 6315 {
switches 0:5c4d7b2438d3 6316 uint32_t i = 0;
switches 0:5c4d7b2438d3 6317 int32_t rOffset, dst_end;
switches 0:5c4d7b2438d3 6318
switches 0:5c4d7b2438d3 6319 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6320 * to the current location from where the input samples to be read */
switches 0:5c4d7b2438d3 6321 rOffset = *readOffset;
switches 0:5c4d7b2438d3 6322
switches 0:5c4d7b2438d3 6323 dst_end = (int32_t) (dst_base + dst_length);
switches 0:5c4d7b2438d3 6324
switches 0:5c4d7b2438d3 6325 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6326 i = blockSize;
switches 0:5c4d7b2438d3 6327
switches 0:5c4d7b2438d3 6328 while(i > 0u)
switches 0:5c4d7b2438d3 6329 {
switches 0:5c4d7b2438d3 6330 /* copy the sample from the circular buffer to the destination buffer */
switches 0:5c4d7b2438d3 6331 *dst = circBuffer[rOffset];
switches 0:5c4d7b2438d3 6332
switches 0:5c4d7b2438d3 6333 /* Update the input pointer */
switches 0:5c4d7b2438d3 6334 dst += dstInc;
switches 0:5c4d7b2438d3 6335
switches 0:5c4d7b2438d3 6336 if(dst == (q15_t *) dst_end)
switches 0:5c4d7b2438d3 6337 {
switches 0:5c4d7b2438d3 6338 dst = dst_base;
switches 0:5c4d7b2438d3 6339 }
switches 0:5c4d7b2438d3 6340
switches 0:5c4d7b2438d3 6341 /* Circularly update wOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6342 rOffset += bufferInc;
switches 0:5c4d7b2438d3 6343
switches 0:5c4d7b2438d3 6344 if(rOffset >= L)
switches 0:5c4d7b2438d3 6345 {
switches 0:5c4d7b2438d3 6346 rOffset -= L;
switches 0:5c4d7b2438d3 6347 }
switches 0:5c4d7b2438d3 6348
switches 0:5c4d7b2438d3 6349 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6350 i--;
switches 0:5c4d7b2438d3 6351 }
switches 0:5c4d7b2438d3 6352
switches 0:5c4d7b2438d3 6353 /* Update the index pointer */
switches 0:5c4d7b2438d3 6354 *readOffset = rOffset;
switches 0:5c4d7b2438d3 6355 }
switches 0:5c4d7b2438d3 6356
switches 0:5c4d7b2438d3 6357
switches 0:5c4d7b2438d3 6358 /**
switches 0:5c4d7b2438d3 6359 * @brief Q7 Circular write function.
switches 0:5c4d7b2438d3 6360 */
switches 0:5c4d7b2438d3 6361
switches 0:5c4d7b2438d3 6362 static __INLINE void arm_circularWrite_q7(
switches 0:5c4d7b2438d3 6363 q7_t * circBuffer,
switches 0:5c4d7b2438d3 6364 int32_t L,
switches 0:5c4d7b2438d3 6365 uint16_t * writeOffset,
switches 0:5c4d7b2438d3 6366 int32_t bufferInc,
switches 0:5c4d7b2438d3 6367 const q7_t * src,
switches 0:5c4d7b2438d3 6368 int32_t srcInc,
switches 0:5c4d7b2438d3 6369 uint32_t blockSize)
switches 0:5c4d7b2438d3 6370 {
switches 0:5c4d7b2438d3 6371 uint32_t i = 0u;
switches 0:5c4d7b2438d3 6372 int32_t wOffset;
switches 0:5c4d7b2438d3 6373
switches 0:5c4d7b2438d3 6374 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6375 * to the current location where the input samples to be copied */
switches 0:5c4d7b2438d3 6376 wOffset = *writeOffset;
switches 0:5c4d7b2438d3 6377
switches 0:5c4d7b2438d3 6378 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6379 i = blockSize;
switches 0:5c4d7b2438d3 6380
switches 0:5c4d7b2438d3 6381 while(i > 0u)
switches 0:5c4d7b2438d3 6382 {
switches 0:5c4d7b2438d3 6383 /* copy the input sample to the circular buffer */
switches 0:5c4d7b2438d3 6384 circBuffer[wOffset] = *src;
switches 0:5c4d7b2438d3 6385
switches 0:5c4d7b2438d3 6386 /* Update the input pointer */
switches 0:5c4d7b2438d3 6387 src += srcInc;
switches 0:5c4d7b2438d3 6388
switches 0:5c4d7b2438d3 6389 /* Circularly update wOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6390 wOffset += bufferInc;
switches 0:5c4d7b2438d3 6391 if(wOffset >= L)
switches 0:5c4d7b2438d3 6392 wOffset -= L;
switches 0:5c4d7b2438d3 6393
switches 0:5c4d7b2438d3 6394 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6395 i--;
switches 0:5c4d7b2438d3 6396 }
switches 0:5c4d7b2438d3 6397
switches 0:5c4d7b2438d3 6398 /* Update the index pointer */
switches 0:5c4d7b2438d3 6399 *writeOffset = wOffset;
switches 0:5c4d7b2438d3 6400 }
switches 0:5c4d7b2438d3 6401
switches 0:5c4d7b2438d3 6402
switches 0:5c4d7b2438d3 6403
switches 0:5c4d7b2438d3 6404 /**
switches 0:5c4d7b2438d3 6405 * @brief Q7 Circular Read function.
switches 0:5c4d7b2438d3 6406 */
switches 0:5c4d7b2438d3 6407 static __INLINE void arm_circularRead_q7(
switches 0:5c4d7b2438d3 6408 q7_t * circBuffer,
switches 0:5c4d7b2438d3 6409 int32_t L,
switches 0:5c4d7b2438d3 6410 int32_t * readOffset,
switches 0:5c4d7b2438d3 6411 int32_t bufferInc,
switches 0:5c4d7b2438d3 6412 q7_t * dst,
switches 0:5c4d7b2438d3 6413 q7_t * dst_base,
switches 0:5c4d7b2438d3 6414 int32_t dst_length,
switches 0:5c4d7b2438d3 6415 int32_t dstInc,
switches 0:5c4d7b2438d3 6416 uint32_t blockSize)
switches 0:5c4d7b2438d3 6417 {
switches 0:5c4d7b2438d3 6418 uint32_t i = 0;
switches 0:5c4d7b2438d3 6419 int32_t rOffset, dst_end;
switches 0:5c4d7b2438d3 6420
switches 0:5c4d7b2438d3 6421 /* Copy the value of Index pointer that points
switches 0:5c4d7b2438d3 6422 * to the current location from where the input samples to be read */
switches 0:5c4d7b2438d3 6423 rOffset = *readOffset;
switches 0:5c4d7b2438d3 6424
switches 0:5c4d7b2438d3 6425 dst_end = (int32_t) (dst_base + dst_length);
switches 0:5c4d7b2438d3 6426
switches 0:5c4d7b2438d3 6427 /* Loop over the blockSize */
switches 0:5c4d7b2438d3 6428 i = blockSize;
switches 0:5c4d7b2438d3 6429
switches 0:5c4d7b2438d3 6430 while(i > 0u)
switches 0:5c4d7b2438d3 6431 {
switches 0:5c4d7b2438d3 6432 /* copy the sample from the circular buffer to the destination buffer */
switches 0:5c4d7b2438d3 6433 *dst = circBuffer[rOffset];
switches 0:5c4d7b2438d3 6434
switches 0:5c4d7b2438d3 6435 /* Update the input pointer */
switches 0:5c4d7b2438d3 6436 dst += dstInc;
switches 0:5c4d7b2438d3 6437
switches 0:5c4d7b2438d3 6438 if(dst == (q7_t *) dst_end)
switches 0:5c4d7b2438d3 6439 {
switches 0:5c4d7b2438d3 6440 dst = dst_base;
switches 0:5c4d7b2438d3 6441 }
switches 0:5c4d7b2438d3 6442
switches 0:5c4d7b2438d3 6443 /* Circularly update rOffset. Watch out for positive and negative value */
switches 0:5c4d7b2438d3 6444 rOffset += bufferInc;
switches 0:5c4d7b2438d3 6445
switches 0:5c4d7b2438d3 6446 if(rOffset >= L)
switches 0:5c4d7b2438d3 6447 {
switches 0:5c4d7b2438d3 6448 rOffset -= L;
switches 0:5c4d7b2438d3 6449 }
switches 0:5c4d7b2438d3 6450
switches 0:5c4d7b2438d3 6451 /* Decrement the loop counter */
switches 0:5c4d7b2438d3 6452 i--;
switches 0:5c4d7b2438d3 6453 }
switches 0:5c4d7b2438d3 6454
switches 0:5c4d7b2438d3 6455 /* Update the index pointer */
switches 0:5c4d7b2438d3 6456 *readOffset = rOffset;
switches 0:5c4d7b2438d3 6457 }
switches 0:5c4d7b2438d3 6458
switches 0:5c4d7b2438d3 6459
switches 0:5c4d7b2438d3 6460 /**
switches 0:5c4d7b2438d3 6461 * @brief Sum of the squares of the elements of a Q31 vector.
switches 0:5c4d7b2438d3 6462 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6463 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6464 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6465 * @return none.
switches 0:5c4d7b2438d3 6466 */
switches 0:5c4d7b2438d3 6467
switches 0:5c4d7b2438d3 6468 void arm_power_q31(
switches 0:5c4d7b2438d3 6469 q31_t * pSrc,
switches 0:5c4d7b2438d3 6470 uint32_t blockSize,
switches 0:5c4d7b2438d3 6471 q63_t * pResult);
switches 0:5c4d7b2438d3 6472
switches 0:5c4d7b2438d3 6473 /**
switches 0:5c4d7b2438d3 6474 * @brief Sum of the squares of the elements of a floating-point vector.
switches 0:5c4d7b2438d3 6475 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6476 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6477 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6478 * @return none.
switches 0:5c4d7b2438d3 6479 */
switches 0:5c4d7b2438d3 6480
switches 0:5c4d7b2438d3 6481 void arm_power_f32(
switches 0:5c4d7b2438d3 6482 float32_t * pSrc,
switches 0:5c4d7b2438d3 6483 uint32_t blockSize,
switches 0:5c4d7b2438d3 6484 float32_t * pResult);
switches 0:5c4d7b2438d3 6485
switches 0:5c4d7b2438d3 6486 /**
switches 0:5c4d7b2438d3 6487 * @brief Sum of the squares of the elements of a Q15 vector.
switches 0:5c4d7b2438d3 6488 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6489 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6490 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6491 * @return none.
switches 0:5c4d7b2438d3 6492 */
switches 0:5c4d7b2438d3 6493
switches 0:5c4d7b2438d3 6494 void arm_power_q15(
switches 0:5c4d7b2438d3 6495 q15_t * pSrc,
switches 0:5c4d7b2438d3 6496 uint32_t blockSize,
switches 0:5c4d7b2438d3 6497 q63_t * pResult);
switches 0:5c4d7b2438d3 6498
switches 0:5c4d7b2438d3 6499 /**
switches 0:5c4d7b2438d3 6500 * @brief Sum of the squares of the elements of a Q7 vector.
switches 0:5c4d7b2438d3 6501 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6502 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6503 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6504 * @return none.
switches 0:5c4d7b2438d3 6505 */
switches 0:5c4d7b2438d3 6506
switches 0:5c4d7b2438d3 6507 void arm_power_q7(
switches 0:5c4d7b2438d3 6508 q7_t * pSrc,
switches 0:5c4d7b2438d3 6509 uint32_t blockSize,
switches 0:5c4d7b2438d3 6510 q31_t * pResult);
switches 0:5c4d7b2438d3 6511
switches 0:5c4d7b2438d3 6512 /**
switches 0:5c4d7b2438d3 6513 * @brief Mean value of a Q7 vector.
switches 0:5c4d7b2438d3 6514 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6515 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6516 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6517 * @return none.
switches 0:5c4d7b2438d3 6518 */
switches 0:5c4d7b2438d3 6519
switches 0:5c4d7b2438d3 6520 void arm_mean_q7(
switches 0:5c4d7b2438d3 6521 q7_t * pSrc,
switches 0:5c4d7b2438d3 6522 uint32_t blockSize,
switches 0:5c4d7b2438d3 6523 q7_t * pResult);
switches 0:5c4d7b2438d3 6524
switches 0:5c4d7b2438d3 6525 /**
switches 0:5c4d7b2438d3 6526 * @brief Mean value of a Q15 vector.
switches 0:5c4d7b2438d3 6527 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6528 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6529 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6530 * @return none.
switches 0:5c4d7b2438d3 6531 */
switches 0:5c4d7b2438d3 6532 void arm_mean_q15(
switches 0:5c4d7b2438d3 6533 q15_t * pSrc,
switches 0:5c4d7b2438d3 6534 uint32_t blockSize,
switches 0:5c4d7b2438d3 6535 q15_t * pResult);
switches 0:5c4d7b2438d3 6536
switches 0:5c4d7b2438d3 6537 /**
switches 0:5c4d7b2438d3 6538 * @brief Mean value of a Q31 vector.
switches 0:5c4d7b2438d3 6539 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6540 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6541 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6542 * @return none.
switches 0:5c4d7b2438d3 6543 */
switches 0:5c4d7b2438d3 6544 void arm_mean_q31(
switches 0:5c4d7b2438d3 6545 q31_t * pSrc,
switches 0:5c4d7b2438d3 6546 uint32_t blockSize,
switches 0:5c4d7b2438d3 6547 q31_t * pResult);
switches 0:5c4d7b2438d3 6548
switches 0:5c4d7b2438d3 6549 /**
switches 0:5c4d7b2438d3 6550 * @brief Mean value of a floating-point vector.
switches 0:5c4d7b2438d3 6551 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6552 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6553 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6554 * @return none.
switches 0:5c4d7b2438d3 6555 */
switches 0:5c4d7b2438d3 6556 void arm_mean_f32(
switches 0:5c4d7b2438d3 6557 float32_t * pSrc,
switches 0:5c4d7b2438d3 6558 uint32_t blockSize,
switches 0:5c4d7b2438d3 6559 float32_t * pResult);
switches 0:5c4d7b2438d3 6560
switches 0:5c4d7b2438d3 6561 /**
switches 0:5c4d7b2438d3 6562 * @brief Variance of the elements of a floating-point vector.
switches 0:5c4d7b2438d3 6563 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6564 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6565 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6566 * @return none.
switches 0:5c4d7b2438d3 6567 */
switches 0:5c4d7b2438d3 6568
switches 0:5c4d7b2438d3 6569 void arm_var_f32(
switches 0:5c4d7b2438d3 6570 float32_t * pSrc,
switches 0:5c4d7b2438d3 6571 uint32_t blockSize,
switches 0:5c4d7b2438d3 6572 float32_t * pResult);
switches 0:5c4d7b2438d3 6573
switches 0:5c4d7b2438d3 6574 /**
switches 0:5c4d7b2438d3 6575 * @brief Variance of the elements of a Q31 vector.
switches 0:5c4d7b2438d3 6576 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6577 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6578 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6579 * @return none.
switches 0:5c4d7b2438d3 6580 */
switches 0:5c4d7b2438d3 6581
switches 0:5c4d7b2438d3 6582 void arm_var_q31(
switches 0:5c4d7b2438d3 6583 q31_t * pSrc,
switches 0:5c4d7b2438d3 6584 uint32_t blockSize,
switches 0:5c4d7b2438d3 6585 q31_t * pResult);
switches 0:5c4d7b2438d3 6586
switches 0:5c4d7b2438d3 6587 /**
switches 0:5c4d7b2438d3 6588 * @brief Variance of the elements of a Q15 vector.
switches 0:5c4d7b2438d3 6589 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6590 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6591 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6592 * @return none.
switches 0:5c4d7b2438d3 6593 */
switches 0:5c4d7b2438d3 6594
switches 0:5c4d7b2438d3 6595 void arm_var_q15(
switches 0:5c4d7b2438d3 6596 q15_t * pSrc,
switches 0:5c4d7b2438d3 6597 uint32_t blockSize,
switches 0:5c4d7b2438d3 6598 q15_t * pResult);
switches 0:5c4d7b2438d3 6599
switches 0:5c4d7b2438d3 6600 /**
switches 0:5c4d7b2438d3 6601 * @brief Root Mean Square of the elements of a floating-point vector.
switches 0:5c4d7b2438d3 6602 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6603 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6604 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6605 * @return none.
switches 0:5c4d7b2438d3 6606 */
switches 0:5c4d7b2438d3 6607
switches 0:5c4d7b2438d3 6608 void arm_rms_f32(
switches 0:5c4d7b2438d3 6609 float32_t * pSrc,
switches 0:5c4d7b2438d3 6610 uint32_t blockSize,
switches 0:5c4d7b2438d3 6611 float32_t * pResult);
switches 0:5c4d7b2438d3 6612
switches 0:5c4d7b2438d3 6613 /**
switches 0:5c4d7b2438d3 6614 * @brief Root Mean Square of the elements of a Q31 vector.
switches 0:5c4d7b2438d3 6615 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6616 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6617 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6618 * @return none.
switches 0:5c4d7b2438d3 6619 */
switches 0:5c4d7b2438d3 6620
switches 0:5c4d7b2438d3 6621 void arm_rms_q31(
switches 0:5c4d7b2438d3 6622 q31_t * pSrc,
switches 0:5c4d7b2438d3 6623 uint32_t blockSize,
switches 0:5c4d7b2438d3 6624 q31_t * pResult);
switches 0:5c4d7b2438d3 6625
switches 0:5c4d7b2438d3 6626 /**
switches 0:5c4d7b2438d3 6627 * @brief Root Mean Square of the elements of a Q15 vector.
switches 0:5c4d7b2438d3 6628 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6629 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6630 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6631 * @return none.
switches 0:5c4d7b2438d3 6632 */
switches 0:5c4d7b2438d3 6633
switches 0:5c4d7b2438d3 6634 void arm_rms_q15(
switches 0:5c4d7b2438d3 6635 q15_t * pSrc,
switches 0:5c4d7b2438d3 6636 uint32_t blockSize,
switches 0:5c4d7b2438d3 6637 q15_t * pResult);
switches 0:5c4d7b2438d3 6638
switches 0:5c4d7b2438d3 6639 /**
switches 0:5c4d7b2438d3 6640 * @brief Standard deviation of the elements of a floating-point vector.
switches 0:5c4d7b2438d3 6641 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6642 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6643 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6644 * @return none.
switches 0:5c4d7b2438d3 6645 */
switches 0:5c4d7b2438d3 6646
switches 0:5c4d7b2438d3 6647 void arm_std_f32(
switches 0:5c4d7b2438d3 6648 float32_t * pSrc,
switches 0:5c4d7b2438d3 6649 uint32_t blockSize,
switches 0:5c4d7b2438d3 6650 float32_t * pResult);
switches 0:5c4d7b2438d3 6651
switches 0:5c4d7b2438d3 6652 /**
switches 0:5c4d7b2438d3 6653 * @brief Standard deviation of the elements of a Q31 vector.
switches 0:5c4d7b2438d3 6654 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6655 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6656 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6657 * @return none.
switches 0:5c4d7b2438d3 6658 */
switches 0:5c4d7b2438d3 6659
switches 0:5c4d7b2438d3 6660 void arm_std_q31(
switches 0:5c4d7b2438d3 6661 q31_t * pSrc,
switches 0:5c4d7b2438d3 6662 uint32_t blockSize,
switches 0:5c4d7b2438d3 6663 q31_t * pResult);
switches 0:5c4d7b2438d3 6664
switches 0:5c4d7b2438d3 6665 /**
switches 0:5c4d7b2438d3 6666 * @brief Standard deviation of the elements of a Q15 vector.
switches 0:5c4d7b2438d3 6667 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6668 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6669 * @param[out] *pResult is output value.
switches 0:5c4d7b2438d3 6670 * @return none.
switches 0:5c4d7b2438d3 6671 */
switches 0:5c4d7b2438d3 6672
switches 0:5c4d7b2438d3 6673 void arm_std_q15(
switches 0:5c4d7b2438d3 6674 q15_t * pSrc,
switches 0:5c4d7b2438d3 6675 uint32_t blockSize,
switches 0:5c4d7b2438d3 6676 q15_t * pResult);
switches 0:5c4d7b2438d3 6677
switches 0:5c4d7b2438d3 6678 /**
switches 0:5c4d7b2438d3 6679 * @brief Floating-point complex magnitude
switches 0:5c4d7b2438d3 6680 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 6681 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 6682 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 6683 * @return none.
switches 0:5c4d7b2438d3 6684 */
switches 0:5c4d7b2438d3 6685
switches 0:5c4d7b2438d3 6686 void arm_cmplx_mag_f32(
switches 0:5c4d7b2438d3 6687 float32_t * pSrc,
switches 0:5c4d7b2438d3 6688 float32_t * pDst,
switches 0:5c4d7b2438d3 6689 uint32_t numSamples);
switches 0:5c4d7b2438d3 6690
switches 0:5c4d7b2438d3 6691 /**
switches 0:5c4d7b2438d3 6692 * @brief Q31 complex magnitude
switches 0:5c4d7b2438d3 6693 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 6694 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 6695 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 6696 * @return none.
switches 0:5c4d7b2438d3 6697 */
switches 0:5c4d7b2438d3 6698
switches 0:5c4d7b2438d3 6699 void arm_cmplx_mag_q31(
switches 0:5c4d7b2438d3 6700 q31_t * pSrc,
switches 0:5c4d7b2438d3 6701 q31_t * pDst,
switches 0:5c4d7b2438d3 6702 uint32_t numSamples);
switches 0:5c4d7b2438d3 6703
switches 0:5c4d7b2438d3 6704 /**
switches 0:5c4d7b2438d3 6705 * @brief Q15 complex magnitude
switches 0:5c4d7b2438d3 6706 * @param[in] *pSrc points to the complex input vector
switches 0:5c4d7b2438d3 6707 * @param[out] *pDst points to the real output vector
switches 0:5c4d7b2438d3 6708 * @param[in] numSamples number of complex samples in the input vector
switches 0:5c4d7b2438d3 6709 * @return none.
switches 0:5c4d7b2438d3 6710 */
switches 0:5c4d7b2438d3 6711
switches 0:5c4d7b2438d3 6712 void arm_cmplx_mag_q15(
switches 0:5c4d7b2438d3 6713 q15_t * pSrc,
switches 0:5c4d7b2438d3 6714 q15_t * pDst,
switches 0:5c4d7b2438d3 6715 uint32_t numSamples);
switches 0:5c4d7b2438d3 6716
switches 0:5c4d7b2438d3 6717 /**
switches 0:5c4d7b2438d3 6718 * @brief Q15 complex dot product
switches 0:5c4d7b2438d3 6719 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6720 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6721 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6722 * @param[out] *realResult real part of the result returned here
switches 0:5c4d7b2438d3 6723 * @param[out] *imagResult imaginary part of the result returned here
switches 0:5c4d7b2438d3 6724 * @return none.
switches 0:5c4d7b2438d3 6725 */
switches 0:5c4d7b2438d3 6726
switches 0:5c4d7b2438d3 6727 void arm_cmplx_dot_prod_q15(
switches 0:5c4d7b2438d3 6728 q15_t * pSrcA,
switches 0:5c4d7b2438d3 6729 q15_t * pSrcB,
switches 0:5c4d7b2438d3 6730 uint32_t numSamples,
switches 0:5c4d7b2438d3 6731 q31_t * realResult,
switches 0:5c4d7b2438d3 6732 q31_t * imagResult);
switches 0:5c4d7b2438d3 6733
switches 0:5c4d7b2438d3 6734 /**
switches 0:5c4d7b2438d3 6735 * @brief Q31 complex dot product
switches 0:5c4d7b2438d3 6736 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6737 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6738 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6739 * @param[out] *realResult real part of the result returned here
switches 0:5c4d7b2438d3 6740 * @param[out] *imagResult imaginary part of the result returned here
switches 0:5c4d7b2438d3 6741 * @return none.
switches 0:5c4d7b2438d3 6742 */
switches 0:5c4d7b2438d3 6743
switches 0:5c4d7b2438d3 6744 void arm_cmplx_dot_prod_q31(
switches 0:5c4d7b2438d3 6745 q31_t * pSrcA,
switches 0:5c4d7b2438d3 6746 q31_t * pSrcB,
switches 0:5c4d7b2438d3 6747 uint32_t numSamples,
switches 0:5c4d7b2438d3 6748 q63_t * realResult,
switches 0:5c4d7b2438d3 6749 q63_t * imagResult);
switches 0:5c4d7b2438d3 6750
switches 0:5c4d7b2438d3 6751 /**
switches 0:5c4d7b2438d3 6752 * @brief Floating-point complex dot product
switches 0:5c4d7b2438d3 6753 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6754 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6755 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6756 * @param[out] *realResult real part of the result returned here
switches 0:5c4d7b2438d3 6757 * @param[out] *imagResult imaginary part of the result returned here
switches 0:5c4d7b2438d3 6758 * @return none.
switches 0:5c4d7b2438d3 6759 */
switches 0:5c4d7b2438d3 6760
switches 0:5c4d7b2438d3 6761 void arm_cmplx_dot_prod_f32(
switches 0:5c4d7b2438d3 6762 float32_t * pSrcA,
switches 0:5c4d7b2438d3 6763 float32_t * pSrcB,
switches 0:5c4d7b2438d3 6764 uint32_t numSamples,
switches 0:5c4d7b2438d3 6765 float32_t * realResult,
switches 0:5c4d7b2438d3 6766 float32_t * imagResult);
switches 0:5c4d7b2438d3 6767
switches 0:5c4d7b2438d3 6768 /**
switches 0:5c4d7b2438d3 6769 * @brief Q15 complex-by-real multiplication
switches 0:5c4d7b2438d3 6770 * @param[in] *pSrcCmplx points to the complex input vector
switches 0:5c4d7b2438d3 6771 * @param[in] *pSrcReal points to the real input vector
switches 0:5c4d7b2438d3 6772 * @param[out] *pCmplxDst points to the complex output vector
switches 0:5c4d7b2438d3 6773 * @param[in] numSamples number of samples in each vector
switches 0:5c4d7b2438d3 6774 * @return none.
switches 0:5c4d7b2438d3 6775 */
switches 0:5c4d7b2438d3 6776
switches 0:5c4d7b2438d3 6777 void arm_cmplx_mult_real_q15(
switches 0:5c4d7b2438d3 6778 q15_t * pSrcCmplx,
switches 0:5c4d7b2438d3 6779 q15_t * pSrcReal,
switches 0:5c4d7b2438d3 6780 q15_t * pCmplxDst,
switches 0:5c4d7b2438d3 6781 uint32_t numSamples);
switches 0:5c4d7b2438d3 6782
switches 0:5c4d7b2438d3 6783 /**
switches 0:5c4d7b2438d3 6784 * @brief Q31 complex-by-real multiplication
switches 0:5c4d7b2438d3 6785 * @param[in] *pSrcCmplx points to the complex input vector
switches 0:5c4d7b2438d3 6786 * @param[in] *pSrcReal points to the real input vector
switches 0:5c4d7b2438d3 6787 * @param[out] *pCmplxDst points to the complex output vector
switches 0:5c4d7b2438d3 6788 * @param[in] numSamples number of samples in each vector
switches 0:5c4d7b2438d3 6789 * @return none.
switches 0:5c4d7b2438d3 6790 */
switches 0:5c4d7b2438d3 6791
switches 0:5c4d7b2438d3 6792 void arm_cmplx_mult_real_q31(
switches 0:5c4d7b2438d3 6793 q31_t * pSrcCmplx,
switches 0:5c4d7b2438d3 6794 q31_t * pSrcReal,
switches 0:5c4d7b2438d3 6795 q31_t * pCmplxDst,
switches 0:5c4d7b2438d3 6796 uint32_t numSamples);
switches 0:5c4d7b2438d3 6797
switches 0:5c4d7b2438d3 6798 /**
switches 0:5c4d7b2438d3 6799 * @brief Floating-point complex-by-real multiplication
switches 0:5c4d7b2438d3 6800 * @param[in] *pSrcCmplx points to the complex input vector
switches 0:5c4d7b2438d3 6801 * @param[in] *pSrcReal points to the real input vector
switches 0:5c4d7b2438d3 6802 * @param[out] *pCmplxDst points to the complex output vector
switches 0:5c4d7b2438d3 6803 * @param[in] numSamples number of samples in each vector
switches 0:5c4d7b2438d3 6804 * @return none.
switches 0:5c4d7b2438d3 6805 */
switches 0:5c4d7b2438d3 6806
switches 0:5c4d7b2438d3 6807 void arm_cmplx_mult_real_f32(
switches 0:5c4d7b2438d3 6808 float32_t * pSrcCmplx,
switches 0:5c4d7b2438d3 6809 float32_t * pSrcReal,
switches 0:5c4d7b2438d3 6810 float32_t * pCmplxDst,
switches 0:5c4d7b2438d3 6811 uint32_t numSamples);
switches 0:5c4d7b2438d3 6812
switches 0:5c4d7b2438d3 6813 /**
switches 0:5c4d7b2438d3 6814 * @brief Minimum value of a Q7 vector.
switches 0:5c4d7b2438d3 6815 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6816 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6817 * @param[out] *result is output pointer
switches 0:5c4d7b2438d3 6818 * @param[in] index is the array index of the minimum value in the input buffer.
switches 0:5c4d7b2438d3 6819 * @return none.
switches 0:5c4d7b2438d3 6820 */
switches 0:5c4d7b2438d3 6821
switches 0:5c4d7b2438d3 6822 void arm_min_q7(
switches 0:5c4d7b2438d3 6823 q7_t * pSrc,
switches 0:5c4d7b2438d3 6824 uint32_t blockSize,
switches 0:5c4d7b2438d3 6825 q7_t * result,
switches 0:5c4d7b2438d3 6826 uint32_t * index);
switches 0:5c4d7b2438d3 6827
switches 0:5c4d7b2438d3 6828 /**
switches 0:5c4d7b2438d3 6829 * @brief Minimum value of a Q15 vector.
switches 0:5c4d7b2438d3 6830 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6831 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6832 * @param[out] *pResult is output pointer
switches 0:5c4d7b2438d3 6833 * @param[in] *pIndex is the array index of the minimum value in the input buffer.
switches 0:5c4d7b2438d3 6834 * @return none.
switches 0:5c4d7b2438d3 6835 */
switches 0:5c4d7b2438d3 6836
switches 0:5c4d7b2438d3 6837 void arm_min_q15(
switches 0:5c4d7b2438d3 6838 q15_t * pSrc,
switches 0:5c4d7b2438d3 6839 uint32_t blockSize,
switches 0:5c4d7b2438d3 6840 q15_t * pResult,
switches 0:5c4d7b2438d3 6841 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6842
switches 0:5c4d7b2438d3 6843 /**
switches 0:5c4d7b2438d3 6844 * @brief Minimum value of a Q31 vector.
switches 0:5c4d7b2438d3 6845 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6846 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6847 * @param[out] *pResult is output pointer
switches 0:5c4d7b2438d3 6848 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
switches 0:5c4d7b2438d3 6849 * @return none.
switches 0:5c4d7b2438d3 6850 */
switches 0:5c4d7b2438d3 6851 void arm_min_q31(
switches 0:5c4d7b2438d3 6852 q31_t * pSrc,
switches 0:5c4d7b2438d3 6853 uint32_t blockSize,
switches 0:5c4d7b2438d3 6854 q31_t * pResult,
switches 0:5c4d7b2438d3 6855 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6856
switches 0:5c4d7b2438d3 6857 /**
switches 0:5c4d7b2438d3 6858 * @brief Minimum value of a floating-point vector.
switches 0:5c4d7b2438d3 6859 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 6860 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 6861 * @param[out] *pResult is output pointer
switches 0:5c4d7b2438d3 6862 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
switches 0:5c4d7b2438d3 6863 * @return none.
switches 0:5c4d7b2438d3 6864 */
switches 0:5c4d7b2438d3 6865
switches 0:5c4d7b2438d3 6866 void arm_min_f32(
switches 0:5c4d7b2438d3 6867 float32_t * pSrc,
switches 0:5c4d7b2438d3 6868 uint32_t blockSize,
switches 0:5c4d7b2438d3 6869 float32_t * pResult,
switches 0:5c4d7b2438d3 6870 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6871
switches 0:5c4d7b2438d3 6872 /**
switches 0:5c4d7b2438d3 6873 * @brief Maximum value of a Q7 vector.
switches 0:5c4d7b2438d3 6874 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 6875 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6876 * @param[out] *pResult maximum value returned here
switches 0:5c4d7b2438d3 6877 * @param[out] *pIndex index of maximum value returned here
switches 0:5c4d7b2438d3 6878 * @return none.
switches 0:5c4d7b2438d3 6879 */
switches 0:5c4d7b2438d3 6880
switches 0:5c4d7b2438d3 6881 void arm_max_q7(
switches 0:5c4d7b2438d3 6882 q7_t * pSrc,
switches 0:5c4d7b2438d3 6883 uint32_t blockSize,
switches 0:5c4d7b2438d3 6884 q7_t * pResult,
switches 0:5c4d7b2438d3 6885 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6886
switches 0:5c4d7b2438d3 6887 /**
switches 0:5c4d7b2438d3 6888 * @brief Maximum value of a Q15 vector.
switches 0:5c4d7b2438d3 6889 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 6890 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6891 * @param[out] *pResult maximum value returned here
switches 0:5c4d7b2438d3 6892 * @param[out] *pIndex index of maximum value returned here
switches 0:5c4d7b2438d3 6893 * @return none.
switches 0:5c4d7b2438d3 6894 */
switches 0:5c4d7b2438d3 6895
switches 0:5c4d7b2438d3 6896 void arm_max_q15(
switches 0:5c4d7b2438d3 6897 q15_t * pSrc,
switches 0:5c4d7b2438d3 6898 uint32_t blockSize,
switches 0:5c4d7b2438d3 6899 q15_t * pResult,
switches 0:5c4d7b2438d3 6900 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6901
switches 0:5c4d7b2438d3 6902 /**
switches 0:5c4d7b2438d3 6903 * @brief Maximum value of a Q31 vector.
switches 0:5c4d7b2438d3 6904 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 6905 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6906 * @param[out] *pResult maximum value returned here
switches 0:5c4d7b2438d3 6907 * @param[out] *pIndex index of maximum value returned here
switches 0:5c4d7b2438d3 6908 * @return none.
switches 0:5c4d7b2438d3 6909 */
switches 0:5c4d7b2438d3 6910
switches 0:5c4d7b2438d3 6911 void arm_max_q31(
switches 0:5c4d7b2438d3 6912 q31_t * pSrc,
switches 0:5c4d7b2438d3 6913 uint32_t blockSize,
switches 0:5c4d7b2438d3 6914 q31_t * pResult,
switches 0:5c4d7b2438d3 6915 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6916
switches 0:5c4d7b2438d3 6917 /**
switches 0:5c4d7b2438d3 6918 * @brief Maximum value of a floating-point vector.
switches 0:5c4d7b2438d3 6919 * @param[in] *pSrc points to the input buffer
switches 0:5c4d7b2438d3 6920 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6921 * @param[out] *pResult maximum value returned here
switches 0:5c4d7b2438d3 6922 * @param[out] *pIndex index of maximum value returned here
switches 0:5c4d7b2438d3 6923 * @return none.
switches 0:5c4d7b2438d3 6924 */
switches 0:5c4d7b2438d3 6925
switches 0:5c4d7b2438d3 6926 void arm_max_f32(
switches 0:5c4d7b2438d3 6927 float32_t * pSrc,
switches 0:5c4d7b2438d3 6928 uint32_t blockSize,
switches 0:5c4d7b2438d3 6929 float32_t * pResult,
switches 0:5c4d7b2438d3 6930 uint32_t * pIndex);
switches 0:5c4d7b2438d3 6931
switches 0:5c4d7b2438d3 6932 /**
switches 0:5c4d7b2438d3 6933 * @brief Q15 complex-by-complex multiplication
switches 0:5c4d7b2438d3 6934 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6935 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6936 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 6937 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6938 * @return none.
switches 0:5c4d7b2438d3 6939 */
switches 0:5c4d7b2438d3 6940
switches 0:5c4d7b2438d3 6941 void arm_cmplx_mult_cmplx_q15(
switches 0:5c4d7b2438d3 6942 q15_t * pSrcA,
switches 0:5c4d7b2438d3 6943 q15_t * pSrcB,
switches 0:5c4d7b2438d3 6944 q15_t * pDst,
switches 0:5c4d7b2438d3 6945 uint32_t numSamples);
switches 0:5c4d7b2438d3 6946
switches 0:5c4d7b2438d3 6947 /**
switches 0:5c4d7b2438d3 6948 * @brief Q31 complex-by-complex multiplication
switches 0:5c4d7b2438d3 6949 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6950 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6951 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 6952 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6953 * @return none.
switches 0:5c4d7b2438d3 6954 */
switches 0:5c4d7b2438d3 6955
switches 0:5c4d7b2438d3 6956 void arm_cmplx_mult_cmplx_q31(
switches 0:5c4d7b2438d3 6957 q31_t * pSrcA,
switches 0:5c4d7b2438d3 6958 q31_t * pSrcB,
switches 0:5c4d7b2438d3 6959 q31_t * pDst,
switches 0:5c4d7b2438d3 6960 uint32_t numSamples);
switches 0:5c4d7b2438d3 6961
switches 0:5c4d7b2438d3 6962 /**
switches 0:5c4d7b2438d3 6963 * @brief Floating-point complex-by-complex multiplication
switches 0:5c4d7b2438d3 6964 * @param[in] *pSrcA points to the first input vector
switches 0:5c4d7b2438d3 6965 * @param[in] *pSrcB points to the second input vector
switches 0:5c4d7b2438d3 6966 * @param[out] *pDst points to the output vector
switches 0:5c4d7b2438d3 6967 * @param[in] numSamples number of complex samples in each vector
switches 0:5c4d7b2438d3 6968 * @return none.
switches 0:5c4d7b2438d3 6969 */
switches 0:5c4d7b2438d3 6970
switches 0:5c4d7b2438d3 6971 void arm_cmplx_mult_cmplx_f32(
switches 0:5c4d7b2438d3 6972 float32_t * pSrcA,
switches 0:5c4d7b2438d3 6973 float32_t * pSrcB,
switches 0:5c4d7b2438d3 6974 float32_t * pDst,
switches 0:5c4d7b2438d3 6975 uint32_t numSamples);
switches 0:5c4d7b2438d3 6976
switches 0:5c4d7b2438d3 6977 /**
switches 0:5c4d7b2438d3 6978 * @brief Converts the elements of the floating-point vector to Q31 vector.
switches 0:5c4d7b2438d3 6979 * @param[in] *pSrc points to the floating-point input vector
switches 0:5c4d7b2438d3 6980 * @param[out] *pDst points to the Q31 output vector
switches 0:5c4d7b2438d3 6981 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6982 * @return none.
switches 0:5c4d7b2438d3 6983 */
switches 0:5c4d7b2438d3 6984 void arm_float_to_q31(
switches 0:5c4d7b2438d3 6985 float32_t * pSrc,
switches 0:5c4d7b2438d3 6986 q31_t * pDst,
switches 0:5c4d7b2438d3 6987 uint32_t blockSize);
switches 0:5c4d7b2438d3 6988
switches 0:5c4d7b2438d3 6989 /**
switches 0:5c4d7b2438d3 6990 * @brief Converts the elements of the floating-point vector to Q15 vector.
switches 0:5c4d7b2438d3 6991 * @param[in] *pSrc points to the floating-point input vector
switches 0:5c4d7b2438d3 6992 * @param[out] *pDst points to the Q15 output vector
switches 0:5c4d7b2438d3 6993 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 6994 * @return none
switches 0:5c4d7b2438d3 6995 */
switches 0:5c4d7b2438d3 6996 void arm_float_to_q15(
switches 0:5c4d7b2438d3 6997 float32_t * pSrc,
switches 0:5c4d7b2438d3 6998 q15_t * pDst,
switches 0:5c4d7b2438d3 6999 uint32_t blockSize);
switches 0:5c4d7b2438d3 7000
switches 0:5c4d7b2438d3 7001 /**
switches 0:5c4d7b2438d3 7002 * @brief Converts the elements of the floating-point vector to Q7 vector.
switches 0:5c4d7b2438d3 7003 * @param[in] *pSrc points to the floating-point input vector
switches 0:5c4d7b2438d3 7004 * @param[out] *pDst points to the Q7 output vector
switches 0:5c4d7b2438d3 7005 * @param[in] blockSize length of the input vector
switches 0:5c4d7b2438d3 7006 * @return none
switches 0:5c4d7b2438d3 7007 */
switches 0:5c4d7b2438d3 7008 void arm_float_to_q7(
switches 0:5c4d7b2438d3 7009 float32_t * pSrc,
switches 0:5c4d7b2438d3 7010 q7_t * pDst,
switches 0:5c4d7b2438d3 7011 uint32_t blockSize);
switches 0:5c4d7b2438d3 7012
switches 0:5c4d7b2438d3 7013
switches 0:5c4d7b2438d3 7014 /**
switches 0:5c4d7b2438d3 7015 * @brief Converts the elements of the Q31 vector to Q15 vector.
switches 0:5c4d7b2438d3 7016 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 7017 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 7018 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 7019 * @return none.
switches 0:5c4d7b2438d3 7020 */
switches 0:5c4d7b2438d3 7021 void arm_q31_to_q15(
switches 0:5c4d7b2438d3 7022 q31_t * pSrc,
switches 0:5c4d7b2438d3 7023 q15_t * pDst,
switches 0:5c4d7b2438d3 7024 uint32_t blockSize);
switches 0:5c4d7b2438d3 7025
switches 0:5c4d7b2438d3 7026 /**
switches 0:5c4d7b2438d3 7027 * @brief Converts the elements of the Q31 vector to Q7 vector.
switches 0:5c4d7b2438d3 7028 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 7029 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 7030 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 7031 * @return none.
switches 0:5c4d7b2438d3 7032 */
switches 0:5c4d7b2438d3 7033 void arm_q31_to_q7(
switches 0:5c4d7b2438d3 7034 q31_t * pSrc,
switches 0:5c4d7b2438d3 7035 q7_t * pDst,
switches 0:5c4d7b2438d3 7036 uint32_t blockSize);
switches 0:5c4d7b2438d3 7037
switches 0:5c4d7b2438d3 7038 /**
switches 0:5c4d7b2438d3 7039 * @brief Converts the elements of the Q15 vector to floating-point vector.
switches 0:5c4d7b2438d3 7040 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 7041 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 7042 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 7043 * @return none.
switches 0:5c4d7b2438d3 7044 */
switches 0:5c4d7b2438d3 7045 void arm_q15_to_float(
switches 0:5c4d7b2438d3 7046 q15_t * pSrc,
switches 0:5c4d7b2438d3 7047 float32_t * pDst,
switches 0:5c4d7b2438d3 7048 uint32_t blockSize);
switches 0:5c4d7b2438d3 7049
switches 0:5c4d7b2438d3 7050
switches 0:5c4d7b2438d3 7051 /**
switches 0:5c4d7b2438d3 7052 * @brief Converts the elements of the Q15 vector to Q31 vector.
switches 0:5c4d7b2438d3 7053 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 7054 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 7055 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 7056 * @return none.
switches 0:5c4d7b2438d3 7057 */
switches 0:5c4d7b2438d3 7058 void arm_q15_to_q31(
switches 0:5c4d7b2438d3 7059 q15_t * pSrc,
switches 0:5c4d7b2438d3 7060 q31_t * pDst,
switches 0:5c4d7b2438d3 7061 uint32_t blockSize);
switches 0:5c4d7b2438d3 7062
switches 0:5c4d7b2438d3 7063
switches 0:5c4d7b2438d3 7064 /**
switches 0:5c4d7b2438d3 7065 * @brief Converts the elements of the Q15 vector to Q7 vector.
switches 0:5c4d7b2438d3 7066 * @param[in] *pSrc is input pointer
switches 0:5c4d7b2438d3 7067 * @param[out] *pDst is output pointer
switches 0:5c4d7b2438d3 7068 * @param[in] blockSize is the number of samples to process
switches 0:5c4d7b2438d3 7069 * @return none.
switches 0:5c4d7b2438d3 7070 */
switches 0:5c4d7b2438d3 7071 void arm_q15_to_q7(
switches 0:5c4d7b2438d3 7072 q15_t * pSrc,
switches 0:5c4d7b2438d3 7073 q7_t * pDst,
switches 0:5c4d7b2438d3 7074 uint32_t blockSize);
switches 0:5c4d7b2438d3 7075
switches 0:5c4d7b2438d3 7076
switches 0:5c4d7b2438d3 7077 /**
switches 0:5c4d7b2438d3 7078 * @ingroup groupInterpolation
switches 0:5c4d7b2438d3 7079 */
switches 0:5c4d7b2438d3 7080
switches 0:5c4d7b2438d3 7081 /**
switches 0:5c4d7b2438d3 7082 * @defgroup BilinearInterpolate Bilinear Interpolation
switches 0:5c4d7b2438d3 7083 *
switches 0:5c4d7b2438d3 7084 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
switches 0:5c4d7b2438d3 7085 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
switches 0:5c4d7b2438d3 7086 * determines values between the grid points.
switches 0:5c4d7b2438d3 7087 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
switches 0:5c4d7b2438d3 7088 * Bilinear interpolation is often used in image processing to rescale images.
switches 0:5c4d7b2438d3 7089 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
switches 0:5c4d7b2438d3 7090 *
switches 0:5c4d7b2438d3 7091 * <b>Algorithm</b>
switches 0:5c4d7b2438d3 7092 * \par
switches 0:5c4d7b2438d3 7093 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
switches 0:5c4d7b2438d3 7094 * For floating-point, the instance structure is defined as:
switches 0:5c4d7b2438d3 7095 * <pre>
switches 0:5c4d7b2438d3 7096 * typedef struct
switches 0:5c4d7b2438d3 7097 * {
switches 0:5c4d7b2438d3 7098 * uint16_t numRows;
switches 0:5c4d7b2438d3 7099 * uint16_t numCols;
switches 0:5c4d7b2438d3 7100 * float32_t *pData;
switches 0:5c4d7b2438d3 7101 * } arm_bilinear_interp_instance_f32;
switches 0:5c4d7b2438d3 7102 * </pre>
switches 0:5c4d7b2438d3 7103 *
switches 0:5c4d7b2438d3 7104 * \par
switches 0:5c4d7b2438d3 7105 * where <code>numRows</code> specifies the number of rows in the table;
switches 0:5c4d7b2438d3 7106 * <code>numCols</code> specifies the number of columns in the table;
switches 0:5c4d7b2438d3 7107 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
switches 0:5c4d7b2438d3 7108 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
switches 0:5c4d7b2438d3 7109 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
switches 0:5c4d7b2438d3 7110 *
switches 0:5c4d7b2438d3 7111 * \par
switches 0:5c4d7b2438d3 7112 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
switches 0:5c4d7b2438d3 7113 * <pre>
switches 0:5c4d7b2438d3 7114 * XF = floor(x)
switches 0:5c4d7b2438d3 7115 * YF = floor(y)
switches 0:5c4d7b2438d3 7116 * </pre>
switches 0:5c4d7b2438d3 7117 * \par
switches 0:5c4d7b2438d3 7118 * The interpolated output point is computed as:
switches 0:5c4d7b2438d3 7119 * <pre>
switches 0:5c4d7b2438d3 7120 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
switches 0:5c4d7b2438d3 7121 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
switches 0:5c4d7b2438d3 7122 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
switches 0:5c4d7b2438d3 7123 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
switches 0:5c4d7b2438d3 7124 * </pre>
switches 0:5c4d7b2438d3 7125 * Note that the coordinates (x, y) contain integer and fractional components.
switches 0:5c4d7b2438d3 7126 * The integer components specify which portion of the table to use while the
switches 0:5c4d7b2438d3 7127 * fractional components control the interpolation processor.
switches 0:5c4d7b2438d3 7128 *
switches 0:5c4d7b2438d3 7129 * \par
switches 0:5c4d7b2438d3 7130 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
switches 0:5c4d7b2438d3 7131 */
switches 0:5c4d7b2438d3 7132
switches 0:5c4d7b2438d3 7133 /**
switches 0:5c4d7b2438d3 7134 * @addtogroup BilinearInterpolate
switches 0:5c4d7b2438d3 7135 * @{
switches 0:5c4d7b2438d3 7136 */
switches 0:5c4d7b2438d3 7137
switches 0:5c4d7b2438d3 7138 /**
switches 0:5c4d7b2438d3 7139 *
switches 0:5c4d7b2438d3 7140 * @brief Floating-point bilinear interpolation.
switches 0:5c4d7b2438d3 7141 * @param[in,out] *S points to an instance of the interpolation structure.
switches 0:5c4d7b2438d3 7142 * @param[in] X interpolation coordinate.
switches 0:5c4d7b2438d3 7143 * @param[in] Y interpolation coordinate.
switches 0:5c4d7b2438d3 7144 * @return out interpolated value.
switches 0:5c4d7b2438d3 7145 */
switches 0:5c4d7b2438d3 7146
switches 0:5c4d7b2438d3 7147
switches 0:5c4d7b2438d3 7148 static __INLINE float32_t arm_bilinear_interp_f32(
switches 0:5c4d7b2438d3 7149 const arm_bilinear_interp_instance_f32 * S,
switches 0:5c4d7b2438d3 7150 float32_t X,
switches 0:5c4d7b2438d3 7151 float32_t Y)
switches 0:5c4d7b2438d3 7152 {
switches 0:5c4d7b2438d3 7153 float32_t out;
switches 0:5c4d7b2438d3 7154 float32_t f00, f01, f10, f11;
switches 0:5c4d7b2438d3 7155 float32_t *pData = S->pData;
switches 0:5c4d7b2438d3 7156 int32_t xIndex, yIndex, index;
switches 0:5c4d7b2438d3 7157 float32_t xdiff, ydiff;
switches 0:5c4d7b2438d3 7158 float32_t b1, b2, b3, b4;
switches 0:5c4d7b2438d3 7159
switches 0:5c4d7b2438d3 7160 xIndex = (int32_t) X;
switches 0:5c4d7b2438d3 7161 yIndex = (int32_t) Y;
switches 0:5c4d7b2438d3 7162
switches 0:5c4d7b2438d3 7163 /* Care taken for table outside boundary */
switches 0:5c4d7b2438d3 7164 /* Returns zero output when values are outside table boundary */
switches 0:5c4d7b2438d3 7165 if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0
switches 0:5c4d7b2438d3 7166 || yIndex > (S->numCols - 1))
switches 0:5c4d7b2438d3 7167 {
switches 0:5c4d7b2438d3 7168 return (0);
switches 0:5c4d7b2438d3 7169 }
switches 0:5c4d7b2438d3 7170
switches 0:5c4d7b2438d3 7171 /* Calculation of index for two nearest points in X-direction */
switches 0:5c4d7b2438d3 7172 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
switches 0:5c4d7b2438d3 7173
switches 0:5c4d7b2438d3 7174
switches 0:5c4d7b2438d3 7175 /* Read two nearest points in X-direction */
switches 0:5c4d7b2438d3 7176 f00 = pData[index];
switches 0:5c4d7b2438d3 7177 f01 = pData[index + 1];
switches 0:5c4d7b2438d3 7178
switches 0:5c4d7b2438d3 7179 /* Calculation of index for two nearest points in Y-direction */
switches 0:5c4d7b2438d3 7180 index = (xIndex - 1) + (yIndex) * S->numCols;
switches 0:5c4d7b2438d3 7181
switches 0:5c4d7b2438d3 7182
switches 0:5c4d7b2438d3 7183 /* Read two nearest points in Y-direction */
switches 0:5c4d7b2438d3 7184 f10 = pData[index];
switches 0:5c4d7b2438d3 7185 f11 = pData[index + 1];
switches 0:5c4d7b2438d3 7186
switches 0:5c4d7b2438d3 7187 /* Calculation of intermediate values */
switches 0:5c4d7b2438d3 7188 b1 = f00;
switches 0:5c4d7b2438d3 7189 b2 = f01 - f00;
switches 0:5c4d7b2438d3 7190 b3 = f10 - f00;
switches 0:5c4d7b2438d3 7191 b4 = f00 - f01 - f10 + f11;
switches 0:5c4d7b2438d3 7192
switches 0:5c4d7b2438d3 7193 /* Calculation of fractional part in X */
switches 0:5c4d7b2438d3 7194 xdiff = X - xIndex;
switches 0:5c4d7b2438d3 7195
switches 0:5c4d7b2438d3 7196 /* Calculation of fractional part in Y */
switches 0:5c4d7b2438d3 7197 ydiff = Y - yIndex;
switches 0:5c4d7b2438d3 7198
switches 0:5c4d7b2438d3 7199 /* Calculation of bi-linear interpolated output */
switches 0:5c4d7b2438d3 7200 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
switches 0:5c4d7b2438d3 7201
switches 0:5c4d7b2438d3 7202 /* return to application */
switches 0:5c4d7b2438d3 7203 return (out);
switches 0:5c4d7b2438d3 7204
switches 0:5c4d7b2438d3 7205 }
switches 0:5c4d7b2438d3 7206
switches 0:5c4d7b2438d3 7207 /**
switches 0:5c4d7b2438d3 7208 *
switches 0:5c4d7b2438d3 7209 * @brief Q31 bilinear interpolation.
switches 0:5c4d7b2438d3 7210 * @param[in,out] *S points to an instance of the interpolation structure.
switches 0:5c4d7b2438d3 7211 * @param[in] X interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7212 * @param[in] Y interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7213 * @return out interpolated value.
switches 0:5c4d7b2438d3 7214 */
switches 0:5c4d7b2438d3 7215
switches 0:5c4d7b2438d3 7216 static __INLINE q31_t arm_bilinear_interp_q31(
switches 0:5c4d7b2438d3 7217 arm_bilinear_interp_instance_q31 * S,
switches 0:5c4d7b2438d3 7218 q31_t X,
switches 0:5c4d7b2438d3 7219 q31_t Y)
switches 0:5c4d7b2438d3 7220 {
switches 0:5c4d7b2438d3 7221 q31_t out; /* Temporary output */
switches 0:5c4d7b2438d3 7222 q31_t acc = 0; /* output */
switches 0:5c4d7b2438d3 7223 q31_t xfract, yfract; /* X, Y fractional parts */
switches 0:5c4d7b2438d3 7224 q31_t x1, x2, y1, y2; /* Nearest output values */
switches 0:5c4d7b2438d3 7225 int32_t rI, cI; /* Row and column indices */
switches 0:5c4d7b2438d3 7226 q31_t *pYData = S->pData; /* pointer to output table values */
switches 0:5c4d7b2438d3 7227 uint32_t nCols = S->numCols; /* num of rows */
switches 0:5c4d7b2438d3 7228
switches 0:5c4d7b2438d3 7229
switches 0:5c4d7b2438d3 7230 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7231 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7232 /* Index value calculation */
switches 0:5c4d7b2438d3 7233 rI = ((X & 0xFFF00000) >> 20u);
switches 0:5c4d7b2438d3 7234
switches 0:5c4d7b2438d3 7235 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7236 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7237 /* Index value calculation */
switches 0:5c4d7b2438d3 7238 cI = ((Y & 0xFFF00000) >> 20u);
switches 0:5c4d7b2438d3 7239
switches 0:5c4d7b2438d3 7240 /* Care taken for table outside boundary */
switches 0:5c4d7b2438d3 7241 /* Returns zero output when values are outside table boundary */
switches 0:5c4d7b2438d3 7242 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
switches 0:5c4d7b2438d3 7243 {
switches 0:5c4d7b2438d3 7244 return (0);
switches 0:5c4d7b2438d3 7245 }
switches 0:5c4d7b2438d3 7246
switches 0:5c4d7b2438d3 7247 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7248 /* shift left xfract by 11 to keep 1.31 format */
switches 0:5c4d7b2438d3 7249 xfract = (X & 0x000FFFFF) << 11u;
switches 0:5c4d7b2438d3 7250
switches 0:5c4d7b2438d3 7251 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7252 x1 = pYData[(rI) + nCols * (cI)];
switches 0:5c4d7b2438d3 7253 x2 = pYData[(rI) + nCols * (cI) + 1u];
switches 0:5c4d7b2438d3 7254
switches 0:5c4d7b2438d3 7255 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7256 /* shift left yfract by 11 to keep 1.31 format */
switches 0:5c4d7b2438d3 7257 yfract = (Y & 0x000FFFFF) << 11u;
switches 0:5c4d7b2438d3 7258
switches 0:5c4d7b2438d3 7259 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7260 y1 = pYData[(rI) + nCols * (cI + 1)];
switches 0:5c4d7b2438d3 7261 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
switches 0:5c4d7b2438d3 7262
switches 0:5c4d7b2438d3 7263 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
switches 0:5c4d7b2438d3 7264 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
switches 0:5c4d7b2438d3 7265 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
switches 0:5c4d7b2438d3 7266
switches 0:5c4d7b2438d3 7267 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
switches 0:5c4d7b2438d3 7268 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
switches 0:5c4d7b2438d3 7269 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
switches 0:5c4d7b2438d3 7270
switches 0:5c4d7b2438d3 7271 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
switches 0:5c4d7b2438d3 7272 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
switches 0:5c4d7b2438d3 7273 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
switches 0:5c4d7b2438d3 7274
switches 0:5c4d7b2438d3 7275 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
switches 0:5c4d7b2438d3 7276 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
switches 0:5c4d7b2438d3 7277 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
switches 0:5c4d7b2438d3 7278
switches 0:5c4d7b2438d3 7279 /* Convert acc to 1.31(q31) format */
switches 0:5c4d7b2438d3 7280 return (acc << 2u);
switches 0:5c4d7b2438d3 7281
switches 0:5c4d7b2438d3 7282 }
switches 0:5c4d7b2438d3 7283
switches 0:5c4d7b2438d3 7284 /**
switches 0:5c4d7b2438d3 7285 * @brief Q15 bilinear interpolation.
switches 0:5c4d7b2438d3 7286 * @param[in,out] *S points to an instance of the interpolation structure.
switches 0:5c4d7b2438d3 7287 * @param[in] X interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7288 * @param[in] Y interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7289 * @return out interpolated value.
switches 0:5c4d7b2438d3 7290 */
switches 0:5c4d7b2438d3 7291
switches 0:5c4d7b2438d3 7292 static __INLINE q15_t arm_bilinear_interp_q15(
switches 0:5c4d7b2438d3 7293 arm_bilinear_interp_instance_q15 * S,
switches 0:5c4d7b2438d3 7294 q31_t X,
switches 0:5c4d7b2438d3 7295 q31_t Y)
switches 0:5c4d7b2438d3 7296 {
switches 0:5c4d7b2438d3 7297 q63_t acc = 0; /* output */
switches 0:5c4d7b2438d3 7298 q31_t out; /* Temporary output */
switches 0:5c4d7b2438d3 7299 q15_t x1, x2, y1, y2; /* Nearest output values */
switches 0:5c4d7b2438d3 7300 q31_t xfract, yfract; /* X, Y fractional parts */
switches 0:5c4d7b2438d3 7301 int32_t rI, cI; /* Row and column indices */
switches 0:5c4d7b2438d3 7302 q15_t *pYData = S->pData; /* pointer to output table values */
switches 0:5c4d7b2438d3 7303 uint32_t nCols = S->numCols; /* num of rows */
switches 0:5c4d7b2438d3 7304
switches 0:5c4d7b2438d3 7305 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7306 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7307 /* Index value calculation */
switches 0:5c4d7b2438d3 7308 rI = ((X & 0xFFF00000) >> 20);
switches 0:5c4d7b2438d3 7309
switches 0:5c4d7b2438d3 7310 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7311 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7312 /* Index value calculation */
switches 0:5c4d7b2438d3 7313 cI = ((Y & 0xFFF00000) >> 20);
switches 0:5c4d7b2438d3 7314
switches 0:5c4d7b2438d3 7315 /* Care taken for table outside boundary */
switches 0:5c4d7b2438d3 7316 /* Returns zero output when values are outside table boundary */
switches 0:5c4d7b2438d3 7317 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
switches 0:5c4d7b2438d3 7318 {
switches 0:5c4d7b2438d3 7319 return (0);
switches 0:5c4d7b2438d3 7320 }
switches 0:5c4d7b2438d3 7321
switches 0:5c4d7b2438d3 7322 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7323 /* xfract should be in 12.20 format */
switches 0:5c4d7b2438d3 7324 xfract = (X & 0x000FFFFF);
switches 0:5c4d7b2438d3 7325
switches 0:5c4d7b2438d3 7326 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7327 x1 = pYData[(rI) + nCols * (cI)];
switches 0:5c4d7b2438d3 7328 x2 = pYData[(rI) + nCols * (cI) + 1u];
switches 0:5c4d7b2438d3 7329
switches 0:5c4d7b2438d3 7330
switches 0:5c4d7b2438d3 7331 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7332 /* yfract should be in 12.20 format */
switches 0:5c4d7b2438d3 7333 yfract = (Y & 0x000FFFFF);
switches 0:5c4d7b2438d3 7334
switches 0:5c4d7b2438d3 7335 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7336 y1 = pYData[(rI) + nCols * (cI + 1)];
switches 0:5c4d7b2438d3 7337 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
switches 0:5c4d7b2438d3 7338
switches 0:5c4d7b2438d3 7339 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
switches 0:5c4d7b2438d3 7340
switches 0:5c4d7b2438d3 7341 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
switches 0:5c4d7b2438d3 7342 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
switches 0:5c4d7b2438d3 7343 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
switches 0:5c4d7b2438d3 7344 acc = ((q63_t) out * (0xFFFFF - yfract));
switches 0:5c4d7b2438d3 7345
switches 0:5c4d7b2438d3 7346 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
switches 0:5c4d7b2438d3 7347 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
switches 0:5c4d7b2438d3 7348 acc += ((q63_t) out * (xfract));
switches 0:5c4d7b2438d3 7349
switches 0:5c4d7b2438d3 7350 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
switches 0:5c4d7b2438d3 7351 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
switches 0:5c4d7b2438d3 7352 acc += ((q63_t) out * (yfract));
switches 0:5c4d7b2438d3 7353
switches 0:5c4d7b2438d3 7354 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
switches 0:5c4d7b2438d3 7355 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
switches 0:5c4d7b2438d3 7356 acc += ((q63_t) out * (yfract));
switches 0:5c4d7b2438d3 7357
switches 0:5c4d7b2438d3 7358 /* acc is in 13.51 format and down shift acc by 36 times */
switches 0:5c4d7b2438d3 7359 /* Convert out to 1.15 format */
switches 0:5c4d7b2438d3 7360 return (acc >> 36);
switches 0:5c4d7b2438d3 7361
switches 0:5c4d7b2438d3 7362 }
switches 0:5c4d7b2438d3 7363
switches 0:5c4d7b2438d3 7364 /**
switches 0:5c4d7b2438d3 7365 * @brief Q7 bilinear interpolation.
switches 0:5c4d7b2438d3 7366 * @param[in,out] *S points to an instance of the interpolation structure.
switches 0:5c4d7b2438d3 7367 * @param[in] X interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7368 * @param[in] Y interpolation coordinate in 12.20 format.
switches 0:5c4d7b2438d3 7369 * @return out interpolated value.
switches 0:5c4d7b2438d3 7370 */
switches 0:5c4d7b2438d3 7371
switches 0:5c4d7b2438d3 7372 static __INLINE q7_t arm_bilinear_interp_q7(
switches 0:5c4d7b2438d3 7373 arm_bilinear_interp_instance_q7 * S,
switches 0:5c4d7b2438d3 7374 q31_t X,
switches 0:5c4d7b2438d3 7375 q31_t Y)
switches 0:5c4d7b2438d3 7376 {
switches 0:5c4d7b2438d3 7377 q63_t acc = 0; /* output */
switches 0:5c4d7b2438d3 7378 q31_t out; /* Temporary output */
switches 0:5c4d7b2438d3 7379 q31_t xfract, yfract; /* X, Y fractional parts */
switches 0:5c4d7b2438d3 7380 q7_t x1, x2, y1, y2; /* Nearest output values */
switches 0:5c4d7b2438d3 7381 int32_t rI, cI; /* Row and column indices */
switches 0:5c4d7b2438d3 7382 q7_t *pYData = S->pData; /* pointer to output table values */
switches 0:5c4d7b2438d3 7383 uint32_t nCols = S->numCols; /* num of rows */
switches 0:5c4d7b2438d3 7384
switches 0:5c4d7b2438d3 7385 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7386 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7387 /* Index value calculation */
switches 0:5c4d7b2438d3 7388 rI = ((X & 0xFFF00000) >> 20);
switches 0:5c4d7b2438d3 7389
switches 0:5c4d7b2438d3 7390 /* Input is in 12.20 format */
switches 0:5c4d7b2438d3 7391 /* 12 bits for the table index */
switches 0:5c4d7b2438d3 7392 /* Index value calculation */
switches 0:5c4d7b2438d3 7393 cI = ((Y & 0xFFF00000) >> 20);
switches 0:5c4d7b2438d3 7394
switches 0:5c4d7b2438d3 7395 /* Care taken for table outside boundary */
switches 0:5c4d7b2438d3 7396 /* Returns zero output when values are outside table boundary */
switches 0:5c4d7b2438d3 7397 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
switches 0:5c4d7b2438d3 7398 {
switches 0:5c4d7b2438d3 7399 return (0);
switches 0:5c4d7b2438d3 7400 }
switches 0:5c4d7b2438d3 7401
switches 0:5c4d7b2438d3 7402 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7403 /* xfract should be in 12.20 format */
switches 0:5c4d7b2438d3 7404 xfract = (X & 0x000FFFFF);
switches 0:5c4d7b2438d3 7405
switches 0:5c4d7b2438d3 7406 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7407 x1 = pYData[(rI) + nCols * (cI)];
switches 0:5c4d7b2438d3 7408 x2 = pYData[(rI) + nCols * (cI) + 1u];
switches 0:5c4d7b2438d3 7409
switches 0:5c4d7b2438d3 7410
switches 0:5c4d7b2438d3 7411 /* 20 bits for the fractional part */
switches 0:5c4d7b2438d3 7412 /* yfract should be in 12.20 format */
switches 0:5c4d7b2438d3 7413 yfract = (Y & 0x000FFFFF);
switches 0:5c4d7b2438d3 7414
switches 0:5c4d7b2438d3 7415 /* Read two nearest output values from the index */
switches 0:5c4d7b2438d3 7416 y1 = pYData[(rI) + nCols * (cI + 1)];
switches 0:5c4d7b2438d3 7417 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
switches 0:5c4d7b2438d3 7418
switches 0:5c4d7b2438d3 7419 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
switches 0:5c4d7b2438d3 7420 out = ((x1 * (0xFFFFF - xfract)));
switches 0:5c4d7b2438d3 7421 acc = (((q63_t) out * (0xFFFFF - yfract)));
switches 0:5c4d7b2438d3 7422
switches 0:5c4d7b2438d3 7423 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
switches 0:5c4d7b2438d3 7424 out = ((x2 * (0xFFFFF - yfract)));
switches 0:5c4d7b2438d3 7425 acc += (((q63_t) out * (xfract)));
switches 0:5c4d7b2438d3 7426
switches 0:5c4d7b2438d3 7427 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
switches 0:5c4d7b2438d3 7428 out = ((y1 * (0xFFFFF - xfract)));
switches 0:5c4d7b2438d3 7429 acc += (((q63_t) out * (yfract)));
switches 0:5c4d7b2438d3 7430
switches 0:5c4d7b2438d3 7431 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
switches 0:5c4d7b2438d3 7432 out = ((y2 * (yfract)));
switches 0:5c4d7b2438d3 7433 acc += (((q63_t) out * (xfract)));
switches 0:5c4d7b2438d3 7434
switches 0:5c4d7b2438d3 7435 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
switches 0:5c4d7b2438d3 7436 return (acc >> 40);
switches 0:5c4d7b2438d3 7437
switches 0:5c4d7b2438d3 7438 }
switches 0:5c4d7b2438d3 7439
switches 0:5c4d7b2438d3 7440 /**
switches 0:5c4d7b2438d3 7441 * @} end of BilinearInterpolate group
switches 0:5c4d7b2438d3 7442 */
switches 0:5c4d7b2438d3 7443
switches 0:5c4d7b2438d3 7444
switches 0:5c4d7b2438d3 7445 //SMMLAR
switches 0:5c4d7b2438d3 7446 #define multAcc_32x32_keep32_R(a, x, y) \
switches 0:5c4d7b2438d3 7447 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
switches 0:5c4d7b2438d3 7448
switches 0:5c4d7b2438d3 7449 //SMMLSR
switches 0:5c4d7b2438d3 7450 #define multSub_32x32_keep32_R(a, x, y) \
switches 0:5c4d7b2438d3 7451 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
switches 0:5c4d7b2438d3 7452
switches 0:5c4d7b2438d3 7453 //SMMULR
switches 0:5c4d7b2438d3 7454 #define mult_32x32_keep32_R(a, x, y) \
switches 0:5c4d7b2438d3 7455 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
switches 0:5c4d7b2438d3 7456
switches 0:5c4d7b2438d3 7457 //SMMLA
switches 0:5c4d7b2438d3 7458 #define multAcc_32x32_keep32(a, x, y) \
switches 0:5c4d7b2438d3 7459 a += (q31_t) (((q63_t) x * y) >> 32)
switches 0:5c4d7b2438d3 7460
switches 0:5c4d7b2438d3 7461 //SMMLS
switches 0:5c4d7b2438d3 7462 #define multSub_32x32_keep32(a, x, y) \
switches 0:5c4d7b2438d3 7463 a -= (q31_t) (((q63_t) x * y) >> 32)
switches 0:5c4d7b2438d3 7464
switches 0:5c4d7b2438d3 7465 //SMMUL
switches 0:5c4d7b2438d3 7466 #define mult_32x32_keep32(a, x, y) \
switches 0:5c4d7b2438d3 7467 a = (q31_t) (((q63_t) x * y ) >> 32)
switches 0:5c4d7b2438d3 7468
switches 0:5c4d7b2438d3 7469
switches 0:5c4d7b2438d3 7470 #if defined ( __CC_ARM ) //Keil
switches 0:5c4d7b2438d3 7471
switches 0:5c4d7b2438d3 7472 //Enter low optimization region - place directly above function definition
switches 0:5c4d7b2438d3 7473 #ifdef ARM_MATH_CM4
switches 0:5c4d7b2438d3 7474 #define LOW_OPTIMIZATION_ENTER \
switches 0:5c4d7b2438d3 7475 _Pragma ("push") \
switches 0:5c4d7b2438d3 7476 _Pragma ("O1")
switches 0:5c4d7b2438d3 7477 #else
switches 0:5c4d7b2438d3 7478 #define LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7479 #endif
switches 0:5c4d7b2438d3 7480
switches 0:5c4d7b2438d3 7481 //Exit low optimization region - place directly after end of function definition
switches 0:5c4d7b2438d3 7482 #ifdef ARM_MATH_CM4
switches 0:5c4d7b2438d3 7483 #define LOW_OPTIMIZATION_EXIT \
switches 0:5c4d7b2438d3 7484 _Pragma ("pop")
switches 0:5c4d7b2438d3 7485 #else
switches 0:5c4d7b2438d3 7486 #define LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7487 #endif
switches 0:5c4d7b2438d3 7488
switches 0:5c4d7b2438d3 7489 //Enter low optimization region - place directly above function definition
switches 0:5c4d7b2438d3 7490 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7491
switches 0:5c4d7b2438d3 7492 //Exit low optimization region - place directly after end of function definition
switches 0:5c4d7b2438d3 7493 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7494
switches 0:5c4d7b2438d3 7495 #elif defined(__ICCARM__) //IAR
switches 0:5c4d7b2438d3 7496
switches 0:5c4d7b2438d3 7497 //Enter low optimization region - place directly above function definition
switches 0:5c4d7b2438d3 7498 #ifdef ARM_MATH_CM4
switches 0:5c4d7b2438d3 7499 #define LOW_OPTIMIZATION_ENTER \
switches 0:5c4d7b2438d3 7500 _Pragma ("optimize=low")
switches 0:5c4d7b2438d3 7501 #else
switches 0:5c4d7b2438d3 7502 #define LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7503 #endif
switches 0:5c4d7b2438d3 7504
switches 0:5c4d7b2438d3 7505 //Exit low optimization region - place directly after end of function definition
switches 0:5c4d7b2438d3 7506 #define LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7507
switches 0:5c4d7b2438d3 7508 //Enter low optimization region - place directly above function definition
switches 0:5c4d7b2438d3 7509 #ifdef ARM_MATH_CM4
switches 0:5c4d7b2438d3 7510 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
switches 0:5c4d7b2438d3 7511 _Pragma ("optimize=low")
switches 0:5c4d7b2438d3 7512 #else
switches 0:5c4d7b2438d3 7513 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7514 #endif
switches 0:5c4d7b2438d3 7515
switches 0:5c4d7b2438d3 7516 //Exit low optimization region - place directly after end of function definition
switches 0:5c4d7b2438d3 7517 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7518
switches 0:5c4d7b2438d3 7519 #elif defined(__GNUC__)
switches 0:5c4d7b2438d3 7520
switches 0:5c4d7b2438d3 7521 #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
switches 0:5c4d7b2438d3 7522
switches 0:5c4d7b2438d3 7523 #define LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7524
switches 0:5c4d7b2438d3 7525 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7526
switches 0:5c4d7b2438d3 7527 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7528
switches 0:5c4d7b2438d3 7529 #elif defined(__CSMC__) // Cosmic
switches 0:5c4d7b2438d3 7530
switches 0:5c4d7b2438d3 7531 #define LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7532 #define LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7533 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7534 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7535
switches 0:5c4d7b2438d3 7536 #elif defined(__TASKING__) // TASKING
switches 0:5c4d7b2438d3 7537
switches 0:5c4d7b2438d3 7538 #define LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7539 #define LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7540 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
switches 0:5c4d7b2438d3 7541 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
switches 0:5c4d7b2438d3 7542
switches 0:5c4d7b2438d3 7543 #endif
switches 0:5c4d7b2438d3 7544
switches 0:5c4d7b2438d3 7545
switches 0:5c4d7b2438d3 7546 #ifdef __cplusplus
switches 0:5c4d7b2438d3 7547 }
switches 0:5c4d7b2438d3 7548 #endif
switches 0:5c4d7b2438d3 7549
switches 0:5c4d7b2438d3 7550
switches 0:5c4d7b2438d3 7551 #endif /* _ARM_MATH_H */
switches 0:5c4d7b2438d3 7552
switches 0:5c4d7b2438d3 7553 /**
switches 0:5c4d7b2438d3 7554 *
switches 0:5c4d7b2438d3 7555 * End of file.
switches 0:5c4d7b2438d3 7556 */