inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

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