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:
AnnaBridge
Date:
Fri Sep 15 14:46:57 2017 +0100
Revision:
151:675da3299148
Parent:
145:64910690c574
Release 151 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 132:9baf128c2fab 1 /* ----------------------------------------------------------------------
AnnaBridge 145:64910690c574 2 * Project: CMSIS DSP Library
AnnaBridge 145:64910690c574 3 * Title: arm_math.h
AnnaBridge 145:64910690c574 4 * Description: Public header file for CMSIS DSP Library
AnnaBridge 145:64910690c574 5 *
AnnaBridge 145:64910690c574 6 * $Date: 27. January 2017
AnnaBridge 145:64910690c574 7 * $Revision: V.1.5.1
AnnaBridge 145:64910690c574 8 *
AnnaBridge 145:64910690c574 9 * Target Processor: Cortex-M cores
<> 132:9baf128c2fab 10 * -------------------------------------------------------------------- */
AnnaBridge 145:64910690c574 11 /*
AnnaBridge 145:64910690c574 12 * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved.
AnnaBridge 145:64910690c574 13 *
AnnaBridge 145:64910690c574 14 * SPDX-License-Identifier: Apache-2.0
AnnaBridge 145:64910690c574 15 *
AnnaBridge 145:64910690c574 16 * Licensed under the Apache License, Version 2.0 (the License); you may
AnnaBridge 145:64910690c574 17 * not use this file except in compliance with the License.
AnnaBridge 145:64910690c574 18 * You may obtain a copy of the License at
AnnaBridge 145:64910690c574 19 *
AnnaBridge 145:64910690c574 20 * www.apache.org/licenses/LICENSE-2.0
AnnaBridge 145:64910690c574 21 *
AnnaBridge 145:64910690c574 22 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 145:64910690c574 23 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
AnnaBridge 145:64910690c574 24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 145:64910690c574 25 * See the License for the specific language governing permissions and
AnnaBridge 145:64910690c574 26 * limitations under the License.
AnnaBridge 145:64910690c574 27 */
<> 132:9baf128c2fab 28
<> 132:9baf128c2fab 29 /**
<> 132:9baf128c2fab 30 \mainpage CMSIS DSP Software Library
<> 132:9baf128c2fab 31 *
<> 132:9baf128c2fab 32 * Introduction
<> 132:9baf128c2fab 33 * ------------
<> 132:9baf128c2fab 34 *
<> 132:9baf128c2fab 35 * This user manual describes the CMSIS DSP software library,
<> 132:9baf128c2fab 36 * a suite of common signal processing functions for use on Cortex-M processor based devices.
<> 132:9baf128c2fab 37 *
<> 132:9baf128c2fab 38 * The library is divided into a number of functions each covering a specific category:
<> 132:9baf128c2fab 39 * - Basic math functions
<> 132:9baf128c2fab 40 * - Fast math functions
<> 132:9baf128c2fab 41 * - Complex math functions
<> 132:9baf128c2fab 42 * - Filters
<> 132:9baf128c2fab 43 * - Matrix functions
<> 132:9baf128c2fab 44 * - Transforms
<> 132:9baf128c2fab 45 * - Motor control functions
<> 132:9baf128c2fab 46 * - Statistical functions
<> 132:9baf128c2fab 47 * - Support functions
<> 132:9baf128c2fab 48 * - Interpolation functions
<> 132:9baf128c2fab 49 *
<> 132:9baf128c2fab 50 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
<> 132:9baf128c2fab 51 * 32-bit integer and 32-bit floating-point values.
<> 132:9baf128c2fab 52 *
<> 132:9baf128c2fab 53 * Using the Library
<> 132:9baf128c2fab 54 * ------------
<> 132:9baf128c2fab 55 *
<> 132:9baf128c2fab 56 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
AnnaBridge 145:64910690c574 57 * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit)
AnnaBridge 145:64910690c574 58 * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit)
AnnaBridge 145:64910690c574 59 * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit)
AnnaBridge 145:64910690c574 60 * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on)
AnnaBridge 145:64910690c574 61 * - arm_cortexM7l_math.lib (Cortex-M7, Little endian)
AnnaBridge 145:64910690c574 62 * - arm_cortexM7b_math.lib (Cortex-M7, Big endian)
AnnaBridge 145:64910690c574 63 * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit)
AnnaBridge 145:64910690c574 64 * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit)
AnnaBridge 145:64910690c574 65 * - arm_cortexM4l_math.lib (Cortex-M4, Little endian)
AnnaBridge 145:64910690c574 66 * - arm_cortexM4b_math.lib (Cortex-M4, Big endian)
AnnaBridge 145:64910690c574 67 * - arm_cortexM3l_math.lib (Cortex-M3, Little endian)
AnnaBridge 145:64910690c574 68 * - arm_cortexM3b_math.lib (Cortex-M3, Big endian)
AnnaBridge 145:64910690c574 69 * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian)
AnnaBridge 145:64910690c574 70 * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian)
AnnaBridge 145:64910690c574 71 * - arm_ARMv8MBLl_math.lib (ARMv8M Baseline, Little endian)
AnnaBridge 145:64910690c574 72 * - arm_ARMv8MMLl_math.lib (ARMv8M Mainline, Little endian)
AnnaBridge 145:64910690c574 73 * - arm_ARMv8MMLlfsp_math.lib (ARMv8M Mainline, Little endian, Single Precision Floating Point Unit)
AnnaBridge 145:64910690c574 74 * - arm_ARMv8MMLld_math.lib (ARMv8M Mainline, Little endian, DSP instructions)
AnnaBridge 145:64910690c574 75 * - arm_ARMv8MMLldfsp_math.lib (ARMv8M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit)
<> 132:9baf128c2fab 76 *
<> 132:9baf128c2fab 77 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
<> 132:9baf128c2fab 78 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
AnnaBridge 145:64910690c574 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.
<> 132:9baf128c2fab 80 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
<> 132:9baf128c2fab 81 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
AnnaBridge 145:64910690c574 82 * For ARMv8M cores define pre processor MACRO ARM_MATH_ARMV8MBL or ARM_MATH_ARMV8MML.
AnnaBridge 145:64910690c574 83 * Set Pre processor MACRO __DSP_PRESENT if ARMv8M Mainline core supports DSP instructions.
AnnaBridge 145:64910690c574 84 *
<> 132:9baf128c2fab 85 *
<> 132:9baf128c2fab 86 * Examples
<> 132:9baf128c2fab 87 * --------
<> 132:9baf128c2fab 88 *
<> 132:9baf128c2fab 89 * The library ships with a number of examples which demonstrate how to use the library functions.
<> 132:9baf128c2fab 90 *
<> 132:9baf128c2fab 91 * Toolchain Support
<> 132:9baf128c2fab 92 * ------------
<> 132:9baf128c2fab 93 *
<> 132:9baf128c2fab 94 * The library has been developed and tested with MDK-ARM version 5.14.0.0
<> 132:9baf128c2fab 95 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
<> 132:9baf128c2fab 96 *
<> 132:9baf128c2fab 97 * Building the Library
<> 132:9baf128c2fab 98 * ------------
<> 132:9baf128c2fab 99 *
<> 132:9baf128c2fab 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.
<> 132:9baf128c2fab 101 * - arm_cortexM_math.uvprojx
<> 132:9baf128c2fab 102 *
<> 132:9baf128c2fab 103 *
<> 132:9baf128c2fab 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.
<> 132:9baf128c2fab 105 *
<> 132:9baf128c2fab 106 * Pre-processor Macros
<> 132:9baf128c2fab 107 * ------------
<> 132:9baf128c2fab 108 *
<> 132:9baf128c2fab 109 * Each library project have differant pre-processor macros.
<> 132:9baf128c2fab 110 *
<> 132:9baf128c2fab 111 * - UNALIGNED_SUPPORT_DISABLE:
<> 132:9baf128c2fab 112 *
<> 132:9baf128c2fab 113 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
<> 132:9baf128c2fab 114 *
<> 132:9baf128c2fab 115 * - ARM_MATH_BIG_ENDIAN:
<> 132:9baf128c2fab 116 *
<> 132:9baf128c2fab 117 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
<> 132:9baf128c2fab 118 *
<> 132:9baf128c2fab 119 * - ARM_MATH_MATRIX_CHECK:
<> 132:9baf128c2fab 120 *
<> 132:9baf128c2fab 121 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
<> 132:9baf128c2fab 122 *
<> 132:9baf128c2fab 123 * - ARM_MATH_ROUNDING:
<> 132:9baf128c2fab 124 *
<> 132:9baf128c2fab 125 * Define macro ARM_MATH_ROUNDING for rounding on support functions
<> 132:9baf128c2fab 126 *
<> 132:9baf128c2fab 127 * - ARM_MATH_CMx:
<> 132:9baf128c2fab 128 *
<> 132:9baf128c2fab 129 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
<> 132:9baf128c2fab 130 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
<> 132:9baf128c2fab 131 * ARM_MATH_CM7 for building the library on cortex-M7.
<> 132:9baf128c2fab 132 *
AnnaBridge 145:64910690c574 133 * - ARM_MATH_ARMV8MxL:
AnnaBridge 145:64910690c574 134 *
AnnaBridge 145:64910690c574 135 * Define macro ARM_MATH_ARMV8MBL for building the library on ARMv8M Baseline target, ARM_MATH_ARMV8MBL for building library
AnnaBridge 145:64910690c574 136 * on ARMv8M Mainline target.
AnnaBridge 145:64910690c574 137 *
<> 132:9baf128c2fab 138 * - __FPU_PRESENT:
<> 132:9baf128c2fab 139 *
AnnaBridge 145:64910690c574 140 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for floating point libraries.
AnnaBridge 145:64910690c574 141 *
AnnaBridge 145:64910690c574 142 * - __DSP_PRESENT:
AnnaBridge 145:64910690c574 143 *
AnnaBridge 145:64910690c574 144 * Initialize macro __DSP_PRESENT = 1 when ARMv8M Mainline core supports DSP instructions.
<> 132:9baf128c2fab 145 *
<> 132:9baf128c2fab 146 * <hr>
<> 132:9baf128c2fab 147 * CMSIS-DSP in ARM::CMSIS Pack
<> 132:9baf128c2fab 148 * -----------------------------
AnnaBridge 145:64910690c574 149 *
<> 132:9baf128c2fab 150 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
<> 132:9baf128c2fab 151 * |File/Folder |Content |
<> 132:9baf128c2fab 152 * |------------------------------|------------------------------------------------------------------------|
<> 132:9baf128c2fab 153 * |\b CMSIS\\Documentation\\DSP | This documentation |
<> 132:9baf128c2fab 154 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
<> 132:9baf128c2fab 155 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
<> 132:9baf128c2fab 156 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
AnnaBridge 145:64910690c574 157 *
<> 132:9baf128c2fab 158 * <hr>
<> 132:9baf128c2fab 159 * Revision History of CMSIS-DSP
<> 132:9baf128c2fab 160 * ------------
<> 132:9baf128c2fab 161 * Please refer to \ref ChangeLog_pg.
<> 132:9baf128c2fab 162 *
<> 132:9baf128c2fab 163 * Copyright Notice
<> 132:9baf128c2fab 164 * ------------
<> 132:9baf128c2fab 165 *
<> 132:9baf128c2fab 166 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 132:9baf128c2fab 167 */
<> 132:9baf128c2fab 168
<> 132:9baf128c2fab 169
<> 132:9baf128c2fab 170 /**
<> 132:9baf128c2fab 171 * @defgroup groupMath Basic Math Functions
<> 132:9baf128c2fab 172 */
<> 132:9baf128c2fab 173
<> 132:9baf128c2fab 174 /**
<> 132:9baf128c2fab 175 * @defgroup groupFastMath Fast Math Functions
<> 132:9baf128c2fab 176 * This set of functions provides a fast approximation to sine, cosine, and square root.
<> 132:9baf128c2fab 177 * As compared to most of the other functions in the CMSIS math library, the fast math functions
<> 132:9baf128c2fab 178 * operate on individual values and not arrays.
<> 132:9baf128c2fab 179 * There are separate functions for Q15, Q31, and floating-point data.
<> 132:9baf128c2fab 180 *
<> 132:9baf128c2fab 181 */
<> 132:9baf128c2fab 182
<> 132:9baf128c2fab 183 /**
<> 132:9baf128c2fab 184 * @defgroup groupCmplxMath Complex Math Functions
<> 132:9baf128c2fab 185 * This set of functions operates on complex data vectors.
<> 132:9baf128c2fab 186 * The data in the complex arrays is stored in an interleaved fashion
<> 132:9baf128c2fab 187 * (real, imag, real, imag, ...).
<> 132:9baf128c2fab 188 * In the API functions, the number of samples in a complex array refers
<> 132:9baf128c2fab 189 * to the number of complex values; the array contains twice this number of
<> 132:9baf128c2fab 190 * real values.
<> 132:9baf128c2fab 191 */
<> 132:9baf128c2fab 192
<> 132:9baf128c2fab 193 /**
<> 132:9baf128c2fab 194 * @defgroup groupFilters Filtering Functions
<> 132:9baf128c2fab 195 */
<> 132:9baf128c2fab 196
<> 132:9baf128c2fab 197 /**
<> 132:9baf128c2fab 198 * @defgroup groupMatrix Matrix Functions
<> 132:9baf128c2fab 199 *
<> 132:9baf128c2fab 200 * This set of functions provides basic matrix math operations.
<> 132:9baf128c2fab 201 * The functions operate on matrix data structures. For example,
<> 132:9baf128c2fab 202 * the type
<> 132:9baf128c2fab 203 * definition for the floating-point matrix structure is shown
<> 132:9baf128c2fab 204 * below:
<> 132:9baf128c2fab 205 * <pre>
<> 132:9baf128c2fab 206 * typedef struct
<> 132:9baf128c2fab 207 * {
<> 132:9baf128c2fab 208 * uint16_t numRows; // number of rows of the matrix.
<> 132:9baf128c2fab 209 * uint16_t numCols; // number of columns of the matrix.
<> 132:9baf128c2fab 210 * float32_t *pData; // points to the data of the matrix.
<> 132:9baf128c2fab 211 * } arm_matrix_instance_f32;
<> 132:9baf128c2fab 212 * </pre>
<> 132:9baf128c2fab 213 * There are similar definitions for Q15 and Q31 data types.
<> 132:9baf128c2fab 214 *
<> 132:9baf128c2fab 215 * The structure specifies the size of the matrix and then points to
<> 132:9baf128c2fab 216 * an array of data. The array is of size <code>numRows X numCols</code>
<> 132:9baf128c2fab 217 * and the values are arranged in row order. That is, the
<> 132:9baf128c2fab 218 * matrix element (i, j) is stored at:
<> 132:9baf128c2fab 219 * <pre>
<> 132:9baf128c2fab 220 * pData[i*numCols + j]
<> 132:9baf128c2fab 221 * </pre>
<> 132:9baf128c2fab 222 *
<> 132:9baf128c2fab 223 * \par Init Functions
<> 132:9baf128c2fab 224 * There is an associated initialization function for each type of matrix
<> 132:9baf128c2fab 225 * data structure.
<> 132:9baf128c2fab 226 * The initialization function sets the values of the internal structure fields.
<> 132:9baf128c2fab 227 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
<> 132:9baf128c2fab 228 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
<> 132:9baf128c2fab 229 *
<> 132:9baf128c2fab 230 * \par
<> 132:9baf128c2fab 231 * Use of the initialization function is optional. However, if initialization function is used
<> 132:9baf128c2fab 232 * then the instance structure cannot be placed into a const data section.
<> 132:9baf128c2fab 233 * To place the instance structure in a const data
<> 132:9baf128c2fab 234 * section, manually initialize the data structure. For example:
<> 132:9baf128c2fab 235 * <pre>
<> 132:9baf128c2fab 236 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
<> 132:9baf128c2fab 237 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
<> 132:9baf128c2fab 238 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
<> 132:9baf128c2fab 239 * </pre>
<> 132:9baf128c2fab 240 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
<> 132:9baf128c2fab 241 * specifies the number of columns, and <code>pData</code> points to the
<> 132:9baf128c2fab 242 * data array.
<> 132:9baf128c2fab 243 *
<> 132:9baf128c2fab 244 * \par Size Checking
<> 132:9baf128c2fab 245 * By default all of the matrix functions perform size checking on the input and
<> 132:9baf128c2fab 246 * output matrices. For example, the matrix addition function verifies that the
<> 132:9baf128c2fab 247 * two input matrices and the output matrix all have the same number of rows and
<> 132:9baf128c2fab 248 * columns. If the size check fails the functions return:
<> 132:9baf128c2fab 249 * <pre>
<> 132:9baf128c2fab 250 * ARM_MATH_SIZE_MISMATCH
<> 132:9baf128c2fab 251 * </pre>
<> 132:9baf128c2fab 252 * Otherwise the functions return
<> 132:9baf128c2fab 253 * <pre>
<> 132:9baf128c2fab 254 * ARM_MATH_SUCCESS
<> 132:9baf128c2fab 255 * </pre>
<> 132:9baf128c2fab 256 * There is some overhead associated with this matrix size checking.
<> 132:9baf128c2fab 257 * The matrix size checking is enabled via the \#define
<> 132:9baf128c2fab 258 * <pre>
<> 132:9baf128c2fab 259 * ARM_MATH_MATRIX_CHECK
<> 132:9baf128c2fab 260 * </pre>
<> 132:9baf128c2fab 261 * within the library project settings. By default this macro is defined
<> 132:9baf128c2fab 262 * and size checking is enabled. By changing the project settings and
<> 132:9baf128c2fab 263 * undefining this macro size checking is eliminated and the functions
<> 132:9baf128c2fab 264 * run a bit faster. With size checking disabled the functions always
<> 132:9baf128c2fab 265 * return <code>ARM_MATH_SUCCESS</code>.
<> 132:9baf128c2fab 266 */
<> 132:9baf128c2fab 267
<> 132:9baf128c2fab 268 /**
<> 132:9baf128c2fab 269 * @defgroup groupTransforms Transform Functions
<> 132:9baf128c2fab 270 */
<> 132:9baf128c2fab 271
<> 132:9baf128c2fab 272 /**
<> 132:9baf128c2fab 273 * @defgroup groupController Controller Functions
<> 132:9baf128c2fab 274 */
<> 132:9baf128c2fab 275
<> 132:9baf128c2fab 276 /**
<> 132:9baf128c2fab 277 * @defgroup groupStats Statistics Functions
<> 132:9baf128c2fab 278 */
<> 132:9baf128c2fab 279 /**
<> 132:9baf128c2fab 280 * @defgroup groupSupport Support Functions
<> 132:9baf128c2fab 281 */
<> 132:9baf128c2fab 282
<> 132:9baf128c2fab 283 /**
<> 132:9baf128c2fab 284 * @defgroup groupInterpolation Interpolation Functions
<> 132:9baf128c2fab 285 * These functions perform 1- and 2-dimensional interpolation of data.
<> 132:9baf128c2fab 286 * Linear interpolation is used for 1-dimensional data and
<> 132:9baf128c2fab 287 * bilinear interpolation is used for 2-dimensional data.
<> 132:9baf128c2fab 288 */
<> 132:9baf128c2fab 289
<> 132:9baf128c2fab 290 /**
<> 132:9baf128c2fab 291 * @defgroup groupExamples Examples
<> 132:9baf128c2fab 292 */
<> 132:9baf128c2fab 293 #ifndef _ARM_MATH_H
<> 132:9baf128c2fab 294 #define _ARM_MATH_H
<> 132:9baf128c2fab 295
AnnaBridge 145:64910690c574 296 /* Compiler specific diagnostic adjustment */
AnnaBridge 145:64910690c574 297 #if defined ( __CC_ARM )
AnnaBridge 145:64910690c574 298
AnnaBridge 145:64910690c574 299 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 )
AnnaBridge 145:64910690c574 300
AnnaBridge 145:64910690c574 301 #elif defined ( __GNUC__ )
AnnaBridge 145:64910690c574 302 #pragma GCC diagnostic push
AnnaBridge 145:64910690c574 303 #pragma GCC diagnostic ignored "-Wsign-conversion"
AnnaBridge 145:64910690c574 304 #pragma GCC diagnostic ignored "-Wconversion"
AnnaBridge 145:64910690c574 305 #pragma GCC diagnostic ignored "-Wunused-parameter"
AnnaBridge 145:64910690c574 306
AnnaBridge 145:64910690c574 307 #elif defined ( __ICCARM__ )
AnnaBridge 145:64910690c574 308
AnnaBridge 145:64910690c574 309 #elif defined ( __TI_ARM__ )
AnnaBridge 145:64910690c574 310
AnnaBridge 145:64910690c574 311 #elif defined ( __CSMC__ )
AnnaBridge 145:64910690c574 312
AnnaBridge 145:64910690c574 313 #elif defined ( __TASKING__ )
AnnaBridge 145:64910690c574 314
AnnaBridge 145:64910690c574 315 #else
AnnaBridge 145:64910690c574 316 #error Unknown compiler
AnnaBridge 145:64910690c574 317 #endif
AnnaBridge 145:64910690c574 318
AnnaBridge 145:64910690c574 319
<> 132:9baf128c2fab 320 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
<> 132:9baf128c2fab 321
<> 132:9baf128c2fab 322 #if defined(ARM_MATH_CM7)
<> 132:9baf128c2fab 323 #include "core_cm7.h"
AnnaBridge 145:64910690c574 324 #define ARM_MATH_DSP
<> 132:9baf128c2fab 325 #elif defined (ARM_MATH_CM4)
<> 132:9baf128c2fab 326 #include "core_cm4.h"
AnnaBridge 145:64910690c574 327 #define ARM_MATH_DSP
<> 132:9baf128c2fab 328 #elif defined (ARM_MATH_CM3)
<> 132:9baf128c2fab 329 #include "core_cm3.h"
<> 132:9baf128c2fab 330 #elif defined (ARM_MATH_CM0)
<> 132:9baf128c2fab 331 #include "core_cm0.h"
AnnaBridge 145:64910690c574 332 #define ARM_MATH_CM0_FAMILY
AnnaBridge 145:64910690c574 333 #elif defined (ARM_MATH_CM0PLUS)
AnnaBridge 145:64910690c574 334 #include "core_cm0plus.h"
AnnaBridge 145:64910690c574 335 #define ARM_MATH_CM0_FAMILY
AnnaBridge 145:64910690c574 336 #elif defined (ARM_MATH_ARMV8MBL)
AnnaBridge 145:64910690c574 337 #include "core_armv8mbl.h"
<> 132:9baf128c2fab 338 #define ARM_MATH_CM0_FAMILY
AnnaBridge 145:64910690c574 339 #elif defined (ARM_MATH_ARMV8MML)
AnnaBridge 145:64910690c574 340 #include "core_armv8mml.h"
AnnaBridge 145:64910690c574 341 #if (defined (__DSP_PRESENT) && (__DSP_PRESENT == 1))
AnnaBridge 145:64910690c574 342 #define ARM_MATH_DSP
AnnaBridge 145:64910690c574 343 #endif
<> 132:9baf128c2fab 344 #else
AnnaBridge 145:64910690c574 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"
<> 132:9baf128c2fab 346 #endif
<> 132:9baf128c2fab 347
<> 132:9baf128c2fab 348 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
<> 132:9baf128c2fab 349 #include "string.h"
<> 132:9baf128c2fab 350 #include "math.h"
AnnaBridge 145:64910690c574 351 #ifdef __cplusplus
<> 132:9baf128c2fab 352 extern "C"
<> 132:9baf128c2fab 353 {
<> 132:9baf128c2fab 354 #endif
<> 132:9baf128c2fab 355
<> 132:9baf128c2fab 356
<> 132:9baf128c2fab 357 /**
<> 132:9baf128c2fab 358 * @brief Macros required for reciprocal calculation in Normalized LMS
<> 132:9baf128c2fab 359 */
<> 132:9baf128c2fab 360
AnnaBridge 145:64910690c574 361 #define DELTA_Q31 (0x100)
AnnaBridge 145:64910690c574 362 #define DELTA_Q15 0x5
AnnaBridge 145:64910690c574 363 #define INDEX_MASK 0x0000003F
<> 132:9baf128c2fab 364 #ifndef PI
AnnaBridge 145:64910690c574 365 #define PI 3.14159265358979f
<> 132:9baf128c2fab 366 #endif
<> 132:9baf128c2fab 367
<> 132:9baf128c2fab 368 /**
<> 132:9baf128c2fab 369 * @brief Macros required for SINE and COSINE Fast math approximations
<> 132:9baf128c2fab 370 */
<> 132:9baf128c2fab 371
<> 132:9baf128c2fab 372 #define FAST_MATH_TABLE_SIZE 512
<> 132:9baf128c2fab 373 #define FAST_MATH_Q31_SHIFT (32 - 10)
<> 132:9baf128c2fab 374 #define FAST_MATH_Q15_SHIFT (16 - 10)
<> 132:9baf128c2fab 375 #define CONTROLLER_Q31_SHIFT (32 - 9)
AnnaBridge 145:64910690c574 376 #define TABLE_SPACING_Q31 0x400000
AnnaBridge 145:64910690c574 377 #define TABLE_SPACING_Q15 0x80
<> 132:9baf128c2fab 378
<> 132:9baf128c2fab 379 /**
<> 132:9baf128c2fab 380 * @brief Macros required for SINE and COSINE Controller functions
<> 132:9baf128c2fab 381 */
<> 132:9baf128c2fab 382 /* 1.31(q31) Fixed value of 2/360 */
<> 132:9baf128c2fab 383 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
AnnaBridge 145:64910690c574 384 #define INPUT_SPACING 0xB60B61
<> 132:9baf128c2fab 385
<> 132:9baf128c2fab 386 /**
<> 132:9baf128c2fab 387 * @brief Macro for Unaligned Support
<> 132:9baf128c2fab 388 */
<> 132:9baf128c2fab 389 #ifndef UNALIGNED_SUPPORT_DISABLE
<> 132:9baf128c2fab 390 #define ALIGN4
<> 132:9baf128c2fab 391 #else
<> 132:9baf128c2fab 392 #if defined (__GNUC__)
<> 132:9baf128c2fab 393 #define ALIGN4 __attribute__((aligned(4)))
<> 132:9baf128c2fab 394 #else
<> 132:9baf128c2fab 395 #define ALIGN4 __align(4)
<> 132:9baf128c2fab 396 #endif
AnnaBridge 145:64910690c574 397 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
<> 132:9baf128c2fab 398
<> 132:9baf128c2fab 399 /**
<> 132:9baf128c2fab 400 * @brief Error status returned by some functions in the library.
<> 132:9baf128c2fab 401 */
<> 132:9baf128c2fab 402
<> 132:9baf128c2fab 403 typedef enum
<> 132:9baf128c2fab 404 {
<> 132:9baf128c2fab 405 ARM_MATH_SUCCESS = 0, /**< No error */
<> 132:9baf128c2fab 406 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
<> 132:9baf128c2fab 407 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
<> 132:9baf128c2fab 408 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
<> 132:9baf128c2fab 409 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
<> 132:9baf128c2fab 410 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
<> 132:9baf128c2fab 411 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
<> 132:9baf128c2fab 412 } arm_status;
<> 132:9baf128c2fab 413
<> 132:9baf128c2fab 414 /**
<> 132:9baf128c2fab 415 * @brief 8-bit fractional data type in 1.7 format.
<> 132:9baf128c2fab 416 */
<> 132:9baf128c2fab 417 typedef int8_t q7_t;
<> 132:9baf128c2fab 418
<> 132:9baf128c2fab 419 /**
<> 132:9baf128c2fab 420 * @brief 16-bit fractional data type in 1.15 format.
<> 132:9baf128c2fab 421 */
<> 132:9baf128c2fab 422 typedef int16_t q15_t;
<> 132:9baf128c2fab 423
<> 132:9baf128c2fab 424 /**
<> 132:9baf128c2fab 425 * @brief 32-bit fractional data type in 1.31 format.
<> 132:9baf128c2fab 426 */
<> 132:9baf128c2fab 427 typedef int32_t q31_t;
<> 132:9baf128c2fab 428
<> 132:9baf128c2fab 429 /**
<> 132:9baf128c2fab 430 * @brief 64-bit fractional data type in 1.63 format.
<> 132:9baf128c2fab 431 */
<> 132:9baf128c2fab 432 typedef int64_t q63_t;
<> 132:9baf128c2fab 433
<> 132:9baf128c2fab 434 /**
<> 132:9baf128c2fab 435 * @brief 32-bit floating-point type definition.
<> 132:9baf128c2fab 436 */
<> 132:9baf128c2fab 437 typedef float float32_t;
<> 132:9baf128c2fab 438
<> 132:9baf128c2fab 439 /**
<> 132:9baf128c2fab 440 * @brief 64-bit floating-point type definition.
<> 132:9baf128c2fab 441 */
<> 132:9baf128c2fab 442 typedef double float64_t;
<> 132:9baf128c2fab 443
<> 132:9baf128c2fab 444 /**
<> 132:9baf128c2fab 445 * @brief definition to read/write two 16 bit values.
<> 132:9baf128c2fab 446 */
AnnaBridge 145:64910690c574 447 #if defined ( __CC_ARM )
<> 132:9baf128c2fab 448 #define __SIMD32_TYPE int32_t __packed
<> 132:9baf128c2fab 449 #define CMSIS_UNUSED __attribute__((unused))
AnnaBridge 145:64910690c574 450 #define CMSIS_INLINE __attribute__((always_inline))
AnnaBridge 145:64910690c574 451
AnnaBridge 145:64910690c574 452 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 )
AnnaBridge 145:64910690c574 453 #define __SIMD32_TYPE int32_t
AnnaBridge 145:64910690c574 454 #define CMSIS_UNUSED __attribute__((unused))
AnnaBridge 145:64910690c574 455 #define CMSIS_INLINE __attribute__((always_inline))
AnnaBridge 145:64910690c574 456
AnnaBridge 145:64910690c574 457 #elif defined ( __GNUC__ )
AnnaBridge 145:64910690c574 458 #define __SIMD32_TYPE int32_t
AnnaBridge 145:64910690c574 459 #define CMSIS_UNUSED __attribute__((unused))
AnnaBridge 145:64910690c574 460 #define CMSIS_INLINE __attribute__((always_inline))
AnnaBridge 145:64910690c574 461
AnnaBridge 145:64910690c574 462 #elif defined ( __ICCARM__ )
<> 132:9baf128c2fab 463 #define __SIMD32_TYPE int32_t __packed
<> 132:9baf128c2fab 464 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 465 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 466
AnnaBridge 145:64910690c574 467 #elif defined ( __TI_ARM__ )
<> 132:9baf128c2fab 468 #define __SIMD32_TYPE int32_t
<> 132:9baf128c2fab 469 #define CMSIS_UNUSED __attribute__((unused))
AnnaBridge 145:64910690c574 470 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 471
AnnaBridge 145:64910690c574 472 #elif defined ( __CSMC__ )
<> 132:9baf128c2fab 473 #define __SIMD32_TYPE int32_t
<> 132:9baf128c2fab 474 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 475 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 476
AnnaBridge 145:64910690c574 477 #elif defined ( __TASKING__ )
<> 132:9baf128c2fab 478 #define __SIMD32_TYPE __unaligned int32_t
<> 132:9baf128c2fab 479 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 480 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 481
<> 132:9baf128c2fab 482 #else
<> 132:9baf128c2fab 483 #error Unknown compiler
<> 132:9baf128c2fab 484 #endif
<> 132:9baf128c2fab 485
AnnaBridge 145:64910690c574 486 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
<> 132:9baf128c2fab 487 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
<> 132:9baf128c2fab 488 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
AnnaBridge 145:64910690c574 489 #define __SIMD64(addr) (*(int64_t **) & (addr))
AnnaBridge 145:64910690c574 490
AnnaBridge 145:64910690c574 491 /* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
AnnaBridge 145:64910690c574 492 #if !defined (ARM_MATH_DSP)
<> 132:9baf128c2fab 493 /**
<> 132:9baf128c2fab 494 * @brief definition to pack two 16 bit values.
<> 132:9baf128c2fab 495 */
AnnaBridge 145:64910690c574 496 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
AnnaBridge 145:64910690c574 497 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
AnnaBridge 145:64910690c574 498 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
AnnaBridge 145:64910690c574 499 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
AnnaBridge 145:64910690c574 500
AnnaBridge 145:64910690c574 501 /* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
AnnaBridge 145:64910690c574 502 #endif /* !defined (ARM_MATH_DSP) */
<> 132:9baf128c2fab 503
<> 132:9baf128c2fab 504 /**
<> 132:9baf128c2fab 505 * @brief definition to pack four 8 bit values.
<> 132:9baf128c2fab 506 */
<> 132:9baf128c2fab 507 #ifndef ARM_MATH_BIG_ENDIAN
<> 132:9baf128c2fab 508
AnnaBridge 145:64910690c574 509 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
AnnaBridge 145:64910690c574 510 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
AnnaBridge 145:64910690c574 511 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
AnnaBridge 145:64910690c574 512 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
<> 132:9baf128c2fab 513 #else
<> 132:9baf128c2fab 514
AnnaBridge 145:64910690c574 515 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
AnnaBridge 145:64910690c574 516 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
AnnaBridge 145:64910690c574 517 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
AnnaBridge 145:64910690c574 518 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
<> 132:9baf128c2fab 519
<> 132:9baf128c2fab 520 #endif
<> 132:9baf128c2fab 521
<> 132:9baf128c2fab 522
<> 132:9baf128c2fab 523 /**
<> 132:9baf128c2fab 524 * @brief Clips Q63 to Q31 values.
<> 132:9baf128c2fab 525 */
AnnaBridge 145:64910690c574 526 CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31(
<> 132:9baf128c2fab 527 q63_t x)
<> 132:9baf128c2fab 528 {
<> 132:9baf128c2fab 529 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 132:9baf128c2fab 530 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
<> 132:9baf128c2fab 531 }
<> 132:9baf128c2fab 532
<> 132:9baf128c2fab 533 /**
<> 132:9baf128c2fab 534 * @brief Clips Q63 to Q15 values.
<> 132:9baf128c2fab 535 */
AnnaBridge 145:64910690c574 536 CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15(
<> 132:9baf128c2fab 537 q63_t x)
<> 132:9baf128c2fab 538 {
<> 132:9baf128c2fab 539 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 132:9baf128c2fab 540 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
<> 132:9baf128c2fab 541 }
<> 132:9baf128c2fab 542
<> 132:9baf128c2fab 543 /**
<> 132:9baf128c2fab 544 * @brief Clips Q31 to Q7 values.
<> 132:9baf128c2fab 545 */
AnnaBridge 145:64910690c574 546 CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7(
<> 132:9baf128c2fab 547 q31_t x)
<> 132:9baf128c2fab 548 {
<> 132:9baf128c2fab 549 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
<> 132:9baf128c2fab 550 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
<> 132:9baf128c2fab 551 }
<> 132:9baf128c2fab 552
<> 132:9baf128c2fab 553 /**
<> 132:9baf128c2fab 554 * @brief Clips Q31 to Q15 values.
<> 132:9baf128c2fab 555 */
AnnaBridge 145:64910690c574 556 CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15(
<> 132:9baf128c2fab 557 q31_t x)
<> 132:9baf128c2fab 558 {
<> 132:9baf128c2fab 559 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
<> 132:9baf128c2fab 560 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
<> 132:9baf128c2fab 561 }
<> 132:9baf128c2fab 562
<> 132:9baf128c2fab 563 /**
<> 132:9baf128c2fab 564 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
<> 132:9baf128c2fab 565 */
<> 132:9baf128c2fab 566
AnnaBridge 145:64910690c574 567 CMSIS_INLINE __STATIC_INLINE q63_t mult32x64(
<> 132:9baf128c2fab 568 q63_t x,
<> 132:9baf128c2fab 569 q31_t y)
<> 132:9baf128c2fab 570 {
<> 132:9baf128c2fab 571 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
<> 132:9baf128c2fab 572 (((q63_t) (x >> 32) * y)));
<> 132:9baf128c2fab 573 }
<> 132:9baf128c2fab 574
AnnaBridge 145:64910690c574 575 /*
AnnaBridge 145:64910690c574 576 #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
AnnaBridge 145:64910690c574 577 #define __CLZ __clz
AnnaBridge 145:64910690c574 578 #endif
AnnaBridge 145:64910690c574 579 */
AnnaBridge 145:64910690c574 580 /* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
<> 132:9baf128c2fab 581 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
AnnaBridge 145:64910690c574 582 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
<> 132:9baf128c2fab 583 q31_t data);
<> 132:9baf128c2fab 584
AnnaBridge 145:64910690c574 585 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
<> 132:9baf128c2fab 586 q31_t data)
<> 132:9baf128c2fab 587 {
<> 132:9baf128c2fab 588 uint32_t count = 0;
<> 132:9baf128c2fab 589 uint32_t mask = 0x80000000;
<> 132:9baf128c2fab 590
AnnaBridge 145:64910690c574 591 while ((data & mask) == 0)
<> 132:9baf128c2fab 592 {
<> 132:9baf128c2fab 593 count += 1u;
<> 132:9baf128c2fab 594 mask = mask >> 1u;
<> 132:9baf128c2fab 595 }
<> 132:9baf128c2fab 596
<> 132:9baf128c2fab 597 return (count);
<> 132:9baf128c2fab 598 }
<> 132:9baf128c2fab 599 #endif
<> 132:9baf128c2fab 600
<> 132:9baf128c2fab 601 /**
<> 132:9baf128c2fab 602 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
<> 132:9baf128c2fab 603 */
<> 132:9baf128c2fab 604
AnnaBridge 145:64910690c574 605 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31(
<> 132:9baf128c2fab 606 q31_t in,
<> 132:9baf128c2fab 607 q31_t * dst,
<> 132:9baf128c2fab 608 q31_t * pRecipTable)
<> 132:9baf128c2fab 609 {
AnnaBridge 145:64910690c574 610 q31_t out;
AnnaBridge 145:64910690c574 611 uint32_t tempVal;
<> 132:9baf128c2fab 612 uint32_t index, i;
<> 132:9baf128c2fab 613 uint32_t signBits;
<> 132:9baf128c2fab 614
AnnaBridge 145:64910690c574 615 if (in > 0)
<> 132:9baf128c2fab 616 {
AnnaBridge 145:64910690c574 617 signBits = ((uint32_t) (__CLZ( in) - 1));
<> 132:9baf128c2fab 618 }
<> 132:9baf128c2fab 619 else
<> 132:9baf128c2fab 620 {
AnnaBridge 145:64910690c574 621 signBits = ((uint32_t) (__CLZ(-in) - 1));
<> 132:9baf128c2fab 622 }
<> 132:9baf128c2fab 623
<> 132:9baf128c2fab 624 /* Convert input sample to 1.31 format */
AnnaBridge 145:64910690c574 625 in = (in << signBits);
<> 132:9baf128c2fab 626
<> 132:9baf128c2fab 627 /* calculation of index for initial approximated Val */
AnnaBridge 145:64910690c574 628 index = (uint32_t)(in >> 24);
<> 132:9baf128c2fab 629 index = (index & INDEX_MASK);
<> 132:9baf128c2fab 630
<> 132:9baf128c2fab 631 /* 1.31 with exp 1 */
<> 132:9baf128c2fab 632 out = pRecipTable[index];
<> 132:9baf128c2fab 633
<> 132:9baf128c2fab 634 /* calculation of reciprocal value */
<> 132:9baf128c2fab 635 /* running approximation for two iterations */
<> 132:9baf128c2fab 636 for (i = 0u; i < 2u; i++)
<> 132:9baf128c2fab 637 {
AnnaBridge 145:64910690c574 638 tempVal = (uint32_t) (((q63_t) in * out) >> 31);
AnnaBridge 145:64910690c574 639 tempVal = 0x7FFFFFFFu - tempVal;
<> 132:9baf128c2fab 640 /* 1.31 with exp 1 */
AnnaBridge 145:64910690c574 641 /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */
AnnaBridge 145:64910690c574 642 out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30);
<> 132:9baf128c2fab 643 }
<> 132:9baf128c2fab 644
<> 132:9baf128c2fab 645 /* write output */
<> 132:9baf128c2fab 646 *dst = out;
<> 132:9baf128c2fab 647
<> 132:9baf128c2fab 648 /* return num of signbits of out = 1/in value */
<> 132:9baf128c2fab 649 return (signBits + 1u);
<> 132:9baf128c2fab 650 }
<> 132:9baf128c2fab 651
AnnaBridge 145:64910690c574 652
<> 132:9baf128c2fab 653 /**
<> 132:9baf128c2fab 654 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
<> 132:9baf128c2fab 655 */
AnnaBridge 145:64910690c574 656 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15(
<> 132:9baf128c2fab 657 q15_t in,
<> 132:9baf128c2fab 658 q15_t * dst,
<> 132:9baf128c2fab 659 q15_t * pRecipTable)
<> 132:9baf128c2fab 660 {
AnnaBridge 145:64910690c574 661 q15_t out = 0;
AnnaBridge 145:64910690c574 662 uint32_t tempVal = 0;
<> 132:9baf128c2fab 663 uint32_t index = 0, i = 0;
<> 132:9baf128c2fab 664 uint32_t signBits = 0;
<> 132:9baf128c2fab 665
AnnaBridge 145:64910690c574 666 if (in > 0)
<> 132:9baf128c2fab 667 {
AnnaBridge 145:64910690c574 668 signBits = ((uint32_t)(__CLZ( in) - 17));
<> 132:9baf128c2fab 669 }
<> 132:9baf128c2fab 670 else
<> 132:9baf128c2fab 671 {
AnnaBridge 145:64910690c574 672 signBits = ((uint32_t)(__CLZ(-in) - 17));
<> 132:9baf128c2fab 673 }
<> 132:9baf128c2fab 674
<> 132:9baf128c2fab 675 /* Convert input sample to 1.15 format */
AnnaBridge 145:64910690c574 676 in = (in << signBits);
<> 132:9baf128c2fab 677
<> 132:9baf128c2fab 678 /* calculation of index for initial approximated Val */
AnnaBridge 145:64910690c574 679 index = (uint32_t)(in >> 8);
<> 132:9baf128c2fab 680 index = (index & INDEX_MASK);
<> 132:9baf128c2fab 681
<> 132:9baf128c2fab 682 /* 1.15 with exp 1 */
<> 132:9baf128c2fab 683 out = pRecipTable[index];
<> 132:9baf128c2fab 684
<> 132:9baf128c2fab 685 /* calculation of reciprocal value */
<> 132:9baf128c2fab 686 /* running approximation for two iterations */
AnnaBridge 145:64910690c574 687 for (i = 0u; i < 2u; i++)
<> 132:9baf128c2fab 688 {
AnnaBridge 145:64910690c574 689 tempVal = (uint32_t) (((q31_t) in * out) >> 15);
AnnaBridge 145:64910690c574 690 tempVal = 0x7FFFu - tempVal;
<> 132:9baf128c2fab 691 /* 1.15 with exp 1 */
<> 132:9baf128c2fab 692 out = (q15_t) (((q31_t) out * tempVal) >> 14);
AnnaBridge 145:64910690c574 693 /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */
<> 132:9baf128c2fab 694 }
<> 132:9baf128c2fab 695
<> 132:9baf128c2fab 696 /* write output */
<> 132:9baf128c2fab 697 *dst = out;
<> 132:9baf128c2fab 698
<> 132:9baf128c2fab 699 /* return num of signbits of out = 1/in value */
<> 132:9baf128c2fab 700 return (signBits + 1);
<> 132:9baf128c2fab 701 }
<> 132:9baf128c2fab 702
<> 132:9baf128c2fab 703
<> 132:9baf128c2fab 704 /*
<> 132:9baf128c2fab 705 * @brief C custom defined intrinisic function for only M0 processors
<> 132:9baf128c2fab 706 */
<> 132:9baf128c2fab 707 #if defined(ARM_MATH_CM0_FAMILY)
AnnaBridge 145:64910690c574 708 CMSIS_INLINE __STATIC_INLINE q31_t __SSAT(
<> 132:9baf128c2fab 709 q31_t x,
<> 132:9baf128c2fab 710 uint32_t y)
<> 132:9baf128c2fab 711 {
<> 132:9baf128c2fab 712 int32_t posMax, negMin;
<> 132:9baf128c2fab 713 uint32_t i;
<> 132:9baf128c2fab 714
<> 132:9baf128c2fab 715 posMax = 1;
<> 132:9baf128c2fab 716 for (i = 0; i < (y - 1); i++)
<> 132:9baf128c2fab 717 {
<> 132:9baf128c2fab 718 posMax = posMax * 2;
<> 132:9baf128c2fab 719 }
<> 132:9baf128c2fab 720
AnnaBridge 145:64910690c574 721 if (x > 0)
<> 132:9baf128c2fab 722 {
<> 132:9baf128c2fab 723 posMax = (posMax - 1);
<> 132:9baf128c2fab 724
AnnaBridge 145:64910690c574 725 if (x > posMax)
<> 132:9baf128c2fab 726 {
<> 132:9baf128c2fab 727 x = posMax;
<> 132:9baf128c2fab 728 }
<> 132:9baf128c2fab 729 }
<> 132:9baf128c2fab 730 else
<> 132:9baf128c2fab 731 {
<> 132:9baf128c2fab 732 negMin = -posMax;
<> 132:9baf128c2fab 733
AnnaBridge 145:64910690c574 734 if (x < negMin)
<> 132:9baf128c2fab 735 {
<> 132:9baf128c2fab 736 x = negMin;
<> 132:9baf128c2fab 737 }
<> 132:9baf128c2fab 738 }
<> 132:9baf128c2fab 739 return (x);
<> 132:9baf128c2fab 740 }
<> 132:9baf128c2fab 741 #endif /* end of ARM_MATH_CM0_FAMILY */
<> 132:9baf128c2fab 742
<> 132:9baf128c2fab 743
<> 132:9baf128c2fab 744 /*
<> 132:9baf128c2fab 745 * @brief C custom defined intrinsic function for M3 and M0 processors
<> 132:9baf128c2fab 746 */
AnnaBridge 145:64910690c574 747 /* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
AnnaBridge 145:64910690c574 748 #if !defined (ARM_MATH_DSP)
<> 132:9baf128c2fab 749
<> 132:9baf128c2fab 750 /*
<> 132:9baf128c2fab 751 * @brief C custom defined QADD8 for M3 and M0 processors
<> 132:9baf128c2fab 752 */
AnnaBridge 145:64910690c574 753 CMSIS_INLINE __STATIC_INLINE uint32_t __QADD8(
AnnaBridge 145:64910690c574 754 uint32_t x,
AnnaBridge 145:64910690c574 755 uint32_t y)
<> 132:9baf128c2fab 756 {
AnnaBridge 145:64910690c574 757 q31_t r, s, t, u;
AnnaBridge 145:64910690c574 758
AnnaBridge 145:64910690c574 759 r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 760 s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 761 t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 762 u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 763
AnnaBridge 145:64910690c574 764 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
<> 132:9baf128c2fab 765 }
<> 132:9baf128c2fab 766
AnnaBridge 145:64910690c574 767
<> 132:9baf128c2fab 768 /*
<> 132:9baf128c2fab 769 * @brief C custom defined QSUB8 for M3 and M0 processors
<> 132:9baf128c2fab 770 */
AnnaBridge 145:64910690c574 771 CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB8(
AnnaBridge 145:64910690c574 772 uint32_t x,
AnnaBridge 145:64910690c574 773 uint32_t y)
<> 132:9baf128c2fab 774 {
<> 132:9baf128c2fab 775 q31_t r, s, t, u;
<> 132:9baf128c2fab 776
AnnaBridge 145:64910690c574 777 r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 778 s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 779 t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 780 u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
AnnaBridge 145:64910690c574 781
AnnaBridge 145:64910690c574 782 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
<> 132:9baf128c2fab 783 }
<> 132:9baf128c2fab 784
AnnaBridge 145:64910690c574 785
<> 132:9baf128c2fab 786 /*
<> 132:9baf128c2fab 787 * @brief C custom defined QADD16 for M3 and M0 processors
<> 132:9baf128c2fab 788 */
AnnaBridge 145:64910690c574 789 CMSIS_INLINE __STATIC_INLINE uint32_t __QADD16(
AnnaBridge 145:64910690c574 790 uint32_t x,
AnnaBridge 145:64910690c574 791 uint32_t y)
<> 132:9baf128c2fab 792 {
AnnaBridge 145:64910690c574 793 /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */
AnnaBridge 145:64910690c574 794 q31_t r = 0, s = 0;
AnnaBridge 145:64910690c574 795
AnnaBridge 145:64910690c574 796 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 797 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 798
AnnaBridge 145:64910690c574 799 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 800 }
<> 132:9baf128c2fab 801
AnnaBridge 145:64910690c574 802
<> 132:9baf128c2fab 803 /*
<> 132:9baf128c2fab 804 * @brief C custom defined SHADD16 for M3 and M0 processors
<> 132:9baf128c2fab 805 */
AnnaBridge 145:64910690c574 806 CMSIS_INLINE __STATIC_INLINE uint32_t __SHADD16(
AnnaBridge 145:64910690c574 807 uint32_t x,
AnnaBridge 145:64910690c574 808 uint32_t y)
<> 132:9baf128c2fab 809 {
<> 132:9baf128c2fab 810 q31_t r, s;
<> 132:9baf128c2fab 811
AnnaBridge 145:64910690c574 812 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 813 s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 814
AnnaBridge 145:64910690c574 815 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 816 }
<> 132:9baf128c2fab 817
AnnaBridge 145:64910690c574 818
<> 132:9baf128c2fab 819 /*
<> 132:9baf128c2fab 820 * @brief C custom defined QSUB16 for M3 and M0 processors
<> 132:9baf128c2fab 821 */
AnnaBridge 145:64910690c574 822 CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB16(
AnnaBridge 145:64910690c574 823 uint32_t x,
AnnaBridge 145:64910690c574 824 uint32_t y)
<> 132:9baf128c2fab 825 {
<> 132:9baf128c2fab 826 q31_t r, s;
<> 132:9baf128c2fab 827
AnnaBridge 145:64910690c574 828 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 829 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 830
AnnaBridge 145:64910690c574 831 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 832 }
<> 132:9baf128c2fab 833
AnnaBridge 145:64910690c574 834
<> 132:9baf128c2fab 835 /*
<> 132:9baf128c2fab 836 * @brief C custom defined SHSUB16 for M3 and M0 processors
<> 132:9baf128c2fab 837 */
AnnaBridge 145:64910690c574 838 CMSIS_INLINE __STATIC_INLINE uint32_t __SHSUB16(
AnnaBridge 145:64910690c574 839 uint32_t x,
AnnaBridge 145:64910690c574 840 uint32_t y)
<> 132:9baf128c2fab 841 {
<> 132:9baf128c2fab 842 q31_t r, s;
<> 132:9baf128c2fab 843
AnnaBridge 145:64910690c574 844 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 845 s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 846
AnnaBridge 145:64910690c574 847 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 848 }
<> 132:9baf128c2fab 849
AnnaBridge 145:64910690c574 850
<> 132:9baf128c2fab 851 /*
<> 132:9baf128c2fab 852 * @brief C custom defined QASX for M3 and M0 processors
<> 132:9baf128c2fab 853 */
AnnaBridge 145:64910690c574 854 CMSIS_INLINE __STATIC_INLINE uint32_t __QASX(
AnnaBridge 145:64910690c574 855 uint32_t x,
AnnaBridge 145:64910690c574 856 uint32_t y)
<> 132:9baf128c2fab 857 {
AnnaBridge 145:64910690c574 858 q31_t r, s;
AnnaBridge 145:64910690c574 859
AnnaBridge 145:64910690c574 860 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 861 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 862
AnnaBridge 145:64910690c574 863 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 864 }
<> 132:9baf128c2fab 865
AnnaBridge 145:64910690c574 866
<> 132:9baf128c2fab 867 /*
<> 132:9baf128c2fab 868 * @brief C custom defined SHASX for M3 and M0 processors
<> 132:9baf128c2fab 869 */
AnnaBridge 145:64910690c574 870 CMSIS_INLINE __STATIC_INLINE uint32_t __SHASX(
AnnaBridge 145:64910690c574 871 uint32_t x,
AnnaBridge 145:64910690c574 872 uint32_t y)
<> 132:9baf128c2fab 873 {
<> 132:9baf128c2fab 874 q31_t r, s;
<> 132:9baf128c2fab 875
AnnaBridge 145:64910690c574 876 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 877 s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 878
AnnaBridge 145:64910690c574 879 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 880 }
<> 132:9baf128c2fab 881
<> 132:9baf128c2fab 882
<> 132:9baf128c2fab 883 /*
<> 132:9baf128c2fab 884 * @brief C custom defined QSAX for M3 and M0 processors
<> 132:9baf128c2fab 885 */
AnnaBridge 145:64910690c574 886 CMSIS_INLINE __STATIC_INLINE uint32_t __QSAX(
AnnaBridge 145:64910690c574 887 uint32_t x,
AnnaBridge 145:64910690c574 888 uint32_t y)
<> 132:9baf128c2fab 889 {
AnnaBridge 145:64910690c574 890 q31_t r, s;
AnnaBridge 145:64910690c574 891
AnnaBridge 145:64910690c574 892 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 893 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 894
AnnaBridge 145:64910690c574 895 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 896 }
<> 132:9baf128c2fab 897
AnnaBridge 145:64910690c574 898
<> 132:9baf128c2fab 899 /*
<> 132:9baf128c2fab 900 * @brief C custom defined SHSAX for M3 and M0 processors
<> 132:9baf128c2fab 901 */
AnnaBridge 145:64910690c574 902 CMSIS_INLINE __STATIC_INLINE uint32_t __SHSAX(
AnnaBridge 145:64910690c574 903 uint32_t x,
AnnaBridge 145:64910690c574 904 uint32_t y)
<> 132:9baf128c2fab 905 {
<> 132:9baf128c2fab 906 q31_t r, s;
<> 132:9baf128c2fab 907
AnnaBridge 145:64910690c574 908 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 909 s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
AnnaBridge 145:64910690c574 910
AnnaBridge 145:64910690c574 911 return ((uint32_t)((s << 16) | (r )));
<> 132:9baf128c2fab 912 }
<> 132:9baf128c2fab 913
AnnaBridge 145:64910690c574 914
<> 132:9baf128c2fab 915 /*
<> 132:9baf128c2fab 916 * @brief C custom defined SMUSDX for M3 and M0 processors
<> 132:9baf128c2fab 917 */
AnnaBridge 145:64910690c574 918 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSDX(
AnnaBridge 145:64910690c574 919 uint32_t x,
AnnaBridge 145:64910690c574 920 uint32_t y)
<> 132:9baf128c2fab 921 {
AnnaBridge 145:64910690c574 922 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
AnnaBridge 145:64910690c574 923 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
<> 132:9baf128c2fab 924 }
<> 132:9baf128c2fab 925
<> 132:9baf128c2fab 926 /*
<> 132:9baf128c2fab 927 * @brief C custom defined SMUADX for M3 and M0 processors
<> 132:9baf128c2fab 928 */
AnnaBridge 145:64910690c574 929 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUADX(
AnnaBridge 145:64910690c574 930 uint32_t x,
AnnaBridge 145:64910690c574 931 uint32_t y)
<> 132:9baf128c2fab 932 {
AnnaBridge 145:64910690c574 933 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
AnnaBridge 145:64910690c574 934 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
<> 132:9baf128c2fab 935 }
<> 132:9baf128c2fab 936
AnnaBridge 145:64910690c574 937
<> 132:9baf128c2fab 938 /*
<> 132:9baf128c2fab 939 * @brief C custom defined QADD for M3 and M0 processors
<> 132:9baf128c2fab 940 */
AnnaBridge 145:64910690c574 941 CMSIS_INLINE __STATIC_INLINE int32_t __QADD(
AnnaBridge 145:64910690c574 942 int32_t x,
AnnaBridge 145:64910690c574 943 int32_t y)
<> 132:9baf128c2fab 944 {
AnnaBridge 145:64910690c574 945 return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y)));
<> 132:9baf128c2fab 946 }
<> 132:9baf128c2fab 947
AnnaBridge 145:64910690c574 948
<> 132:9baf128c2fab 949 /*
<> 132:9baf128c2fab 950 * @brief C custom defined QSUB for M3 and M0 processors
<> 132:9baf128c2fab 951 */
AnnaBridge 145:64910690c574 952 CMSIS_INLINE __STATIC_INLINE int32_t __QSUB(
AnnaBridge 145:64910690c574 953 int32_t x,
AnnaBridge 145:64910690c574 954 int32_t y)
<> 132:9baf128c2fab 955 {
AnnaBridge 145:64910690c574 956 return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y)));
<> 132:9baf128c2fab 957 }
<> 132:9baf128c2fab 958
AnnaBridge 145:64910690c574 959
<> 132:9baf128c2fab 960 /*
<> 132:9baf128c2fab 961 * @brief C custom defined SMLAD for M3 and M0 processors
<> 132:9baf128c2fab 962 */
AnnaBridge 145:64910690c574 963 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLAD(
AnnaBridge 145:64910690c574 964 uint32_t x,
AnnaBridge 145:64910690c574 965 uint32_t y,
AnnaBridge 145:64910690c574 966 uint32_t sum)
<> 132:9baf128c2fab 967 {
AnnaBridge 145:64910690c574 968 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 969 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
AnnaBridge 145:64910690c574 970 ( ((q31_t)sum ) ) ));
<> 132:9baf128c2fab 971 }
<> 132:9baf128c2fab 972
AnnaBridge 145:64910690c574 973
<> 132:9baf128c2fab 974 /*
<> 132:9baf128c2fab 975 * @brief C custom defined SMLADX for M3 and M0 processors
<> 132:9baf128c2fab 976 */
AnnaBridge 145:64910690c574 977 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLADX(
AnnaBridge 145:64910690c574 978 uint32_t x,
AnnaBridge 145:64910690c574 979 uint32_t y,
AnnaBridge 145:64910690c574 980 uint32_t sum)
<> 132:9baf128c2fab 981 {
AnnaBridge 145:64910690c574 982 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
AnnaBridge 145:64910690c574 983 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 984 ( ((q31_t)sum ) ) ));
<> 132:9baf128c2fab 985 }
<> 132:9baf128c2fab 986
AnnaBridge 145:64910690c574 987
<> 132:9baf128c2fab 988 /*
<> 132:9baf128c2fab 989 * @brief C custom defined SMLSDX for M3 and M0 processors
<> 132:9baf128c2fab 990 */
AnnaBridge 145:64910690c574 991 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLSDX(
AnnaBridge 145:64910690c574 992 uint32_t x,
AnnaBridge 145:64910690c574 993 uint32_t y,
AnnaBridge 145:64910690c574 994 uint32_t sum)
<> 132:9baf128c2fab 995 {
AnnaBridge 145:64910690c574 996 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
AnnaBridge 145:64910690c574 997 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 998 ( ((q31_t)sum ) ) ));
<> 132:9baf128c2fab 999 }
<> 132:9baf128c2fab 1000
AnnaBridge 145:64910690c574 1001
<> 132:9baf128c2fab 1002 /*
<> 132:9baf128c2fab 1003 * @brief C custom defined SMLALD for M3 and M0 processors
<> 132:9baf128c2fab 1004 */
AnnaBridge 145:64910690c574 1005 CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALD(
AnnaBridge 145:64910690c574 1006 uint32_t x,
AnnaBridge 145:64910690c574 1007 uint32_t y,
AnnaBridge 145:64910690c574 1008 uint64_t sum)
<> 132:9baf128c2fab 1009 {
AnnaBridge 145:64910690c574 1010 /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */
AnnaBridge 145:64910690c574 1011 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 1012 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
AnnaBridge 145:64910690c574 1013 ( ((q63_t)sum ) ) ));
<> 132:9baf128c2fab 1014 }
<> 132:9baf128c2fab 1015
AnnaBridge 145:64910690c574 1016
<> 132:9baf128c2fab 1017 /*
<> 132:9baf128c2fab 1018 * @brief C custom defined SMLALDX for M3 and M0 processors
<> 132:9baf128c2fab 1019 */
AnnaBridge 145:64910690c574 1020 CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALDX(
AnnaBridge 145:64910690c574 1021 uint32_t x,
AnnaBridge 145:64910690c574 1022 uint32_t y,
AnnaBridge 145:64910690c574 1023 uint64_t sum)
<> 132:9baf128c2fab 1024 {
AnnaBridge 145:64910690c574 1025 /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */
AnnaBridge 145:64910690c574 1026 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
AnnaBridge 145:64910690c574 1027 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 1028 ( ((q63_t)sum ) ) ));
<> 132:9baf128c2fab 1029 }
<> 132:9baf128c2fab 1030
AnnaBridge 145:64910690c574 1031
<> 132:9baf128c2fab 1032 /*
<> 132:9baf128c2fab 1033 * @brief C custom defined SMUAD for M3 and M0 processors
<> 132:9baf128c2fab 1034 */
AnnaBridge 145:64910690c574 1035 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUAD(
AnnaBridge 145:64910690c574 1036 uint32_t x,
AnnaBridge 145:64910690c574 1037 uint32_t y)
<> 132:9baf128c2fab 1038 {
AnnaBridge 145:64910690c574 1039 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
AnnaBridge 145:64910690c574 1040 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
<> 132:9baf128c2fab 1041 }
<> 132:9baf128c2fab 1042
AnnaBridge 145:64910690c574 1043
<> 132:9baf128c2fab 1044 /*
<> 132:9baf128c2fab 1045 * @brief C custom defined SMUSD for M3 and M0 processors
<> 132:9baf128c2fab 1046 */
AnnaBridge 145:64910690c574 1047 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSD(
AnnaBridge 145:64910690c574 1048 uint32_t x,
AnnaBridge 145:64910690c574 1049 uint32_t y)
<> 132:9baf128c2fab 1050 {
AnnaBridge 145:64910690c574 1051 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) -
AnnaBridge 145:64910690c574 1052 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
<> 132:9baf128c2fab 1053 }
<> 132:9baf128c2fab 1054
<> 132:9baf128c2fab 1055
<> 132:9baf128c2fab 1056 /*
<> 132:9baf128c2fab 1057 * @brief C custom defined SXTB16 for M3 and M0 processors
<> 132:9baf128c2fab 1058 */
AnnaBridge 145:64910690c574 1059 CMSIS_INLINE __STATIC_INLINE uint32_t __SXTB16(
AnnaBridge 145:64910690c574 1060 uint32_t x)
AnnaBridge 145:64910690c574 1061 {
AnnaBridge 145:64910690c574 1062 return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) |
AnnaBridge 145:64910690c574 1063 ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) ));
AnnaBridge 145:64910690c574 1064 }
AnnaBridge 145:64910690c574 1065
AnnaBridge 145:64910690c574 1066 /*
AnnaBridge 145:64910690c574 1067 * @brief C custom defined SMMLA for M3 and M0 processors
AnnaBridge 145:64910690c574 1068 */
AnnaBridge 145:64910690c574 1069 CMSIS_INLINE __STATIC_INLINE int32_t __SMMLA(
AnnaBridge 145:64910690c574 1070 int32_t x,
AnnaBridge 145:64910690c574 1071 int32_t y,
AnnaBridge 145:64910690c574 1072 int32_t sum)
<> 132:9baf128c2fab 1073 {
AnnaBridge 145:64910690c574 1074 return (sum + (int32_t) (((int64_t) x * y) >> 32));
AnnaBridge 145:64910690c574 1075 }
AnnaBridge 145:64910690c574 1076
AnnaBridge 145:64910690c574 1077 #if 0
AnnaBridge 145:64910690c574 1078 /*
AnnaBridge 145:64910690c574 1079 * @brief C custom defined PKHBT for unavailable DSP extension
AnnaBridge 145:64910690c574 1080 */
AnnaBridge 145:64910690c574 1081 CMSIS_INLINE __STATIC_INLINE uint32_t __PKHBT(
AnnaBridge 145:64910690c574 1082 uint32_t x,
AnnaBridge 145:64910690c574 1083 uint32_t y,
AnnaBridge 145:64910690c574 1084 uint32_t leftshift)
AnnaBridge 145:64910690c574 1085 {
AnnaBridge 145:64910690c574 1086 return ( ((x ) & 0x0000FFFFUL) |
AnnaBridge 145:64910690c574 1087 ((y << leftshift) & 0xFFFF0000UL) );
<> 132:9baf128c2fab 1088 }
<> 132:9baf128c2fab 1089
AnnaBridge 145:64910690c574 1090 /*
AnnaBridge 145:64910690c574 1091 * @brief C custom defined PKHTB for unavailable DSP extension
AnnaBridge 145:64910690c574 1092 */
AnnaBridge 145:64910690c574 1093 CMSIS_INLINE __STATIC_INLINE uint32_t __PKHTB(
AnnaBridge 145:64910690c574 1094 uint32_t x,
AnnaBridge 145:64910690c574 1095 uint32_t y,
AnnaBridge 145:64910690c574 1096 uint32_t rightshift)
AnnaBridge 145:64910690c574 1097 {
AnnaBridge 145:64910690c574 1098 return ( ((x ) & 0xFFFF0000UL) |
AnnaBridge 145:64910690c574 1099 ((y >> rightshift) & 0x0000FFFFUL) );
AnnaBridge 145:64910690c574 1100 }
AnnaBridge 145:64910690c574 1101 #endif
AnnaBridge 145:64910690c574 1102
AnnaBridge 145:64910690c574 1103 /* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
AnnaBridge 145:64910690c574 1104 #endif /* !defined (ARM_MATH_DSP) */
<> 132:9baf128c2fab 1105
<> 132:9baf128c2fab 1106
<> 132:9baf128c2fab 1107 /**
<> 132:9baf128c2fab 1108 * @brief Instance structure for the Q7 FIR filter.
<> 132:9baf128c2fab 1109 */
<> 132:9baf128c2fab 1110 typedef struct
<> 132:9baf128c2fab 1111 {
<> 132:9baf128c2fab 1112 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 132:9baf128c2fab 1113 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 1114 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 1115 } arm_fir_instance_q7;
<> 132:9baf128c2fab 1116
<> 132:9baf128c2fab 1117 /**
<> 132:9baf128c2fab 1118 * @brief Instance structure for the Q15 FIR filter.
<> 132:9baf128c2fab 1119 */
<> 132:9baf128c2fab 1120 typedef struct
<> 132:9baf128c2fab 1121 {
<> 132:9baf128c2fab 1122 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 132:9baf128c2fab 1123 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 1124 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 1125 } arm_fir_instance_q15;
<> 132:9baf128c2fab 1126
<> 132:9baf128c2fab 1127 /**
<> 132:9baf128c2fab 1128 * @brief Instance structure for the Q31 FIR filter.
<> 132:9baf128c2fab 1129 */
<> 132:9baf128c2fab 1130 typedef struct
<> 132:9baf128c2fab 1131 {
<> 132:9baf128c2fab 1132 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 132:9baf128c2fab 1133 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 1134 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 1135 } arm_fir_instance_q31;
<> 132:9baf128c2fab 1136
<> 132:9baf128c2fab 1137 /**
<> 132:9baf128c2fab 1138 * @brief Instance structure for the floating-point FIR filter.
<> 132:9baf128c2fab 1139 */
<> 132:9baf128c2fab 1140 typedef struct
<> 132:9baf128c2fab 1141 {
<> 132:9baf128c2fab 1142 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 132:9baf128c2fab 1143 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 1144 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 1145 } arm_fir_instance_f32;
<> 132:9baf128c2fab 1146
<> 132:9baf128c2fab 1147
<> 132:9baf128c2fab 1148 /**
<> 132:9baf128c2fab 1149 * @brief Processing function for the Q7 FIR filter.
AnnaBridge 145:64910690c574 1150 * @param[in] S points to an instance of the Q7 FIR filter structure.
AnnaBridge 145:64910690c574 1151 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1152 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1153 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1154 */
<> 132:9baf128c2fab 1155 void arm_fir_q7(
<> 132:9baf128c2fab 1156 const arm_fir_instance_q7 * S,
<> 132:9baf128c2fab 1157 q7_t * pSrc,
<> 132:9baf128c2fab 1158 q7_t * pDst,
<> 132:9baf128c2fab 1159 uint32_t blockSize);
<> 132:9baf128c2fab 1160
<> 132:9baf128c2fab 1161
<> 132:9baf128c2fab 1162 /**
<> 132:9baf128c2fab 1163 * @brief Initialization function for the Q7 FIR filter.
AnnaBridge 145:64910690c574 1164 * @param[in,out] S points to an instance of the Q7 FIR structure.
AnnaBridge 145:64910690c574 1165 * @param[in] numTaps Number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 1166 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1167 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1168 * @param[in] blockSize number of samples that are processed.
<> 132:9baf128c2fab 1169 */
<> 132:9baf128c2fab 1170 void arm_fir_init_q7(
<> 132:9baf128c2fab 1171 arm_fir_instance_q7 * S,
<> 132:9baf128c2fab 1172 uint16_t numTaps,
<> 132:9baf128c2fab 1173 q7_t * pCoeffs,
<> 132:9baf128c2fab 1174 q7_t * pState,
<> 132:9baf128c2fab 1175 uint32_t blockSize);
<> 132:9baf128c2fab 1176
<> 132:9baf128c2fab 1177
<> 132:9baf128c2fab 1178 /**
<> 132:9baf128c2fab 1179 * @brief Processing function for the Q15 FIR filter.
AnnaBridge 145:64910690c574 1180 * @param[in] S points to an instance of the Q15 FIR structure.
AnnaBridge 145:64910690c574 1181 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1182 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1183 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1184 */
<> 132:9baf128c2fab 1185 void arm_fir_q15(
<> 132:9baf128c2fab 1186 const arm_fir_instance_q15 * S,
<> 132:9baf128c2fab 1187 q15_t * pSrc,
<> 132:9baf128c2fab 1188 q15_t * pDst,
<> 132:9baf128c2fab 1189 uint32_t blockSize);
<> 132:9baf128c2fab 1190
AnnaBridge 145:64910690c574 1191
<> 132:9baf128c2fab 1192 /**
<> 132:9baf128c2fab 1193 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 1194 * @param[in] S points to an instance of the Q15 FIR filter structure.
AnnaBridge 145:64910690c574 1195 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1196 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1197 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1198 */
<> 132:9baf128c2fab 1199 void arm_fir_fast_q15(
<> 132:9baf128c2fab 1200 const arm_fir_instance_q15 * S,
<> 132:9baf128c2fab 1201 q15_t * pSrc,
<> 132:9baf128c2fab 1202 q15_t * pDst,
<> 132:9baf128c2fab 1203 uint32_t blockSize);
<> 132:9baf128c2fab 1204
AnnaBridge 145:64910690c574 1205
<> 132:9baf128c2fab 1206 /**
<> 132:9baf128c2fab 1207 * @brief Initialization function for the Q15 FIR filter.
AnnaBridge 145:64910690c574 1208 * @param[in,out] S points to an instance of the Q15 FIR filter structure.
AnnaBridge 145:64910690c574 1209 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
AnnaBridge 145:64910690c574 1210 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1211 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1212 * @param[in] blockSize number of samples that are processed at a time.
<> 132:9baf128c2fab 1213 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
<> 132:9baf128c2fab 1214 * <code>numTaps</code> is not a supported value.
<> 132:9baf128c2fab 1215 */
<> 132:9baf128c2fab 1216 arm_status arm_fir_init_q15(
<> 132:9baf128c2fab 1217 arm_fir_instance_q15 * S,
<> 132:9baf128c2fab 1218 uint16_t numTaps,
<> 132:9baf128c2fab 1219 q15_t * pCoeffs,
<> 132:9baf128c2fab 1220 q15_t * pState,
<> 132:9baf128c2fab 1221 uint32_t blockSize);
<> 132:9baf128c2fab 1222
AnnaBridge 145:64910690c574 1223
<> 132:9baf128c2fab 1224 /**
<> 132:9baf128c2fab 1225 * @brief Processing function for the Q31 FIR filter.
AnnaBridge 145:64910690c574 1226 * @param[in] S points to an instance of the Q31 FIR filter structure.
AnnaBridge 145:64910690c574 1227 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1228 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1229 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1230 */
<> 132:9baf128c2fab 1231 void arm_fir_q31(
<> 132:9baf128c2fab 1232 const arm_fir_instance_q31 * S,
<> 132:9baf128c2fab 1233 q31_t * pSrc,
<> 132:9baf128c2fab 1234 q31_t * pDst,
<> 132:9baf128c2fab 1235 uint32_t blockSize);
<> 132:9baf128c2fab 1236
AnnaBridge 145:64910690c574 1237
<> 132:9baf128c2fab 1238 /**
<> 132:9baf128c2fab 1239 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 1240 * @param[in] S points to an instance of the Q31 FIR structure.
AnnaBridge 145:64910690c574 1241 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1242 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1243 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1244 */
<> 132:9baf128c2fab 1245 void arm_fir_fast_q31(
<> 132:9baf128c2fab 1246 const arm_fir_instance_q31 * S,
<> 132:9baf128c2fab 1247 q31_t * pSrc,
<> 132:9baf128c2fab 1248 q31_t * pDst,
<> 132:9baf128c2fab 1249 uint32_t blockSize);
<> 132:9baf128c2fab 1250
AnnaBridge 145:64910690c574 1251
<> 132:9baf128c2fab 1252 /**
<> 132:9baf128c2fab 1253 * @brief Initialization function for the Q31 FIR filter.
AnnaBridge 145:64910690c574 1254 * @param[in,out] S points to an instance of the Q31 FIR structure.
AnnaBridge 145:64910690c574 1255 * @param[in] numTaps Number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 1256 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1257 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1258 * @param[in] blockSize number of samples that are processed at a time.
<> 132:9baf128c2fab 1259 */
<> 132:9baf128c2fab 1260 void arm_fir_init_q31(
<> 132:9baf128c2fab 1261 arm_fir_instance_q31 * S,
<> 132:9baf128c2fab 1262 uint16_t numTaps,
<> 132:9baf128c2fab 1263 q31_t * pCoeffs,
<> 132:9baf128c2fab 1264 q31_t * pState,
<> 132:9baf128c2fab 1265 uint32_t blockSize);
<> 132:9baf128c2fab 1266
AnnaBridge 145:64910690c574 1267
<> 132:9baf128c2fab 1268 /**
<> 132:9baf128c2fab 1269 * @brief Processing function for the floating-point FIR filter.
AnnaBridge 145:64910690c574 1270 * @param[in] S points to an instance of the floating-point FIR structure.
AnnaBridge 145:64910690c574 1271 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1272 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1273 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 1274 */
<> 132:9baf128c2fab 1275 void arm_fir_f32(
<> 132:9baf128c2fab 1276 const arm_fir_instance_f32 * S,
<> 132:9baf128c2fab 1277 float32_t * pSrc,
<> 132:9baf128c2fab 1278 float32_t * pDst,
<> 132:9baf128c2fab 1279 uint32_t blockSize);
<> 132:9baf128c2fab 1280
AnnaBridge 145:64910690c574 1281
<> 132:9baf128c2fab 1282 /**
<> 132:9baf128c2fab 1283 * @brief Initialization function for the floating-point FIR filter.
AnnaBridge 145:64910690c574 1284 * @param[in,out] S points to an instance of the floating-point FIR filter structure.
AnnaBridge 145:64910690c574 1285 * @param[in] numTaps Number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 1286 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1287 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1288 * @param[in] blockSize number of samples that are processed at a time.
<> 132:9baf128c2fab 1289 */
<> 132:9baf128c2fab 1290 void arm_fir_init_f32(
<> 132:9baf128c2fab 1291 arm_fir_instance_f32 * S,
<> 132:9baf128c2fab 1292 uint16_t numTaps,
<> 132:9baf128c2fab 1293 float32_t * pCoeffs,
<> 132:9baf128c2fab 1294 float32_t * pState,
<> 132:9baf128c2fab 1295 uint32_t blockSize);
<> 132:9baf128c2fab 1296
<> 132:9baf128c2fab 1297
<> 132:9baf128c2fab 1298 /**
<> 132:9baf128c2fab 1299 * @brief Instance structure for the Q15 Biquad cascade filter.
<> 132:9baf128c2fab 1300 */
<> 132:9baf128c2fab 1301 typedef struct
<> 132:9baf128c2fab 1302 {
AnnaBridge 145:64910690c574 1303 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
AnnaBridge 145:64910690c574 1304 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
AnnaBridge 145:64910690c574 1305 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
AnnaBridge 145:64910690c574 1306 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 132:9baf128c2fab 1307 } arm_biquad_casd_df1_inst_q15;
<> 132:9baf128c2fab 1308
<> 132:9baf128c2fab 1309 /**
<> 132:9baf128c2fab 1310 * @brief Instance structure for the Q31 Biquad cascade filter.
<> 132:9baf128c2fab 1311 */
<> 132:9baf128c2fab 1312 typedef struct
<> 132:9baf128c2fab 1313 {
<> 132:9baf128c2fab 1314 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 132:9baf128c2fab 1315 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 132:9baf128c2fab 1316 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 1317 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 132:9baf128c2fab 1318 } arm_biquad_casd_df1_inst_q31;
<> 132:9baf128c2fab 1319
<> 132:9baf128c2fab 1320 /**
<> 132:9baf128c2fab 1321 * @brief Instance structure for the floating-point Biquad cascade filter.
<> 132:9baf128c2fab 1322 */
<> 132:9baf128c2fab 1323 typedef struct
<> 132:9baf128c2fab 1324 {
AnnaBridge 145:64910690c574 1325 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
AnnaBridge 145:64910690c574 1326 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
AnnaBridge 145:64910690c574 1327 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 1328 } arm_biquad_casd_df1_inst_f32;
<> 132:9baf128c2fab 1329
<> 132:9baf128c2fab 1330
<> 132:9baf128c2fab 1331 /**
<> 132:9baf128c2fab 1332 * @brief Processing function for the Q15 Biquad cascade filter.
AnnaBridge 145:64910690c574 1333 * @param[in] S points to an instance of the Q15 Biquad cascade structure.
AnnaBridge 145:64910690c574 1334 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1335 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1336 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1337 */
<> 132:9baf128c2fab 1338 void arm_biquad_cascade_df1_q15(
<> 132:9baf128c2fab 1339 const arm_biquad_casd_df1_inst_q15 * S,
<> 132:9baf128c2fab 1340 q15_t * pSrc,
<> 132:9baf128c2fab 1341 q15_t * pDst,
<> 132:9baf128c2fab 1342 uint32_t blockSize);
<> 132:9baf128c2fab 1343
AnnaBridge 145:64910690c574 1344
<> 132:9baf128c2fab 1345 /**
<> 132:9baf128c2fab 1346 * @brief Initialization function for the Q15 Biquad cascade filter.
AnnaBridge 145:64910690c574 1347 * @param[in,out] S points to an instance of the Q15 Biquad cascade structure.
AnnaBridge 145:64910690c574 1348 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 1349 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1350 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1351 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
AnnaBridge 145:64910690c574 1352 */
<> 132:9baf128c2fab 1353 void arm_biquad_cascade_df1_init_q15(
<> 132:9baf128c2fab 1354 arm_biquad_casd_df1_inst_q15 * S,
<> 132:9baf128c2fab 1355 uint8_t numStages,
<> 132:9baf128c2fab 1356 q15_t * pCoeffs,
<> 132:9baf128c2fab 1357 q15_t * pState,
<> 132:9baf128c2fab 1358 int8_t postShift);
<> 132:9baf128c2fab 1359
<> 132:9baf128c2fab 1360
<> 132:9baf128c2fab 1361 /**
<> 132:9baf128c2fab 1362 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 1363 * @param[in] S points to an instance of the Q15 Biquad cascade structure.
AnnaBridge 145:64910690c574 1364 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1365 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 1366 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1367 */
<> 132:9baf128c2fab 1368 void arm_biquad_cascade_df1_fast_q15(
<> 132:9baf128c2fab 1369 const arm_biquad_casd_df1_inst_q15 * S,
<> 132:9baf128c2fab 1370 q15_t * pSrc,
<> 132:9baf128c2fab 1371 q15_t * pDst,
<> 132:9baf128c2fab 1372 uint32_t blockSize);
<> 132:9baf128c2fab 1373
<> 132:9baf128c2fab 1374
<> 132:9baf128c2fab 1375 /**
<> 132:9baf128c2fab 1376 * @brief Processing function for the Q31 Biquad cascade filter
AnnaBridge 145:64910690c574 1377 * @param[in] S points to an instance of the Q31 Biquad cascade structure.
AnnaBridge 145:64910690c574 1378 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1379 * @param[out] pDst points to the block of output data.
<> 132:9baf128c2fab 1380 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1381 */
<> 132:9baf128c2fab 1382 void arm_biquad_cascade_df1_q31(
<> 132:9baf128c2fab 1383 const arm_biquad_casd_df1_inst_q31 * S,
<> 132:9baf128c2fab 1384 q31_t * pSrc,
<> 132:9baf128c2fab 1385 q31_t * pDst,
<> 132:9baf128c2fab 1386 uint32_t blockSize);
<> 132:9baf128c2fab 1387
AnnaBridge 145:64910690c574 1388
<> 132:9baf128c2fab 1389 /**
<> 132:9baf128c2fab 1390 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 1391 * @param[in] S points to an instance of the Q31 Biquad cascade structure.
AnnaBridge 145:64910690c574 1392 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1393 * @param[out] pDst points to the block of output data.
<> 132:9baf128c2fab 1394 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1395 */
<> 132:9baf128c2fab 1396 void arm_biquad_cascade_df1_fast_q31(
<> 132:9baf128c2fab 1397 const arm_biquad_casd_df1_inst_q31 * S,
<> 132:9baf128c2fab 1398 q31_t * pSrc,
<> 132:9baf128c2fab 1399 q31_t * pDst,
<> 132:9baf128c2fab 1400 uint32_t blockSize);
<> 132:9baf128c2fab 1401
AnnaBridge 145:64910690c574 1402
<> 132:9baf128c2fab 1403 /**
<> 132:9baf128c2fab 1404 * @brief Initialization function for the Q31 Biquad cascade filter.
AnnaBridge 145:64910690c574 1405 * @param[in,out] S points to an instance of the Q31 Biquad cascade structure.
AnnaBridge 145:64910690c574 1406 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 1407 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1408 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1409 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
AnnaBridge 145:64910690c574 1410 */
<> 132:9baf128c2fab 1411 void arm_biquad_cascade_df1_init_q31(
<> 132:9baf128c2fab 1412 arm_biquad_casd_df1_inst_q31 * S,
<> 132:9baf128c2fab 1413 uint8_t numStages,
<> 132:9baf128c2fab 1414 q31_t * pCoeffs,
<> 132:9baf128c2fab 1415 q31_t * pState,
<> 132:9baf128c2fab 1416 int8_t postShift);
<> 132:9baf128c2fab 1417
AnnaBridge 145:64910690c574 1418
<> 132:9baf128c2fab 1419 /**
<> 132:9baf128c2fab 1420 * @brief Processing function for the floating-point Biquad cascade filter.
AnnaBridge 145:64910690c574 1421 * @param[in] S points to an instance of the floating-point Biquad cascade structure.
AnnaBridge 145:64910690c574 1422 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 1423 * @param[out] pDst points to the block of output data.
<> 132:9baf128c2fab 1424 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1425 */
<> 132:9baf128c2fab 1426 void arm_biquad_cascade_df1_f32(
<> 132:9baf128c2fab 1427 const arm_biquad_casd_df1_inst_f32 * S,
<> 132:9baf128c2fab 1428 float32_t * pSrc,
<> 132:9baf128c2fab 1429 float32_t * pDst,
<> 132:9baf128c2fab 1430 uint32_t blockSize);
<> 132:9baf128c2fab 1431
AnnaBridge 145:64910690c574 1432
<> 132:9baf128c2fab 1433 /**
<> 132:9baf128c2fab 1434 * @brief Initialization function for the floating-point Biquad cascade filter.
AnnaBridge 145:64910690c574 1435 * @param[in,out] S points to an instance of the floating-point Biquad cascade structure.
AnnaBridge 145:64910690c574 1436 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 1437 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 1438 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 1439 */
<> 132:9baf128c2fab 1440 void arm_biquad_cascade_df1_init_f32(
<> 132:9baf128c2fab 1441 arm_biquad_casd_df1_inst_f32 * S,
<> 132:9baf128c2fab 1442 uint8_t numStages,
<> 132:9baf128c2fab 1443 float32_t * pCoeffs,
<> 132:9baf128c2fab 1444 float32_t * pState);
<> 132:9baf128c2fab 1445
<> 132:9baf128c2fab 1446
<> 132:9baf128c2fab 1447 /**
<> 132:9baf128c2fab 1448 * @brief Instance structure for the floating-point matrix structure.
<> 132:9baf128c2fab 1449 */
<> 132:9baf128c2fab 1450 typedef struct
<> 132:9baf128c2fab 1451 {
<> 132:9baf128c2fab 1452 uint16_t numRows; /**< number of rows of the matrix. */
<> 132:9baf128c2fab 1453 uint16_t numCols; /**< number of columns of the matrix. */
<> 132:9baf128c2fab 1454 float32_t *pData; /**< points to the data of the matrix. */
<> 132:9baf128c2fab 1455 } arm_matrix_instance_f32;
<> 132:9baf128c2fab 1456
<> 132:9baf128c2fab 1457
<> 132:9baf128c2fab 1458 /**
<> 132:9baf128c2fab 1459 * @brief Instance structure for the floating-point matrix structure.
<> 132:9baf128c2fab 1460 */
<> 132:9baf128c2fab 1461 typedef struct
<> 132:9baf128c2fab 1462 {
<> 132:9baf128c2fab 1463 uint16_t numRows; /**< number of rows of the matrix. */
<> 132:9baf128c2fab 1464 uint16_t numCols; /**< number of columns of the matrix. */
<> 132:9baf128c2fab 1465 float64_t *pData; /**< points to the data of the matrix. */
<> 132:9baf128c2fab 1466 } arm_matrix_instance_f64;
<> 132:9baf128c2fab 1467
<> 132:9baf128c2fab 1468 /**
<> 132:9baf128c2fab 1469 * @brief Instance structure for the Q15 matrix structure.
<> 132:9baf128c2fab 1470 */
<> 132:9baf128c2fab 1471 typedef struct
<> 132:9baf128c2fab 1472 {
<> 132:9baf128c2fab 1473 uint16_t numRows; /**< number of rows of the matrix. */
<> 132:9baf128c2fab 1474 uint16_t numCols; /**< number of columns of the matrix. */
<> 132:9baf128c2fab 1475 q15_t *pData; /**< points to the data of the matrix. */
<> 132:9baf128c2fab 1476 } arm_matrix_instance_q15;
<> 132:9baf128c2fab 1477
<> 132:9baf128c2fab 1478 /**
<> 132:9baf128c2fab 1479 * @brief Instance structure for the Q31 matrix structure.
<> 132:9baf128c2fab 1480 */
<> 132:9baf128c2fab 1481 typedef struct
<> 132:9baf128c2fab 1482 {
<> 132:9baf128c2fab 1483 uint16_t numRows; /**< number of rows of the matrix. */
<> 132:9baf128c2fab 1484 uint16_t numCols; /**< number of columns of the matrix. */
<> 132:9baf128c2fab 1485 q31_t *pData; /**< points to the data of the matrix. */
<> 132:9baf128c2fab 1486 } arm_matrix_instance_q31;
<> 132:9baf128c2fab 1487
<> 132:9baf128c2fab 1488
<> 132:9baf128c2fab 1489 /**
<> 132:9baf128c2fab 1490 * @brief Floating-point matrix addition.
AnnaBridge 145:64910690c574 1491 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1492 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1493 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1494 * @return The function returns either
<> 132:9baf128c2fab 1495 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1496 */
<> 132:9baf128c2fab 1497 arm_status arm_mat_add_f32(
<> 132:9baf128c2fab 1498 const arm_matrix_instance_f32 * pSrcA,
<> 132:9baf128c2fab 1499 const arm_matrix_instance_f32 * pSrcB,
<> 132:9baf128c2fab 1500 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1501
AnnaBridge 145:64910690c574 1502
<> 132:9baf128c2fab 1503 /**
<> 132:9baf128c2fab 1504 * @brief Q15 matrix addition.
AnnaBridge 145:64910690c574 1505 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1506 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1507 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1508 * @return The function returns either
<> 132:9baf128c2fab 1509 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1510 */
<> 132:9baf128c2fab 1511 arm_status arm_mat_add_q15(
<> 132:9baf128c2fab 1512 const arm_matrix_instance_q15 * pSrcA,
<> 132:9baf128c2fab 1513 const arm_matrix_instance_q15 * pSrcB,
<> 132:9baf128c2fab 1514 arm_matrix_instance_q15 * pDst);
<> 132:9baf128c2fab 1515
AnnaBridge 145:64910690c574 1516
<> 132:9baf128c2fab 1517 /**
<> 132:9baf128c2fab 1518 * @brief Q31 matrix addition.
AnnaBridge 145:64910690c574 1519 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1520 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1521 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1522 * @return The function returns either
<> 132:9baf128c2fab 1523 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1524 */
<> 132:9baf128c2fab 1525 arm_status arm_mat_add_q31(
<> 132:9baf128c2fab 1526 const arm_matrix_instance_q31 * pSrcA,
<> 132:9baf128c2fab 1527 const arm_matrix_instance_q31 * pSrcB,
<> 132:9baf128c2fab 1528 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1529
AnnaBridge 145:64910690c574 1530
<> 132:9baf128c2fab 1531 /**
<> 132:9baf128c2fab 1532 * @brief Floating-point, complex, matrix multiplication.
AnnaBridge 145:64910690c574 1533 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1534 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1535 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1536 * @return The function returns either
<> 132:9baf128c2fab 1537 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1538 */
<> 132:9baf128c2fab 1539 arm_status arm_mat_cmplx_mult_f32(
<> 132:9baf128c2fab 1540 const arm_matrix_instance_f32 * pSrcA,
<> 132:9baf128c2fab 1541 const arm_matrix_instance_f32 * pSrcB,
<> 132:9baf128c2fab 1542 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1543
AnnaBridge 145:64910690c574 1544
<> 132:9baf128c2fab 1545 /**
<> 132:9baf128c2fab 1546 * @brief Q15, complex, matrix multiplication.
AnnaBridge 145:64910690c574 1547 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1548 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1549 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1550 * @return The function returns either
<> 132:9baf128c2fab 1551 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1552 */
<> 132:9baf128c2fab 1553 arm_status arm_mat_cmplx_mult_q15(
<> 132:9baf128c2fab 1554 const arm_matrix_instance_q15 * pSrcA,
<> 132:9baf128c2fab 1555 const arm_matrix_instance_q15 * pSrcB,
<> 132:9baf128c2fab 1556 arm_matrix_instance_q15 * pDst,
<> 132:9baf128c2fab 1557 q15_t * pScratch);
<> 132:9baf128c2fab 1558
AnnaBridge 145:64910690c574 1559
<> 132:9baf128c2fab 1560 /**
<> 132:9baf128c2fab 1561 * @brief Q31, complex, matrix multiplication.
AnnaBridge 145:64910690c574 1562 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1563 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1564 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1565 * @return The function returns either
<> 132:9baf128c2fab 1566 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1567 */
<> 132:9baf128c2fab 1568 arm_status arm_mat_cmplx_mult_q31(
<> 132:9baf128c2fab 1569 const arm_matrix_instance_q31 * pSrcA,
<> 132:9baf128c2fab 1570 const arm_matrix_instance_q31 * pSrcB,
<> 132:9baf128c2fab 1571 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1572
<> 132:9baf128c2fab 1573
<> 132:9baf128c2fab 1574 /**
<> 132:9baf128c2fab 1575 * @brief Floating-point matrix transpose.
AnnaBridge 145:64910690c574 1576 * @param[in] pSrc points to the input matrix
AnnaBridge 145:64910690c574 1577 * @param[out] pDst points to the output matrix
AnnaBridge 145:64910690c574 1578 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 132:9baf128c2fab 1579 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1580 */
<> 132:9baf128c2fab 1581 arm_status arm_mat_trans_f32(
<> 132:9baf128c2fab 1582 const arm_matrix_instance_f32 * pSrc,
<> 132:9baf128c2fab 1583 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1584
<> 132:9baf128c2fab 1585
<> 132:9baf128c2fab 1586 /**
<> 132:9baf128c2fab 1587 * @brief Q15 matrix transpose.
AnnaBridge 145:64910690c574 1588 * @param[in] pSrc points to the input matrix
AnnaBridge 145:64910690c574 1589 * @param[out] pDst points to the output matrix
AnnaBridge 145:64910690c574 1590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 132:9baf128c2fab 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1592 */
<> 132:9baf128c2fab 1593 arm_status arm_mat_trans_q15(
<> 132:9baf128c2fab 1594 const arm_matrix_instance_q15 * pSrc,
<> 132:9baf128c2fab 1595 arm_matrix_instance_q15 * pDst);
<> 132:9baf128c2fab 1596
AnnaBridge 145:64910690c574 1597
<> 132:9baf128c2fab 1598 /**
<> 132:9baf128c2fab 1599 * @brief Q31 matrix transpose.
AnnaBridge 145:64910690c574 1600 * @param[in] pSrc points to the input matrix
AnnaBridge 145:64910690c574 1601 * @param[out] pDst points to the output matrix
AnnaBridge 145:64910690c574 1602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 132:9baf128c2fab 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1604 */
<> 132:9baf128c2fab 1605 arm_status arm_mat_trans_q31(
<> 132:9baf128c2fab 1606 const arm_matrix_instance_q31 * pSrc,
<> 132:9baf128c2fab 1607 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1608
<> 132:9baf128c2fab 1609
<> 132:9baf128c2fab 1610 /**
<> 132:9baf128c2fab 1611 * @brief Floating-point matrix multiplication
AnnaBridge 145:64910690c574 1612 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1613 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1614 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1615 * @return The function returns either
<> 132:9baf128c2fab 1616 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1617 */
<> 132:9baf128c2fab 1618 arm_status arm_mat_mult_f32(
<> 132:9baf128c2fab 1619 const arm_matrix_instance_f32 * pSrcA,
<> 132:9baf128c2fab 1620 const arm_matrix_instance_f32 * pSrcB,
<> 132:9baf128c2fab 1621 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1622
AnnaBridge 145:64910690c574 1623
<> 132:9baf128c2fab 1624 /**
<> 132:9baf128c2fab 1625 * @brief Q15 matrix multiplication
AnnaBridge 145:64910690c574 1626 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1627 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1628 * @param[out] pDst points to output matrix structure
AnnaBridge 145:64910690c574 1629 * @param[in] pState points to the array for storing intermediate results
<> 132:9baf128c2fab 1630 * @return The function returns either
<> 132:9baf128c2fab 1631 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1632 */
<> 132:9baf128c2fab 1633 arm_status arm_mat_mult_q15(
<> 132:9baf128c2fab 1634 const arm_matrix_instance_q15 * pSrcA,
<> 132:9baf128c2fab 1635 const arm_matrix_instance_q15 * pSrcB,
<> 132:9baf128c2fab 1636 arm_matrix_instance_q15 * pDst,
<> 132:9baf128c2fab 1637 q15_t * pState);
<> 132:9baf128c2fab 1638
AnnaBridge 145:64910690c574 1639
<> 132:9baf128c2fab 1640 /**
<> 132:9baf128c2fab 1641 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 1642 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1643 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1644 * @param[out] pDst points to output matrix structure
AnnaBridge 145:64910690c574 1645 * @param[in] pState points to the array for storing intermediate results
<> 132:9baf128c2fab 1646 * @return The function returns either
<> 132:9baf128c2fab 1647 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1648 */
<> 132:9baf128c2fab 1649 arm_status arm_mat_mult_fast_q15(
<> 132:9baf128c2fab 1650 const arm_matrix_instance_q15 * pSrcA,
<> 132:9baf128c2fab 1651 const arm_matrix_instance_q15 * pSrcB,
<> 132:9baf128c2fab 1652 arm_matrix_instance_q15 * pDst,
<> 132:9baf128c2fab 1653 q15_t * pState);
<> 132:9baf128c2fab 1654
AnnaBridge 145:64910690c574 1655
<> 132:9baf128c2fab 1656 /**
<> 132:9baf128c2fab 1657 * @brief Q31 matrix multiplication
AnnaBridge 145:64910690c574 1658 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1659 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1660 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1661 * @return The function returns either
<> 132:9baf128c2fab 1662 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1663 */
<> 132:9baf128c2fab 1664 arm_status arm_mat_mult_q31(
<> 132:9baf128c2fab 1665 const arm_matrix_instance_q31 * pSrcA,
<> 132:9baf128c2fab 1666 const arm_matrix_instance_q31 * pSrcB,
<> 132:9baf128c2fab 1667 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1668
AnnaBridge 145:64910690c574 1669
<> 132:9baf128c2fab 1670 /**
<> 132:9baf128c2fab 1671 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 1672 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1673 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1674 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1675 * @return The function returns either
<> 132:9baf128c2fab 1676 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1677 */
<> 132:9baf128c2fab 1678 arm_status arm_mat_mult_fast_q31(
<> 132:9baf128c2fab 1679 const arm_matrix_instance_q31 * pSrcA,
<> 132:9baf128c2fab 1680 const arm_matrix_instance_q31 * pSrcB,
<> 132:9baf128c2fab 1681 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1682
<> 132:9baf128c2fab 1683
<> 132:9baf128c2fab 1684 /**
<> 132:9baf128c2fab 1685 * @brief Floating-point matrix subtraction
AnnaBridge 145:64910690c574 1686 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1687 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1688 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1689 * @return The function returns either
<> 132:9baf128c2fab 1690 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1691 */
<> 132:9baf128c2fab 1692 arm_status arm_mat_sub_f32(
<> 132:9baf128c2fab 1693 const arm_matrix_instance_f32 * pSrcA,
<> 132:9baf128c2fab 1694 const arm_matrix_instance_f32 * pSrcB,
<> 132:9baf128c2fab 1695 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1696
AnnaBridge 145:64910690c574 1697
<> 132:9baf128c2fab 1698 /**
<> 132:9baf128c2fab 1699 * @brief Q15 matrix subtraction
AnnaBridge 145:64910690c574 1700 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1701 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1702 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1703 * @return The function returns either
<> 132:9baf128c2fab 1704 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1705 */
<> 132:9baf128c2fab 1706 arm_status arm_mat_sub_q15(
<> 132:9baf128c2fab 1707 const arm_matrix_instance_q15 * pSrcA,
<> 132:9baf128c2fab 1708 const arm_matrix_instance_q15 * pSrcB,
<> 132:9baf128c2fab 1709 arm_matrix_instance_q15 * pDst);
<> 132:9baf128c2fab 1710
AnnaBridge 145:64910690c574 1711
<> 132:9baf128c2fab 1712 /**
<> 132:9baf128c2fab 1713 * @brief Q31 matrix subtraction
AnnaBridge 145:64910690c574 1714 * @param[in] pSrcA points to the first input matrix structure
AnnaBridge 145:64910690c574 1715 * @param[in] pSrcB points to the second input matrix structure
AnnaBridge 145:64910690c574 1716 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1717 * @return The function returns either
<> 132:9baf128c2fab 1718 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1719 */
<> 132:9baf128c2fab 1720 arm_status arm_mat_sub_q31(
<> 132:9baf128c2fab 1721 const arm_matrix_instance_q31 * pSrcA,
<> 132:9baf128c2fab 1722 const arm_matrix_instance_q31 * pSrcB,
<> 132:9baf128c2fab 1723 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1724
AnnaBridge 145:64910690c574 1725
<> 132:9baf128c2fab 1726 /**
<> 132:9baf128c2fab 1727 * @brief Floating-point matrix scaling.
AnnaBridge 145:64910690c574 1728 * @param[in] pSrc points to the input matrix
AnnaBridge 145:64910690c574 1729 * @param[in] scale scale factor
AnnaBridge 145:64910690c574 1730 * @param[out] pDst points to the output matrix
<> 132:9baf128c2fab 1731 * @return The function returns either
<> 132:9baf128c2fab 1732 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1733 */
<> 132:9baf128c2fab 1734 arm_status arm_mat_scale_f32(
<> 132:9baf128c2fab 1735 const arm_matrix_instance_f32 * pSrc,
<> 132:9baf128c2fab 1736 float32_t scale,
<> 132:9baf128c2fab 1737 arm_matrix_instance_f32 * pDst);
<> 132:9baf128c2fab 1738
AnnaBridge 145:64910690c574 1739
<> 132:9baf128c2fab 1740 /**
<> 132:9baf128c2fab 1741 * @brief Q15 matrix scaling.
AnnaBridge 145:64910690c574 1742 * @param[in] pSrc points to input matrix
AnnaBridge 145:64910690c574 1743 * @param[in] scaleFract fractional portion of the scale factor
AnnaBridge 145:64910690c574 1744 * @param[in] shift number of bits to shift the result by
AnnaBridge 145:64910690c574 1745 * @param[out] pDst points to output matrix
<> 132:9baf128c2fab 1746 * @return The function returns either
<> 132:9baf128c2fab 1747 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1748 */
<> 132:9baf128c2fab 1749 arm_status arm_mat_scale_q15(
<> 132:9baf128c2fab 1750 const arm_matrix_instance_q15 * pSrc,
<> 132:9baf128c2fab 1751 q15_t scaleFract,
<> 132:9baf128c2fab 1752 int32_t shift,
<> 132:9baf128c2fab 1753 arm_matrix_instance_q15 * pDst);
<> 132:9baf128c2fab 1754
AnnaBridge 145:64910690c574 1755
<> 132:9baf128c2fab 1756 /**
<> 132:9baf128c2fab 1757 * @brief Q31 matrix scaling.
AnnaBridge 145:64910690c574 1758 * @param[in] pSrc points to input matrix
AnnaBridge 145:64910690c574 1759 * @param[in] scaleFract fractional portion of the scale factor
AnnaBridge 145:64910690c574 1760 * @param[in] shift number of bits to shift the result by
AnnaBridge 145:64910690c574 1761 * @param[out] pDst points to output matrix structure
<> 132:9baf128c2fab 1762 * @return The function returns either
<> 132:9baf128c2fab 1763 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 132:9baf128c2fab 1764 */
<> 132:9baf128c2fab 1765 arm_status arm_mat_scale_q31(
<> 132:9baf128c2fab 1766 const arm_matrix_instance_q31 * pSrc,
<> 132:9baf128c2fab 1767 q31_t scaleFract,
<> 132:9baf128c2fab 1768 int32_t shift,
<> 132:9baf128c2fab 1769 arm_matrix_instance_q31 * pDst);
<> 132:9baf128c2fab 1770
<> 132:9baf128c2fab 1771
<> 132:9baf128c2fab 1772 /**
<> 132:9baf128c2fab 1773 * @brief Q31 matrix initialization.
AnnaBridge 145:64910690c574 1774 * @param[in,out] S points to an instance of the floating-point matrix structure.
AnnaBridge 145:64910690c574 1775 * @param[in] nRows number of rows in the matrix.
AnnaBridge 145:64910690c574 1776 * @param[in] nColumns number of columns in the matrix.
AnnaBridge 145:64910690c574 1777 * @param[in] pData points to the matrix data array.
AnnaBridge 145:64910690c574 1778 */
<> 132:9baf128c2fab 1779 void arm_mat_init_q31(
<> 132:9baf128c2fab 1780 arm_matrix_instance_q31 * S,
<> 132:9baf128c2fab 1781 uint16_t nRows,
<> 132:9baf128c2fab 1782 uint16_t nColumns,
<> 132:9baf128c2fab 1783 q31_t * pData);
<> 132:9baf128c2fab 1784
AnnaBridge 145:64910690c574 1785
<> 132:9baf128c2fab 1786 /**
<> 132:9baf128c2fab 1787 * @brief Q15 matrix initialization.
AnnaBridge 145:64910690c574 1788 * @param[in,out] S points to an instance of the floating-point matrix structure.
AnnaBridge 145:64910690c574 1789 * @param[in] nRows number of rows in the matrix.
AnnaBridge 145:64910690c574 1790 * @param[in] nColumns number of columns in the matrix.
AnnaBridge 145:64910690c574 1791 * @param[in] pData points to the matrix data array.
AnnaBridge 145:64910690c574 1792 */
<> 132:9baf128c2fab 1793 void arm_mat_init_q15(
<> 132:9baf128c2fab 1794 arm_matrix_instance_q15 * S,
<> 132:9baf128c2fab 1795 uint16_t nRows,
<> 132:9baf128c2fab 1796 uint16_t nColumns,
<> 132:9baf128c2fab 1797 q15_t * pData);
<> 132:9baf128c2fab 1798
AnnaBridge 145:64910690c574 1799
<> 132:9baf128c2fab 1800 /**
<> 132:9baf128c2fab 1801 * @brief Floating-point matrix initialization.
AnnaBridge 145:64910690c574 1802 * @param[in,out] S points to an instance of the floating-point matrix structure.
AnnaBridge 145:64910690c574 1803 * @param[in] nRows number of rows in the matrix.
AnnaBridge 145:64910690c574 1804 * @param[in] nColumns number of columns in the matrix.
AnnaBridge 145:64910690c574 1805 * @param[in] pData points to the matrix data array.
AnnaBridge 145:64910690c574 1806 */
<> 132:9baf128c2fab 1807 void arm_mat_init_f32(
<> 132:9baf128c2fab 1808 arm_matrix_instance_f32 * S,
<> 132:9baf128c2fab 1809 uint16_t nRows,
<> 132:9baf128c2fab 1810 uint16_t nColumns,
<> 132:9baf128c2fab 1811 float32_t * pData);
<> 132:9baf128c2fab 1812
<> 132:9baf128c2fab 1813
<> 132:9baf128c2fab 1814
<> 132:9baf128c2fab 1815 /**
<> 132:9baf128c2fab 1816 * @brief Instance structure for the Q15 PID Control.
<> 132:9baf128c2fab 1817 */
<> 132:9baf128c2fab 1818 typedef struct
<> 132:9baf128c2fab 1819 {
AnnaBridge 145:64910690c574 1820 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
AnnaBridge 145:64910690c574 1821 #if !defined (ARM_MATH_DSP)
<> 132:9baf128c2fab 1822 q15_t A1;
<> 132:9baf128c2fab 1823 q15_t A2;
<> 132:9baf128c2fab 1824 #else
<> 132:9baf128c2fab 1825 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
<> 132:9baf128c2fab 1826 #endif
AnnaBridge 145:64910690c574 1827 q15_t state[3]; /**< The state array of length 3. */
<> 132:9baf128c2fab 1828 q15_t Kp; /**< The proportional gain. */
<> 132:9baf128c2fab 1829 q15_t Ki; /**< The integral gain. */
<> 132:9baf128c2fab 1830 q15_t Kd; /**< The derivative gain. */
<> 132:9baf128c2fab 1831 } arm_pid_instance_q15;
<> 132:9baf128c2fab 1832
<> 132:9baf128c2fab 1833 /**
<> 132:9baf128c2fab 1834 * @brief Instance structure for the Q31 PID Control.
<> 132:9baf128c2fab 1835 */
<> 132:9baf128c2fab 1836 typedef struct
<> 132:9baf128c2fab 1837 {
<> 132:9baf128c2fab 1838 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 132:9baf128c2fab 1839 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 132:9baf128c2fab 1840 q31_t A2; /**< The derived gain, A2 = Kd . */
<> 132:9baf128c2fab 1841 q31_t state[3]; /**< The state array of length 3. */
<> 132:9baf128c2fab 1842 q31_t Kp; /**< The proportional gain. */
<> 132:9baf128c2fab 1843 q31_t Ki; /**< The integral gain. */
<> 132:9baf128c2fab 1844 q31_t Kd; /**< The derivative gain. */
<> 132:9baf128c2fab 1845 } arm_pid_instance_q31;
<> 132:9baf128c2fab 1846
<> 132:9baf128c2fab 1847 /**
<> 132:9baf128c2fab 1848 * @brief Instance structure for the floating-point PID Control.
<> 132:9baf128c2fab 1849 */
<> 132:9baf128c2fab 1850 typedef struct
<> 132:9baf128c2fab 1851 {
<> 132:9baf128c2fab 1852 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 132:9baf128c2fab 1853 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 132:9baf128c2fab 1854 float32_t A2; /**< The derived gain, A2 = Kd . */
<> 132:9baf128c2fab 1855 float32_t state[3]; /**< The state array of length 3. */
AnnaBridge 145:64910690c574 1856 float32_t Kp; /**< The proportional gain. */
AnnaBridge 145:64910690c574 1857 float32_t Ki; /**< The integral gain. */
AnnaBridge 145:64910690c574 1858 float32_t Kd; /**< The derivative gain. */
<> 132:9baf128c2fab 1859 } arm_pid_instance_f32;
<> 132:9baf128c2fab 1860
<> 132:9baf128c2fab 1861
<> 132:9baf128c2fab 1862
<> 132:9baf128c2fab 1863 /**
<> 132:9baf128c2fab 1864 * @brief Initialization function for the floating-point PID Control.
AnnaBridge 145:64910690c574 1865 * @param[in,out] S points to an instance of the PID structure.
<> 132:9baf128c2fab 1866 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 132:9baf128c2fab 1867 */
<> 132:9baf128c2fab 1868 void arm_pid_init_f32(
<> 132:9baf128c2fab 1869 arm_pid_instance_f32 * S,
<> 132:9baf128c2fab 1870 int32_t resetStateFlag);
<> 132:9baf128c2fab 1871
AnnaBridge 145:64910690c574 1872
<> 132:9baf128c2fab 1873 /**
<> 132:9baf128c2fab 1874 * @brief Reset function for the floating-point PID Control.
AnnaBridge 145:64910690c574 1875 * @param[in,out] S is an instance of the floating-point PID Control structure
<> 132:9baf128c2fab 1876 */
<> 132:9baf128c2fab 1877 void arm_pid_reset_f32(
<> 132:9baf128c2fab 1878 arm_pid_instance_f32 * S);
<> 132:9baf128c2fab 1879
<> 132:9baf128c2fab 1880
<> 132:9baf128c2fab 1881 /**
<> 132:9baf128c2fab 1882 * @brief Initialization function for the Q31 PID Control.
AnnaBridge 145:64910690c574 1883 * @param[in,out] S points to an instance of the Q15 PID structure.
<> 132:9baf128c2fab 1884 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 132:9baf128c2fab 1885 */
<> 132:9baf128c2fab 1886 void arm_pid_init_q31(
<> 132:9baf128c2fab 1887 arm_pid_instance_q31 * S,
<> 132:9baf128c2fab 1888 int32_t resetStateFlag);
<> 132:9baf128c2fab 1889
<> 132:9baf128c2fab 1890
<> 132:9baf128c2fab 1891 /**
<> 132:9baf128c2fab 1892 * @brief Reset function for the Q31 PID Control.
AnnaBridge 145:64910690c574 1893 * @param[in,out] S points to an instance of the Q31 PID Control structure
<> 132:9baf128c2fab 1894 */
<> 132:9baf128c2fab 1895
<> 132:9baf128c2fab 1896 void arm_pid_reset_q31(
<> 132:9baf128c2fab 1897 arm_pid_instance_q31 * S);
<> 132:9baf128c2fab 1898
AnnaBridge 145:64910690c574 1899
<> 132:9baf128c2fab 1900 /**
<> 132:9baf128c2fab 1901 * @brief Initialization function for the Q15 PID Control.
AnnaBridge 145:64910690c574 1902 * @param[in,out] S points to an instance of the Q15 PID structure.
AnnaBridge 145:64910690c574 1903 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 132:9baf128c2fab 1904 */
<> 132:9baf128c2fab 1905 void arm_pid_init_q15(
<> 132:9baf128c2fab 1906 arm_pid_instance_q15 * S,
<> 132:9baf128c2fab 1907 int32_t resetStateFlag);
<> 132:9baf128c2fab 1908
AnnaBridge 145:64910690c574 1909
<> 132:9baf128c2fab 1910 /**
<> 132:9baf128c2fab 1911 * @brief Reset function for the Q15 PID Control.
AnnaBridge 145:64910690c574 1912 * @param[in,out] S points to an instance of the q15 PID Control structure
<> 132:9baf128c2fab 1913 */
<> 132:9baf128c2fab 1914 void arm_pid_reset_q15(
<> 132:9baf128c2fab 1915 arm_pid_instance_q15 * S);
<> 132:9baf128c2fab 1916
<> 132:9baf128c2fab 1917
<> 132:9baf128c2fab 1918 /**
<> 132:9baf128c2fab 1919 * @brief Instance structure for the floating-point Linear Interpolate function.
<> 132:9baf128c2fab 1920 */
<> 132:9baf128c2fab 1921 typedef struct
<> 132:9baf128c2fab 1922 {
<> 132:9baf128c2fab 1923 uint32_t nValues; /**< nValues */
<> 132:9baf128c2fab 1924 float32_t x1; /**< x1 */
<> 132:9baf128c2fab 1925 float32_t xSpacing; /**< xSpacing */
<> 132:9baf128c2fab 1926 float32_t *pYData; /**< pointer to the table of Y values */
<> 132:9baf128c2fab 1927 } arm_linear_interp_instance_f32;
<> 132:9baf128c2fab 1928
<> 132:9baf128c2fab 1929 /**
<> 132:9baf128c2fab 1930 * @brief Instance structure for the floating-point bilinear interpolation function.
<> 132:9baf128c2fab 1931 */
<> 132:9baf128c2fab 1932 typedef struct
<> 132:9baf128c2fab 1933 {
<> 132:9baf128c2fab 1934 uint16_t numRows; /**< number of rows in the data table. */
<> 132:9baf128c2fab 1935 uint16_t numCols; /**< number of columns in the data table. */
<> 132:9baf128c2fab 1936 float32_t *pData; /**< points to the data table. */
<> 132:9baf128c2fab 1937 } arm_bilinear_interp_instance_f32;
<> 132:9baf128c2fab 1938
<> 132:9baf128c2fab 1939 /**
<> 132:9baf128c2fab 1940 * @brief Instance structure for the Q31 bilinear interpolation function.
<> 132:9baf128c2fab 1941 */
<> 132:9baf128c2fab 1942 typedef struct
<> 132:9baf128c2fab 1943 {
<> 132:9baf128c2fab 1944 uint16_t numRows; /**< number of rows in the data table. */
<> 132:9baf128c2fab 1945 uint16_t numCols; /**< number of columns in the data table. */
<> 132:9baf128c2fab 1946 q31_t *pData; /**< points to the data table. */
<> 132:9baf128c2fab 1947 } arm_bilinear_interp_instance_q31;
<> 132:9baf128c2fab 1948
<> 132:9baf128c2fab 1949 /**
<> 132:9baf128c2fab 1950 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 132:9baf128c2fab 1951 */
<> 132:9baf128c2fab 1952 typedef struct
<> 132:9baf128c2fab 1953 {
<> 132:9baf128c2fab 1954 uint16_t numRows; /**< number of rows in the data table. */
<> 132:9baf128c2fab 1955 uint16_t numCols; /**< number of columns in the data table. */
<> 132:9baf128c2fab 1956 q15_t *pData; /**< points to the data table. */
<> 132:9baf128c2fab 1957 } arm_bilinear_interp_instance_q15;
<> 132:9baf128c2fab 1958
<> 132:9baf128c2fab 1959 /**
<> 132:9baf128c2fab 1960 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 132:9baf128c2fab 1961 */
<> 132:9baf128c2fab 1962 typedef struct
<> 132:9baf128c2fab 1963 {
<> 132:9baf128c2fab 1964 uint16_t numRows; /**< number of rows in the data table. */
<> 132:9baf128c2fab 1965 uint16_t numCols; /**< number of columns in the data table. */
AnnaBridge 145:64910690c574 1966 q7_t *pData; /**< points to the data table. */
<> 132:9baf128c2fab 1967 } arm_bilinear_interp_instance_q7;
<> 132:9baf128c2fab 1968
<> 132:9baf128c2fab 1969
<> 132:9baf128c2fab 1970 /**
<> 132:9baf128c2fab 1971 * @brief Q7 vector multiplication.
AnnaBridge 145:64910690c574 1972 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 1973 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 1974 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 1975 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 1976 */
<> 132:9baf128c2fab 1977 void arm_mult_q7(
<> 132:9baf128c2fab 1978 q7_t * pSrcA,
<> 132:9baf128c2fab 1979 q7_t * pSrcB,
<> 132:9baf128c2fab 1980 q7_t * pDst,
<> 132:9baf128c2fab 1981 uint32_t blockSize);
<> 132:9baf128c2fab 1982
AnnaBridge 145:64910690c574 1983
<> 132:9baf128c2fab 1984 /**
<> 132:9baf128c2fab 1985 * @brief Q15 vector multiplication.
AnnaBridge 145:64910690c574 1986 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 1987 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 1988 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 1989 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 1990 */
<> 132:9baf128c2fab 1991 void arm_mult_q15(
<> 132:9baf128c2fab 1992 q15_t * pSrcA,
<> 132:9baf128c2fab 1993 q15_t * pSrcB,
<> 132:9baf128c2fab 1994 q15_t * pDst,
<> 132:9baf128c2fab 1995 uint32_t blockSize);
<> 132:9baf128c2fab 1996
AnnaBridge 145:64910690c574 1997
<> 132:9baf128c2fab 1998 /**
<> 132:9baf128c2fab 1999 * @brief Q31 vector multiplication.
AnnaBridge 145:64910690c574 2000 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2001 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2002 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2003 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2004 */
<> 132:9baf128c2fab 2005 void arm_mult_q31(
<> 132:9baf128c2fab 2006 q31_t * pSrcA,
<> 132:9baf128c2fab 2007 q31_t * pSrcB,
<> 132:9baf128c2fab 2008 q31_t * pDst,
<> 132:9baf128c2fab 2009 uint32_t blockSize);
<> 132:9baf128c2fab 2010
AnnaBridge 145:64910690c574 2011
<> 132:9baf128c2fab 2012 /**
<> 132:9baf128c2fab 2013 * @brief Floating-point vector multiplication.
AnnaBridge 145:64910690c574 2014 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2015 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2016 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2017 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2018 */
<> 132:9baf128c2fab 2019 void arm_mult_f32(
<> 132:9baf128c2fab 2020 float32_t * pSrcA,
<> 132:9baf128c2fab 2021 float32_t * pSrcB,
<> 132:9baf128c2fab 2022 float32_t * pDst,
<> 132:9baf128c2fab 2023 uint32_t blockSize);
<> 132:9baf128c2fab 2024
<> 132:9baf128c2fab 2025
<> 132:9baf128c2fab 2026 /**
<> 132:9baf128c2fab 2027 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 132:9baf128c2fab 2028 */
<> 132:9baf128c2fab 2029 typedef struct
<> 132:9baf128c2fab 2030 {
<> 132:9baf128c2fab 2031 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2032 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2033 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
AnnaBridge 145:64910690c574 2034 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
<> 132:9baf128c2fab 2035 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2036 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2037 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 132:9baf128c2fab 2038 } arm_cfft_radix2_instance_q15;
<> 132:9baf128c2fab 2039
<> 132:9baf128c2fab 2040 /* Deprecated */
<> 132:9baf128c2fab 2041 arm_status arm_cfft_radix2_init_q15(
<> 132:9baf128c2fab 2042 arm_cfft_radix2_instance_q15 * S,
<> 132:9baf128c2fab 2043 uint16_t fftLen,
<> 132:9baf128c2fab 2044 uint8_t ifftFlag,
<> 132:9baf128c2fab 2045 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2046
<> 132:9baf128c2fab 2047 /* Deprecated */
<> 132:9baf128c2fab 2048 void arm_cfft_radix2_q15(
<> 132:9baf128c2fab 2049 const arm_cfft_radix2_instance_q15 * S,
<> 132:9baf128c2fab 2050 q15_t * pSrc);
<> 132:9baf128c2fab 2051
<> 132:9baf128c2fab 2052
<> 132:9baf128c2fab 2053 /**
<> 132:9baf128c2fab 2054 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 132:9baf128c2fab 2055 */
<> 132:9baf128c2fab 2056 typedef struct
<> 132:9baf128c2fab 2057 {
<> 132:9baf128c2fab 2058 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2059 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2060 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 132:9baf128c2fab 2061 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 132:9baf128c2fab 2062 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2063 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2064 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 132:9baf128c2fab 2065 } arm_cfft_radix4_instance_q15;
<> 132:9baf128c2fab 2066
<> 132:9baf128c2fab 2067 /* Deprecated */
<> 132:9baf128c2fab 2068 arm_status arm_cfft_radix4_init_q15(
<> 132:9baf128c2fab 2069 arm_cfft_radix4_instance_q15 * S,
<> 132:9baf128c2fab 2070 uint16_t fftLen,
<> 132:9baf128c2fab 2071 uint8_t ifftFlag,
<> 132:9baf128c2fab 2072 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2073
<> 132:9baf128c2fab 2074 /* Deprecated */
<> 132:9baf128c2fab 2075 void arm_cfft_radix4_q15(
<> 132:9baf128c2fab 2076 const arm_cfft_radix4_instance_q15 * S,
<> 132:9baf128c2fab 2077 q15_t * pSrc);
<> 132:9baf128c2fab 2078
<> 132:9baf128c2fab 2079 /**
<> 132:9baf128c2fab 2080 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
<> 132:9baf128c2fab 2081 */
<> 132:9baf128c2fab 2082 typedef struct
<> 132:9baf128c2fab 2083 {
<> 132:9baf128c2fab 2084 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2085 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2086 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
AnnaBridge 145:64910690c574 2087 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2088 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2089 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2090 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 132:9baf128c2fab 2091 } arm_cfft_radix2_instance_q31;
<> 132:9baf128c2fab 2092
<> 132:9baf128c2fab 2093 /* Deprecated */
<> 132:9baf128c2fab 2094 arm_status arm_cfft_radix2_init_q31(
<> 132:9baf128c2fab 2095 arm_cfft_radix2_instance_q31 * S,
<> 132:9baf128c2fab 2096 uint16_t fftLen,
<> 132:9baf128c2fab 2097 uint8_t ifftFlag,
<> 132:9baf128c2fab 2098 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2099
<> 132:9baf128c2fab 2100 /* Deprecated */
<> 132:9baf128c2fab 2101 void arm_cfft_radix2_q31(
<> 132:9baf128c2fab 2102 const arm_cfft_radix2_instance_q31 * S,
<> 132:9baf128c2fab 2103 q31_t * pSrc);
<> 132:9baf128c2fab 2104
<> 132:9baf128c2fab 2105 /**
<> 132:9baf128c2fab 2106 * @brief Instance structure for the Q31 CFFT/CIFFT function.
<> 132:9baf128c2fab 2107 */
<> 132:9baf128c2fab 2108 typedef struct
<> 132:9baf128c2fab 2109 {
<> 132:9baf128c2fab 2110 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2111 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2112 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 132:9baf128c2fab 2113 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 132:9baf128c2fab 2114 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2115 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2116 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 132:9baf128c2fab 2117 } arm_cfft_radix4_instance_q31;
<> 132:9baf128c2fab 2118
<> 132:9baf128c2fab 2119 /* Deprecated */
<> 132:9baf128c2fab 2120 void arm_cfft_radix4_q31(
<> 132:9baf128c2fab 2121 const arm_cfft_radix4_instance_q31 * S,
<> 132:9baf128c2fab 2122 q31_t * pSrc);
<> 132:9baf128c2fab 2123
<> 132:9baf128c2fab 2124 /* Deprecated */
<> 132:9baf128c2fab 2125 arm_status arm_cfft_radix4_init_q31(
<> 132:9baf128c2fab 2126 arm_cfft_radix4_instance_q31 * S,
<> 132:9baf128c2fab 2127 uint16_t fftLen,
<> 132:9baf128c2fab 2128 uint8_t ifftFlag,
<> 132:9baf128c2fab 2129 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2130
<> 132:9baf128c2fab 2131 /**
<> 132:9baf128c2fab 2132 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 132:9baf128c2fab 2133 */
<> 132:9baf128c2fab 2134 typedef struct
<> 132:9baf128c2fab 2135 {
<> 132:9baf128c2fab 2136 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2137 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2138 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 132:9baf128c2fab 2139 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2140 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2141 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2142 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
AnnaBridge 145:64910690c574 2143 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 132:9baf128c2fab 2144 } arm_cfft_radix2_instance_f32;
<> 132:9baf128c2fab 2145
<> 132:9baf128c2fab 2146 /* Deprecated */
<> 132:9baf128c2fab 2147 arm_status arm_cfft_radix2_init_f32(
<> 132:9baf128c2fab 2148 arm_cfft_radix2_instance_f32 * S,
<> 132:9baf128c2fab 2149 uint16_t fftLen,
<> 132:9baf128c2fab 2150 uint8_t ifftFlag,
<> 132:9baf128c2fab 2151 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2152
<> 132:9baf128c2fab 2153 /* Deprecated */
<> 132:9baf128c2fab 2154 void arm_cfft_radix2_f32(
<> 132:9baf128c2fab 2155 const arm_cfft_radix2_instance_f32 * S,
<> 132:9baf128c2fab 2156 float32_t * pSrc);
<> 132:9baf128c2fab 2157
<> 132:9baf128c2fab 2158 /**
<> 132:9baf128c2fab 2159 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 132:9baf128c2fab 2160 */
<> 132:9baf128c2fab 2161 typedef struct
<> 132:9baf128c2fab 2162 {
<> 132:9baf128c2fab 2163 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2164 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 132:9baf128c2fab 2165 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 132:9baf128c2fab 2166 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2167 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2168 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2169 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
AnnaBridge 145:64910690c574 2170 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 132:9baf128c2fab 2171 } arm_cfft_radix4_instance_f32;
<> 132:9baf128c2fab 2172
<> 132:9baf128c2fab 2173 /* Deprecated */
<> 132:9baf128c2fab 2174 arm_status arm_cfft_radix4_init_f32(
<> 132:9baf128c2fab 2175 arm_cfft_radix4_instance_f32 * S,
<> 132:9baf128c2fab 2176 uint16_t fftLen,
<> 132:9baf128c2fab 2177 uint8_t ifftFlag,
<> 132:9baf128c2fab 2178 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2179
<> 132:9baf128c2fab 2180 /* Deprecated */
<> 132:9baf128c2fab 2181 void arm_cfft_radix4_f32(
<> 132:9baf128c2fab 2182 const arm_cfft_radix4_instance_f32 * S,
<> 132:9baf128c2fab 2183 float32_t * pSrc);
<> 132:9baf128c2fab 2184
<> 132:9baf128c2fab 2185 /**
<> 132:9baf128c2fab 2186 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 132:9baf128c2fab 2187 */
<> 132:9baf128c2fab 2188 typedef struct
<> 132:9baf128c2fab 2189 {
<> 132:9baf128c2fab 2190 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2191 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2192 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2193 uint16_t bitRevLength; /**< bit reversal table length. */
<> 132:9baf128c2fab 2194 } arm_cfft_instance_q15;
<> 132:9baf128c2fab 2195
AnnaBridge 145:64910690c574 2196 void arm_cfft_q15(
AnnaBridge 145:64910690c574 2197 const arm_cfft_instance_q15 * S,
<> 132:9baf128c2fab 2198 q15_t * p1,
<> 132:9baf128c2fab 2199 uint8_t ifftFlag,
AnnaBridge 145:64910690c574 2200 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2201
<> 132:9baf128c2fab 2202 /**
<> 132:9baf128c2fab 2203 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 132:9baf128c2fab 2204 */
<> 132:9baf128c2fab 2205 typedef struct
<> 132:9baf128c2fab 2206 {
<> 132:9baf128c2fab 2207 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2208 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2209 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2210 uint16_t bitRevLength; /**< bit reversal table length. */
<> 132:9baf128c2fab 2211 } arm_cfft_instance_q31;
<> 132:9baf128c2fab 2212
AnnaBridge 145:64910690c574 2213 void arm_cfft_q31(
AnnaBridge 145:64910690c574 2214 const arm_cfft_instance_q31 * S,
<> 132:9baf128c2fab 2215 q31_t * p1,
<> 132:9baf128c2fab 2216 uint8_t ifftFlag,
AnnaBridge 145:64910690c574 2217 uint8_t bitReverseFlag);
AnnaBridge 145:64910690c574 2218
<> 132:9baf128c2fab 2219 /**
<> 132:9baf128c2fab 2220 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 132:9baf128c2fab 2221 */
<> 132:9baf128c2fab 2222 typedef struct
<> 132:9baf128c2fab 2223 {
<> 132:9baf128c2fab 2224 uint16_t fftLen; /**< length of the FFT. */
<> 132:9baf128c2fab 2225 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 132:9baf128c2fab 2226 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 132:9baf128c2fab 2227 uint16_t bitRevLength; /**< bit reversal table length. */
<> 132:9baf128c2fab 2228 } arm_cfft_instance_f32;
<> 132:9baf128c2fab 2229
<> 132:9baf128c2fab 2230 void arm_cfft_f32(
<> 132:9baf128c2fab 2231 const arm_cfft_instance_f32 * S,
<> 132:9baf128c2fab 2232 float32_t * p1,
<> 132:9baf128c2fab 2233 uint8_t ifftFlag,
<> 132:9baf128c2fab 2234 uint8_t bitReverseFlag);
<> 132:9baf128c2fab 2235
<> 132:9baf128c2fab 2236 /**
<> 132:9baf128c2fab 2237 * @brief Instance structure for the Q15 RFFT/RIFFT function.
<> 132:9baf128c2fab 2238 */
<> 132:9baf128c2fab 2239 typedef struct
<> 132:9baf128c2fab 2240 {
<> 132:9baf128c2fab 2241 uint32_t fftLenReal; /**< length of the real FFT. */
<> 132:9baf128c2fab 2242 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 132:9baf128c2fab 2243 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 132:9baf128c2fab 2244 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2245 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 132:9baf128c2fab 2246 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 132:9baf128c2fab 2247 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2248 } arm_rfft_instance_q15;
<> 132:9baf128c2fab 2249
<> 132:9baf128c2fab 2250 arm_status arm_rfft_init_q15(
<> 132:9baf128c2fab 2251 arm_rfft_instance_q15 * S,
<> 132:9baf128c2fab 2252 uint32_t fftLenReal,
<> 132:9baf128c2fab 2253 uint32_t ifftFlagR,
<> 132:9baf128c2fab 2254 uint32_t bitReverseFlag);
<> 132:9baf128c2fab 2255
<> 132:9baf128c2fab 2256 void arm_rfft_q15(
<> 132:9baf128c2fab 2257 const arm_rfft_instance_q15 * S,
<> 132:9baf128c2fab 2258 q15_t * pSrc,
<> 132:9baf128c2fab 2259 q15_t * pDst);
<> 132:9baf128c2fab 2260
<> 132:9baf128c2fab 2261 /**
<> 132:9baf128c2fab 2262 * @brief Instance structure for the Q31 RFFT/RIFFT function.
<> 132:9baf128c2fab 2263 */
<> 132:9baf128c2fab 2264 typedef struct
<> 132:9baf128c2fab 2265 {
<> 132:9baf128c2fab 2266 uint32_t fftLenReal; /**< length of the real FFT. */
<> 132:9baf128c2fab 2267 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 132:9baf128c2fab 2268 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 132:9baf128c2fab 2269 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2270 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 132:9baf128c2fab 2271 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 132:9baf128c2fab 2272 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2273 } arm_rfft_instance_q31;
<> 132:9baf128c2fab 2274
<> 132:9baf128c2fab 2275 arm_status arm_rfft_init_q31(
<> 132:9baf128c2fab 2276 arm_rfft_instance_q31 * S,
<> 132:9baf128c2fab 2277 uint32_t fftLenReal,
<> 132:9baf128c2fab 2278 uint32_t ifftFlagR,
<> 132:9baf128c2fab 2279 uint32_t bitReverseFlag);
<> 132:9baf128c2fab 2280
<> 132:9baf128c2fab 2281 void arm_rfft_q31(
<> 132:9baf128c2fab 2282 const arm_rfft_instance_q31 * S,
<> 132:9baf128c2fab 2283 q31_t * pSrc,
<> 132:9baf128c2fab 2284 q31_t * pDst);
<> 132:9baf128c2fab 2285
<> 132:9baf128c2fab 2286 /**
<> 132:9baf128c2fab 2287 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 132:9baf128c2fab 2288 */
<> 132:9baf128c2fab 2289 typedef struct
<> 132:9baf128c2fab 2290 {
<> 132:9baf128c2fab 2291 uint32_t fftLenReal; /**< length of the real FFT. */
<> 132:9baf128c2fab 2292 uint16_t fftLenBy2; /**< length of the complex FFT. */
<> 132:9baf128c2fab 2293 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 132:9baf128c2fab 2294 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 132:9baf128c2fab 2295 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 132:9baf128c2fab 2296 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 132:9baf128c2fab 2297 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 132:9baf128c2fab 2298 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2299 } arm_rfft_instance_f32;
<> 132:9baf128c2fab 2300
<> 132:9baf128c2fab 2301 arm_status arm_rfft_init_f32(
<> 132:9baf128c2fab 2302 arm_rfft_instance_f32 * S,
<> 132:9baf128c2fab 2303 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 132:9baf128c2fab 2304 uint32_t fftLenReal,
<> 132:9baf128c2fab 2305 uint32_t ifftFlagR,
<> 132:9baf128c2fab 2306 uint32_t bitReverseFlag);
<> 132:9baf128c2fab 2307
<> 132:9baf128c2fab 2308 void arm_rfft_f32(
<> 132:9baf128c2fab 2309 const arm_rfft_instance_f32 * S,
<> 132:9baf128c2fab 2310 float32_t * pSrc,
<> 132:9baf128c2fab 2311 float32_t * pDst);
<> 132:9baf128c2fab 2312
<> 132:9baf128c2fab 2313 /**
<> 132:9baf128c2fab 2314 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 132:9baf128c2fab 2315 */
<> 132:9baf128c2fab 2316 typedef struct
<> 132:9baf128c2fab 2317 {
<> 132:9baf128c2fab 2318 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
AnnaBridge 145:64910690c574 2319 uint16_t fftLenRFFT; /**< length of the real sequence */
AnnaBridge 145:64910690c574 2320 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
<> 132:9baf128c2fab 2321 } arm_rfft_fast_instance_f32 ;
<> 132:9baf128c2fab 2322
<> 132:9baf128c2fab 2323 arm_status arm_rfft_fast_init_f32 (
AnnaBridge 145:64910690c574 2324 arm_rfft_fast_instance_f32 * S,
AnnaBridge 145:64910690c574 2325 uint16_t fftLen);
<> 132:9baf128c2fab 2326
<> 132:9baf128c2fab 2327 void arm_rfft_fast_f32(
<> 132:9baf128c2fab 2328 arm_rfft_fast_instance_f32 * S,
<> 132:9baf128c2fab 2329 float32_t * p, float32_t * pOut,
<> 132:9baf128c2fab 2330 uint8_t ifftFlag);
<> 132:9baf128c2fab 2331
<> 132:9baf128c2fab 2332 /**
<> 132:9baf128c2fab 2333 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
<> 132:9baf128c2fab 2334 */
<> 132:9baf128c2fab 2335 typedef struct
<> 132:9baf128c2fab 2336 {
AnnaBridge 145:64910690c574 2337 uint16_t N; /**< length of the DCT4. */
AnnaBridge 145:64910690c574 2338 uint16_t Nby2; /**< half of the length of the DCT4. */
AnnaBridge 145:64910690c574 2339 float32_t normalize; /**< normalizing factor. */
AnnaBridge 145:64910690c574 2340 float32_t *pTwiddle; /**< points to the twiddle factor table. */
AnnaBridge 145:64910690c574 2341 float32_t *pCosFactor; /**< points to the cosFactor table. */
<> 132:9baf128c2fab 2342 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
<> 132:9baf128c2fab 2343 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2344 } arm_dct4_instance_f32;
<> 132:9baf128c2fab 2345
AnnaBridge 145:64910690c574 2346
<> 132:9baf128c2fab 2347 /**
<> 132:9baf128c2fab 2348 * @brief Initialization function for the floating-point DCT4/IDCT4.
AnnaBridge 145:64910690c574 2349 * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure.
AnnaBridge 145:64910690c574 2350 * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
AnnaBridge 145:64910690c574 2351 * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
<> 132:9baf128c2fab 2352 * @param[in] N length of the DCT4.
<> 132:9baf128c2fab 2353 * @param[in] Nby2 half of the length of the DCT4.
<> 132:9baf128c2fab 2354 * @param[in] normalize normalizing factor.
AnnaBridge 145:64910690c574 2355 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported transform length.
AnnaBridge 145:64910690c574 2356 */
<> 132:9baf128c2fab 2357 arm_status arm_dct4_init_f32(
<> 132:9baf128c2fab 2358 arm_dct4_instance_f32 * S,
<> 132:9baf128c2fab 2359 arm_rfft_instance_f32 * S_RFFT,
<> 132:9baf128c2fab 2360 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 132:9baf128c2fab 2361 uint16_t N,
<> 132:9baf128c2fab 2362 uint16_t Nby2,
<> 132:9baf128c2fab 2363 float32_t normalize);
<> 132:9baf128c2fab 2364
AnnaBridge 145:64910690c574 2365
<> 132:9baf128c2fab 2366 /**
<> 132:9baf128c2fab 2367 * @brief Processing function for the floating-point DCT4/IDCT4.
AnnaBridge 145:64910690c574 2368 * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure.
AnnaBridge 145:64910690c574 2369 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 2370 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
AnnaBridge 145:64910690c574 2371 */
<> 132:9baf128c2fab 2372 void arm_dct4_f32(
<> 132:9baf128c2fab 2373 const arm_dct4_instance_f32 * S,
<> 132:9baf128c2fab 2374 float32_t * pState,
<> 132:9baf128c2fab 2375 float32_t * pInlineBuffer);
<> 132:9baf128c2fab 2376
AnnaBridge 145:64910690c574 2377
<> 132:9baf128c2fab 2378 /**
<> 132:9baf128c2fab 2379 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
<> 132:9baf128c2fab 2380 */
<> 132:9baf128c2fab 2381 typedef struct
<> 132:9baf128c2fab 2382 {
AnnaBridge 145:64910690c574 2383 uint16_t N; /**< length of the DCT4. */
AnnaBridge 145:64910690c574 2384 uint16_t Nby2; /**< half of the length of the DCT4. */
AnnaBridge 145:64910690c574 2385 q31_t normalize; /**< normalizing factor. */
AnnaBridge 145:64910690c574 2386 q31_t *pTwiddle; /**< points to the twiddle factor table. */
AnnaBridge 145:64910690c574 2387 q31_t *pCosFactor; /**< points to the cosFactor table. */
<> 132:9baf128c2fab 2388 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
<> 132:9baf128c2fab 2389 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2390 } arm_dct4_instance_q31;
<> 132:9baf128c2fab 2391
AnnaBridge 145:64910690c574 2392
<> 132:9baf128c2fab 2393 /**
<> 132:9baf128c2fab 2394 * @brief Initialization function for the Q31 DCT4/IDCT4.
AnnaBridge 145:64910690c574 2395 * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure.
AnnaBridge 145:64910690c574 2396 * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure
AnnaBridge 145:64910690c574 2397 * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure
<> 132:9baf128c2fab 2398 * @param[in] N length of the DCT4.
<> 132:9baf128c2fab 2399 * @param[in] Nby2 half of the length of the DCT4.
<> 132:9baf128c2fab 2400 * @param[in] normalize normalizing factor.
AnnaBridge 145:64910690c574 2401 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length.
AnnaBridge 145:64910690c574 2402 */
<> 132:9baf128c2fab 2403 arm_status arm_dct4_init_q31(
<> 132:9baf128c2fab 2404 arm_dct4_instance_q31 * S,
<> 132:9baf128c2fab 2405 arm_rfft_instance_q31 * S_RFFT,
<> 132:9baf128c2fab 2406 arm_cfft_radix4_instance_q31 * S_CFFT,
<> 132:9baf128c2fab 2407 uint16_t N,
<> 132:9baf128c2fab 2408 uint16_t Nby2,
<> 132:9baf128c2fab 2409 q31_t normalize);
<> 132:9baf128c2fab 2410
AnnaBridge 145:64910690c574 2411
<> 132:9baf128c2fab 2412 /**
<> 132:9baf128c2fab 2413 * @brief Processing function for the Q31 DCT4/IDCT4.
AnnaBridge 145:64910690c574 2414 * @param[in] S points to an instance of the Q31 DCT4 structure.
AnnaBridge 145:64910690c574 2415 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 2416 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
AnnaBridge 145:64910690c574 2417 */
<> 132:9baf128c2fab 2418 void arm_dct4_q31(
<> 132:9baf128c2fab 2419 const arm_dct4_instance_q31 * S,
<> 132:9baf128c2fab 2420 q31_t * pState,
<> 132:9baf128c2fab 2421 q31_t * pInlineBuffer);
<> 132:9baf128c2fab 2422
AnnaBridge 145:64910690c574 2423
<> 132:9baf128c2fab 2424 /**
<> 132:9baf128c2fab 2425 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
<> 132:9baf128c2fab 2426 */
<> 132:9baf128c2fab 2427 typedef struct
<> 132:9baf128c2fab 2428 {
AnnaBridge 145:64910690c574 2429 uint16_t N; /**< length of the DCT4. */
AnnaBridge 145:64910690c574 2430 uint16_t Nby2; /**< half of the length of the DCT4. */
AnnaBridge 145:64910690c574 2431 q15_t normalize; /**< normalizing factor. */
AnnaBridge 145:64910690c574 2432 q15_t *pTwiddle; /**< points to the twiddle factor table. */
AnnaBridge 145:64910690c574 2433 q15_t *pCosFactor; /**< points to the cosFactor table. */
<> 132:9baf128c2fab 2434 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
<> 132:9baf128c2fab 2435 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 132:9baf128c2fab 2436 } arm_dct4_instance_q15;
<> 132:9baf128c2fab 2437
AnnaBridge 145:64910690c574 2438
<> 132:9baf128c2fab 2439 /**
<> 132:9baf128c2fab 2440 * @brief Initialization function for the Q15 DCT4/IDCT4.
AnnaBridge 145:64910690c574 2441 * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure.
AnnaBridge 145:64910690c574 2442 * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
AnnaBridge 145:64910690c574 2443 * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
<> 132:9baf128c2fab 2444 * @param[in] N length of the DCT4.
<> 132:9baf128c2fab 2445 * @param[in] Nby2 half of the length of the DCT4.
<> 132:9baf128c2fab 2446 * @param[in] normalize normalizing factor.
AnnaBridge 145:64910690c574 2447 * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length.
AnnaBridge 145:64910690c574 2448 */
<> 132:9baf128c2fab 2449 arm_status arm_dct4_init_q15(
<> 132:9baf128c2fab 2450 arm_dct4_instance_q15 * S,
<> 132:9baf128c2fab 2451 arm_rfft_instance_q15 * S_RFFT,
<> 132:9baf128c2fab 2452 arm_cfft_radix4_instance_q15 * S_CFFT,
<> 132:9baf128c2fab 2453 uint16_t N,
<> 132:9baf128c2fab 2454 uint16_t Nby2,
<> 132:9baf128c2fab 2455 q15_t normalize);
<> 132:9baf128c2fab 2456
AnnaBridge 145:64910690c574 2457
<> 132:9baf128c2fab 2458 /**
<> 132:9baf128c2fab 2459 * @brief Processing function for the Q15 DCT4/IDCT4.
AnnaBridge 145:64910690c574 2460 * @param[in] S points to an instance of the Q15 DCT4 structure.
AnnaBridge 145:64910690c574 2461 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 2462 * @param[in,out] pInlineBuffer points to the in-place input and output buffer.
AnnaBridge 145:64910690c574 2463 */
<> 132:9baf128c2fab 2464 void arm_dct4_q15(
<> 132:9baf128c2fab 2465 const arm_dct4_instance_q15 * S,
<> 132:9baf128c2fab 2466 q15_t * pState,
<> 132:9baf128c2fab 2467 q15_t * pInlineBuffer);
<> 132:9baf128c2fab 2468
AnnaBridge 145:64910690c574 2469
<> 132:9baf128c2fab 2470 /**
<> 132:9baf128c2fab 2471 * @brief Floating-point vector addition.
AnnaBridge 145:64910690c574 2472 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2473 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2474 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2475 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2476 */
<> 132:9baf128c2fab 2477 void arm_add_f32(
<> 132:9baf128c2fab 2478 float32_t * pSrcA,
<> 132:9baf128c2fab 2479 float32_t * pSrcB,
<> 132:9baf128c2fab 2480 float32_t * pDst,
<> 132:9baf128c2fab 2481 uint32_t blockSize);
<> 132:9baf128c2fab 2482
AnnaBridge 145:64910690c574 2483
<> 132:9baf128c2fab 2484 /**
<> 132:9baf128c2fab 2485 * @brief Q7 vector addition.
AnnaBridge 145:64910690c574 2486 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2487 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2488 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2489 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2490 */
<> 132:9baf128c2fab 2491 void arm_add_q7(
<> 132:9baf128c2fab 2492 q7_t * pSrcA,
<> 132:9baf128c2fab 2493 q7_t * pSrcB,
<> 132:9baf128c2fab 2494 q7_t * pDst,
<> 132:9baf128c2fab 2495 uint32_t blockSize);
<> 132:9baf128c2fab 2496
AnnaBridge 145:64910690c574 2497
<> 132:9baf128c2fab 2498 /**
<> 132:9baf128c2fab 2499 * @brief Q15 vector addition.
AnnaBridge 145:64910690c574 2500 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2501 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2502 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2503 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2504 */
<> 132:9baf128c2fab 2505 void arm_add_q15(
<> 132:9baf128c2fab 2506 q15_t * pSrcA,
<> 132:9baf128c2fab 2507 q15_t * pSrcB,
<> 132:9baf128c2fab 2508 q15_t * pDst,
<> 132:9baf128c2fab 2509 uint32_t blockSize);
<> 132:9baf128c2fab 2510
AnnaBridge 145:64910690c574 2511
<> 132:9baf128c2fab 2512 /**
<> 132:9baf128c2fab 2513 * @brief Q31 vector addition.
AnnaBridge 145:64910690c574 2514 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2515 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2516 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2517 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2518 */
<> 132:9baf128c2fab 2519 void arm_add_q31(
<> 132:9baf128c2fab 2520 q31_t * pSrcA,
<> 132:9baf128c2fab 2521 q31_t * pSrcB,
<> 132:9baf128c2fab 2522 q31_t * pDst,
<> 132:9baf128c2fab 2523 uint32_t blockSize);
<> 132:9baf128c2fab 2524
AnnaBridge 145:64910690c574 2525
<> 132:9baf128c2fab 2526 /**
<> 132:9baf128c2fab 2527 * @brief Floating-point vector subtraction.
AnnaBridge 145:64910690c574 2528 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2529 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2530 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2531 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2532 */
<> 132:9baf128c2fab 2533 void arm_sub_f32(
<> 132:9baf128c2fab 2534 float32_t * pSrcA,
<> 132:9baf128c2fab 2535 float32_t * pSrcB,
<> 132:9baf128c2fab 2536 float32_t * pDst,
<> 132:9baf128c2fab 2537 uint32_t blockSize);
<> 132:9baf128c2fab 2538
AnnaBridge 145:64910690c574 2539
<> 132:9baf128c2fab 2540 /**
<> 132:9baf128c2fab 2541 * @brief Q7 vector subtraction.
AnnaBridge 145:64910690c574 2542 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2543 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2544 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2545 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2546 */
<> 132:9baf128c2fab 2547 void arm_sub_q7(
<> 132:9baf128c2fab 2548 q7_t * pSrcA,
<> 132:9baf128c2fab 2549 q7_t * pSrcB,
<> 132:9baf128c2fab 2550 q7_t * pDst,
<> 132:9baf128c2fab 2551 uint32_t blockSize);
<> 132:9baf128c2fab 2552
AnnaBridge 145:64910690c574 2553
<> 132:9baf128c2fab 2554 /**
<> 132:9baf128c2fab 2555 * @brief Q15 vector subtraction.
AnnaBridge 145:64910690c574 2556 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2557 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2558 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2559 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2560 */
<> 132:9baf128c2fab 2561 void arm_sub_q15(
<> 132:9baf128c2fab 2562 q15_t * pSrcA,
<> 132:9baf128c2fab 2563 q15_t * pSrcB,
<> 132:9baf128c2fab 2564 q15_t * pDst,
<> 132:9baf128c2fab 2565 uint32_t blockSize);
<> 132:9baf128c2fab 2566
AnnaBridge 145:64910690c574 2567
<> 132:9baf128c2fab 2568 /**
<> 132:9baf128c2fab 2569 * @brief Q31 vector subtraction.
AnnaBridge 145:64910690c574 2570 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2571 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2572 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2573 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2574 */
<> 132:9baf128c2fab 2575 void arm_sub_q31(
<> 132:9baf128c2fab 2576 q31_t * pSrcA,
<> 132:9baf128c2fab 2577 q31_t * pSrcB,
<> 132:9baf128c2fab 2578 q31_t * pDst,
<> 132:9baf128c2fab 2579 uint32_t blockSize);
<> 132:9baf128c2fab 2580
AnnaBridge 145:64910690c574 2581
<> 132:9baf128c2fab 2582 /**
<> 132:9baf128c2fab 2583 * @brief Multiplies a floating-point vector by a scalar.
AnnaBridge 145:64910690c574 2584 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2585 * @param[in] scale scale factor to be applied
AnnaBridge 145:64910690c574 2586 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2587 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2588 */
<> 132:9baf128c2fab 2589 void arm_scale_f32(
<> 132:9baf128c2fab 2590 float32_t * pSrc,
<> 132:9baf128c2fab 2591 float32_t scale,
<> 132:9baf128c2fab 2592 float32_t * pDst,
<> 132:9baf128c2fab 2593 uint32_t blockSize);
<> 132:9baf128c2fab 2594
AnnaBridge 145:64910690c574 2595
<> 132:9baf128c2fab 2596 /**
<> 132:9baf128c2fab 2597 * @brief Multiplies a Q7 vector by a scalar.
AnnaBridge 145:64910690c574 2598 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2599 * @param[in] scaleFract fractional portion of the scale value
AnnaBridge 145:64910690c574 2600 * @param[in] shift number of bits to shift the result by
AnnaBridge 145:64910690c574 2601 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2602 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2603 */
<> 132:9baf128c2fab 2604 void arm_scale_q7(
<> 132:9baf128c2fab 2605 q7_t * pSrc,
<> 132:9baf128c2fab 2606 q7_t scaleFract,
<> 132:9baf128c2fab 2607 int8_t shift,
<> 132:9baf128c2fab 2608 q7_t * pDst,
<> 132:9baf128c2fab 2609 uint32_t blockSize);
<> 132:9baf128c2fab 2610
AnnaBridge 145:64910690c574 2611
<> 132:9baf128c2fab 2612 /**
<> 132:9baf128c2fab 2613 * @brief Multiplies a Q15 vector by a scalar.
AnnaBridge 145:64910690c574 2614 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2615 * @param[in] scaleFract fractional portion of the scale value
AnnaBridge 145:64910690c574 2616 * @param[in] shift number of bits to shift the result by
AnnaBridge 145:64910690c574 2617 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2618 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2619 */
<> 132:9baf128c2fab 2620 void arm_scale_q15(
<> 132:9baf128c2fab 2621 q15_t * pSrc,
<> 132:9baf128c2fab 2622 q15_t scaleFract,
<> 132:9baf128c2fab 2623 int8_t shift,
<> 132:9baf128c2fab 2624 q15_t * pDst,
<> 132:9baf128c2fab 2625 uint32_t blockSize);
<> 132:9baf128c2fab 2626
AnnaBridge 145:64910690c574 2627
<> 132:9baf128c2fab 2628 /**
<> 132:9baf128c2fab 2629 * @brief Multiplies a Q31 vector by a scalar.
AnnaBridge 145:64910690c574 2630 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2631 * @param[in] scaleFract fractional portion of the scale value
AnnaBridge 145:64910690c574 2632 * @param[in] shift number of bits to shift the result by
AnnaBridge 145:64910690c574 2633 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2634 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2635 */
<> 132:9baf128c2fab 2636 void arm_scale_q31(
<> 132:9baf128c2fab 2637 q31_t * pSrc,
<> 132:9baf128c2fab 2638 q31_t scaleFract,
<> 132:9baf128c2fab 2639 int8_t shift,
<> 132:9baf128c2fab 2640 q31_t * pDst,
<> 132:9baf128c2fab 2641 uint32_t blockSize);
<> 132:9baf128c2fab 2642
AnnaBridge 145:64910690c574 2643
<> 132:9baf128c2fab 2644 /**
<> 132:9baf128c2fab 2645 * @brief Q7 vector absolute value.
AnnaBridge 145:64910690c574 2646 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 2647 * @param[out] pDst points to the output buffer
AnnaBridge 145:64910690c574 2648 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2649 */
<> 132:9baf128c2fab 2650 void arm_abs_q7(
<> 132:9baf128c2fab 2651 q7_t * pSrc,
<> 132:9baf128c2fab 2652 q7_t * pDst,
<> 132:9baf128c2fab 2653 uint32_t blockSize);
<> 132:9baf128c2fab 2654
AnnaBridge 145:64910690c574 2655
<> 132:9baf128c2fab 2656 /**
<> 132:9baf128c2fab 2657 * @brief Floating-point vector absolute value.
AnnaBridge 145:64910690c574 2658 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 2659 * @param[out] pDst points to the output buffer
AnnaBridge 145:64910690c574 2660 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2661 */
<> 132:9baf128c2fab 2662 void arm_abs_f32(
<> 132:9baf128c2fab 2663 float32_t * pSrc,
<> 132:9baf128c2fab 2664 float32_t * pDst,
<> 132:9baf128c2fab 2665 uint32_t blockSize);
<> 132:9baf128c2fab 2666
AnnaBridge 145:64910690c574 2667
<> 132:9baf128c2fab 2668 /**
<> 132:9baf128c2fab 2669 * @brief Q15 vector absolute value.
AnnaBridge 145:64910690c574 2670 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 2671 * @param[out] pDst points to the output buffer
AnnaBridge 145:64910690c574 2672 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2673 */
<> 132:9baf128c2fab 2674 void arm_abs_q15(
<> 132:9baf128c2fab 2675 q15_t * pSrc,
<> 132:9baf128c2fab 2676 q15_t * pDst,
<> 132:9baf128c2fab 2677 uint32_t blockSize);
<> 132:9baf128c2fab 2678
AnnaBridge 145:64910690c574 2679
<> 132:9baf128c2fab 2680 /**
<> 132:9baf128c2fab 2681 * @brief Q31 vector absolute value.
AnnaBridge 145:64910690c574 2682 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 2683 * @param[out] pDst points to the output buffer
AnnaBridge 145:64910690c574 2684 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2685 */
<> 132:9baf128c2fab 2686 void arm_abs_q31(
<> 132:9baf128c2fab 2687 q31_t * pSrc,
<> 132:9baf128c2fab 2688 q31_t * pDst,
<> 132:9baf128c2fab 2689 uint32_t blockSize);
<> 132:9baf128c2fab 2690
AnnaBridge 145:64910690c574 2691
<> 132:9baf128c2fab 2692 /**
<> 132:9baf128c2fab 2693 * @brief Dot product of floating-point vectors.
AnnaBridge 145:64910690c574 2694 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2695 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2696 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2697 * @param[out] result output result returned here
AnnaBridge 145:64910690c574 2698 */
<> 132:9baf128c2fab 2699 void arm_dot_prod_f32(
<> 132:9baf128c2fab 2700 float32_t * pSrcA,
<> 132:9baf128c2fab 2701 float32_t * pSrcB,
<> 132:9baf128c2fab 2702 uint32_t blockSize,
<> 132:9baf128c2fab 2703 float32_t * result);
<> 132:9baf128c2fab 2704
AnnaBridge 145:64910690c574 2705
<> 132:9baf128c2fab 2706 /**
<> 132:9baf128c2fab 2707 * @brief Dot product of Q7 vectors.
AnnaBridge 145:64910690c574 2708 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2709 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2710 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2711 * @param[out] result output result returned here
AnnaBridge 145:64910690c574 2712 */
<> 132:9baf128c2fab 2713 void arm_dot_prod_q7(
<> 132:9baf128c2fab 2714 q7_t * pSrcA,
<> 132:9baf128c2fab 2715 q7_t * pSrcB,
<> 132:9baf128c2fab 2716 uint32_t blockSize,
<> 132:9baf128c2fab 2717 q31_t * result);
<> 132:9baf128c2fab 2718
AnnaBridge 145:64910690c574 2719
<> 132:9baf128c2fab 2720 /**
<> 132:9baf128c2fab 2721 * @brief Dot product of Q15 vectors.
AnnaBridge 145:64910690c574 2722 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2723 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2724 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2725 * @param[out] result output result returned here
AnnaBridge 145:64910690c574 2726 */
<> 132:9baf128c2fab 2727 void arm_dot_prod_q15(
<> 132:9baf128c2fab 2728 q15_t * pSrcA,
<> 132:9baf128c2fab 2729 q15_t * pSrcB,
<> 132:9baf128c2fab 2730 uint32_t blockSize,
<> 132:9baf128c2fab 2731 q63_t * result);
<> 132:9baf128c2fab 2732
AnnaBridge 145:64910690c574 2733
<> 132:9baf128c2fab 2734 /**
<> 132:9baf128c2fab 2735 * @brief Dot product of Q31 vectors.
AnnaBridge 145:64910690c574 2736 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 2737 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 2738 * @param[in] blockSize number of samples in each vector
AnnaBridge 145:64910690c574 2739 * @param[out] result output result returned here
AnnaBridge 145:64910690c574 2740 */
<> 132:9baf128c2fab 2741 void arm_dot_prod_q31(
<> 132:9baf128c2fab 2742 q31_t * pSrcA,
<> 132:9baf128c2fab 2743 q31_t * pSrcB,
<> 132:9baf128c2fab 2744 uint32_t blockSize,
<> 132:9baf128c2fab 2745 q63_t * result);
<> 132:9baf128c2fab 2746
AnnaBridge 145:64910690c574 2747
<> 132:9baf128c2fab 2748 /**
<> 132:9baf128c2fab 2749 * @brief Shifts the elements of a Q7 vector a specified number of bits.
AnnaBridge 145:64910690c574 2750 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2751 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
AnnaBridge 145:64910690c574 2752 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2753 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2754 */
<> 132:9baf128c2fab 2755 void arm_shift_q7(
<> 132:9baf128c2fab 2756 q7_t * pSrc,
<> 132:9baf128c2fab 2757 int8_t shiftBits,
<> 132:9baf128c2fab 2758 q7_t * pDst,
<> 132:9baf128c2fab 2759 uint32_t blockSize);
<> 132:9baf128c2fab 2760
AnnaBridge 145:64910690c574 2761
<> 132:9baf128c2fab 2762 /**
<> 132:9baf128c2fab 2763 * @brief Shifts the elements of a Q15 vector a specified number of bits.
AnnaBridge 145:64910690c574 2764 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2765 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
AnnaBridge 145:64910690c574 2766 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2767 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2768 */
<> 132:9baf128c2fab 2769 void arm_shift_q15(
<> 132:9baf128c2fab 2770 q15_t * pSrc,
<> 132:9baf128c2fab 2771 int8_t shiftBits,
<> 132:9baf128c2fab 2772 q15_t * pDst,
<> 132:9baf128c2fab 2773 uint32_t blockSize);
<> 132:9baf128c2fab 2774
AnnaBridge 145:64910690c574 2775
<> 132:9baf128c2fab 2776 /**
<> 132:9baf128c2fab 2777 * @brief Shifts the elements of a Q31 vector a specified number of bits.
AnnaBridge 145:64910690c574 2778 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2779 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
AnnaBridge 145:64910690c574 2780 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2781 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2782 */
<> 132:9baf128c2fab 2783 void arm_shift_q31(
<> 132:9baf128c2fab 2784 q31_t * pSrc,
<> 132:9baf128c2fab 2785 int8_t shiftBits,
<> 132:9baf128c2fab 2786 q31_t * pDst,
<> 132:9baf128c2fab 2787 uint32_t blockSize);
<> 132:9baf128c2fab 2788
AnnaBridge 145:64910690c574 2789
<> 132:9baf128c2fab 2790 /**
<> 132:9baf128c2fab 2791 * @brief Adds a constant offset to a floating-point vector.
AnnaBridge 145:64910690c574 2792 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2793 * @param[in] offset is the offset to be added
AnnaBridge 145:64910690c574 2794 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2795 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2796 */
<> 132:9baf128c2fab 2797 void arm_offset_f32(
<> 132:9baf128c2fab 2798 float32_t * pSrc,
<> 132:9baf128c2fab 2799 float32_t offset,
<> 132:9baf128c2fab 2800 float32_t * pDst,
<> 132:9baf128c2fab 2801 uint32_t blockSize);
<> 132:9baf128c2fab 2802
AnnaBridge 145:64910690c574 2803
<> 132:9baf128c2fab 2804 /**
<> 132:9baf128c2fab 2805 * @brief Adds a constant offset to a Q7 vector.
AnnaBridge 145:64910690c574 2806 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2807 * @param[in] offset is the offset to be added
AnnaBridge 145:64910690c574 2808 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2809 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2810 */
<> 132:9baf128c2fab 2811 void arm_offset_q7(
<> 132:9baf128c2fab 2812 q7_t * pSrc,
<> 132:9baf128c2fab 2813 q7_t offset,
<> 132:9baf128c2fab 2814 q7_t * pDst,
<> 132:9baf128c2fab 2815 uint32_t blockSize);
<> 132:9baf128c2fab 2816
AnnaBridge 145:64910690c574 2817
<> 132:9baf128c2fab 2818 /**
<> 132:9baf128c2fab 2819 * @brief Adds a constant offset to a Q15 vector.
AnnaBridge 145:64910690c574 2820 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2821 * @param[in] offset is the offset to be added
AnnaBridge 145:64910690c574 2822 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2823 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2824 */
<> 132:9baf128c2fab 2825 void arm_offset_q15(
<> 132:9baf128c2fab 2826 q15_t * pSrc,
<> 132:9baf128c2fab 2827 q15_t offset,
<> 132:9baf128c2fab 2828 q15_t * pDst,
<> 132:9baf128c2fab 2829 uint32_t blockSize);
<> 132:9baf128c2fab 2830
AnnaBridge 145:64910690c574 2831
<> 132:9baf128c2fab 2832 /**
<> 132:9baf128c2fab 2833 * @brief Adds a constant offset to a Q31 vector.
AnnaBridge 145:64910690c574 2834 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2835 * @param[in] offset is the offset to be added
AnnaBridge 145:64910690c574 2836 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2837 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2838 */
<> 132:9baf128c2fab 2839 void arm_offset_q31(
<> 132:9baf128c2fab 2840 q31_t * pSrc,
<> 132:9baf128c2fab 2841 q31_t offset,
<> 132:9baf128c2fab 2842 q31_t * pDst,
<> 132:9baf128c2fab 2843 uint32_t blockSize);
<> 132:9baf128c2fab 2844
AnnaBridge 145:64910690c574 2845
<> 132:9baf128c2fab 2846 /**
<> 132:9baf128c2fab 2847 * @brief Negates the elements of a floating-point vector.
AnnaBridge 145:64910690c574 2848 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2849 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2850 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2851 */
<> 132:9baf128c2fab 2852 void arm_negate_f32(
<> 132:9baf128c2fab 2853 float32_t * pSrc,
<> 132:9baf128c2fab 2854 float32_t * pDst,
<> 132:9baf128c2fab 2855 uint32_t blockSize);
<> 132:9baf128c2fab 2856
AnnaBridge 145:64910690c574 2857
<> 132:9baf128c2fab 2858 /**
<> 132:9baf128c2fab 2859 * @brief Negates the elements of a Q7 vector.
AnnaBridge 145:64910690c574 2860 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2861 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2862 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2863 */
<> 132:9baf128c2fab 2864 void arm_negate_q7(
<> 132:9baf128c2fab 2865 q7_t * pSrc,
<> 132:9baf128c2fab 2866 q7_t * pDst,
<> 132:9baf128c2fab 2867 uint32_t blockSize);
<> 132:9baf128c2fab 2868
AnnaBridge 145:64910690c574 2869
<> 132:9baf128c2fab 2870 /**
<> 132:9baf128c2fab 2871 * @brief Negates the elements of a Q15 vector.
AnnaBridge 145:64910690c574 2872 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2873 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2874 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2875 */
<> 132:9baf128c2fab 2876 void arm_negate_q15(
<> 132:9baf128c2fab 2877 q15_t * pSrc,
<> 132:9baf128c2fab 2878 q15_t * pDst,
<> 132:9baf128c2fab 2879 uint32_t blockSize);
<> 132:9baf128c2fab 2880
AnnaBridge 145:64910690c574 2881
<> 132:9baf128c2fab 2882 /**
<> 132:9baf128c2fab 2883 * @brief Negates the elements of a Q31 vector.
AnnaBridge 145:64910690c574 2884 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 2885 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 2886 * @param[in] blockSize number of samples in the vector
AnnaBridge 145:64910690c574 2887 */
<> 132:9baf128c2fab 2888 void arm_negate_q31(
<> 132:9baf128c2fab 2889 q31_t * pSrc,
<> 132:9baf128c2fab 2890 q31_t * pDst,
<> 132:9baf128c2fab 2891 uint32_t blockSize);
AnnaBridge 145:64910690c574 2892
AnnaBridge 145:64910690c574 2893
<> 132:9baf128c2fab 2894 /**
<> 132:9baf128c2fab 2895 * @brief Copies the elements of a floating-point vector.
AnnaBridge 145:64910690c574 2896 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 2897 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2898 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2899 */
<> 132:9baf128c2fab 2900 void arm_copy_f32(
<> 132:9baf128c2fab 2901 float32_t * pSrc,
<> 132:9baf128c2fab 2902 float32_t * pDst,
<> 132:9baf128c2fab 2903 uint32_t blockSize);
<> 132:9baf128c2fab 2904
AnnaBridge 145:64910690c574 2905
<> 132:9baf128c2fab 2906 /**
<> 132:9baf128c2fab 2907 * @brief Copies the elements of a Q7 vector.
AnnaBridge 145:64910690c574 2908 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 2909 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2910 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2911 */
<> 132:9baf128c2fab 2912 void arm_copy_q7(
<> 132:9baf128c2fab 2913 q7_t * pSrc,
<> 132:9baf128c2fab 2914 q7_t * pDst,
<> 132:9baf128c2fab 2915 uint32_t blockSize);
<> 132:9baf128c2fab 2916
AnnaBridge 145:64910690c574 2917
<> 132:9baf128c2fab 2918 /**
<> 132:9baf128c2fab 2919 * @brief Copies the elements of a Q15 vector.
AnnaBridge 145:64910690c574 2920 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 2921 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2922 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2923 */
<> 132:9baf128c2fab 2924 void arm_copy_q15(
<> 132:9baf128c2fab 2925 q15_t * pSrc,
<> 132:9baf128c2fab 2926 q15_t * pDst,
<> 132:9baf128c2fab 2927 uint32_t blockSize);
<> 132:9baf128c2fab 2928
AnnaBridge 145:64910690c574 2929
<> 132:9baf128c2fab 2930 /**
<> 132:9baf128c2fab 2931 * @brief Copies the elements of a Q31 vector.
AnnaBridge 145:64910690c574 2932 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 2933 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2934 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2935 */
<> 132:9baf128c2fab 2936 void arm_copy_q31(
<> 132:9baf128c2fab 2937 q31_t * pSrc,
<> 132:9baf128c2fab 2938 q31_t * pDst,
<> 132:9baf128c2fab 2939 uint32_t blockSize);
AnnaBridge 145:64910690c574 2940
AnnaBridge 145:64910690c574 2941
<> 132:9baf128c2fab 2942 /**
<> 132:9baf128c2fab 2943 * @brief Fills a constant value into a floating-point vector.
AnnaBridge 145:64910690c574 2944 * @param[in] value input value to be filled
AnnaBridge 145:64910690c574 2945 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2946 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2947 */
<> 132:9baf128c2fab 2948 void arm_fill_f32(
<> 132:9baf128c2fab 2949 float32_t value,
<> 132:9baf128c2fab 2950 float32_t * pDst,
<> 132:9baf128c2fab 2951 uint32_t blockSize);
<> 132:9baf128c2fab 2952
AnnaBridge 145:64910690c574 2953
<> 132:9baf128c2fab 2954 /**
<> 132:9baf128c2fab 2955 * @brief Fills a constant value into a Q7 vector.
AnnaBridge 145:64910690c574 2956 * @param[in] value input value to be filled
AnnaBridge 145:64910690c574 2957 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2958 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2959 */
<> 132:9baf128c2fab 2960 void arm_fill_q7(
<> 132:9baf128c2fab 2961 q7_t value,
<> 132:9baf128c2fab 2962 q7_t * pDst,
<> 132:9baf128c2fab 2963 uint32_t blockSize);
<> 132:9baf128c2fab 2964
AnnaBridge 145:64910690c574 2965
<> 132:9baf128c2fab 2966 /**
<> 132:9baf128c2fab 2967 * @brief Fills a constant value into a Q15 vector.
AnnaBridge 145:64910690c574 2968 * @param[in] value input value to be filled
AnnaBridge 145:64910690c574 2969 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2970 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2971 */
<> 132:9baf128c2fab 2972 void arm_fill_q15(
<> 132:9baf128c2fab 2973 q15_t value,
<> 132:9baf128c2fab 2974 q15_t * pDst,
<> 132:9baf128c2fab 2975 uint32_t blockSize);
<> 132:9baf128c2fab 2976
AnnaBridge 145:64910690c574 2977
<> 132:9baf128c2fab 2978 /**
<> 132:9baf128c2fab 2979 * @brief Fills a constant value into a Q31 vector.
AnnaBridge 145:64910690c574 2980 * @param[in] value input value to be filled
AnnaBridge 145:64910690c574 2981 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 2982 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 2983 */
<> 132:9baf128c2fab 2984 void arm_fill_q31(
<> 132:9baf128c2fab 2985 q31_t value,
<> 132:9baf128c2fab 2986 q31_t * pDst,
<> 132:9baf128c2fab 2987 uint32_t blockSize);
<> 132:9baf128c2fab 2988
AnnaBridge 145:64910690c574 2989
<> 132:9baf128c2fab 2990 /**
<> 132:9baf128c2fab 2991 * @brief Convolution of floating-point sequences.
AnnaBridge 145:64910690c574 2992 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 2993 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 2994 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 2995 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 2996 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 132:9baf128c2fab 2997 */
<> 132:9baf128c2fab 2998 void arm_conv_f32(
<> 132:9baf128c2fab 2999 float32_t * pSrcA,
<> 132:9baf128c2fab 3000 uint32_t srcALen,
<> 132:9baf128c2fab 3001 float32_t * pSrcB,
<> 132:9baf128c2fab 3002 uint32_t srcBLen,
<> 132:9baf128c2fab 3003 float32_t * pDst);
<> 132:9baf128c2fab 3004
<> 132:9baf128c2fab 3005
<> 132:9baf128c2fab 3006 /**
<> 132:9baf128c2fab 3007 * @brief Convolution of Q15 sequences.
AnnaBridge 145:64910690c574 3008 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3009 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3010 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3011 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3012 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3013 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3014 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
AnnaBridge 145:64910690c574 3015 */
<> 132:9baf128c2fab 3016 void arm_conv_opt_q15(
<> 132:9baf128c2fab 3017 q15_t * pSrcA,
<> 132:9baf128c2fab 3018 uint32_t srcALen,
<> 132:9baf128c2fab 3019 q15_t * pSrcB,
<> 132:9baf128c2fab 3020 uint32_t srcBLen,
<> 132:9baf128c2fab 3021 q15_t * pDst,
<> 132:9baf128c2fab 3022 q15_t * pScratch1,
<> 132:9baf128c2fab 3023 q15_t * pScratch2);
<> 132:9baf128c2fab 3024
<> 132:9baf128c2fab 3025
<> 132:9baf128c2fab 3026 /**
<> 132:9baf128c2fab 3027 * @brief Convolution of Q15 sequences.
AnnaBridge 145:64910690c574 3028 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3029 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3030 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3031 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3032 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 132:9baf128c2fab 3033 */
<> 132:9baf128c2fab 3034 void arm_conv_q15(
<> 132:9baf128c2fab 3035 q15_t * pSrcA,
<> 132:9baf128c2fab 3036 uint32_t srcALen,
<> 132:9baf128c2fab 3037 q15_t * pSrcB,
<> 132:9baf128c2fab 3038 uint32_t srcBLen,
<> 132:9baf128c2fab 3039 q15_t * pDst);
<> 132:9baf128c2fab 3040
<> 132:9baf128c2fab 3041
<> 132:9baf128c2fab 3042 /**
<> 132:9baf128c2fab 3043 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3044 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3045 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3046 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3047 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3048 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3049 */
AnnaBridge 145:64910690c574 3050 void arm_conv_fast_q15(
AnnaBridge 145:64910690c574 3051 q15_t * pSrcA,
AnnaBridge 145:64910690c574 3052 uint32_t srcALen,
AnnaBridge 145:64910690c574 3053 q15_t * pSrcB,
AnnaBridge 145:64910690c574 3054 uint32_t srcBLen,
AnnaBridge 145:64910690c574 3055 q15_t * pDst);
AnnaBridge 145:64910690c574 3056
AnnaBridge 145:64910690c574 3057
AnnaBridge 145:64910690c574 3058 /**
AnnaBridge 145:64910690c574 3059 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3060 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3061 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3062 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3063 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3064 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3065 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3066 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
AnnaBridge 145:64910690c574 3067 */
<> 132:9baf128c2fab 3068 void arm_conv_fast_opt_q15(
<> 132:9baf128c2fab 3069 q15_t * pSrcA,
<> 132:9baf128c2fab 3070 uint32_t srcALen,
<> 132:9baf128c2fab 3071 q15_t * pSrcB,
<> 132:9baf128c2fab 3072 uint32_t srcBLen,
<> 132:9baf128c2fab 3073 q15_t * pDst,
<> 132:9baf128c2fab 3074 q15_t * pScratch1,
<> 132:9baf128c2fab 3075 q15_t * pScratch2);
<> 132:9baf128c2fab 3076
<> 132:9baf128c2fab 3077
<> 132:9baf128c2fab 3078 /**
<> 132:9baf128c2fab 3079 * @brief Convolution of Q31 sequences.
AnnaBridge 145:64910690c574 3080 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3081 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3082 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3083 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3084 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3085 */
<> 132:9baf128c2fab 3086 void arm_conv_q31(
<> 132:9baf128c2fab 3087 q31_t * pSrcA,
<> 132:9baf128c2fab 3088 uint32_t srcALen,
<> 132:9baf128c2fab 3089 q31_t * pSrcB,
<> 132:9baf128c2fab 3090 uint32_t srcBLen,
<> 132:9baf128c2fab 3091 q31_t * pDst);
<> 132:9baf128c2fab 3092
AnnaBridge 145:64910690c574 3093
<> 132:9baf128c2fab 3094 /**
<> 132:9baf128c2fab 3095 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3096 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3097 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3098 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3099 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3100 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3101 */
<> 132:9baf128c2fab 3102 void arm_conv_fast_q31(
<> 132:9baf128c2fab 3103 q31_t * pSrcA,
<> 132:9baf128c2fab 3104 uint32_t srcALen,
<> 132:9baf128c2fab 3105 q31_t * pSrcB,
<> 132:9baf128c2fab 3106 uint32_t srcBLen,
<> 132:9baf128c2fab 3107 q31_t * pDst);
<> 132:9baf128c2fab 3108
<> 132:9baf128c2fab 3109
<> 132:9baf128c2fab 3110 /**
<> 132:9baf128c2fab 3111 * @brief Convolution of Q7 sequences.
AnnaBridge 145:64910690c574 3112 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3113 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3114 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3115 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3116 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3117 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3118 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
AnnaBridge 145:64910690c574 3119 */
<> 132:9baf128c2fab 3120 void arm_conv_opt_q7(
<> 132:9baf128c2fab 3121 q7_t * pSrcA,
<> 132:9baf128c2fab 3122 uint32_t srcALen,
<> 132:9baf128c2fab 3123 q7_t * pSrcB,
<> 132:9baf128c2fab 3124 uint32_t srcBLen,
<> 132:9baf128c2fab 3125 q7_t * pDst,
<> 132:9baf128c2fab 3126 q15_t * pScratch1,
<> 132:9baf128c2fab 3127 q15_t * pScratch2);
<> 132:9baf128c2fab 3128
<> 132:9baf128c2fab 3129
<> 132:9baf128c2fab 3130 /**
<> 132:9baf128c2fab 3131 * @brief Convolution of Q7 sequences.
AnnaBridge 145:64910690c574 3132 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3133 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3134 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3135 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3136 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1.
AnnaBridge 145:64910690c574 3137 */
<> 132:9baf128c2fab 3138 void arm_conv_q7(
<> 132:9baf128c2fab 3139 q7_t * pSrcA,
<> 132:9baf128c2fab 3140 uint32_t srcALen,
<> 132:9baf128c2fab 3141 q7_t * pSrcB,
<> 132:9baf128c2fab 3142 uint32_t srcBLen,
<> 132:9baf128c2fab 3143 q7_t * pDst);
<> 132:9baf128c2fab 3144
<> 132:9baf128c2fab 3145
<> 132:9baf128c2fab 3146 /**
<> 132:9baf128c2fab 3147 * @brief Partial convolution of floating-point sequences.
AnnaBridge 145:64910690c574 3148 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3149 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3150 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3151 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3152 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3153 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3154 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3156 */
<> 132:9baf128c2fab 3157 arm_status arm_conv_partial_f32(
<> 132:9baf128c2fab 3158 float32_t * pSrcA,
<> 132:9baf128c2fab 3159 uint32_t srcALen,
<> 132:9baf128c2fab 3160 float32_t * pSrcB,
<> 132:9baf128c2fab 3161 uint32_t srcBLen,
<> 132:9baf128c2fab 3162 float32_t * pDst,
<> 132:9baf128c2fab 3163 uint32_t firstIndex,
<> 132:9baf128c2fab 3164 uint32_t numPoints);
<> 132:9baf128c2fab 3165
AnnaBridge 145:64910690c574 3166
AnnaBridge 145:64910690c574 3167 /**
<> 132:9baf128c2fab 3168 * @brief Partial convolution of Q15 sequences.
AnnaBridge 145:64910690c574 3169 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3170 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3171 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3172 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3173 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3174 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3175 * @param[in] numPoints is the number of output points to be computed.
AnnaBridge 145:64910690c574 3176 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3177 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3179 */
<> 132:9baf128c2fab 3180 arm_status arm_conv_partial_opt_q15(
<> 132:9baf128c2fab 3181 q15_t * pSrcA,
<> 132:9baf128c2fab 3182 uint32_t srcALen,
<> 132:9baf128c2fab 3183 q15_t * pSrcB,
<> 132:9baf128c2fab 3184 uint32_t srcBLen,
<> 132:9baf128c2fab 3185 q15_t * pDst,
<> 132:9baf128c2fab 3186 uint32_t firstIndex,
<> 132:9baf128c2fab 3187 uint32_t numPoints,
<> 132:9baf128c2fab 3188 q15_t * pScratch1,
<> 132:9baf128c2fab 3189 q15_t * pScratch2);
<> 132:9baf128c2fab 3190
<> 132:9baf128c2fab 3191
AnnaBridge 145:64910690c574 3192 /**
<> 132:9baf128c2fab 3193 * @brief Partial convolution of Q15 sequences.
AnnaBridge 145:64910690c574 3194 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3195 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3196 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3197 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3198 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3199 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3200 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3202 */
<> 132:9baf128c2fab 3203 arm_status arm_conv_partial_q15(
<> 132:9baf128c2fab 3204 q15_t * pSrcA,
<> 132:9baf128c2fab 3205 uint32_t srcALen,
<> 132:9baf128c2fab 3206 q15_t * pSrcB,
<> 132:9baf128c2fab 3207 uint32_t srcBLen,
<> 132:9baf128c2fab 3208 q15_t * pDst,
<> 132:9baf128c2fab 3209 uint32_t firstIndex,
<> 132:9baf128c2fab 3210 uint32_t numPoints);
<> 132:9baf128c2fab 3211
AnnaBridge 145:64910690c574 3212
<> 132:9baf128c2fab 3213 /**
<> 132:9baf128c2fab 3214 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3215 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3216 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3217 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3218 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3219 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3220 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3221 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3223 */
<> 132:9baf128c2fab 3224 arm_status arm_conv_partial_fast_q15(
AnnaBridge 145:64910690c574 3225 q15_t * pSrcA,
AnnaBridge 145:64910690c574 3226 uint32_t srcALen,
AnnaBridge 145:64910690c574 3227 q15_t * pSrcB,
AnnaBridge 145:64910690c574 3228 uint32_t srcBLen,
AnnaBridge 145:64910690c574 3229 q15_t * pDst,
AnnaBridge 145:64910690c574 3230 uint32_t firstIndex,
AnnaBridge 145:64910690c574 3231 uint32_t numPoints);
<> 132:9baf128c2fab 3232
<> 132:9baf128c2fab 3233
<> 132:9baf128c2fab 3234 /**
<> 132:9baf128c2fab 3235 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3236 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3237 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3238 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3239 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3240 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3241 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3242 * @param[in] numPoints is the number of output points to be computed.
AnnaBridge 145:64910690c574 3243 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3244 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3246 */
<> 132:9baf128c2fab 3247 arm_status arm_conv_partial_fast_opt_q15(
<> 132:9baf128c2fab 3248 q15_t * pSrcA,
<> 132:9baf128c2fab 3249 uint32_t srcALen,
<> 132:9baf128c2fab 3250 q15_t * pSrcB,
<> 132:9baf128c2fab 3251 uint32_t srcBLen,
<> 132:9baf128c2fab 3252 q15_t * pDst,
<> 132:9baf128c2fab 3253 uint32_t firstIndex,
<> 132:9baf128c2fab 3254 uint32_t numPoints,
<> 132:9baf128c2fab 3255 q15_t * pScratch1,
<> 132:9baf128c2fab 3256 q15_t * pScratch2);
<> 132:9baf128c2fab 3257
<> 132:9baf128c2fab 3258
<> 132:9baf128c2fab 3259 /**
<> 132:9baf128c2fab 3260 * @brief Partial convolution of Q31 sequences.
AnnaBridge 145:64910690c574 3261 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3262 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3263 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3264 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3265 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3266 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3267 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 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].
<> 132:9baf128c2fab 3269 */
<> 132:9baf128c2fab 3270 arm_status arm_conv_partial_q31(
<> 132:9baf128c2fab 3271 q31_t * pSrcA,
<> 132:9baf128c2fab 3272 uint32_t srcALen,
<> 132:9baf128c2fab 3273 q31_t * pSrcB,
<> 132:9baf128c2fab 3274 uint32_t srcBLen,
<> 132:9baf128c2fab 3275 q31_t * pDst,
<> 132:9baf128c2fab 3276 uint32_t firstIndex,
<> 132:9baf128c2fab 3277 uint32_t numPoints);
<> 132:9baf128c2fab 3278
<> 132:9baf128c2fab 3279
<> 132:9baf128c2fab 3280 /**
<> 132:9baf128c2fab 3281 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 3282 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3283 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3284 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3285 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3286 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3287 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3288 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 3289 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
<> 132:9baf128c2fab 3290 */
<> 132:9baf128c2fab 3291 arm_status arm_conv_partial_fast_q31(
<> 132:9baf128c2fab 3292 q31_t * pSrcA,
<> 132:9baf128c2fab 3293 uint32_t srcALen,
<> 132:9baf128c2fab 3294 q31_t * pSrcB,
<> 132:9baf128c2fab 3295 uint32_t srcBLen,
<> 132:9baf128c2fab 3296 q31_t * pDst,
<> 132:9baf128c2fab 3297 uint32_t firstIndex,
<> 132:9baf128c2fab 3298 uint32_t numPoints);
<> 132:9baf128c2fab 3299
<> 132:9baf128c2fab 3300
<> 132:9baf128c2fab 3301 /**
<> 132:9baf128c2fab 3302 * @brief Partial convolution of Q7 sequences
AnnaBridge 145:64910690c574 3303 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3304 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3305 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3306 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3307 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3308 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3309 * @param[in] numPoints is the number of output points to be computed.
AnnaBridge 145:64910690c574 3310 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 3311 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 132:9baf128c2fab 3312 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
<> 132:9baf128c2fab 3313 */
<> 132:9baf128c2fab 3314 arm_status arm_conv_partial_opt_q7(
<> 132:9baf128c2fab 3315 q7_t * pSrcA,
<> 132:9baf128c2fab 3316 uint32_t srcALen,
<> 132:9baf128c2fab 3317 q7_t * pSrcB,
<> 132:9baf128c2fab 3318 uint32_t srcBLen,
<> 132:9baf128c2fab 3319 q7_t * pDst,
<> 132:9baf128c2fab 3320 uint32_t firstIndex,
<> 132:9baf128c2fab 3321 uint32_t numPoints,
<> 132:9baf128c2fab 3322 q15_t * pScratch1,
<> 132:9baf128c2fab 3323 q15_t * pScratch2);
<> 132:9baf128c2fab 3324
<> 132:9baf128c2fab 3325
<> 132:9baf128c2fab 3326 /**
<> 132:9baf128c2fab 3327 * @brief Partial convolution of Q7 sequences.
AnnaBridge 145:64910690c574 3328 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 3329 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 3330 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 3331 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 3332 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3333 * @param[in] firstIndex is the first output sample to start with.
AnnaBridge 145:64910690c574 3334 * @param[in] numPoints is the number of output points to be computed.
<> 132:9baf128c2fab 3335 * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
<> 132:9baf128c2fab 3336 */
<> 132:9baf128c2fab 3337 arm_status arm_conv_partial_q7(
<> 132:9baf128c2fab 3338 q7_t * pSrcA,
<> 132:9baf128c2fab 3339 uint32_t srcALen,
<> 132:9baf128c2fab 3340 q7_t * pSrcB,
<> 132:9baf128c2fab 3341 uint32_t srcBLen,
<> 132:9baf128c2fab 3342 q7_t * pDst,
<> 132:9baf128c2fab 3343 uint32_t firstIndex,
<> 132:9baf128c2fab 3344 uint32_t numPoints);
<> 132:9baf128c2fab 3345
<> 132:9baf128c2fab 3346
<> 132:9baf128c2fab 3347 /**
<> 132:9baf128c2fab 3348 * @brief Instance structure for the Q15 FIR decimator.
<> 132:9baf128c2fab 3349 */
<> 132:9baf128c2fab 3350 typedef struct
<> 132:9baf128c2fab 3351 {
AnnaBridge 145:64910690c574 3352 uint8_t M; /**< decimation factor. */
AnnaBridge 145:64910690c574 3353 uint16_t numTaps; /**< number of coefficients in the filter. */
AnnaBridge 145:64910690c574 3354 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
AnnaBridge 145:64910690c574 3355 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 3356 } arm_fir_decimate_instance_q15;
<> 132:9baf128c2fab 3357
<> 132:9baf128c2fab 3358 /**
<> 132:9baf128c2fab 3359 * @brief Instance structure for the Q31 FIR decimator.
<> 132:9baf128c2fab 3360 */
<> 132:9baf128c2fab 3361 typedef struct
<> 132:9baf128c2fab 3362 {
<> 132:9baf128c2fab 3363 uint8_t M; /**< decimation factor. */
<> 132:9baf128c2fab 3364 uint16_t numTaps; /**< number of coefficients in the filter. */
AnnaBridge 145:64910690c574 3365 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
AnnaBridge 145:64910690c574 3366 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 3367 } arm_fir_decimate_instance_q31;
<> 132:9baf128c2fab 3368
<> 132:9baf128c2fab 3369 /**
<> 132:9baf128c2fab 3370 * @brief Instance structure for the floating-point FIR decimator.
<> 132:9baf128c2fab 3371 */
<> 132:9baf128c2fab 3372 typedef struct
<> 132:9baf128c2fab 3373 {
AnnaBridge 145:64910690c574 3374 uint8_t M; /**< decimation factor. */
AnnaBridge 145:64910690c574 3375 uint16_t numTaps; /**< number of coefficients in the filter. */
AnnaBridge 145:64910690c574 3376 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
AnnaBridge 145:64910690c574 3377 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 3378 } arm_fir_decimate_instance_f32;
<> 132:9baf128c2fab 3379
<> 132:9baf128c2fab 3380
<> 132:9baf128c2fab 3381 /**
<> 132:9baf128c2fab 3382 * @brief Processing function for the floating-point FIR decimator.
AnnaBridge 145:64910690c574 3383 * @param[in] S points to an instance of the floating-point FIR decimator structure.
AnnaBridge 145:64910690c574 3384 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3385 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3386 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3387 */
<> 132:9baf128c2fab 3388 void arm_fir_decimate_f32(
<> 132:9baf128c2fab 3389 const arm_fir_decimate_instance_f32 * S,
<> 132:9baf128c2fab 3390 float32_t * pSrc,
<> 132:9baf128c2fab 3391 float32_t * pDst,
<> 132:9baf128c2fab 3392 uint32_t blockSize);
<> 132:9baf128c2fab 3393
<> 132:9baf128c2fab 3394
<> 132:9baf128c2fab 3395 /**
<> 132:9baf128c2fab 3396 * @brief Initialization function for the floating-point FIR decimator.
AnnaBridge 145:64910690c574 3397 * @param[in,out] S points to an instance of the floating-point FIR decimator structure.
AnnaBridge 145:64910690c574 3398 * @param[in] numTaps number of coefficients in the filter.
AnnaBridge 145:64910690c574 3399 * @param[in] M decimation factor.
AnnaBridge 145:64910690c574 3400 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3401 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3402 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3403 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3404 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 132:9baf128c2fab 3405 */
<> 132:9baf128c2fab 3406 arm_status arm_fir_decimate_init_f32(
<> 132:9baf128c2fab 3407 arm_fir_decimate_instance_f32 * S,
<> 132:9baf128c2fab 3408 uint16_t numTaps,
<> 132:9baf128c2fab 3409 uint8_t M,
<> 132:9baf128c2fab 3410 float32_t * pCoeffs,
<> 132:9baf128c2fab 3411 float32_t * pState,
<> 132:9baf128c2fab 3412 uint32_t blockSize);
<> 132:9baf128c2fab 3413
AnnaBridge 145:64910690c574 3414
<> 132:9baf128c2fab 3415 /**
<> 132:9baf128c2fab 3416 * @brief Processing function for the Q15 FIR decimator.
AnnaBridge 145:64910690c574 3417 * @param[in] S points to an instance of the Q15 FIR decimator structure.
AnnaBridge 145:64910690c574 3418 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3419 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3420 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3421 */
<> 132:9baf128c2fab 3422 void arm_fir_decimate_q15(
<> 132:9baf128c2fab 3423 const arm_fir_decimate_instance_q15 * S,
<> 132:9baf128c2fab 3424 q15_t * pSrc,
<> 132:9baf128c2fab 3425 q15_t * pDst,
<> 132:9baf128c2fab 3426 uint32_t blockSize);
<> 132:9baf128c2fab 3427
AnnaBridge 145:64910690c574 3428
<> 132:9baf128c2fab 3429 /**
<> 132:9baf128c2fab 3430 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 3431 * @param[in] S points to an instance of the Q15 FIR decimator structure.
AnnaBridge 145:64910690c574 3432 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3433 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3434 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3435 */
<> 132:9baf128c2fab 3436 void arm_fir_decimate_fast_q15(
<> 132:9baf128c2fab 3437 const arm_fir_decimate_instance_q15 * S,
<> 132:9baf128c2fab 3438 q15_t * pSrc,
<> 132:9baf128c2fab 3439 q15_t * pDst,
<> 132:9baf128c2fab 3440 uint32_t blockSize);
<> 132:9baf128c2fab 3441
<> 132:9baf128c2fab 3442
<> 132:9baf128c2fab 3443 /**
<> 132:9baf128c2fab 3444 * @brief Initialization function for the Q15 FIR decimator.
AnnaBridge 145:64910690c574 3445 * @param[in,out] S points to an instance of the Q15 FIR decimator structure.
AnnaBridge 145:64910690c574 3446 * @param[in] numTaps number of coefficients in the filter.
AnnaBridge 145:64910690c574 3447 * @param[in] M decimation factor.
AnnaBridge 145:64910690c574 3448 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3449 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3450 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3451 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3452 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 132:9baf128c2fab 3453 */
<> 132:9baf128c2fab 3454 arm_status arm_fir_decimate_init_q15(
<> 132:9baf128c2fab 3455 arm_fir_decimate_instance_q15 * S,
<> 132:9baf128c2fab 3456 uint16_t numTaps,
<> 132:9baf128c2fab 3457 uint8_t M,
<> 132:9baf128c2fab 3458 q15_t * pCoeffs,
<> 132:9baf128c2fab 3459 q15_t * pState,
<> 132:9baf128c2fab 3460 uint32_t blockSize);
<> 132:9baf128c2fab 3461
AnnaBridge 145:64910690c574 3462
<> 132:9baf128c2fab 3463 /**
<> 132:9baf128c2fab 3464 * @brief Processing function for the Q31 FIR decimator.
AnnaBridge 145:64910690c574 3465 * @param[in] S points to an instance of the Q31 FIR decimator structure.
AnnaBridge 145:64910690c574 3466 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3467 * @param[out] pDst points to the block of output data
<> 132:9baf128c2fab 3468 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3469 */
<> 132:9baf128c2fab 3470 void arm_fir_decimate_q31(
<> 132:9baf128c2fab 3471 const arm_fir_decimate_instance_q31 * S,
<> 132:9baf128c2fab 3472 q31_t * pSrc,
<> 132:9baf128c2fab 3473 q31_t * pDst,
<> 132:9baf128c2fab 3474 uint32_t blockSize);
<> 132:9baf128c2fab 3475
<> 132:9baf128c2fab 3476 /**
<> 132:9baf128c2fab 3477 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 3478 * @param[in] S points to an instance of the Q31 FIR decimator structure.
AnnaBridge 145:64910690c574 3479 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3480 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3481 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3482 */
<> 132:9baf128c2fab 3483 void arm_fir_decimate_fast_q31(
<> 132:9baf128c2fab 3484 arm_fir_decimate_instance_q31 * S,
<> 132:9baf128c2fab 3485 q31_t * pSrc,
<> 132:9baf128c2fab 3486 q31_t * pDst,
<> 132:9baf128c2fab 3487 uint32_t blockSize);
<> 132:9baf128c2fab 3488
<> 132:9baf128c2fab 3489
<> 132:9baf128c2fab 3490 /**
<> 132:9baf128c2fab 3491 * @brief Initialization function for the Q31 FIR decimator.
AnnaBridge 145:64910690c574 3492 * @param[in,out] S points to an instance of the Q31 FIR decimator structure.
AnnaBridge 145:64910690c574 3493 * @param[in] numTaps number of coefficients in the filter.
AnnaBridge 145:64910690c574 3494 * @param[in] M decimation factor.
AnnaBridge 145:64910690c574 3495 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3496 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3497 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3498 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3499 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 132:9baf128c2fab 3500 */
<> 132:9baf128c2fab 3501 arm_status arm_fir_decimate_init_q31(
<> 132:9baf128c2fab 3502 arm_fir_decimate_instance_q31 * S,
<> 132:9baf128c2fab 3503 uint16_t numTaps,
<> 132:9baf128c2fab 3504 uint8_t M,
<> 132:9baf128c2fab 3505 q31_t * pCoeffs,
<> 132:9baf128c2fab 3506 q31_t * pState,
<> 132:9baf128c2fab 3507 uint32_t blockSize);
<> 132:9baf128c2fab 3508
<> 132:9baf128c2fab 3509
<> 132:9baf128c2fab 3510 /**
<> 132:9baf128c2fab 3511 * @brief Instance structure for the Q15 FIR interpolator.
<> 132:9baf128c2fab 3512 */
<> 132:9baf128c2fab 3513 typedef struct
<> 132:9baf128c2fab 3514 {
<> 132:9baf128c2fab 3515 uint8_t L; /**< upsample factor. */
<> 132:9baf128c2fab 3516 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 132:9baf128c2fab 3517 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 132:9baf128c2fab 3518 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 132:9baf128c2fab 3519 } arm_fir_interpolate_instance_q15;
<> 132:9baf128c2fab 3520
<> 132:9baf128c2fab 3521 /**
<> 132:9baf128c2fab 3522 * @brief Instance structure for the Q31 FIR interpolator.
<> 132:9baf128c2fab 3523 */
<> 132:9baf128c2fab 3524 typedef struct
<> 132:9baf128c2fab 3525 {
<> 132:9baf128c2fab 3526 uint8_t L; /**< upsample factor. */
<> 132:9baf128c2fab 3527 uint16_t phaseLength; /**< length of each polyphase filter component. */
AnnaBridge 145:64910690c574 3528 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
AnnaBridge 145:64910690c574 3529 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 132:9baf128c2fab 3530 } arm_fir_interpolate_instance_q31;
<> 132:9baf128c2fab 3531
<> 132:9baf128c2fab 3532 /**
<> 132:9baf128c2fab 3533 * @brief Instance structure for the floating-point FIR interpolator.
<> 132:9baf128c2fab 3534 */
<> 132:9baf128c2fab 3535 typedef struct
<> 132:9baf128c2fab 3536 {
<> 132:9baf128c2fab 3537 uint8_t L; /**< upsample factor. */
<> 132:9baf128c2fab 3538 uint16_t phaseLength; /**< length of each polyphase filter component. */
AnnaBridge 145:64910690c574 3539 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
AnnaBridge 145:64910690c574 3540 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
<> 132:9baf128c2fab 3541 } arm_fir_interpolate_instance_f32;
<> 132:9baf128c2fab 3542
<> 132:9baf128c2fab 3543
<> 132:9baf128c2fab 3544 /**
<> 132:9baf128c2fab 3545 * @brief Processing function for the Q15 FIR interpolator.
AnnaBridge 145:64910690c574 3546 * @param[in] S points to an instance of the Q15 FIR interpolator structure.
AnnaBridge 145:64910690c574 3547 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3548 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3549 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3550 */
<> 132:9baf128c2fab 3551 void arm_fir_interpolate_q15(
<> 132:9baf128c2fab 3552 const arm_fir_interpolate_instance_q15 * S,
<> 132:9baf128c2fab 3553 q15_t * pSrc,
<> 132:9baf128c2fab 3554 q15_t * pDst,
<> 132:9baf128c2fab 3555 uint32_t blockSize);
<> 132:9baf128c2fab 3556
<> 132:9baf128c2fab 3557
<> 132:9baf128c2fab 3558 /**
<> 132:9baf128c2fab 3559 * @brief Initialization function for the Q15 FIR interpolator.
AnnaBridge 145:64910690c574 3560 * @param[in,out] S points to an instance of the Q15 FIR interpolator structure.
AnnaBridge 145:64910690c574 3561 * @param[in] L upsample factor.
AnnaBridge 145:64910690c574 3562 * @param[in] numTaps number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 3563 * @param[in] pCoeffs points to the filter coefficient buffer.
AnnaBridge 145:64910690c574 3564 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3565 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3566 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3567 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 132:9baf128c2fab 3568 */
<> 132:9baf128c2fab 3569 arm_status arm_fir_interpolate_init_q15(
<> 132:9baf128c2fab 3570 arm_fir_interpolate_instance_q15 * S,
<> 132:9baf128c2fab 3571 uint8_t L,
<> 132:9baf128c2fab 3572 uint16_t numTaps,
<> 132:9baf128c2fab 3573 q15_t * pCoeffs,
<> 132:9baf128c2fab 3574 q15_t * pState,
<> 132:9baf128c2fab 3575 uint32_t blockSize);
<> 132:9baf128c2fab 3576
AnnaBridge 145:64910690c574 3577
<> 132:9baf128c2fab 3578 /**
<> 132:9baf128c2fab 3579 * @brief Processing function for the Q31 FIR interpolator.
AnnaBridge 145:64910690c574 3580 * @param[in] S points to an instance of the Q15 FIR interpolator structure.
AnnaBridge 145:64910690c574 3581 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3582 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3583 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3584 */
<> 132:9baf128c2fab 3585 void arm_fir_interpolate_q31(
<> 132:9baf128c2fab 3586 const arm_fir_interpolate_instance_q31 * S,
<> 132:9baf128c2fab 3587 q31_t * pSrc,
<> 132:9baf128c2fab 3588 q31_t * pDst,
<> 132:9baf128c2fab 3589 uint32_t blockSize);
<> 132:9baf128c2fab 3590
AnnaBridge 145:64910690c574 3591
<> 132:9baf128c2fab 3592 /**
<> 132:9baf128c2fab 3593 * @brief Initialization function for the Q31 FIR interpolator.
AnnaBridge 145:64910690c574 3594 * @param[in,out] S points to an instance of the Q31 FIR interpolator structure.
AnnaBridge 145:64910690c574 3595 * @param[in] L upsample factor.
AnnaBridge 145:64910690c574 3596 * @param[in] numTaps number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 3597 * @param[in] pCoeffs points to the filter coefficient buffer.
AnnaBridge 145:64910690c574 3598 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3599 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3600 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3601 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 132:9baf128c2fab 3602 */
<> 132:9baf128c2fab 3603 arm_status arm_fir_interpolate_init_q31(
<> 132:9baf128c2fab 3604 arm_fir_interpolate_instance_q31 * S,
<> 132:9baf128c2fab 3605 uint8_t L,
<> 132:9baf128c2fab 3606 uint16_t numTaps,
<> 132:9baf128c2fab 3607 q31_t * pCoeffs,
<> 132:9baf128c2fab 3608 q31_t * pState,
<> 132:9baf128c2fab 3609 uint32_t blockSize);
<> 132:9baf128c2fab 3610
<> 132:9baf128c2fab 3611
<> 132:9baf128c2fab 3612 /**
<> 132:9baf128c2fab 3613 * @brief Processing function for the floating-point FIR interpolator.
AnnaBridge 145:64910690c574 3614 * @param[in] S points to an instance of the floating-point FIR interpolator structure.
AnnaBridge 145:64910690c574 3615 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3616 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3617 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3618 */
<> 132:9baf128c2fab 3619 void arm_fir_interpolate_f32(
<> 132:9baf128c2fab 3620 const arm_fir_interpolate_instance_f32 * S,
<> 132:9baf128c2fab 3621 float32_t * pSrc,
<> 132:9baf128c2fab 3622 float32_t * pDst,
<> 132:9baf128c2fab 3623 uint32_t blockSize);
<> 132:9baf128c2fab 3624
AnnaBridge 145:64910690c574 3625
<> 132:9baf128c2fab 3626 /**
<> 132:9baf128c2fab 3627 * @brief Initialization function for the floating-point FIR interpolator.
AnnaBridge 145:64910690c574 3628 * @param[in,out] S points to an instance of the floating-point FIR interpolator structure.
AnnaBridge 145:64910690c574 3629 * @param[in] L upsample factor.
AnnaBridge 145:64910690c574 3630 * @param[in] numTaps number of filter coefficients in the filter.
AnnaBridge 145:64910690c574 3631 * @param[in] pCoeffs points to the filter coefficient buffer.
AnnaBridge 145:64910690c574 3632 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3633 * @param[in] blockSize number of input samples to process per call.
<> 132:9baf128c2fab 3634 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 132:9baf128c2fab 3635 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 132:9baf128c2fab 3636 */
<> 132:9baf128c2fab 3637 arm_status arm_fir_interpolate_init_f32(
<> 132:9baf128c2fab 3638 arm_fir_interpolate_instance_f32 * S,
<> 132:9baf128c2fab 3639 uint8_t L,
<> 132:9baf128c2fab 3640 uint16_t numTaps,
<> 132:9baf128c2fab 3641 float32_t * pCoeffs,
<> 132:9baf128c2fab 3642 float32_t * pState,
<> 132:9baf128c2fab 3643 uint32_t blockSize);
<> 132:9baf128c2fab 3644
AnnaBridge 145:64910690c574 3645
<> 132:9baf128c2fab 3646 /**
<> 132:9baf128c2fab 3647 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
<> 132:9baf128c2fab 3648 */
<> 132:9baf128c2fab 3649 typedef struct
<> 132:9baf128c2fab 3650 {
<> 132:9baf128c2fab 3651 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 132:9baf128c2fab 3652 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 132:9baf128c2fab 3653 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 3654 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
<> 132:9baf128c2fab 3655 } arm_biquad_cas_df1_32x64_ins_q31;
<> 132:9baf128c2fab 3656
<> 132:9baf128c2fab 3657
<> 132:9baf128c2fab 3658 /**
AnnaBridge 145:64910690c574 3659 * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure.
AnnaBridge 145:64910690c574 3660 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3661 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3662 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3663 */
<> 132:9baf128c2fab 3664 void arm_biquad_cas_df1_32x64_q31(
<> 132:9baf128c2fab 3665 const arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 132:9baf128c2fab 3666 q31_t * pSrc,
<> 132:9baf128c2fab 3667 q31_t * pDst,
<> 132:9baf128c2fab 3668 uint32_t blockSize);
<> 132:9baf128c2fab 3669
<> 132:9baf128c2fab 3670
<> 132:9baf128c2fab 3671 /**
AnnaBridge 145:64910690c574 3672 * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure.
AnnaBridge 145:64910690c574 3673 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 3674 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3675 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3676 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
AnnaBridge 145:64910690c574 3677 */
<> 132:9baf128c2fab 3678 void arm_biquad_cas_df1_32x64_init_q31(
<> 132:9baf128c2fab 3679 arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 132:9baf128c2fab 3680 uint8_t numStages,
<> 132:9baf128c2fab 3681 q31_t * pCoeffs,
<> 132:9baf128c2fab 3682 q63_t * pState,
<> 132:9baf128c2fab 3683 uint8_t postShift);
<> 132:9baf128c2fab 3684
<> 132:9baf128c2fab 3685
<> 132:9baf128c2fab 3686 /**
<> 132:9baf128c2fab 3687 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 132:9baf128c2fab 3688 */
<> 132:9baf128c2fab 3689 typedef struct
<> 132:9baf128c2fab 3690 {
<> 132:9baf128c2fab 3691 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 132:9baf128c2fab 3692 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 132:9baf128c2fab 3693 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 3694 } arm_biquad_cascade_df2T_instance_f32;
<> 132:9baf128c2fab 3695
<> 132:9baf128c2fab 3696 /**
<> 132:9baf128c2fab 3697 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 132:9baf128c2fab 3698 */
<> 132:9baf128c2fab 3699 typedef struct
<> 132:9baf128c2fab 3700 {
<> 132:9baf128c2fab 3701 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 132:9baf128c2fab 3702 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 132:9baf128c2fab 3703 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 3704 } arm_biquad_cascade_stereo_df2T_instance_f32;
<> 132:9baf128c2fab 3705
<> 132:9baf128c2fab 3706 /**
<> 132:9baf128c2fab 3707 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 132:9baf128c2fab 3708 */
<> 132:9baf128c2fab 3709 typedef struct
<> 132:9baf128c2fab 3710 {
<> 132:9baf128c2fab 3711 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 132:9baf128c2fab 3712 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 132:9baf128c2fab 3713 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 132:9baf128c2fab 3714 } arm_biquad_cascade_df2T_instance_f64;
<> 132:9baf128c2fab 3715
<> 132:9baf128c2fab 3716
<> 132:9baf128c2fab 3717 /**
<> 132:9baf128c2fab 3718 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
AnnaBridge 145:64910690c574 3719 * @param[in] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3720 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3721 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3722 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3723 */
<> 132:9baf128c2fab 3724 void arm_biquad_cascade_df2T_f32(
<> 132:9baf128c2fab 3725 const arm_biquad_cascade_df2T_instance_f32 * S,
<> 132:9baf128c2fab 3726 float32_t * pSrc,
<> 132:9baf128c2fab 3727 float32_t * pDst,
<> 132:9baf128c2fab 3728 uint32_t blockSize);
<> 132:9baf128c2fab 3729
<> 132:9baf128c2fab 3730
<> 132:9baf128c2fab 3731 /**
<> 132:9baf128c2fab 3732 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
AnnaBridge 145:64910690c574 3733 * @param[in] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3734 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3735 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3736 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3737 */
<> 132:9baf128c2fab 3738 void arm_biquad_cascade_stereo_df2T_f32(
<> 132:9baf128c2fab 3739 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 132:9baf128c2fab 3740 float32_t * pSrc,
<> 132:9baf128c2fab 3741 float32_t * pDst,
<> 132:9baf128c2fab 3742 uint32_t blockSize);
<> 132:9baf128c2fab 3743
AnnaBridge 145:64910690c574 3744
<> 132:9baf128c2fab 3745 /**
<> 132:9baf128c2fab 3746 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
AnnaBridge 145:64910690c574 3747 * @param[in] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3748 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3749 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3750 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3751 */
<> 132:9baf128c2fab 3752 void arm_biquad_cascade_df2T_f64(
<> 132:9baf128c2fab 3753 const arm_biquad_cascade_df2T_instance_f64 * S,
<> 132:9baf128c2fab 3754 float64_t * pSrc,
<> 132:9baf128c2fab 3755 float64_t * pDst,
<> 132:9baf128c2fab 3756 uint32_t blockSize);
<> 132:9baf128c2fab 3757
<> 132:9baf128c2fab 3758
<> 132:9baf128c2fab 3759 /**
<> 132:9baf128c2fab 3760 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
AnnaBridge 145:64910690c574 3761 * @param[in,out] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3762 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 3763 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3764 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3765 */
<> 132:9baf128c2fab 3766 void arm_biquad_cascade_df2T_init_f32(
<> 132:9baf128c2fab 3767 arm_biquad_cascade_df2T_instance_f32 * S,
<> 132:9baf128c2fab 3768 uint8_t numStages,
<> 132:9baf128c2fab 3769 float32_t * pCoeffs,
<> 132:9baf128c2fab 3770 float32_t * pState);
<> 132:9baf128c2fab 3771
<> 132:9baf128c2fab 3772
<> 132:9baf128c2fab 3773 /**
<> 132:9baf128c2fab 3774 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
AnnaBridge 145:64910690c574 3775 * @param[in,out] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3776 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 3777 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3778 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3779 */
<> 132:9baf128c2fab 3780 void arm_biquad_cascade_stereo_df2T_init_f32(
<> 132:9baf128c2fab 3781 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 132:9baf128c2fab 3782 uint8_t numStages,
<> 132:9baf128c2fab 3783 float32_t * pCoeffs,
<> 132:9baf128c2fab 3784 float32_t * pState);
<> 132:9baf128c2fab 3785
<> 132:9baf128c2fab 3786
<> 132:9baf128c2fab 3787 /**
<> 132:9baf128c2fab 3788 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
AnnaBridge 145:64910690c574 3789 * @param[in,out] S points to an instance of the filter data structure.
AnnaBridge 145:64910690c574 3790 * @param[in] numStages number of 2nd order stages in the filter.
AnnaBridge 145:64910690c574 3791 * @param[in] pCoeffs points to the filter coefficients.
AnnaBridge 145:64910690c574 3792 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 3793 */
<> 132:9baf128c2fab 3794 void arm_biquad_cascade_df2T_init_f64(
<> 132:9baf128c2fab 3795 arm_biquad_cascade_df2T_instance_f64 * S,
<> 132:9baf128c2fab 3796 uint8_t numStages,
<> 132:9baf128c2fab 3797 float64_t * pCoeffs,
<> 132:9baf128c2fab 3798 float64_t * pState);
<> 132:9baf128c2fab 3799
<> 132:9baf128c2fab 3800
<> 132:9baf128c2fab 3801 /**
<> 132:9baf128c2fab 3802 * @brief Instance structure for the Q15 FIR lattice filter.
<> 132:9baf128c2fab 3803 */
<> 132:9baf128c2fab 3804 typedef struct
<> 132:9baf128c2fab 3805 {
AnnaBridge 145:64910690c574 3806 uint16_t numStages; /**< number of filter stages. */
AnnaBridge 145:64910690c574 3807 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
AnnaBridge 145:64910690c574 3808 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 132:9baf128c2fab 3809 } arm_fir_lattice_instance_q15;
<> 132:9baf128c2fab 3810
<> 132:9baf128c2fab 3811 /**
<> 132:9baf128c2fab 3812 * @brief Instance structure for the Q31 FIR lattice filter.
<> 132:9baf128c2fab 3813 */
<> 132:9baf128c2fab 3814 typedef struct
<> 132:9baf128c2fab 3815 {
AnnaBridge 145:64910690c574 3816 uint16_t numStages; /**< number of filter stages. */
AnnaBridge 145:64910690c574 3817 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
AnnaBridge 145:64910690c574 3818 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 132:9baf128c2fab 3819 } arm_fir_lattice_instance_q31;
<> 132:9baf128c2fab 3820
<> 132:9baf128c2fab 3821 /**
<> 132:9baf128c2fab 3822 * @brief Instance structure for the floating-point FIR lattice filter.
<> 132:9baf128c2fab 3823 */
<> 132:9baf128c2fab 3824 typedef struct
<> 132:9baf128c2fab 3825 {
<> 132:9baf128c2fab 3826 uint16_t numStages; /**< number of filter stages. */
<> 132:9baf128c2fab 3827 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 132:9baf128c2fab 3828 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 132:9baf128c2fab 3829 } arm_fir_lattice_instance_f32;
<> 132:9baf128c2fab 3830
AnnaBridge 145:64910690c574 3831
<> 132:9baf128c2fab 3832 /**
<> 132:9baf128c2fab 3833 * @brief Initialization function for the Q15 FIR lattice filter.
AnnaBridge 145:64910690c574 3834 * @param[in] S points to an instance of the Q15 FIR lattice structure.
<> 132:9baf128c2fab 3835 * @param[in] numStages number of filter stages.
AnnaBridge 145:64910690c574 3836 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3837 * @param[in] pState points to the state buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3838 */
<> 132:9baf128c2fab 3839 void arm_fir_lattice_init_q15(
<> 132:9baf128c2fab 3840 arm_fir_lattice_instance_q15 * S,
<> 132:9baf128c2fab 3841 uint16_t numStages,
<> 132:9baf128c2fab 3842 q15_t * pCoeffs,
<> 132:9baf128c2fab 3843 q15_t * pState);
<> 132:9baf128c2fab 3844
<> 132:9baf128c2fab 3845
<> 132:9baf128c2fab 3846 /**
<> 132:9baf128c2fab 3847 * @brief Processing function for the Q15 FIR lattice filter.
AnnaBridge 145:64910690c574 3848 * @param[in] S points to an instance of the Q15 FIR lattice structure.
AnnaBridge 145:64910690c574 3849 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3850 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3851 * @param[in] blockSize number of samples to process.
<> 132:9baf128c2fab 3852 */
<> 132:9baf128c2fab 3853 void arm_fir_lattice_q15(
<> 132:9baf128c2fab 3854 const arm_fir_lattice_instance_q15 * S,
<> 132:9baf128c2fab 3855 q15_t * pSrc,
<> 132:9baf128c2fab 3856 q15_t * pDst,
<> 132:9baf128c2fab 3857 uint32_t blockSize);
<> 132:9baf128c2fab 3858
AnnaBridge 145:64910690c574 3859
<> 132:9baf128c2fab 3860 /**
<> 132:9baf128c2fab 3861 * @brief Initialization function for the Q31 FIR lattice filter.
AnnaBridge 145:64910690c574 3862 * @param[in] S points to an instance of the Q31 FIR lattice structure.
<> 132:9baf128c2fab 3863 * @param[in] numStages number of filter stages.
AnnaBridge 145:64910690c574 3864 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3865 * @param[in] pState points to the state buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3866 */
<> 132:9baf128c2fab 3867 void arm_fir_lattice_init_q31(
<> 132:9baf128c2fab 3868 arm_fir_lattice_instance_q31 * S,
<> 132:9baf128c2fab 3869 uint16_t numStages,
<> 132:9baf128c2fab 3870 q31_t * pCoeffs,
<> 132:9baf128c2fab 3871 q31_t * pState);
<> 132:9baf128c2fab 3872
<> 132:9baf128c2fab 3873
<> 132:9baf128c2fab 3874 /**
<> 132:9baf128c2fab 3875 * @brief Processing function for the Q31 FIR lattice filter.
AnnaBridge 145:64910690c574 3876 * @param[in] S points to an instance of the Q31 FIR lattice structure.
AnnaBridge 145:64910690c574 3877 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3878 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3879 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3880 */
<> 132:9baf128c2fab 3881 void arm_fir_lattice_q31(
<> 132:9baf128c2fab 3882 const arm_fir_lattice_instance_q31 * S,
<> 132:9baf128c2fab 3883 q31_t * pSrc,
<> 132:9baf128c2fab 3884 q31_t * pDst,
<> 132:9baf128c2fab 3885 uint32_t blockSize);
<> 132:9baf128c2fab 3886
AnnaBridge 145:64910690c574 3887
<> 132:9baf128c2fab 3888 /**
<> 132:9baf128c2fab 3889 * @brief Initialization function for the floating-point FIR lattice filter.
AnnaBridge 145:64910690c574 3890 * @param[in] S points to an instance of the floating-point FIR lattice structure.
<> 132:9baf128c2fab 3891 * @param[in] numStages number of filter stages.
AnnaBridge 145:64910690c574 3892 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3893 * @param[in] pState points to the state buffer. The array is of length numStages.
<> 132:9baf128c2fab 3894 */
<> 132:9baf128c2fab 3895 void arm_fir_lattice_init_f32(
<> 132:9baf128c2fab 3896 arm_fir_lattice_instance_f32 * S,
<> 132:9baf128c2fab 3897 uint16_t numStages,
<> 132:9baf128c2fab 3898 float32_t * pCoeffs,
<> 132:9baf128c2fab 3899 float32_t * pState);
<> 132:9baf128c2fab 3900
AnnaBridge 145:64910690c574 3901
<> 132:9baf128c2fab 3902 /**
<> 132:9baf128c2fab 3903 * @brief Processing function for the floating-point FIR lattice filter.
AnnaBridge 145:64910690c574 3904 * @param[in] S points to an instance of the floating-point FIR lattice structure.
AnnaBridge 145:64910690c574 3905 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3906 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 3907 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3908 */
<> 132:9baf128c2fab 3909 void arm_fir_lattice_f32(
<> 132:9baf128c2fab 3910 const arm_fir_lattice_instance_f32 * S,
<> 132:9baf128c2fab 3911 float32_t * pSrc,
<> 132:9baf128c2fab 3912 float32_t * pDst,
<> 132:9baf128c2fab 3913 uint32_t blockSize);
<> 132:9baf128c2fab 3914
AnnaBridge 145:64910690c574 3915
<> 132:9baf128c2fab 3916 /**
<> 132:9baf128c2fab 3917 * @brief Instance structure for the Q15 IIR lattice filter.
<> 132:9baf128c2fab 3918 */
<> 132:9baf128c2fab 3919 typedef struct
<> 132:9baf128c2fab 3920 {
AnnaBridge 145:64910690c574 3921 uint16_t numStages; /**< number of stages in the filter. */
AnnaBridge 145:64910690c574 3922 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
AnnaBridge 145:64910690c574 3923 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
AnnaBridge 145:64910690c574 3924 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 132:9baf128c2fab 3925 } arm_iir_lattice_instance_q15;
<> 132:9baf128c2fab 3926
<> 132:9baf128c2fab 3927 /**
<> 132:9baf128c2fab 3928 * @brief Instance structure for the Q31 IIR lattice filter.
<> 132:9baf128c2fab 3929 */
<> 132:9baf128c2fab 3930 typedef struct
<> 132:9baf128c2fab 3931 {
AnnaBridge 145:64910690c574 3932 uint16_t numStages; /**< number of stages in the filter. */
AnnaBridge 145:64910690c574 3933 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
AnnaBridge 145:64910690c574 3934 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
AnnaBridge 145:64910690c574 3935 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 132:9baf128c2fab 3936 } arm_iir_lattice_instance_q31;
<> 132:9baf128c2fab 3937
<> 132:9baf128c2fab 3938 /**
<> 132:9baf128c2fab 3939 * @brief Instance structure for the floating-point IIR lattice filter.
<> 132:9baf128c2fab 3940 */
<> 132:9baf128c2fab 3941 typedef struct
<> 132:9baf128c2fab 3942 {
AnnaBridge 145:64910690c574 3943 uint16_t numStages; /**< number of stages in the filter. */
AnnaBridge 145:64910690c574 3944 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
AnnaBridge 145:64910690c574 3945 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
AnnaBridge 145:64910690c574 3946 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 132:9baf128c2fab 3947 } arm_iir_lattice_instance_f32;
<> 132:9baf128c2fab 3948
AnnaBridge 145:64910690c574 3949
<> 132:9baf128c2fab 3950 /**
<> 132:9baf128c2fab 3951 * @brief Processing function for the floating-point IIR lattice filter.
AnnaBridge 145:64910690c574 3952 * @param[in] S points to an instance of the floating-point IIR lattice structure.
AnnaBridge 145:64910690c574 3953 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3954 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3955 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3956 */
<> 132:9baf128c2fab 3957 void arm_iir_lattice_f32(
<> 132:9baf128c2fab 3958 const arm_iir_lattice_instance_f32 * S,
<> 132:9baf128c2fab 3959 float32_t * pSrc,
<> 132:9baf128c2fab 3960 float32_t * pDst,
<> 132:9baf128c2fab 3961 uint32_t blockSize);
<> 132:9baf128c2fab 3962
AnnaBridge 145:64910690c574 3963
<> 132:9baf128c2fab 3964 /**
<> 132:9baf128c2fab 3965 * @brief Initialization function for the floating-point IIR lattice filter.
AnnaBridge 145:64910690c574 3966 * @param[in] S points to an instance of the floating-point IIR lattice structure.
AnnaBridge 145:64910690c574 3967 * @param[in] numStages number of stages in the filter.
AnnaBridge 145:64910690c574 3968 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 3969 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
AnnaBridge 145:64910690c574 3970 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1.
AnnaBridge 145:64910690c574 3971 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3972 */
<> 132:9baf128c2fab 3973 void arm_iir_lattice_init_f32(
<> 132:9baf128c2fab 3974 arm_iir_lattice_instance_f32 * S,
<> 132:9baf128c2fab 3975 uint16_t numStages,
<> 132:9baf128c2fab 3976 float32_t * pkCoeffs,
<> 132:9baf128c2fab 3977 float32_t * pvCoeffs,
<> 132:9baf128c2fab 3978 float32_t * pState,
<> 132:9baf128c2fab 3979 uint32_t blockSize);
<> 132:9baf128c2fab 3980
<> 132:9baf128c2fab 3981
<> 132:9baf128c2fab 3982 /**
<> 132:9baf128c2fab 3983 * @brief Processing function for the Q31 IIR lattice filter.
AnnaBridge 145:64910690c574 3984 * @param[in] S points to an instance of the Q31 IIR lattice structure.
AnnaBridge 145:64910690c574 3985 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 3986 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 3987 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 3988 */
<> 132:9baf128c2fab 3989 void arm_iir_lattice_q31(
<> 132:9baf128c2fab 3990 const arm_iir_lattice_instance_q31 * S,
<> 132:9baf128c2fab 3991 q31_t * pSrc,
<> 132:9baf128c2fab 3992 q31_t * pDst,
<> 132:9baf128c2fab 3993 uint32_t blockSize);
<> 132:9baf128c2fab 3994
<> 132:9baf128c2fab 3995
<> 132:9baf128c2fab 3996 /**
<> 132:9baf128c2fab 3997 * @brief Initialization function for the Q31 IIR lattice filter.
AnnaBridge 145:64910690c574 3998 * @param[in] S points to an instance of the Q31 IIR lattice structure.
AnnaBridge 145:64910690c574 3999 * @param[in] numStages number of stages in the filter.
AnnaBridge 145:64910690c574 4000 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 4001 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
AnnaBridge 145:64910690c574 4002 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize.
AnnaBridge 145:64910690c574 4003 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4004 */
<> 132:9baf128c2fab 4005 void arm_iir_lattice_init_q31(
<> 132:9baf128c2fab 4006 arm_iir_lattice_instance_q31 * S,
<> 132:9baf128c2fab 4007 uint16_t numStages,
<> 132:9baf128c2fab 4008 q31_t * pkCoeffs,
<> 132:9baf128c2fab 4009 q31_t * pvCoeffs,
<> 132:9baf128c2fab 4010 q31_t * pState,
<> 132:9baf128c2fab 4011 uint32_t blockSize);
<> 132:9baf128c2fab 4012
<> 132:9baf128c2fab 4013
<> 132:9baf128c2fab 4014 /**
<> 132:9baf128c2fab 4015 * @brief Processing function for the Q15 IIR lattice filter.
AnnaBridge 145:64910690c574 4016 * @param[in] S points to an instance of the Q15 IIR lattice structure.
AnnaBridge 145:64910690c574 4017 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4018 * @param[out] pDst points to the block of output data.
AnnaBridge 145:64910690c574 4019 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4020 */
<> 132:9baf128c2fab 4021 void arm_iir_lattice_q15(
<> 132:9baf128c2fab 4022 const arm_iir_lattice_instance_q15 * S,
<> 132:9baf128c2fab 4023 q15_t * pSrc,
<> 132:9baf128c2fab 4024 q15_t * pDst,
<> 132:9baf128c2fab 4025 uint32_t blockSize);
<> 132:9baf128c2fab 4026
<> 132:9baf128c2fab 4027
<> 132:9baf128c2fab 4028 /**
<> 132:9baf128c2fab 4029 * @brief Initialization function for the Q15 IIR lattice filter.
AnnaBridge 145:64910690c574 4030 * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure.
<> 132:9baf128c2fab 4031 * @param[in] numStages number of stages in the filter.
AnnaBridge 145:64910690c574 4032 * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
AnnaBridge 145:64910690c574 4033 * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
AnnaBridge 145:64910690c574 4034 * @param[in] pState points to state buffer. The array is of length numStages+blockSize.
AnnaBridge 145:64910690c574 4035 * @param[in] blockSize number of samples to process per call.
<> 132:9baf128c2fab 4036 */
<> 132:9baf128c2fab 4037 void arm_iir_lattice_init_q15(
<> 132:9baf128c2fab 4038 arm_iir_lattice_instance_q15 * S,
<> 132:9baf128c2fab 4039 uint16_t numStages,
<> 132:9baf128c2fab 4040 q15_t * pkCoeffs,
<> 132:9baf128c2fab 4041 q15_t * pvCoeffs,
<> 132:9baf128c2fab 4042 q15_t * pState,
<> 132:9baf128c2fab 4043 uint32_t blockSize);
<> 132:9baf128c2fab 4044
AnnaBridge 145:64910690c574 4045
<> 132:9baf128c2fab 4046 /**
<> 132:9baf128c2fab 4047 * @brief Instance structure for the floating-point LMS filter.
<> 132:9baf128c2fab 4048 */
<> 132:9baf128c2fab 4049 typedef struct
<> 132:9baf128c2fab 4050 {
<> 132:9baf128c2fab 4051 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4052 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4053 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 4054 float32_t mu; /**< step size that controls filter coefficient updates. */
<> 132:9baf128c2fab 4055 } arm_lms_instance_f32;
<> 132:9baf128c2fab 4056
AnnaBridge 145:64910690c574 4057
<> 132:9baf128c2fab 4058 /**
<> 132:9baf128c2fab 4059 * @brief Processing function for floating-point LMS filter.
AnnaBridge 145:64910690c574 4060 * @param[in] S points to an instance of the floating-point LMS filter structure.
AnnaBridge 145:64910690c574 4061 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4062 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4063 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4064 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4065 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4066 */
<> 132:9baf128c2fab 4067 void arm_lms_f32(
<> 132:9baf128c2fab 4068 const arm_lms_instance_f32 * S,
<> 132:9baf128c2fab 4069 float32_t * pSrc,
<> 132:9baf128c2fab 4070 float32_t * pRef,
<> 132:9baf128c2fab 4071 float32_t * pOut,
<> 132:9baf128c2fab 4072 float32_t * pErr,
<> 132:9baf128c2fab 4073 uint32_t blockSize);
<> 132:9baf128c2fab 4074
AnnaBridge 145:64910690c574 4075
<> 132:9baf128c2fab 4076 /**
<> 132:9baf128c2fab 4077 * @brief Initialization function for floating-point LMS filter.
AnnaBridge 145:64910690c574 4078 * @param[in] S points to an instance of the floating-point LMS filter structure.
AnnaBridge 145:64910690c574 4079 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4080 * @param[in] pCoeffs points to the coefficient buffer.
AnnaBridge 145:64910690c574 4081 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 4082 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4083 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4084 */
<> 132:9baf128c2fab 4085 void arm_lms_init_f32(
<> 132:9baf128c2fab 4086 arm_lms_instance_f32 * S,
<> 132:9baf128c2fab 4087 uint16_t numTaps,
<> 132:9baf128c2fab 4088 float32_t * pCoeffs,
<> 132:9baf128c2fab 4089 float32_t * pState,
<> 132:9baf128c2fab 4090 float32_t mu,
<> 132:9baf128c2fab 4091 uint32_t blockSize);
<> 132:9baf128c2fab 4092
AnnaBridge 145:64910690c574 4093
<> 132:9baf128c2fab 4094 /**
<> 132:9baf128c2fab 4095 * @brief Instance structure for the Q15 LMS filter.
<> 132:9baf128c2fab 4096 */
<> 132:9baf128c2fab 4097 typedef struct
<> 132:9baf128c2fab 4098 {
<> 132:9baf128c2fab 4099 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4100 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4101 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 4102 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 132:9baf128c2fab 4103 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 132:9baf128c2fab 4104 } arm_lms_instance_q15;
<> 132:9baf128c2fab 4105
<> 132:9baf128c2fab 4106
<> 132:9baf128c2fab 4107 /**
<> 132:9baf128c2fab 4108 * @brief Initialization function for the Q15 LMS filter.
AnnaBridge 145:64910690c574 4109 * @param[in] S points to an instance of the Q15 LMS filter structure.
AnnaBridge 145:64910690c574 4110 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4111 * @param[in] pCoeffs points to the coefficient buffer.
AnnaBridge 145:64910690c574 4112 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 4113 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4114 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4115 * @param[in] postShift bit shift applied to coefficients.
AnnaBridge 145:64910690c574 4116 */
<> 132:9baf128c2fab 4117 void arm_lms_init_q15(
<> 132:9baf128c2fab 4118 arm_lms_instance_q15 * S,
<> 132:9baf128c2fab 4119 uint16_t numTaps,
<> 132:9baf128c2fab 4120 q15_t * pCoeffs,
<> 132:9baf128c2fab 4121 q15_t * pState,
<> 132:9baf128c2fab 4122 q15_t mu,
<> 132:9baf128c2fab 4123 uint32_t blockSize,
<> 132:9baf128c2fab 4124 uint32_t postShift);
<> 132:9baf128c2fab 4125
AnnaBridge 145:64910690c574 4126
<> 132:9baf128c2fab 4127 /**
<> 132:9baf128c2fab 4128 * @brief Processing function for Q15 LMS filter.
AnnaBridge 145:64910690c574 4129 * @param[in] S points to an instance of the Q15 LMS filter structure.
AnnaBridge 145:64910690c574 4130 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4131 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4132 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4133 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4134 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4135 */
<> 132:9baf128c2fab 4136 void arm_lms_q15(
<> 132:9baf128c2fab 4137 const arm_lms_instance_q15 * S,
<> 132:9baf128c2fab 4138 q15_t * pSrc,
<> 132:9baf128c2fab 4139 q15_t * pRef,
<> 132:9baf128c2fab 4140 q15_t * pOut,
<> 132:9baf128c2fab 4141 q15_t * pErr,
<> 132:9baf128c2fab 4142 uint32_t blockSize);
<> 132:9baf128c2fab 4143
<> 132:9baf128c2fab 4144
<> 132:9baf128c2fab 4145 /**
<> 132:9baf128c2fab 4146 * @brief Instance structure for the Q31 LMS filter.
<> 132:9baf128c2fab 4147 */
<> 132:9baf128c2fab 4148 typedef struct
<> 132:9baf128c2fab 4149 {
<> 132:9baf128c2fab 4150 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4151 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4152 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 4153 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 132:9baf128c2fab 4154 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 132:9baf128c2fab 4155 } arm_lms_instance_q31;
<> 132:9baf128c2fab 4156
AnnaBridge 145:64910690c574 4157
<> 132:9baf128c2fab 4158 /**
<> 132:9baf128c2fab 4159 * @brief Processing function for Q31 LMS filter.
AnnaBridge 145:64910690c574 4160 * @param[in] S points to an instance of the Q15 LMS filter structure.
AnnaBridge 145:64910690c574 4161 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4162 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4163 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4164 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4165 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4166 */
<> 132:9baf128c2fab 4167 void arm_lms_q31(
<> 132:9baf128c2fab 4168 const arm_lms_instance_q31 * S,
<> 132:9baf128c2fab 4169 q31_t * pSrc,
<> 132:9baf128c2fab 4170 q31_t * pRef,
<> 132:9baf128c2fab 4171 q31_t * pOut,
<> 132:9baf128c2fab 4172 q31_t * pErr,
<> 132:9baf128c2fab 4173 uint32_t blockSize);
<> 132:9baf128c2fab 4174
AnnaBridge 145:64910690c574 4175
<> 132:9baf128c2fab 4176 /**
<> 132:9baf128c2fab 4177 * @brief Initialization function for Q31 LMS filter.
AnnaBridge 145:64910690c574 4178 * @param[in] S points to an instance of the Q31 LMS filter structure.
AnnaBridge 145:64910690c574 4179 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4180 * @param[in] pCoeffs points to coefficient buffer.
AnnaBridge 145:64910690c574 4181 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 4182 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4183 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4184 * @param[in] postShift bit shift applied to coefficients.
AnnaBridge 145:64910690c574 4185 */
<> 132:9baf128c2fab 4186 void arm_lms_init_q31(
<> 132:9baf128c2fab 4187 arm_lms_instance_q31 * S,
<> 132:9baf128c2fab 4188 uint16_t numTaps,
<> 132:9baf128c2fab 4189 q31_t * pCoeffs,
<> 132:9baf128c2fab 4190 q31_t * pState,
<> 132:9baf128c2fab 4191 q31_t mu,
<> 132:9baf128c2fab 4192 uint32_t blockSize,
<> 132:9baf128c2fab 4193 uint32_t postShift);
<> 132:9baf128c2fab 4194
AnnaBridge 145:64910690c574 4195
<> 132:9baf128c2fab 4196 /**
<> 132:9baf128c2fab 4197 * @brief Instance structure for the floating-point normalized LMS filter.
<> 132:9baf128c2fab 4198 */
<> 132:9baf128c2fab 4199 typedef struct
<> 132:9baf128c2fab 4200 {
<> 132:9baf128c2fab 4201 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4202 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4203 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
AnnaBridge 145:64910690c574 4204 float32_t mu; /**< step size that control filter coefficient updates. */
AnnaBridge 145:64910690c574 4205 float32_t energy; /**< saves previous frame energy. */
AnnaBridge 145:64910690c574 4206 float32_t x0; /**< saves previous input sample. */
<> 132:9baf128c2fab 4207 } arm_lms_norm_instance_f32;
<> 132:9baf128c2fab 4208
AnnaBridge 145:64910690c574 4209
<> 132:9baf128c2fab 4210 /**
<> 132:9baf128c2fab 4211 * @brief Processing function for floating-point normalized LMS filter.
AnnaBridge 145:64910690c574 4212 * @param[in] S points to an instance of the floating-point normalized LMS filter structure.
AnnaBridge 145:64910690c574 4213 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4214 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4215 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4216 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4217 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4218 */
<> 132:9baf128c2fab 4219 void arm_lms_norm_f32(
<> 132:9baf128c2fab 4220 arm_lms_norm_instance_f32 * S,
<> 132:9baf128c2fab 4221 float32_t * pSrc,
<> 132:9baf128c2fab 4222 float32_t * pRef,
<> 132:9baf128c2fab 4223 float32_t * pOut,
<> 132:9baf128c2fab 4224 float32_t * pErr,
<> 132:9baf128c2fab 4225 uint32_t blockSize);
<> 132:9baf128c2fab 4226
AnnaBridge 145:64910690c574 4227
<> 132:9baf128c2fab 4228 /**
<> 132:9baf128c2fab 4229 * @brief Initialization function for floating-point normalized LMS filter.
AnnaBridge 145:64910690c574 4230 * @param[in] S points to an instance of the floating-point LMS filter structure.
AnnaBridge 145:64910690c574 4231 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4232 * @param[in] pCoeffs points to coefficient buffer.
AnnaBridge 145:64910690c574 4233 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 4234 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4235 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4236 */
<> 132:9baf128c2fab 4237 void arm_lms_norm_init_f32(
<> 132:9baf128c2fab 4238 arm_lms_norm_instance_f32 * S,
<> 132:9baf128c2fab 4239 uint16_t numTaps,
<> 132:9baf128c2fab 4240 float32_t * pCoeffs,
<> 132:9baf128c2fab 4241 float32_t * pState,
<> 132:9baf128c2fab 4242 float32_t mu,
<> 132:9baf128c2fab 4243 uint32_t blockSize);
<> 132:9baf128c2fab 4244
<> 132:9baf128c2fab 4245
<> 132:9baf128c2fab 4246 /**
<> 132:9baf128c2fab 4247 * @brief Instance structure for the Q31 normalized LMS filter.
<> 132:9baf128c2fab 4248 */
<> 132:9baf128c2fab 4249 typedef struct
<> 132:9baf128c2fab 4250 {
<> 132:9baf128c2fab 4251 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4252 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4253 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 132:9baf128c2fab 4254 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 132:9baf128c2fab 4255 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 132:9baf128c2fab 4256 q31_t *recipTable; /**< points to the reciprocal initial value table. */
<> 132:9baf128c2fab 4257 q31_t energy; /**< saves previous frame energy. */
<> 132:9baf128c2fab 4258 q31_t x0; /**< saves previous input sample. */
<> 132:9baf128c2fab 4259 } arm_lms_norm_instance_q31;
<> 132:9baf128c2fab 4260
AnnaBridge 145:64910690c574 4261
<> 132:9baf128c2fab 4262 /**
<> 132:9baf128c2fab 4263 * @brief Processing function for Q31 normalized LMS filter.
AnnaBridge 145:64910690c574 4264 * @param[in] S points to an instance of the Q31 normalized LMS filter structure.
AnnaBridge 145:64910690c574 4265 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4266 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4267 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4268 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4269 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4270 */
<> 132:9baf128c2fab 4271 void arm_lms_norm_q31(
<> 132:9baf128c2fab 4272 arm_lms_norm_instance_q31 * S,
<> 132:9baf128c2fab 4273 q31_t * pSrc,
<> 132:9baf128c2fab 4274 q31_t * pRef,
<> 132:9baf128c2fab 4275 q31_t * pOut,
<> 132:9baf128c2fab 4276 q31_t * pErr,
<> 132:9baf128c2fab 4277 uint32_t blockSize);
<> 132:9baf128c2fab 4278
AnnaBridge 145:64910690c574 4279
<> 132:9baf128c2fab 4280 /**
<> 132:9baf128c2fab 4281 * @brief Initialization function for Q31 normalized LMS filter.
AnnaBridge 145:64910690c574 4282 * @param[in] S points to an instance of the Q31 normalized LMS filter structure.
AnnaBridge 145:64910690c574 4283 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4284 * @param[in] pCoeffs points to coefficient buffer.
AnnaBridge 145:64910690c574 4285 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 4286 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4287 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4288 * @param[in] postShift bit shift applied to coefficients.
AnnaBridge 145:64910690c574 4289 */
<> 132:9baf128c2fab 4290 void arm_lms_norm_init_q31(
<> 132:9baf128c2fab 4291 arm_lms_norm_instance_q31 * S,
<> 132:9baf128c2fab 4292 uint16_t numTaps,
<> 132:9baf128c2fab 4293 q31_t * pCoeffs,
<> 132:9baf128c2fab 4294 q31_t * pState,
<> 132:9baf128c2fab 4295 q31_t mu,
<> 132:9baf128c2fab 4296 uint32_t blockSize,
<> 132:9baf128c2fab 4297 uint8_t postShift);
<> 132:9baf128c2fab 4298
AnnaBridge 145:64910690c574 4299
<> 132:9baf128c2fab 4300 /**
<> 132:9baf128c2fab 4301 * @brief Instance structure for the Q15 normalized LMS filter.
<> 132:9baf128c2fab 4302 */
<> 132:9baf128c2fab 4303 typedef struct
<> 132:9baf128c2fab 4304 {
AnnaBridge 145:64910690c574 4305 uint16_t numTaps; /**< Number of coefficients in the filter. */
<> 132:9baf128c2fab 4306 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 132:9baf128c2fab 4307 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
AnnaBridge 145:64910690c574 4308 q15_t mu; /**< step size that controls filter coefficient updates. */
AnnaBridge 145:64910690c574 4309 uint8_t postShift; /**< bit shift applied to coefficients. */
AnnaBridge 145:64910690c574 4310 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
AnnaBridge 145:64910690c574 4311 q15_t energy; /**< saves previous frame energy. */
AnnaBridge 145:64910690c574 4312 q15_t x0; /**< saves previous input sample. */
<> 132:9baf128c2fab 4313 } arm_lms_norm_instance_q15;
<> 132:9baf128c2fab 4314
AnnaBridge 145:64910690c574 4315
<> 132:9baf128c2fab 4316 /**
<> 132:9baf128c2fab 4317 * @brief Processing function for Q15 normalized LMS filter.
AnnaBridge 145:64910690c574 4318 * @param[in] S points to an instance of the Q15 normalized LMS filter structure.
AnnaBridge 145:64910690c574 4319 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4320 * @param[in] pRef points to the block of reference data.
AnnaBridge 145:64910690c574 4321 * @param[out] pOut points to the block of output data.
AnnaBridge 145:64910690c574 4322 * @param[out] pErr points to the block of error data.
AnnaBridge 145:64910690c574 4323 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4324 */
<> 132:9baf128c2fab 4325 void arm_lms_norm_q15(
<> 132:9baf128c2fab 4326 arm_lms_norm_instance_q15 * S,
<> 132:9baf128c2fab 4327 q15_t * pSrc,
<> 132:9baf128c2fab 4328 q15_t * pRef,
<> 132:9baf128c2fab 4329 q15_t * pOut,
<> 132:9baf128c2fab 4330 q15_t * pErr,
<> 132:9baf128c2fab 4331 uint32_t blockSize);
<> 132:9baf128c2fab 4332
<> 132:9baf128c2fab 4333
<> 132:9baf128c2fab 4334 /**
<> 132:9baf128c2fab 4335 * @brief Initialization function for Q15 normalized LMS filter.
AnnaBridge 145:64910690c574 4336 * @param[in] S points to an instance of the Q15 normalized LMS filter structure.
AnnaBridge 145:64910690c574 4337 * @param[in] numTaps number of filter coefficients.
AnnaBridge 145:64910690c574 4338 * @param[in] pCoeffs points to coefficient buffer.
AnnaBridge 145:64910690c574 4339 * @param[in] pState points to state buffer.
AnnaBridge 145:64910690c574 4340 * @param[in] mu step size that controls filter coefficient updates.
AnnaBridge 145:64910690c574 4341 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 4342 * @param[in] postShift bit shift applied to coefficients.
AnnaBridge 145:64910690c574 4343 */
<> 132:9baf128c2fab 4344 void arm_lms_norm_init_q15(
<> 132:9baf128c2fab 4345 arm_lms_norm_instance_q15 * S,
<> 132:9baf128c2fab 4346 uint16_t numTaps,
<> 132:9baf128c2fab 4347 q15_t * pCoeffs,
<> 132:9baf128c2fab 4348 q15_t * pState,
<> 132:9baf128c2fab 4349 q15_t mu,
<> 132:9baf128c2fab 4350 uint32_t blockSize,
<> 132:9baf128c2fab 4351 uint8_t postShift);
<> 132:9baf128c2fab 4352
AnnaBridge 145:64910690c574 4353
<> 132:9baf128c2fab 4354 /**
<> 132:9baf128c2fab 4355 * @brief Correlation of floating-point sequences.
AnnaBridge 145:64910690c574 4356 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4357 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4358 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4359 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4360 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4361 */
<> 132:9baf128c2fab 4362 void arm_correlate_f32(
<> 132:9baf128c2fab 4363 float32_t * pSrcA,
<> 132:9baf128c2fab 4364 uint32_t srcALen,
<> 132:9baf128c2fab 4365 float32_t * pSrcB,
<> 132:9baf128c2fab 4366 uint32_t srcBLen,
<> 132:9baf128c2fab 4367 float32_t * pDst);
<> 132:9baf128c2fab 4368
<> 132:9baf128c2fab 4369
<> 132:9baf128c2fab 4370 /**
<> 132:9baf128c2fab 4371 * @brief Correlation of Q15 sequences
AnnaBridge 145:64910690c574 4372 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4373 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4374 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4375 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4376 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4377 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 132:9baf128c2fab 4378 */
<> 132:9baf128c2fab 4379 void arm_correlate_opt_q15(
<> 132:9baf128c2fab 4380 q15_t * pSrcA,
<> 132:9baf128c2fab 4381 uint32_t srcALen,
<> 132:9baf128c2fab 4382 q15_t * pSrcB,
<> 132:9baf128c2fab 4383 uint32_t srcBLen,
<> 132:9baf128c2fab 4384 q15_t * pDst,
<> 132:9baf128c2fab 4385 q15_t * pScratch);
<> 132:9baf128c2fab 4386
<> 132:9baf128c2fab 4387
<> 132:9baf128c2fab 4388 /**
<> 132:9baf128c2fab 4389 * @brief Correlation of Q15 sequences.
AnnaBridge 145:64910690c574 4390 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4391 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4392 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4393 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4394 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 132:9baf128c2fab 4395 */
<> 132:9baf128c2fab 4396
<> 132:9baf128c2fab 4397 void arm_correlate_q15(
<> 132:9baf128c2fab 4398 q15_t * pSrcA,
<> 132:9baf128c2fab 4399 uint32_t srcALen,
<> 132:9baf128c2fab 4400 q15_t * pSrcB,
<> 132:9baf128c2fab 4401 uint32_t srcBLen,
<> 132:9baf128c2fab 4402 q15_t * pDst);
<> 132:9baf128c2fab 4403
AnnaBridge 145:64910690c574 4404
<> 132:9baf128c2fab 4405 /**
<> 132:9baf128c2fab 4406 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 4407 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4408 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4409 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4410 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4411 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 132:9baf128c2fab 4412 */
<> 132:9baf128c2fab 4413
<> 132:9baf128c2fab 4414 void arm_correlate_fast_q15(
AnnaBridge 145:64910690c574 4415 q15_t * pSrcA,
AnnaBridge 145:64910690c574 4416 uint32_t srcALen,
AnnaBridge 145:64910690c574 4417 q15_t * pSrcB,
AnnaBridge 145:64910690c574 4418 uint32_t srcBLen,
AnnaBridge 145:64910690c574 4419 q15_t * pDst);
<> 132:9baf128c2fab 4420
<> 132:9baf128c2fab 4421
<> 132:9baf128c2fab 4422 /**
<> 132:9baf128c2fab 4423 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
AnnaBridge 145:64910690c574 4424 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4425 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4426 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4427 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4428 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4429 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 4430 */
<> 132:9baf128c2fab 4431 void arm_correlate_fast_opt_q15(
<> 132:9baf128c2fab 4432 q15_t * pSrcA,
<> 132:9baf128c2fab 4433 uint32_t srcALen,
<> 132:9baf128c2fab 4434 q15_t * pSrcB,
<> 132:9baf128c2fab 4435 uint32_t srcBLen,
<> 132:9baf128c2fab 4436 q15_t * pDst,
<> 132:9baf128c2fab 4437 q15_t * pScratch);
<> 132:9baf128c2fab 4438
AnnaBridge 145:64910690c574 4439
<> 132:9baf128c2fab 4440 /**
<> 132:9baf128c2fab 4441 * @brief Correlation of Q31 sequences.
AnnaBridge 145:64910690c574 4442 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4443 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4444 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4445 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4446 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4447 */
<> 132:9baf128c2fab 4448 void arm_correlate_q31(
<> 132:9baf128c2fab 4449 q31_t * pSrcA,
<> 132:9baf128c2fab 4450 uint32_t srcALen,
<> 132:9baf128c2fab 4451 q31_t * pSrcB,
<> 132:9baf128c2fab 4452 uint32_t srcBLen,
<> 132:9baf128c2fab 4453 q31_t * pDst);
<> 132:9baf128c2fab 4454
AnnaBridge 145:64910690c574 4455
<> 132:9baf128c2fab 4456 /**
<> 132:9baf128c2fab 4457 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
AnnaBridge 145:64910690c574 4458 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4459 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4460 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4461 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4462 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4463 */
<> 132:9baf128c2fab 4464 void arm_correlate_fast_q31(
<> 132:9baf128c2fab 4465 q31_t * pSrcA,
<> 132:9baf128c2fab 4466 uint32_t srcALen,
<> 132:9baf128c2fab 4467 q31_t * pSrcB,
<> 132:9baf128c2fab 4468 uint32_t srcBLen,
<> 132:9baf128c2fab 4469 q31_t * pDst);
<> 132:9baf128c2fab 4470
<> 132:9baf128c2fab 4471
<> 132:9baf128c2fab 4472 /**
<> 132:9baf128c2fab 4473 * @brief Correlation of Q7 sequences.
AnnaBridge 145:64910690c574 4474 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4475 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4476 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4477 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4478 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4479 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
AnnaBridge 145:64910690c574 4480 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
AnnaBridge 145:64910690c574 4481 */
<> 132:9baf128c2fab 4482 void arm_correlate_opt_q7(
<> 132:9baf128c2fab 4483 q7_t * pSrcA,
<> 132:9baf128c2fab 4484 uint32_t srcALen,
<> 132:9baf128c2fab 4485 q7_t * pSrcB,
<> 132:9baf128c2fab 4486 uint32_t srcBLen,
<> 132:9baf128c2fab 4487 q7_t * pDst,
<> 132:9baf128c2fab 4488 q15_t * pScratch1,
<> 132:9baf128c2fab 4489 q15_t * pScratch2);
<> 132:9baf128c2fab 4490
<> 132:9baf128c2fab 4491
<> 132:9baf128c2fab 4492 /**
<> 132:9baf128c2fab 4493 * @brief Correlation of Q7 sequences.
AnnaBridge 145:64910690c574 4494 * @param[in] pSrcA points to the first input sequence.
AnnaBridge 145:64910690c574 4495 * @param[in] srcALen length of the first input sequence.
AnnaBridge 145:64910690c574 4496 * @param[in] pSrcB points to the second input sequence.
AnnaBridge 145:64910690c574 4497 * @param[in] srcBLen length of the second input sequence.
AnnaBridge 145:64910690c574 4498 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
AnnaBridge 145:64910690c574 4499 */
<> 132:9baf128c2fab 4500 void arm_correlate_q7(
<> 132:9baf128c2fab 4501 q7_t * pSrcA,
<> 132:9baf128c2fab 4502 uint32_t srcALen,
<> 132:9baf128c2fab 4503 q7_t * pSrcB,
<> 132:9baf128c2fab 4504 uint32_t srcBLen,
<> 132:9baf128c2fab 4505 q7_t * pDst);
<> 132:9baf128c2fab 4506
<> 132:9baf128c2fab 4507
<> 132:9baf128c2fab 4508 /**
<> 132:9baf128c2fab 4509 * @brief Instance structure for the floating-point sparse FIR filter.
<> 132:9baf128c2fab 4510 */
<> 132:9baf128c2fab 4511 typedef struct
<> 132:9baf128c2fab 4512 {
<> 132:9baf128c2fab 4513 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4514 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 132:9baf128c2fab 4515 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 132:9baf128c2fab 4516 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 4517 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 132:9baf128c2fab 4518 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 132:9baf128c2fab 4519 } arm_fir_sparse_instance_f32;
<> 132:9baf128c2fab 4520
<> 132:9baf128c2fab 4521 /**
<> 132:9baf128c2fab 4522 * @brief Instance structure for the Q31 sparse FIR filter.
<> 132:9baf128c2fab 4523 */
<> 132:9baf128c2fab 4524 typedef struct
<> 132:9baf128c2fab 4525 {
<> 132:9baf128c2fab 4526 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4527 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 132:9baf128c2fab 4528 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 132:9baf128c2fab 4529 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 4530 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 132:9baf128c2fab 4531 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 132:9baf128c2fab 4532 } arm_fir_sparse_instance_q31;
<> 132:9baf128c2fab 4533
<> 132:9baf128c2fab 4534 /**
<> 132:9baf128c2fab 4535 * @brief Instance structure for the Q15 sparse FIR filter.
<> 132:9baf128c2fab 4536 */
<> 132:9baf128c2fab 4537 typedef struct
<> 132:9baf128c2fab 4538 {
<> 132:9baf128c2fab 4539 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4540 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 132:9baf128c2fab 4541 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 132:9baf128c2fab 4542 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 4543 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 132:9baf128c2fab 4544 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 132:9baf128c2fab 4545 } arm_fir_sparse_instance_q15;
<> 132:9baf128c2fab 4546
<> 132:9baf128c2fab 4547 /**
<> 132:9baf128c2fab 4548 * @brief Instance structure for the Q7 sparse FIR filter.
<> 132:9baf128c2fab 4549 */
<> 132:9baf128c2fab 4550 typedef struct
<> 132:9baf128c2fab 4551 {
<> 132:9baf128c2fab 4552 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 132:9baf128c2fab 4553 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 132:9baf128c2fab 4554 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 132:9baf128c2fab 4555 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 132:9baf128c2fab 4556 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 132:9baf128c2fab 4557 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 132:9baf128c2fab 4558 } arm_fir_sparse_instance_q7;
<> 132:9baf128c2fab 4559
AnnaBridge 145:64910690c574 4560
<> 132:9baf128c2fab 4561 /**
<> 132:9baf128c2fab 4562 * @brief Processing function for the floating-point sparse FIR filter.
AnnaBridge 145:64910690c574 4563 * @param[in] S points to an instance of the floating-point sparse FIR structure.
AnnaBridge 145:64910690c574 4564 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4565 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 4566 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
<> 132:9baf128c2fab 4567 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4568 */
<> 132:9baf128c2fab 4569 void arm_fir_sparse_f32(
<> 132:9baf128c2fab 4570 arm_fir_sparse_instance_f32 * S,
<> 132:9baf128c2fab 4571 float32_t * pSrc,
<> 132:9baf128c2fab 4572 float32_t * pDst,
<> 132:9baf128c2fab 4573 float32_t * pScratchIn,
<> 132:9baf128c2fab 4574 uint32_t blockSize);
<> 132:9baf128c2fab 4575
AnnaBridge 145:64910690c574 4576
<> 132:9baf128c2fab 4577 /**
<> 132:9baf128c2fab 4578 * @brief Initialization function for the floating-point sparse FIR filter.
AnnaBridge 145:64910690c574 4579 * @param[in,out] S points to an instance of the floating-point sparse FIR structure.
<> 132:9baf128c2fab 4580 * @param[in] numTaps number of nonzero coefficients in the filter.
AnnaBridge 145:64910690c574 4581 * @param[in] pCoeffs points to the array of filter coefficients.
AnnaBridge 145:64910690c574 4582 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 4583 * @param[in] pTapDelay points to the array of offset times.
<> 132:9baf128c2fab 4584 * @param[in] maxDelay maximum offset time supported.
<> 132:9baf128c2fab 4585 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4586 */
<> 132:9baf128c2fab 4587 void arm_fir_sparse_init_f32(
<> 132:9baf128c2fab 4588 arm_fir_sparse_instance_f32 * S,
<> 132:9baf128c2fab 4589 uint16_t numTaps,
<> 132:9baf128c2fab 4590 float32_t * pCoeffs,
<> 132:9baf128c2fab 4591 float32_t * pState,
<> 132:9baf128c2fab 4592 int32_t * pTapDelay,
<> 132:9baf128c2fab 4593 uint16_t maxDelay,
<> 132:9baf128c2fab 4594 uint32_t blockSize);
<> 132:9baf128c2fab 4595
AnnaBridge 145:64910690c574 4596
<> 132:9baf128c2fab 4597 /**
<> 132:9baf128c2fab 4598 * @brief Processing function for the Q31 sparse FIR filter.
AnnaBridge 145:64910690c574 4599 * @param[in] S points to an instance of the Q31 sparse FIR structure.
AnnaBridge 145:64910690c574 4600 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4601 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 4602 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
<> 132:9baf128c2fab 4603 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4604 */
<> 132:9baf128c2fab 4605 void arm_fir_sparse_q31(
<> 132:9baf128c2fab 4606 arm_fir_sparse_instance_q31 * S,
<> 132:9baf128c2fab 4607 q31_t * pSrc,
<> 132:9baf128c2fab 4608 q31_t * pDst,
<> 132:9baf128c2fab 4609 q31_t * pScratchIn,
<> 132:9baf128c2fab 4610 uint32_t blockSize);
<> 132:9baf128c2fab 4611
AnnaBridge 145:64910690c574 4612
<> 132:9baf128c2fab 4613 /**
<> 132:9baf128c2fab 4614 * @brief Initialization function for the Q31 sparse FIR filter.
AnnaBridge 145:64910690c574 4615 * @param[in,out] S points to an instance of the Q31 sparse FIR structure.
<> 132:9baf128c2fab 4616 * @param[in] numTaps number of nonzero coefficients in the filter.
AnnaBridge 145:64910690c574 4617 * @param[in] pCoeffs points to the array of filter coefficients.
AnnaBridge 145:64910690c574 4618 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 4619 * @param[in] pTapDelay points to the array of offset times.
<> 132:9baf128c2fab 4620 * @param[in] maxDelay maximum offset time supported.
<> 132:9baf128c2fab 4621 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4622 */
<> 132:9baf128c2fab 4623 void arm_fir_sparse_init_q31(
<> 132:9baf128c2fab 4624 arm_fir_sparse_instance_q31 * S,
<> 132:9baf128c2fab 4625 uint16_t numTaps,
<> 132:9baf128c2fab 4626 q31_t * pCoeffs,
<> 132:9baf128c2fab 4627 q31_t * pState,
<> 132:9baf128c2fab 4628 int32_t * pTapDelay,
<> 132:9baf128c2fab 4629 uint16_t maxDelay,
<> 132:9baf128c2fab 4630 uint32_t blockSize);
<> 132:9baf128c2fab 4631
AnnaBridge 145:64910690c574 4632
<> 132:9baf128c2fab 4633 /**
<> 132:9baf128c2fab 4634 * @brief Processing function for the Q15 sparse FIR filter.
AnnaBridge 145:64910690c574 4635 * @param[in] S points to an instance of the Q15 sparse FIR structure.
AnnaBridge 145:64910690c574 4636 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4637 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 4638 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
AnnaBridge 145:64910690c574 4639 * @param[in] pScratchOut points to a temporary buffer of size blockSize.
<> 132:9baf128c2fab 4640 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4641 */
<> 132:9baf128c2fab 4642 void arm_fir_sparse_q15(
<> 132:9baf128c2fab 4643 arm_fir_sparse_instance_q15 * S,
<> 132:9baf128c2fab 4644 q15_t * pSrc,
<> 132:9baf128c2fab 4645 q15_t * pDst,
<> 132:9baf128c2fab 4646 q15_t * pScratchIn,
<> 132:9baf128c2fab 4647 q31_t * pScratchOut,
<> 132:9baf128c2fab 4648 uint32_t blockSize);
<> 132:9baf128c2fab 4649
<> 132:9baf128c2fab 4650
<> 132:9baf128c2fab 4651 /**
<> 132:9baf128c2fab 4652 * @brief Initialization function for the Q15 sparse FIR filter.
AnnaBridge 145:64910690c574 4653 * @param[in,out] S points to an instance of the Q15 sparse FIR structure.
<> 132:9baf128c2fab 4654 * @param[in] numTaps number of nonzero coefficients in the filter.
AnnaBridge 145:64910690c574 4655 * @param[in] pCoeffs points to the array of filter coefficients.
AnnaBridge 145:64910690c574 4656 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 4657 * @param[in] pTapDelay points to the array of offset times.
<> 132:9baf128c2fab 4658 * @param[in] maxDelay maximum offset time supported.
<> 132:9baf128c2fab 4659 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4660 */
<> 132:9baf128c2fab 4661 void arm_fir_sparse_init_q15(
<> 132:9baf128c2fab 4662 arm_fir_sparse_instance_q15 * S,
<> 132:9baf128c2fab 4663 uint16_t numTaps,
<> 132:9baf128c2fab 4664 q15_t * pCoeffs,
<> 132:9baf128c2fab 4665 q15_t * pState,
<> 132:9baf128c2fab 4666 int32_t * pTapDelay,
<> 132:9baf128c2fab 4667 uint16_t maxDelay,
<> 132:9baf128c2fab 4668 uint32_t blockSize);
<> 132:9baf128c2fab 4669
AnnaBridge 145:64910690c574 4670
<> 132:9baf128c2fab 4671 /**
<> 132:9baf128c2fab 4672 * @brief Processing function for the Q7 sparse FIR filter.
AnnaBridge 145:64910690c574 4673 * @param[in] S points to an instance of the Q7 sparse FIR structure.
AnnaBridge 145:64910690c574 4674 * @param[in] pSrc points to the block of input data.
AnnaBridge 145:64910690c574 4675 * @param[out] pDst points to the block of output data
AnnaBridge 145:64910690c574 4676 * @param[in] pScratchIn points to a temporary buffer of size blockSize.
AnnaBridge 145:64910690c574 4677 * @param[in] pScratchOut points to a temporary buffer of size blockSize.
<> 132:9baf128c2fab 4678 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4679 */
<> 132:9baf128c2fab 4680 void arm_fir_sparse_q7(
<> 132:9baf128c2fab 4681 arm_fir_sparse_instance_q7 * S,
<> 132:9baf128c2fab 4682 q7_t * pSrc,
<> 132:9baf128c2fab 4683 q7_t * pDst,
<> 132:9baf128c2fab 4684 q7_t * pScratchIn,
<> 132:9baf128c2fab 4685 q31_t * pScratchOut,
<> 132:9baf128c2fab 4686 uint32_t blockSize);
<> 132:9baf128c2fab 4687
AnnaBridge 145:64910690c574 4688
<> 132:9baf128c2fab 4689 /**
<> 132:9baf128c2fab 4690 * @brief Initialization function for the Q7 sparse FIR filter.
AnnaBridge 145:64910690c574 4691 * @param[in,out] S points to an instance of the Q7 sparse FIR structure.
<> 132:9baf128c2fab 4692 * @param[in] numTaps number of nonzero coefficients in the filter.
AnnaBridge 145:64910690c574 4693 * @param[in] pCoeffs points to the array of filter coefficients.
AnnaBridge 145:64910690c574 4694 * @param[in] pState points to the state buffer.
AnnaBridge 145:64910690c574 4695 * @param[in] pTapDelay points to the array of offset times.
<> 132:9baf128c2fab 4696 * @param[in] maxDelay maximum offset time supported.
<> 132:9baf128c2fab 4697 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4698 */
<> 132:9baf128c2fab 4699 void arm_fir_sparse_init_q7(
<> 132:9baf128c2fab 4700 arm_fir_sparse_instance_q7 * S,
<> 132:9baf128c2fab 4701 uint16_t numTaps,
<> 132:9baf128c2fab 4702 q7_t * pCoeffs,
<> 132:9baf128c2fab 4703 q7_t * pState,
<> 132:9baf128c2fab 4704 int32_t * pTapDelay,
<> 132:9baf128c2fab 4705 uint16_t maxDelay,
<> 132:9baf128c2fab 4706 uint32_t blockSize);
<> 132:9baf128c2fab 4707
<> 132:9baf128c2fab 4708
AnnaBridge 145:64910690c574 4709 /**
<> 132:9baf128c2fab 4710 * @brief Floating-point sin_cos function.
AnnaBridge 145:64910690c574 4711 * @param[in] theta input value in degrees
AnnaBridge 145:64910690c574 4712 * @param[out] pSinVal points to the processed sine output.
AnnaBridge 145:64910690c574 4713 * @param[out] pCosVal points to the processed cos output.
AnnaBridge 145:64910690c574 4714 */
<> 132:9baf128c2fab 4715 void arm_sin_cos_f32(
<> 132:9baf128c2fab 4716 float32_t theta,
<> 132:9baf128c2fab 4717 float32_t * pSinVal,
AnnaBridge 145:64910690c574 4718 float32_t * pCosVal);
AnnaBridge 145:64910690c574 4719
AnnaBridge 145:64910690c574 4720
AnnaBridge 145:64910690c574 4721 /**
<> 132:9baf128c2fab 4722 * @brief Q31 sin_cos function.
<> 132:9baf128c2fab 4723 * @param[in] theta scaled input value in degrees
AnnaBridge 145:64910690c574 4724 * @param[out] pSinVal points to the processed sine output.
AnnaBridge 145:64910690c574 4725 * @param[out] pCosVal points to the processed cosine output.
AnnaBridge 145:64910690c574 4726 */
<> 132:9baf128c2fab 4727 void arm_sin_cos_q31(
<> 132:9baf128c2fab 4728 q31_t theta,
<> 132:9baf128c2fab 4729 q31_t * pSinVal,
<> 132:9baf128c2fab 4730 q31_t * pCosVal);
<> 132:9baf128c2fab 4731
<> 132:9baf128c2fab 4732
<> 132:9baf128c2fab 4733 /**
<> 132:9baf128c2fab 4734 * @brief Floating-point complex conjugate.
AnnaBridge 145:64910690c574 4735 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 4736 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 4737 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 4738 */
<> 132:9baf128c2fab 4739 void arm_cmplx_conj_f32(
<> 132:9baf128c2fab 4740 float32_t * pSrc,
<> 132:9baf128c2fab 4741 float32_t * pDst,
<> 132:9baf128c2fab 4742 uint32_t numSamples);
<> 132:9baf128c2fab 4743
<> 132:9baf128c2fab 4744 /**
<> 132:9baf128c2fab 4745 * @brief Q31 complex conjugate.
AnnaBridge 145:64910690c574 4746 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 4747 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 4748 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 4749 */
<> 132:9baf128c2fab 4750 void arm_cmplx_conj_q31(
<> 132:9baf128c2fab 4751 q31_t * pSrc,
<> 132:9baf128c2fab 4752 q31_t * pDst,
<> 132:9baf128c2fab 4753 uint32_t numSamples);
<> 132:9baf128c2fab 4754
AnnaBridge 145:64910690c574 4755
<> 132:9baf128c2fab 4756 /**
<> 132:9baf128c2fab 4757 * @brief Q15 complex conjugate.
AnnaBridge 145:64910690c574 4758 * @param[in] pSrc points to the input vector
AnnaBridge 145:64910690c574 4759 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 4760 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 4761 */
<> 132:9baf128c2fab 4762 void arm_cmplx_conj_q15(
<> 132:9baf128c2fab 4763 q15_t * pSrc,
<> 132:9baf128c2fab 4764 q15_t * pDst,
<> 132:9baf128c2fab 4765 uint32_t numSamples);
<> 132:9baf128c2fab 4766
<> 132:9baf128c2fab 4767
<> 132:9baf128c2fab 4768 /**
<> 132:9baf128c2fab 4769 * @brief Floating-point complex magnitude squared
AnnaBridge 145:64910690c574 4770 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 4771 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 4772 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 4773 */
<> 132:9baf128c2fab 4774 void arm_cmplx_mag_squared_f32(
<> 132:9baf128c2fab 4775 float32_t * pSrc,
<> 132:9baf128c2fab 4776 float32_t * pDst,
<> 132:9baf128c2fab 4777 uint32_t numSamples);
<> 132:9baf128c2fab 4778
AnnaBridge 145:64910690c574 4779
<> 132:9baf128c2fab 4780 /**
<> 132:9baf128c2fab 4781 * @brief Q31 complex magnitude squared
AnnaBridge 145:64910690c574 4782 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 4783 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 4784 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 4785 */
<> 132:9baf128c2fab 4786 void arm_cmplx_mag_squared_q31(
<> 132:9baf128c2fab 4787 q31_t * pSrc,
<> 132:9baf128c2fab 4788 q31_t * pDst,
<> 132:9baf128c2fab 4789 uint32_t numSamples);
<> 132:9baf128c2fab 4790
AnnaBridge 145:64910690c574 4791
<> 132:9baf128c2fab 4792 /**
<> 132:9baf128c2fab 4793 * @brief Q15 complex magnitude squared
AnnaBridge 145:64910690c574 4794 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 4795 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 4796 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 4797 */
<> 132:9baf128c2fab 4798 void arm_cmplx_mag_squared_q15(
<> 132:9baf128c2fab 4799 q15_t * pSrc,
<> 132:9baf128c2fab 4800 q15_t * pDst,
<> 132:9baf128c2fab 4801 uint32_t numSamples);
<> 132:9baf128c2fab 4802
<> 132:9baf128c2fab 4803
<> 132:9baf128c2fab 4804 /**
<> 132:9baf128c2fab 4805 * @ingroup groupController
<> 132:9baf128c2fab 4806 */
<> 132:9baf128c2fab 4807
<> 132:9baf128c2fab 4808 /**
<> 132:9baf128c2fab 4809 * @defgroup PID PID Motor Control
<> 132:9baf128c2fab 4810 *
<> 132:9baf128c2fab 4811 * A Proportional Integral Derivative (PID) controller is a generic feedback control
<> 132:9baf128c2fab 4812 * loop mechanism widely used in industrial control systems.
<> 132:9baf128c2fab 4813 * A PID controller is the most commonly used type of feedback controller.
<> 132:9baf128c2fab 4814 *
<> 132:9baf128c2fab 4815 * This set of functions implements (PID) controllers
<> 132:9baf128c2fab 4816 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
<> 132:9baf128c2fab 4817 * of data and each call to the function returns a single processed value.
<> 132:9baf128c2fab 4818 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
<> 132:9baf128c2fab 4819 * is the input sample value. The functions return the output value.
<> 132:9baf128c2fab 4820 *
<> 132:9baf128c2fab 4821 * \par Algorithm:
<> 132:9baf128c2fab 4822 * <pre>
<> 132:9baf128c2fab 4823 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
<> 132:9baf128c2fab 4824 * A0 = Kp + Ki + Kd
<> 132:9baf128c2fab 4825 * A1 = (-Kp ) - (2 * Kd )
<> 132:9baf128c2fab 4826 * A2 = Kd </pre>
<> 132:9baf128c2fab 4827 *
<> 132:9baf128c2fab 4828 * \par
<> 132:9baf128c2fab 4829 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
<> 132:9baf128c2fab 4830 *
<> 132:9baf128c2fab 4831 * \par
<> 132:9baf128c2fab 4832 * \image html PID.gif "Proportional Integral Derivative Controller"
<> 132:9baf128c2fab 4833 *
<> 132:9baf128c2fab 4834 * \par
<> 132:9baf128c2fab 4835 * The PID controller calculates an "error" value as the difference between
<> 132:9baf128c2fab 4836 * the measured output and the reference input.
<> 132:9baf128c2fab 4837 * The controller attempts to minimize the error by adjusting the process control inputs.
<> 132:9baf128c2fab 4838 * The proportional value determines the reaction to the current error,
<> 132:9baf128c2fab 4839 * the integral value determines the reaction based on the sum of recent errors,
<> 132:9baf128c2fab 4840 * and the derivative value determines the reaction based on the rate at which the error has been changing.
<> 132:9baf128c2fab 4841 *
<> 132:9baf128c2fab 4842 * \par Instance Structure
<> 132:9baf128c2fab 4843 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
<> 132:9baf128c2fab 4844 * A separate instance structure must be defined for each PID Controller.
<> 132:9baf128c2fab 4845 * There are separate instance structure declarations for each of the 3 supported data types.
<> 132:9baf128c2fab 4846 *
<> 132:9baf128c2fab 4847 * \par Reset Functions
<> 132:9baf128c2fab 4848 * There is also an associated reset function for each data type which clears the state array.
<> 132:9baf128c2fab 4849 *
<> 132:9baf128c2fab 4850 * \par Initialization Functions
<> 132:9baf128c2fab 4851 * There is also an associated initialization function for each data type.
<> 132:9baf128c2fab 4852 * The initialization function performs the following operations:
<> 132:9baf128c2fab 4853 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
<> 132:9baf128c2fab 4854 * - Zeros out the values in the state buffer.
<> 132:9baf128c2fab 4855 *
<> 132:9baf128c2fab 4856 * \par
<> 132:9baf128c2fab 4857 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
<> 132:9baf128c2fab 4858 *
<> 132:9baf128c2fab 4859 * \par Fixed-Point Behavior
<> 132:9baf128c2fab 4860 * Care must be taken when using the fixed-point versions of the PID Controller functions.
<> 132:9baf128c2fab 4861 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
<> 132:9baf128c2fab 4862 * Refer to the function specific documentation below for usage guidelines.
<> 132:9baf128c2fab 4863 */
<> 132:9baf128c2fab 4864
<> 132:9baf128c2fab 4865 /**
<> 132:9baf128c2fab 4866 * @addtogroup PID
<> 132:9baf128c2fab 4867 * @{
<> 132:9baf128c2fab 4868 */
<> 132:9baf128c2fab 4869
<> 132:9baf128c2fab 4870 /**
<> 132:9baf128c2fab 4871 * @brief Process function for the floating-point PID Control.
AnnaBridge 145:64910690c574 4872 * @param[in,out] S is an instance of the floating-point PID Control structure
AnnaBridge 145:64910690c574 4873 * @param[in] in input sample to process
<> 132:9baf128c2fab 4874 * @return out processed output sample.
<> 132:9baf128c2fab 4875 */
AnnaBridge 145:64910690c574 4876 CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32(
<> 132:9baf128c2fab 4877 arm_pid_instance_f32 * S,
<> 132:9baf128c2fab 4878 float32_t in)
<> 132:9baf128c2fab 4879 {
<> 132:9baf128c2fab 4880 float32_t out;
<> 132:9baf128c2fab 4881
<> 132:9baf128c2fab 4882 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
<> 132:9baf128c2fab 4883 out = (S->A0 * in) +
<> 132:9baf128c2fab 4884 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
<> 132:9baf128c2fab 4885
<> 132:9baf128c2fab 4886 /* Update state */
<> 132:9baf128c2fab 4887 S->state[1] = S->state[0];
<> 132:9baf128c2fab 4888 S->state[0] = in;
<> 132:9baf128c2fab 4889 S->state[2] = out;
<> 132:9baf128c2fab 4890
<> 132:9baf128c2fab 4891 /* return to application */
<> 132:9baf128c2fab 4892 return (out);
<> 132:9baf128c2fab 4893
<> 132:9baf128c2fab 4894 }
<> 132:9baf128c2fab 4895
<> 132:9baf128c2fab 4896 /**
<> 132:9baf128c2fab 4897 * @brief Process function for the Q31 PID Control.
AnnaBridge 145:64910690c574 4898 * @param[in,out] S points to an instance of the Q31 PID Control structure
AnnaBridge 145:64910690c574 4899 * @param[in] in input sample to process
<> 132:9baf128c2fab 4900 * @return out processed output sample.
<> 132:9baf128c2fab 4901 *
<> 132:9baf128c2fab 4902 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 4903 * \par
<> 132:9baf128c2fab 4904 * The function is implemented using an internal 64-bit accumulator.
<> 132:9baf128c2fab 4905 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
<> 132:9baf128c2fab 4906 * Thus, if the accumulator result overflows it wraps around rather than clip.
<> 132:9baf128c2fab 4907 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
<> 132:9baf128c2fab 4908 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
<> 132:9baf128c2fab 4909 */
AnnaBridge 145:64910690c574 4910 CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31(
<> 132:9baf128c2fab 4911 arm_pid_instance_q31 * S,
<> 132:9baf128c2fab 4912 q31_t in)
<> 132:9baf128c2fab 4913 {
<> 132:9baf128c2fab 4914 q63_t acc;
<> 132:9baf128c2fab 4915 q31_t out;
<> 132:9baf128c2fab 4916
<> 132:9baf128c2fab 4917 /* acc = A0 * x[n] */
<> 132:9baf128c2fab 4918 acc = (q63_t) S->A0 * in;
<> 132:9baf128c2fab 4919
<> 132:9baf128c2fab 4920 /* acc += A1 * x[n-1] */
<> 132:9baf128c2fab 4921 acc += (q63_t) S->A1 * S->state[0];
<> 132:9baf128c2fab 4922
<> 132:9baf128c2fab 4923 /* acc += A2 * x[n-2] */
<> 132:9baf128c2fab 4924 acc += (q63_t) S->A2 * S->state[1];
<> 132:9baf128c2fab 4925
<> 132:9baf128c2fab 4926 /* convert output to 1.31 format to add y[n-1] */
<> 132:9baf128c2fab 4927 out = (q31_t) (acc >> 31u);
<> 132:9baf128c2fab 4928
<> 132:9baf128c2fab 4929 /* out += y[n-1] */
<> 132:9baf128c2fab 4930 out += S->state[2];
<> 132:9baf128c2fab 4931
<> 132:9baf128c2fab 4932 /* Update state */
<> 132:9baf128c2fab 4933 S->state[1] = S->state[0];
<> 132:9baf128c2fab 4934 S->state[0] = in;
<> 132:9baf128c2fab 4935 S->state[2] = out;
<> 132:9baf128c2fab 4936
<> 132:9baf128c2fab 4937 /* return to application */
<> 132:9baf128c2fab 4938 return (out);
<> 132:9baf128c2fab 4939 }
<> 132:9baf128c2fab 4940
AnnaBridge 145:64910690c574 4941
<> 132:9baf128c2fab 4942 /**
<> 132:9baf128c2fab 4943 * @brief Process function for the Q15 PID Control.
AnnaBridge 145:64910690c574 4944 * @param[in,out] S points to an instance of the Q15 PID Control structure
AnnaBridge 145:64910690c574 4945 * @param[in] in input sample to process
<> 132:9baf128c2fab 4946 * @return out processed output sample.
<> 132:9baf128c2fab 4947 *
<> 132:9baf128c2fab 4948 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 4949 * \par
<> 132:9baf128c2fab 4950 * The function is implemented using a 64-bit internal accumulator.
<> 132:9baf128c2fab 4951 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
<> 132:9baf128c2fab 4952 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
<> 132:9baf128c2fab 4953 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
<> 132:9baf128c2fab 4954 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
<> 132:9baf128c2fab 4955 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
<> 132:9baf128c2fab 4956 */
AnnaBridge 145:64910690c574 4957 CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15(
<> 132:9baf128c2fab 4958 arm_pid_instance_q15 * S,
<> 132:9baf128c2fab 4959 q15_t in)
<> 132:9baf128c2fab 4960 {
<> 132:9baf128c2fab 4961 q63_t acc;
<> 132:9baf128c2fab 4962 q15_t out;
<> 132:9baf128c2fab 4963
AnnaBridge 145:64910690c574 4964 #if defined (ARM_MATH_DSP)
<> 132:9baf128c2fab 4965 __SIMD32_TYPE *vstate;
<> 132:9baf128c2fab 4966
<> 132:9baf128c2fab 4967 /* Implementation of PID controller */
<> 132:9baf128c2fab 4968
<> 132:9baf128c2fab 4969 /* acc = A0 * x[n] */
AnnaBridge 145:64910690c574 4970 acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);
<> 132:9baf128c2fab 4971
<> 132:9baf128c2fab 4972 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 132:9baf128c2fab 4973 vstate = __SIMD32_CONST(S->state);
AnnaBridge 145:64910690c574 4974 acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc);
<> 132:9baf128c2fab 4975 #else
<> 132:9baf128c2fab 4976 /* acc = A0 * x[n] */
<> 132:9baf128c2fab 4977 acc = ((q31_t) S->A0) * in;
<> 132:9baf128c2fab 4978
<> 132:9baf128c2fab 4979 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 132:9baf128c2fab 4980 acc += (q31_t) S->A1 * S->state[0];
<> 132:9baf128c2fab 4981 acc += (q31_t) S->A2 * S->state[1];
<> 132:9baf128c2fab 4982 #endif
<> 132:9baf128c2fab 4983
<> 132:9baf128c2fab 4984 /* acc += y[n-1] */
<> 132:9baf128c2fab 4985 acc += (q31_t) S->state[2] << 15;
<> 132:9baf128c2fab 4986
<> 132:9baf128c2fab 4987 /* saturate the output */
<> 132:9baf128c2fab 4988 out = (q15_t) (__SSAT((acc >> 15), 16));
<> 132:9baf128c2fab 4989
<> 132:9baf128c2fab 4990 /* Update state */
<> 132:9baf128c2fab 4991 S->state[1] = S->state[0];
<> 132:9baf128c2fab 4992 S->state[0] = in;
<> 132:9baf128c2fab 4993 S->state[2] = out;
<> 132:9baf128c2fab 4994
<> 132:9baf128c2fab 4995 /* return to application */
<> 132:9baf128c2fab 4996 return (out);
<> 132:9baf128c2fab 4997 }
<> 132:9baf128c2fab 4998
<> 132:9baf128c2fab 4999 /**
<> 132:9baf128c2fab 5000 * @} end of PID group
<> 132:9baf128c2fab 5001 */
<> 132:9baf128c2fab 5002
<> 132:9baf128c2fab 5003
<> 132:9baf128c2fab 5004 /**
<> 132:9baf128c2fab 5005 * @brief Floating-point matrix inverse.
AnnaBridge 145:64910690c574 5006 * @param[in] src points to the instance of the input floating-point matrix structure.
AnnaBridge 145:64910690c574 5007 * @param[out] dst points to the instance of the output floating-point matrix structure.
<> 132:9baf128c2fab 5008 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 132:9baf128c2fab 5009 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 132:9baf128c2fab 5010 */
<> 132:9baf128c2fab 5011 arm_status arm_mat_inverse_f32(
<> 132:9baf128c2fab 5012 const arm_matrix_instance_f32 * src,
<> 132:9baf128c2fab 5013 arm_matrix_instance_f32 * dst);
<> 132:9baf128c2fab 5014
<> 132:9baf128c2fab 5015
<> 132:9baf128c2fab 5016 /**
<> 132:9baf128c2fab 5017 * @brief Floating-point matrix inverse.
AnnaBridge 145:64910690c574 5018 * @param[in] src points to the instance of the input floating-point matrix structure.
AnnaBridge 145:64910690c574 5019 * @param[out] dst points to the instance of the output floating-point matrix structure.
<> 132:9baf128c2fab 5020 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 132:9baf128c2fab 5021 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 132:9baf128c2fab 5022 */
<> 132:9baf128c2fab 5023 arm_status arm_mat_inverse_f64(
<> 132:9baf128c2fab 5024 const arm_matrix_instance_f64 * src,
<> 132:9baf128c2fab 5025 arm_matrix_instance_f64 * dst);
<> 132:9baf128c2fab 5026
<> 132:9baf128c2fab 5027
<> 132:9baf128c2fab 5028
<> 132:9baf128c2fab 5029 /**
<> 132:9baf128c2fab 5030 * @ingroup groupController
<> 132:9baf128c2fab 5031 */
<> 132:9baf128c2fab 5032
<> 132:9baf128c2fab 5033 /**
<> 132:9baf128c2fab 5034 * @defgroup clarke Vector Clarke Transform
<> 132:9baf128c2fab 5035 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
<> 132:9baf128c2fab 5036 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
<> 132:9baf128c2fab 5037 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
<> 132:9baf128c2fab 5038 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
<> 132:9baf128c2fab 5039 * \image html clarke.gif Stator current space vector and its components in (a,b).
<> 132:9baf128c2fab 5040 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
<> 132:9baf128c2fab 5041 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
<> 132:9baf128c2fab 5042 *
<> 132:9baf128c2fab 5043 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 132:9baf128c2fab 5044 * The library provides separate functions for Q31 and floating-point data types.
<> 132:9baf128c2fab 5045 * \par Algorithm
<> 132:9baf128c2fab 5046 * \image html clarkeFormula.gif
<> 132:9baf128c2fab 5047 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
<> 132:9baf128c2fab 5048 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
<> 132:9baf128c2fab 5049 * \par Fixed-Point Behavior
<> 132:9baf128c2fab 5050 * Care must be taken when using the Q31 version of the Clarke transform.
<> 132:9baf128c2fab 5051 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 132:9baf128c2fab 5052 * Refer to the function specific documentation below for usage guidelines.
<> 132:9baf128c2fab 5053 */
<> 132:9baf128c2fab 5054
<> 132:9baf128c2fab 5055 /**
<> 132:9baf128c2fab 5056 * @addtogroup clarke
<> 132:9baf128c2fab 5057 * @{
<> 132:9baf128c2fab 5058 */
<> 132:9baf128c2fab 5059
<> 132:9baf128c2fab 5060 /**
<> 132:9baf128c2fab 5061 *
<> 132:9baf128c2fab 5062 * @brief Floating-point Clarke transform
AnnaBridge 145:64910690c574 5063 * @param[in] Ia input three-phase coordinate <code>a</code>
AnnaBridge 145:64910690c574 5064 * @param[in] Ib input three-phase coordinate <code>b</code>
AnnaBridge 145:64910690c574 5065 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5066 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
AnnaBridge 145:64910690c574 5067 */
AnnaBridge 145:64910690c574 5068 CMSIS_INLINE __STATIC_INLINE void arm_clarke_f32(
<> 132:9baf128c2fab 5069 float32_t Ia,
<> 132:9baf128c2fab 5070 float32_t Ib,
<> 132:9baf128c2fab 5071 float32_t * pIalpha,
<> 132:9baf128c2fab 5072 float32_t * pIbeta)
<> 132:9baf128c2fab 5073 {
<> 132:9baf128c2fab 5074 /* Calculate pIalpha using the equation, pIalpha = Ia */
<> 132:9baf128c2fab 5075 *pIalpha = Ia;
<> 132:9baf128c2fab 5076
<> 132:9baf128c2fab 5077 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
AnnaBridge 145:64910690c574 5078 *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
<> 132:9baf128c2fab 5079 }
<> 132:9baf128c2fab 5080
AnnaBridge 145:64910690c574 5081
<> 132:9baf128c2fab 5082 /**
<> 132:9baf128c2fab 5083 * @brief Clarke transform for Q31 version
AnnaBridge 145:64910690c574 5084 * @param[in] Ia input three-phase coordinate <code>a</code>
AnnaBridge 145:64910690c574 5085 * @param[in] Ib input three-phase coordinate <code>b</code>
AnnaBridge 145:64910690c574 5086 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5087 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
<> 132:9baf128c2fab 5088 *
<> 132:9baf128c2fab 5089 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 5090 * \par
<> 132:9baf128c2fab 5091 * The function is implemented using an internal 32-bit accumulator.
<> 132:9baf128c2fab 5092 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 132:9baf128c2fab 5093 * There is saturation on the addition, hence there is no risk of overflow.
<> 132:9baf128c2fab 5094 */
AnnaBridge 145:64910690c574 5095 CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31(
<> 132:9baf128c2fab 5096 q31_t Ia,
<> 132:9baf128c2fab 5097 q31_t Ib,
<> 132:9baf128c2fab 5098 q31_t * pIalpha,
<> 132:9baf128c2fab 5099 q31_t * pIbeta)
<> 132:9baf128c2fab 5100 {
<> 132:9baf128c2fab 5101 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5102
<> 132:9baf128c2fab 5103 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
<> 132:9baf128c2fab 5104 *pIalpha = Ia;
<> 132:9baf128c2fab 5105
<> 132:9baf128c2fab 5106 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
<> 132:9baf128c2fab 5107 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
<> 132:9baf128c2fab 5108
<> 132:9baf128c2fab 5109 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
<> 132:9baf128c2fab 5110 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
<> 132:9baf128c2fab 5111
<> 132:9baf128c2fab 5112 /* pIbeta is calculated by adding the intermediate products */
<> 132:9baf128c2fab 5113 *pIbeta = __QADD(product1, product2);
<> 132:9baf128c2fab 5114 }
<> 132:9baf128c2fab 5115
<> 132:9baf128c2fab 5116 /**
<> 132:9baf128c2fab 5117 * @} end of clarke group
<> 132:9baf128c2fab 5118 */
<> 132:9baf128c2fab 5119
<> 132:9baf128c2fab 5120 /**
<> 132:9baf128c2fab 5121 * @brief Converts the elements of the Q7 vector to Q31 vector.
AnnaBridge 145:64910690c574 5122 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 5123 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 5124 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 5125 */
<> 132:9baf128c2fab 5126 void arm_q7_to_q31(
<> 132:9baf128c2fab 5127 q7_t * pSrc,
<> 132:9baf128c2fab 5128 q31_t * pDst,
<> 132:9baf128c2fab 5129 uint32_t blockSize);
<> 132:9baf128c2fab 5130
<> 132:9baf128c2fab 5131
<> 132:9baf128c2fab 5132
<> 132:9baf128c2fab 5133 /**
<> 132:9baf128c2fab 5134 * @ingroup groupController
<> 132:9baf128c2fab 5135 */
<> 132:9baf128c2fab 5136
<> 132:9baf128c2fab 5137 /**
<> 132:9baf128c2fab 5138 * @defgroup inv_clarke Vector Inverse Clarke Transform
<> 132:9baf128c2fab 5139 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
<> 132:9baf128c2fab 5140 *
<> 132:9baf128c2fab 5141 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 132:9baf128c2fab 5142 * The library provides separate functions for Q31 and floating-point data types.
<> 132:9baf128c2fab 5143 * \par Algorithm
<> 132:9baf128c2fab 5144 * \image html clarkeInvFormula.gif
<> 132:9baf128c2fab 5145 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
<> 132:9baf128c2fab 5146 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
<> 132:9baf128c2fab 5147 * \par Fixed-Point Behavior
<> 132:9baf128c2fab 5148 * Care must be taken when using the Q31 version of the Clarke transform.
<> 132:9baf128c2fab 5149 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 132:9baf128c2fab 5150 * Refer to the function specific documentation below for usage guidelines.
<> 132:9baf128c2fab 5151 */
<> 132:9baf128c2fab 5152
<> 132:9baf128c2fab 5153 /**
<> 132:9baf128c2fab 5154 * @addtogroup inv_clarke
<> 132:9baf128c2fab 5155 * @{
<> 132:9baf128c2fab 5156 */
<> 132:9baf128c2fab 5157
<> 132:9baf128c2fab 5158 /**
<> 132:9baf128c2fab 5159 * @brief Floating-point Inverse Clarke transform
AnnaBridge 145:64910690c574 5160 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5161 * @param[in] Ibeta input two-phase orthogonal vector axis beta
AnnaBridge 145:64910690c574 5162 * @param[out] pIa points to output three-phase coordinate <code>a</code>
AnnaBridge 145:64910690c574 5163 * @param[out] pIb points to output three-phase coordinate <code>b</code>
AnnaBridge 145:64910690c574 5164 */
AnnaBridge 145:64910690c574 5165 CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_f32(
<> 132:9baf128c2fab 5166 float32_t Ialpha,
<> 132:9baf128c2fab 5167 float32_t Ibeta,
<> 132:9baf128c2fab 5168 float32_t * pIa,
<> 132:9baf128c2fab 5169 float32_t * pIb)
<> 132:9baf128c2fab 5170 {
<> 132:9baf128c2fab 5171 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 132:9baf128c2fab 5172 *pIa = Ialpha;
<> 132:9baf128c2fab 5173
<> 132:9baf128c2fab 5174 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
AnnaBridge 145:64910690c574 5175 *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta;
<> 132:9baf128c2fab 5176 }
<> 132:9baf128c2fab 5177
AnnaBridge 145:64910690c574 5178
<> 132:9baf128c2fab 5179 /**
<> 132:9baf128c2fab 5180 * @brief Inverse Clarke transform for Q31 version
AnnaBridge 145:64910690c574 5181 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5182 * @param[in] Ibeta input two-phase orthogonal vector axis beta
AnnaBridge 145:64910690c574 5183 * @param[out] pIa points to output three-phase coordinate <code>a</code>
AnnaBridge 145:64910690c574 5184 * @param[out] pIb points to output three-phase coordinate <code>b</code>
<> 132:9baf128c2fab 5185 *
<> 132:9baf128c2fab 5186 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 5187 * \par
<> 132:9baf128c2fab 5188 * The function is implemented using an internal 32-bit accumulator.
<> 132:9baf128c2fab 5189 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 132:9baf128c2fab 5190 * There is saturation on the subtraction, hence there is no risk of overflow.
<> 132:9baf128c2fab 5191 */
AnnaBridge 145:64910690c574 5192 CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31(
<> 132:9baf128c2fab 5193 q31_t Ialpha,
<> 132:9baf128c2fab 5194 q31_t Ibeta,
<> 132:9baf128c2fab 5195 q31_t * pIa,
<> 132:9baf128c2fab 5196 q31_t * pIb)
<> 132:9baf128c2fab 5197 {
<> 132:9baf128c2fab 5198 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5199
<> 132:9baf128c2fab 5200 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 132:9baf128c2fab 5201 *pIa = Ialpha;
<> 132:9baf128c2fab 5202
<> 132:9baf128c2fab 5203 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
<> 132:9baf128c2fab 5204 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
<> 132:9baf128c2fab 5205
<> 132:9baf128c2fab 5206 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
<> 132:9baf128c2fab 5207 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
<> 132:9baf128c2fab 5208
<> 132:9baf128c2fab 5209 /* pIb is calculated by subtracting the products */
<> 132:9baf128c2fab 5210 *pIb = __QSUB(product2, product1);
<> 132:9baf128c2fab 5211 }
<> 132:9baf128c2fab 5212
<> 132:9baf128c2fab 5213 /**
<> 132:9baf128c2fab 5214 * @} end of inv_clarke group
<> 132:9baf128c2fab 5215 */
<> 132:9baf128c2fab 5216
<> 132:9baf128c2fab 5217 /**
<> 132:9baf128c2fab 5218 * @brief Converts the elements of the Q7 vector to Q15 vector.
AnnaBridge 145:64910690c574 5219 * @param[in] pSrc input pointer
AnnaBridge 145:64910690c574 5220 * @param[out] pDst output pointer
AnnaBridge 145:64910690c574 5221 * @param[in] blockSize number of samples to process
<> 132:9baf128c2fab 5222 */
<> 132:9baf128c2fab 5223 void arm_q7_to_q15(
<> 132:9baf128c2fab 5224 q7_t * pSrc,
<> 132:9baf128c2fab 5225 q15_t * pDst,
<> 132:9baf128c2fab 5226 uint32_t blockSize);
<> 132:9baf128c2fab 5227
<> 132:9baf128c2fab 5228
<> 132:9baf128c2fab 5229
<> 132:9baf128c2fab 5230 /**
<> 132:9baf128c2fab 5231 * @ingroup groupController
<> 132:9baf128c2fab 5232 */
<> 132:9baf128c2fab 5233
<> 132:9baf128c2fab 5234 /**
<> 132:9baf128c2fab 5235 * @defgroup park Vector Park Transform
<> 132:9baf128c2fab 5236 *
<> 132:9baf128c2fab 5237 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
<> 132:9baf128c2fab 5238 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
<> 132:9baf128c2fab 5239 * from the stationary to the moving reference frame and control the spatial relationship between
<> 132:9baf128c2fab 5240 * the stator vector current and rotor flux vector.
<> 132:9baf128c2fab 5241 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
<> 132:9baf128c2fab 5242 * current vector and the relationship from the two reference frames:
<> 132:9baf128c2fab 5243 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
<> 132:9baf128c2fab 5244 *
<> 132:9baf128c2fab 5245 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 132:9baf128c2fab 5246 * The library provides separate functions for Q31 and floating-point data types.
<> 132:9baf128c2fab 5247 * \par Algorithm
<> 132:9baf128c2fab 5248 * \image html parkFormula.gif
<> 132:9baf128c2fab 5249 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
<> 132:9baf128c2fab 5250 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 132:9baf128c2fab 5251 * cosine and sine values of theta (rotor flux position).
<> 132:9baf128c2fab 5252 * \par Fixed-Point Behavior
<> 132:9baf128c2fab 5253 * Care must be taken when using the Q31 version of the Park transform.
<> 132:9baf128c2fab 5254 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 132:9baf128c2fab 5255 * Refer to the function specific documentation below for usage guidelines.
<> 132:9baf128c2fab 5256 */
<> 132:9baf128c2fab 5257
<> 132:9baf128c2fab 5258 /**
<> 132:9baf128c2fab 5259 * @addtogroup park
<> 132:9baf128c2fab 5260 * @{
<> 132:9baf128c2fab 5261 */
<> 132:9baf128c2fab 5262
<> 132:9baf128c2fab 5263 /**
<> 132:9baf128c2fab 5264 * @brief Floating-point Park transform
AnnaBridge 145:64910690c574 5265 * @param[in] Ialpha input two-phase vector coordinate alpha
AnnaBridge 145:64910690c574 5266 * @param[in] Ibeta input two-phase vector coordinate beta
AnnaBridge 145:64910690c574 5267 * @param[out] pId points to output rotor reference frame d
AnnaBridge 145:64910690c574 5268 * @param[out] pIq points to output rotor reference frame q
AnnaBridge 145:64910690c574 5269 * @param[in] sinVal sine value of rotation angle theta
AnnaBridge 145:64910690c574 5270 * @param[in] cosVal cosine value of rotation angle theta
<> 132:9baf128c2fab 5271 *
<> 132:9baf128c2fab 5272 * The function implements the forward Park transform.
<> 132:9baf128c2fab 5273 *
<> 132:9baf128c2fab 5274 */
AnnaBridge 145:64910690c574 5275 CMSIS_INLINE __STATIC_INLINE void arm_park_f32(
<> 132:9baf128c2fab 5276 float32_t Ialpha,
<> 132:9baf128c2fab 5277 float32_t Ibeta,
<> 132:9baf128c2fab 5278 float32_t * pId,
<> 132:9baf128c2fab 5279 float32_t * pIq,
<> 132:9baf128c2fab 5280 float32_t sinVal,
<> 132:9baf128c2fab 5281 float32_t cosVal)
<> 132:9baf128c2fab 5282 {
<> 132:9baf128c2fab 5283 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
<> 132:9baf128c2fab 5284 *pId = Ialpha * cosVal + Ibeta * sinVal;
<> 132:9baf128c2fab 5285
<> 132:9baf128c2fab 5286 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
<> 132:9baf128c2fab 5287 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
<> 132:9baf128c2fab 5288 }
<> 132:9baf128c2fab 5289
AnnaBridge 145:64910690c574 5290
<> 132:9baf128c2fab 5291 /**
<> 132:9baf128c2fab 5292 * @brief Park transform for Q31 version
AnnaBridge 145:64910690c574 5293 * @param[in] Ialpha input two-phase vector coordinate alpha
AnnaBridge 145:64910690c574 5294 * @param[in] Ibeta input two-phase vector coordinate beta
AnnaBridge 145:64910690c574 5295 * @param[out] pId points to output rotor reference frame d
AnnaBridge 145:64910690c574 5296 * @param[out] pIq points to output rotor reference frame q
AnnaBridge 145:64910690c574 5297 * @param[in] sinVal sine value of rotation angle theta
AnnaBridge 145:64910690c574 5298 * @param[in] cosVal cosine value of rotation angle theta
<> 132:9baf128c2fab 5299 *
<> 132:9baf128c2fab 5300 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 5301 * \par
<> 132:9baf128c2fab 5302 * The function is implemented using an internal 32-bit accumulator.
<> 132:9baf128c2fab 5303 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 132:9baf128c2fab 5304 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
<> 132:9baf128c2fab 5305 */
AnnaBridge 145:64910690c574 5306 CMSIS_INLINE __STATIC_INLINE void arm_park_q31(
<> 132:9baf128c2fab 5307 q31_t Ialpha,
<> 132:9baf128c2fab 5308 q31_t Ibeta,
<> 132:9baf128c2fab 5309 q31_t * pId,
<> 132:9baf128c2fab 5310 q31_t * pIq,
<> 132:9baf128c2fab 5311 q31_t sinVal,
<> 132:9baf128c2fab 5312 q31_t cosVal)
<> 132:9baf128c2fab 5313 {
<> 132:9baf128c2fab 5314 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5315 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5316
<> 132:9baf128c2fab 5317 /* Intermediate product is calculated by (Ialpha * cosVal) */
<> 132:9baf128c2fab 5318 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
<> 132:9baf128c2fab 5319
<> 132:9baf128c2fab 5320 /* Intermediate product is calculated by (Ibeta * sinVal) */
<> 132:9baf128c2fab 5321 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
<> 132:9baf128c2fab 5322
<> 132:9baf128c2fab 5323
<> 132:9baf128c2fab 5324 /* Intermediate product is calculated by (Ialpha * sinVal) */
<> 132:9baf128c2fab 5325 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
<> 132:9baf128c2fab 5326
<> 132:9baf128c2fab 5327 /* Intermediate product is calculated by (Ibeta * cosVal) */
<> 132:9baf128c2fab 5328 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
<> 132:9baf128c2fab 5329
<> 132:9baf128c2fab 5330 /* Calculate pId by adding the two intermediate products 1 and 2 */
<> 132:9baf128c2fab 5331 *pId = __QADD(product1, product2);
<> 132:9baf128c2fab 5332
<> 132:9baf128c2fab 5333 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
<> 132:9baf128c2fab 5334 *pIq = __QSUB(product4, product3);
<> 132:9baf128c2fab 5335 }
<> 132:9baf128c2fab 5336
<> 132:9baf128c2fab 5337 /**
<> 132:9baf128c2fab 5338 * @} end of park group
<> 132:9baf128c2fab 5339 */
<> 132:9baf128c2fab 5340
<> 132:9baf128c2fab 5341 /**
<> 132:9baf128c2fab 5342 * @brief Converts the elements of the Q7 vector to floating-point vector.
AnnaBridge 145:64910690c574 5343 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 5344 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 5345 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 5346 */
<> 132:9baf128c2fab 5347 void arm_q7_to_float(
<> 132:9baf128c2fab 5348 q7_t * pSrc,
<> 132:9baf128c2fab 5349 float32_t * pDst,
<> 132:9baf128c2fab 5350 uint32_t blockSize);
<> 132:9baf128c2fab 5351
<> 132:9baf128c2fab 5352
<> 132:9baf128c2fab 5353 /**
<> 132:9baf128c2fab 5354 * @ingroup groupController
<> 132:9baf128c2fab 5355 */
<> 132:9baf128c2fab 5356
<> 132:9baf128c2fab 5357 /**
<> 132:9baf128c2fab 5358 * @defgroup inv_park Vector Inverse Park transform
<> 132:9baf128c2fab 5359 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
<> 132:9baf128c2fab 5360 *
<> 132:9baf128c2fab 5361 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 132:9baf128c2fab 5362 * The library provides separate functions for Q31 and floating-point data types.
<> 132:9baf128c2fab 5363 * \par Algorithm
<> 132:9baf128c2fab 5364 * \image html parkInvFormula.gif
<> 132:9baf128c2fab 5365 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
<> 132:9baf128c2fab 5366 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 132:9baf128c2fab 5367 * cosine and sine values of theta (rotor flux position).
<> 132:9baf128c2fab 5368 * \par Fixed-Point Behavior
<> 132:9baf128c2fab 5369 * Care must be taken when using the Q31 version of the Park transform.
<> 132:9baf128c2fab 5370 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 132:9baf128c2fab 5371 * Refer to the function specific documentation below for usage guidelines.
<> 132:9baf128c2fab 5372 */
<> 132:9baf128c2fab 5373
<> 132:9baf128c2fab 5374 /**
<> 132:9baf128c2fab 5375 * @addtogroup inv_park
<> 132:9baf128c2fab 5376 * @{
<> 132:9baf128c2fab 5377 */
<> 132:9baf128c2fab 5378
<> 132:9baf128c2fab 5379 /**
<> 132:9baf128c2fab 5380 * @brief Floating-point Inverse Park transform
AnnaBridge 145:64910690c574 5381 * @param[in] Id input coordinate of rotor reference frame d
AnnaBridge 145:64910690c574 5382 * @param[in] Iq input coordinate of rotor reference frame q
AnnaBridge 145:64910690c574 5383 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5384 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
AnnaBridge 145:64910690c574 5385 * @param[in] sinVal sine value of rotation angle theta
AnnaBridge 145:64910690c574 5386 * @param[in] cosVal cosine value of rotation angle theta
AnnaBridge 145:64910690c574 5387 */
AnnaBridge 145:64910690c574 5388 CMSIS_INLINE __STATIC_INLINE void arm_inv_park_f32(
<> 132:9baf128c2fab 5389 float32_t Id,
<> 132:9baf128c2fab 5390 float32_t Iq,
<> 132:9baf128c2fab 5391 float32_t * pIalpha,
<> 132:9baf128c2fab 5392 float32_t * pIbeta,
<> 132:9baf128c2fab 5393 float32_t sinVal,
<> 132:9baf128c2fab 5394 float32_t cosVal)
<> 132:9baf128c2fab 5395 {
<> 132:9baf128c2fab 5396 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
<> 132:9baf128c2fab 5397 *pIalpha = Id * cosVal - Iq * sinVal;
<> 132:9baf128c2fab 5398
<> 132:9baf128c2fab 5399 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
<> 132:9baf128c2fab 5400 *pIbeta = Id * sinVal + Iq * cosVal;
<> 132:9baf128c2fab 5401 }
<> 132:9baf128c2fab 5402
<> 132:9baf128c2fab 5403
<> 132:9baf128c2fab 5404 /**
AnnaBridge 145:64910690c574 5405 * @brief Inverse Park transform for Q31 version
AnnaBridge 145:64910690c574 5406 * @param[in] Id input coordinate of rotor reference frame d
AnnaBridge 145:64910690c574 5407 * @param[in] Iq input coordinate of rotor reference frame q
AnnaBridge 145:64910690c574 5408 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha
AnnaBridge 145:64910690c574 5409 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta
AnnaBridge 145:64910690c574 5410 * @param[in] sinVal sine value of rotation angle theta
AnnaBridge 145:64910690c574 5411 * @param[in] cosVal cosine value of rotation angle theta
<> 132:9baf128c2fab 5412 *
<> 132:9baf128c2fab 5413 * <b>Scaling and Overflow Behavior:</b>
<> 132:9baf128c2fab 5414 * \par
<> 132:9baf128c2fab 5415 * The function is implemented using an internal 32-bit accumulator.
<> 132:9baf128c2fab 5416 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 132:9baf128c2fab 5417 * There is saturation on the addition, hence there is no risk of overflow.
<> 132:9baf128c2fab 5418 */
AnnaBridge 145:64910690c574 5419 CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31(
<> 132:9baf128c2fab 5420 q31_t Id,
<> 132:9baf128c2fab 5421 q31_t Iq,
<> 132:9baf128c2fab 5422 q31_t * pIalpha,
<> 132:9baf128c2fab 5423 q31_t * pIbeta,
<> 132:9baf128c2fab 5424 q31_t sinVal,
<> 132:9baf128c2fab 5425 q31_t cosVal)
<> 132:9baf128c2fab 5426 {
<> 132:9baf128c2fab 5427 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5428 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 132:9baf128c2fab 5429
<> 132:9baf128c2fab 5430 /* Intermediate product is calculated by (Id * cosVal) */
<> 132:9baf128c2fab 5431 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
<> 132:9baf128c2fab 5432
<> 132:9baf128c2fab 5433 /* Intermediate product is calculated by (Iq * sinVal) */
<> 132:9baf128c2fab 5434 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
<> 132:9baf128c2fab 5435
<> 132:9baf128c2fab 5436
<> 132:9baf128c2fab 5437 /* Intermediate product is calculated by (Id * sinVal) */
<> 132:9baf128c2fab 5438 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
<> 132:9baf128c2fab 5439
<> 132:9baf128c2fab 5440 /* Intermediate product is calculated by (Iq * cosVal) */
<> 132:9baf128c2fab 5441 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
<> 132:9baf128c2fab 5442
<> 132:9baf128c2fab 5443 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
<> 132:9baf128c2fab 5444 *pIalpha = __QSUB(product1, product2);
<> 132:9baf128c2fab 5445
<> 132:9baf128c2fab 5446 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
<> 132:9baf128c2fab 5447 *pIbeta = __QADD(product4, product3);
<> 132:9baf128c2fab 5448 }
<> 132:9baf128c2fab 5449
<> 132:9baf128c2fab 5450 /**
<> 132:9baf128c2fab 5451 * @} end of Inverse park group
<> 132:9baf128c2fab 5452 */
<> 132:9baf128c2fab 5453
<> 132:9baf128c2fab 5454
<> 132:9baf128c2fab 5455 /**
<> 132:9baf128c2fab 5456 * @brief Converts the elements of the Q31 vector to floating-point vector.
AnnaBridge 145:64910690c574 5457 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 5458 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 5459 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 5460 */
<> 132:9baf128c2fab 5461 void arm_q31_to_float(
<> 132:9baf128c2fab 5462 q31_t * pSrc,
<> 132:9baf128c2fab 5463 float32_t * pDst,
<> 132:9baf128c2fab 5464 uint32_t blockSize);
<> 132:9baf128c2fab 5465
<> 132:9baf128c2fab 5466 /**
<> 132:9baf128c2fab 5467 * @ingroup groupInterpolation
<> 132:9baf128c2fab 5468 */
<> 132:9baf128c2fab 5469
<> 132:9baf128c2fab 5470 /**
<> 132:9baf128c2fab 5471 * @defgroup LinearInterpolate Linear Interpolation
<> 132:9baf128c2fab 5472 *
<> 132:9baf128c2fab 5473 * Linear interpolation is a method of curve fitting using linear polynomials.
<> 132:9baf128c2fab 5474 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
<> 132:9baf128c2fab 5475 *
<> 132:9baf128c2fab 5476 * \par
<> 132:9baf128c2fab 5477 * \image html LinearInterp.gif "Linear interpolation"
<> 132:9baf128c2fab 5478 *
<> 132:9baf128c2fab 5479 * \par
<> 132:9baf128c2fab 5480 * A Linear Interpolate function calculates an output value(y), for the input(x)
<> 132:9baf128c2fab 5481 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
<> 132:9baf128c2fab 5482 *
<> 132:9baf128c2fab 5483 * \par Algorithm:
<> 132:9baf128c2fab 5484 * <pre>
<> 132:9baf128c2fab 5485 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
<> 132:9baf128c2fab 5486 * where x0, x1 are nearest values of input x
<> 132:9baf128c2fab 5487 * y0, y1 are nearest values to output y
<> 132:9baf128c2fab 5488 * </pre>
<> 132:9baf128c2fab 5489 *
<> 132:9baf128c2fab 5490 * \par
<> 132:9baf128c2fab 5491 * This set of functions implements Linear interpolation process
<> 132:9baf128c2fab 5492 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
<> 132:9baf128c2fab 5493 * sample of data and each call to the function returns a single processed value.
<> 132:9baf128c2fab 5494 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
<> 132:9baf128c2fab 5495 * <code>x</code> is the input sample value. The functions returns the output value.
<> 132:9baf128c2fab 5496 *
<> 132:9baf128c2fab 5497 * \par
<> 132:9baf128c2fab 5498 * if x is outside of the table boundary, Linear interpolation returns first value of the table
<> 132:9baf128c2fab 5499 * if x is below input range and returns last value of table if x is above range.
<> 132:9baf128c2fab 5500 */
<> 132:9baf128c2fab 5501
<> 132:9baf128c2fab 5502 /**
<> 132:9baf128c2fab 5503 * @addtogroup LinearInterpolate
<> 132:9baf128c2fab 5504 * @{
<> 132:9baf128c2fab 5505 */
<> 132:9baf128c2fab 5506
<> 132:9baf128c2fab 5507 /**
<> 132:9baf128c2fab 5508 * @brief Process function for the floating-point Linear Interpolation Function.
AnnaBridge 145:64910690c574 5509 * @param[in,out] S is an instance of the floating-point Linear Interpolation structure
AnnaBridge 145:64910690c574 5510 * @param[in] x input sample to process
<> 132:9baf128c2fab 5511 * @return y processed output sample.
<> 132:9baf128c2fab 5512 *
<> 132:9baf128c2fab 5513 */
AnnaBridge 145:64910690c574 5514 CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32(
<> 132:9baf128c2fab 5515 arm_linear_interp_instance_f32 * S,
<> 132:9baf128c2fab 5516 float32_t x)
<> 132:9baf128c2fab 5517 {
<> 132:9baf128c2fab 5518 float32_t y;
<> 132:9baf128c2fab 5519 float32_t x0, x1; /* Nearest input values */
<> 132:9baf128c2fab 5520 float32_t y0, y1; /* Nearest output values */
<> 132:9baf128c2fab 5521 float32_t xSpacing = S->xSpacing; /* spacing between input values */
<> 132:9baf128c2fab 5522 int32_t i; /* Index variable */
<> 132:9baf128c2fab 5523 float32_t *pYData = S->pYData; /* pointer to output table */
<> 132:9baf128c2fab 5524
<> 132:9baf128c2fab 5525 /* Calculation of index */
<> 132:9baf128c2fab 5526 i = (int32_t) ((x - S->x1) / xSpacing);
<> 132:9baf128c2fab 5527
AnnaBridge 145:64910690c574 5528 if (i < 0)
<> 132:9baf128c2fab 5529 {
<> 132:9baf128c2fab 5530 /* Iniatilize output for below specified range as least output value of table */
<> 132:9baf128c2fab 5531 y = pYData[0];
<> 132:9baf128c2fab 5532 }
AnnaBridge 145:64910690c574 5533 else if ((uint32_t)i >= S->nValues)
<> 132:9baf128c2fab 5534 {
<> 132:9baf128c2fab 5535 /* Iniatilize output for above specified range as last output value of table */
<> 132:9baf128c2fab 5536 y = pYData[S->nValues - 1];
<> 132:9baf128c2fab 5537 }
<> 132:9baf128c2fab 5538 else
<> 132:9baf128c2fab 5539 {
<> 132:9baf128c2fab 5540 /* Calculation of nearest input values */
AnnaBridge 145:64910690c574 5541 x0 = S->x1 + i * xSpacing;
<> 132:9baf128c2fab 5542 x1 = S->x1 + (i + 1) * xSpacing;
<> 132:9baf128c2fab 5543
<> 132:9baf128c2fab 5544 /* Read of nearest output values */
<> 132:9baf128c2fab 5545 y0 = pYData[i];
<> 132:9baf128c2fab 5546 y1 = pYData[i + 1];
<> 132:9baf128c2fab 5547
<> 132:9baf128c2fab 5548 /* Calculation of output */
<> 132:9baf128c2fab 5549 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
<> 132:9baf128c2fab 5550
<> 132:9baf128c2fab 5551 }
<> 132:9baf128c2fab 5552
<> 132:9baf128c2fab 5553 /* returns output value */
<> 132:9baf128c2fab 5554 return (y);
<> 132:9baf128c2fab 5555 }
<> 132:9baf128c2fab 5556
AnnaBridge 145:64910690c574 5557
<> 132:9baf128c2fab 5558 /**
<> 132:9baf128c2fab 5559 *
<> 132:9baf128c2fab 5560 * @brief Process function for the Q31 Linear Interpolation Function.
AnnaBridge 145:64910690c574 5561 * @param[in] pYData pointer to Q31 Linear Interpolation table
AnnaBridge 145:64910690c574 5562 * @param[in] x input sample to process
AnnaBridge 145:64910690c574 5563 * @param[in] nValues number of table values
<> 132:9baf128c2fab 5564 * @return y processed output sample.
<> 132:9baf128c2fab 5565 *
<> 132:9baf128c2fab 5566 * \par
<> 132:9baf128c2fab 5567 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 132:9baf128c2fab 5568 * This function can support maximum of table size 2^12.
<> 132:9baf128c2fab 5569 *
<> 132:9baf128c2fab 5570 */
AnnaBridge 145:64910690c574 5571 CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31(
<> 132:9baf128c2fab 5572 q31_t * pYData,
<> 132:9baf128c2fab 5573 q31_t x,
<> 132:9baf128c2fab 5574 uint32_t nValues)
<> 132:9baf128c2fab 5575 {
<> 132:9baf128c2fab 5576 q31_t y; /* output */
<> 132:9baf128c2fab 5577 q31_t y0, y1; /* Nearest output values */
<> 132:9baf128c2fab 5578 q31_t fract; /* fractional part */
<> 132:9baf128c2fab 5579 int32_t index; /* Index to read nearest output values */
<> 132:9baf128c2fab 5580
<> 132:9baf128c2fab 5581 /* Input is in 12.20 format */
<> 132:9baf128c2fab 5582 /* 12 bits for the table index */
<> 132:9baf128c2fab 5583 /* Index value calculation */
AnnaBridge 145:64910690c574 5584 index = ((x & (q31_t)0xFFF00000) >> 20);
AnnaBridge 145:64910690c574 5585
AnnaBridge 145:64910690c574 5586 if (index >= (int32_t)(nValues - 1))
<> 132:9baf128c2fab 5587 {
<> 132:9baf128c2fab 5588 return (pYData[nValues - 1]);
<> 132:9baf128c2fab 5589 }
AnnaBridge 145:64910690c574 5590 else if (index < 0)
<> 132:9baf128c2fab 5591 {
<> 132:9baf128c2fab 5592 return (pYData[0]);
<> 132:9baf128c2fab 5593 }
<> 132:9baf128c2fab 5594 else
<> 132:9baf128c2fab 5595 {
<> 132:9baf128c2fab 5596 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 5597 /* shift left by 11 to keep fract in 1.31 format */
<> 132:9baf128c2fab 5598 fract = (x & 0x000FFFFF) << 11;
<> 132:9baf128c2fab 5599
<> 132:9baf128c2fab 5600 /* Read two nearest output values from the index in 1.31(q31) format */
<> 132:9baf128c2fab 5601 y0 = pYData[index];
AnnaBridge 145:64910690c574 5602 y1 = pYData[index + 1];
<> 132:9baf128c2fab 5603
<> 132:9baf128c2fab 5604 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
<> 132:9baf128c2fab 5605 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
<> 132:9baf128c2fab 5606
<> 132:9baf128c2fab 5607 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
<> 132:9baf128c2fab 5608 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
<> 132:9baf128c2fab 5609
<> 132:9baf128c2fab 5610 /* Convert y to 1.31 format */
<> 132:9baf128c2fab 5611 return (y << 1u);
<> 132:9baf128c2fab 5612 }
<> 132:9baf128c2fab 5613 }
<> 132:9baf128c2fab 5614
AnnaBridge 145:64910690c574 5615
<> 132:9baf128c2fab 5616 /**
<> 132:9baf128c2fab 5617 *
<> 132:9baf128c2fab 5618 * @brief Process function for the Q15 Linear Interpolation Function.
AnnaBridge 145:64910690c574 5619 * @param[in] pYData pointer to Q15 Linear Interpolation table
AnnaBridge 145:64910690c574 5620 * @param[in] x input sample to process
AnnaBridge 145:64910690c574 5621 * @param[in] nValues number of table values
<> 132:9baf128c2fab 5622 * @return y processed output sample.
<> 132:9baf128c2fab 5623 *
<> 132:9baf128c2fab 5624 * \par
<> 132:9baf128c2fab 5625 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 132:9baf128c2fab 5626 * This function can support maximum of table size 2^12.
<> 132:9baf128c2fab 5627 *
<> 132:9baf128c2fab 5628 */
AnnaBridge 145:64910690c574 5629 CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15(
<> 132:9baf128c2fab 5630 q15_t * pYData,
<> 132:9baf128c2fab 5631 q31_t x,
<> 132:9baf128c2fab 5632 uint32_t nValues)
<> 132:9baf128c2fab 5633 {
<> 132:9baf128c2fab 5634 q63_t y; /* output */
<> 132:9baf128c2fab 5635 q15_t y0, y1; /* Nearest output values */
<> 132:9baf128c2fab 5636 q31_t fract; /* fractional part */
<> 132:9baf128c2fab 5637 int32_t index; /* Index to read nearest output values */
<> 132:9baf128c2fab 5638
<> 132:9baf128c2fab 5639 /* Input is in 12.20 format */
<> 132:9baf128c2fab 5640 /* 12 bits for the table index */
<> 132:9baf128c2fab 5641 /* Index value calculation */
AnnaBridge 145:64910690c574 5642 index = ((x & (int32_t)0xFFF00000) >> 20);
AnnaBridge 145:64910690c574 5643
AnnaBridge 145:64910690c574 5644 if (index >= (int32_t)(nValues - 1))
<> 132:9baf128c2fab 5645 {
<> 132:9baf128c2fab 5646 return (pYData[nValues - 1]);
<> 132:9baf128c2fab 5647 }
AnnaBridge 145:64910690c574 5648 else if (index < 0)
<> 132:9baf128c2fab 5649 {
<> 132:9baf128c2fab 5650 return (pYData[0]);
<> 132:9baf128c2fab 5651 }
<> 132:9baf128c2fab 5652 else
<> 132:9baf128c2fab 5653 {
<> 132:9baf128c2fab 5654 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 5655 /* fract is in 12.20 format */
<> 132:9baf128c2fab 5656 fract = (x & 0x000FFFFF);
<> 132:9baf128c2fab 5657
<> 132:9baf128c2fab 5658 /* Read two nearest output values from the index */
<> 132:9baf128c2fab 5659 y0 = pYData[index];
AnnaBridge 145:64910690c574 5660 y1 = pYData[index + 1];
<> 132:9baf128c2fab 5661
<> 132:9baf128c2fab 5662 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
<> 132:9baf128c2fab 5663 y = ((q63_t) y0 * (0xFFFFF - fract));
<> 132:9baf128c2fab 5664
<> 132:9baf128c2fab 5665 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
<> 132:9baf128c2fab 5666 y += ((q63_t) y1 * (fract));
<> 132:9baf128c2fab 5667
<> 132:9baf128c2fab 5668 /* convert y to 1.15 format */
AnnaBridge 145:64910690c574 5669 return (q15_t) (y >> 20);
<> 132:9baf128c2fab 5670 }
<> 132:9baf128c2fab 5671 }
<> 132:9baf128c2fab 5672
AnnaBridge 145:64910690c574 5673
<> 132:9baf128c2fab 5674 /**
<> 132:9baf128c2fab 5675 *
<> 132:9baf128c2fab 5676 * @brief Process function for the Q7 Linear Interpolation Function.
AnnaBridge 145:64910690c574 5677 * @param[in] pYData pointer to Q7 Linear Interpolation table
AnnaBridge 145:64910690c574 5678 * @param[in] x input sample to process
AnnaBridge 145:64910690c574 5679 * @param[in] nValues number of table values
<> 132:9baf128c2fab 5680 * @return y processed output sample.
<> 132:9baf128c2fab 5681 *
<> 132:9baf128c2fab 5682 * \par
<> 132:9baf128c2fab 5683 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 132:9baf128c2fab 5684 * This function can support maximum of table size 2^12.
<> 132:9baf128c2fab 5685 */
AnnaBridge 145:64910690c574 5686 CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7(
<> 132:9baf128c2fab 5687 q7_t * pYData,
<> 132:9baf128c2fab 5688 q31_t x,
<> 132:9baf128c2fab 5689 uint32_t nValues)
<> 132:9baf128c2fab 5690 {
<> 132:9baf128c2fab 5691 q31_t y; /* output */
<> 132:9baf128c2fab 5692 q7_t y0, y1; /* Nearest output values */
<> 132:9baf128c2fab 5693 q31_t fract; /* fractional part */
<> 132:9baf128c2fab 5694 uint32_t index; /* Index to read nearest output values */
<> 132:9baf128c2fab 5695
<> 132:9baf128c2fab 5696 /* Input is in 12.20 format */
<> 132:9baf128c2fab 5697 /* 12 bits for the table index */
<> 132:9baf128c2fab 5698 /* Index value calculation */
<> 132:9baf128c2fab 5699 if (x < 0)
<> 132:9baf128c2fab 5700 {
<> 132:9baf128c2fab 5701 return (pYData[0]);
<> 132:9baf128c2fab 5702 }
<> 132:9baf128c2fab 5703 index = (x >> 20) & 0xfff;
<> 132:9baf128c2fab 5704
AnnaBridge 145:64910690c574 5705 if (index >= (nValues - 1))
<> 132:9baf128c2fab 5706 {
<> 132:9baf128c2fab 5707 return (pYData[nValues - 1]);
<> 132:9baf128c2fab 5708 }
<> 132:9baf128c2fab 5709 else
<> 132:9baf128c2fab 5710 {
<> 132:9baf128c2fab 5711 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 5712 /* fract is in 12.20 format */
<> 132:9baf128c2fab 5713 fract = (x & 0x000FFFFF);
<> 132:9baf128c2fab 5714
<> 132:9baf128c2fab 5715 /* Read two nearest output values from the index and are in 1.7(q7) format */
<> 132:9baf128c2fab 5716 y0 = pYData[index];
AnnaBridge 145:64910690c574 5717 y1 = pYData[index + 1];
<> 132:9baf128c2fab 5718
<> 132:9baf128c2fab 5719 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
<> 132:9baf128c2fab 5720 y = ((y0 * (0xFFFFF - fract)));
<> 132:9baf128c2fab 5721
<> 132:9baf128c2fab 5722 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
<> 132:9baf128c2fab 5723 y += (y1 * fract);
<> 132:9baf128c2fab 5724
<> 132:9baf128c2fab 5725 /* convert y to 1.7(q7) format */
AnnaBridge 145:64910690c574 5726 return (q7_t) (y >> 20);
AnnaBridge 145:64910690c574 5727 }
<> 132:9baf128c2fab 5728 }
AnnaBridge 145:64910690c574 5729
<> 132:9baf128c2fab 5730 /**
<> 132:9baf128c2fab 5731 * @} end of LinearInterpolate group
<> 132:9baf128c2fab 5732 */
<> 132:9baf128c2fab 5733
<> 132:9baf128c2fab 5734 /**
<> 132:9baf128c2fab 5735 * @brief Fast approximation to the trigonometric sine function for floating-point data.
AnnaBridge 145:64910690c574 5736 * @param[in] x input value in radians.
<> 132:9baf128c2fab 5737 * @return sin(x).
<> 132:9baf128c2fab 5738 */
<> 132:9baf128c2fab 5739 float32_t arm_sin_f32(
<> 132:9baf128c2fab 5740 float32_t x);
<> 132:9baf128c2fab 5741
AnnaBridge 145:64910690c574 5742
<> 132:9baf128c2fab 5743 /**
<> 132:9baf128c2fab 5744 * @brief Fast approximation to the trigonometric sine function for Q31 data.
AnnaBridge 145:64910690c574 5745 * @param[in] x Scaled input value in radians.
<> 132:9baf128c2fab 5746 * @return sin(x).
<> 132:9baf128c2fab 5747 */
<> 132:9baf128c2fab 5748 q31_t arm_sin_q31(
<> 132:9baf128c2fab 5749 q31_t x);
<> 132:9baf128c2fab 5750
AnnaBridge 145:64910690c574 5751
<> 132:9baf128c2fab 5752 /**
<> 132:9baf128c2fab 5753 * @brief Fast approximation to the trigonometric sine function for Q15 data.
AnnaBridge 145:64910690c574 5754 * @param[in] x Scaled input value in radians.
<> 132:9baf128c2fab 5755 * @return sin(x).
<> 132:9baf128c2fab 5756 */
<> 132:9baf128c2fab 5757 q15_t arm_sin_q15(
<> 132:9baf128c2fab 5758 q15_t x);
<> 132:9baf128c2fab 5759
AnnaBridge 145:64910690c574 5760
<> 132:9baf128c2fab 5761 /**
<> 132:9baf128c2fab 5762 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
AnnaBridge 145:64910690c574 5763 * @param[in] x input value in radians.
<> 132:9baf128c2fab 5764 * @return cos(x).
<> 132:9baf128c2fab 5765 */
<> 132:9baf128c2fab 5766 float32_t arm_cos_f32(
<> 132:9baf128c2fab 5767 float32_t x);
<> 132:9baf128c2fab 5768
AnnaBridge 145:64910690c574 5769
<> 132:9baf128c2fab 5770 /**
<> 132:9baf128c2fab 5771 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
AnnaBridge 145:64910690c574 5772 * @param[in] x Scaled input value in radians.
<> 132:9baf128c2fab 5773 * @return cos(x).
<> 132:9baf128c2fab 5774 */
<> 132:9baf128c2fab 5775 q31_t arm_cos_q31(
<> 132:9baf128c2fab 5776 q31_t x);
<> 132:9baf128c2fab 5777
AnnaBridge 145:64910690c574 5778
<> 132:9baf128c2fab 5779 /**
<> 132:9baf128c2fab 5780 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
AnnaBridge 145:64910690c574 5781 * @param[in] x Scaled input value in radians.
<> 132:9baf128c2fab 5782 * @return cos(x).
<> 132:9baf128c2fab 5783 */
<> 132:9baf128c2fab 5784 q15_t arm_cos_q15(
<> 132:9baf128c2fab 5785 q15_t x);
<> 132:9baf128c2fab 5786
<> 132:9baf128c2fab 5787
<> 132:9baf128c2fab 5788 /**
<> 132:9baf128c2fab 5789 * @ingroup groupFastMath
<> 132:9baf128c2fab 5790 */
<> 132:9baf128c2fab 5791
<> 132:9baf128c2fab 5792
<> 132:9baf128c2fab 5793 /**
<> 132:9baf128c2fab 5794 * @defgroup SQRT Square Root
<> 132:9baf128c2fab 5795 *
<> 132:9baf128c2fab 5796 * Computes the square root of a number.
<> 132:9baf128c2fab 5797 * There are separate functions for Q15, Q31, and floating-point data types.
<> 132:9baf128c2fab 5798 * The square root function is computed using the Newton-Raphson algorithm.
<> 132:9baf128c2fab 5799 * This is an iterative algorithm of the form:
<> 132:9baf128c2fab 5800 * <pre>
<> 132:9baf128c2fab 5801 * x1 = x0 - f(x0)/f'(x0)
<> 132:9baf128c2fab 5802 * </pre>
<> 132:9baf128c2fab 5803 * where <code>x1</code> is the current estimate,
<> 132:9baf128c2fab 5804 * <code>x0</code> is the previous estimate, and
<> 132:9baf128c2fab 5805 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
<> 132:9baf128c2fab 5806 * For the square root function, the algorithm reduces to:
<> 132:9baf128c2fab 5807 * <pre>
<> 132:9baf128c2fab 5808 * x0 = in/2 [initial guess]
<> 132:9baf128c2fab 5809 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
<> 132:9baf128c2fab 5810 * </pre>
<> 132:9baf128c2fab 5811 */
<> 132:9baf128c2fab 5812
<> 132:9baf128c2fab 5813
<> 132:9baf128c2fab 5814 /**
<> 132:9baf128c2fab 5815 * @addtogroup SQRT
<> 132:9baf128c2fab 5816 * @{
<> 132:9baf128c2fab 5817 */
<> 132:9baf128c2fab 5818
<> 132:9baf128c2fab 5819 /**
<> 132:9baf128c2fab 5820 * @brief Floating-point square root function.
AnnaBridge 145:64910690c574 5821 * @param[in] in input value.
AnnaBridge 145:64910690c574 5822 * @param[out] pOut square root of input value.
<> 132:9baf128c2fab 5823 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 132:9baf128c2fab 5824 * <code>in</code> is negative value and returns zero output for negative values.
<> 132:9baf128c2fab 5825 */
AnnaBridge 145:64910690c574 5826 CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32(
<> 132:9baf128c2fab 5827 float32_t in,
<> 132:9baf128c2fab 5828 float32_t * pOut)
<> 132:9baf128c2fab 5829 {
AnnaBridge 145:64910690c574 5830 if (in >= 0.0f)
<> 132:9baf128c2fab 5831 {
<> 132:9baf128c2fab 5832
AnnaBridge 145:64910690c574 5833 #if (__FPU_USED == 1) && defined ( __CC_ARM )
<> 132:9baf128c2fab 5834 *pOut = __sqrtf(in);
AnnaBridge 145:64910690c574 5835 #elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 145:64910690c574 5836 *pOut = __builtin_sqrtf(in);
AnnaBridge 145:64910690c574 5837 #elif (__FPU_USED == 1) && defined(__GNUC__)
AnnaBridge 145:64910690c574 5838 *pOut = __builtin_sqrtf(in);
AnnaBridge 145:64910690c574 5839 #elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000)
AnnaBridge 145:64910690c574 5840 __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in));
<> 132:9baf128c2fab 5841 #else
<> 132:9baf128c2fab 5842 *pOut = sqrtf(in);
<> 132:9baf128c2fab 5843 #endif
<> 132:9baf128c2fab 5844
<> 132:9baf128c2fab 5845 return (ARM_MATH_SUCCESS);
<> 132:9baf128c2fab 5846 }
<> 132:9baf128c2fab 5847 else
<> 132:9baf128c2fab 5848 {
<> 132:9baf128c2fab 5849 *pOut = 0.0f;
<> 132:9baf128c2fab 5850 return (ARM_MATH_ARGUMENT_ERROR);
<> 132:9baf128c2fab 5851 }
<> 132:9baf128c2fab 5852 }
<> 132:9baf128c2fab 5853
<> 132:9baf128c2fab 5854
<> 132:9baf128c2fab 5855 /**
<> 132:9baf128c2fab 5856 * @brief Q31 square root function.
AnnaBridge 145:64910690c574 5857 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
AnnaBridge 145:64910690c574 5858 * @param[out] pOut square root of input value.
<> 132:9baf128c2fab 5859 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 132:9baf128c2fab 5860 * <code>in</code> is negative value and returns zero output for negative values.
<> 132:9baf128c2fab 5861 */
<> 132:9baf128c2fab 5862 arm_status arm_sqrt_q31(
<> 132:9baf128c2fab 5863 q31_t in,
<> 132:9baf128c2fab 5864 q31_t * pOut);
<> 132:9baf128c2fab 5865
AnnaBridge 145:64910690c574 5866
<> 132:9baf128c2fab 5867 /**
<> 132:9baf128c2fab 5868 * @brief Q15 square root function.
AnnaBridge 145:64910690c574 5869 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
AnnaBridge 145:64910690c574 5870 * @param[out] pOut square root of input value.
<> 132:9baf128c2fab 5871 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 132:9baf128c2fab 5872 * <code>in</code> is negative value and returns zero output for negative values.
<> 132:9baf128c2fab 5873 */
<> 132:9baf128c2fab 5874 arm_status arm_sqrt_q15(
<> 132:9baf128c2fab 5875 q15_t in,
<> 132:9baf128c2fab 5876 q15_t * pOut);
<> 132:9baf128c2fab 5877
<> 132:9baf128c2fab 5878 /**
<> 132:9baf128c2fab 5879 * @} end of SQRT group
<> 132:9baf128c2fab 5880 */
<> 132:9baf128c2fab 5881
<> 132:9baf128c2fab 5882
<> 132:9baf128c2fab 5883 /**
<> 132:9baf128c2fab 5884 * @brief floating-point Circular write function.
<> 132:9baf128c2fab 5885 */
AnnaBridge 145:64910690c574 5886 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32(
<> 132:9baf128c2fab 5887 int32_t * circBuffer,
<> 132:9baf128c2fab 5888 int32_t L,
<> 132:9baf128c2fab 5889 uint16_t * writeOffset,
<> 132:9baf128c2fab 5890 int32_t bufferInc,
<> 132:9baf128c2fab 5891 const int32_t * src,
<> 132:9baf128c2fab 5892 int32_t srcInc,
<> 132:9baf128c2fab 5893 uint32_t blockSize)
<> 132:9baf128c2fab 5894 {
<> 132:9baf128c2fab 5895 uint32_t i = 0u;
<> 132:9baf128c2fab 5896 int32_t wOffset;
<> 132:9baf128c2fab 5897
<> 132:9baf128c2fab 5898 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 5899 * to the current location where the input samples to be copied */
<> 132:9baf128c2fab 5900 wOffset = *writeOffset;
<> 132:9baf128c2fab 5901
<> 132:9baf128c2fab 5902 /* Loop over the blockSize */
<> 132:9baf128c2fab 5903 i = blockSize;
<> 132:9baf128c2fab 5904
AnnaBridge 145:64910690c574 5905 while (i > 0u)
<> 132:9baf128c2fab 5906 {
<> 132:9baf128c2fab 5907 /* copy the input sample to the circular buffer */
<> 132:9baf128c2fab 5908 circBuffer[wOffset] = *src;
<> 132:9baf128c2fab 5909
<> 132:9baf128c2fab 5910 /* Update the input pointer */
<> 132:9baf128c2fab 5911 src += srcInc;
<> 132:9baf128c2fab 5912
<> 132:9baf128c2fab 5913 /* Circularly update wOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 5914 wOffset += bufferInc;
AnnaBridge 145:64910690c574 5915 if (wOffset >= L)
<> 132:9baf128c2fab 5916 wOffset -= L;
<> 132:9baf128c2fab 5917
<> 132:9baf128c2fab 5918 /* Decrement the loop counter */
<> 132:9baf128c2fab 5919 i--;
<> 132:9baf128c2fab 5920 }
<> 132:9baf128c2fab 5921
<> 132:9baf128c2fab 5922 /* Update the index pointer */
AnnaBridge 145:64910690c574 5923 *writeOffset = (uint16_t)wOffset;
<> 132:9baf128c2fab 5924 }
<> 132:9baf128c2fab 5925
<> 132:9baf128c2fab 5926
<> 132:9baf128c2fab 5927
<> 132:9baf128c2fab 5928 /**
<> 132:9baf128c2fab 5929 * @brief floating-point Circular Read function.
<> 132:9baf128c2fab 5930 */
AnnaBridge 145:64910690c574 5931 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32(
<> 132:9baf128c2fab 5932 int32_t * circBuffer,
<> 132:9baf128c2fab 5933 int32_t L,
<> 132:9baf128c2fab 5934 int32_t * readOffset,
<> 132:9baf128c2fab 5935 int32_t bufferInc,
<> 132:9baf128c2fab 5936 int32_t * dst,
<> 132:9baf128c2fab 5937 int32_t * dst_base,
<> 132:9baf128c2fab 5938 int32_t dst_length,
<> 132:9baf128c2fab 5939 int32_t dstInc,
<> 132:9baf128c2fab 5940 uint32_t blockSize)
<> 132:9baf128c2fab 5941 {
<> 132:9baf128c2fab 5942 uint32_t i = 0u;
<> 132:9baf128c2fab 5943 int32_t rOffset, dst_end;
<> 132:9baf128c2fab 5944
<> 132:9baf128c2fab 5945 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 5946 * to the current location from where the input samples to be read */
<> 132:9baf128c2fab 5947 rOffset = *readOffset;
<> 132:9baf128c2fab 5948 dst_end = (int32_t) (dst_base + dst_length);
<> 132:9baf128c2fab 5949
<> 132:9baf128c2fab 5950 /* Loop over the blockSize */
<> 132:9baf128c2fab 5951 i = blockSize;
<> 132:9baf128c2fab 5952
AnnaBridge 145:64910690c574 5953 while (i > 0u)
<> 132:9baf128c2fab 5954 {
<> 132:9baf128c2fab 5955 /* copy the sample from the circular buffer to the destination buffer */
<> 132:9baf128c2fab 5956 *dst = circBuffer[rOffset];
<> 132:9baf128c2fab 5957
<> 132:9baf128c2fab 5958 /* Update the input pointer */
<> 132:9baf128c2fab 5959 dst += dstInc;
<> 132:9baf128c2fab 5960
AnnaBridge 145:64910690c574 5961 if (dst == (int32_t *) dst_end)
<> 132:9baf128c2fab 5962 {
<> 132:9baf128c2fab 5963 dst = dst_base;
<> 132:9baf128c2fab 5964 }
<> 132:9baf128c2fab 5965
<> 132:9baf128c2fab 5966 /* Circularly update rOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 5967 rOffset += bufferInc;
<> 132:9baf128c2fab 5968
AnnaBridge 145:64910690c574 5969 if (rOffset >= L)
<> 132:9baf128c2fab 5970 {
<> 132:9baf128c2fab 5971 rOffset -= L;
<> 132:9baf128c2fab 5972 }
<> 132:9baf128c2fab 5973
<> 132:9baf128c2fab 5974 /* Decrement the loop counter */
<> 132:9baf128c2fab 5975 i--;
<> 132:9baf128c2fab 5976 }
<> 132:9baf128c2fab 5977
<> 132:9baf128c2fab 5978 /* Update the index pointer */
<> 132:9baf128c2fab 5979 *readOffset = rOffset;
<> 132:9baf128c2fab 5980 }
<> 132:9baf128c2fab 5981
AnnaBridge 145:64910690c574 5982
<> 132:9baf128c2fab 5983 /**
<> 132:9baf128c2fab 5984 * @brief Q15 Circular write function.
<> 132:9baf128c2fab 5985 */
AnnaBridge 145:64910690c574 5986 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15(
<> 132:9baf128c2fab 5987 q15_t * circBuffer,
<> 132:9baf128c2fab 5988 int32_t L,
<> 132:9baf128c2fab 5989 uint16_t * writeOffset,
<> 132:9baf128c2fab 5990 int32_t bufferInc,
<> 132:9baf128c2fab 5991 const q15_t * src,
<> 132:9baf128c2fab 5992 int32_t srcInc,
<> 132:9baf128c2fab 5993 uint32_t blockSize)
<> 132:9baf128c2fab 5994 {
<> 132:9baf128c2fab 5995 uint32_t i = 0u;
<> 132:9baf128c2fab 5996 int32_t wOffset;
<> 132:9baf128c2fab 5997
<> 132:9baf128c2fab 5998 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 5999 * to the current location where the input samples to be copied */
<> 132:9baf128c2fab 6000 wOffset = *writeOffset;
<> 132:9baf128c2fab 6001
<> 132:9baf128c2fab 6002 /* Loop over the blockSize */
<> 132:9baf128c2fab 6003 i = blockSize;
<> 132:9baf128c2fab 6004
AnnaBridge 145:64910690c574 6005 while (i > 0u)
<> 132:9baf128c2fab 6006 {
<> 132:9baf128c2fab 6007 /* copy the input sample to the circular buffer */
<> 132:9baf128c2fab 6008 circBuffer[wOffset] = *src;
<> 132:9baf128c2fab 6009
<> 132:9baf128c2fab 6010 /* Update the input pointer */
<> 132:9baf128c2fab 6011 src += srcInc;
<> 132:9baf128c2fab 6012
<> 132:9baf128c2fab 6013 /* Circularly update wOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 6014 wOffset += bufferInc;
AnnaBridge 145:64910690c574 6015 if (wOffset >= L)
<> 132:9baf128c2fab 6016 wOffset -= L;
<> 132:9baf128c2fab 6017
<> 132:9baf128c2fab 6018 /* Decrement the loop counter */
<> 132:9baf128c2fab 6019 i--;
<> 132:9baf128c2fab 6020 }
<> 132:9baf128c2fab 6021
<> 132:9baf128c2fab 6022 /* Update the index pointer */
AnnaBridge 145:64910690c574 6023 *writeOffset = (uint16_t)wOffset;
<> 132:9baf128c2fab 6024 }
<> 132:9baf128c2fab 6025
<> 132:9baf128c2fab 6026
<> 132:9baf128c2fab 6027 /**
<> 132:9baf128c2fab 6028 * @brief Q15 Circular Read function.
<> 132:9baf128c2fab 6029 */
AnnaBridge 145:64910690c574 6030 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15(
<> 132:9baf128c2fab 6031 q15_t * circBuffer,
<> 132:9baf128c2fab 6032 int32_t L,
<> 132:9baf128c2fab 6033 int32_t * readOffset,
<> 132:9baf128c2fab 6034 int32_t bufferInc,
<> 132:9baf128c2fab 6035 q15_t * dst,
<> 132:9baf128c2fab 6036 q15_t * dst_base,
<> 132:9baf128c2fab 6037 int32_t dst_length,
<> 132:9baf128c2fab 6038 int32_t dstInc,
<> 132:9baf128c2fab 6039 uint32_t blockSize)
<> 132:9baf128c2fab 6040 {
<> 132:9baf128c2fab 6041 uint32_t i = 0;
<> 132:9baf128c2fab 6042 int32_t rOffset, dst_end;
<> 132:9baf128c2fab 6043
<> 132:9baf128c2fab 6044 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 6045 * to the current location from where the input samples to be read */
<> 132:9baf128c2fab 6046 rOffset = *readOffset;
<> 132:9baf128c2fab 6047
<> 132:9baf128c2fab 6048 dst_end = (int32_t) (dst_base + dst_length);
<> 132:9baf128c2fab 6049
<> 132:9baf128c2fab 6050 /* Loop over the blockSize */
<> 132:9baf128c2fab 6051 i = blockSize;
<> 132:9baf128c2fab 6052
AnnaBridge 145:64910690c574 6053 while (i > 0u)
<> 132:9baf128c2fab 6054 {
<> 132:9baf128c2fab 6055 /* copy the sample from the circular buffer to the destination buffer */
<> 132:9baf128c2fab 6056 *dst = circBuffer[rOffset];
<> 132:9baf128c2fab 6057
<> 132:9baf128c2fab 6058 /* Update the input pointer */
<> 132:9baf128c2fab 6059 dst += dstInc;
<> 132:9baf128c2fab 6060
AnnaBridge 145:64910690c574 6061 if (dst == (q15_t *) dst_end)
<> 132:9baf128c2fab 6062 {
<> 132:9baf128c2fab 6063 dst = dst_base;
<> 132:9baf128c2fab 6064 }
<> 132:9baf128c2fab 6065
<> 132:9baf128c2fab 6066 /* Circularly update wOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 6067 rOffset += bufferInc;
<> 132:9baf128c2fab 6068
AnnaBridge 145:64910690c574 6069 if (rOffset >= L)
<> 132:9baf128c2fab 6070 {
<> 132:9baf128c2fab 6071 rOffset -= L;
<> 132:9baf128c2fab 6072 }
<> 132:9baf128c2fab 6073
<> 132:9baf128c2fab 6074 /* Decrement the loop counter */
<> 132:9baf128c2fab 6075 i--;
<> 132:9baf128c2fab 6076 }
<> 132:9baf128c2fab 6077
<> 132:9baf128c2fab 6078 /* Update the index pointer */
<> 132:9baf128c2fab 6079 *readOffset = rOffset;
<> 132:9baf128c2fab 6080 }
<> 132:9baf128c2fab 6081
<> 132:9baf128c2fab 6082
<> 132:9baf128c2fab 6083 /**
<> 132:9baf128c2fab 6084 * @brief Q7 Circular write function.
<> 132:9baf128c2fab 6085 */
AnnaBridge 145:64910690c574 6086 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7(
<> 132:9baf128c2fab 6087 q7_t * circBuffer,
<> 132:9baf128c2fab 6088 int32_t L,
<> 132:9baf128c2fab 6089 uint16_t * writeOffset,
<> 132:9baf128c2fab 6090 int32_t bufferInc,
<> 132:9baf128c2fab 6091 const q7_t * src,
<> 132:9baf128c2fab 6092 int32_t srcInc,
<> 132:9baf128c2fab 6093 uint32_t blockSize)
<> 132:9baf128c2fab 6094 {
<> 132:9baf128c2fab 6095 uint32_t i = 0u;
<> 132:9baf128c2fab 6096 int32_t wOffset;
<> 132:9baf128c2fab 6097
<> 132:9baf128c2fab 6098 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 6099 * to the current location where the input samples to be copied */
<> 132:9baf128c2fab 6100 wOffset = *writeOffset;
<> 132:9baf128c2fab 6101
<> 132:9baf128c2fab 6102 /* Loop over the blockSize */
<> 132:9baf128c2fab 6103 i = blockSize;
<> 132:9baf128c2fab 6104
AnnaBridge 145:64910690c574 6105 while (i > 0u)
<> 132:9baf128c2fab 6106 {
<> 132:9baf128c2fab 6107 /* copy the input sample to the circular buffer */
<> 132:9baf128c2fab 6108 circBuffer[wOffset] = *src;
<> 132:9baf128c2fab 6109
<> 132:9baf128c2fab 6110 /* Update the input pointer */
<> 132:9baf128c2fab 6111 src += srcInc;
<> 132:9baf128c2fab 6112
<> 132:9baf128c2fab 6113 /* Circularly update wOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 6114 wOffset += bufferInc;
AnnaBridge 145:64910690c574 6115 if (wOffset >= L)
<> 132:9baf128c2fab 6116 wOffset -= L;
<> 132:9baf128c2fab 6117
<> 132:9baf128c2fab 6118 /* Decrement the loop counter */
<> 132:9baf128c2fab 6119 i--;
<> 132:9baf128c2fab 6120 }
<> 132:9baf128c2fab 6121
<> 132:9baf128c2fab 6122 /* Update the index pointer */
AnnaBridge 145:64910690c574 6123 *writeOffset = (uint16_t)wOffset;
<> 132:9baf128c2fab 6124 }
<> 132:9baf128c2fab 6125
<> 132:9baf128c2fab 6126
<> 132:9baf128c2fab 6127 /**
<> 132:9baf128c2fab 6128 * @brief Q7 Circular Read function.
<> 132:9baf128c2fab 6129 */
AnnaBridge 145:64910690c574 6130 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7(
<> 132:9baf128c2fab 6131 q7_t * circBuffer,
<> 132:9baf128c2fab 6132 int32_t L,
<> 132:9baf128c2fab 6133 int32_t * readOffset,
<> 132:9baf128c2fab 6134 int32_t bufferInc,
<> 132:9baf128c2fab 6135 q7_t * dst,
<> 132:9baf128c2fab 6136 q7_t * dst_base,
<> 132:9baf128c2fab 6137 int32_t dst_length,
<> 132:9baf128c2fab 6138 int32_t dstInc,
<> 132:9baf128c2fab 6139 uint32_t blockSize)
<> 132:9baf128c2fab 6140 {
<> 132:9baf128c2fab 6141 uint32_t i = 0;
<> 132:9baf128c2fab 6142 int32_t rOffset, dst_end;
<> 132:9baf128c2fab 6143
<> 132:9baf128c2fab 6144 /* Copy the value of Index pointer that points
<> 132:9baf128c2fab 6145 * to the current location from where the input samples to be read */
<> 132:9baf128c2fab 6146 rOffset = *readOffset;
<> 132:9baf128c2fab 6147
<> 132:9baf128c2fab 6148 dst_end = (int32_t) (dst_base + dst_length);
<> 132:9baf128c2fab 6149
<> 132:9baf128c2fab 6150 /* Loop over the blockSize */
<> 132:9baf128c2fab 6151 i = blockSize;
<> 132:9baf128c2fab 6152
AnnaBridge 145:64910690c574 6153 while (i > 0u)
<> 132:9baf128c2fab 6154 {
<> 132:9baf128c2fab 6155 /* copy the sample from the circular buffer to the destination buffer */
<> 132:9baf128c2fab 6156 *dst = circBuffer[rOffset];
<> 132:9baf128c2fab 6157
<> 132:9baf128c2fab 6158 /* Update the input pointer */
<> 132:9baf128c2fab 6159 dst += dstInc;
<> 132:9baf128c2fab 6160
AnnaBridge 145:64910690c574 6161 if (dst == (q7_t *) dst_end)
<> 132:9baf128c2fab 6162 {
<> 132:9baf128c2fab 6163 dst = dst_base;
<> 132:9baf128c2fab 6164 }
<> 132:9baf128c2fab 6165
<> 132:9baf128c2fab 6166 /* Circularly update rOffset. Watch out for positive and negative value */
<> 132:9baf128c2fab 6167 rOffset += bufferInc;
<> 132:9baf128c2fab 6168
AnnaBridge 145:64910690c574 6169 if (rOffset >= L)
<> 132:9baf128c2fab 6170 {
<> 132:9baf128c2fab 6171 rOffset -= L;
<> 132:9baf128c2fab 6172 }
<> 132:9baf128c2fab 6173
<> 132:9baf128c2fab 6174 /* Decrement the loop counter */
<> 132:9baf128c2fab 6175 i--;
<> 132:9baf128c2fab 6176 }
<> 132:9baf128c2fab 6177
<> 132:9baf128c2fab 6178 /* Update the index pointer */
<> 132:9baf128c2fab 6179 *readOffset = rOffset;
<> 132:9baf128c2fab 6180 }
<> 132:9baf128c2fab 6181
<> 132:9baf128c2fab 6182
<> 132:9baf128c2fab 6183 /**
<> 132:9baf128c2fab 6184 * @brief Sum of the squares of the elements of a Q31 vector.
AnnaBridge 145:64910690c574 6185 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6186 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6187 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6188 */
<> 132:9baf128c2fab 6189 void arm_power_q31(
<> 132:9baf128c2fab 6190 q31_t * pSrc,
<> 132:9baf128c2fab 6191 uint32_t blockSize,
<> 132:9baf128c2fab 6192 q63_t * pResult);
<> 132:9baf128c2fab 6193
AnnaBridge 145:64910690c574 6194
<> 132:9baf128c2fab 6195 /**
<> 132:9baf128c2fab 6196 * @brief Sum of the squares of the elements of a floating-point vector.
AnnaBridge 145:64910690c574 6197 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6198 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6199 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6200 */
<> 132:9baf128c2fab 6201 void arm_power_f32(
<> 132:9baf128c2fab 6202 float32_t * pSrc,
<> 132:9baf128c2fab 6203 uint32_t blockSize,
<> 132:9baf128c2fab 6204 float32_t * pResult);
<> 132:9baf128c2fab 6205
AnnaBridge 145:64910690c574 6206
<> 132:9baf128c2fab 6207 /**
<> 132:9baf128c2fab 6208 * @brief Sum of the squares of the elements of a Q15 vector.
AnnaBridge 145:64910690c574 6209 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6210 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6211 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6212 */
<> 132:9baf128c2fab 6213 void arm_power_q15(
<> 132:9baf128c2fab 6214 q15_t * pSrc,
<> 132:9baf128c2fab 6215 uint32_t blockSize,
<> 132:9baf128c2fab 6216 q63_t * pResult);
<> 132:9baf128c2fab 6217
AnnaBridge 145:64910690c574 6218
<> 132:9baf128c2fab 6219 /**
<> 132:9baf128c2fab 6220 * @brief Sum of the squares of the elements of a Q7 vector.
AnnaBridge 145:64910690c574 6221 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6222 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6223 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6224 */
<> 132:9baf128c2fab 6225 void arm_power_q7(
<> 132:9baf128c2fab 6226 q7_t * pSrc,
<> 132:9baf128c2fab 6227 uint32_t blockSize,
<> 132:9baf128c2fab 6228 q31_t * pResult);
<> 132:9baf128c2fab 6229
AnnaBridge 145:64910690c574 6230
<> 132:9baf128c2fab 6231 /**
<> 132:9baf128c2fab 6232 * @brief Mean value of a Q7 vector.
AnnaBridge 145:64910690c574 6233 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6234 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6235 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6236 */
<> 132:9baf128c2fab 6237 void arm_mean_q7(
<> 132:9baf128c2fab 6238 q7_t * pSrc,
<> 132:9baf128c2fab 6239 uint32_t blockSize,
<> 132:9baf128c2fab 6240 q7_t * pResult);
<> 132:9baf128c2fab 6241
AnnaBridge 145:64910690c574 6242
<> 132:9baf128c2fab 6243 /**
<> 132:9baf128c2fab 6244 * @brief Mean value of a Q15 vector.
AnnaBridge 145:64910690c574 6245 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6246 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6247 * @param[out] pResult is output value.
<> 132:9baf128c2fab 6248 */
<> 132:9baf128c2fab 6249 void arm_mean_q15(
<> 132:9baf128c2fab 6250 q15_t * pSrc,
<> 132:9baf128c2fab 6251 uint32_t blockSize,
<> 132:9baf128c2fab 6252 q15_t * pResult);
<> 132:9baf128c2fab 6253
AnnaBridge 145:64910690c574 6254
<> 132:9baf128c2fab 6255 /**
<> 132:9baf128c2fab 6256 * @brief Mean value of a Q31 vector.
AnnaBridge 145:64910690c574 6257 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6258 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6259 * @param[out] pResult is output value.
<> 132:9baf128c2fab 6260 */
<> 132:9baf128c2fab 6261 void arm_mean_q31(
<> 132:9baf128c2fab 6262 q31_t * pSrc,
<> 132:9baf128c2fab 6263 uint32_t blockSize,
<> 132:9baf128c2fab 6264 q31_t * pResult);
<> 132:9baf128c2fab 6265
AnnaBridge 145:64910690c574 6266
<> 132:9baf128c2fab 6267 /**
<> 132:9baf128c2fab 6268 * @brief Mean value of a floating-point vector.
AnnaBridge 145:64910690c574 6269 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6270 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6271 * @param[out] pResult is output value.
<> 132:9baf128c2fab 6272 */
<> 132:9baf128c2fab 6273 void arm_mean_f32(
<> 132:9baf128c2fab 6274 float32_t * pSrc,
<> 132:9baf128c2fab 6275 uint32_t blockSize,
<> 132:9baf128c2fab 6276 float32_t * pResult);
<> 132:9baf128c2fab 6277
AnnaBridge 145:64910690c574 6278
<> 132:9baf128c2fab 6279 /**
<> 132:9baf128c2fab 6280 * @brief Variance of the elements of a floating-point vector.
AnnaBridge 145:64910690c574 6281 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6282 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6283 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6284 */
<> 132:9baf128c2fab 6285 void arm_var_f32(
<> 132:9baf128c2fab 6286 float32_t * pSrc,
<> 132:9baf128c2fab 6287 uint32_t blockSize,
<> 132:9baf128c2fab 6288 float32_t * pResult);
<> 132:9baf128c2fab 6289
AnnaBridge 145:64910690c574 6290
<> 132:9baf128c2fab 6291 /**
<> 132:9baf128c2fab 6292 * @brief Variance of the elements of a Q31 vector.
AnnaBridge 145:64910690c574 6293 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6294 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6295 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6296 */
<> 132:9baf128c2fab 6297 void arm_var_q31(
<> 132:9baf128c2fab 6298 q31_t * pSrc,
<> 132:9baf128c2fab 6299 uint32_t blockSize,
<> 132:9baf128c2fab 6300 q31_t * pResult);
<> 132:9baf128c2fab 6301
AnnaBridge 145:64910690c574 6302
<> 132:9baf128c2fab 6303 /**
<> 132:9baf128c2fab 6304 * @brief Variance of the elements of a Q15 vector.
AnnaBridge 145:64910690c574 6305 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6306 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6307 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6308 */
<> 132:9baf128c2fab 6309 void arm_var_q15(
<> 132:9baf128c2fab 6310 q15_t * pSrc,
<> 132:9baf128c2fab 6311 uint32_t blockSize,
<> 132:9baf128c2fab 6312 q15_t * pResult);
<> 132:9baf128c2fab 6313
AnnaBridge 145:64910690c574 6314
<> 132:9baf128c2fab 6315 /**
<> 132:9baf128c2fab 6316 * @brief Root Mean Square of the elements of a floating-point vector.
AnnaBridge 145:64910690c574 6317 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6318 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6319 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6320 */
<> 132:9baf128c2fab 6321 void arm_rms_f32(
<> 132:9baf128c2fab 6322 float32_t * pSrc,
<> 132:9baf128c2fab 6323 uint32_t blockSize,
<> 132:9baf128c2fab 6324 float32_t * pResult);
<> 132:9baf128c2fab 6325
AnnaBridge 145:64910690c574 6326
<> 132:9baf128c2fab 6327 /**
<> 132:9baf128c2fab 6328 * @brief Root Mean Square of the elements of a Q31 vector.
AnnaBridge 145:64910690c574 6329 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6330 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6331 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6332 */
<> 132:9baf128c2fab 6333 void arm_rms_q31(
<> 132:9baf128c2fab 6334 q31_t * pSrc,
<> 132:9baf128c2fab 6335 uint32_t blockSize,
<> 132:9baf128c2fab 6336 q31_t * pResult);
<> 132:9baf128c2fab 6337
AnnaBridge 145:64910690c574 6338
<> 132:9baf128c2fab 6339 /**
<> 132:9baf128c2fab 6340 * @brief Root Mean Square of the elements of a Q15 vector.
AnnaBridge 145:64910690c574 6341 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6342 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6343 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6344 */
<> 132:9baf128c2fab 6345 void arm_rms_q15(
<> 132:9baf128c2fab 6346 q15_t * pSrc,
<> 132:9baf128c2fab 6347 uint32_t blockSize,
<> 132:9baf128c2fab 6348 q15_t * pResult);
<> 132:9baf128c2fab 6349
AnnaBridge 145:64910690c574 6350
<> 132:9baf128c2fab 6351 /**
<> 132:9baf128c2fab 6352 * @brief Standard deviation of the elements of a floating-point vector.
AnnaBridge 145:64910690c574 6353 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6354 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6355 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6356 */
<> 132:9baf128c2fab 6357 void arm_std_f32(
<> 132:9baf128c2fab 6358 float32_t * pSrc,
<> 132:9baf128c2fab 6359 uint32_t blockSize,
<> 132:9baf128c2fab 6360 float32_t * pResult);
<> 132:9baf128c2fab 6361
AnnaBridge 145:64910690c574 6362
<> 132:9baf128c2fab 6363 /**
<> 132:9baf128c2fab 6364 * @brief Standard deviation of the elements of a Q31 vector.
AnnaBridge 145:64910690c574 6365 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6366 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6367 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6368 */
<> 132:9baf128c2fab 6369 void arm_std_q31(
<> 132:9baf128c2fab 6370 q31_t * pSrc,
<> 132:9baf128c2fab 6371 uint32_t blockSize,
<> 132:9baf128c2fab 6372 q31_t * pResult);
<> 132:9baf128c2fab 6373
AnnaBridge 145:64910690c574 6374
<> 132:9baf128c2fab 6375 /**
<> 132:9baf128c2fab 6376 * @brief Standard deviation of the elements of a Q15 vector.
AnnaBridge 145:64910690c574 6377 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6378 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6379 * @param[out] pResult is output value.
AnnaBridge 145:64910690c574 6380 */
<> 132:9baf128c2fab 6381 void arm_std_q15(
<> 132:9baf128c2fab 6382 q15_t * pSrc,
<> 132:9baf128c2fab 6383 uint32_t blockSize,
<> 132:9baf128c2fab 6384 q15_t * pResult);
<> 132:9baf128c2fab 6385
AnnaBridge 145:64910690c574 6386
<> 132:9baf128c2fab 6387 /**
<> 132:9baf128c2fab 6388 * @brief Floating-point complex magnitude
AnnaBridge 145:64910690c574 6389 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 6390 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 6391 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 6392 */
<> 132:9baf128c2fab 6393 void arm_cmplx_mag_f32(
<> 132:9baf128c2fab 6394 float32_t * pSrc,
<> 132:9baf128c2fab 6395 float32_t * pDst,
<> 132:9baf128c2fab 6396 uint32_t numSamples);
<> 132:9baf128c2fab 6397
AnnaBridge 145:64910690c574 6398
<> 132:9baf128c2fab 6399 /**
<> 132:9baf128c2fab 6400 * @brief Q31 complex magnitude
AnnaBridge 145:64910690c574 6401 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 6402 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 6403 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 6404 */
<> 132:9baf128c2fab 6405 void arm_cmplx_mag_q31(
<> 132:9baf128c2fab 6406 q31_t * pSrc,
<> 132:9baf128c2fab 6407 q31_t * pDst,
<> 132:9baf128c2fab 6408 uint32_t numSamples);
<> 132:9baf128c2fab 6409
AnnaBridge 145:64910690c574 6410
<> 132:9baf128c2fab 6411 /**
<> 132:9baf128c2fab 6412 * @brief Q15 complex magnitude
AnnaBridge 145:64910690c574 6413 * @param[in] pSrc points to the complex input vector
AnnaBridge 145:64910690c574 6414 * @param[out] pDst points to the real output vector
AnnaBridge 145:64910690c574 6415 * @param[in] numSamples number of complex samples in the input vector
AnnaBridge 145:64910690c574 6416 */
<> 132:9baf128c2fab 6417 void arm_cmplx_mag_q15(
<> 132:9baf128c2fab 6418 q15_t * pSrc,
<> 132:9baf128c2fab 6419 q15_t * pDst,
<> 132:9baf128c2fab 6420 uint32_t numSamples);
<> 132:9baf128c2fab 6421
AnnaBridge 145:64910690c574 6422
<> 132:9baf128c2fab 6423 /**
<> 132:9baf128c2fab 6424 * @brief Q15 complex dot product
AnnaBridge 145:64910690c574 6425 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6426 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6427 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6428 * @param[out] realResult real part of the result returned here
AnnaBridge 145:64910690c574 6429 * @param[out] imagResult imaginary part of the result returned here
AnnaBridge 145:64910690c574 6430 */
<> 132:9baf128c2fab 6431 void arm_cmplx_dot_prod_q15(
<> 132:9baf128c2fab 6432 q15_t * pSrcA,
<> 132:9baf128c2fab 6433 q15_t * pSrcB,
<> 132:9baf128c2fab 6434 uint32_t numSamples,
<> 132:9baf128c2fab 6435 q31_t * realResult,
<> 132:9baf128c2fab 6436 q31_t * imagResult);
<> 132:9baf128c2fab 6437
AnnaBridge 145:64910690c574 6438
<> 132:9baf128c2fab 6439 /**
<> 132:9baf128c2fab 6440 * @brief Q31 complex dot product
AnnaBridge 145:64910690c574 6441 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6442 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6443 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6444 * @param[out] realResult real part of the result returned here
AnnaBridge 145:64910690c574 6445 * @param[out] imagResult imaginary part of the result returned here
AnnaBridge 145:64910690c574 6446 */
<> 132:9baf128c2fab 6447 void arm_cmplx_dot_prod_q31(
<> 132:9baf128c2fab 6448 q31_t * pSrcA,
<> 132:9baf128c2fab 6449 q31_t * pSrcB,
<> 132:9baf128c2fab 6450 uint32_t numSamples,
<> 132:9baf128c2fab 6451 q63_t * realResult,
<> 132:9baf128c2fab 6452 q63_t * imagResult);
<> 132:9baf128c2fab 6453
AnnaBridge 145:64910690c574 6454
<> 132:9baf128c2fab 6455 /**
<> 132:9baf128c2fab 6456 * @brief Floating-point complex dot product
AnnaBridge 145:64910690c574 6457 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6458 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6459 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6460 * @param[out] realResult real part of the result returned here
AnnaBridge 145:64910690c574 6461 * @param[out] imagResult imaginary part of the result returned here
AnnaBridge 145:64910690c574 6462 */
<> 132:9baf128c2fab 6463 void arm_cmplx_dot_prod_f32(
<> 132:9baf128c2fab 6464 float32_t * pSrcA,
<> 132:9baf128c2fab 6465 float32_t * pSrcB,
<> 132:9baf128c2fab 6466 uint32_t numSamples,
<> 132:9baf128c2fab 6467 float32_t * realResult,
<> 132:9baf128c2fab 6468 float32_t * imagResult);
<> 132:9baf128c2fab 6469
AnnaBridge 145:64910690c574 6470
<> 132:9baf128c2fab 6471 /**
<> 132:9baf128c2fab 6472 * @brief Q15 complex-by-real multiplication
AnnaBridge 145:64910690c574 6473 * @param[in] pSrcCmplx points to the complex input vector
AnnaBridge 145:64910690c574 6474 * @param[in] pSrcReal points to the real input vector
AnnaBridge 145:64910690c574 6475 * @param[out] pCmplxDst points to the complex output vector
AnnaBridge 145:64910690c574 6476 * @param[in] numSamples number of samples in each vector
AnnaBridge 145:64910690c574 6477 */
<> 132:9baf128c2fab 6478 void arm_cmplx_mult_real_q15(
<> 132:9baf128c2fab 6479 q15_t * pSrcCmplx,
<> 132:9baf128c2fab 6480 q15_t * pSrcReal,
<> 132:9baf128c2fab 6481 q15_t * pCmplxDst,
<> 132:9baf128c2fab 6482 uint32_t numSamples);
<> 132:9baf128c2fab 6483
AnnaBridge 145:64910690c574 6484
<> 132:9baf128c2fab 6485 /**
<> 132:9baf128c2fab 6486 * @brief Q31 complex-by-real multiplication
AnnaBridge 145:64910690c574 6487 * @param[in] pSrcCmplx points to the complex input vector
AnnaBridge 145:64910690c574 6488 * @param[in] pSrcReal points to the real input vector
AnnaBridge 145:64910690c574 6489 * @param[out] pCmplxDst points to the complex output vector
AnnaBridge 145:64910690c574 6490 * @param[in] numSamples number of samples in each vector
AnnaBridge 145:64910690c574 6491 */
<> 132:9baf128c2fab 6492 void arm_cmplx_mult_real_q31(
<> 132:9baf128c2fab 6493 q31_t * pSrcCmplx,
<> 132:9baf128c2fab 6494 q31_t * pSrcReal,
<> 132:9baf128c2fab 6495 q31_t * pCmplxDst,
<> 132:9baf128c2fab 6496 uint32_t numSamples);
<> 132:9baf128c2fab 6497
AnnaBridge 145:64910690c574 6498
<> 132:9baf128c2fab 6499 /**
<> 132:9baf128c2fab 6500 * @brief Floating-point complex-by-real multiplication
AnnaBridge 145:64910690c574 6501 * @param[in] pSrcCmplx points to the complex input vector
AnnaBridge 145:64910690c574 6502 * @param[in] pSrcReal points to the real input vector
AnnaBridge 145:64910690c574 6503 * @param[out] pCmplxDst points to the complex output vector
AnnaBridge 145:64910690c574 6504 * @param[in] numSamples number of samples in each vector
AnnaBridge 145:64910690c574 6505 */
<> 132:9baf128c2fab 6506 void arm_cmplx_mult_real_f32(
<> 132:9baf128c2fab 6507 float32_t * pSrcCmplx,
<> 132:9baf128c2fab 6508 float32_t * pSrcReal,
<> 132:9baf128c2fab 6509 float32_t * pCmplxDst,
<> 132:9baf128c2fab 6510 uint32_t numSamples);
<> 132:9baf128c2fab 6511
AnnaBridge 145:64910690c574 6512
<> 132:9baf128c2fab 6513 /**
<> 132:9baf128c2fab 6514 * @brief Minimum value of a Q7 vector.
AnnaBridge 145:64910690c574 6515 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6516 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6517 * @param[out] result is output pointer
AnnaBridge 145:64910690c574 6518 * @param[in] index is the array index of the minimum value in the input buffer.
AnnaBridge 145:64910690c574 6519 */
<> 132:9baf128c2fab 6520 void arm_min_q7(
<> 132:9baf128c2fab 6521 q7_t * pSrc,
<> 132:9baf128c2fab 6522 uint32_t blockSize,
<> 132:9baf128c2fab 6523 q7_t * result,
<> 132:9baf128c2fab 6524 uint32_t * index);
<> 132:9baf128c2fab 6525
AnnaBridge 145:64910690c574 6526
<> 132:9baf128c2fab 6527 /**
<> 132:9baf128c2fab 6528 * @brief Minimum value of a Q15 vector.
AnnaBridge 145:64910690c574 6529 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6530 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6531 * @param[out] pResult is output pointer
AnnaBridge 145:64910690c574 6532 * @param[in] pIndex is the array index of the minimum value in the input buffer.
AnnaBridge 145:64910690c574 6533 */
<> 132:9baf128c2fab 6534 void arm_min_q15(
<> 132:9baf128c2fab 6535 q15_t * pSrc,
<> 132:9baf128c2fab 6536 uint32_t blockSize,
<> 132:9baf128c2fab 6537 q15_t * pResult,
<> 132:9baf128c2fab 6538 uint32_t * pIndex);
<> 132:9baf128c2fab 6539
AnnaBridge 145:64910690c574 6540
<> 132:9baf128c2fab 6541 /**
<> 132:9baf128c2fab 6542 * @brief Minimum value of a Q31 vector.
AnnaBridge 145:64910690c574 6543 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6544 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6545 * @param[out] pResult is output pointer
AnnaBridge 145:64910690c574 6546 * @param[out] pIndex is the array index of the minimum value in the input buffer.
<> 132:9baf128c2fab 6547 */
<> 132:9baf128c2fab 6548 void arm_min_q31(
<> 132:9baf128c2fab 6549 q31_t * pSrc,
<> 132:9baf128c2fab 6550 uint32_t blockSize,
<> 132:9baf128c2fab 6551 q31_t * pResult,
<> 132:9baf128c2fab 6552 uint32_t * pIndex);
<> 132:9baf128c2fab 6553
AnnaBridge 145:64910690c574 6554
<> 132:9baf128c2fab 6555 /**
<> 132:9baf128c2fab 6556 * @brief Minimum value of a floating-point vector.
AnnaBridge 145:64910690c574 6557 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6558 * @param[in] blockSize is the number of samples to process
AnnaBridge 145:64910690c574 6559 * @param[out] pResult is output pointer
AnnaBridge 145:64910690c574 6560 * @param[out] pIndex is the array index of the minimum value in the input buffer.
AnnaBridge 145:64910690c574 6561 */
<> 132:9baf128c2fab 6562 void arm_min_f32(
<> 132:9baf128c2fab 6563 float32_t * pSrc,
<> 132:9baf128c2fab 6564 uint32_t blockSize,
<> 132:9baf128c2fab 6565 float32_t * pResult,
<> 132:9baf128c2fab 6566 uint32_t * pIndex);
<> 132:9baf128c2fab 6567
AnnaBridge 145:64910690c574 6568
<> 132:9baf128c2fab 6569 /**
<> 132:9baf128c2fab 6570 * @brief Maximum value of a Q7 vector.
AnnaBridge 145:64910690c574 6571 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 6572 * @param[in] blockSize length of the input vector
AnnaBridge 145:64910690c574 6573 * @param[out] pResult maximum value returned here
AnnaBridge 145:64910690c574 6574 * @param[out] pIndex index of maximum value returned here
<> 132:9baf128c2fab 6575 */
<> 132:9baf128c2fab 6576 void arm_max_q7(
<> 132:9baf128c2fab 6577 q7_t * pSrc,
<> 132:9baf128c2fab 6578 uint32_t blockSize,
<> 132:9baf128c2fab 6579 q7_t * pResult,
<> 132:9baf128c2fab 6580 uint32_t * pIndex);
<> 132:9baf128c2fab 6581
AnnaBridge 145:64910690c574 6582
<> 132:9baf128c2fab 6583 /**
<> 132:9baf128c2fab 6584 * @brief Maximum value of a Q15 vector.
AnnaBridge 145:64910690c574 6585 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 6586 * @param[in] blockSize length of the input vector
AnnaBridge 145:64910690c574 6587 * @param[out] pResult maximum value returned here
AnnaBridge 145:64910690c574 6588 * @param[out] pIndex index of maximum value returned here
<> 132:9baf128c2fab 6589 */
<> 132:9baf128c2fab 6590 void arm_max_q15(
<> 132:9baf128c2fab 6591 q15_t * pSrc,
<> 132:9baf128c2fab 6592 uint32_t blockSize,
<> 132:9baf128c2fab 6593 q15_t * pResult,
<> 132:9baf128c2fab 6594 uint32_t * pIndex);
<> 132:9baf128c2fab 6595
AnnaBridge 145:64910690c574 6596
<> 132:9baf128c2fab 6597 /**
<> 132:9baf128c2fab 6598 * @brief Maximum value of a Q31 vector.
AnnaBridge 145:64910690c574 6599 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 6600 * @param[in] blockSize length of the input vector
AnnaBridge 145:64910690c574 6601 * @param[out] pResult maximum value returned here
AnnaBridge 145:64910690c574 6602 * @param[out] pIndex index of maximum value returned here
<> 132:9baf128c2fab 6603 */
<> 132:9baf128c2fab 6604 void arm_max_q31(
<> 132:9baf128c2fab 6605 q31_t * pSrc,
<> 132:9baf128c2fab 6606 uint32_t blockSize,
<> 132:9baf128c2fab 6607 q31_t * pResult,
<> 132:9baf128c2fab 6608 uint32_t * pIndex);
<> 132:9baf128c2fab 6609
AnnaBridge 145:64910690c574 6610
<> 132:9baf128c2fab 6611 /**
<> 132:9baf128c2fab 6612 * @brief Maximum value of a floating-point vector.
AnnaBridge 145:64910690c574 6613 * @param[in] pSrc points to the input buffer
AnnaBridge 145:64910690c574 6614 * @param[in] blockSize length of the input vector
AnnaBridge 145:64910690c574 6615 * @param[out] pResult maximum value returned here
AnnaBridge 145:64910690c574 6616 * @param[out] pIndex index of maximum value returned here
<> 132:9baf128c2fab 6617 */
<> 132:9baf128c2fab 6618 void arm_max_f32(
<> 132:9baf128c2fab 6619 float32_t * pSrc,
<> 132:9baf128c2fab 6620 uint32_t blockSize,
<> 132:9baf128c2fab 6621 float32_t * pResult,
<> 132:9baf128c2fab 6622 uint32_t * pIndex);
<> 132:9baf128c2fab 6623
AnnaBridge 145:64910690c574 6624
<> 132:9baf128c2fab 6625 /**
<> 132:9baf128c2fab 6626 * @brief Q15 complex-by-complex multiplication
AnnaBridge 145:64910690c574 6627 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6628 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6629 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 6630 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6631 */
<> 132:9baf128c2fab 6632 void arm_cmplx_mult_cmplx_q15(
<> 132:9baf128c2fab 6633 q15_t * pSrcA,
<> 132:9baf128c2fab 6634 q15_t * pSrcB,
<> 132:9baf128c2fab 6635 q15_t * pDst,
<> 132:9baf128c2fab 6636 uint32_t numSamples);
<> 132:9baf128c2fab 6637
AnnaBridge 145:64910690c574 6638
<> 132:9baf128c2fab 6639 /**
<> 132:9baf128c2fab 6640 * @brief Q31 complex-by-complex multiplication
AnnaBridge 145:64910690c574 6641 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6642 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6643 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 6644 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6645 */
<> 132:9baf128c2fab 6646 void arm_cmplx_mult_cmplx_q31(
<> 132:9baf128c2fab 6647 q31_t * pSrcA,
<> 132:9baf128c2fab 6648 q31_t * pSrcB,
<> 132:9baf128c2fab 6649 q31_t * pDst,
<> 132:9baf128c2fab 6650 uint32_t numSamples);
<> 132:9baf128c2fab 6651
AnnaBridge 145:64910690c574 6652
<> 132:9baf128c2fab 6653 /**
<> 132:9baf128c2fab 6654 * @brief Floating-point complex-by-complex multiplication
AnnaBridge 145:64910690c574 6655 * @param[in] pSrcA points to the first input vector
AnnaBridge 145:64910690c574 6656 * @param[in] pSrcB points to the second input vector
AnnaBridge 145:64910690c574 6657 * @param[out] pDst points to the output vector
AnnaBridge 145:64910690c574 6658 * @param[in] numSamples number of complex samples in each vector
AnnaBridge 145:64910690c574 6659 */
<> 132:9baf128c2fab 6660 void arm_cmplx_mult_cmplx_f32(
<> 132:9baf128c2fab 6661 float32_t * pSrcA,
<> 132:9baf128c2fab 6662 float32_t * pSrcB,
<> 132:9baf128c2fab 6663 float32_t * pDst,
<> 132:9baf128c2fab 6664 uint32_t numSamples);
<> 132:9baf128c2fab 6665
AnnaBridge 145:64910690c574 6666
<> 132:9baf128c2fab 6667 /**
<> 132:9baf128c2fab 6668 * @brief Converts the elements of the floating-point vector to Q31 vector.
AnnaBridge 145:64910690c574 6669 * @param[in] pSrc points to the floating-point input vector
AnnaBridge 145:64910690c574 6670 * @param[out] pDst points to the Q31 output vector
AnnaBridge 145:64910690c574 6671 * @param[in] blockSize length of the input vector
<> 132:9baf128c2fab 6672 */
<> 132:9baf128c2fab 6673 void arm_float_to_q31(
<> 132:9baf128c2fab 6674 float32_t * pSrc,
<> 132:9baf128c2fab 6675 q31_t * pDst,
<> 132:9baf128c2fab 6676 uint32_t blockSize);
<> 132:9baf128c2fab 6677
AnnaBridge 145:64910690c574 6678
<> 132:9baf128c2fab 6679 /**
<> 132:9baf128c2fab 6680 * @brief Converts the elements of the floating-point vector to Q15 vector.
AnnaBridge 145:64910690c574 6681 * @param[in] pSrc points to the floating-point input vector
AnnaBridge 145:64910690c574 6682 * @param[out] pDst points to the Q15 output vector
AnnaBridge 145:64910690c574 6683 * @param[in] blockSize length of the input vector
<> 132:9baf128c2fab 6684 */
<> 132:9baf128c2fab 6685 void arm_float_to_q15(
<> 132:9baf128c2fab 6686 float32_t * pSrc,
<> 132:9baf128c2fab 6687 q15_t * pDst,
<> 132:9baf128c2fab 6688 uint32_t blockSize);
<> 132:9baf128c2fab 6689
AnnaBridge 145:64910690c574 6690
<> 132:9baf128c2fab 6691 /**
<> 132:9baf128c2fab 6692 * @brief Converts the elements of the floating-point vector to Q7 vector.
AnnaBridge 145:64910690c574 6693 * @param[in] pSrc points to the floating-point input vector
AnnaBridge 145:64910690c574 6694 * @param[out] pDst points to the Q7 output vector
AnnaBridge 145:64910690c574 6695 * @param[in] blockSize length of the input vector
<> 132:9baf128c2fab 6696 */
<> 132:9baf128c2fab 6697 void arm_float_to_q7(
<> 132:9baf128c2fab 6698 float32_t * pSrc,
<> 132:9baf128c2fab 6699 q7_t * pDst,
<> 132:9baf128c2fab 6700 uint32_t blockSize);
<> 132:9baf128c2fab 6701
<> 132:9baf128c2fab 6702
<> 132:9baf128c2fab 6703 /**
<> 132:9baf128c2fab 6704 * @brief Converts the elements of the Q31 vector to Q15 vector.
AnnaBridge 145:64910690c574 6705 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6706 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 6707 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 6708 */
<> 132:9baf128c2fab 6709 void arm_q31_to_q15(
<> 132:9baf128c2fab 6710 q31_t * pSrc,
<> 132:9baf128c2fab 6711 q15_t * pDst,
<> 132:9baf128c2fab 6712 uint32_t blockSize);
<> 132:9baf128c2fab 6713
AnnaBridge 145:64910690c574 6714
<> 132:9baf128c2fab 6715 /**
<> 132:9baf128c2fab 6716 * @brief Converts the elements of the Q31 vector to Q7 vector.
AnnaBridge 145:64910690c574 6717 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6718 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 6719 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 6720 */
<> 132:9baf128c2fab 6721 void arm_q31_to_q7(
<> 132:9baf128c2fab 6722 q31_t * pSrc,
<> 132:9baf128c2fab 6723 q7_t * pDst,
<> 132:9baf128c2fab 6724 uint32_t blockSize);
<> 132:9baf128c2fab 6725
AnnaBridge 145:64910690c574 6726
<> 132:9baf128c2fab 6727 /**
<> 132:9baf128c2fab 6728 * @brief Converts the elements of the Q15 vector to floating-point vector.
AnnaBridge 145:64910690c574 6729 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6730 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 6731 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 6732 */
<> 132:9baf128c2fab 6733 void arm_q15_to_float(
<> 132:9baf128c2fab 6734 q15_t * pSrc,
<> 132:9baf128c2fab 6735 float32_t * pDst,
<> 132:9baf128c2fab 6736 uint32_t blockSize);
<> 132:9baf128c2fab 6737
<> 132:9baf128c2fab 6738
<> 132:9baf128c2fab 6739 /**
<> 132:9baf128c2fab 6740 * @brief Converts the elements of the Q15 vector to Q31 vector.
AnnaBridge 145:64910690c574 6741 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6742 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 6743 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 6744 */
<> 132:9baf128c2fab 6745 void arm_q15_to_q31(
<> 132:9baf128c2fab 6746 q15_t * pSrc,
<> 132:9baf128c2fab 6747 q31_t * pDst,
<> 132:9baf128c2fab 6748 uint32_t blockSize);
<> 132:9baf128c2fab 6749
<> 132:9baf128c2fab 6750
<> 132:9baf128c2fab 6751 /**
<> 132:9baf128c2fab 6752 * @brief Converts the elements of the Q15 vector to Q7 vector.
AnnaBridge 145:64910690c574 6753 * @param[in] pSrc is input pointer
AnnaBridge 145:64910690c574 6754 * @param[out] pDst is output pointer
AnnaBridge 145:64910690c574 6755 * @param[in] blockSize is the number of samples to process
<> 132:9baf128c2fab 6756 */
<> 132:9baf128c2fab 6757 void arm_q15_to_q7(
<> 132:9baf128c2fab 6758 q15_t * pSrc,
<> 132:9baf128c2fab 6759 q7_t * pDst,
<> 132:9baf128c2fab 6760 uint32_t blockSize);
<> 132:9baf128c2fab 6761
<> 132:9baf128c2fab 6762
<> 132:9baf128c2fab 6763 /**
<> 132:9baf128c2fab 6764 * @ingroup groupInterpolation
<> 132:9baf128c2fab 6765 */
<> 132:9baf128c2fab 6766
<> 132:9baf128c2fab 6767 /**
<> 132:9baf128c2fab 6768 * @defgroup BilinearInterpolate Bilinear Interpolation
<> 132:9baf128c2fab 6769 *
<> 132:9baf128c2fab 6770 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
<> 132:9baf128c2fab 6771 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
<> 132:9baf128c2fab 6772 * determines values between the grid points.
<> 132:9baf128c2fab 6773 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
<> 132:9baf128c2fab 6774 * Bilinear interpolation is often used in image processing to rescale images.
<> 132:9baf128c2fab 6775 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
<> 132:9baf128c2fab 6776 *
<> 132:9baf128c2fab 6777 * <b>Algorithm</b>
<> 132:9baf128c2fab 6778 * \par
<> 132:9baf128c2fab 6779 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
<> 132:9baf128c2fab 6780 * For floating-point, the instance structure is defined as:
<> 132:9baf128c2fab 6781 * <pre>
<> 132:9baf128c2fab 6782 * typedef struct
<> 132:9baf128c2fab 6783 * {
<> 132:9baf128c2fab 6784 * uint16_t numRows;
<> 132:9baf128c2fab 6785 * uint16_t numCols;
<> 132:9baf128c2fab 6786 * float32_t *pData;
<> 132:9baf128c2fab 6787 * } arm_bilinear_interp_instance_f32;
<> 132:9baf128c2fab 6788 * </pre>
<> 132:9baf128c2fab 6789 *
<> 132:9baf128c2fab 6790 * \par
<> 132:9baf128c2fab 6791 * where <code>numRows</code> specifies the number of rows in the table;
<> 132:9baf128c2fab 6792 * <code>numCols</code> specifies the number of columns in the table;
<> 132:9baf128c2fab 6793 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
<> 132:9baf128c2fab 6794 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
<> 132:9baf128c2fab 6795 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
<> 132:9baf128c2fab 6796 *
<> 132:9baf128c2fab 6797 * \par
<> 132:9baf128c2fab 6798 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
<> 132:9baf128c2fab 6799 * <pre>
<> 132:9baf128c2fab 6800 * XF = floor(x)
<> 132:9baf128c2fab 6801 * YF = floor(y)
<> 132:9baf128c2fab 6802 * </pre>
<> 132:9baf128c2fab 6803 * \par
<> 132:9baf128c2fab 6804 * The interpolated output point is computed as:
<> 132:9baf128c2fab 6805 * <pre>
<> 132:9baf128c2fab 6806 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
<> 132:9baf128c2fab 6807 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
<> 132:9baf128c2fab 6808 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
<> 132:9baf128c2fab 6809 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
<> 132:9baf128c2fab 6810 * </pre>
<> 132:9baf128c2fab 6811 * Note that the coordinates (x, y) contain integer and fractional components.
<> 132:9baf128c2fab 6812 * The integer components specify which portion of the table to use while the
<> 132:9baf128c2fab 6813 * fractional components control the interpolation processor.
<> 132:9baf128c2fab 6814 *
<> 132:9baf128c2fab 6815 * \par
<> 132:9baf128c2fab 6816 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
<> 132:9baf128c2fab 6817 */
<> 132:9baf128c2fab 6818
<> 132:9baf128c2fab 6819 /**
<> 132:9baf128c2fab 6820 * @addtogroup BilinearInterpolate
<> 132:9baf128c2fab 6821 * @{
<> 132:9baf128c2fab 6822 */
<> 132:9baf128c2fab 6823
AnnaBridge 145:64910690c574 6824
<> 132:9baf128c2fab 6825 /**
<> 132:9baf128c2fab 6826 *
<> 132:9baf128c2fab 6827 * @brief Floating-point bilinear interpolation.
AnnaBridge 145:64910690c574 6828 * @param[in,out] S points to an instance of the interpolation structure.
AnnaBridge 145:64910690c574 6829 * @param[in] X interpolation coordinate.
AnnaBridge 145:64910690c574 6830 * @param[in] Y interpolation coordinate.
<> 132:9baf128c2fab 6831 * @return out interpolated value.
<> 132:9baf128c2fab 6832 */
AnnaBridge 145:64910690c574 6833 CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32(
<> 132:9baf128c2fab 6834 const arm_bilinear_interp_instance_f32 * S,
<> 132:9baf128c2fab 6835 float32_t X,
<> 132:9baf128c2fab 6836 float32_t Y)
<> 132:9baf128c2fab 6837 {
<> 132:9baf128c2fab 6838 float32_t out;
<> 132:9baf128c2fab 6839 float32_t f00, f01, f10, f11;
<> 132:9baf128c2fab 6840 float32_t *pData = S->pData;
<> 132:9baf128c2fab 6841 int32_t xIndex, yIndex, index;
<> 132:9baf128c2fab 6842 float32_t xdiff, ydiff;
<> 132:9baf128c2fab 6843 float32_t b1, b2, b3, b4;
<> 132:9baf128c2fab 6844
<> 132:9baf128c2fab 6845 xIndex = (int32_t) X;
<> 132:9baf128c2fab 6846 yIndex = (int32_t) Y;
<> 132:9baf128c2fab 6847
<> 132:9baf128c2fab 6848 /* Care taken for table outside boundary */
<> 132:9baf128c2fab 6849 /* Returns zero output when values are outside table boundary */
AnnaBridge 145:64910690c574 6850 if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1))
<> 132:9baf128c2fab 6851 {
<> 132:9baf128c2fab 6852 return (0);
<> 132:9baf128c2fab 6853 }
<> 132:9baf128c2fab 6854
<> 132:9baf128c2fab 6855 /* Calculation of index for two nearest points in X-direction */
<> 132:9baf128c2fab 6856 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
<> 132:9baf128c2fab 6857
<> 132:9baf128c2fab 6858
<> 132:9baf128c2fab 6859 /* Read two nearest points in X-direction */
<> 132:9baf128c2fab 6860 f00 = pData[index];
<> 132:9baf128c2fab 6861 f01 = pData[index + 1];
<> 132:9baf128c2fab 6862
<> 132:9baf128c2fab 6863 /* Calculation of index for two nearest points in Y-direction */
<> 132:9baf128c2fab 6864 index = (xIndex - 1) + (yIndex) * S->numCols;
<> 132:9baf128c2fab 6865
<> 132:9baf128c2fab 6866
<> 132:9baf128c2fab 6867 /* Read two nearest points in Y-direction */
<> 132:9baf128c2fab 6868 f10 = pData[index];
<> 132:9baf128c2fab 6869 f11 = pData[index + 1];
<> 132:9baf128c2fab 6870
<> 132:9baf128c2fab 6871 /* Calculation of intermediate values */
<> 132:9baf128c2fab 6872 b1 = f00;
<> 132:9baf128c2fab 6873 b2 = f01 - f00;
<> 132:9baf128c2fab 6874 b3 = f10 - f00;
<> 132:9baf128c2fab 6875 b4 = f00 - f01 - f10 + f11;
<> 132:9baf128c2fab 6876
<> 132:9baf128c2fab 6877 /* Calculation of fractional part in X */
<> 132:9baf128c2fab 6878 xdiff = X - xIndex;
<> 132:9baf128c2fab 6879
<> 132:9baf128c2fab 6880 /* Calculation of fractional part in Y */
<> 132:9baf128c2fab 6881 ydiff = Y - yIndex;
<> 132:9baf128c2fab 6882
<> 132:9baf128c2fab 6883 /* Calculation of bi-linear interpolated output */
<> 132:9baf128c2fab 6884 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
<> 132:9baf128c2fab 6885
<> 132:9baf128c2fab 6886 /* return to application */
<> 132:9baf128c2fab 6887 return (out);
<> 132:9baf128c2fab 6888 }
<> 132:9baf128c2fab 6889
AnnaBridge 145:64910690c574 6890
<> 132:9baf128c2fab 6891 /**
<> 132:9baf128c2fab 6892 *
<> 132:9baf128c2fab 6893 * @brief Q31 bilinear interpolation.
AnnaBridge 145:64910690c574 6894 * @param[in,out] S points to an instance of the interpolation structure.
AnnaBridge 145:64910690c574 6895 * @param[in] X interpolation coordinate in 12.20 format.
AnnaBridge 145:64910690c574 6896 * @param[in] Y interpolation coordinate in 12.20 format.
<> 132:9baf128c2fab 6897 * @return out interpolated value.
<> 132:9baf128c2fab 6898 */
AnnaBridge 145:64910690c574 6899 CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31(
<> 132:9baf128c2fab 6900 arm_bilinear_interp_instance_q31 * S,
<> 132:9baf128c2fab 6901 q31_t X,
<> 132:9baf128c2fab 6902 q31_t Y)
<> 132:9baf128c2fab 6903 {
<> 132:9baf128c2fab 6904 q31_t out; /* Temporary output */
<> 132:9baf128c2fab 6905 q31_t acc = 0; /* output */
<> 132:9baf128c2fab 6906 q31_t xfract, yfract; /* X, Y fractional parts */
<> 132:9baf128c2fab 6907 q31_t x1, x2, y1, y2; /* Nearest output values */
<> 132:9baf128c2fab 6908 int32_t rI, cI; /* Row and column indices */
<> 132:9baf128c2fab 6909 q31_t *pYData = S->pData; /* pointer to output table values */
<> 132:9baf128c2fab 6910 uint32_t nCols = S->numCols; /* num of rows */
<> 132:9baf128c2fab 6911
AnnaBridge 145:64910690c574 6912 /* Input is in 12.20 format */
AnnaBridge 145:64910690c574 6913 /* 12 bits for the table index */
AnnaBridge 145:64910690c574 6914 /* Index value calculation */
AnnaBridge 145:64910690c574 6915 rI = ((X & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 6916
<> 132:9baf128c2fab 6917 /* Input is in 12.20 format */
<> 132:9baf128c2fab 6918 /* 12 bits for the table index */
<> 132:9baf128c2fab 6919 /* Index value calculation */
AnnaBridge 145:64910690c574 6920 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 6921
<> 132:9baf128c2fab 6922 /* Care taken for table outside boundary */
<> 132:9baf128c2fab 6923 /* Returns zero output when values are outside table boundary */
AnnaBridge 145:64910690c574 6924 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 132:9baf128c2fab 6925 {
<> 132:9baf128c2fab 6926 return (0);
<> 132:9baf128c2fab 6927 }
<> 132:9baf128c2fab 6928
<> 132:9baf128c2fab 6929 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 6930 /* shift left xfract by 11 to keep 1.31 format */
<> 132:9baf128c2fab 6931 xfract = (X & 0x000FFFFF) << 11u;
<> 132:9baf128c2fab 6932
<> 132:9baf128c2fab 6933 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 6934 x1 = pYData[(rI) + (int32_t)nCols * (cI) ];
AnnaBridge 145:64910690c574 6935 x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1];
<> 132:9baf128c2fab 6936
<> 132:9baf128c2fab 6937 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 6938 /* shift left yfract by 11 to keep 1.31 format */
<> 132:9baf128c2fab 6939 yfract = (Y & 0x000FFFFF) << 11u;
<> 132:9baf128c2fab 6940
<> 132:9baf128c2fab 6941 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 6942 y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ];
AnnaBridge 145:64910690c574 6943 y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1];
<> 132:9baf128c2fab 6944
<> 132:9baf128c2fab 6945 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
AnnaBridge 145:64910690c574 6946 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
<> 132:9baf128c2fab 6947 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
<> 132:9baf128c2fab 6948
<> 132:9baf128c2fab 6949 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
<> 132:9baf128c2fab 6950 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
<> 132:9baf128c2fab 6951 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
<> 132:9baf128c2fab 6952
<> 132:9baf128c2fab 6953 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 132:9baf128c2fab 6954 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
<> 132:9baf128c2fab 6955 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 132:9baf128c2fab 6956
<> 132:9baf128c2fab 6957 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 132:9baf128c2fab 6958 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
<> 132:9baf128c2fab 6959 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 132:9baf128c2fab 6960
<> 132:9baf128c2fab 6961 /* Convert acc to 1.31(q31) format */
AnnaBridge 145:64910690c574 6962 return ((q31_t)(acc << 2));
<> 132:9baf128c2fab 6963 }
<> 132:9baf128c2fab 6964
AnnaBridge 145:64910690c574 6965
<> 132:9baf128c2fab 6966 /**
<> 132:9baf128c2fab 6967 * @brief Q15 bilinear interpolation.
AnnaBridge 145:64910690c574 6968 * @param[in,out] S points to an instance of the interpolation structure.
AnnaBridge 145:64910690c574 6969 * @param[in] X interpolation coordinate in 12.20 format.
AnnaBridge 145:64910690c574 6970 * @param[in] Y interpolation coordinate in 12.20 format.
<> 132:9baf128c2fab 6971 * @return out interpolated value.
<> 132:9baf128c2fab 6972 */
AnnaBridge 145:64910690c574 6973 CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(
<> 132:9baf128c2fab 6974 arm_bilinear_interp_instance_q15 * S,
<> 132:9baf128c2fab 6975 q31_t X,
<> 132:9baf128c2fab 6976 q31_t Y)
<> 132:9baf128c2fab 6977 {
<> 132:9baf128c2fab 6978 q63_t acc = 0; /* output */
<> 132:9baf128c2fab 6979 q31_t out; /* Temporary output */
<> 132:9baf128c2fab 6980 q15_t x1, x2, y1, y2; /* Nearest output values */
<> 132:9baf128c2fab 6981 q31_t xfract, yfract; /* X, Y fractional parts */
<> 132:9baf128c2fab 6982 int32_t rI, cI; /* Row and column indices */
<> 132:9baf128c2fab 6983 q15_t *pYData = S->pData; /* pointer to output table values */
<> 132:9baf128c2fab 6984 uint32_t nCols = S->numCols; /* num of rows */
<> 132:9baf128c2fab 6985
<> 132:9baf128c2fab 6986 /* Input is in 12.20 format */
<> 132:9baf128c2fab 6987 /* 12 bits for the table index */
<> 132:9baf128c2fab 6988 /* Index value calculation */
AnnaBridge 145:64910690c574 6989 rI = ((X & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 6990
<> 132:9baf128c2fab 6991 /* Input is in 12.20 format */
<> 132:9baf128c2fab 6992 /* 12 bits for the table index */
<> 132:9baf128c2fab 6993 /* Index value calculation */
AnnaBridge 145:64910690c574 6994 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 6995
<> 132:9baf128c2fab 6996 /* Care taken for table outside boundary */
<> 132:9baf128c2fab 6997 /* Returns zero output when values are outside table boundary */
AnnaBridge 145:64910690c574 6998 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 132:9baf128c2fab 6999 {
<> 132:9baf128c2fab 7000 return (0);
<> 132:9baf128c2fab 7001 }
<> 132:9baf128c2fab 7002
<> 132:9baf128c2fab 7003 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 7004 /* xfract should be in 12.20 format */
<> 132:9baf128c2fab 7005 xfract = (X & 0x000FFFFF);
<> 132:9baf128c2fab 7006
<> 132:9baf128c2fab 7007 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 7008 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
AnnaBridge 145:64910690c574 7009 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
<> 132:9baf128c2fab 7010
<> 132:9baf128c2fab 7011 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 7012 /* yfract should be in 12.20 format */
<> 132:9baf128c2fab 7013 yfract = (Y & 0x000FFFFF);
<> 132:9baf128c2fab 7014
<> 132:9baf128c2fab 7015 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 7016 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
AnnaBridge 145:64910690c574 7017 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
<> 132:9baf128c2fab 7018
<> 132:9baf128c2fab 7019 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
<> 132:9baf128c2fab 7020
<> 132:9baf128c2fab 7021 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
<> 132:9baf128c2fab 7022 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
<> 132:9baf128c2fab 7023 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
<> 132:9baf128c2fab 7024 acc = ((q63_t) out * (0xFFFFF - yfract));
<> 132:9baf128c2fab 7025
<> 132:9baf128c2fab 7026 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
<> 132:9baf128c2fab 7027 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
<> 132:9baf128c2fab 7028 acc += ((q63_t) out * (xfract));
<> 132:9baf128c2fab 7029
<> 132:9baf128c2fab 7030 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
<> 132:9baf128c2fab 7031 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
<> 132:9baf128c2fab 7032 acc += ((q63_t) out * (yfract));
<> 132:9baf128c2fab 7033
<> 132:9baf128c2fab 7034 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
<> 132:9baf128c2fab 7035 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
<> 132:9baf128c2fab 7036 acc += ((q63_t) out * (yfract));
<> 132:9baf128c2fab 7037
<> 132:9baf128c2fab 7038 /* acc is in 13.51 format and down shift acc by 36 times */
<> 132:9baf128c2fab 7039 /* Convert out to 1.15 format */
AnnaBridge 145:64910690c574 7040 return ((q15_t)(acc >> 36));
<> 132:9baf128c2fab 7041 }
<> 132:9baf128c2fab 7042
AnnaBridge 145:64910690c574 7043
<> 132:9baf128c2fab 7044 /**
<> 132:9baf128c2fab 7045 * @brief Q7 bilinear interpolation.
AnnaBridge 145:64910690c574 7046 * @param[in,out] S points to an instance of the interpolation structure.
AnnaBridge 145:64910690c574 7047 * @param[in] X interpolation coordinate in 12.20 format.
AnnaBridge 145:64910690c574 7048 * @param[in] Y interpolation coordinate in 12.20 format.
<> 132:9baf128c2fab 7049 * @return out interpolated value.
<> 132:9baf128c2fab 7050 */
AnnaBridge 145:64910690c574 7051 CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7(
<> 132:9baf128c2fab 7052 arm_bilinear_interp_instance_q7 * S,
<> 132:9baf128c2fab 7053 q31_t X,
<> 132:9baf128c2fab 7054 q31_t Y)
<> 132:9baf128c2fab 7055 {
<> 132:9baf128c2fab 7056 q63_t acc = 0; /* output */
<> 132:9baf128c2fab 7057 q31_t out; /* Temporary output */
<> 132:9baf128c2fab 7058 q31_t xfract, yfract; /* X, Y fractional parts */
<> 132:9baf128c2fab 7059 q7_t x1, x2, y1, y2; /* Nearest output values */
<> 132:9baf128c2fab 7060 int32_t rI, cI; /* Row and column indices */
<> 132:9baf128c2fab 7061 q7_t *pYData = S->pData; /* pointer to output table values */
<> 132:9baf128c2fab 7062 uint32_t nCols = S->numCols; /* num of rows */
<> 132:9baf128c2fab 7063
<> 132:9baf128c2fab 7064 /* Input is in 12.20 format */
<> 132:9baf128c2fab 7065 /* 12 bits for the table index */
<> 132:9baf128c2fab 7066 /* Index value calculation */
AnnaBridge 145:64910690c574 7067 rI = ((X & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 7068
<> 132:9baf128c2fab 7069 /* Input is in 12.20 format */
<> 132:9baf128c2fab 7070 /* 12 bits for the table index */
<> 132:9baf128c2fab 7071 /* Index value calculation */
AnnaBridge 145:64910690c574 7072 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 132:9baf128c2fab 7073
<> 132:9baf128c2fab 7074 /* Care taken for table outside boundary */
<> 132:9baf128c2fab 7075 /* Returns zero output when values are outside table boundary */
AnnaBridge 145:64910690c574 7076 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 132:9baf128c2fab 7077 {
<> 132:9baf128c2fab 7078 return (0);
<> 132:9baf128c2fab 7079 }
<> 132:9baf128c2fab 7080
<> 132:9baf128c2fab 7081 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 7082 /* xfract should be in 12.20 format */
AnnaBridge 145:64910690c574 7083 xfract = (X & (q31_t)0x000FFFFF);
<> 132:9baf128c2fab 7084
<> 132:9baf128c2fab 7085 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 7086 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
AnnaBridge 145:64910690c574 7087 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
<> 132:9baf128c2fab 7088
<> 132:9baf128c2fab 7089 /* 20 bits for the fractional part */
<> 132:9baf128c2fab 7090 /* yfract should be in 12.20 format */
AnnaBridge 145:64910690c574 7091 yfract = (Y & (q31_t)0x000FFFFF);
<> 132:9baf128c2fab 7092
<> 132:9baf128c2fab 7093 /* Read two nearest output values from the index */
AnnaBridge 145:64910690c574 7094 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
AnnaBridge 145:64910690c574 7095 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
<> 132:9baf128c2fab 7096
<> 132:9baf128c2fab 7097 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
<> 132:9baf128c2fab 7098 out = ((x1 * (0xFFFFF - xfract)));
<> 132:9baf128c2fab 7099 acc = (((q63_t) out * (0xFFFFF - yfract)));
<> 132:9baf128c2fab 7100
<> 132:9baf128c2fab 7101 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
<> 132:9baf128c2fab 7102 out = ((x2 * (0xFFFFF - yfract)));
<> 132:9baf128c2fab 7103 acc += (((q63_t) out * (xfract)));
<> 132:9baf128c2fab 7104
<> 132:9baf128c2fab 7105 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
<> 132:9baf128c2fab 7106 out = ((y1 * (0xFFFFF - xfract)));
<> 132:9baf128c2fab 7107 acc += (((q63_t) out * (yfract)));
<> 132:9baf128c2fab 7108
<> 132:9baf128c2fab 7109 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
<> 132:9baf128c2fab 7110 out = ((y2 * (yfract)));
<> 132:9baf128c2fab 7111 acc += (((q63_t) out * (xfract)));
<> 132:9baf128c2fab 7112
<> 132:9baf128c2fab 7113 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
AnnaBridge 145:64910690c574 7114 return ((q7_t)(acc >> 40));
<> 132:9baf128c2fab 7115 }
<> 132:9baf128c2fab 7116
<> 132:9baf128c2fab 7117 /**
<> 132:9baf128c2fab 7118 * @} end of BilinearInterpolate group
<> 132:9baf128c2fab 7119 */
AnnaBridge 145:64910690c574 7120
AnnaBridge 145:64910690c574 7121
AnnaBridge 145:64910690c574 7122 /* SMMLAR */
<> 132:9baf128c2fab 7123 #define multAcc_32x32_keep32_R(a, x, y) \
<> 132:9baf128c2fab 7124 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 132:9baf128c2fab 7125
AnnaBridge 145:64910690c574 7126 /* SMMLSR */
<> 132:9baf128c2fab 7127 #define multSub_32x32_keep32_R(a, x, y) \
<> 132:9baf128c2fab 7128 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 132:9baf128c2fab 7129
AnnaBridge 145:64910690c574 7130 /* SMMULR */
<> 132:9baf128c2fab 7131 #define mult_32x32_keep32_R(a, x, y) \
<> 132:9baf128c2fab 7132 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
<> 132:9baf128c2fab 7133
AnnaBridge 145:64910690c574 7134 /* SMMLA */
<> 132:9baf128c2fab 7135 #define multAcc_32x32_keep32(a, x, y) \
<> 132:9baf128c2fab 7136 a += (q31_t) (((q63_t) x * y) >> 32)
<> 132:9baf128c2fab 7137
AnnaBridge 145:64910690c574 7138 /* SMMLS */
<> 132:9baf128c2fab 7139 #define multSub_32x32_keep32(a, x, y) \
<> 132:9baf128c2fab 7140 a -= (q31_t) (((q63_t) x * y) >> 32)
<> 132:9baf128c2fab 7141
AnnaBridge 145:64910690c574 7142 /* SMMUL */
<> 132:9baf128c2fab 7143 #define mult_32x32_keep32(a, x, y) \
<> 132:9baf128c2fab 7144 a = (q31_t) (((q63_t) x * y ) >> 32)
<> 132:9baf128c2fab 7145
<> 132:9baf128c2fab 7146
AnnaBridge 145:64910690c574 7147 #if defined ( __CC_ARM )
AnnaBridge 145:64910690c574 7148 /* Enter low optimization region - place directly above function definition */
AnnaBridge 145:64910690c574 7149 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
AnnaBridge 145:64910690c574 7150 #define LOW_OPTIMIZATION_ENTER \
AnnaBridge 145:64910690c574 7151 _Pragma ("push") \
AnnaBridge 145:64910690c574 7152 _Pragma ("O1")
AnnaBridge 145:64910690c574 7153 #else
AnnaBridge 145:64910690c574 7154 #define LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7155 #endif
AnnaBridge 145:64910690c574 7156
AnnaBridge 145:64910690c574 7157 /* Exit low optimization region - place directly after end of function definition */
AnnaBridge 145:64910690c574 7158 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 )
AnnaBridge 145:64910690c574 7159 #define LOW_OPTIMIZATION_EXIT \
AnnaBridge 145:64910690c574 7160 _Pragma ("pop")
AnnaBridge 145:64910690c574 7161 #else
AnnaBridge 145:64910690c574 7162 #define LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7163 #endif
AnnaBridge 145:64910690c574 7164
AnnaBridge 145:64910690c574 7165 /* Enter low optimization region - place directly above function definition */
<> 132:9baf128c2fab 7166 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 132:9baf128c2fab 7167
AnnaBridge 145:64910690c574 7168 /* Exit low optimization region - place directly after end of function definition */
AnnaBridge 145:64910690c574 7169 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7170
AnnaBridge 145:64910690c574 7171 #elif defined (__ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 )
AnnaBridge 145:64910690c574 7172 #define LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7173 #define LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7174 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7175 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7176
AnnaBridge 145:64910690c574 7177 #elif defined ( __GNUC__ )
AnnaBridge 145:64910690c574 7178 #define LOW_OPTIMIZATION_ENTER \
AnnaBridge 145:64910690c574 7179 __attribute__(( optimize("-O1") ))
AnnaBridge 145:64910690c574 7180 #define LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7181 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 132:9baf128c2fab 7182 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7183
AnnaBridge 145:64910690c574 7184 #elif defined ( __ICCARM__ )
AnnaBridge 145:64910690c574 7185 /* Enter low optimization region - place directly above function definition */
AnnaBridge 145:64910690c574 7186 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 )
AnnaBridge 145:64910690c574 7187 #define LOW_OPTIMIZATION_ENTER \
AnnaBridge 145:64910690c574 7188 _Pragma ("optimize=low")
AnnaBridge 145:64910690c574 7189 #else
AnnaBridge 145:64910690c574 7190 #define LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7191 #endif
AnnaBridge 145:64910690c574 7192
AnnaBridge 145:64910690c574 7193 /* Exit low optimization region - place directly after end of function definition */
<> 132:9baf128c2fab 7194 #define LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7195
AnnaBridge 145:64910690c574 7196 /* Enter low optimization region - place directly above function definition */
AnnaBridge 145:64910690c574 7197 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 )
AnnaBridge 145:64910690c574 7198 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
AnnaBridge 145:64910690c574 7199 _Pragma ("optimize=low")
AnnaBridge 145:64910690c574 7200 #else
AnnaBridge 145:64910690c574 7201 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7202 #endif
AnnaBridge 145:64910690c574 7203
AnnaBridge 145:64910690c574 7204 /* Exit low optimization region - place directly after end of function definition */
<> 132:9baf128c2fab 7205 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7206
AnnaBridge 145:64910690c574 7207 #elif defined ( __TI_ARM__ )
AnnaBridge 145:64910690c574 7208 #define LOW_OPTIMIZATION_ENTER
<> 132:9baf128c2fab 7209 #define LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7210 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 132:9baf128c2fab 7211 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7212
AnnaBridge 145:64910690c574 7213 #elif defined ( __CSMC__ )
AnnaBridge 145:64910690c574 7214 #define LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7215 #define LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7216 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7217 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7218
AnnaBridge 145:64910690c574 7219 #elif defined ( __TASKING__ )
AnnaBridge 145:64910690c574 7220 #define LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7221 #define LOW_OPTIMIZATION_EXIT
AnnaBridge 145:64910690c574 7222 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
AnnaBridge 145:64910690c574 7223 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 132:9baf128c2fab 7224
<> 132:9baf128c2fab 7225 #endif
<> 132:9baf128c2fab 7226
<> 132:9baf128c2fab 7227
AnnaBridge 145:64910690c574 7228 #ifdef __cplusplus
<> 132:9baf128c2fab 7229 }
<> 132:9baf128c2fab 7230 #endif
<> 132:9baf128c2fab 7231
AnnaBridge 145:64910690c574 7232 /* Compiler specific diagnostic adjustment */
AnnaBridge 145:64910690c574 7233 #if defined ( __CC_ARM )
AnnaBridge 145:64910690c574 7234
AnnaBridge 145:64910690c574 7235 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 )
AnnaBridge 145:64910690c574 7236
AnnaBridge 145:64910690c574 7237 #elif defined ( __GNUC__ )
AnnaBridge 145:64910690c574 7238 #pragma GCC diagnostic pop
AnnaBridge 145:64910690c574 7239
AnnaBridge 145:64910690c574 7240 #elif defined ( __ICCARM__ )
AnnaBridge 145:64910690c574 7241
AnnaBridge 145:64910690c574 7242 #elif defined ( __TI_ARM__ )
AnnaBridge 145:64910690c574 7243
AnnaBridge 145:64910690c574 7244 #elif defined ( __CSMC__ )
AnnaBridge 145:64910690c574 7245
AnnaBridge 145:64910690c574 7246 #elif defined ( __TASKING__ )
AnnaBridge 145:64910690c574 7247
AnnaBridge 145:64910690c574 7248 #else
AnnaBridge 145:64910690c574 7249 #error Unknown compiler
AnnaBridge 145:64910690c574 7250 #endif
<> 132:9baf128c2fab 7251
<> 132:9baf128c2fab 7252 #endif /* _ARM_MATH_H */
<> 132:9baf128c2fab 7253
<> 132:9baf128c2fab 7254 /**
<> 132:9baf128c2fab 7255 *
<> 132:9baf128c2fab 7256 * End of file.
<> 132:9baf128c2fab 7257 */