The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Anna Bridge
Date:
Wed Jan 17 16:13:02 2018 +0000
Revision:
160:5571c4ff569f
Parent:
148:fd96258d940d
mbed library. Release version 158

Who changed what in which revision?

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