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:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
145:64910690c574
Release 147 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 28
<> 140:97feb9bacc10 29 /**
<> 140:97feb9bacc10 30 \mainpage CMSIS DSP Software Library
<> 140:97feb9bacc10 31 *
<> 140:97feb9bacc10 32 * Introduction
<> 140:97feb9bacc10 33 * ------------
<> 140:97feb9bacc10 34 *
<> 140:97feb9bacc10 35 * This user manual describes the CMSIS DSP software library,
<> 140:97feb9bacc10 36 * a suite of common signal processing functions for use on Cortex-M processor based devices.
<> 140:97feb9bacc10 37 *
<> 140:97feb9bacc10 38 * The library is divided into a number of functions each covering a specific category:
<> 140:97feb9bacc10 39 * - Basic math functions
<> 140:97feb9bacc10 40 * - Fast math functions
<> 140:97feb9bacc10 41 * - Complex math functions
<> 140:97feb9bacc10 42 * - Filters
<> 140:97feb9bacc10 43 * - Matrix functions
<> 140:97feb9bacc10 44 * - Transforms
<> 140:97feb9bacc10 45 * - Motor control functions
<> 140:97feb9bacc10 46 * - Statistical functions
<> 140:97feb9bacc10 47 * - Support functions
<> 140:97feb9bacc10 48 * - Interpolation functions
<> 140:97feb9bacc10 49 *
<> 140:97feb9bacc10 50 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
<> 140:97feb9bacc10 51 * 32-bit integer and 32-bit floating-point values.
<> 140:97feb9bacc10 52 *
<> 140:97feb9bacc10 53 * Using the Library
<> 140:97feb9bacc10 54 * ------------
<> 140:97feb9bacc10 55 *
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 76 *
<> 140:97feb9bacc10 77 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 80 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
<> 140:97feb9bacc10 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 *
<> 140:97feb9bacc10 85 *
<> 140:97feb9bacc10 86 * Examples
<> 140:97feb9bacc10 87 * --------
<> 140:97feb9bacc10 88 *
<> 140:97feb9bacc10 89 * The library ships with a number of examples which demonstrate how to use the library functions.
<> 140:97feb9bacc10 90 *
<> 140:97feb9bacc10 91 * Toolchain Support
<> 140:97feb9bacc10 92 * ------------
<> 140:97feb9bacc10 93 *
<> 140:97feb9bacc10 94 * The library has been developed and tested with MDK-ARM version 5.14.0.0
<> 140:97feb9bacc10 95 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
<> 140:97feb9bacc10 96 *
<> 140:97feb9bacc10 97 * Building the Library
<> 140:97feb9bacc10 98 * ------------
<> 140:97feb9bacc10 99 *
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 101 * - arm_cortexM_math.uvprojx
<> 140:97feb9bacc10 102 *
<> 140:97feb9bacc10 103 *
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 105 *
<> 140:97feb9bacc10 106 * Pre-processor Macros
<> 140:97feb9bacc10 107 * ------------
<> 140:97feb9bacc10 108 *
<> 140:97feb9bacc10 109 * Each library project have differant pre-processor macros.
<> 140:97feb9bacc10 110 *
<> 140:97feb9bacc10 111 * - UNALIGNED_SUPPORT_DISABLE:
<> 140:97feb9bacc10 112 *
<> 140:97feb9bacc10 113 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
<> 140:97feb9bacc10 114 *
<> 140:97feb9bacc10 115 * - ARM_MATH_BIG_ENDIAN:
<> 140:97feb9bacc10 116 *
<> 140:97feb9bacc10 117 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
<> 140:97feb9bacc10 118 *
<> 140:97feb9bacc10 119 * - ARM_MATH_MATRIX_CHECK:
<> 140:97feb9bacc10 120 *
<> 140:97feb9bacc10 121 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
<> 140:97feb9bacc10 122 *
<> 140:97feb9bacc10 123 * - ARM_MATH_ROUNDING:
<> 140:97feb9bacc10 124 *
<> 140:97feb9bacc10 125 * Define macro ARM_MATH_ROUNDING for rounding on support functions
<> 140:97feb9bacc10 126 *
<> 140:97feb9bacc10 127 * - ARM_MATH_CMx:
<> 140:97feb9bacc10 128 *
<> 140:97feb9bacc10 129 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
<> 140:97feb9bacc10 130 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
<> 140:97feb9bacc10 131 * ARM_MATH_CM7 for building the library on cortex-M7.
<> 140:97feb9bacc10 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 *
<> 140:97feb9bacc10 138 * - __FPU_PRESENT:
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 145 *
<> 140:97feb9bacc10 146 * <hr>
<> 140:97feb9bacc10 147 * CMSIS-DSP in ARM::CMSIS Pack
<> 140:97feb9bacc10 148 * -----------------------------
AnnaBridge 145:64910690c574 149 *
<> 140:97feb9bacc10 150 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
<> 140:97feb9bacc10 151 * |File/Folder |Content |
<> 140:97feb9bacc10 152 * |------------------------------|------------------------------------------------------------------------|
<> 140:97feb9bacc10 153 * |\b CMSIS\\Documentation\\DSP | This documentation |
<> 140:97feb9bacc10 154 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
<> 140:97feb9bacc10 155 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
<> 140:97feb9bacc10 156 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
AnnaBridge 145:64910690c574 157 *
<> 140:97feb9bacc10 158 * <hr>
<> 140:97feb9bacc10 159 * Revision History of CMSIS-DSP
<> 140:97feb9bacc10 160 * ------------
<> 140:97feb9bacc10 161 * Please refer to \ref ChangeLog_pg.
<> 140:97feb9bacc10 162 *
<> 140:97feb9bacc10 163 * Copyright Notice
<> 140:97feb9bacc10 164 * ------------
<> 140:97feb9bacc10 165 *
<> 140:97feb9bacc10 166 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 140:97feb9bacc10 167 */
<> 140:97feb9bacc10 168
<> 140:97feb9bacc10 169
<> 140:97feb9bacc10 170 /**
<> 140:97feb9bacc10 171 * @defgroup groupMath Basic Math Functions
<> 140:97feb9bacc10 172 */
<> 140:97feb9bacc10 173
<> 140:97feb9bacc10 174 /**
<> 140:97feb9bacc10 175 * @defgroup groupFastMath Fast Math Functions
<> 140:97feb9bacc10 176 * This set of functions provides a fast approximation to sine, cosine, and square root.
<> 140:97feb9bacc10 177 * As compared to most of the other functions in the CMSIS math library, the fast math functions
<> 140:97feb9bacc10 178 * operate on individual values and not arrays.
<> 140:97feb9bacc10 179 * There are separate functions for Q15, Q31, and floating-point data.
<> 140:97feb9bacc10 180 *
<> 140:97feb9bacc10 181 */
<> 140:97feb9bacc10 182
<> 140:97feb9bacc10 183 /**
<> 140:97feb9bacc10 184 * @defgroup groupCmplxMath Complex Math Functions
<> 140:97feb9bacc10 185 * This set of functions operates on complex data vectors.
<> 140:97feb9bacc10 186 * The data in the complex arrays is stored in an interleaved fashion
<> 140:97feb9bacc10 187 * (real, imag, real, imag, ...).
<> 140:97feb9bacc10 188 * In the API functions, the number of samples in a complex array refers
<> 140:97feb9bacc10 189 * to the number of complex values; the array contains twice this number of
<> 140:97feb9bacc10 190 * real values.
<> 140:97feb9bacc10 191 */
<> 140:97feb9bacc10 192
<> 140:97feb9bacc10 193 /**
<> 140:97feb9bacc10 194 * @defgroup groupFilters Filtering Functions
<> 140:97feb9bacc10 195 */
<> 140:97feb9bacc10 196
<> 140:97feb9bacc10 197 /**
<> 140:97feb9bacc10 198 * @defgroup groupMatrix Matrix Functions
<> 140:97feb9bacc10 199 *
<> 140:97feb9bacc10 200 * This set of functions provides basic matrix math operations.
<> 140:97feb9bacc10 201 * The functions operate on matrix data structures. For example,
<> 140:97feb9bacc10 202 * the type
<> 140:97feb9bacc10 203 * definition for the floating-point matrix structure is shown
<> 140:97feb9bacc10 204 * below:
<> 140:97feb9bacc10 205 * <pre>
<> 140:97feb9bacc10 206 * typedef struct
<> 140:97feb9bacc10 207 * {
<> 140:97feb9bacc10 208 * uint16_t numRows; // number of rows of the matrix.
<> 140:97feb9bacc10 209 * uint16_t numCols; // number of columns of the matrix.
<> 140:97feb9bacc10 210 * float32_t *pData; // points to the data of the matrix.
<> 140:97feb9bacc10 211 * } arm_matrix_instance_f32;
<> 140:97feb9bacc10 212 * </pre>
<> 140:97feb9bacc10 213 * There are similar definitions for Q15 and Q31 data types.
<> 140:97feb9bacc10 214 *
<> 140:97feb9bacc10 215 * The structure specifies the size of the matrix and then points to
<> 140:97feb9bacc10 216 * an array of data. The array is of size <code>numRows X numCols</code>
<> 140:97feb9bacc10 217 * and the values are arranged in row order. That is, the
<> 140:97feb9bacc10 218 * matrix element (i, j) is stored at:
<> 140:97feb9bacc10 219 * <pre>
<> 140:97feb9bacc10 220 * pData[i*numCols + j]
<> 140:97feb9bacc10 221 * </pre>
<> 140:97feb9bacc10 222 *
<> 140:97feb9bacc10 223 * \par Init Functions
<> 140:97feb9bacc10 224 * There is an associated initialization function for each type of matrix
<> 140:97feb9bacc10 225 * data structure.
<> 140:97feb9bacc10 226 * The initialization function sets the values of the internal structure fields.
<> 140:97feb9bacc10 227 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
<> 140:97feb9bacc10 228 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
<> 140:97feb9bacc10 229 *
<> 140:97feb9bacc10 230 * \par
<> 140:97feb9bacc10 231 * Use of the initialization function is optional. However, if initialization function is used
<> 140:97feb9bacc10 232 * then the instance structure cannot be placed into a const data section.
<> 140:97feb9bacc10 233 * To place the instance structure in a const data
<> 140:97feb9bacc10 234 * section, manually initialize the data structure. For example:
<> 140:97feb9bacc10 235 * <pre>
<> 140:97feb9bacc10 236 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
<> 140:97feb9bacc10 237 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
<> 140:97feb9bacc10 238 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
<> 140:97feb9bacc10 239 * </pre>
<> 140:97feb9bacc10 240 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
<> 140:97feb9bacc10 241 * specifies the number of columns, and <code>pData</code> points to the
<> 140:97feb9bacc10 242 * data array.
<> 140:97feb9bacc10 243 *
<> 140:97feb9bacc10 244 * \par Size Checking
<> 140:97feb9bacc10 245 * By default all of the matrix functions perform size checking on the input and
<> 140:97feb9bacc10 246 * output matrices. For example, the matrix addition function verifies that the
<> 140:97feb9bacc10 247 * two input matrices and the output matrix all have the same number of rows and
<> 140:97feb9bacc10 248 * columns. If the size check fails the functions return:
<> 140:97feb9bacc10 249 * <pre>
<> 140:97feb9bacc10 250 * ARM_MATH_SIZE_MISMATCH
<> 140:97feb9bacc10 251 * </pre>
<> 140:97feb9bacc10 252 * Otherwise the functions return
<> 140:97feb9bacc10 253 * <pre>
<> 140:97feb9bacc10 254 * ARM_MATH_SUCCESS
<> 140:97feb9bacc10 255 * </pre>
<> 140:97feb9bacc10 256 * There is some overhead associated with this matrix size checking.
<> 140:97feb9bacc10 257 * The matrix size checking is enabled via the \#define
<> 140:97feb9bacc10 258 * <pre>
<> 140:97feb9bacc10 259 * ARM_MATH_MATRIX_CHECK
<> 140:97feb9bacc10 260 * </pre>
<> 140:97feb9bacc10 261 * within the library project settings. By default this macro is defined
<> 140:97feb9bacc10 262 * and size checking is enabled. By changing the project settings and
<> 140:97feb9bacc10 263 * undefining this macro size checking is eliminated and the functions
<> 140:97feb9bacc10 264 * run a bit faster. With size checking disabled the functions always
<> 140:97feb9bacc10 265 * return <code>ARM_MATH_SUCCESS</code>.
<> 140:97feb9bacc10 266 */
<> 140:97feb9bacc10 267
<> 140:97feb9bacc10 268 /**
<> 140:97feb9bacc10 269 * @defgroup groupTransforms Transform Functions
<> 140:97feb9bacc10 270 */
<> 140:97feb9bacc10 271
<> 140:97feb9bacc10 272 /**
<> 140:97feb9bacc10 273 * @defgroup groupController Controller Functions
<> 140:97feb9bacc10 274 */
<> 140:97feb9bacc10 275
<> 140:97feb9bacc10 276 /**
<> 140:97feb9bacc10 277 * @defgroup groupStats Statistics Functions
<> 140:97feb9bacc10 278 */
<> 140:97feb9bacc10 279 /**
<> 140:97feb9bacc10 280 * @defgroup groupSupport Support Functions
<> 140:97feb9bacc10 281 */
<> 140:97feb9bacc10 282
<> 140:97feb9bacc10 283 /**
<> 140:97feb9bacc10 284 * @defgroup groupInterpolation Interpolation Functions
<> 140:97feb9bacc10 285 * These functions perform 1- and 2-dimensional interpolation of data.
<> 140:97feb9bacc10 286 * Linear interpolation is used for 1-dimensional data and
<> 140:97feb9bacc10 287 * bilinear interpolation is used for 2-dimensional data.
<> 140:97feb9bacc10 288 */
<> 140:97feb9bacc10 289
<> 140:97feb9bacc10 290 /**
<> 140:97feb9bacc10 291 * @defgroup groupExamples Examples
<> 140:97feb9bacc10 292 */
<> 140:97feb9bacc10 293 #ifndef _ARM_MATH_H
<> 140:97feb9bacc10 294 #define _ARM_MATH_H
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 320 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
<> 140:97feb9bacc10 321
<> 140:97feb9bacc10 322 #if defined(ARM_MATH_CM7)
<> 140:97feb9bacc10 323 #include "core_cm7.h"
AnnaBridge 145:64910690c574 324 #define ARM_MATH_DSP
<> 140:97feb9bacc10 325 #elif defined (ARM_MATH_CM4)
<> 140:97feb9bacc10 326 #include "core_cm4.h"
AnnaBridge 145:64910690c574 327 #define ARM_MATH_DSP
<> 140:97feb9bacc10 328 #elif defined (ARM_MATH_CM3)
<> 140:97feb9bacc10 329 #include "core_cm3.h"
<> 140:97feb9bacc10 330 #elif defined (ARM_MATH_CM0)
<> 140:97feb9bacc10 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"
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 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"
<> 140:97feb9bacc10 346 #endif
<> 140:97feb9bacc10 347
<> 140:97feb9bacc10 348 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
<> 140:97feb9bacc10 349 #include "string.h"
<> 140:97feb9bacc10 350 #include "math.h"
AnnaBridge 145:64910690c574 351 #ifdef __cplusplus
<> 140:97feb9bacc10 352 extern "C"
<> 140:97feb9bacc10 353 {
<> 140:97feb9bacc10 354 #endif
<> 140:97feb9bacc10 355
<> 140:97feb9bacc10 356
<> 140:97feb9bacc10 357 /**
<> 140:97feb9bacc10 358 * @brief Macros required for reciprocal calculation in Normalized LMS
<> 140:97feb9bacc10 359 */
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 364 #ifndef PI
AnnaBridge 145:64910690c574 365 #define PI 3.14159265358979f
<> 140:97feb9bacc10 366 #endif
<> 140:97feb9bacc10 367
<> 140:97feb9bacc10 368 /**
<> 140:97feb9bacc10 369 * @brief Macros required for SINE and COSINE Fast math approximations
<> 140:97feb9bacc10 370 */
<> 140:97feb9bacc10 371
<> 140:97feb9bacc10 372 #define FAST_MATH_TABLE_SIZE 512
<> 140:97feb9bacc10 373 #define FAST_MATH_Q31_SHIFT (32 - 10)
<> 140:97feb9bacc10 374 #define FAST_MATH_Q15_SHIFT (16 - 10)
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 378
<> 140:97feb9bacc10 379 /**
<> 140:97feb9bacc10 380 * @brief Macros required for SINE and COSINE Controller functions
<> 140:97feb9bacc10 381 */
<> 140:97feb9bacc10 382 /* 1.31(q31) Fixed value of 2/360 */
<> 140:97feb9bacc10 383 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
AnnaBridge 145:64910690c574 384 #define INPUT_SPACING 0xB60B61
<> 140:97feb9bacc10 385
<> 140:97feb9bacc10 386 /**
<> 140:97feb9bacc10 387 * @brief Macro for Unaligned Support
<> 140:97feb9bacc10 388 */
<> 140:97feb9bacc10 389 #ifndef UNALIGNED_SUPPORT_DISABLE
<> 140:97feb9bacc10 390 #define ALIGN4
<> 140:97feb9bacc10 391 #else
<> 140:97feb9bacc10 392 #if defined (__GNUC__)
<> 140:97feb9bacc10 393 #define ALIGN4 __attribute__((aligned(4)))
<> 140:97feb9bacc10 394 #else
<> 140:97feb9bacc10 395 #define ALIGN4 __align(4)
<> 140:97feb9bacc10 396 #endif
AnnaBridge 145:64910690c574 397 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
<> 140:97feb9bacc10 398
<> 140:97feb9bacc10 399 /**
<> 140:97feb9bacc10 400 * @brief Error status returned by some functions in the library.
<> 140:97feb9bacc10 401 */
<> 140:97feb9bacc10 402
<> 140:97feb9bacc10 403 typedef enum
<> 140:97feb9bacc10 404 {
<> 140:97feb9bacc10 405 ARM_MATH_SUCCESS = 0, /**< No error */
<> 140:97feb9bacc10 406 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
<> 140:97feb9bacc10 407 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
<> 140:97feb9bacc10 408 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
<> 140:97feb9bacc10 409 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
<> 140:97feb9bacc10 410 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
<> 140:97feb9bacc10 411 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
<> 140:97feb9bacc10 412 } arm_status;
<> 140:97feb9bacc10 413
<> 140:97feb9bacc10 414 /**
<> 140:97feb9bacc10 415 * @brief 8-bit fractional data type in 1.7 format.
<> 140:97feb9bacc10 416 */
<> 140:97feb9bacc10 417 typedef int8_t q7_t;
<> 140:97feb9bacc10 418
<> 140:97feb9bacc10 419 /**
<> 140:97feb9bacc10 420 * @brief 16-bit fractional data type in 1.15 format.
<> 140:97feb9bacc10 421 */
<> 140:97feb9bacc10 422 typedef int16_t q15_t;
<> 140:97feb9bacc10 423
<> 140:97feb9bacc10 424 /**
<> 140:97feb9bacc10 425 * @brief 32-bit fractional data type in 1.31 format.
<> 140:97feb9bacc10 426 */
<> 140:97feb9bacc10 427 typedef int32_t q31_t;
<> 140:97feb9bacc10 428
<> 140:97feb9bacc10 429 /**
<> 140:97feb9bacc10 430 * @brief 64-bit fractional data type in 1.63 format.
<> 140:97feb9bacc10 431 */
<> 140:97feb9bacc10 432 typedef int64_t q63_t;
<> 140:97feb9bacc10 433
<> 140:97feb9bacc10 434 /**
<> 140:97feb9bacc10 435 * @brief 32-bit floating-point type definition.
<> 140:97feb9bacc10 436 */
<> 140:97feb9bacc10 437 typedef float float32_t;
<> 140:97feb9bacc10 438
<> 140:97feb9bacc10 439 /**
<> 140:97feb9bacc10 440 * @brief 64-bit floating-point type definition.
<> 140:97feb9bacc10 441 */
<> 140:97feb9bacc10 442 typedef double float64_t;
<> 140:97feb9bacc10 443
<> 140:97feb9bacc10 444 /**
<> 140:97feb9bacc10 445 * @brief definition to read/write two 16 bit values.
<> 140:97feb9bacc10 446 */
AnnaBridge 145:64910690c574 447 #if defined ( __CC_ARM )
<> 140:97feb9bacc10 448 #define __SIMD32_TYPE int32_t __packed
<> 140:97feb9bacc10 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__ )
<> 140:97feb9bacc10 463 #define __SIMD32_TYPE int32_t __packed
<> 140:97feb9bacc10 464 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 465 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 466
AnnaBridge 145:64910690c574 467 #elif defined ( __TI_ARM__ )
<> 140:97feb9bacc10 468 #define __SIMD32_TYPE int32_t
<> 140:97feb9bacc10 469 #define CMSIS_UNUSED __attribute__((unused))
AnnaBridge 145:64910690c574 470 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 471
AnnaBridge 145:64910690c574 472 #elif defined ( __CSMC__ )
<> 140:97feb9bacc10 473 #define __SIMD32_TYPE int32_t
<> 140:97feb9bacc10 474 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 475 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 476
AnnaBridge 145:64910690c574 477 #elif defined ( __TASKING__ )
<> 140:97feb9bacc10 478 #define __SIMD32_TYPE __unaligned int32_t
<> 140:97feb9bacc10 479 #define CMSIS_UNUSED
AnnaBridge 145:64910690c574 480 #define CMSIS_INLINE
AnnaBridge 145:64910690c574 481
<> 140:97feb9bacc10 482 #else
<> 140:97feb9bacc10 483 #error Unknown compiler
<> 140:97feb9bacc10 484 #endif
<> 140:97feb9bacc10 485
AnnaBridge 145:64910690c574 486 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
<> 140:97feb9bacc10 487 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 493 /**
<> 140:97feb9bacc10 494 * @brief definition to pack two 16 bit values.
<> 140:97feb9bacc10 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) */
<> 140:97feb9bacc10 503
<> 140:97feb9bacc10 504 /**
<> 140:97feb9bacc10 505 * @brief definition to pack four 8 bit values.
<> 140:97feb9bacc10 506 */
<> 140:97feb9bacc10 507 #ifndef ARM_MATH_BIG_ENDIAN
<> 140:97feb9bacc10 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) )
<> 140:97feb9bacc10 513 #else
<> 140:97feb9bacc10 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) )
<> 140:97feb9bacc10 519
<> 140:97feb9bacc10 520 #endif
<> 140:97feb9bacc10 521
<> 140:97feb9bacc10 522
<> 140:97feb9bacc10 523 /**
<> 140:97feb9bacc10 524 * @brief Clips Q63 to Q31 values.
<> 140:97feb9bacc10 525 */
AnnaBridge 145:64910690c574 526 CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31(
<> 140:97feb9bacc10 527 q63_t x)
<> 140:97feb9bacc10 528 {
<> 140:97feb9bacc10 529 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 140:97feb9bacc10 530 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
<> 140:97feb9bacc10 531 }
<> 140:97feb9bacc10 532
<> 140:97feb9bacc10 533 /**
<> 140:97feb9bacc10 534 * @brief Clips Q63 to Q15 values.
<> 140:97feb9bacc10 535 */
AnnaBridge 145:64910690c574 536 CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15(
<> 140:97feb9bacc10 537 q63_t x)
<> 140:97feb9bacc10 538 {
<> 140:97feb9bacc10 539 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 140:97feb9bacc10 540 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
<> 140:97feb9bacc10 541 }
<> 140:97feb9bacc10 542
<> 140:97feb9bacc10 543 /**
<> 140:97feb9bacc10 544 * @brief Clips Q31 to Q7 values.
<> 140:97feb9bacc10 545 */
AnnaBridge 145:64910690c574 546 CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7(
<> 140:97feb9bacc10 547 q31_t x)
<> 140:97feb9bacc10 548 {
<> 140:97feb9bacc10 549 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
<> 140:97feb9bacc10 550 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
<> 140:97feb9bacc10 551 }
<> 140:97feb9bacc10 552
<> 140:97feb9bacc10 553 /**
<> 140:97feb9bacc10 554 * @brief Clips Q31 to Q15 values.
<> 140:97feb9bacc10 555 */
AnnaBridge 145:64910690c574 556 CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15(
<> 140:97feb9bacc10 557 q31_t x)
<> 140:97feb9bacc10 558 {
<> 140:97feb9bacc10 559 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
<> 140:97feb9bacc10 560 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
<> 140:97feb9bacc10 561 }
<> 140:97feb9bacc10 562
<> 140:97feb9bacc10 563 /**
<> 140:97feb9bacc10 564 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
<> 140:97feb9bacc10 565 */
<> 140:97feb9bacc10 566
AnnaBridge 145:64910690c574 567 CMSIS_INLINE __STATIC_INLINE q63_t mult32x64(
<> 140:97feb9bacc10 568 q63_t x,
<> 140:97feb9bacc10 569 q31_t y)
<> 140:97feb9bacc10 570 {
<> 140:97feb9bacc10 571 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
<> 140:97feb9bacc10 572 (((q63_t) (x >> 32) * y)));
<> 140:97feb9bacc10 573 }
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 581 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
AnnaBridge 145:64910690c574 582 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
<> 140:97feb9bacc10 583 q31_t data);
<> 140:97feb9bacc10 584
AnnaBridge 145:64910690c574 585 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
<> 140:97feb9bacc10 586 q31_t data)
<> 140:97feb9bacc10 587 {
<> 140:97feb9bacc10 588 uint32_t count = 0;
<> 140:97feb9bacc10 589 uint32_t mask = 0x80000000;
<> 140:97feb9bacc10 590
AnnaBridge 145:64910690c574 591 while ((data & mask) == 0)
<> 140:97feb9bacc10 592 {
<> 140:97feb9bacc10 593 count += 1u;
<> 140:97feb9bacc10 594 mask = mask >> 1u;
<> 140:97feb9bacc10 595 }
<> 140:97feb9bacc10 596
<> 140:97feb9bacc10 597 return (count);
<> 140:97feb9bacc10 598 }
<> 140:97feb9bacc10 599 #endif
<> 140:97feb9bacc10 600
<> 140:97feb9bacc10 601 /**
<> 140:97feb9bacc10 602 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
<> 140:97feb9bacc10 603 */
<> 140:97feb9bacc10 604
AnnaBridge 145:64910690c574 605 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31(
<> 140:97feb9bacc10 606 q31_t in,
<> 140:97feb9bacc10 607 q31_t * dst,
<> 140:97feb9bacc10 608 q31_t * pRecipTable)
<> 140:97feb9bacc10 609 {
AnnaBridge 145:64910690c574 610 q31_t out;
AnnaBridge 145:64910690c574 611 uint32_t tempVal;
<> 140:97feb9bacc10 612 uint32_t index, i;
<> 140:97feb9bacc10 613 uint32_t signBits;
<> 140:97feb9bacc10 614
AnnaBridge 145:64910690c574 615 if (in > 0)
<> 140:97feb9bacc10 616 {
AnnaBridge 145:64910690c574 617 signBits = ((uint32_t) (__CLZ( in) - 1));
<> 140:97feb9bacc10 618 }
<> 140:97feb9bacc10 619 else
<> 140:97feb9bacc10 620 {
AnnaBridge 145:64910690c574 621 signBits = ((uint32_t) (__CLZ(-in) - 1));
<> 140:97feb9bacc10 622 }
<> 140:97feb9bacc10 623
<> 140:97feb9bacc10 624 /* Convert input sample to 1.31 format */
AnnaBridge 145:64910690c574 625 in = (in << signBits);
<> 140:97feb9bacc10 626
<> 140:97feb9bacc10 627 /* calculation of index for initial approximated Val */
AnnaBridge 145:64910690c574 628 index = (uint32_t)(in >> 24);
<> 140:97feb9bacc10 629 index = (index & INDEX_MASK);
<> 140:97feb9bacc10 630
<> 140:97feb9bacc10 631 /* 1.31 with exp 1 */
<> 140:97feb9bacc10 632 out = pRecipTable[index];
<> 140:97feb9bacc10 633
<> 140:97feb9bacc10 634 /* calculation of reciprocal value */
<> 140:97feb9bacc10 635 /* running approximation for two iterations */
<> 140:97feb9bacc10 636 for (i = 0u; i < 2u; i++)
<> 140:97feb9bacc10 637 {
AnnaBridge 145:64910690c574 638 tempVal = (uint32_t) (((q63_t) in * out) >> 31);
AnnaBridge 145:64910690c574 639 tempVal = 0x7FFFFFFFu - tempVal;
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 643 }
<> 140:97feb9bacc10 644
<> 140:97feb9bacc10 645 /* write output */
<> 140:97feb9bacc10 646 *dst = out;
<> 140:97feb9bacc10 647
<> 140:97feb9bacc10 648 /* return num of signbits of out = 1/in value */
<> 140:97feb9bacc10 649 return (signBits + 1u);
<> 140:97feb9bacc10 650 }
<> 140:97feb9bacc10 651
AnnaBridge 145:64910690c574 652
<> 140:97feb9bacc10 653 /**
<> 140:97feb9bacc10 654 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
<> 140:97feb9bacc10 655 */
AnnaBridge 145:64910690c574 656 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15(
<> 140:97feb9bacc10 657 q15_t in,
<> 140:97feb9bacc10 658 q15_t * dst,
<> 140:97feb9bacc10 659 q15_t * pRecipTable)
<> 140:97feb9bacc10 660 {
AnnaBridge 145:64910690c574 661 q15_t out = 0;
AnnaBridge 145:64910690c574 662 uint32_t tempVal = 0;
<> 140:97feb9bacc10 663 uint32_t index = 0, i = 0;
<> 140:97feb9bacc10 664 uint32_t signBits = 0;
<> 140:97feb9bacc10 665
AnnaBridge 145:64910690c574 666 if (in > 0)
<> 140:97feb9bacc10 667 {
AnnaBridge 145:64910690c574 668 signBits = ((uint32_t)(__CLZ( in) - 17));
<> 140:97feb9bacc10 669 }
<> 140:97feb9bacc10 670 else
<> 140:97feb9bacc10 671 {
AnnaBridge 145:64910690c574 672 signBits = ((uint32_t)(__CLZ(-in) - 17));
<> 140:97feb9bacc10 673 }
<> 140:97feb9bacc10 674
<> 140:97feb9bacc10 675 /* Convert input sample to 1.15 format */
AnnaBridge 145:64910690c574 676 in = (in << signBits);
<> 140:97feb9bacc10 677
<> 140:97feb9bacc10 678 /* calculation of index for initial approximated Val */
AnnaBridge 145:64910690c574 679 index = (uint32_t)(in >> 8);
<> 140:97feb9bacc10 680 index = (index & INDEX_MASK);
<> 140:97feb9bacc10 681
<> 140:97feb9bacc10 682 /* 1.15 with exp 1 */
<> 140:97feb9bacc10 683 out = pRecipTable[index];
<> 140:97feb9bacc10 684
<> 140:97feb9bacc10 685 /* calculation of reciprocal value */
<> 140:97feb9bacc10 686 /* running approximation for two iterations */
AnnaBridge 145:64910690c574 687 for (i = 0u; i < 2u; i++)
<> 140:97feb9bacc10 688 {
AnnaBridge 145:64910690c574 689 tempVal = (uint32_t) (((q31_t) in * out) >> 15);
AnnaBridge 145:64910690c574 690 tempVal = 0x7FFFu - tempVal;
<> 140:97feb9bacc10 691 /* 1.15 with exp 1 */
<> 140:97feb9bacc10 692 out = (q15_t) (((q31_t) out * tempVal) >> 14);
AnnaBridge 145:64910690c574 693 /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */
<> 140:97feb9bacc10 694 }
<> 140:97feb9bacc10 695
<> 140:97feb9bacc10 696 /* write output */
<> 140:97feb9bacc10 697 *dst = out;
<> 140:97feb9bacc10 698
<> 140:97feb9bacc10 699 /* return num of signbits of out = 1/in value */
<> 140:97feb9bacc10 700 return (signBits + 1);
<> 140:97feb9bacc10 701 }
<> 140:97feb9bacc10 702
<> 140:97feb9bacc10 703
<> 140:97feb9bacc10 704 /*
<> 140:97feb9bacc10 705 * @brief C custom defined intrinisic function for only M0 processors
<> 140:97feb9bacc10 706 */
<> 140:97feb9bacc10 707 #if defined(ARM_MATH_CM0_FAMILY)
AnnaBridge 145:64910690c574 708 CMSIS_INLINE __STATIC_INLINE q31_t __SSAT(
<> 140:97feb9bacc10 709 q31_t x,
<> 140:97feb9bacc10 710 uint32_t y)
<> 140:97feb9bacc10 711 {
<> 140:97feb9bacc10 712 int32_t posMax, negMin;
<> 140:97feb9bacc10 713 uint32_t i;
<> 140:97feb9bacc10 714
<> 140:97feb9bacc10 715 posMax = 1;
<> 140:97feb9bacc10 716 for (i = 0; i < (y - 1); i++)
<> 140:97feb9bacc10 717 {
<> 140:97feb9bacc10 718 posMax = posMax * 2;
<> 140:97feb9bacc10 719 }
<> 140:97feb9bacc10 720
AnnaBridge 145:64910690c574 721 if (x > 0)
<> 140:97feb9bacc10 722 {
<> 140:97feb9bacc10 723 posMax = (posMax - 1);
<> 140:97feb9bacc10 724
AnnaBridge 145:64910690c574 725 if (x > posMax)
<> 140:97feb9bacc10 726 {
<> 140:97feb9bacc10 727 x = posMax;
<> 140:97feb9bacc10 728 }
<> 140:97feb9bacc10 729 }
<> 140:97feb9bacc10 730 else
<> 140:97feb9bacc10 731 {
<> 140:97feb9bacc10 732 negMin = -posMax;
<> 140:97feb9bacc10 733
AnnaBridge 145:64910690c574 734 if (x < negMin)
<> 140:97feb9bacc10 735 {
<> 140:97feb9bacc10 736 x = negMin;
<> 140:97feb9bacc10 737 }
<> 140:97feb9bacc10 738 }
<> 140:97feb9bacc10 739 return (x);
<> 140:97feb9bacc10 740 }
<> 140:97feb9bacc10 741 #endif /* end of ARM_MATH_CM0_FAMILY */
<> 140:97feb9bacc10 742
<> 140:97feb9bacc10 743
<> 140:97feb9bacc10 744 /*
<> 140:97feb9bacc10 745 * @brief C custom defined intrinsic function for M3 and M0 processors
<> 140:97feb9bacc10 746 */
AnnaBridge 145:64910690c574 747 /* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
AnnaBridge 145:64910690c574 748 #if !defined (ARM_MATH_DSP)
<> 140:97feb9bacc10 749
<> 140:97feb9bacc10 750 /*
<> 140:97feb9bacc10 751 * @brief C custom defined QADD8 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 765 }
<> 140:97feb9bacc10 766
AnnaBridge 145:64910690c574 767
<> 140:97feb9bacc10 768 /*
<> 140:97feb9bacc10 769 * @brief C custom defined QSUB8 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 774 {
<> 140:97feb9bacc10 775 q31_t r, s, t, u;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 783 }
<> 140:97feb9bacc10 784
AnnaBridge 145:64910690c574 785
<> 140:97feb9bacc10 786 /*
<> 140:97feb9bacc10 787 * @brief C custom defined QADD16 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 800 }
<> 140:97feb9bacc10 801
AnnaBridge 145:64910690c574 802
<> 140:97feb9bacc10 803 /*
<> 140:97feb9bacc10 804 * @brief C custom defined SHADD16 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 809 {
<> 140:97feb9bacc10 810 q31_t r, s;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 816 }
<> 140:97feb9bacc10 817
AnnaBridge 145:64910690c574 818
<> 140:97feb9bacc10 819 /*
<> 140:97feb9bacc10 820 * @brief C custom defined QSUB16 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 825 {
<> 140:97feb9bacc10 826 q31_t r, s;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 832 }
<> 140:97feb9bacc10 833
AnnaBridge 145:64910690c574 834
<> 140:97feb9bacc10 835 /*
<> 140:97feb9bacc10 836 * @brief C custom defined SHSUB16 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 841 {
<> 140:97feb9bacc10 842 q31_t r, s;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 848 }
<> 140:97feb9bacc10 849
AnnaBridge 145:64910690c574 850
<> 140:97feb9bacc10 851 /*
<> 140:97feb9bacc10 852 * @brief C custom defined QASX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 864 }
<> 140:97feb9bacc10 865
AnnaBridge 145:64910690c574 866
<> 140:97feb9bacc10 867 /*
<> 140:97feb9bacc10 868 * @brief C custom defined SHASX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 873 {
<> 140:97feb9bacc10 874 q31_t r, s;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 880 }
<> 140:97feb9bacc10 881
<> 140:97feb9bacc10 882
<> 140:97feb9bacc10 883 /*
<> 140:97feb9bacc10 884 * @brief C custom defined QSAX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 896 }
<> 140:97feb9bacc10 897
AnnaBridge 145:64910690c574 898
<> 140:97feb9bacc10 899 /*
<> 140:97feb9bacc10 900 * @brief C custom defined SHSAX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 905 {
<> 140:97feb9bacc10 906 q31_t r, s;
<> 140:97feb9bacc10 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 )));
<> 140:97feb9bacc10 912 }
<> 140:97feb9bacc10 913
AnnaBridge 145:64910690c574 914
<> 140:97feb9bacc10 915 /*
<> 140:97feb9bacc10 916 * @brief C custom defined SMUSDX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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)) ));
<> 140:97feb9bacc10 924 }
<> 140:97feb9bacc10 925
<> 140:97feb9bacc10 926 /*
<> 140:97feb9bacc10 927 * @brief C custom defined SMUADX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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)) ));
<> 140:97feb9bacc10 935 }
<> 140:97feb9bacc10 936
AnnaBridge 145:64910690c574 937
<> 140:97feb9bacc10 938 /*
<> 140:97feb9bacc10 939 * @brief C custom defined QADD for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 944 {
AnnaBridge 145:64910690c574 945 return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y)));
<> 140:97feb9bacc10 946 }
<> 140:97feb9bacc10 947
AnnaBridge 145:64910690c574 948
<> 140:97feb9bacc10 949 /*
<> 140:97feb9bacc10 950 * @brief C custom defined QSUB for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 955 {
AnnaBridge 145:64910690c574 956 return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y)));
<> 140:97feb9bacc10 957 }
<> 140:97feb9bacc10 958
AnnaBridge 145:64910690c574 959
<> 140:97feb9bacc10 960 /*
<> 140:97feb9bacc10 961 * @brief C custom defined SMLAD for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 ) ) ));
<> 140:97feb9bacc10 971 }
<> 140:97feb9bacc10 972
AnnaBridge 145:64910690c574 973
<> 140:97feb9bacc10 974 /*
<> 140:97feb9bacc10 975 * @brief C custom defined SMLADX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 ) ) ));
<> 140:97feb9bacc10 985 }
<> 140:97feb9bacc10 986
AnnaBridge 145:64910690c574 987
<> 140:97feb9bacc10 988 /*
<> 140:97feb9bacc10 989 * @brief C custom defined SMLSDX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 ) ) ));
<> 140:97feb9bacc10 999 }
<> 140:97feb9bacc10 1000
AnnaBridge 145:64910690c574 1001
<> 140:97feb9bacc10 1002 /*
<> 140:97feb9bacc10 1003 * @brief C custom defined SMLALD for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 ) ) ));
<> 140:97feb9bacc10 1014 }
<> 140:97feb9bacc10 1015
AnnaBridge 145:64910690c574 1016
<> 140:97feb9bacc10 1017 /*
<> 140:97feb9bacc10 1018 * @brief C custom defined SMLALDX for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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 ) ) ));
<> 140:97feb9bacc10 1029 }
<> 140:97feb9bacc10 1030
AnnaBridge 145:64910690c574 1031
<> 140:97feb9bacc10 1032 /*
<> 140:97feb9bacc10 1033 * @brief C custom defined SMUAD for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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)) ));
<> 140:97feb9bacc10 1041 }
<> 140:97feb9bacc10 1042
AnnaBridge 145:64910690c574 1043
<> 140:97feb9bacc10 1044 /*
<> 140:97feb9bacc10 1045 * @brief C custom defined SMUSD for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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)) ));
<> 140:97feb9bacc10 1053 }
<> 140:97feb9bacc10 1054
<> 140:97feb9bacc10 1055
<> 140:97feb9bacc10 1056 /*
<> 140:97feb9bacc10 1057 * @brief C custom defined SXTB16 for M3 and M0 processors
<> 140:97feb9bacc10 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)
<> 140:97feb9bacc10 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) );
<> 140:97feb9bacc10 1088 }
<> 140:97feb9bacc10 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) */
<> 140:97feb9bacc10 1105
<> 140:97feb9bacc10 1106
<> 140:97feb9bacc10 1107 /**
<> 140:97feb9bacc10 1108 * @brief Instance structure for the Q7 FIR filter.
<> 140:97feb9bacc10 1109 */
<> 140:97feb9bacc10 1110 typedef struct
<> 140:97feb9bacc10 1111 {
<> 140:97feb9bacc10 1112 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 140:97feb9bacc10 1113 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 1114 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 1115 } arm_fir_instance_q7;
<> 140:97feb9bacc10 1116
<> 140:97feb9bacc10 1117 /**
<> 140:97feb9bacc10 1118 * @brief Instance structure for the Q15 FIR filter.
<> 140:97feb9bacc10 1119 */
<> 140:97feb9bacc10 1120 typedef struct
<> 140:97feb9bacc10 1121 {
<> 140:97feb9bacc10 1122 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 140:97feb9bacc10 1123 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 1124 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 1125 } arm_fir_instance_q15;
<> 140:97feb9bacc10 1126
<> 140:97feb9bacc10 1127 /**
<> 140:97feb9bacc10 1128 * @brief Instance structure for the Q31 FIR filter.
<> 140:97feb9bacc10 1129 */
<> 140:97feb9bacc10 1130 typedef struct
<> 140:97feb9bacc10 1131 {
<> 140:97feb9bacc10 1132 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 140:97feb9bacc10 1133 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 1134 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 1135 } arm_fir_instance_q31;
<> 140:97feb9bacc10 1136
<> 140:97feb9bacc10 1137 /**
<> 140:97feb9bacc10 1138 * @brief Instance structure for the floating-point FIR filter.
<> 140:97feb9bacc10 1139 */
<> 140:97feb9bacc10 1140 typedef struct
<> 140:97feb9bacc10 1141 {
<> 140:97feb9bacc10 1142 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 140:97feb9bacc10 1143 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 1144 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 1145 } arm_fir_instance_f32;
<> 140:97feb9bacc10 1146
<> 140:97feb9bacc10 1147
<> 140:97feb9bacc10 1148 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1154 */
<> 140:97feb9bacc10 1155 void arm_fir_q7(
<> 140:97feb9bacc10 1156 const arm_fir_instance_q7 * S,
<> 140:97feb9bacc10 1157 q7_t * pSrc,
<> 140:97feb9bacc10 1158 q7_t * pDst,
<> 140:97feb9bacc10 1159 uint32_t blockSize);
<> 140:97feb9bacc10 1160
<> 140:97feb9bacc10 1161
<> 140:97feb9bacc10 1162 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1169 */
<> 140:97feb9bacc10 1170 void arm_fir_init_q7(
<> 140:97feb9bacc10 1171 arm_fir_instance_q7 * S,
<> 140:97feb9bacc10 1172 uint16_t numTaps,
<> 140:97feb9bacc10 1173 q7_t * pCoeffs,
<> 140:97feb9bacc10 1174 q7_t * pState,
<> 140:97feb9bacc10 1175 uint32_t blockSize);
<> 140:97feb9bacc10 1176
<> 140:97feb9bacc10 1177
<> 140:97feb9bacc10 1178 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1184 */
<> 140:97feb9bacc10 1185 void arm_fir_q15(
<> 140:97feb9bacc10 1186 const arm_fir_instance_q15 * S,
<> 140:97feb9bacc10 1187 q15_t * pSrc,
<> 140:97feb9bacc10 1188 q15_t * pDst,
<> 140:97feb9bacc10 1189 uint32_t blockSize);
<> 140:97feb9bacc10 1190
AnnaBridge 145:64910690c574 1191
<> 140:97feb9bacc10 1192 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1198 */
<> 140:97feb9bacc10 1199 void arm_fir_fast_q15(
<> 140:97feb9bacc10 1200 const arm_fir_instance_q15 * S,
<> 140:97feb9bacc10 1201 q15_t * pSrc,
<> 140:97feb9bacc10 1202 q15_t * pDst,
<> 140:97feb9bacc10 1203 uint32_t blockSize);
<> 140:97feb9bacc10 1204
AnnaBridge 145:64910690c574 1205
<> 140:97feb9bacc10 1206 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1213 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
<> 140:97feb9bacc10 1214 * <code>numTaps</code> is not a supported value.
<> 140:97feb9bacc10 1215 */
<> 140:97feb9bacc10 1216 arm_status arm_fir_init_q15(
<> 140:97feb9bacc10 1217 arm_fir_instance_q15 * S,
<> 140:97feb9bacc10 1218 uint16_t numTaps,
<> 140:97feb9bacc10 1219 q15_t * pCoeffs,
<> 140:97feb9bacc10 1220 q15_t * pState,
<> 140:97feb9bacc10 1221 uint32_t blockSize);
<> 140:97feb9bacc10 1222
AnnaBridge 145:64910690c574 1223
<> 140:97feb9bacc10 1224 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1230 */
<> 140:97feb9bacc10 1231 void arm_fir_q31(
<> 140:97feb9bacc10 1232 const arm_fir_instance_q31 * S,
<> 140:97feb9bacc10 1233 q31_t * pSrc,
<> 140:97feb9bacc10 1234 q31_t * pDst,
<> 140:97feb9bacc10 1235 uint32_t blockSize);
<> 140:97feb9bacc10 1236
AnnaBridge 145:64910690c574 1237
<> 140:97feb9bacc10 1238 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1244 */
<> 140:97feb9bacc10 1245 void arm_fir_fast_q31(
<> 140:97feb9bacc10 1246 const arm_fir_instance_q31 * S,
<> 140:97feb9bacc10 1247 q31_t * pSrc,
<> 140:97feb9bacc10 1248 q31_t * pDst,
<> 140:97feb9bacc10 1249 uint32_t blockSize);
<> 140:97feb9bacc10 1250
AnnaBridge 145:64910690c574 1251
<> 140:97feb9bacc10 1252 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1259 */
<> 140:97feb9bacc10 1260 void arm_fir_init_q31(
<> 140:97feb9bacc10 1261 arm_fir_instance_q31 * S,
<> 140:97feb9bacc10 1262 uint16_t numTaps,
<> 140:97feb9bacc10 1263 q31_t * pCoeffs,
<> 140:97feb9bacc10 1264 q31_t * pState,
<> 140:97feb9bacc10 1265 uint32_t blockSize);
<> 140:97feb9bacc10 1266
AnnaBridge 145:64910690c574 1267
<> 140:97feb9bacc10 1268 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1274 */
<> 140:97feb9bacc10 1275 void arm_fir_f32(
<> 140:97feb9bacc10 1276 const arm_fir_instance_f32 * S,
<> 140:97feb9bacc10 1277 float32_t * pSrc,
<> 140:97feb9bacc10 1278 float32_t * pDst,
<> 140:97feb9bacc10 1279 uint32_t blockSize);
<> 140:97feb9bacc10 1280
AnnaBridge 145:64910690c574 1281
<> 140:97feb9bacc10 1282 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1289 */
<> 140:97feb9bacc10 1290 void arm_fir_init_f32(
<> 140:97feb9bacc10 1291 arm_fir_instance_f32 * S,
<> 140:97feb9bacc10 1292 uint16_t numTaps,
<> 140:97feb9bacc10 1293 float32_t * pCoeffs,
<> 140:97feb9bacc10 1294 float32_t * pState,
<> 140:97feb9bacc10 1295 uint32_t blockSize);
<> 140:97feb9bacc10 1296
<> 140:97feb9bacc10 1297
<> 140:97feb9bacc10 1298 /**
<> 140:97feb9bacc10 1299 * @brief Instance structure for the Q15 Biquad cascade filter.
<> 140:97feb9bacc10 1300 */
<> 140:97feb9bacc10 1301 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 1307 } arm_biquad_casd_df1_inst_q15;
<> 140:97feb9bacc10 1308
<> 140:97feb9bacc10 1309 /**
<> 140:97feb9bacc10 1310 * @brief Instance structure for the Q31 Biquad cascade filter.
<> 140:97feb9bacc10 1311 */
<> 140:97feb9bacc10 1312 typedef struct
<> 140:97feb9bacc10 1313 {
<> 140:97feb9bacc10 1314 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 140:97feb9bacc10 1315 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 140:97feb9bacc10 1316 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 140:97feb9bacc10 1317 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 140:97feb9bacc10 1318 } arm_biquad_casd_df1_inst_q31;
<> 140:97feb9bacc10 1319
<> 140:97feb9bacc10 1320 /**
<> 140:97feb9bacc10 1321 * @brief Instance structure for the floating-point Biquad cascade filter.
<> 140:97feb9bacc10 1322 */
<> 140:97feb9bacc10 1323 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 1328 } arm_biquad_casd_df1_inst_f32;
<> 140:97feb9bacc10 1329
<> 140:97feb9bacc10 1330
<> 140:97feb9bacc10 1331 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1338 void arm_biquad_cascade_df1_q15(
<> 140:97feb9bacc10 1339 const arm_biquad_casd_df1_inst_q15 * S,
<> 140:97feb9bacc10 1340 q15_t * pSrc,
<> 140:97feb9bacc10 1341 q15_t * pDst,
<> 140:97feb9bacc10 1342 uint32_t blockSize);
<> 140:97feb9bacc10 1343
AnnaBridge 145:64910690c574 1344
<> 140:97feb9bacc10 1345 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1353 void arm_biquad_cascade_df1_init_q15(
<> 140:97feb9bacc10 1354 arm_biquad_casd_df1_inst_q15 * S,
<> 140:97feb9bacc10 1355 uint8_t numStages,
<> 140:97feb9bacc10 1356 q15_t * pCoeffs,
<> 140:97feb9bacc10 1357 q15_t * pState,
<> 140:97feb9bacc10 1358 int8_t postShift);
<> 140:97feb9bacc10 1359
<> 140:97feb9bacc10 1360
<> 140:97feb9bacc10 1361 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1368 void arm_biquad_cascade_df1_fast_q15(
<> 140:97feb9bacc10 1369 const arm_biquad_casd_df1_inst_q15 * S,
<> 140:97feb9bacc10 1370 q15_t * pSrc,
<> 140:97feb9bacc10 1371 q15_t * pDst,
<> 140:97feb9bacc10 1372 uint32_t blockSize);
<> 140:97feb9bacc10 1373
<> 140:97feb9bacc10 1374
<> 140:97feb9bacc10 1375 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1380 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1381 */
<> 140:97feb9bacc10 1382 void arm_biquad_cascade_df1_q31(
<> 140:97feb9bacc10 1383 const arm_biquad_casd_df1_inst_q31 * S,
<> 140:97feb9bacc10 1384 q31_t * pSrc,
<> 140:97feb9bacc10 1385 q31_t * pDst,
<> 140:97feb9bacc10 1386 uint32_t blockSize);
<> 140:97feb9bacc10 1387
AnnaBridge 145:64910690c574 1388
<> 140:97feb9bacc10 1389 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1394 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1395 */
<> 140:97feb9bacc10 1396 void arm_biquad_cascade_df1_fast_q31(
<> 140:97feb9bacc10 1397 const arm_biquad_casd_df1_inst_q31 * S,
<> 140:97feb9bacc10 1398 q31_t * pSrc,
<> 140:97feb9bacc10 1399 q31_t * pDst,
<> 140:97feb9bacc10 1400 uint32_t blockSize);
<> 140:97feb9bacc10 1401
AnnaBridge 145:64910690c574 1402
<> 140:97feb9bacc10 1403 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1411 void arm_biquad_cascade_df1_init_q31(
<> 140:97feb9bacc10 1412 arm_biquad_casd_df1_inst_q31 * S,
<> 140:97feb9bacc10 1413 uint8_t numStages,
<> 140:97feb9bacc10 1414 q31_t * pCoeffs,
<> 140:97feb9bacc10 1415 q31_t * pState,
<> 140:97feb9bacc10 1416 int8_t postShift);
<> 140:97feb9bacc10 1417
AnnaBridge 145:64910690c574 1418
<> 140:97feb9bacc10 1419 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1424 * @param[in] blockSize number of samples to process.
AnnaBridge 145:64910690c574 1425 */
<> 140:97feb9bacc10 1426 void arm_biquad_cascade_df1_f32(
<> 140:97feb9bacc10 1427 const arm_biquad_casd_df1_inst_f32 * S,
<> 140:97feb9bacc10 1428 float32_t * pSrc,
<> 140:97feb9bacc10 1429 float32_t * pDst,
<> 140:97feb9bacc10 1430 uint32_t blockSize);
<> 140:97feb9bacc10 1431
AnnaBridge 145:64910690c574 1432
<> 140:97feb9bacc10 1433 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1440 void arm_biquad_cascade_df1_init_f32(
<> 140:97feb9bacc10 1441 arm_biquad_casd_df1_inst_f32 * S,
<> 140:97feb9bacc10 1442 uint8_t numStages,
<> 140:97feb9bacc10 1443 float32_t * pCoeffs,
<> 140:97feb9bacc10 1444 float32_t * pState);
<> 140:97feb9bacc10 1445
<> 140:97feb9bacc10 1446
<> 140:97feb9bacc10 1447 /**
<> 140:97feb9bacc10 1448 * @brief Instance structure for the floating-point matrix structure.
<> 140:97feb9bacc10 1449 */
<> 140:97feb9bacc10 1450 typedef struct
<> 140:97feb9bacc10 1451 {
<> 140:97feb9bacc10 1452 uint16_t numRows; /**< number of rows of the matrix. */
<> 140:97feb9bacc10 1453 uint16_t numCols; /**< number of columns of the matrix. */
<> 140:97feb9bacc10 1454 float32_t *pData; /**< points to the data of the matrix. */
<> 140:97feb9bacc10 1455 } arm_matrix_instance_f32;
<> 140:97feb9bacc10 1456
<> 140:97feb9bacc10 1457
<> 140:97feb9bacc10 1458 /**
<> 140:97feb9bacc10 1459 * @brief Instance structure for the floating-point matrix structure.
<> 140:97feb9bacc10 1460 */
<> 140:97feb9bacc10 1461 typedef struct
<> 140:97feb9bacc10 1462 {
<> 140:97feb9bacc10 1463 uint16_t numRows; /**< number of rows of the matrix. */
<> 140:97feb9bacc10 1464 uint16_t numCols; /**< number of columns of the matrix. */
<> 140:97feb9bacc10 1465 float64_t *pData; /**< points to the data of the matrix. */
<> 140:97feb9bacc10 1466 } arm_matrix_instance_f64;
<> 140:97feb9bacc10 1467
<> 140:97feb9bacc10 1468 /**
<> 140:97feb9bacc10 1469 * @brief Instance structure for the Q15 matrix structure.
<> 140:97feb9bacc10 1470 */
<> 140:97feb9bacc10 1471 typedef struct
<> 140:97feb9bacc10 1472 {
<> 140:97feb9bacc10 1473 uint16_t numRows; /**< number of rows of the matrix. */
<> 140:97feb9bacc10 1474 uint16_t numCols; /**< number of columns of the matrix. */
<> 140:97feb9bacc10 1475 q15_t *pData; /**< points to the data of the matrix. */
<> 140:97feb9bacc10 1476 } arm_matrix_instance_q15;
<> 140:97feb9bacc10 1477
<> 140:97feb9bacc10 1478 /**
<> 140:97feb9bacc10 1479 * @brief Instance structure for the Q31 matrix structure.
<> 140:97feb9bacc10 1480 */
<> 140:97feb9bacc10 1481 typedef struct
<> 140:97feb9bacc10 1482 {
<> 140:97feb9bacc10 1483 uint16_t numRows; /**< number of rows of the matrix. */
<> 140:97feb9bacc10 1484 uint16_t numCols; /**< number of columns of the matrix. */
<> 140:97feb9bacc10 1485 q31_t *pData; /**< points to the data of the matrix. */
<> 140:97feb9bacc10 1486 } arm_matrix_instance_q31;
<> 140:97feb9bacc10 1487
<> 140:97feb9bacc10 1488
<> 140:97feb9bacc10 1489 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1494 * @return The function returns either
<> 140:97feb9bacc10 1495 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1496 */
<> 140:97feb9bacc10 1497 arm_status arm_mat_add_f32(
<> 140:97feb9bacc10 1498 const arm_matrix_instance_f32 * pSrcA,
<> 140:97feb9bacc10 1499 const arm_matrix_instance_f32 * pSrcB,
<> 140:97feb9bacc10 1500 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1501
AnnaBridge 145:64910690c574 1502
<> 140:97feb9bacc10 1503 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1508 * @return The function returns either
<> 140:97feb9bacc10 1509 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1510 */
<> 140:97feb9bacc10 1511 arm_status arm_mat_add_q15(
<> 140:97feb9bacc10 1512 const arm_matrix_instance_q15 * pSrcA,
<> 140:97feb9bacc10 1513 const arm_matrix_instance_q15 * pSrcB,
<> 140:97feb9bacc10 1514 arm_matrix_instance_q15 * pDst);
<> 140:97feb9bacc10 1515
AnnaBridge 145:64910690c574 1516
<> 140:97feb9bacc10 1517 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1522 * @return The function returns either
<> 140:97feb9bacc10 1523 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1524 */
<> 140:97feb9bacc10 1525 arm_status arm_mat_add_q31(
<> 140:97feb9bacc10 1526 const arm_matrix_instance_q31 * pSrcA,
<> 140:97feb9bacc10 1527 const arm_matrix_instance_q31 * pSrcB,
<> 140:97feb9bacc10 1528 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1529
AnnaBridge 145:64910690c574 1530
<> 140:97feb9bacc10 1531 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1536 * @return The function returns either
<> 140:97feb9bacc10 1537 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1538 */
<> 140:97feb9bacc10 1539 arm_status arm_mat_cmplx_mult_f32(
<> 140:97feb9bacc10 1540 const arm_matrix_instance_f32 * pSrcA,
<> 140:97feb9bacc10 1541 const arm_matrix_instance_f32 * pSrcB,
<> 140:97feb9bacc10 1542 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1543
AnnaBridge 145:64910690c574 1544
<> 140:97feb9bacc10 1545 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1550 * @return The function returns either
<> 140:97feb9bacc10 1551 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1552 */
<> 140:97feb9bacc10 1553 arm_status arm_mat_cmplx_mult_q15(
<> 140:97feb9bacc10 1554 const arm_matrix_instance_q15 * pSrcA,
<> 140:97feb9bacc10 1555 const arm_matrix_instance_q15 * pSrcB,
<> 140:97feb9bacc10 1556 arm_matrix_instance_q15 * pDst,
<> 140:97feb9bacc10 1557 q15_t * pScratch);
<> 140:97feb9bacc10 1558
AnnaBridge 145:64910690c574 1559
<> 140:97feb9bacc10 1560 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1565 * @return The function returns either
<> 140:97feb9bacc10 1566 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1567 */
<> 140:97feb9bacc10 1568 arm_status arm_mat_cmplx_mult_q31(
<> 140:97feb9bacc10 1569 const arm_matrix_instance_q31 * pSrcA,
<> 140:97feb9bacc10 1570 const arm_matrix_instance_q31 * pSrcB,
<> 140:97feb9bacc10 1571 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1572
<> 140:97feb9bacc10 1573
<> 140:97feb9bacc10 1574 /**
<> 140:97feb9bacc10 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>
<> 140:97feb9bacc10 1579 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1580 */
<> 140:97feb9bacc10 1581 arm_status arm_mat_trans_f32(
<> 140:97feb9bacc10 1582 const arm_matrix_instance_f32 * pSrc,
<> 140:97feb9bacc10 1583 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1584
<> 140:97feb9bacc10 1585
<> 140:97feb9bacc10 1586 /**
<> 140:97feb9bacc10 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>
<> 140:97feb9bacc10 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1592 */
<> 140:97feb9bacc10 1593 arm_status arm_mat_trans_q15(
<> 140:97feb9bacc10 1594 const arm_matrix_instance_q15 * pSrc,
<> 140:97feb9bacc10 1595 arm_matrix_instance_q15 * pDst);
<> 140:97feb9bacc10 1596
AnnaBridge 145:64910690c574 1597
<> 140:97feb9bacc10 1598 /**
<> 140:97feb9bacc10 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>
<> 140:97feb9bacc10 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1604 */
<> 140:97feb9bacc10 1605 arm_status arm_mat_trans_q31(
<> 140:97feb9bacc10 1606 const arm_matrix_instance_q31 * pSrc,
<> 140:97feb9bacc10 1607 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1608
<> 140:97feb9bacc10 1609
<> 140:97feb9bacc10 1610 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1615 * @return The function returns either
<> 140:97feb9bacc10 1616 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1617 */
<> 140:97feb9bacc10 1618 arm_status arm_mat_mult_f32(
<> 140:97feb9bacc10 1619 const arm_matrix_instance_f32 * pSrcA,
<> 140:97feb9bacc10 1620 const arm_matrix_instance_f32 * pSrcB,
<> 140:97feb9bacc10 1621 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1622
AnnaBridge 145:64910690c574 1623
<> 140:97feb9bacc10 1624 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1630 * @return The function returns either
<> 140:97feb9bacc10 1631 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1632 */
<> 140:97feb9bacc10 1633 arm_status arm_mat_mult_q15(
<> 140:97feb9bacc10 1634 const arm_matrix_instance_q15 * pSrcA,
<> 140:97feb9bacc10 1635 const arm_matrix_instance_q15 * pSrcB,
<> 140:97feb9bacc10 1636 arm_matrix_instance_q15 * pDst,
<> 140:97feb9bacc10 1637 q15_t * pState);
<> 140:97feb9bacc10 1638
AnnaBridge 145:64910690c574 1639
<> 140:97feb9bacc10 1640 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1646 * @return The function returns either
<> 140:97feb9bacc10 1647 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1648 */
<> 140:97feb9bacc10 1649 arm_status arm_mat_mult_fast_q15(
<> 140:97feb9bacc10 1650 const arm_matrix_instance_q15 * pSrcA,
<> 140:97feb9bacc10 1651 const arm_matrix_instance_q15 * pSrcB,
<> 140:97feb9bacc10 1652 arm_matrix_instance_q15 * pDst,
<> 140:97feb9bacc10 1653 q15_t * pState);
<> 140:97feb9bacc10 1654
AnnaBridge 145:64910690c574 1655
<> 140:97feb9bacc10 1656 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1661 * @return The function returns either
<> 140:97feb9bacc10 1662 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1663 */
<> 140:97feb9bacc10 1664 arm_status arm_mat_mult_q31(
<> 140:97feb9bacc10 1665 const arm_matrix_instance_q31 * pSrcA,
<> 140:97feb9bacc10 1666 const arm_matrix_instance_q31 * pSrcB,
<> 140:97feb9bacc10 1667 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1668
AnnaBridge 145:64910690c574 1669
<> 140:97feb9bacc10 1670 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1675 * @return The function returns either
<> 140:97feb9bacc10 1676 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1677 */
<> 140:97feb9bacc10 1678 arm_status arm_mat_mult_fast_q31(
<> 140:97feb9bacc10 1679 const arm_matrix_instance_q31 * pSrcA,
<> 140:97feb9bacc10 1680 const arm_matrix_instance_q31 * pSrcB,
<> 140:97feb9bacc10 1681 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1682
<> 140:97feb9bacc10 1683
<> 140:97feb9bacc10 1684 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1689 * @return The function returns either
<> 140:97feb9bacc10 1690 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1691 */
<> 140:97feb9bacc10 1692 arm_status arm_mat_sub_f32(
<> 140:97feb9bacc10 1693 const arm_matrix_instance_f32 * pSrcA,
<> 140:97feb9bacc10 1694 const arm_matrix_instance_f32 * pSrcB,
<> 140:97feb9bacc10 1695 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1696
AnnaBridge 145:64910690c574 1697
<> 140:97feb9bacc10 1698 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1703 * @return The function returns either
<> 140:97feb9bacc10 1704 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1705 */
<> 140:97feb9bacc10 1706 arm_status arm_mat_sub_q15(
<> 140:97feb9bacc10 1707 const arm_matrix_instance_q15 * pSrcA,
<> 140:97feb9bacc10 1708 const arm_matrix_instance_q15 * pSrcB,
<> 140:97feb9bacc10 1709 arm_matrix_instance_q15 * pDst);
<> 140:97feb9bacc10 1710
AnnaBridge 145:64910690c574 1711
<> 140:97feb9bacc10 1712 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1717 * @return The function returns either
<> 140:97feb9bacc10 1718 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1719 */
<> 140:97feb9bacc10 1720 arm_status arm_mat_sub_q31(
<> 140:97feb9bacc10 1721 const arm_matrix_instance_q31 * pSrcA,
<> 140:97feb9bacc10 1722 const arm_matrix_instance_q31 * pSrcB,
<> 140:97feb9bacc10 1723 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1724
AnnaBridge 145:64910690c574 1725
<> 140:97feb9bacc10 1726 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1731 * @return The function returns either
<> 140:97feb9bacc10 1732 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1733 */
<> 140:97feb9bacc10 1734 arm_status arm_mat_scale_f32(
<> 140:97feb9bacc10 1735 const arm_matrix_instance_f32 * pSrc,
<> 140:97feb9bacc10 1736 float32_t scale,
<> 140:97feb9bacc10 1737 arm_matrix_instance_f32 * pDst);
<> 140:97feb9bacc10 1738
AnnaBridge 145:64910690c574 1739
<> 140:97feb9bacc10 1740 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1746 * @return The function returns either
<> 140:97feb9bacc10 1747 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1748 */
<> 140:97feb9bacc10 1749 arm_status arm_mat_scale_q15(
<> 140:97feb9bacc10 1750 const arm_matrix_instance_q15 * pSrc,
<> 140:97feb9bacc10 1751 q15_t scaleFract,
<> 140:97feb9bacc10 1752 int32_t shift,
<> 140:97feb9bacc10 1753 arm_matrix_instance_q15 * pDst);
<> 140:97feb9bacc10 1754
AnnaBridge 145:64910690c574 1755
<> 140:97feb9bacc10 1756 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1762 * @return The function returns either
<> 140:97feb9bacc10 1763 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 140:97feb9bacc10 1764 */
<> 140:97feb9bacc10 1765 arm_status arm_mat_scale_q31(
<> 140:97feb9bacc10 1766 const arm_matrix_instance_q31 * pSrc,
<> 140:97feb9bacc10 1767 q31_t scaleFract,
<> 140:97feb9bacc10 1768 int32_t shift,
<> 140:97feb9bacc10 1769 arm_matrix_instance_q31 * pDst);
<> 140:97feb9bacc10 1770
<> 140:97feb9bacc10 1771
<> 140:97feb9bacc10 1772 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1779 void arm_mat_init_q31(
<> 140:97feb9bacc10 1780 arm_matrix_instance_q31 * S,
<> 140:97feb9bacc10 1781 uint16_t nRows,
<> 140:97feb9bacc10 1782 uint16_t nColumns,
<> 140:97feb9bacc10 1783 q31_t * pData);
<> 140:97feb9bacc10 1784
AnnaBridge 145:64910690c574 1785
<> 140:97feb9bacc10 1786 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1793 void arm_mat_init_q15(
<> 140:97feb9bacc10 1794 arm_matrix_instance_q15 * S,
<> 140:97feb9bacc10 1795 uint16_t nRows,
<> 140:97feb9bacc10 1796 uint16_t nColumns,
<> 140:97feb9bacc10 1797 q15_t * pData);
<> 140:97feb9bacc10 1798
AnnaBridge 145:64910690c574 1799
<> 140:97feb9bacc10 1800 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1807 void arm_mat_init_f32(
<> 140:97feb9bacc10 1808 arm_matrix_instance_f32 * S,
<> 140:97feb9bacc10 1809 uint16_t nRows,
<> 140:97feb9bacc10 1810 uint16_t nColumns,
<> 140:97feb9bacc10 1811 float32_t * pData);
<> 140:97feb9bacc10 1812
<> 140:97feb9bacc10 1813
<> 140:97feb9bacc10 1814
<> 140:97feb9bacc10 1815 /**
<> 140:97feb9bacc10 1816 * @brief Instance structure for the Q15 PID Control.
<> 140:97feb9bacc10 1817 */
<> 140:97feb9bacc10 1818 typedef struct
<> 140:97feb9bacc10 1819 {
AnnaBridge 145:64910690c574 1820 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
AnnaBridge 145:64910690c574 1821 #if !defined (ARM_MATH_DSP)
<> 140:97feb9bacc10 1822 q15_t A1;
<> 140:97feb9bacc10 1823 q15_t A2;
<> 140:97feb9bacc10 1824 #else
<> 140:97feb9bacc10 1825 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
<> 140:97feb9bacc10 1826 #endif
AnnaBridge 145:64910690c574 1827 q15_t state[3]; /**< The state array of length 3. */
<> 140:97feb9bacc10 1828 q15_t Kp; /**< The proportional gain. */
<> 140:97feb9bacc10 1829 q15_t Ki; /**< The integral gain. */
<> 140:97feb9bacc10 1830 q15_t Kd; /**< The derivative gain. */
<> 140:97feb9bacc10 1831 } arm_pid_instance_q15;
<> 140:97feb9bacc10 1832
<> 140:97feb9bacc10 1833 /**
<> 140:97feb9bacc10 1834 * @brief Instance structure for the Q31 PID Control.
<> 140:97feb9bacc10 1835 */
<> 140:97feb9bacc10 1836 typedef struct
<> 140:97feb9bacc10 1837 {
<> 140:97feb9bacc10 1838 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 140:97feb9bacc10 1839 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 140:97feb9bacc10 1840 q31_t A2; /**< The derived gain, A2 = Kd . */
<> 140:97feb9bacc10 1841 q31_t state[3]; /**< The state array of length 3. */
<> 140:97feb9bacc10 1842 q31_t Kp; /**< The proportional gain. */
<> 140:97feb9bacc10 1843 q31_t Ki; /**< The integral gain. */
<> 140:97feb9bacc10 1844 q31_t Kd; /**< The derivative gain. */
<> 140:97feb9bacc10 1845 } arm_pid_instance_q31;
<> 140:97feb9bacc10 1846
<> 140:97feb9bacc10 1847 /**
<> 140:97feb9bacc10 1848 * @brief Instance structure for the floating-point PID Control.
<> 140:97feb9bacc10 1849 */
<> 140:97feb9bacc10 1850 typedef struct
<> 140:97feb9bacc10 1851 {
<> 140:97feb9bacc10 1852 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 140:97feb9bacc10 1853 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 140:97feb9bacc10 1854 float32_t A2; /**< The derived gain, A2 = Kd . */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 1859 } arm_pid_instance_f32;
<> 140:97feb9bacc10 1860
<> 140:97feb9bacc10 1861
<> 140:97feb9bacc10 1862
<> 140:97feb9bacc10 1863 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1866 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 140:97feb9bacc10 1867 */
<> 140:97feb9bacc10 1868 void arm_pid_init_f32(
<> 140:97feb9bacc10 1869 arm_pid_instance_f32 * S,
<> 140:97feb9bacc10 1870 int32_t resetStateFlag);
<> 140:97feb9bacc10 1871
AnnaBridge 145:64910690c574 1872
<> 140:97feb9bacc10 1873 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1876 */
<> 140:97feb9bacc10 1877 void arm_pid_reset_f32(
<> 140:97feb9bacc10 1878 arm_pid_instance_f32 * S);
<> 140:97feb9bacc10 1879
<> 140:97feb9bacc10 1880
<> 140:97feb9bacc10 1881 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1884 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 140:97feb9bacc10 1885 */
<> 140:97feb9bacc10 1886 void arm_pid_init_q31(
<> 140:97feb9bacc10 1887 arm_pid_instance_q31 * S,
<> 140:97feb9bacc10 1888 int32_t resetStateFlag);
<> 140:97feb9bacc10 1889
<> 140:97feb9bacc10 1890
<> 140:97feb9bacc10 1891 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1894 */
<> 140:97feb9bacc10 1895
<> 140:97feb9bacc10 1896 void arm_pid_reset_q31(
<> 140:97feb9bacc10 1897 arm_pid_instance_q31 * S);
<> 140:97feb9bacc10 1898
AnnaBridge 145:64910690c574 1899
<> 140:97feb9bacc10 1900 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 1904 */
<> 140:97feb9bacc10 1905 void arm_pid_init_q15(
<> 140:97feb9bacc10 1906 arm_pid_instance_q15 * S,
<> 140:97feb9bacc10 1907 int32_t resetStateFlag);
<> 140:97feb9bacc10 1908
AnnaBridge 145:64910690c574 1909
<> 140:97feb9bacc10 1910 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 1913 */
<> 140:97feb9bacc10 1914 void arm_pid_reset_q15(
<> 140:97feb9bacc10 1915 arm_pid_instance_q15 * S);
<> 140:97feb9bacc10 1916
<> 140:97feb9bacc10 1917
<> 140:97feb9bacc10 1918 /**
<> 140:97feb9bacc10 1919 * @brief Instance structure for the floating-point Linear Interpolate function.
<> 140:97feb9bacc10 1920 */
<> 140:97feb9bacc10 1921 typedef struct
<> 140:97feb9bacc10 1922 {
<> 140:97feb9bacc10 1923 uint32_t nValues; /**< nValues */
<> 140:97feb9bacc10 1924 float32_t x1; /**< x1 */
<> 140:97feb9bacc10 1925 float32_t xSpacing; /**< xSpacing */
<> 140:97feb9bacc10 1926 float32_t *pYData; /**< pointer to the table of Y values */
<> 140:97feb9bacc10 1927 } arm_linear_interp_instance_f32;
<> 140:97feb9bacc10 1928
<> 140:97feb9bacc10 1929 /**
<> 140:97feb9bacc10 1930 * @brief Instance structure for the floating-point bilinear interpolation function.
<> 140:97feb9bacc10 1931 */
<> 140:97feb9bacc10 1932 typedef struct
<> 140:97feb9bacc10 1933 {
<> 140:97feb9bacc10 1934 uint16_t numRows; /**< number of rows in the data table. */
<> 140:97feb9bacc10 1935 uint16_t numCols; /**< number of columns in the data table. */
<> 140:97feb9bacc10 1936 float32_t *pData; /**< points to the data table. */
<> 140:97feb9bacc10 1937 } arm_bilinear_interp_instance_f32;
<> 140:97feb9bacc10 1938
<> 140:97feb9bacc10 1939 /**
<> 140:97feb9bacc10 1940 * @brief Instance structure for the Q31 bilinear interpolation function.
<> 140:97feb9bacc10 1941 */
<> 140:97feb9bacc10 1942 typedef struct
<> 140:97feb9bacc10 1943 {
<> 140:97feb9bacc10 1944 uint16_t numRows; /**< number of rows in the data table. */
<> 140:97feb9bacc10 1945 uint16_t numCols; /**< number of columns in the data table. */
<> 140:97feb9bacc10 1946 q31_t *pData; /**< points to the data table. */
<> 140:97feb9bacc10 1947 } arm_bilinear_interp_instance_q31;
<> 140:97feb9bacc10 1948
<> 140:97feb9bacc10 1949 /**
<> 140:97feb9bacc10 1950 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 140:97feb9bacc10 1951 */
<> 140:97feb9bacc10 1952 typedef struct
<> 140:97feb9bacc10 1953 {
<> 140:97feb9bacc10 1954 uint16_t numRows; /**< number of rows in the data table. */
<> 140:97feb9bacc10 1955 uint16_t numCols; /**< number of columns in the data table. */
<> 140:97feb9bacc10 1956 q15_t *pData; /**< points to the data table. */
<> 140:97feb9bacc10 1957 } arm_bilinear_interp_instance_q15;
<> 140:97feb9bacc10 1958
<> 140:97feb9bacc10 1959 /**
<> 140:97feb9bacc10 1960 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 140:97feb9bacc10 1961 */
<> 140:97feb9bacc10 1962 typedef struct
<> 140:97feb9bacc10 1963 {
<> 140:97feb9bacc10 1964 uint16_t numRows; /**< number of rows in the data table. */
<> 140:97feb9bacc10 1965 uint16_t numCols; /**< number of columns in the data table. */
AnnaBridge 145:64910690c574 1966 q7_t *pData; /**< points to the data table. */
<> 140:97feb9bacc10 1967 } arm_bilinear_interp_instance_q7;
<> 140:97feb9bacc10 1968
<> 140:97feb9bacc10 1969
<> 140:97feb9bacc10 1970 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1977 void arm_mult_q7(
<> 140:97feb9bacc10 1978 q7_t * pSrcA,
<> 140:97feb9bacc10 1979 q7_t * pSrcB,
<> 140:97feb9bacc10 1980 q7_t * pDst,
<> 140:97feb9bacc10 1981 uint32_t blockSize);
<> 140:97feb9bacc10 1982
AnnaBridge 145:64910690c574 1983
<> 140:97feb9bacc10 1984 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 1991 void arm_mult_q15(
<> 140:97feb9bacc10 1992 q15_t * pSrcA,
<> 140:97feb9bacc10 1993 q15_t * pSrcB,
<> 140:97feb9bacc10 1994 q15_t * pDst,
<> 140:97feb9bacc10 1995 uint32_t blockSize);
<> 140:97feb9bacc10 1996
AnnaBridge 145:64910690c574 1997
<> 140:97feb9bacc10 1998 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2005 void arm_mult_q31(
<> 140:97feb9bacc10 2006 q31_t * pSrcA,
<> 140:97feb9bacc10 2007 q31_t * pSrcB,
<> 140:97feb9bacc10 2008 q31_t * pDst,
<> 140:97feb9bacc10 2009 uint32_t blockSize);
<> 140:97feb9bacc10 2010
AnnaBridge 145:64910690c574 2011
<> 140:97feb9bacc10 2012 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2019 void arm_mult_f32(
<> 140:97feb9bacc10 2020 float32_t * pSrcA,
<> 140:97feb9bacc10 2021 float32_t * pSrcB,
<> 140:97feb9bacc10 2022 float32_t * pDst,
<> 140:97feb9bacc10 2023 uint32_t blockSize);
<> 140:97feb9bacc10 2024
<> 140:97feb9bacc10 2025
<> 140:97feb9bacc10 2026 /**
<> 140:97feb9bacc10 2027 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 140:97feb9bacc10 2028 */
<> 140:97feb9bacc10 2029 typedef struct
<> 140:97feb9bacc10 2030 {
<> 140:97feb9bacc10 2031 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2032 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2035 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2036 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2037 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 140:97feb9bacc10 2038 } arm_cfft_radix2_instance_q15;
<> 140:97feb9bacc10 2039
<> 140:97feb9bacc10 2040 /* Deprecated */
<> 140:97feb9bacc10 2041 arm_status arm_cfft_radix2_init_q15(
<> 140:97feb9bacc10 2042 arm_cfft_radix2_instance_q15 * S,
<> 140:97feb9bacc10 2043 uint16_t fftLen,
<> 140:97feb9bacc10 2044 uint8_t ifftFlag,
<> 140:97feb9bacc10 2045 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2046
<> 140:97feb9bacc10 2047 /* Deprecated */
<> 140:97feb9bacc10 2048 void arm_cfft_radix2_q15(
<> 140:97feb9bacc10 2049 const arm_cfft_radix2_instance_q15 * S,
<> 140:97feb9bacc10 2050 q15_t * pSrc);
<> 140:97feb9bacc10 2051
<> 140:97feb9bacc10 2052
<> 140:97feb9bacc10 2053 /**
<> 140:97feb9bacc10 2054 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 140:97feb9bacc10 2055 */
<> 140:97feb9bacc10 2056 typedef struct
<> 140:97feb9bacc10 2057 {
<> 140:97feb9bacc10 2058 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2059 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 2060 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 140:97feb9bacc10 2061 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 140:97feb9bacc10 2062 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2063 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2064 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 140:97feb9bacc10 2065 } arm_cfft_radix4_instance_q15;
<> 140:97feb9bacc10 2066
<> 140:97feb9bacc10 2067 /* Deprecated */
<> 140:97feb9bacc10 2068 arm_status arm_cfft_radix4_init_q15(
<> 140:97feb9bacc10 2069 arm_cfft_radix4_instance_q15 * S,
<> 140:97feb9bacc10 2070 uint16_t fftLen,
<> 140:97feb9bacc10 2071 uint8_t ifftFlag,
<> 140:97feb9bacc10 2072 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2073
<> 140:97feb9bacc10 2074 /* Deprecated */
<> 140:97feb9bacc10 2075 void arm_cfft_radix4_q15(
<> 140:97feb9bacc10 2076 const arm_cfft_radix4_instance_q15 * S,
<> 140:97feb9bacc10 2077 q15_t * pSrc);
<> 140:97feb9bacc10 2078
<> 140:97feb9bacc10 2079 /**
<> 140:97feb9bacc10 2080 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
<> 140:97feb9bacc10 2081 */
<> 140:97feb9bacc10 2082 typedef struct
<> 140:97feb9bacc10 2083 {
<> 140:97feb9bacc10 2084 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2085 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2088 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2089 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2090 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 140:97feb9bacc10 2091 } arm_cfft_radix2_instance_q31;
<> 140:97feb9bacc10 2092
<> 140:97feb9bacc10 2093 /* Deprecated */
<> 140:97feb9bacc10 2094 arm_status arm_cfft_radix2_init_q31(
<> 140:97feb9bacc10 2095 arm_cfft_radix2_instance_q31 * S,
<> 140:97feb9bacc10 2096 uint16_t fftLen,
<> 140:97feb9bacc10 2097 uint8_t ifftFlag,
<> 140:97feb9bacc10 2098 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2099
<> 140:97feb9bacc10 2100 /* Deprecated */
<> 140:97feb9bacc10 2101 void arm_cfft_radix2_q31(
<> 140:97feb9bacc10 2102 const arm_cfft_radix2_instance_q31 * S,
<> 140:97feb9bacc10 2103 q31_t * pSrc);
<> 140:97feb9bacc10 2104
<> 140:97feb9bacc10 2105 /**
<> 140:97feb9bacc10 2106 * @brief Instance structure for the Q31 CFFT/CIFFT function.
<> 140:97feb9bacc10 2107 */
<> 140:97feb9bacc10 2108 typedef struct
<> 140:97feb9bacc10 2109 {
<> 140:97feb9bacc10 2110 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2111 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 2112 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 140:97feb9bacc10 2113 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 140:97feb9bacc10 2114 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2115 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2116 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 140:97feb9bacc10 2117 } arm_cfft_radix4_instance_q31;
<> 140:97feb9bacc10 2118
<> 140:97feb9bacc10 2119 /* Deprecated */
<> 140:97feb9bacc10 2120 void arm_cfft_radix4_q31(
<> 140:97feb9bacc10 2121 const arm_cfft_radix4_instance_q31 * S,
<> 140:97feb9bacc10 2122 q31_t * pSrc);
<> 140:97feb9bacc10 2123
<> 140:97feb9bacc10 2124 /* Deprecated */
<> 140:97feb9bacc10 2125 arm_status arm_cfft_radix4_init_q31(
<> 140:97feb9bacc10 2126 arm_cfft_radix4_instance_q31 * S,
<> 140:97feb9bacc10 2127 uint16_t fftLen,
<> 140:97feb9bacc10 2128 uint8_t ifftFlag,
<> 140:97feb9bacc10 2129 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2130
<> 140:97feb9bacc10 2131 /**
<> 140:97feb9bacc10 2132 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 140:97feb9bacc10 2133 */
<> 140:97feb9bacc10 2134 typedef struct
<> 140:97feb9bacc10 2135 {
<> 140:97feb9bacc10 2136 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2137 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 2138 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 140:97feb9bacc10 2139 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 140:97feb9bacc10 2140 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2141 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2144 } arm_cfft_radix2_instance_f32;
<> 140:97feb9bacc10 2145
<> 140:97feb9bacc10 2146 /* Deprecated */
<> 140:97feb9bacc10 2147 arm_status arm_cfft_radix2_init_f32(
<> 140:97feb9bacc10 2148 arm_cfft_radix2_instance_f32 * S,
<> 140:97feb9bacc10 2149 uint16_t fftLen,
<> 140:97feb9bacc10 2150 uint8_t ifftFlag,
<> 140:97feb9bacc10 2151 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2152
<> 140:97feb9bacc10 2153 /* Deprecated */
<> 140:97feb9bacc10 2154 void arm_cfft_radix2_f32(
<> 140:97feb9bacc10 2155 const arm_cfft_radix2_instance_f32 * S,
<> 140:97feb9bacc10 2156 float32_t * pSrc);
<> 140:97feb9bacc10 2157
<> 140:97feb9bacc10 2158 /**
<> 140:97feb9bacc10 2159 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 140:97feb9bacc10 2160 */
<> 140:97feb9bacc10 2161 typedef struct
<> 140:97feb9bacc10 2162 {
<> 140:97feb9bacc10 2163 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2164 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 140:97feb9bacc10 2165 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 140:97feb9bacc10 2166 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 140:97feb9bacc10 2167 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2168 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2171 } arm_cfft_radix4_instance_f32;
<> 140:97feb9bacc10 2172
<> 140:97feb9bacc10 2173 /* Deprecated */
<> 140:97feb9bacc10 2174 arm_status arm_cfft_radix4_init_f32(
<> 140:97feb9bacc10 2175 arm_cfft_radix4_instance_f32 * S,
<> 140:97feb9bacc10 2176 uint16_t fftLen,
<> 140:97feb9bacc10 2177 uint8_t ifftFlag,
<> 140:97feb9bacc10 2178 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2179
<> 140:97feb9bacc10 2180 /* Deprecated */
<> 140:97feb9bacc10 2181 void arm_cfft_radix4_f32(
<> 140:97feb9bacc10 2182 const arm_cfft_radix4_instance_f32 * S,
<> 140:97feb9bacc10 2183 float32_t * pSrc);
<> 140:97feb9bacc10 2184
<> 140:97feb9bacc10 2185 /**
<> 140:97feb9bacc10 2186 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 140:97feb9bacc10 2187 */
<> 140:97feb9bacc10 2188 typedef struct
<> 140:97feb9bacc10 2189 {
<> 140:97feb9bacc10 2190 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2191 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 140:97feb9bacc10 2192 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2193 uint16_t bitRevLength; /**< bit reversal table length. */
<> 140:97feb9bacc10 2194 } arm_cfft_instance_q15;
<> 140:97feb9bacc10 2195
AnnaBridge 145:64910690c574 2196 void arm_cfft_q15(
AnnaBridge 145:64910690c574 2197 const arm_cfft_instance_q15 * S,
<> 140:97feb9bacc10 2198 q15_t * p1,
<> 140:97feb9bacc10 2199 uint8_t ifftFlag,
AnnaBridge 145:64910690c574 2200 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2201
<> 140:97feb9bacc10 2202 /**
<> 140:97feb9bacc10 2203 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 140:97feb9bacc10 2204 */
<> 140:97feb9bacc10 2205 typedef struct
<> 140:97feb9bacc10 2206 {
<> 140:97feb9bacc10 2207 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2208 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 140:97feb9bacc10 2209 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2210 uint16_t bitRevLength; /**< bit reversal table length. */
<> 140:97feb9bacc10 2211 } arm_cfft_instance_q31;
<> 140:97feb9bacc10 2212
AnnaBridge 145:64910690c574 2213 void arm_cfft_q31(
AnnaBridge 145:64910690c574 2214 const arm_cfft_instance_q31 * S,
<> 140:97feb9bacc10 2215 q31_t * p1,
<> 140:97feb9bacc10 2216 uint8_t ifftFlag,
AnnaBridge 145:64910690c574 2217 uint8_t bitReverseFlag);
AnnaBridge 145:64910690c574 2218
<> 140:97feb9bacc10 2219 /**
<> 140:97feb9bacc10 2220 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 140:97feb9bacc10 2221 */
<> 140:97feb9bacc10 2222 typedef struct
<> 140:97feb9bacc10 2223 {
<> 140:97feb9bacc10 2224 uint16_t fftLen; /**< length of the FFT. */
<> 140:97feb9bacc10 2225 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 140:97feb9bacc10 2226 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 140:97feb9bacc10 2227 uint16_t bitRevLength; /**< bit reversal table length. */
<> 140:97feb9bacc10 2228 } arm_cfft_instance_f32;
<> 140:97feb9bacc10 2229
<> 140:97feb9bacc10 2230 void arm_cfft_f32(
<> 140:97feb9bacc10 2231 const arm_cfft_instance_f32 * S,
<> 140:97feb9bacc10 2232 float32_t * p1,
<> 140:97feb9bacc10 2233 uint8_t ifftFlag,
<> 140:97feb9bacc10 2234 uint8_t bitReverseFlag);
<> 140:97feb9bacc10 2235
<> 140:97feb9bacc10 2236 /**
<> 140:97feb9bacc10 2237 * @brief Instance structure for the Q15 RFFT/RIFFT function.
<> 140:97feb9bacc10 2238 */
<> 140:97feb9bacc10 2239 typedef struct
<> 140:97feb9bacc10 2240 {
<> 140:97feb9bacc10 2241 uint32_t fftLenReal; /**< length of the real FFT. */
<> 140:97feb9bacc10 2242 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 140:97feb9bacc10 2243 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 140:97feb9bacc10 2244 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2245 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 140:97feb9bacc10 2246 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 140:97feb9bacc10 2247 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2248 } arm_rfft_instance_q15;
<> 140:97feb9bacc10 2249
<> 140:97feb9bacc10 2250 arm_status arm_rfft_init_q15(
<> 140:97feb9bacc10 2251 arm_rfft_instance_q15 * S,
<> 140:97feb9bacc10 2252 uint32_t fftLenReal,
<> 140:97feb9bacc10 2253 uint32_t ifftFlagR,
<> 140:97feb9bacc10 2254 uint32_t bitReverseFlag);
<> 140:97feb9bacc10 2255
<> 140:97feb9bacc10 2256 void arm_rfft_q15(
<> 140:97feb9bacc10 2257 const arm_rfft_instance_q15 * S,
<> 140:97feb9bacc10 2258 q15_t * pSrc,
<> 140:97feb9bacc10 2259 q15_t * pDst);
<> 140:97feb9bacc10 2260
<> 140:97feb9bacc10 2261 /**
<> 140:97feb9bacc10 2262 * @brief Instance structure for the Q31 RFFT/RIFFT function.
<> 140:97feb9bacc10 2263 */
<> 140:97feb9bacc10 2264 typedef struct
<> 140:97feb9bacc10 2265 {
<> 140:97feb9bacc10 2266 uint32_t fftLenReal; /**< length of the real FFT. */
<> 140:97feb9bacc10 2267 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 140:97feb9bacc10 2268 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 140:97feb9bacc10 2269 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2270 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 140:97feb9bacc10 2271 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 140:97feb9bacc10 2272 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2273 } arm_rfft_instance_q31;
<> 140:97feb9bacc10 2274
<> 140:97feb9bacc10 2275 arm_status arm_rfft_init_q31(
<> 140:97feb9bacc10 2276 arm_rfft_instance_q31 * S,
<> 140:97feb9bacc10 2277 uint32_t fftLenReal,
<> 140:97feb9bacc10 2278 uint32_t ifftFlagR,
<> 140:97feb9bacc10 2279 uint32_t bitReverseFlag);
<> 140:97feb9bacc10 2280
<> 140:97feb9bacc10 2281 void arm_rfft_q31(
<> 140:97feb9bacc10 2282 const arm_rfft_instance_q31 * S,
<> 140:97feb9bacc10 2283 q31_t * pSrc,
<> 140:97feb9bacc10 2284 q31_t * pDst);
<> 140:97feb9bacc10 2285
<> 140:97feb9bacc10 2286 /**
<> 140:97feb9bacc10 2287 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 140:97feb9bacc10 2288 */
<> 140:97feb9bacc10 2289 typedef struct
<> 140:97feb9bacc10 2290 {
<> 140:97feb9bacc10 2291 uint32_t fftLenReal; /**< length of the real FFT. */
<> 140:97feb9bacc10 2292 uint16_t fftLenBy2; /**< length of the complex FFT. */
<> 140:97feb9bacc10 2293 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 140:97feb9bacc10 2294 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 140:97feb9bacc10 2295 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 140:97feb9bacc10 2296 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 140:97feb9bacc10 2297 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 140:97feb9bacc10 2298 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2299 } arm_rfft_instance_f32;
<> 140:97feb9bacc10 2300
<> 140:97feb9bacc10 2301 arm_status arm_rfft_init_f32(
<> 140:97feb9bacc10 2302 arm_rfft_instance_f32 * S,
<> 140:97feb9bacc10 2303 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 140:97feb9bacc10 2304 uint32_t fftLenReal,
<> 140:97feb9bacc10 2305 uint32_t ifftFlagR,
<> 140:97feb9bacc10 2306 uint32_t bitReverseFlag);
<> 140:97feb9bacc10 2307
<> 140:97feb9bacc10 2308 void arm_rfft_f32(
<> 140:97feb9bacc10 2309 const arm_rfft_instance_f32 * S,
<> 140:97feb9bacc10 2310 float32_t * pSrc,
<> 140:97feb9bacc10 2311 float32_t * pDst);
<> 140:97feb9bacc10 2312
<> 140:97feb9bacc10 2313 /**
<> 140:97feb9bacc10 2314 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 140:97feb9bacc10 2315 */
<> 140:97feb9bacc10 2316 typedef struct
<> 140:97feb9bacc10 2317 {
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2321 } arm_rfft_fast_instance_f32 ;
<> 140:97feb9bacc10 2322
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 2326
<> 140:97feb9bacc10 2327 void arm_rfft_fast_f32(
<> 140:97feb9bacc10 2328 arm_rfft_fast_instance_f32 * S,
<> 140:97feb9bacc10 2329 float32_t * p, float32_t * pOut,
<> 140:97feb9bacc10 2330 uint8_t ifftFlag);
<> 140:97feb9bacc10 2331
<> 140:97feb9bacc10 2332 /**
<> 140:97feb9bacc10 2333 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
<> 140:97feb9bacc10 2334 */
<> 140:97feb9bacc10 2335 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2342 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
<> 140:97feb9bacc10 2343 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2344 } arm_dct4_instance_f32;
<> 140:97feb9bacc10 2345
AnnaBridge 145:64910690c574 2346
<> 140:97feb9bacc10 2347 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 2352 * @param[in] N length of the DCT4.
<> 140:97feb9bacc10 2353 * @param[in] Nby2 half of the length of the DCT4.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2357 arm_status arm_dct4_init_f32(
<> 140:97feb9bacc10 2358 arm_dct4_instance_f32 * S,
<> 140:97feb9bacc10 2359 arm_rfft_instance_f32 * S_RFFT,
<> 140:97feb9bacc10 2360 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 140:97feb9bacc10 2361 uint16_t N,
<> 140:97feb9bacc10 2362 uint16_t Nby2,
<> 140:97feb9bacc10 2363 float32_t normalize);
<> 140:97feb9bacc10 2364
AnnaBridge 145:64910690c574 2365
<> 140:97feb9bacc10 2366 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2372 void arm_dct4_f32(
<> 140:97feb9bacc10 2373 const arm_dct4_instance_f32 * S,
<> 140:97feb9bacc10 2374 float32_t * pState,
<> 140:97feb9bacc10 2375 float32_t * pInlineBuffer);
<> 140:97feb9bacc10 2376
AnnaBridge 145:64910690c574 2377
<> 140:97feb9bacc10 2378 /**
<> 140:97feb9bacc10 2379 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
<> 140:97feb9bacc10 2380 */
<> 140:97feb9bacc10 2381 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2388 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
<> 140:97feb9bacc10 2389 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2390 } arm_dct4_instance_q31;
<> 140:97feb9bacc10 2391
AnnaBridge 145:64910690c574 2392
<> 140:97feb9bacc10 2393 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2398 * @param[in] N length of the DCT4.
<> 140:97feb9bacc10 2399 * @param[in] Nby2 half of the length of the DCT4.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2403 arm_status arm_dct4_init_q31(
<> 140:97feb9bacc10 2404 arm_dct4_instance_q31 * S,
<> 140:97feb9bacc10 2405 arm_rfft_instance_q31 * S_RFFT,
<> 140:97feb9bacc10 2406 arm_cfft_radix4_instance_q31 * S_CFFT,
<> 140:97feb9bacc10 2407 uint16_t N,
<> 140:97feb9bacc10 2408 uint16_t Nby2,
<> 140:97feb9bacc10 2409 q31_t normalize);
<> 140:97feb9bacc10 2410
AnnaBridge 145:64910690c574 2411
<> 140:97feb9bacc10 2412 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2418 void arm_dct4_q31(
<> 140:97feb9bacc10 2419 const arm_dct4_instance_q31 * S,
<> 140:97feb9bacc10 2420 q31_t * pState,
<> 140:97feb9bacc10 2421 q31_t * pInlineBuffer);
<> 140:97feb9bacc10 2422
AnnaBridge 145:64910690c574 2423
<> 140:97feb9bacc10 2424 /**
<> 140:97feb9bacc10 2425 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
<> 140:97feb9bacc10 2426 */
<> 140:97feb9bacc10 2427 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 2434 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
<> 140:97feb9bacc10 2435 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 140:97feb9bacc10 2436 } arm_dct4_instance_q15;
<> 140:97feb9bacc10 2437
AnnaBridge 145:64910690c574 2438
<> 140:97feb9bacc10 2439 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 2444 * @param[in] N length of the DCT4.
<> 140:97feb9bacc10 2445 * @param[in] Nby2 half of the length of the DCT4.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2449 arm_status arm_dct4_init_q15(
<> 140:97feb9bacc10 2450 arm_dct4_instance_q15 * S,
<> 140:97feb9bacc10 2451 arm_rfft_instance_q15 * S_RFFT,
<> 140:97feb9bacc10 2452 arm_cfft_radix4_instance_q15 * S_CFFT,
<> 140:97feb9bacc10 2453 uint16_t N,
<> 140:97feb9bacc10 2454 uint16_t Nby2,
<> 140:97feb9bacc10 2455 q15_t normalize);
<> 140:97feb9bacc10 2456
AnnaBridge 145:64910690c574 2457
<> 140:97feb9bacc10 2458 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2464 void arm_dct4_q15(
<> 140:97feb9bacc10 2465 const arm_dct4_instance_q15 * S,
<> 140:97feb9bacc10 2466 q15_t * pState,
<> 140:97feb9bacc10 2467 q15_t * pInlineBuffer);
<> 140:97feb9bacc10 2468
AnnaBridge 145:64910690c574 2469
<> 140:97feb9bacc10 2470 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2477 void arm_add_f32(
<> 140:97feb9bacc10 2478 float32_t * pSrcA,
<> 140:97feb9bacc10 2479 float32_t * pSrcB,
<> 140:97feb9bacc10 2480 float32_t * pDst,
<> 140:97feb9bacc10 2481 uint32_t blockSize);
<> 140:97feb9bacc10 2482
AnnaBridge 145:64910690c574 2483
<> 140:97feb9bacc10 2484 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2491 void arm_add_q7(
<> 140:97feb9bacc10 2492 q7_t * pSrcA,
<> 140:97feb9bacc10 2493 q7_t * pSrcB,
<> 140:97feb9bacc10 2494 q7_t * pDst,
<> 140:97feb9bacc10 2495 uint32_t blockSize);
<> 140:97feb9bacc10 2496
AnnaBridge 145:64910690c574 2497
<> 140:97feb9bacc10 2498 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2505 void arm_add_q15(
<> 140:97feb9bacc10 2506 q15_t * pSrcA,
<> 140:97feb9bacc10 2507 q15_t * pSrcB,
<> 140:97feb9bacc10 2508 q15_t * pDst,
<> 140:97feb9bacc10 2509 uint32_t blockSize);
<> 140:97feb9bacc10 2510
AnnaBridge 145:64910690c574 2511
<> 140:97feb9bacc10 2512 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2519 void arm_add_q31(
<> 140:97feb9bacc10 2520 q31_t * pSrcA,
<> 140:97feb9bacc10 2521 q31_t * pSrcB,
<> 140:97feb9bacc10 2522 q31_t * pDst,
<> 140:97feb9bacc10 2523 uint32_t blockSize);
<> 140:97feb9bacc10 2524
AnnaBridge 145:64910690c574 2525
<> 140:97feb9bacc10 2526 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2533 void arm_sub_f32(
<> 140:97feb9bacc10 2534 float32_t * pSrcA,
<> 140:97feb9bacc10 2535 float32_t * pSrcB,
<> 140:97feb9bacc10 2536 float32_t * pDst,
<> 140:97feb9bacc10 2537 uint32_t blockSize);
<> 140:97feb9bacc10 2538
AnnaBridge 145:64910690c574 2539
<> 140:97feb9bacc10 2540 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2547 void arm_sub_q7(
<> 140:97feb9bacc10 2548 q7_t * pSrcA,
<> 140:97feb9bacc10 2549 q7_t * pSrcB,
<> 140:97feb9bacc10 2550 q7_t * pDst,
<> 140:97feb9bacc10 2551 uint32_t blockSize);
<> 140:97feb9bacc10 2552
AnnaBridge 145:64910690c574 2553
<> 140:97feb9bacc10 2554 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2561 void arm_sub_q15(
<> 140:97feb9bacc10 2562 q15_t * pSrcA,
<> 140:97feb9bacc10 2563 q15_t * pSrcB,
<> 140:97feb9bacc10 2564 q15_t * pDst,
<> 140:97feb9bacc10 2565 uint32_t blockSize);
<> 140:97feb9bacc10 2566
AnnaBridge 145:64910690c574 2567
<> 140:97feb9bacc10 2568 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2575 void arm_sub_q31(
<> 140:97feb9bacc10 2576 q31_t * pSrcA,
<> 140:97feb9bacc10 2577 q31_t * pSrcB,
<> 140:97feb9bacc10 2578 q31_t * pDst,
<> 140:97feb9bacc10 2579 uint32_t blockSize);
<> 140:97feb9bacc10 2580
AnnaBridge 145:64910690c574 2581
<> 140:97feb9bacc10 2582 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2589 void arm_scale_f32(
<> 140:97feb9bacc10 2590 float32_t * pSrc,
<> 140:97feb9bacc10 2591 float32_t scale,
<> 140:97feb9bacc10 2592 float32_t * pDst,
<> 140:97feb9bacc10 2593 uint32_t blockSize);
<> 140:97feb9bacc10 2594
AnnaBridge 145:64910690c574 2595
<> 140:97feb9bacc10 2596 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2604 void arm_scale_q7(
<> 140:97feb9bacc10 2605 q7_t * pSrc,
<> 140:97feb9bacc10 2606 q7_t scaleFract,
<> 140:97feb9bacc10 2607 int8_t shift,
<> 140:97feb9bacc10 2608 q7_t * pDst,
<> 140:97feb9bacc10 2609 uint32_t blockSize);
<> 140:97feb9bacc10 2610
AnnaBridge 145:64910690c574 2611
<> 140:97feb9bacc10 2612 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2620 void arm_scale_q15(
<> 140:97feb9bacc10 2621 q15_t * pSrc,
<> 140:97feb9bacc10 2622 q15_t scaleFract,
<> 140:97feb9bacc10 2623 int8_t shift,
<> 140:97feb9bacc10 2624 q15_t * pDst,
<> 140:97feb9bacc10 2625 uint32_t blockSize);
<> 140:97feb9bacc10 2626
AnnaBridge 145:64910690c574 2627
<> 140:97feb9bacc10 2628 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2636 void arm_scale_q31(
<> 140:97feb9bacc10 2637 q31_t * pSrc,
<> 140:97feb9bacc10 2638 q31_t scaleFract,
<> 140:97feb9bacc10 2639 int8_t shift,
<> 140:97feb9bacc10 2640 q31_t * pDst,
<> 140:97feb9bacc10 2641 uint32_t blockSize);
<> 140:97feb9bacc10 2642
AnnaBridge 145:64910690c574 2643
<> 140:97feb9bacc10 2644 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2650 void arm_abs_q7(
<> 140:97feb9bacc10 2651 q7_t * pSrc,
<> 140:97feb9bacc10 2652 q7_t * pDst,
<> 140:97feb9bacc10 2653 uint32_t blockSize);
<> 140:97feb9bacc10 2654
AnnaBridge 145:64910690c574 2655
<> 140:97feb9bacc10 2656 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2662 void arm_abs_f32(
<> 140:97feb9bacc10 2663 float32_t * pSrc,
<> 140:97feb9bacc10 2664 float32_t * pDst,
<> 140:97feb9bacc10 2665 uint32_t blockSize);
<> 140:97feb9bacc10 2666
AnnaBridge 145:64910690c574 2667
<> 140:97feb9bacc10 2668 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2674 void arm_abs_q15(
<> 140:97feb9bacc10 2675 q15_t * pSrc,
<> 140:97feb9bacc10 2676 q15_t * pDst,
<> 140:97feb9bacc10 2677 uint32_t blockSize);
<> 140:97feb9bacc10 2678
AnnaBridge 145:64910690c574 2679
<> 140:97feb9bacc10 2680 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2686 void arm_abs_q31(
<> 140:97feb9bacc10 2687 q31_t * pSrc,
<> 140:97feb9bacc10 2688 q31_t * pDst,
<> 140:97feb9bacc10 2689 uint32_t blockSize);
<> 140:97feb9bacc10 2690
AnnaBridge 145:64910690c574 2691
<> 140:97feb9bacc10 2692 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2699 void arm_dot_prod_f32(
<> 140:97feb9bacc10 2700 float32_t * pSrcA,
<> 140:97feb9bacc10 2701 float32_t * pSrcB,
<> 140:97feb9bacc10 2702 uint32_t blockSize,
<> 140:97feb9bacc10 2703 float32_t * result);
<> 140:97feb9bacc10 2704
AnnaBridge 145:64910690c574 2705
<> 140:97feb9bacc10 2706 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2713 void arm_dot_prod_q7(
<> 140:97feb9bacc10 2714 q7_t * pSrcA,
<> 140:97feb9bacc10 2715 q7_t * pSrcB,
<> 140:97feb9bacc10 2716 uint32_t blockSize,
<> 140:97feb9bacc10 2717 q31_t * result);
<> 140:97feb9bacc10 2718
AnnaBridge 145:64910690c574 2719
<> 140:97feb9bacc10 2720 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2727 void arm_dot_prod_q15(
<> 140:97feb9bacc10 2728 q15_t * pSrcA,
<> 140:97feb9bacc10 2729 q15_t * pSrcB,
<> 140:97feb9bacc10 2730 uint32_t blockSize,
<> 140:97feb9bacc10 2731 q63_t * result);
<> 140:97feb9bacc10 2732
AnnaBridge 145:64910690c574 2733
<> 140:97feb9bacc10 2734 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2741 void arm_dot_prod_q31(
<> 140:97feb9bacc10 2742 q31_t * pSrcA,
<> 140:97feb9bacc10 2743 q31_t * pSrcB,
<> 140:97feb9bacc10 2744 uint32_t blockSize,
<> 140:97feb9bacc10 2745 q63_t * result);
<> 140:97feb9bacc10 2746
AnnaBridge 145:64910690c574 2747
<> 140:97feb9bacc10 2748 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2755 void arm_shift_q7(
<> 140:97feb9bacc10 2756 q7_t * pSrc,
<> 140:97feb9bacc10 2757 int8_t shiftBits,
<> 140:97feb9bacc10 2758 q7_t * pDst,
<> 140:97feb9bacc10 2759 uint32_t blockSize);
<> 140:97feb9bacc10 2760
AnnaBridge 145:64910690c574 2761
<> 140:97feb9bacc10 2762 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2769 void arm_shift_q15(
<> 140:97feb9bacc10 2770 q15_t * pSrc,
<> 140:97feb9bacc10 2771 int8_t shiftBits,
<> 140:97feb9bacc10 2772 q15_t * pDst,
<> 140:97feb9bacc10 2773 uint32_t blockSize);
<> 140:97feb9bacc10 2774
AnnaBridge 145:64910690c574 2775
<> 140:97feb9bacc10 2776 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2783 void arm_shift_q31(
<> 140:97feb9bacc10 2784 q31_t * pSrc,
<> 140:97feb9bacc10 2785 int8_t shiftBits,
<> 140:97feb9bacc10 2786 q31_t * pDst,
<> 140:97feb9bacc10 2787 uint32_t blockSize);
<> 140:97feb9bacc10 2788
AnnaBridge 145:64910690c574 2789
<> 140:97feb9bacc10 2790 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2797 void arm_offset_f32(
<> 140:97feb9bacc10 2798 float32_t * pSrc,
<> 140:97feb9bacc10 2799 float32_t offset,
<> 140:97feb9bacc10 2800 float32_t * pDst,
<> 140:97feb9bacc10 2801 uint32_t blockSize);
<> 140:97feb9bacc10 2802
AnnaBridge 145:64910690c574 2803
<> 140:97feb9bacc10 2804 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2811 void arm_offset_q7(
<> 140:97feb9bacc10 2812 q7_t * pSrc,
<> 140:97feb9bacc10 2813 q7_t offset,
<> 140:97feb9bacc10 2814 q7_t * pDst,
<> 140:97feb9bacc10 2815 uint32_t blockSize);
<> 140:97feb9bacc10 2816
AnnaBridge 145:64910690c574 2817
<> 140:97feb9bacc10 2818 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2825 void arm_offset_q15(
<> 140:97feb9bacc10 2826 q15_t * pSrc,
<> 140:97feb9bacc10 2827 q15_t offset,
<> 140:97feb9bacc10 2828 q15_t * pDst,
<> 140:97feb9bacc10 2829 uint32_t blockSize);
<> 140:97feb9bacc10 2830
AnnaBridge 145:64910690c574 2831
<> 140:97feb9bacc10 2832 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2839 void arm_offset_q31(
<> 140:97feb9bacc10 2840 q31_t * pSrc,
<> 140:97feb9bacc10 2841 q31_t offset,
<> 140:97feb9bacc10 2842 q31_t * pDst,
<> 140:97feb9bacc10 2843 uint32_t blockSize);
<> 140:97feb9bacc10 2844
AnnaBridge 145:64910690c574 2845
<> 140:97feb9bacc10 2846 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2852 void arm_negate_f32(
<> 140:97feb9bacc10 2853 float32_t * pSrc,
<> 140:97feb9bacc10 2854 float32_t * pDst,
<> 140:97feb9bacc10 2855 uint32_t blockSize);
<> 140:97feb9bacc10 2856
AnnaBridge 145:64910690c574 2857
<> 140:97feb9bacc10 2858 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2864 void arm_negate_q7(
<> 140:97feb9bacc10 2865 q7_t * pSrc,
<> 140:97feb9bacc10 2866 q7_t * pDst,
<> 140:97feb9bacc10 2867 uint32_t blockSize);
<> 140:97feb9bacc10 2868
AnnaBridge 145:64910690c574 2869
<> 140:97feb9bacc10 2870 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2876 void arm_negate_q15(
<> 140:97feb9bacc10 2877 q15_t * pSrc,
<> 140:97feb9bacc10 2878 q15_t * pDst,
<> 140:97feb9bacc10 2879 uint32_t blockSize);
<> 140:97feb9bacc10 2880
AnnaBridge 145:64910690c574 2881
<> 140:97feb9bacc10 2882 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 2888 void arm_negate_q31(
<> 140:97feb9bacc10 2889 q31_t * pSrc,
<> 140:97feb9bacc10 2890 q31_t * pDst,
<> 140:97feb9bacc10 2891 uint32_t blockSize);
AnnaBridge 145:64910690c574 2892
AnnaBridge 145:64910690c574 2893
<> 140:97feb9bacc10 2894 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2899 */
<> 140:97feb9bacc10 2900 void arm_copy_f32(
<> 140:97feb9bacc10 2901 float32_t * pSrc,
<> 140:97feb9bacc10 2902 float32_t * pDst,
<> 140:97feb9bacc10 2903 uint32_t blockSize);
<> 140:97feb9bacc10 2904
AnnaBridge 145:64910690c574 2905
<> 140:97feb9bacc10 2906 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2911 */
<> 140:97feb9bacc10 2912 void arm_copy_q7(
<> 140:97feb9bacc10 2913 q7_t * pSrc,
<> 140:97feb9bacc10 2914 q7_t * pDst,
<> 140:97feb9bacc10 2915 uint32_t blockSize);
<> 140:97feb9bacc10 2916
AnnaBridge 145:64910690c574 2917
<> 140:97feb9bacc10 2918 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2923 */
<> 140:97feb9bacc10 2924 void arm_copy_q15(
<> 140:97feb9bacc10 2925 q15_t * pSrc,
<> 140:97feb9bacc10 2926 q15_t * pDst,
<> 140:97feb9bacc10 2927 uint32_t blockSize);
<> 140:97feb9bacc10 2928
AnnaBridge 145:64910690c574 2929
<> 140:97feb9bacc10 2930 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2935 */
<> 140:97feb9bacc10 2936 void arm_copy_q31(
<> 140:97feb9bacc10 2937 q31_t * pSrc,
<> 140:97feb9bacc10 2938 q31_t * pDst,
<> 140:97feb9bacc10 2939 uint32_t blockSize);
AnnaBridge 145:64910690c574 2940
AnnaBridge 145:64910690c574 2941
<> 140:97feb9bacc10 2942 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2947 */
<> 140:97feb9bacc10 2948 void arm_fill_f32(
<> 140:97feb9bacc10 2949 float32_t value,
<> 140:97feb9bacc10 2950 float32_t * pDst,
<> 140:97feb9bacc10 2951 uint32_t blockSize);
<> 140:97feb9bacc10 2952
AnnaBridge 145:64910690c574 2953
<> 140:97feb9bacc10 2954 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2959 */
<> 140:97feb9bacc10 2960 void arm_fill_q7(
<> 140:97feb9bacc10 2961 q7_t value,
<> 140:97feb9bacc10 2962 q7_t * pDst,
<> 140:97feb9bacc10 2963 uint32_t blockSize);
<> 140:97feb9bacc10 2964
AnnaBridge 145:64910690c574 2965
<> 140:97feb9bacc10 2966 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2971 */
<> 140:97feb9bacc10 2972 void arm_fill_q15(
<> 140:97feb9bacc10 2973 q15_t value,
<> 140:97feb9bacc10 2974 q15_t * pDst,
<> 140:97feb9bacc10 2975 uint32_t blockSize);
<> 140:97feb9bacc10 2976
AnnaBridge 145:64910690c574 2977
<> 140:97feb9bacc10 2978 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 2983 */
<> 140:97feb9bacc10 2984 void arm_fill_q31(
<> 140:97feb9bacc10 2985 q31_t value,
<> 140:97feb9bacc10 2986 q31_t * pDst,
<> 140:97feb9bacc10 2987 uint32_t blockSize);
<> 140:97feb9bacc10 2988
AnnaBridge 145:64910690c574 2989
<> 140:97feb9bacc10 2990 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 2997 */
<> 140:97feb9bacc10 2998 void arm_conv_f32(
<> 140:97feb9bacc10 2999 float32_t * pSrcA,
<> 140:97feb9bacc10 3000 uint32_t srcALen,
<> 140:97feb9bacc10 3001 float32_t * pSrcB,
<> 140:97feb9bacc10 3002 uint32_t srcBLen,
<> 140:97feb9bacc10 3003 float32_t * pDst);
<> 140:97feb9bacc10 3004
<> 140:97feb9bacc10 3005
<> 140:97feb9bacc10 3006 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3016 void arm_conv_opt_q15(
<> 140:97feb9bacc10 3017 q15_t * pSrcA,
<> 140:97feb9bacc10 3018 uint32_t srcALen,
<> 140:97feb9bacc10 3019 q15_t * pSrcB,
<> 140:97feb9bacc10 3020 uint32_t srcBLen,
<> 140:97feb9bacc10 3021 q15_t * pDst,
<> 140:97feb9bacc10 3022 q15_t * pScratch1,
<> 140:97feb9bacc10 3023 q15_t * pScratch2);
<> 140:97feb9bacc10 3024
<> 140:97feb9bacc10 3025
<> 140:97feb9bacc10 3026 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3033 */
<> 140:97feb9bacc10 3034 void arm_conv_q15(
<> 140:97feb9bacc10 3035 q15_t * pSrcA,
<> 140:97feb9bacc10 3036 uint32_t srcALen,
<> 140:97feb9bacc10 3037 q15_t * pSrcB,
<> 140:97feb9bacc10 3038 uint32_t srcBLen,
<> 140:97feb9bacc10 3039 q15_t * pDst);
<> 140:97feb9bacc10 3040
<> 140:97feb9bacc10 3041
<> 140:97feb9bacc10 3042 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3068 void arm_conv_fast_opt_q15(
<> 140:97feb9bacc10 3069 q15_t * pSrcA,
<> 140:97feb9bacc10 3070 uint32_t srcALen,
<> 140:97feb9bacc10 3071 q15_t * pSrcB,
<> 140:97feb9bacc10 3072 uint32_t srcBLen,
<> 140:97feb9bacc10 3073 q15_t * pDst,
<> 140:97feb9bacc10 3074 q15_t * pScratch1,
<> 140:97feb9bacc10 3075 q15_t * pScratch2);
<> 140:97feb9bacc10 3076
<> 140:97feb9bacc10 3077
<> 140:97feb9bacc10 3078 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3086 void arm_conv_q31(
<> 140:97feb9bacc10 3087 q31_t * pSrcA,
<> 140:97feb9bacc10 3088 uint32_t srcALen,
<> 140:97feb9bacc10 3089 q31_t * pSrcB,
<> 140:97feb9bacc10 3090 uint32_t srcBLen,
<> 140:97feb9bacc10 3091 q31_t * pDst);
<> 140:97feb9bacc10 3092
AnnaBridge 145:64910690c574 3093
<> 140:97feb9bacc10 3094 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3102 void arm_conv_fast_q31(
<> 140:97feb9bacc10 3103 q31_t * pSrcA,
<> 140:97feb9bacc10 3104 uint32_t srcALen,
<> 140:97feb9bacc10 3105 q31_t * pSrcB,
<> 140:97feb9bacc10 3106 uint32_t srcBLen,
<> 140:97feb9bacc10 3107 q31_t * pDst);
<> 140:97feb9bacc10 3108
<> 140:97feb9bacc10 3109
<> 140:97feb9bacc10 3110 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3120 void arm_conv_opt_q7(
<> 140:97feb9bacc10 3121 q7_t * pSrcA,
<> 140:97feb9bacc10 3122 uint32_t srcALen,
<> 140:97feb9bacc10 3123 q7_t * pSrcB,
<> 140:97feb9bacc10 3124 uint32_t srcBLen,
<> 140:97feb9bacc10 3125 q7_t * pDst,
<> 140:97feb9bacc10 3126 q15_t * pScratch1,
<> 140:97feb9bacc10 3127 q15_t * pScratch2);
<> 140:97feb9bacc10 3128
<> 140:97feb9bacc10 3129
<> 140:97feb9bacc10 3130 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3138 void arm_conv_q7(
<> 140:97feb9bacc10 3139 q7_t * pSrcA,
<> 140:97feb9bacc10 3140 uint32_t srcALen,
<> 140:97feb9bacc10 3141 q7_t * pSrcB,
<> 140:97feb9bacc10 3142 uint32_t srcBLen,
<> 140:97feb9bacc10 3143 q7_t * pDst);
<> 140:97feb9bacc10 3144
<> 140:97feb9bacc10 3145
<> 140:97feb9bacc10 3146 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3156 */
<> 140:97feb9bacc10 3157 arm_status arm_conv_partial_f32(
<> 140:97feb9bacc10 3158 float32_t * pSrcA,
<> 140:97feb9bacc10 3159 uint32_t srcALen,
<> 140:97feb9bacc10 3160 float32_t * pSrcB,
<> 140:97feb9bacc10 3161 uint32_t srcBLen,
<> 140:97feb9bacc10 3162 float32_t * pDst,
<> 140:97feb9bacc10 3163 uint32_t firstIndex,
<> 140:97feb9bacc10 3164 uint32_t numPoints);
<> 140:97feb9bacc10 3165
AnnaBridge 145:64910690c574 3166
AnnaBridge 145:64910690c574 3167 /**
<> 140:97feb9bacc10 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).
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3179 */
<> 140:97feb9bacc10 3180 arm_status arm_conv_partial_opt_q15(
<> 140:97feb9bacc10 3181 q15_t * pSrcA,
<> 140:97feb9bacc10 3182 uint32_t srcALen,
<> 140:97feb9bacc10 3183 q15_t * pSrcB,
<> 140:97feb9bacc10 3184 uint32_t srcBLen,
<> 140:97feb9bacc10 3185 q15_t * pDst,
<> 140:97feb9bacc10 3186 uint32_t firstIndex,
<> 140:97feb9bacc10 3187 uint32_t numPoints,
<> 140:97feb9bacc10 3188 q15_t * pScratch1,
<> 140:97feb9bacc10 3189 q15_t * pScratch2);
<> 140:97feb9bacc10 3190
<> 140:97feb9bacc10 3191
AnnaBridge 145:64910690c574 3192 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3202 */
<> 140:97feb9bacc10 3203 arm_status arm_conv_partial_q15(
<> 140:97feb9bacc10 3204 q15_t * pSrcA,
<> 140:97feb9bacc10 3205 uint32_t srcALen,
<> 140:97feb9bacc10 3206 q15_t * pSrcB,
<> 140:97feb9bacc10 3207 uint32_t srcBLen,
<> 140:97feb9bacc10 3208 q15_t * pDst,
<> 140:97feb9bacc10 3209 uint32_t firstIndex,
<> 140:97feb9bacc10 3210 uint32_t numPoints);
<> 140:97feb9bacc10 3211
AnnaBridge 145:64910690c574 3212
<> 140:97feb9bacc10 3213 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3223 */
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 3232
<> 140:97feb9bacc10 3233
<> 140:97feb9bacc10 3234 /**
<> 140:97feb9bacc10 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).
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3246 */
<> 140:97feb9bacc10 3247 arm_status arm_conv_partial_fast_opt_q15(
<> 140:97feb9bacc10 3248 q15_t * pSrcA,
<> 140:97feb9bacc10 3249 uint32_t srcALen,
<> 140:97feb9bacc10 3250 q15_t * pSrcB,
<> 140:97feb9bacc10 3251 uint32_t srcBLen,
<> 140:97feb9bacc10 3252 q15_t * pDst,
<> 140:97feb9bacc10 3253 uint32_t firstIndex,
<> 140:97feb9bacc10 3254 uint32_t numPoints,
<> 140:97feb9bacc10 3255 q15_t * pScratch1,
<> 140:97feb9bacc10 3256 q15_t * pScratch2);
<> 140:97feb9bacc10 3257
<> 140:97feb9bacc10 3258
<> 140:97feb9bacc10 3259 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3269 */
<> 140:97feb9bacc10 3270 arm_status arm_conv_partial_q31(
<> 140:97feb9bacc10 3271 q31_t * pSrcA,
<> 140:97feb9bacc10 3272 uint32_t srcALen,
<> 140:97feb9bacc10 3273 q31_t * pSrcB,
<> 140:97feb9bacc10 3274 uint32_t srcBLen,
<> 140:97feb9bacc10 3275 q31_t * pDst,
<> 140:97feb9bacc10 3276 uint32_t firstIndex,
<> 140:97feb9bacc10 3277 uint32_t numPoints);
<> 140:97feb9bacc10 3278
<> 140:97feb9bacc10 3279
<> 140:97feb9bacc10 3280 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3290 */
<> 140:97feb9bacc10 3291 arm_status arm_conv_partial_fast_q31(
<> 140:97feb9bacc10 3292 q31_t * pSrcA,
<> 140:97feb9bacc10 3293 uint32_t srcALen,
<> 140:97feb9bacc10 3294 q31_t * pSrcB,
<> 140:97feb9bacc10 3295 uint32_t srcBLen,
<> 140:97feb9bacc10 3296 q31_t * pDst,
<> 140:97feb9bacc10 3297 uint32_t firstIndex,
<> 140:97feb9bacc10 3298 uint32_t numPoints);
<> 140:97feb9bacc10 3299
<> 140:97feb9bacc10 3300
<> 140:97feb9bacc10 3301 /**
<> 140:97feb9bacc10 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).
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3313 */
<> 140:97feb9bacc10 3314 arm_status arm_conv_partial_opt_q7(
<> 140:97feb9bacc10 3315 q7_t * pSrcA,
<> 140:97feb9bacc10 3316 uint32_t srcALen,
<> 140:97feb9bacc10 3317 q7_t * pSrcB,
<> 140:97feb9bacc10 3318 uint32_t srcBLen,
<> 140:97feb9bacc10 3319 q7_t * pDst,
<> 140:97feb9bacc10 3320 uint32_t firstIndex,
<> 140:97feb9bacc10 3321 uint32_t numPoints,
<> 140:97feb9bacc10 3322 q15_t * pScratch1,
<> 140:97feb9bacc10 3323 q15_t * pScratch2);
<> 140:97feb9bacc10 3324
<> 140:97feb9bacc10 3325
<> 140:97feb9bacc10 3326 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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].
<> 140:97feb9bacc10 3336 */
<> 140:97feb9bacc10 3337 arm_status arm_conv_partial_q7(
<> 140:97feb9bacc10 3338 q7_t * pSrcA,
<> 140:97feb9bacc10 3339 uint32_t srcALen,
<> 140:97feb9bacc10 3340 q7_t * pSrcB,
<> 140:97feb9bacc10 3341 uint32_t srcBLen,
<> 140:97feb9bacc10 3342 q7_t * pDst,
<> 140:97feb9bacc10 3343 uint32_t firstIndex,
<> 140:97feb9bacc10 3344 uint32_t numPoints);
<> 140:97feb9bacc10 3345
<> 140:97feb9bacc10 3346
<> 140:97feb9bacc10 3347 /**
<> 140:97feb9bacc10 3348 * @brief Instance structure for the Q15 FIR decimator.
<> 140:97feb9bacc10 3349 */
<> 140:97feb9bacc10 3350 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3356 } arm_fir_decimate_instance_q15;
<> 140:97feb9bacc10 3357
<> 140:97feb9bacc10 3358 /**
<> 140:97feb9bacc10 3359 * @brief Instance structure for the Q31 FIR decimator.
<> 140:97feb9bacc10 3360 */
<> 140:97feb9bacc10 3361 typedef struct
<> 140:97feb9bacc10 3362 {
<> 140:97feb9bacc10 3363 uint8_t M; /**< decimation factor. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3367 } arm_fir_decimate_instance_q31;
<> 140:97feb9bacc10 3368
<> 140:97feb9bacc10 3369 /**
<> 140:97feb9bacc10 3370 * @brief Instance structure for the floating-point FIR decimator.
<> 140:97feb9bacc10 3371 */
<> 140:97feb9bacc10 3372 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3378 } arm_fir_decimate_instance_f32;
<> 140:97feb9bacc10 3379
<> 140:97feb9bacc10 3380
<> 140:97feb9bacc10 3381 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3388 void arm_fir_decimate_f32(
<> 140:97feb9bacc10 3389 const arm_fir_decimate_instance_f32 * S,
<> 140:97feb9bacc10 3390 float32_t * pSrc,
<> 140:97feb9bacc10 3391 float32_t * pDst,
<> 140:97feb9bacc10 3392 uint32_t blockSize);
<> 140:97feb9bacc10 3393
<> 140:97feb9bacc10 3394
<> 140:97feb9bacc10 3395 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3403 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3404 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 140:97feb9bacc10 3405 */
<> 140:97feb9bacc10 3406 arm_status arm_fir_decimate_init_f32(
<> 140:97feb9bacc10 3407 arm_fir_decimate_instance_f32 * S,
<> 140:97feb9bacc10 3408 uint16_t numTaps,
<> 140:97feb9bacc10 3409 uint8_t M,
<> 140:97feb9bacc10 3410 float32_t * pCoeffs,
<> 140:97feb9bacc10 3411 float32_t * pState,
<> 140:97feb9bacc10 3412 uint32_t blockSize);
<> 140:97feb9bacc10 3413
AnnaBridge 145:64910690c574 3414
<> 140:97feb9bacc10 3415 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3422 void arm_fir_decimate_q15(
<> 140:97feb9bacc10 3423 const arm_fir_decimate_instance_q15 * S,
<> 140:97feb9bacc10 3424 q15_t * pSrc,
<> 140:97feb9bacc10 3425 q15_t * pDst,
<> 140:97feb9bacc10 3426 uint32_t blockSize);
<> 140:97feb9bacc10 3427
AnnaBridge 145:64910690c574 3428
<> 140:97feb9bacc10 3429 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3436 void arm_fir_decimate_fast_q15(
<> 140:97feb9bacc10 3437 const arm_fir_decimate_instance_q15 * S,
<> 140:97feb9bacc10 3438 q15_t * pSrc,
<> 140:97feb9bacc10 3439 q15_t * pDst,
<> 140:97feb9bacc10 3440 uint32_t blockSize);
<> 140:97feb9bacc10 3441
<> 140:97feb9bacc10 3442
<> 140:97feb9bacc10 3443 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3451 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3452 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 140:97feb9bacc10 3453 */
<> 140:97feb9bacc10 3454 arm_status arm_fir_decimate_init_q15(
<> 140:97feb9bacc10 3455 arm_fir_decimate_instance_q15 * S,
<> 140:97feb9bacc10 3456 uint16_t numTaps,
<> 140:97feb9bacc10 3457 uint8_t M,
<> 140:97feb9bacc10 3458 q15_t * pCoeffs,
<> 140:97feb9bacc10 3459 q15_t * pState,
<> 140:97feb9bacc10 3460 uint32_t blockSize);
<> 140:97feb9bacc10 3461
AnnaBridge 145:64910690c574 3462
<> 140:97feb9bacc10 3463 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 3468 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 3469 */
<> 140:97feb9bacc10 3470 void arm_fir_decimate_q31(
<> 140:97feb9bacc10 3471 const arm_fir_decimate_instance_q31 * S,
<> 140:97feb9bacc10 3472 q31_t * pSrc,
<> 140:97feb9bacc10 3473 q31_t * pDst,
<> 140:97feb9bacc10 3474 uint32_t blockSize);
<> 140:97feb9bacc10 3475
<> 140:97feb9bacc10 3476 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3483 void arm_fir_decimate_fast_q31(
<> 140:97feb9bacc10 3484 arm_fir_decimate_instance_q31 * S,
<> 140:97feb9bacc10 3485 q31_t * pSrc,
<> 140:97feb9bacc10 3486 q31_t * pDst,
<> 140:97feb9bacc10 3487 uint32_t blockSize);
<> 140:97feb9bacc10 3488
<> 140:97feb9bacc10 3489
<> 140:97feb9bacc10 3490 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3498 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3499 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 140:97feb9bacc10 3500 */
<> 140:97feb9bacc10 3501 arm_status arm_fir_decimate_init_q31(
<> 140:97feb9bacc10 3502 arm_fir_decimate_instance_q31 * S,
<> 140:97feb9bacc10 3503 uint16_t numTaps,
<> 140:97feb9bacc10 3504 uint8_t M,
<> 140:97feb9bacc10 3505 q31_t * pCoeffs,
<> 140:97feb9bacc10 3506 q31_t * pState,
<> 140:97feb9bacc10 3507 uint32_t blockSize);
<> 140:97feb9bacc10 3508
<> 140:97feb9bacc10 3509
<> 140:97feb9bacc10 3510 /**
<> 140:97feb9bacc10 3511 * @brief Instance structure for the Q15 FIR interpolator.
<> 140:97feb9bacc10 3512 */
<> 140:97feb9bacc10 3513 typedef struct
<> 140:97feb9bacc10 3514 {
<> 140:97feb9bacc10 3515 uint8_t L; /**< upsample factor. */
<> 140:97feb9bacc10 3516 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 140:97feb9bacc10 3517 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 140:97feb9bacc10 3518 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 140:97feb9bacc10 3519 } arm_fir_interpolate_instance_q15;
<> 140:97feb9bacc10 3520
<> 140:97feb9bacc10 3521 /**
<> 140:97feb9bacc10 3522 * @brief Instance structure for the Q31 FIR interpolator.
<> 140:97feb9bacc10 3523 */
<> 140:97feb9bacc10 3524 typedef struct
<> 140:97feb9bacc10 3525 {
<> 140:97feb9bacc10 3526 uint8_t L; /**< upsample factor. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3530 } arm_fir_interpolate_instance_q31;
<> 140:97feb9bacc10 3531
<> 140:97feb9bacc10 3532 /**
<> 140:97feb9bacc10 3533 * @brief Instance structure for the floating-point FIR interpolator.
<> 140:97feb9bacc10 3534 */
<> 140:97feb9bacc10 3535 typedef struct
<> 140:97feb9bacc10 3536 {
<> 140:97feb9bacc10 3537 uint8_t L; /**< upsample factor. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3541 } arm_fir_interpolate_instance_f32;
<> 140:97feb9bacc10 3542
<> 140:97feb9bacc10 3543
<> 140:97feb9bacc10 3544 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3551 void arm_fir_interpolate_q15(
<> 140:97feb9bacc10 3552 const arm_fir_interpolate_instance_q15 * S,
<> 140:97feb9bacc10 3553 q15_t * pSrc,
<> 140:97feb9bacc10 3554 q15_t * pDst,
<> 140:97feb9bacc10 3555 uint32_t blockSize);
<> 140:97feb9bacc10 3556
<> 140:97feb9bacc10 3557
<> 140:97feb9bacc10 3558 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3566 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3567 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 140:97feb9bacc10 3568 */
<> 140:97feb9bacc10 3569 arm_status arm_fir_interpolate_init_q15(
<> 140:97feb9bacc10 3570 arm_fir_interpolate_instance_q15 * S,
<> 140:97feb9bacc10 3571 uint8_t L,
<> 140:97feb9bacc10 3572 uint16_t numTaps,
<> 140:97feb9bacc10 3573 q15_t * pCoeffs,
<> 140:97feb9bacc10 3574 q15_t * pState,
<> 140:97feb9bacc10 3575 uint32_t blockSize);
<> 140:97feb9bacc10 3576
AnnaBridge 145:64910690c574 3577
<> 140:97feb9bacc10 3578 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3585 void arm_fir_interpolate_q31(
<> 140:97feb9bacc10 3586 const arm_fir_interpolate_instance_q31 * S,
<> 140:97feb9bacc10 3587 q31_t * pSrc,
<> 140:97feb9bacc10 3588 q31_t * pDst,
<> 140:97feb9bacc10 3589 uint32_t blockSize);
<> 140:97feb9bacc10 3590
AnnaBridge 145:64910690c574 3591
<> 140:97feb9bacc10 3592 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3600 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3601 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 140:97feb9bacc10 3602 */
<> 140:97feb9bacc10 3603 arm_status arm_fir_interpolate_init_q31(
<> 140:97feb9bacc10 3604 arm_fir_interpolate_instance_q31 * S,
<> 140:97feb9bacc10 3605 uint8_t L,
<> 140:97feb9bacc10 3606 uint16_t numTaps,
<> 140:97feb9bacc10 3607 q31_t * pCoeffs,
<> 140:97feb9bacc10 3608 q31_t * pState,
<> 140:97feb9bacc10 3609 uint32_t blockSize);
<> 140:97feb9bacc10 3610
<> 140:97feb9bacc10 3611
<> 140:97feb9bacc10 3612 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3619 void arm_fir_interpolate_f32(
<> 140:97feb9bacc10 3620 const arm_fir_interpolate_instance_f32 * S,
<> 140:97feb9bacc10 3621 float32_t * pSrc,
<> 140:97feb9bacc10 3622 float32_t * pDst,
<> 140:97feb9bacc10 3623 uint32_t blockSize);
<> 140:97feb9bacc10 3624
AnnaBridge 145:64910690c574 3625
<> 140:97feb9bacc10 3626 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3634 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 140:97feb9bacc10 3635 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 140:97feb9bacc10 3636 */
<> 140:97feb9bacc10 3637 arm_status arm_fir_interpolate_init_f32(
<> 140:97feb9bacc10 3638 arm_fir_interpolate_instance_f32 * S,
<> 140:97feb9bacc10 3639 uint8_t L,
<> 140:97feb9bacc10 3640 uint16_t numTaps,
<> 140:97feb9bacc10 3641 float32_t * pCoeffs,
<> 140:97feb9bacc10 3642 float32_t * pState,
<> 140:97feb9bacc10 3643 uint32_t blockSize);
<> 140:97feb9bacc10 3644
AnnaBridge 145:64910690c574 3645
<> 140:97feb9bacc10 3646 /**
<> 140:97feb9bacc10 3647 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
<> 140:97feb9bacc10 3648 */
<> 140:97feb9bacc10 3649 typedef struct
<> 140:97feb9bacc10 3650 {
<> 140:97feb9bacc10 3651 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 140:97feb9bacc10 3652 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 140:97feb9bacc10 3653 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 140:97feb9bacc10 3654 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
<> 140:97feb9bacc10 3655 } arm_biquad_cas_df1_32x64_ins_q31;
<> 140:97feb9bacc10 3656
<> 140:97feb9bacc10 3657
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3664 void arm_biquad_cas_df1_32x64_q31(
<> 140:97feb9bacc10 3665 const arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 140:97feb9bacc10 3666 q31_t * pSrc,
<> 140:97feb9bacc10 3667 q31_t * pDst,
<> 140:97feb9bacc10 3668 uint32_t blockSize);
<> 140:97feb9bacc10 3669
<> 140:97feb9bacc10 3670
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3678 void arm_biquad_cas_df1_32x64_init_q31(
<> 140:97feb9bacc10 3679 arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 140:97feb9bacc10 3680 uint8_t numStages,
<> 140:97feb9bacc10 3681 q31_t * pCoeffs,
<> 140:97feb9bacc10 3682 q63_t * pState,
<> 140:97feb9bacc10 3683 uint8_t postShift);
<> 140:97feb9bacc10 3684
<> 140:97feb9bacc10 3685
<> 140:97feb9bacc10 3686 /**
<> 140:97feb9bacc10 3687 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 140:97feb9bacc10 3688 */
<> 140:97feb9bacc10 3689 typedef struct
<> 140:97feb9bacc10 3690 {
<> 140:97feb9bacc10 3691 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 140:97feb9bacc10 3692 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 140:97feb9bacc10 3693 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 140:97feb9bacc10 3694 } arm_biquad_cascade_df2T_instance_f32;
<> 140:97feb9bacc10 3695
<> 140:97feb9bacc10 3696 /**
<> 140:97feb9bacc10 3697 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 140:97feb9bacc10 3698 */
<> 140:97feb9bacc10 3699 typedef struct
<> 140:97feb9bacc10 3700 {
<> 140:97feb9bacc10 3701 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 140:97feb9bacc10 3702 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 140:97feb9bacc10 3703 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 140:97feb9bacc10 3704 } arm_biquad_cascade_stereo_df2T_instance_f32;
<> 140:97feb9bacc10 3705
<> 140:97feb9bacc10 3706 /**
<> 140:97feb9bacc10 3707 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 140:97feb9bacc10 3708 */
<> 140:97feb9bacc10 3709 typedef struct
<> 140:97feb9bacc10 3710 {
<> 140:97feb9bacc10 3711 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 140:97feb9bacc10 3712 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 140:97feb9bacc10 3713 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 140:97feb9bacc10 3714 } arm_biquad_cascade_df2T_instance_f64;
<> 140:97feb9bacc10 3715
<> 140:97feb9bacc10 3716
<> 140:97feb9bacc10 3717 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3724 void arm_biquad_cascade_df2T_f32(
<> 140:97feb9bacc10 3725 const arm_biquad_cascade_df2T_instance_f32 * S,
<> 140:97feb9bacc10 3726 float32_t * pSrc,
<> 140:97feb9bacc10 3727 float32_t * pDst,
<> 140:97feb9bacc10 3728 uint32_t blockSize);
<> 140:97feb9bacc10 3729
<> 140:97feb9bacc10 3730
<> 140:97feb9bacc10 3731 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3738 void arm_biquad_cascade_stereo_df2T_f32(
<> 140:97feb9bacc10 3739 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 140:97feb9bacc10 3740 float32_t * pSrc,
<> 140:97feb9bacc10 3741 float32_t * pDst,
<> 140:97feb9bacc10 3742 uint32_t blockSize);
<> 140:97feb9bacc10 3743
AnnaBridge 145:64910690c574 3744
<> 140:97feb9bacc10 3745 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3752 void arm_biquad_cascade_df2T_f64(
<> 140:97feb9bacc10 3753 const arm_biquad_cascade_df2T_instance_f64 * S,
<> 140:97feb9bacc10 3754 float64_t * pSrc,
<> 140:97feb9bacc10 3755 float64_t * pDst,
<> 140:97feb9bacc10 3756 uint32_t blockSize);
<> 140:97feb9bacc10 3757
<> 140:97feb9bacc10 3758
<> 140:97feb9bacc10 3759 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3766 void arm_biquad_cascade_df2T_init_f32(
<> 140:97feb9bacc10 3767 arm_biquad_cascade_df2T_instance_f32 * S,
<> 140:97feb9bacc10 3768 uint8_t numStages,
<> 140:97feb9bacc10 3769 float32_t * pCoeffs,
<> 140:97feb9bacc10 3770 float32_t * pState);
<> 140:97feb9bacc10 3771
<> 140:97feb9bacc10 3772
<> 140:97feb9bacc10 3773 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3780 void arm_biquad_cascade_stereo_df2T_init_f32(
<> 140:97feb9bacc10 3781 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 140:97feb9bacc10 3782 uint8_t numStages,
<> 140:97feb9bacc10 3783 float32_t * pCoeffs,
<> 140:97feb9bacc10 3784 float32_t * pState);
<> 140:97feb9bacc10 3785
<> 140:97feb9bacc10 3786
<> 140:97feb9bacc10 3787 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3794 void arm_biquad_cascade_df2T_init_f64(
<> 140:97feb9bacc10 3795 arm_biquad_cascade_df2T_instance_f64 * S,
<> 140:97feb9bacc10 3796 uint8_t numStages,
<> 140:97feb9bacc10 3797 float64_t * pCoeffs,
<> 140:97feb9bacc10 3798 float64_t * pState);
<> 140:97feb9bacc10 3799
<> 140:97feb9bacc10 3800
<> 140:97feb9bacc10 3801 /**
<> 140:97feb9bacc10 3802 * @brief Instance structure for the Q15 FIR lattice filter.
<> 140:97feb9bacc10 3803 */
<> 140:97feb9bacc10 3804 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3809 } arm_fir_lattice_instance_q15;
<> 140:97feb9bacc10 3810
<> 140:97feb9bacc10 3811 /**
<> 140:97feb9bacc10 3812 * @brief Instance structure for the Q31 FIR lattice filter.
<> 140:97feb9bacc10 3813 */
<> 140:97feb9bacc10 3814 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3819 } arm_fir_lattice_instance_q31;
<> 140:97feb9bacc10 3820
<> 140:97feb9bacc10 3821 /**
<> 140:97feb9bacc10 3822 * @brief Instance structure for the floating-point FIR lattice filter.
<> 140:97feb9bacc10 3823 */
<> 140:97feb9bacc10 3824 typedef struct
<> 140:97feb9bacc10 3825 {
<> 140:97feb9bacc10 3826 uint16_t numStages; /**< number of filter stages. */
<> 140:97feb9bacc10 3827 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 140:97feb9bacc10 3828 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 140:97feb9bacc10 3829 } arm_fir_lattice_instance_f32;
<> 140:97feb9bacc10 3830
AnnaBridge 145:64910690c574 3831
<> 140:97feb9bacc10 3832 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3839 void arm_fir_lattice_init_q15(
<> 140:97feb9bacc10 3840 arm_fir_lattice_instance_q15 * S,
<> 140:97feb9bacc10 3841 uint16_t numStages,
<> 140:97feb9bacc10 3842 q15_t * pCoeffs,
<> 140:97feb9bacc10 3843 q15_t * pState);
<> 140:97feb9bacc10 3844
<> 140:97feb9bacc10 3845
<> 140:97feb9bacc10 3846 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3852 */
<> 140:97feb9bacc10 3853 void arm_fir_lattice_q15(
<> 140:97feb9bacc10 3854 const arm_fir_lattice_instance_q15 * S,
<> 140:97feb9bacc10 3855 q15_t * pSrc,
<> 140:97feb9bacc10 3856 q15_t * pDst,
<> 140:97feb9bacc10 3857 uint32_t blockSize);
<> 140:97feb9bacc10 3858
AnnaBridge 145:64910690c574 3859
<> 140:97feb9bacc10 3860 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3867 void arm_fir_lattice_init_q31(
<> 140:97feb9bacc10 3868 arm_fir_lattice_instance_q31 * S,
<> 140:97feb9bacc10 3869 uint16_t numStages,
<> 140:97feb9bacc10 3870 q31_t * pCoeffs,
<> 140:97feb9bacc10 3871 q31_t * pState);
<> 140:97feb9bacc10 3872
<> 140:97feb9bacc10 3873
<> 140:97feb9bacc10 3874 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3881 void arm_fir_lattice_q31(
<> 140:97feb9bacc10 3882 const arm_fir_lattice_instance_q31 * S,
<> 140:97feb9bacc10 3883 q31_t * pSrc,
<> 140:97feb9bacc10 3884 q31_t * pDst,
<> 140:97feb9bacc10 3885 uint32_t blockSize);
<> 140:97feb9bacc10 3886
AnnaBridge 145:64910690c574 3887
<> 140:97feb9bacc10 3888 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 3894 */
<> 140:97feb9bacc10 3895 void arm_fir_lattice_init_f32(
<> 140:97feb9bacc10 3896 arm_fir_lattice_instance_f32 * S,
<> 140:97feb9bacc10 3897 uint16_t numStages,
<> 140:97feb9bacc10 3898 float32_t * pCoeffs,
<> 140:97feb9bacc10 3899 float32_t * pState);
<> 140:97feb9bacc10 3900
AnnaBridge 145:64910690c574 3901
<> 140:97feb9bacc10 3902 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3909 void arm_fir_lattice_f32(
<> 140:97feb9bacc10 3910 const arm_fir_lattice_instance_f32 * S,
<> 140:97feb9bacc10 3911 float32_t * pSrc,
<> 140:97feb9bacc10 3912 float32_t * pDst,
<> 140:97feb9bacc10 3913 uint32_t blockSize);
<> 140:97feb9bacc10 3914
AnnaBridge 145:64910690c574 3915
<> 140:97feb9bacc10 3916 /**
<> 140:97feb9bacc10 3917 * @brief Instance structure for the Q15 IIR lattice filter.
<> 140:97feb9bacc10 3918 */
<> 140:97feb9bacc10 3919 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3925 } arm_iir_lattice_instance_q15;
<> 140:97feb9bacc10 3926
<> 140:97feb9bacc10 3927 /**
<> 140:97feb9bacc10 3928 * @brief Instance structure for the Q31 IIR lattice filter.
<> 140:97feb9bacc10 3929 */
<> 140:97feb9bacc10 3930 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3936 } arm_iir_lattice_instance_q31;
<> 140:97feb9bacc10 3937
<> 140:97feb9bacc10 3938 /**
<> 140:97feb9bacc10 3939 * @brief Instance structure for the floating-point IIR lattice filter.
<> 140:97feb9bacc10 3940 */
<> 140:97feb9bacc10 3941 typedef struct
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 3947 } arm_iir_lattice_instance_f32;
<> 140:97feb9bacc10 3948
AnnaBridge 145:64910690c574 3949
<> 140:97feb9bacc10 3950 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3957 void arm_iir_lattice_f32(
<> 140:97feb9bacc10 3958 const arm_iir_lattice_instance_f32 * S,
<> 140:97feb9bacc10 3959 float32_t * pSrc,
<> 140:97feb9bacc10 3960 float32_t * pDst,
<> 140:97feb9bacc10 3961 uint32_t blockSize);
<> 140:97feb9bacc10 3962
AnnaBridge 145:64910690c574 3963
<> 140:97feb9bacc10 3964 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3973 void arm_iir_lattice_init_f32(
<> 140:97feb9bacc10 3974 arm_iir_lattice_instance_f32 * S,
<> 140:97feb9bacc10 3975 uint16_t numStages,
<> 140:97feb9bacc10 3976 float32_t * pkCoeffs,
<> 140:97feb9bacc10 3977 float32_t * pvCoeffs,
<> 140:97feb9bacc10 3978 float32_t * pState,
<> 140:97feb9bacc10 3979 uint32_t blockSize);
<> 140:97feb9bacc10 3980
<> 140:97feb9bacc10 3981
<> 140:97feb9bacc10 3982 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 3989 void arm_iir_lattice_q31(
<> 140:97feb9bacc10 3990 const arm_iir_lattice_instance_q31 * S,
<> 140:97feb9bacc10 3991 q31_t * pSrc,
<> 140:97feb9bacc10 3992 q31_t * pDst,
<> 140:97feb9bacc10 3993 uint32_t blockSize);
<> 140:97feb9bacc10 3994
<> 140:97feb9bacc10 3995
<> 140:97feb9bacc10 3996 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4005 void arm_iir_lattice_init_q31(
<> 140:97feb9bacc10 4006 arm_iir_lattice_instance_q31 * S,
<> 140:97feb9bacc10 4007 uint16_t numStages,
<> 140:97feb9bacc10 4008 q31_t * pkCoeffs,
<> 140:97feb9bacc10 4009 q31_t * pvCoeffs,
<> 140:97feb9bacc10 4010 q31_t * pState,
<> 140:97feb9bacc10 4011 uint32_t blockSize);
<> 140:97feb9bacc10 4012
<> 140:97feb9bacc10 4013
<> 140:97feb9bacc10 4014 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4021 void arm_iir_lattice_q15(
<> 140:97feb9bacc10 4022 const arm_iir_lattice_instance_q15 * S,
<> 140:97feb9bacc10 4023 q15_t * pSrc,
<> 140:97feb9bacc10 4024 q15_t * pDst,
<> 140:97feb9bacc10 4025 uint32_t blockSize);
<> 140:97feb9bacc10 4026
<> 140:97feb9bacc10 4027
<> 140:97feb9bacc10 4028 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4036 */
<> 140:97feb9bacc10 4037 void arm_iir_lattice_init_q15(
<> 140:97feb9bacc10 4038 arm_iir_lattice_instance_q15 * S,
<> 140:97feb9bacc10 4039 uint16_t numStages,
<> 140:97feb9bacc10 4040 q15_t * pkCoeffs,
<> 140:97feb9bacc10 4041 q15_t * pvCoeffs,
<> 140:97feb9bacc10 4042 q15_t * pState,
<> 140:97feb9bacc10 4043 uint32_t blockSize);
<> 140:97feb9bacc10 4044
AnnaBridge 145:64910690c574 4045
<> 140:97feb9bacc10 4046 /**
<> 140:97feb9bacc10 4047 * @brief Instance structure for the floating-point LMS filter.
<> 140:97feb9bacc10 4048 */
<> 140:97feb9bacc10 4049 typedef struct
<> 140:97feb9bacc10 4050 {
<> 140:97feb9bacc10 4051 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4052 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 4053 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 4054 float32_t mu; /**< step size that controls filter coefficient updates. */
<> 140:97feb9bacc10 4055 } arm_lms_instance_f32;
<> 140:97feb9bacc10 4056
AnnaBridge 145:64910690c574 4057
<> 140:97feb9bacc10 4058 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4067 void arm_lms_f32(
<> 140:97feb9bacc10 4068 const arm_lms_instance_f32 * S,
<> 140:97feb9bacc10 4069 float32_t * pSrc,
<> 140:97feb9bacc10 4070 float32_t * pRef,
<> 140:97feb9bacc10 4071 float32_t * pOut,
<> 140:97feb9bacc10 4072 float32_t * pErr,
<> 140:97feb9bacc10 4073 uint32_t blockSize);
<> 140:97feb9bacc10 4074
AnnaBridge 145:64910690c574 4075
<> 140:97feb9bacc10 4076 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4085 void arm_lms_init_f32(
<> 140:97feb9bacc10 4086 arm_lms_instance_f32 * S,
<> 140:97feb9bacc10 4087 uint16_t numTaps,
<> 140:97feb9bacc10 4088 float32_t * pCoeffs,
<> 140:97feb9bacc10 4089 float32_t * pState,
<> 140:97feb9bacc10 4090 float32_t mu,
<> 140:97feb9bacc10 4091 uint32_t blockSize);
<> 140:97feb9bacc10 4092
AnnaBridge 145:64910690c574 4093
<> 140:97feb9bacc10 4094 /**
<> 140:97feb9bacc10 4095 * @brief Instance structure for the Q15 LMS filter.
<> 140:97feb9bacc10 4096 */
<> 140:97feb9bacc10 4097 typedef struct
<> 140:97feb9bacc10 4098 {
<> 140:97feb9bacc10 4099 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4100 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 4101 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 4102 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 140:97feb9bacc10 4103 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 140:97feb9bacc10 4104 } arm_lms_instance_q15;
<> 140:97feb9bacc10 4105
<> 140:97feb9bacc10 4106
<> 140:97feb9bacc10 4107 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4117 void arm_lms_init_q15(
<> 140:97feb9bacc10 4118 arm_lms_instance_q15 * S,
<> 140:97feb9bacc10 4119 uint16_t numTaps,
<> 140:97feb9bacc10 4120 q15_t * pCoeffs,
<> 140:97feb9bacc10 4121 q15_t * pState,
<> 140:97feb9bacc10 4122 q15_t mu,
<> 140:97feb9bacc10 4123 uint32_t blockSize,
<> 140:97feb9bacc10 4124 uint32_t postShift);
<> 140:97feb9bacc10 4125
AnnaBridge 145:64910690c574 4126
<> 140:97feb9bacc10 4127 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4136 void arm_lms_q15(
<> 140:97feb9bacc10 4137 const arm_lms_instance_q15 * S,
<> 140:97feb9bacc10 4138 q15_t * pSrc,
<> 140:97feb9bacc10 4139 q15_t * pRef,
<> 140:97feb9bacc10 4140 q15_t * pOut,
<> 140:97feb9bacc10 4141 q15_t * pErr,
<> 140:97feb9bacc10 4142 uint32_t blockSize);
<> 140:97feb9bacc10 4143
<> 140:97feb9bacc10 4144
<> 140:97feb9bacc10 4145 /**
<> 140:97feb9bacc10 4146 * @brief Instance structure for the Q31 LMS filter.
<> 140:97feb9bacc10 4147 */
<> 140:97feb9bacc10 4148 typedef struct
<> 140:97feb9bacc10 4149 {
<> 140:97feb9bacc10 4150 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4151 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 4152 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 4153 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 140:97feb9bacc10 4154 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 140:97feb9bacc10 4155 } arm_lms_instance_q31;
<> 140:97feb9bacc10 4156
AnnaBridge 145:64910690c574 4157
<> 140:97feb9bacc10 4158 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4167 void arm_lms_q31(
<> 140:97feb9bacc10 4168 const arm_lms_instance_q31 * S,
<> 140:97feb9bacc10 4169 q31_t * pSrc,
<> 140:97feb9bacc10 4170 q31_t * pRef,
<> 140:97feb9bacc10 4171 q31_t * pOut,
<> 140:97feb9bacc10 4172 q31_t * pErr,
<> 140:97feb9bacc10 4173 uint32_t blockSize);
<> 140:97feb9bacc10 4174
AnnaBridge 145:64910690c574 4175
<> 140:97feb9bacc10 4176 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4186 void arm_lms_init_q31(
<> 140:97feb9bacc10 4187 arm_lms_instance_q31 * S,
<> 140:97feb9bacc10 4188 uint16_t numTaps,
<> 140:97feb9bacc10 4189 q31_t * pCoeffs,
<> 140:97feb9bacc10 4190 q31_t * pState,
<> 140:97feb9bacc10 4191 q31_t mu,
<> 140:97feb9bacc10 4192 uint32_t blockSize,
<> 140:97feb9bacc10 4193 uint32_t postShift);
<> 140:97feb9bacc10 4194
AnnaBridge 145:64910690c574 4195
<> 140:97feb9bacc10 4196 /**
<> 140:97feb9bacc10 4197 * @brief Instance structure for the floating-point normalized LMS filter.
<> 140:97feb9bacc10 4198 */
<> 140:97feb9bacc10 4199 typedef struct
<> 140:97feb9bacc10 4200 {
<> 140:97feb9bacc10 4201 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4202 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 4207 } arm_lms_norm_instance_f32;
<> 140:97feb9bacc10 4208
AnnaBridge 145:64910690c574 4209
<> 140:97feb9bacc10 4210 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4219 void arm_lms_norm_f32(
<> 140:97feb9bacc10 4220 arm_lms_norm_instance_f32 * S,
<> 140:97feb9bacc10 4221 float32_t * pSrc,
<> 140:97feb9bacc10 4222 float32_t * pRef,
<> 140:97feb9bacc10 4223 float32_t * pOut,
<> 140:97feb9bacc10 4224 float32_t * pErr,
<> 140:97feb9bacc10 4225 uint32_t blockSize);
<> 140:97feb9bacc10 4226
AnnaBridge 145:64910690c574 4227
<> 140:97feb9bacc10 4228 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4237 void arm_lms_norm_init_f32(
<> 140:97feb9bacc10 4238 arm_lms_norm_instance_f32 * S,
<> 140:97feb9bacc10 4239 uint16_t numTaps,
<> 140:97feb9bacc10 4240 float32_t * pCoeffs,
<> 140:97feb9bacc10 4241 float32_t * pState,
<> 140:97feb9bacc10 4242 float32_t mu,
<> 140:97feb9bacc10 4243 uint32_t blockSize);
<> 140:97feb9bacc10 4244
<> 140:97feb9bacc10 4245
<> 140:97feb9bacc10 4246 /**
<> 140:97feb9bacc10 4247 * @brief Instance structure for the Q31 normalized LMS filter.
<> 140:97feb9bacc10 4248 */
<> 140:97feb9bacc10 4249 typedef struct
<> 140:97feb9bacc10 4250 {
<> 140:97feb9bacc10 4251 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4252 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 4253 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 140:97feb9bacc10 4254 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 140:97feb9bacc10 4255 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 140:97feb9bacc10 4256 q31_t *recipTable; /**< points to the reciprocal initial value table. */
<> 140:97feb9bacc10 4257 q31_t energy; /**< saves previous frame energy. */
<> 140:97feb9bacc10 4258 q31_t x0; /**< saves previous input sample. */
<> 140:97feb9bacc10 4259 } arm_lms_norm_instance_q31;
<> 140:97feb9bacc10 4260
AnnaBridge 145:64910690c574 4261
<> 140:97feb9bacc10 4262 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4271 void arm_lms_norm_q31(
<> 140:97feb9bacc10 4272 arm_lms_norm_instance_q31 * S,
<> 140:97feb9bacc10 4273 q31_t * pSrc,
<> 140:97feb9bacc10 4274 q31_t * pRef,
<> 140:97feb9bacc10 4275 q31_t * pOut,
<> 140:97feb9bacc10 4276 q31_t * pErr,
<> 140:97feb9bacc10 4277 uint32_t blockSize);
<> 140:97feb9bacc10 4278
AnnaBridge 145:64910690c574 4279
<> 140:97feb9bacc10 4280 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4290 void arm_lms_norm_init_q31(
<> 140:97feb9bacc10 4291 arm_lms_norm_instance_q31 * S,
<> 140:97feb9bacc10 4292 uint16_t numTaps,
<> 140:97feb9bacc10 4293 q31_t * pCoeffs,
<> 140:97feb9bacc10 4294 q31_t * pState,
<> 140:97feb9bacc10 4295 q31_t mu,
<> 140:97feb9bacc10 4296 uint32_t blockSize,
<> 140:97feb9bacc10 4297 uint8_t postShift);
<> 140:97feb9bacc10 4298
AnnaBridge 145:64910690c574 4299
<> 140:97feb9bacc10 4300 /**
<> 140:97feb9bacc10 4301 * @brief Instance structure for the Q15 normalized LMS filter.
<> 140:97feb9bacc10 4302 */
<> 140:97feb9bacc10 4303 typedef struct
<> 140:97feb9bacc10 4304 {
AnnaBridge 145:64910690c574 4305 uint16_t numTaps; /**< Number of coefficients in the filter. */
<> 140:97feb9bacc10 4306 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 140:97feb9bacc10 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. */
<> 140:97feb9bacc10 4313 } arm_lms_norm_instance_q15;
<> 140:97feb9bacc10 4314
AnnaBridge 145:64910690c574 4315
<> 140:97feb9bacc10 4316 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4325 void arm_lms_norm_q15(
<> 140:97feb9bacc10 4326 arm_lms_norm_instance_q15 * S,
<> 140:97feb9bacc10 4327 q15_t * pSrc,
<> 140:97feb9bacc10 4328 q15_t * pRef,
<> 140:97feb9bacc10 4329 q15_t * pOut,
<> 140:97feb9bacc10 4330 q15_t * pErr,
<> 140:97feb9bacc10 4331 uint32_t blockSize);
<> 140:97feb9bacc10 4332
<> 140:97feb9bacc10 4333
<> 140:97feb9bacc10 4334 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4344 void arm_lms_norm_init_q15(
<> 140:97feb9bacc10 4345 arm_lms_norm_instance_q15 * S,
<> 140:97feb9bacc10 4346 uint16_t numTaps,
<> 140:97feb9bacc10 4347 q15_t * pCoeffs,
<> 140:97feb9bacc10 4348 q15_t * pState,
<> 140:97feb9bacc10 4349 q15_t mu,
<> 140:97feb9bacc10 4350 uint32_t blockSize,
<> 140:97feb9bacc10 4351 uint8_t postShift);
<> 140:97feb9bacc10 4352
AnnaBridge 145:64910690c574 4353
<> 140:97feb9bacc10 4354 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4362 void arm_correlate_f32(
<> 140:97feb9bacc10 4363 float32_t * pSrcA,
<> 140:97feb9bacc10 4364 uint32_t srcALen,
<> 140:97feb9bacc10 4365 float32_t * pSrcB,
<> 140:97feb9bacc10 4366 uint32_t srcBLen,
<> 140:97feb9bacc10 4367 float32_t * pDst);
<> 140:97feb9bacc10 4368
<> 140:97feb9bacc10 4369
<> 140:97feb9bacc10 4370 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4378 */
<> 140:97feb9bacc10 4379 void arm_correlate_opt_q15(
<> 140:97feb9bacc10 4380 q15_t * pSrcA,
<> 140:97feb9bacc10 4381 uint32_t srcALen,
<> 140:97feb9bacc10 4382 q15_t * pSrcB,
<> 140:97feb9bacc10 4383 uint32_t srcBLen,
<> 140:97feb9bacc10 4384 q15_t * pDst,
<> 140:97feb9bacc10 4385 q15_t * pScratch);
<> 140:97feb9bacc10 4386
<> 140:97feb9bacc10 4387
<> 140:97feb9bacc10 4388 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4395 */
<> 140:97feb9bacc10 4396
<> 140:97feb9bacc10 4397 void arm_correlate_q15(
<> 140:97feb9bacc10 4398 q15_t * pSrcA,
<> 140:97feb9bacc10 4399 uint32_t srcALen,
<> 140:97feb9bacc10 4400 q15_t * pSrcB,
<> 140:97feb9bacc10 4401 uint32_t srcBLen,
<> 140:97feb9bacc10 4402 q15_t * pDst);
<> 140:97feb9bacc10 4403
AnnaBridge 145:64910690c574 4404
<> 140:97feb9bacc10 4405 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4412 */
<> 140:97feb9bacc10 4413
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 4420
<> 140:97feb9bacc10 4421
<> 140:97feb9bacc10 4422 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4431 void arm_correlate_fast_opt_q15(
<> 140:97feb9bacc10 4432 q15_t * pSrcA,
<> 140:97feb9bacc10 4433 uint32_t srcALen,
<> 140:97feb9bacc10 4434 q15_t * pSrcB,
<> 140:97feb9bacc10 4435 uint32_t srcBLen,
<> 140:97feb9bacc10 4436 q15_t * pDst,
<> 140:97feb9bacc10 4437 q15_t * pScratch);
<> 140:97feb9bacc10 4438
AnnaBridge 145:64910690c574 4439
<> 140:97feb9bacc10 4440 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4448 void arm_correlate_q31(
<> 140:97feb9bacc10 4449 q31_t * pSrcA,
<> 140:97feb9bacc10 4450 uint32_t srcALen,
<> 140:97feb9bacc10 4451 q31_t * pSrcB,
<> 140:97feb9bacc10 4452 uint32_t srcBLen,
<> 140:97feb9bacc10 4453 q31_t * pDst);
<> 140:97feb9bacc10 4454
AnnaBridge 145:64910690c574 4455
<> 140:97feb9bacc10 4456 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4464 void arm_correlate_fast_q31(
<> 140:97feb9bacc10 4465 q31_t * pSrcA,
<> 140:97feb9bacc10 4466 uint32_t srcALen,
<> 140:97feb9bacc10 4467 q31_t * pSrcB,
<> 140:97feb9bacc10 4468 uint32_t srcBLen,
<> 140:97feb9bacc10 4469 q31_t * pDst);
<> 140:97feb9bacc10 4470
<> 140:97feb9bacc10 4471
<> 140:97feb9bacc10 4472 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4482 void arm_correlate_opt_q7(
<> 140:97feb9bacc10 4483 q7_t * pSrcA,
<> 140:97feb9bacc10 4484 uint32_t srcALen,
<> 140:97feb9bacc10 4485 q7_t * pSrcB,
<> 140:97feb9bacc10 4486 uint32_t srcBLen,
<> 140:97feb9bacc10 4487 q7_t * pDst,
<> 140:97feb9bacc10 4488 q15_t * pScratch1,
<> 140:97feb9bacc10 4489 q15_t * pScratch2);
<> 140:97feb9bacc10 4490
<> 140:97feb9bacc10 4491
<> 140:97feb9bacc10 4492 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4500 void arm_correlate_q7(
<> 140:97feb9bacc10 4501 q7_t * pSrcA,
<> 140:97feb9bacc10 4502 uint32_t srcALen,
<> 140:97feb9bacc10 4503 q7_t * pSrcB,
<> 140:97feb9bacc10 4504 uint32_t srcBLen,
<> 140:97feb9bacc10 4505 q7_t * pDst);
<> 140:97feb9bacc10 4506
<> 140:97feb9bacc10 4507
<> 140:97feb9bacc10 4508 /**
<> 140:97feb9bacc10 4509 * @brief Instance structure for the floating-point sparse FIR filter.
<> 140:97feb9bacc10 4510 */
<> 140:97feb9bacc10 4511 typedef struct
<> 140:97feb9bacc10 4512 {
<> 140:97feb9bacc10 4513 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4514 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 140:97feb9bacc10 4515 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 140:97feb9bacc10 4516 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 4517 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 140:97feb9bacc10 4518 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 140:97feb9bacc10 4519 } arm_fir_sparse_instance_f32;
<> 140:97feb9bacc10 4520
<> 140:97feb9bacc10 4521 /**
<> 140:97feb9bacc10 4522 * @brief Instance structure for the Q31 sparse FIR filter.
<> 140:97feb9bacc10 4523 */
<> 140:97feb9bacc10 4524 typedef struct
<> 140:97feb9bacc10 4525 {
<> 140:97feb9bacc10 4526 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4527 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 140:97feb9bacc10 4528 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 140:97feb9bacc10 4529 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 4530 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 140:97feb9bacc10 4531 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 140:97feb9bacc10 4532 } arm_fir_sparse_instance_q31;
<> 140:97feb9bacc10 4533
<> 140:97feb9bacc10 4534 /**
<> 140:97feb9bacc10 4535 * @brief Instance structure for the Q15 sparse FIR filter.
<> 140:97feb9bacc10 4536 */
<> 140:97feb9bacc10 4537 typedef struct
<> 140:97feb9bacc10 4538 {
<> 140:97feb9bacc10 4539 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4540 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 140:97feb9bacc10 4541 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 140:97feb9bacc10 4542 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 4543 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 140:97feb9bacc10 4544 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 140:97feb9bacc10 4545 } arm_fir_sparse_instance_q15;
<> 140:97feb9bacc10 4546
<> 140:97feb9bacc10 4547 /**
<> 140:97feb9bacc10 4548 * @brief Instance structure for the Q7 sparse FIR filter.
<> 140:97feb9bacc10 4549 */
<> 140:97feb9bacc10 4550 typedef struct
<> 140:97feb9bacc10 4551 {
<> 140:97feb9bacc10 4552 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 140:97feb9bacc10 4553 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 140:97feb9bacc10 4554 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 140:97feb9bacc10 4555 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 140:97feb9bacc10 4556 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 140:97feb9bacc10 4557 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 140:97feb9bacc10 4558 } arm_fir_sparse_instance_q7;
<> 140:97feb9bacc10 4559
AnnaBridge 145:64910690c574 4560
<> 140:97feb9bacc10 4561 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4567 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4568 */
<> 140:97feb9bacc10 4569 void arm_fir_sparse_f32(
<> 140:97feb9bacc10 4570 arm_fir_sparse_instance_f32 * S,
<> 140:97feb9bacc10 4571 float32_t * pSrc,
<> 140:97feb9bacc10 4572 float32_t * pDst,
<> 140:97feb9bacc10 4573 float32_t * pScratchIn,
<> 140:97feb9bacc10 4574 uint32_t blockSize);
<> 140:97feb9bacc10 4575
AnnaBridge 145:64910690c574 4576
<> 140:97feb9bacc10 4577 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4584 * @param[in] maxDelay maximum offset time supported.
<> 140:97feb9bacc10 4585 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4586 */
<> 140:97feb9bacc10 4587 void arm_fir_sparse_init_f32(
<> 140:97feb9bacc10 4588 arm_fir_sparse_instance_f32 * S,
<> 140:97feb9bacc10 4589 uint16_t numTaps,
<> 140:97feb9bacc10 4590 float32_t * pCoeffs,
<> 140:97feb9bacc10 4591 float32_t * pState,
<> 140:97feb9bacc10 4592 int32_t * pTapDelay,
<> 140:97feb9bacc10 4593 uint16_t maxDelay,
<> 140:97feb9bacc10 4594 uint32_t blockSize);
<> 140:97feb9bacc10 4595
AnnaBridge 145:64910690c574 4596
<> 140:97feb9bacc10 4597 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4603 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4604 */
<> 140:97feb9bacc10 4605 void arm_fir_sparse_q31(
<> 140:97feb9bacc10 4606 arm_fir_sparse_instance_q31 * S,
<> 140:97feb9bacc10 4607 q31_t * pSrc,
<> 140:97feb9bacc10 4608 q31_t * pDst,
<> 140:97feb9bacc10 4609 q31_t * pScratchIn,
<> 140:97feb9bacc10 4610 uint32_t blockSize);
<> 140:97feb9bacc10 4611
AnnaBridge 145:64910690c574 4612
<> 140:97feb9bacc10 4613 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4620 * @param[in] maxDelay maximum offset time supported.
<> 140:97feb9bacc10 4621 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4622 */
<> 140:97feb9bacc10 4623 void arm_fir_sparse_init_q31(
<> 140:97feb9bacc10 4624 arm_fir_sparse_instance_q31 * S,
<> 140:97feb9bacc10 4625 uint16_t numTaps,
<> 140:97feb9bacc10 4626 q31_t * pCoeffs,
<> 140:97feb9bacc10 4627 q31_t * pState,
<> 140:97feb9bacc10 4628 int32_t * pTapDelay,
<> 140:97feb9bacc10 4629 uint16_t maxDelay,
<> 140:97feb9bacc10 4630 uint32_t blockSize);
<> 140:97feb9bacc10 4631
AnnaBridge 145:64910690c574 4632
<> 140:97feb9bacc10 4633 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4640 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4641 */
<> 140:97feb9bacc10 4642 void arm_fir_sparse_q15(
<> 140:97feb9bacc10 4643 arm_fir_sparse_instance_q15 * S,
<> 140:97feb9bacc10 4644 q15_t * pSrc,
<> 140:97feb9bacc10 4645 q15_t * pDst,
<> 140:97feb9bacc10 4646 q15_t * pScratchIn,
<> 140:97feb9bacc10 4647 q31_t * pScratchOut,
<> 140:97feb9bacc10 4648 uint32_t blockSize);
<> 140:97feb9bacc10 4649
<> 140:97feb9bacc10 4650
<> 140:97feb9bacc10 4651 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4658 * @param[in] maxDelay maximum offset time supported.
<> 140:97feb9bacc10 4659 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4660 */
<> 140:97feb9bacc10 4661 void arm_fir_sparse_init_q15(
<> 140:97feb9bacc10 4662 arm_fir_sparse_instance_q15 * S,
<> 140:97feb9bacc10 4663 uint16_t numTaps,
<> 140:97feb9bacc10 4664 q15_t * pCoeffs,
<> 140:97feb9bacc10 4665 q15_t * pState,
<> 140:97feb9bacc10 4666 int32_t * pTapDelay,
<> 140:97feb9bacc10 4667 uint16_t maxDelay,
<> 140:97feb9bacc10 4668 uint32_t blockSize);
<> 140:97feb9bacc10 4669
AnnaBridge 145:64910690c574 4670
<> 140:97feb9bacc10 4671 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4678 * @param[in] blockSize number of input samples to process per call.
AnnaBridge 145:64910690c574 4679 */
<> 140:97feb9bacc10 4680 void arm_fir_sparse_q7(
<> 140:97feb9bacc10 4681 arm_fir_sparse_instance_q7 * S,
<> 140:97feb9bacc10 4682 q7_t * pSrc,
<> 140:97feb9bacc10 4683 q7_t * pDst,
<> 140:97feb9bacc10 4684 q7_t * pScratchIn,
<> 140:97feb9bacc10 4685 q31_t * pScratchOut,
<> 140:97feb9bacc10 4686 uint32_t blockSize);
<> 140:97feb9bacc10 4687
AnnaBridge 145:64910690c574 4688
<> 140:97feb9bacc10 4689 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 4696 * @param[in] maxDelay maximum offset time supported.
<> 140:97feb9bacc10 4697 * @param[in] blockSize number of samples that will be processed per block.
AnnaBridge 145:64910690c574 4698 */
<> 140:97feb9bacc10 4699 void arm_fir_sparse_init_q7(
<> 140:97feb9bacc10 4700 arm_fir_sparse_instance_q7 * S,
<> 140:97feb9bacc10 4701 uint16_t numTaps,
<> 140:97feb9bacc10 4702 q7_t * pCoeffs,
<> 140:97feb9bacc10 4703 q7_t * pState,
<> 140:97feb9bacc10 4704 int32_t * pTapDelay,
<> 140:97feb9bacc10 4705 uint16_t maxDelay,
<> 140:97feb9bacc10 4706 uint32_t blockSize);
<> 140:97feb9bacc10 4707
<> 140:97feb9bacc10 4708
AnnaBridge 145:64910690c574 4709 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4715 void arm_sin_cos_f32(
<> 140:97feb9bacc10 4716 float32_t theta,
<> 140:97feb9bacc10 4717 float32_t * pSinVal,
AnnaBridge 145:64910690c574 4718 float32_t * pCosVal);
AnnaBridge 145:64910690c574 4719
AnnaBridge 145:64910690c574 4720
AnnaBridge 145:64910690c574 4721 /**
<> 140:97feb9bacc10 4722 * @brief Q31 sin_cos function.
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4727 void arm_sin_cos_q31(
<> 140:97feb9bacc10 4728 q31_t theta,
<> 140:97feb9bacc10 4729 q31_t * pSinVal,
<> 140:97feb9bacc10 4730 q31_t * pCosVal);
<> 140:97feb9bacc10 4731
<> 140:97feb9bacc10 4732
<> 140:97feb9bacc10 4733 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4739 void arm_cmplx_conj_f32(
<> 140:97feb9bacc10 4740 float32_t * pSrc,
<> 140:97feb9bacc10 4741 float32_t * pDst,
<> 140:97feb9bacc10 4742 uint32_t numSamples);
<> 140:97feb9bacc10 4743
<> 140:97feb9bacc10 4744 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4750 void arm_cmplx_conj_q31(
<> 140:97feb9bacc10 4751 q31_t * pSrc,
<> 140:97feb9bacc10 4752 q31_t * pDst,
<> 140:97feb9bacc10 4753 uint32_t numSamples);
<> 140:97feb9bacc10 4754
AnnaBridge 145:64910690c574 4755
<> 140:97feb9bacc10 4756 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4762 void arm_cmplx_conj_q15(
<> 140:97feb9bacc10 4763 q15_t * pSrc,
<> 140:97feb9bacc10 4764 q15_t * pDst,
<> 140:97feb9bacc10 4765 uint32_t numSamples);
<> 140:97feb9bacc10 4766
<> 140:97feb9bacc10 4767
<> 140:97feb9bacc10 4768 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4774 void arm_cmplx_mag_squared_f32(
<> 140:97feb9bacc10 4775 float32_t * pSrc,
<> 140:97feb9bacc10 4776 float32_t * pDst,
<> 140:97feb9bacc10 4777 uint32_t numSamples);
<> 140:97feb9bacc10 4778
AnnaBridge 145:64910690c574 4779
<> 140:97feb9bacc10 4780 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4786 void arm_cmplx_mag_squared_q31(
<> 140:97feb9bacc10 4787 q31_t * pSrc,
<> 140:97feb9bacc10 4788 q31_t * pDst,
<> 140:97feb9bacc10 4789 uint32_t numSamples);
<> 140:97feb9bacc10 4790
AnnaBridge 145:64910690c574 4791
<> 140:97feb9bacc10 4792 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 4798 void arm_cmplx_mag_squared_q15(
<> 140:97feb9bacc10 4799 q15_t * pSrc,
<> 140:97feb9bacc10 4800 q15_t * pDst,
<> 140:97feb9bacc10 4801 uint32_t numSamples);
<> 140:97feb9bacc10 4802
<> 140:97feb9bacc10 4803
<> 140:97feb9bacc10 4804 /**
<> 140:97feb9bacc10 4805 * @ingroup groupController
<> 140:97feb9bacc10 4806 */
<> 140:97feb9bacc10 4807
<> 140:97feb9bacc10 4808 /**
<> 140:97feb9bacc10 4809 * @defgroup PID PID Motor Control
<> 140:97feb9bacc10 4810 *
<> 140:97feb9bacc10 4811 * A Proportional Integral Derivative (PID) controller is a generic feedback control
<> 140:97feb9bacc10 4812 * loop mechanism widely used in industrial control systems.
<> 140:97feb9bacc10 4813 * A PID controller is the most commonly used type of feedback controller.
<> 140:97feb9bacc10 4814 *
<> 140:97feb9bacc10 4815 * This set of functions implements (PID) controllers
<> 140:97feb9bacc10 4816 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
<> 140:97feb9bacc10 4817 * of data and each call to the function returns a single processed value.
<> 140:97feb9bacc10 4818 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
<> 140:97feb9bacc10 4819 * is the input sample value. The functions return the output value.
<> 140:97feb9bacc10 4820 *
<> 140:97feb9bacc10 4821 * \par Algorithm:
<> 140:97feb9bacc10 4822 * <pre>
<> 140:97feb9bacc10 4823 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
<> 140:97feb9bacc10 4824 * A0 = Kp + Ki + Kd
<> 140:97feb9bacc10 4825 * A1 = (-Kp ) - (2 * Kd )
<> 140:97feb9bacc10 4826 * A2 = Kd </pre>
<> 140:97feb9bacc10 4827 *
<> 140:97feb9bacc10 4828 * \par
<> 140:97feb9bacc10 4829 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
<> 140:97feb9bacc10 4830 *
<> 140:97feb9bacc10 4831 * \par
<> 140:97feb9bacc10 4832 * \image html PID.gif "Proportional Integral Derivative Controller"
<> 140:97feb9bacc10 4833 *
<> 140:97feb9bacc10 4834 * \par
<> 140:97feb9bacc10 4835 * The PID controller calculates an "error" value as the difference between
<> 140:97feb9bacc10 4836 * the measured output and the reference input.
<> 140:97feb9bacc10 4837 * The controller attempts to minimize the error by adjusting the process control inputs.
<> 140:97feb9bacc10 4838 * The proportional value determines the reaction to the current error,
<> 140:97feb9bacc10 4839 * the integral value determines the reaction based on the sum of recent errors,
<> 140:97feb9bacc10 4840 * and the derivative value determines the reaction based on the rate at which the error has been changing.
<> 140:97feb9bacc10 4841 *
<> 140:97feb9bacc10 4842 * \par Instance Structure
<> 140:97feb9bacc10 4843 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
<> 140:97feb9bacc10 4844 * A separate instance structure must be defined for each PID Controller.
<> 140:97feb9bacc10 4845 * There are separate instance structure declarations for each of the 3 supported data types.
<> 140:97feb9bacc10 4846 *
<> 140:97feb9bacc10 4847 * \par Reset Functions
<> 140:97feb9bacc10 4848 * There is also an associated reset function for each data type which clears the state array.
<> 140:97feb9bacc10 4849 *
<> 140:97feb9bacc10 4850 * \par Initialization Functions
<> 140:97feb9bacc10 4851 * There is also an associated initialization function for each data type.
<> 140:97feb9bacc10 4852 * The initialization function performs the following operations:
<> 140:97feb9bacc10 4853 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
<> 140:97feb9bacc10 4854 * - Zeros out the values in the state buffer.
<> 140:97feb9bacc10 4855 *
<> 140:97feb9bacc10 4856 * \par
<> 140:97feb9bacc10 4857 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
<> 140:97feb9bacc10 4858 *
<> 140:97feb9bacc10 4859 * \par Fixed-Point Behavior
<> 140:97feb9bacc10 4860 * Care must be taken when using the fixed-point versions of the PID Controller functions.
<> 140:97feb9bacc10 4861 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
<> 140:97feb9bacc10 4862 * Refer to the function specific documentation below for usage guidelines.
<> 140:97feb9bacc10 4863 */
<> 140:97feb9bacc10 4864
<> 140:97feb9bacc10 4865 /**
<> 140:97feb9bacc10 4866 * @addtogroup PID
<> 140:97feb9bacc10 4867 * @{
<> 140:97feb9bacc10 4868 */
<> 140:97feb9bacc10 4869
<> 140:97feb9bacc10 4870 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 4874 * @return out processed output sample.
<> 140:97feb9bacc10 4875 */
AnnaBridge 145:64910690c574 4876 CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32(
<> 140:97feb9bacc10 4877 arm_pid_instance_f32 * S,
<> 140:97feb9bacc10 4878 float32_t in)
<> 140:97feb9bacc10 4879 {
<> 140:97feb9bacc10 4880 float32_t out;
<> 140:97feb9bacc10 4881
<> 140:97feb9bacc10 4882 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
<> 140:97feb9bacc10 4883 out = (S->A0 * in) +
<> 140:97feb9bacc10 4884 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
<> 140:97feb9bacc10 4885
<> 140:97feb9bacc10 4886 /* Update state */
<> 140:97feb9bacc10 4887 S->state[1] = S->state[0];
<> 140:97feb9bacc10 4888 S->state[0] = in;
<> 140:97feb9bacc10 4889 S->state[2] = out;
<> 140:97feb9bacc10 4890
<> 140:97feb9bacc10 4891 /* return to application */
<> 140:97feb9bacc10 4892 return (out);
<> 140:97feb9bacc10 4893
<> 140:97feb9bacc10 4894 }
<> 140:97feb9bacc10 4895
<> 140:97feb9bacc10 4896 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 4900 * @return out processed output sample.
<> 140:97feb9bacc10 4901 *
<> 140:97feb9bacc10 4902 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 4903 * \par
<> 140:97feb9bacc10 4904 * The function is implemented using an internal 64-bit accumulator.
<> 140:97feb9bacc10 4905 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
<> 140:97feb9bacc10 4906 * Thus, if the accumulator result overflows it wraps around rather than clip.
<> 140:97feb9bacc10 4907 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
<> 140:97feb9bacc10 4908 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
<> 140:97feb9bacc10 4909 */
AnnaBridge 145:64910690c574 4910 CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31(
<> 140:97feb9bacc10 4911 arm_pid_instance_q31 * S,
<> 140:97feb9bacc10 4912 q31_t in)
<> 140:97feb9bacc10 4913 {
<> 140:97feb9bacc10 4914 q63_t acc;
<> 140:97feb9bacc10 4915 q31_t out;
<> 140:97feb9bacc10 4916
<> 140:97feb9bacc10 4917 /* acc = A0 * x[n] */
<> 140:97feb9bacc10 4918 acc = (q63_t) S->A0 * in;
<> 140:97feb9bacc10 4919
<> 140:97feb9bacc10 4920 /* acc += A1 * x[n-1] */
<> 140:97feb9bacc10 4921 acc += (q63_t) S->A1 * S->state[0];
<> 140:97feb9bacc10 4922
<> 140:97feb9bacc10 4923 /* acc += A2 * x[n-2] */
<> 140:97feb9bacc10 4924 acc += (q63_t) S->A2 * S->state[1];
<> 140:97feb9bacc10 4925
<> 140:97feb9bacc10 4926 /* convert output to 1.31 format to add y[n-1] */
<> 140:97feb9bacc10 4927 out = (q31_t) (acc >> 31u);
<> 140:97feb9bacc10 4928
<> 140:97feb9bacc10 4929 /* out += y[n-1] */
<> 140:97feb9bacc10 4930 out += S->state[2];
<> 140:97feb9bacc10 4931
<> 140:97feb9bacc10 4932 /* Update state */
<> 140:97feb9bacc10 4933 S->state[1] = S->state[0];
<> 140:97feb9bacc10 4934 S->state[0] = in;
<> 140:97feb9bacc10 4935 S->state[2] = out;
<> 140:97feb9bacc10 4936
<> 140:97feb9bacc10 4937 /* return to application */
<> 140:97feb9bacc10 4938 return (out);
<> 140:97feb9bacc10 4939 }
<> 140:97feb9bacc10 4940
AnnaBridge 145:64910690c574 4941
<> 140:97feb9bacc10 4942 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 4946 * @return out processed output sample.
<> 140:97feb9bacc10 4947 *
<> 140:97feb9bacc10 4948 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 4949 * \par
<> 140:97feb9bacc10 4950 * The function is implemented using a 64-bit internal accumulator.
<> 140:97feb9bacc10 4951 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
<> 140:97feb9bacc10 4952 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
<> 140:97feb9bacc10 4953 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
<> 140:97feb9bacc10 4954 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
<> 140:97feb9bacc10 4955 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
<> 140:97feb9bacc10 4956 */
AnnaBridge 145:64910690c574 4957 CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15(
<> 140:97feb9bacc10 4958 arm_pid_instance_q15 * S,
<> 140:97feb9bacc10 4959 q15_t in)
<> 140:97feb9bacc10 4960 {
<> 140:97feb9bacc10 4961 q63_t acc;
<> 140:97feb9bacc10 4962 q15_t out;
<> 140:97feb9bacc10 4963
AnnaBridge 145:64910690c574 4964 #if defined (ARM_MATH_DSP)
<> 140:97feb9bacc10 4965 __SIMD32_TYPE *vstate;
<> 140:97feb9bacc10 4966
<> 140:97feb9bacc10 4967 /* Implementation of PID controller */
<> 140:97feb9bacc10 4968
<> 140:97feb9bacc10 4969 /* acc = A0 * x[n] */
AnnaBridge 145:64910690c574 4970 acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);
<> 140:97feb9bacc10 4971
<> 140:97feb9bacc10 4972 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 140:97feb9bacc10 4973 vstate = __SIMD32_CONST(S->state);
AnnaBridge 145:64910690c574 4974 acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc);
<> 140:97feb9bacc10 4975 #else
<> 140:97feb9bacc10 4976 /* acc = A0 * x[n] */
<> 140:97feb9bacc10 4977 acc = ((q31_t) S->A0) * in;
<> 140:97feb9bacc10 4978
<> 140:97feb9bacc10 4979 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 140:97feb9bacc10 4980 acc += (q31_t) S->A1 * S->state[0];
<> 140:97feb9bacc10 4981 acc += (q31_t) S->A2 * S->state[1];
<> 140:97feb9bacc10 4982 #endif
<> 140:97feb9bacc10 4983
<> 140:97feb9bacc10 4984 /* acc += y[n-1] */
<> 140:97feb9bacc10 4985 acc += (q31_t) S->state[2] << 15;
<> 140:97feb9bacc10 4986
<> 140:97feb9bacc10 4987 /* saturate the output */
<> 140:97feb9bacc10 4988 out = (q15_t) (__SSAT((acc >> 15), 16));
<> 140:97feb9bacc10 4989
<> 140:97feb9bacc10 4990 /* Update state */
<> 140:97feb9bacc10 4991 S->state[1] = S->state[0];
<> 140:97feb9bacc10 4992 S->state[0] = in;
<> 140:97feb9bacc10 4993 S->state[2] = out;
<> 140:97feb9bacc10 4994
<> 140:97feb9bacc10 4995 /* return to application */
<> 140:97feb9bacc10 4996 return (out);
<> 140:97feb9bacc10 4997 }
<> 140:97feb9bacc10 4998
<> 140:97feb9bacc10 4999 /**
<> 140:97feb9bacc10 5000 * @} end of PID group
<> 140:97feb9bacc10 5001 */
<> 140:97feb9bacc10 5002
<> 140:97feb9bacc10 5003
<> 140:97feb9bacc10 5004 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 5008 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 140:97feb9bacc10 5009 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 140:97feb9bacc10 5010 */
<> 140:97feb9bacc10 5011 arm_status arm_mat_inverse_f32(
<> 140:97feb9bacc10 5012 const arm_matrix_instance_f32 * src,
<> 140:97feb9bacc10 5013 arm_matrix_instance_f32 * dst);
<> 140:97feb9bacc10 5014
<> 140:97feb9bacc10 5015
<> 140:97feb9bacc10 5016 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 5020 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 140:97feb9bacc10 5021 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 140:97feb9bacc10 5022 */
<> 140:97feb9bacc10 5023 arm_status arm_mat_inverse_f64(
<> 140:97feb9bacc10 5024 const arm_matrix_instance_f64 * src,
<> 140:97feb9bacc10 5025 arm_matrix_instance_f64 * dst);
<> 140:97feb9bacc10 5026
<> 140:97feb9bacc10 5027
<> 140:97feb9bacc10 5028
<> 140:97feb9bacc10 5029 /**
<> 140:97feb9bacc10 5030 * @ingroup groupController
<> 140:97feb9bacc10 5031 */
<> 140:97feb9bacc10 5032
<> 140:97feb9bacc10 5033 /**
<> 140:97feb9bacc10 5034 * @defgroup clarke Vector Clarke Transform
<> 140:97feb9bacc10 5035 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
<> 140:97feb9bacc10 5036 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
<> 140:97feb9bacc10 5037 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
<> 140:97feb9bacc10 5038 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
<> 140:97feb9bacc10 5039 * \image html clarke.gif Stator current space vector and its components in (a,b).
<> 140:97feb9bacc10 5040 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
<> 140:97feb9bacc10 5041 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
<> 140:97feb9bacc10 5042 *
<> 140:97feb9bacc10 5043 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 140:97feb9bacc10 5044 * The library provides separate functions for Q31 and floating-point data types.
<> 140:97feb9bacc10 5045 * \par Algorithm
<> 140:97feb9bacc10 5046 * \image html clarkeFormula.gif
<> 140:97feb9bacc10 5047 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
<> 140:97feb9bacc10 5048 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
<> 140:97feb9bacc10 5049 * \par Fixed-Point Behavior
<> 140:97feb9bacc10 5050 * Care must be taken when using the Q31 version of the Clarke transform.
<> 140:97feb9bacc10 5051 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 140:97feb9bacc10 5052 * Refer to the function specific documentation below for usage guidelines.
<> 140:97feb9bacc10 5053 */
<> 140:97feb9bacc10 5054
<> 140:97feb9bacc10 5055 /**
<> 140:97feb9bacc10 5056 * @addtogroup clarke
<> 140:97feb9bacc10 5057 * @{
<> 140:97feb9bacc10 5058 */
<> 140:97feb9bacc10 5059
<> 140:97feb9bacc10 5060 /**
<> 140:97feb9bacc10 5061 *
<> 140:97feb9bacc10 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(
<> 140:97feb9bacc10 5069 float32_t Ia,
<> 140:97feb9bacc10 5070 float32_t Ib,
<> 140:97feb9bacc10 5071 float32_t * pIalpha,
<> 140:97feb9bacc10 5072 float32_t * pIbeta)
<> 140:97feb9bacc10 5073 {
<> 140:97feb9bacc10 5074 /* Calculate pIalpha using the equation, pIalpha = Ia */
<> 140:97feb9bacc10 5075 *pIalpha = Ia;
<> 140:97feb9bacc10 5076
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 5079 }
<> 140:97feb9bacc10 5080
AnnaBridge 145:64910690c574 5081
<> 140:97feb9bacc10 5082 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5088 *
<> 140:97feb9bacc10 5089 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 5090 * \par
<> 140:97feb9bacc10 5091 * The function is implemented using an internal 32-bit accumulator.
<> 140:97feb9bacc10 5092 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 140:97feb9bacc10 5093 * There is saturation on the addition, hence there is no risk of overflow.
<> 140:97feb9bacc10 5094 */
AnnaBridge 145:64910690c574 5095 CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31(
<> 140:97feb9bacc10 5096 q31_t Ia,
<> 140:97feb9bacc10 5097 q31_t Ib,
<> 140:97feb9bacc10 5098 q31_t * pIalpha,
<> 140:97feb9bacc10 5099 q31_t * pIbeta)
<> 140:97feb9bacc10 5100 {
<> 140:97feb9bacc10 5101 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5102
<> 140:97feb9bacc10 5103 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
<> 140:97feb9bacc10 5104 *pIalpha = Ia;
<> 140:97feb9bacc10 5105
<> 140:97feb9bacc10 5106 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
<> 140:97feb9bacc10 5107 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
<> 140:97feb9bacc10 5108
<> 140:97feb9bacc10 5109 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
<> 140:97feb9bacc10 5110 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
<> 140:97feb9bacc10 5111
<> 140:97feb9bacc10 5112 /* pIbeta is calculated by adding the intermediate products */
<> 140:97feb9bacc10 5113 *pIbeta = __QADD(product1, product2);
<> 140:97feb9bacc10 5114 }
<> 140:97feb9bacc10 5115
<> 140:97feb9bacc10 5116 /**
<> 140:97feb9bacc10 5117 * @} end of clarke group
<> 140:97feb9bacc10 5118 */
<> 140:97feb9bacc10 5119
<> 140:97feb9bacc10 5120 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5125 */
<> 140:97feb9bacc10 5126 void arm_q7_to_q31(
<> 140:97feb9bacc10 5127 q7_t * pSrc,
<> 140:97feb9bacc10 5128 q31_t * pDst,
<> 140:97feb9bacc10 5129 uint32_t blockSize);
<> 140:97feb9bacc10 5130
<> 140:97feb9bacc10 5131
<> 140:97feb9bacc10 5132
<> 140:97feb9bacc10 5133 /**
<> 140:97feb9bacc10 5134 * @ingroup groupController
<> 140:97feb9bacc10 5135 */
<> 140:97feb9bacc10 5136
<> 140:97feb9bacc10 5137 /**
<> 140:97feb9bacc10 5138 * @defgroup inv_clarke Vector Inverse Clarke Transform
<> 140:97feb9bacc10 5139 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
<> 140:97feb9bacc10 5140 *
<> 140:97feb9bacc10 5141 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 140:97feb9bacc10 5142 * The library provides separate functions for Q31 and floating-point data types.
<> 140:97feb9bacc10 5143 * \par Algorithm
<> 140:97feb9bacc10 5144 * \image html clarkeInvFormula.gif
<> 140:97feb9bacc10 5145 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
<> 140:97feb9bacc10 5146 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
<> 140:97feb9bacc10 5147 * \par Fixed-Point Behavior
<> 140:97feb9bacc10 5148 * Care must be taken when using the Q31 version of the Clarke transform.
<> 140:97feb9bacc10 5149 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 140:97feb9bacc10 5150 * Refer to the function specific documentation below for usage guidelines.
<> 140:97feb9bacc10 5151 */
<> 140:97feb9bacc10 5152
<> 140:97feb9bacc10 5153 /**
<> 140:97feb9bacc10 5154 * @addtogroup inv_clarke
<> 140:97feb9bacc10 5155 * @{
<> 140:97feb9bacc10 5156 */
<> 140:97feb9bacc10 5157
<> 140:97feb9bacc10 5158 /**
<> 140:97feb9bacc10 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(
<> 140:97feb9bacc10 5166 float32_t Ialpha,
<> 140:97feb9bacc10 5167 float32_t Ibeta,
<> 140:97feb9bacc10 5168 float32_t * pIa,
<> 140:97feb9bacc10 5169 float32_t * pIb)
<> 140:97feb9bacc10 5170 {
<> 140:97feb9bacc10 5171 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 140:97feb9bacc10 5172 *pIa = Ialpha;
<> 140:97feb9bacc10 5173
<> 140:97feb9bacc10 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;
<> 140:97feb9bacc10 5176 }
<> 140:97feb9bacc10 5177
AnnaBridge 145:64910690c574 5178
<> 140:97feb9bacc10 5179 /**
<> 140:97feb9bacc10 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>
<> 140:97feb9bacc10 5185 *
<> 140:97feb9bacc10 5186 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 5187 * \par
<> 140:97feb9bacc10 5188 * The function is implemented using an internal 32-bit accumulator.
<> 140:97feb9bacc10 5189 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 140:97feb9bacc10 5190 * There is saturation on the subtraction, hence there is no risk of overflow.
<> 140:97feb9bacc10 5191 */
AnnaBridge 145:64910690c574 5192 CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31(
<> 140:97feb9bacc10 5193 q31_t Ialpha,
<> 140:97feb9bacc10 5194 q31_t Ibeta,
<> 140:97feb9bacc10 5195 q31_t * pIa,
<> 140:97feb9bacc10 5196 q31_t * pIb)
<> 140:97feb9bacc10 5197 {
<> 140:97feb9bacc10 5198 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5199
<> 140:97feb9bacc10 5200 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 140:97feb9bacc10 5201 *pIa = Ialpha;
<> 140:97feb9bacc10 5202
<> 140:97feb9bacc10 5203 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
<> 140:97feb9bacc10 5204 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
<> 140:97feb9bacc10 5205
<> 140:97feb9bacc10 5206 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
<> 140:97feb9bacc10 5207 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
<> 140:97feb9bacc10 5208
<> 140:97feb9bacc10 5209 /* pIb is calculated by subtracting the products */
<> 140:97feb9bacc10 5210 *pIb = __QSUB(product2, product1);
<> 140:97feb9bacc10 5211 }
<> 140:97feb9bacc10 5212
<> 140:97feb9bacc10 5213 /**
<> 140:97feb9bacc10 5214 * @} end of inv_clarke group
<> 140:97feb9bacc10 5215 */
<> 140:97feb9bacc10 5216
<> 140:97feb9bacc10 5217 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5222 */
<> 140:97feb9bacc10 5223 void arm_q7_to_q15(
<> 140:97feb9bacc10 5224 q7_t * pSrc,
<> 140:97feb9bacc10 5225 q15_t * pDst,
<> 140:97feb9bacc10 5226 uint32_t blockSize);
<> 140:97feb9bacc10 5227
<> 140:97feb9bacc10 5228
<> 140:97feb9bacc10 5229
<> 140:97feb9bacc10 5230 /**
<> 140:97feb9bacc10 5231 * @ingroup groupController
<> 140:97feb9bacc10 5232 */
<> 140:97feb9bacc10 5233
<> 140:97feb9bacc10 5234 /**
<> 140:97feb9bacc10 5235 * @defgroup park Vector Park Transform
<> 140:97feb9bacc10 5236 *
<> 140:97feb9bacc10 5237 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
<> 140:97feb9bacc10 5238 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
<> 140:97feb9bacc10 5239 * from the stationary to the moving reference frame and control the spatial relationship between
<> 140:97feb9bacc10 5240 * the stator vector current and rotor flux vector.
<> 140:97feb9bacc10 5241 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
<> 140:97feb9bacc10 5242 * current vector and the relationship from the two reference frames:
<> 140:97feb9bacc10 5243 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
<> 140:97feb9bacc10 5244 *
<> 140:97feb9bacc10 5245 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 140:97feb9bacc10 5246 * The library provides separate functions for Q31 and floating-point data types.
<> 140:97feb9bacc10 5247 * \par Algorithm
<> 140:97feb9bacc10 5248 * \image html parkFormula.gif
<> 140:97feb9bacc10 5249 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
<> 140:97feb9bacc10 5250 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 140:97feb9bacc10 5251 * cosine and sine values of theta (rotor flux position).
<> 140:97feb9bacc10 5252 * \par Fixed-Point Behavior
<> 140:97feb9bacc10 5253 * Care must be taken when using the Q31 version of the Park transform.
<> 140:97feb9bacc10 5254 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 140:97feb9bacc10 5255 * Refer to the function specific documentation below for usage guidelines.
<> 140:97feb9bacc10 5256 */
<> 140:97feb9bacc10 5257
<> 140:97feb9bacc10 5258 /**
<> 140:97feb9bacc10 5259 * @addtogroup park
<> 140:97feb9bacc10 5260 * @{
<> 140:97feb9bacc10 5261 */
<> 140:97feb9bacc10 5262
<> 140:97feb9bacc10 5263 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5271 *
<> 140:97feb9bacc10 5272 * The function implements the forward Park transform.
<> 140:97feb9bacc10 5273 *
<> 140:97feb9bacc10 5274 */
AnnaBridge 145:64910690c574 5275 CMSIS_INLINE __STATIC_INLINE void arm_park_f32(
<> 140:97feb9bacc10 5276 float32_t Ialpha,
<> 140:97feb9bacc10 5277 float32_t Ibeta,
<> 140:97feb9bacc10 5278 float32_t * pId,
<> 140:97feb9bacc10 5279 float32_t * pIq,
<> 140:97feb9bacc10 5280 float32_t sinVal,
<> 140:97feb9bacc10 5281 float32_t cosVal)
<> 140:97feb9bacc10 5282 {
<> 140:97feb9bacc10 5283 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
<> 140:97feb9bacc10 5284 *pId = Ialpha * cosVal + Ibeta * sinVal;
<> 140:97feb9bacc10 5285
<> 140:97feb9bacc10 5286 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
<> 140:97feb9bacc10 5287 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
<> 140:97feb9bacc10 5288 }
<> 140:97feb9bacc10 5289
AnnaBridge 145:64910690c574 5290
<> 140:97feb9bacc10 5291 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5299 *
<> 140:97feb9bacc10 5300 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 5301 * \par
<> 140:97feb9bacc10 5302 * The function is implemented using an internal 32-bit accumulator.
<> 140:97feb9bacc10 5303 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 140:97feb9bacc10 5304 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
<> 140:97feb9bacc10 5305 */
AnnaBridge 145:64910690c574 5306 CMSIS_INLINE __STATIC_INLINE void arm_park_q31(
<> 140:97feb9bacc10 5307 q31_t Ialpha,
<> 140:97feb9bacc10 5308 q31_t Ibeta,
<> 140:97feb9bacc10 5309 q31_t * pId,
<> 140:97feb9bacc10 5310 q31_t * pIq,
<> 140:97feb9bacc10 5311 q31_t sinVal,
<> 140:97feb9bacc10 5312 q31_t cosVal)
<> 140:97feb9bacc10 5313 {
<> 140:97feb9bacc10 5314 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5315 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5316
<> 140:97feb9bacc10 5317 /* Intermediate product is calculated by (Ialpha * cosVal) */
<> 140:97feb9bacc10 5318 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
<> 140:97feb9bacc10 5319
<> 140:97feb9bacc10 5320 /* Intermediate product is calculated by (Ibeta * sinVal) */
<> 140:97feb9bacc10 5321 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
<> 140:97feb9bacc10 5322
<> 140:97feb9bacc10 5323
<> 140:97feb9bacc10 5324 /* Intermediate product is calculated by (Ialpha * sinVal) */
<> 140:97feb9bacc10 5325 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
<> 140:97feb9bacc10 5326
<> 140:97feb9bacc10 5327 /* Intermediate product is calculated by (Ibeta * cosVal) */
<> 140:97feb9bacc10 5328 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
<> 140:97feb9bacc10 5329
<> 140:97feb9bacc10 5330 /* Calculate pId by adding the two intermediate products 1 and 2 */
<> 140:97feb9bacc10 5331 *pId = __QADD(product1, product2);
<> 140:97feb9bacc10 5332
<> 140:97feb9bacc10 5333 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
<> 140:97feb9bacc10 5334 *pIq = __QSUB(product4, product3);
<> 140:97feb9bacc10 5335 }
<> 140:97feb9bacc10 5336
<> 140:97feb9bacc10 5337 /**
<> 140:97feb9bacc10 5338 * @} end of park group
<> 140:97feb9bacc10 5339 */
<> 140:97feb9bacc10 5340
<> 140:97feb9bacc10 5341 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5346 */
<> 140:97feb9bacc10 5347 void arm_q7_to_float(
<> 140:97feb9bacc10 5348 q7_t * pSrc,
<> 140:97feb9bacc10 5349 float32_t * pDst,
<> 140:97feb9bacc10 5350 uint32_t blockSize);
<> 140:97feb9bacc10 5351
<> 140:97feb9bacc10 5352
<> 140:97feb9bacc10 5353 /**
<> 140:97feb9bacc10 5354 * @ingroup groupController
<> 140:97feb9bacc10 5355 */
<> 140:97feb9bacc10 5356
<> 140:97feb9bacc10 5357 /**
<> 140:97feb9bacc10 5358 * @defgroup inv_park Vector Inverse Park transform
<> 140:97feb9bacc10 5359 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
<> 140:97feb9bacc10 5360 *
<> 140:97feb9bacc10 5361 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 140:97feb9bacc10 5362 * The library provides separate functions for Q31 and floating-point data types.
<> 140:97feb9bacc10 5363 * \par Algorithm
<> 140:97feb9bacc10 5364 * \image html parkInvFormula.gif
<> 140:97feb9bacc10 5365 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
<> 140:97feb9bacc10 5366 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 140:97feb9bacc10 5367 * cosine and sine values of theta (rotor flux position).
<> 140:97feb9bacc10 5368 * \par Fixed-Point Behavior
<> 140:97feb9bacc10 5369 * Care must be taken when using the Q31 version of the Park transform.
<> 140:97feb9bacc10 5370 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 140:97feb9bacc10 5371 * Refer to the function specific documentation below for usage guidelines.
<> 140:97feb9bacc10 5372 */
<> 140:97feb9bacc10 5373
<> 140:97feb9bacc10 5374 /**
<> 140:97feb9bacc10 5375 * @addtogroup inv_park
<> 140:97feb9bacc10 5376 * @{
<> 140:97feb9bacc10 5377 */
<> 140:97feb9bacc10 5378
<> 140:97feb9bacc10 5379 /**
<> 140:97feb9bacc10 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(
<> 140:97feb9bacc10 5389 float32_t Id,
<> 140:97feb9bacc10 5390 float32_t Iq,
<> 140:97feb9bacc10 5391 float32_t * pIalpha,
<> 140:97feb9bacc10 5392 float32_t * pIbeta,
<> 140:97feb9bacc10 5393 float32_t sinVal,
<> 140:97feb9bacc10 5394 float32_t cosVal)
<> 140:97feb9bacc10 5395 {
<> 140:97feb9bacc10 5396 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
<> 140:97feb9bacc10 5397 *pIalpha = Id * cosVal - Iq * sinVal;
<> 140:97feb9bacc10 5398
<> 140:97feb9bacc10 5399 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
<> 140:97feb9bacc10 5400 *pIbeta = Id * sinVal + Iq * cosVal;
<> 140:97feb9bacc10 5401 }
<> 140:97feb9bacc10 5402
<> 140:97feb9bacc10 5403
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5412 *
<> 140:97feb9bacc10 5413 * <b>Scaling and Overflow Behavior:</b>
<> 140:97feb9bacc10 5414 * \par
<> 140:97feb9bacc10 5415 * The function is implemented using an internal 32-bit accumulator.
<> 140:97feb9bacc10 5416 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 140:97feb9bacc10 5417 * There is saturation on the addition, hence there is no risk of overflow.
<> 140:97feb9bacc10 5418 */
AnnaBridge 145:64910690c574 5419 CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31(
<> 140:97feb9bacc10 5420 q31_t Id,
<> 140:97feb9bacc10 5421 q31_t Iq,
<> 140:97feb9bacc10 5422 q31_t * pIalpha,
<> 140:97feb9bacc10 5423 q31_t * pIbeta,
<> 140:97feb9bacc10 5424 q31_t sinVal,
<> 140:97feb9bacc10 5425 q31_t cosVal)
<> 140:97feb9bacc10 5426 {
<> 140:97feb9bacc10 5427 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5428 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 140:97feb9bacc10 5429
<> 140:97feb9bacc10 5430 /* Intermediate product is calculated by (Id * cosVal) */
<> 140:97feb9bacc10 5431 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
<> 140:97feb9bacc10 5432
<> 140:97feb9bacc10 5433 /* Intermediate product is calculated by (Iq * sinVal) */
<> 140:97feb9bacc10 5434 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
<> 140:97feb9bacc10 5435
<> 140:97feb9bacc10 5436
<> 140:97feb9bacc10 5437 /* Intermediate product is calculated by (Id * sinVal) */
<> 140:97feb9bacc10 5438 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
<> 140:97feb9bacc10 5439
<> 140:97feb9bacc10 5440 /* Intermediate product is calculated by (Iq * cosVal) */
<> 140:97feb9bacc10 5441 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
<> 140:97feb9bacc10 5442
<> 140:97feb9bacc10 5443 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
<> 140:97feb9bacc10 5444 *pIalpha = __QSUB(product1, product2);
<> 140:97feb9bacc10 5445
<> 140:97feb9bacc10 5446 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
<> 140:97feb9bacc10 5447 *pIbeta = __QADD(product4, product3);
<> 140:97feb9bacc10 5448 }
<> 140:97feb9bacc10 5449
<> 140:97feb9bacc10 5450 /**
<> 140:97feb9bacc10 5451 * @} end of Inverse park group
<> 140:97feb9bacc10 5452 */
<> 140:97feb9bacc10 5453
<> 140:97feb9bacc10 5454
<> 140:97feb9bacc10 5455 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5460 */
<> 140:97feb9bacc10 5461 void arm_q31_to_float(
<> 140:97feb9bacc10 5462 q31_t * pSrc,
<> 140:97feb9bacc10 5463 float32_t * pDst,
<> 140:97feb9bacc10 5464 uint32_t blockSize);
<> 140:97feb9bacc10 5465
<> 140:97feb9bacc10 5466 /**
<> 140:97feb9bacc10 5467 * @ingroup groupInterpolation
<> 140:97feb9bacc10 5468 */
<> 140:97feb9bacc10 5469
<> 140:97feb9bacc10 5470 /**
<> 140:97feb9bacc10 5471 * @defgroup LinearInterpolate Linear Interpolation
<> 140:97feb9bacc10 5472 *
<> 140:97feb9bacc10 5473 * Linear interpolation is a method of curve fitting using linear polynomials.
<> 140:97feb9bacc10 5474 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
<> 140:97feb9bacc10 5475 *
<> 140:97feb9bacc10 5476 * \par
<> 140:97feb9bacc10 5477 * \image html LinearInterp.gif "Linear interpolation"
<> 140:97feb9bacc10 5478 *
<> 140:97feb9bacc10 5479 * \par
<> 140:97feb9bacc10 5480 * A Linear Interpolate function calculates an output value(y), for the input(x)
<> 140:97feb9bacc10 5481 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
<> 140:97feb9bacc10 5482 *
<> 140:97feb9bacc10 5483 * \par Algorithm:
<> 140:97feb9bacc10 5484 * <pre>
<> 140:97feb9bacc10 5485 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
<> 140:97feb9bacc10 5486 * where x0, x1 are nearest values of input x
<> 140:97feb9bacc10 5487 * y0, y1 are nearest values to output y
<> 140:97feb9bacc10 5488 * </pre>
<> 140:97feb9bacc10 5489 *
<> 140:97feb9bacc10 5490 * \par
<> 140:97feb9bacc10 5491 * This set of functions implements Linear interpolation process
<> 140:97feb9bacc10 5492 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
<> 140:97feb9bacc10 5493 * sample of data and each call to the function returns a single processed value.
<> 140:97feb9bacc10 5494 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
<> 140:97feb9bacc10 5495 * <code>x</code> is the input sample value. The functions returns the output value.
<> 140:97feb9bacc10 5496 *
<> 140:97feb9bacc10 5497 * \par
<> 140:97feb9bacc10 5498 * if x is outside of the table boundary, Linear interpolation returns first value of the table
<> 140:97feb9bacc10 5499 * if x is below input range and returns last value of table if x is above range.
<> 140:97feb9bacc10 5500 */
<> 140:97feb9bacc10 5501
<> 140:97feb9bacc10 5502 /**
<> 140:97feb9bacc10 5503 * @addtogroup LinearInterpolate
<> 140:97feb9bacc10 5504 * @{
<> 140:97feb9bacc10 5505 */
<> 140:97feb9bacc10 5506
<> 140:97feb9bacc10 5507 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5511 * @return y processed output sample.
<> 140:97feb9bacc10 5512 *
<> 140:97feb9bacc10 5513 */
AnnaBridge 145:64910690c574 5514 CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32(
<> 140:97feb9bacc10 5515 arm_linear_interp_instance_f32 * S,
<> 140:97feb9bacc10 5516 float32_t x)
<> 140:97feb9bacc10 5517 {
<> 140:97feb9bacc10 5518 float32_t y;
<> 140:97feb9bacc10 5519 float32_t x0, x1; /* Nearest input values */
<> 140:97feb9bacc10 5520 float32_t y0, y1; /* Nearest output values */
<> 140:97feb9bacc10 5521 float32_t xSpacing = S->xSpacing; /* spacing between input values */
<> 140:97feb9bacc10 5522 int32_t i; /* Index variable */
<> 140:97feb9bacc10 5523 float32_t *pYData = S->pYData; /* pointer to output table */
<> 140:97feb9bacc10 5524
<> 140:97feb9bacc10 5525 /* Calculation of index */
<> 140:97feb9bacc10 5526 i = (int32_t) ((x - S->x1) / xSpacing);
<> 140:97feb9bacc10 5527
AnnaBridge 145:64910690c574 5528 if (i < 0)
<> 140:97feb9bacc10 5529 {
<> 140:97feb9bacc10 5530 /* Iniatilize output for below specified range as least output value of table */
<> 140:97feb9bacc10 5531 y = pYData[0];
<> 140:97feb9bacc10 5532 }
AnnaBridge 145:64910690c574 5533 else if ((uint32_t)i >= S->nValues)
<> 140:97feb9bacc10 5534 {
<> 140:97feb9bacc10 5535 /* Iniatilize output for above specified range as last output value of table */
<> 140:97feb9bacc10 5536 y = pYData[S->nValues - 1];
<> 140:97feb9bacc10 5537 }
<> 140:97feb9bacc10 5538 else
<> 140:97feb9bacc10 5539 {
<> 140:97feb9bacc10 5540 /* Calculation of nearest input values */
AnnaBridge 145:64910690c574 5541 x0 = S->x1 + i * xSpacing;
<> 140:97feb9bacc10 5542 x1 = S->x1 + (i + 1) * xSpacing;
<> 140:97feb9bacc10 5543
<> 140:97feb9bacc10 5544 /* Read of nearest output values */
<> 140:97feb9bacc10 5545 y0 = pYData[i];
<> 140:97feb9bacc10 5546 y1 = pYData[i + 1];
<> 140:97feb9bacc10 5547
<> 140:97feb9bacc10 5548 /* Calculation of output */
<> 140:97feb9bacc10 5549 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
<> 140:97feb9bacc10 5550
<> 140:97feb9bacc10 5551 }
<> 140:97feb9bacc10 5552
<> 140:97feb9bacc10 5553 /* returns output value */
<> 140:97feb9bacc10 5554 return (y);
<> 140:97feb9bacc10 5555 }
<> 140:97feb9bacc10 5556
AnnaBridge 145:64910690c574 5557
<> 140:97feb9bacc10 5558 /**
<> 140:97feb9bacc10 5559 *
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5564 * @return y processed output sample.
<> 140:97feb9bacc10 5565 *
<> 140:97feb9bacc10 5566 * \par
<> 140:97feb9bacc10 5567 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 140:97feb9bacc10 5568 * This function can support maximum of table size 2^12.
<> 140:97feb9bacc10 5569 *
<> 140:97feb9bacc10 5570 */
AnnaBridge 145:64910690c574 5571 CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31(
<> 140:97feb9bacc10 5572 q31_t * pYData,
<> 140:97feb9bacc10 5573 q31_t x,
<> 140:97feb9bacc10 5574 uint32_t nValues)
<> 140:97feb9bacc10 5575 {
<> 140:97feb9bacc10 5576 q31_t y; /* output */
<> 140:97feb9bacc10 5577 q31_t y0, y1; /* Nearest output values */
<> 140:97feb9bacc10 5578 q31_t fract; /* fractional part */
<> 140:97feb9bacc10 5579 int32_t index; /* Index to read nearest output values */
<> 140:97feb9bacc10 5580
<> 140:97feb9bacc10 5581 /* Input is in 12.20 format */
<> 140:97feb9bacc10 5582 /* 12 bits for the table index */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 5587 {
<> 140:97feb9bacc10 5588 return (pYData[nValues - 1]);
<> 140:97feb9bacc10 5589 }
AnnaBridge 145:64910690c574 5590 else if (index < 0)
<> 140:97feb9bacc10 5591 {
<> 140:97feb9bacc10 5592 return (pYData[0]);
<> 140:97feb9bacc10 5593 }
<> 140:97feb9bacc10 5594 else
<> 140:97feb9bacc10 5595 {
<> 140:97feb9bacc10 5596 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 5597 /* shift left by 11 to keep fract in 1.31 format */
<> 140:97feb9bacc10 5598 fract = (x & 0x000FFFFF) << 11;
<> 140:97feb9bacc10 5599
<> 140:97feb9bacc10 5600 /* Read two nearest output values from the index in 1.31(q31) format */
<> 140:97feb9bacc10 5601 y0 = pYData[index];
AnnaBridge 145:64910690c574 5602 y1 = pYData[index + 1];
<> 140:97feb9bacc10 5603
<> 140:97feb9bacc10 5604 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
<> 140:97feb9bacc10 5605 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
<> 140:97feb9bacc10 5606
<> 140:97feb9bacc10 5607 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
<> 140:97feb9bacc10 5608 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
<> 140:97feb9bacc10 5609
<> 140:97feb9bacc10 5610 /* Convert y to 1.31 format */
<> 140:97feb9bacc10 5611 return (y << 1u);
<> 140:97feb9bacc10 5612 }
<> 140:97feb9bacc10 5613 }
<> 140:97feb9bacc10 5614
AnnaBridge 145:64910690c574 5615
<> 140:97feb9bacc10 5616 /**
<> 140:97feb9bacc10 5617 *
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5622 * @return y processed output sample.
<> 140:97feb9bacc10 5623 *
<> 140:97feb9bacc10 5624 * \par
<> 140:97feb9bacc10 5625 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 140:97feb9bacc10 5626 * This function can support maximum of table size 2^12.
<> 140:97feb9bacc10 5627 *
<> 140:97feb9bacc10 5628 */
AnnaBridge 145:64910690c574 5629 CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15(
<> 140:97feb9bacc10 5630 q15_t * pYData,
<> 140:97feb9bacc10 5631 q31_t x,
<> 140:97feb9bacc10 5632 uint32_t nValues)
<> 140:97feb9bacc10 5633 {
<> 140:97feb9bacc10 5634 q63_t y; /* output */
<> 140:97feb9bacc10 5635 q15_t y0, y1; /* Nearest output values */
<> 140:97feb9bacc10 5636 q31_t fract; /* fractional part */
<> 140:97feb9bacc10 5637 int32_t index; /* Index to read nearest output values */
<> 140:97feb9bacc10 5638
<> 140:97feb9bacc10 5639 /* Input is in 12.20 format */
<> 140:97feb9bacc10 5640 /* 12 bits for the table index */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 5645 {
<> 140:97feb9bacc10 5646 return (pYData[nValues - 1]);
<> 140:97feb9bacc10 5647 }
AnnaBridge 145:64910690c574 5648 else if (index < 0)
<> 140:97feb9bacc10 5649 {
<> 140:97feb9bacc10 5650 return (pYData[0]);
<> 140:97feb9bacc10 5651 }
<> 140:97feb9bacc10 5652 else
<> 140:97feb9bacc10 5653 {
<> 140:97feb9bacc10 5654 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 5655 /* fract is in 12.20 format */
<> 140:97feb9bacc10 5656 fract = (x & 0x000FFFFF);
<> 140:97feb9bacc10 5657
<> 140:97feb9bacc10 5658 /* Read two nearest output values from the index */
<> 140:97feb9bacc10 5659 y0 = pYData[index];
AnnaBridge 145:64910690c574 5660 y1 = pYData[index + 1];
<> 140:97feb9bacc10 5661
<> 140:97feb9bacc10 5662 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
<> 140:97feb9bacc10 5663 y = ((q63_t) y0 * (0xFFFFF - fract));
<> 140:97feb9bacc10 5664
<> 140:97feb9bacc10 5665 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
<> 140:97feb9bacc10 5666 y += ((q63_t) y1 * (fract));
<> 140:97feb9bacc10 5667
<> 140:97feb9bacc10 5668 /* convert y to 1.15 format */
AnnaBridge 145:64910690c574 5669 return (q15_t) (y >> 20);
<> 140:97feb9bacc10 5670 }
<> 140:97feb9bacc10 5671 }
<> 140:97feb9bacc10 5672
AnnaBridge 145:64910690c574 5673
<> 140:97feb9bacc10 5674 /**
<> 140:97feb9bacc10 5675 *
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 5680 * @return y processed output sample.
<> 140:97feb9bacc10 5681 *
<> 140:97feb9bacc10 5682 * \par
<> 140:97feb9bacc10 5683 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 140:97feb9bacc10 5684 * This function can support maximum of table size 2^12.
<> 140:97feb9bacc10 5685 */
AnnaBridge 145:64910690c574 5686 CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7(
<> 140:97feb9bacc10 5687 q7_t * pYData,
<> 140:97feb9bacc10 5688 q31_t x,
<> 140:97feb9bacc10 5689 uint32_t nValues)
<> 140:97feb9bacc10 5690 {
<> 140:97feb9bacc10 5691 q31_t y; /* output */
<> 140:97feb9bacc10 5692 q7_t y0, y1; /* Nearest output values */
<> 140:97feb9bacc10 5693 q31_t fract; /* fractional part */
<> 140:97feb9bacc10 5694 uint32_t index; /* Index to read nearest output values */
<> 140:97feb9bacc10 5695
<> 140:97feb9bacc10 5696 /* Input is in 12.20 format */
<> 140:97feb9bacc10 5697 /* 12 bits for the table index */
<> 140:97feb9bacc10 5698 /* Index value calculation */
<> 140:97feb9bacc10 5699 if (x < 0)
<> 140:97feb9bacc10 5700 {
<> 140:97feb9bacc10 5701 return (pYData[0]);
<> 140:97feb9bacc10 5702 }
<> 140:97feb9bacc10 5703 index = (x >> 20) & 0xfff;
<> 140:97feb9bacc10 5704
AnnaBridge 145:64910690c574 5705 if (index >= (nValues - 1))
<> 140:97feb9bacc10 5706 {
<> 140:97feb9bacc10 5707 return (pYData[nValues - 1]);
<> 140:97feb9bacc10 5708 }
<> 140:97feb9bacc10 5709 else
<> 140:97feb9bacc10 5710 {
<> 140:97feb9bacc10 5711 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 5712 /* fract is in 12.20 format */
<> 140:97feb9bacc10 5713 fract = (x & 0x000FFFFF);
<> 140:97feb9bacc10 5714
<> 140:97feb9bacc10 5715 /* Read two nearest output values from the index and are in 1.7(q7) format */
<> 140:97feb9bacc10 5716 y0 = pYData[index];
AnnaBridge 145:64910690c574 5717 y1 = pYData[index + 1];
<> 140:97feb9bacc10 5718
<> 140:97feb9bacc10 5719 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
<> 140:97feb9bacc10 5720 y = ((y0 * (0xFFFFF - fract)));
<> 140:97feb9bacc10 5721
<> 140:97feb9bacc10 5722 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
<> 140:97feb9bacc10 5723 y += (y1 * fract);
<> 140:97feb9bacc10 5724
<> 140:97feb9bacc10 5725 /* convert y to 1.7(q7) format */
AnnaBridge 145:64910690c574 5726 return (q7_t) (y >> 20);
AnnaBridge 145:64910690c574 5727 }
<> 140:97feb9bacc10 5728 }
AnnaBridge 145:64910690c574 5729
<> 140:97feb9bacc10 5730 /**
<> 140:97feb9bacc10 5731 * @} end of LinearInterpolate group
<> 140:97feb9bacc10 5732 */
<> 140:97feb9bacc10 5733
<> 140:97feb9bacc10 5734 /**
<> 140:97feb9bacc10 5735 * @brief Fast approximation to the trigonometric sine function for floating-point data.
AnnaBridge 145:64910690c574 5736 * @param[in] x input value in radians.
<> 140:97feb9bacc10 5737 * @return sin(x).
<> 140:97feb9bacc10 5738 */
<> 140:97feb9bacc10 5739 float32_t arm_sin_f32(
<> 140:97feb9bacc10 5740 float32_t x);
<> 140:97feb9bacc10 5741
AnnaBridge 145:64910690c574 5742
<> 140:97feb9bacc10 5743 /**
<> 140:97feb9bacc10 5744 * @brief Fast approximation to the trigonometric sine function for Q31 data.
AnnaBridge 145:64910690c574 5745 * @param[in] x Scaled input value in radians.
<> 140:97feb9bacc10 5746 * @return sin(x).
<> 140:97feb9bacc10 5747 */
<> 140:97feb9bacc10 5748 q31_t arm_sin_q31(
<> 140:97feb9bacc10 5749 q31_t x);
<> 140:97feb9bacc10 5750
AnnaBridge 145:64910690c574 5751
<> 140:97feb9bacc10 5752 /**
<> 140:97feb9bacc10 5753 * @brief Fast approximation to the trigonometric sine function for Q15 data.
AnnaBridge 145:64910690c574 5754 * @param[in] x Scaled input value in radians.
<> 140:97feb9bacc10 5755 * @return sin(x).
<> 140:97feb9bacc10 5756 */
<> 140:97feb9bacc10 5757 q15_t arm_sin_q15(
<> 140:97feb9bacc10 5758 q15_t x);
<> 140:97feb9bacc10 5759
AnnaBridge 145:64910690c574 5760
<> 140:97feb9bacc10 5761 /**
<> 140:97feb9bacc10 5762 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
AnnaBridge 145:64910690c574 5763 * @param[in] x input value in radians.
<> 140:97feb9bacc10 5764 * @return cos(x).
<> 140:97feb9bacc10 5765 */
<> 140:97feb9bacc10 5766 float32_t arm_cos_f32(
<> 140:97feb9bacc10 5767 float32_t x);
<> 140:97feb9bacc10 5768
AnnaBridge 145:64910690c574 5769
<> 140:97feb9bacc10 5770 /**
<> 140:97feb9bacc10 5771 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
AnnaBridge 145:64910690c574 5772 * @param[in] x Scaled input value in radians.
<> 140:97feb9bacc10 5773 * @return cos(x).
<> 140:97feb9bacc10 5774 */
<> 140:97feb9bacc10 5775 q31_t arm_cos_q31(
<> 140:97feb9bacc10 5776 q31_t x);
<> 140:97feb9bacc10 5777
AnnaBridge 145:64910690c574 5778
<> 140:97feb9bacc10 5779 /**
<> 140:97feb9bacc10 5780 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
AnnaBridge 145:64910690c574 5781 * @param[in] x Scaled input value in radians.
<> 140:97feb9bacc10 5782 * @return cos(x).
<> 140:97feb9bacc10 5783 */
<> 140:97feb9bacc10 5784 q15_t arm_cos_q15(
<> 140:97feb9bacc10 5785 q15_t x);
<> 140:97feb9bacc10 5786
<> 140:97feb9bacc10 5787
<> 140:97feb9bacc10 5788 /**
<> 140:97feb9bacc10 5789 * @ingroup groupFastMath
<> 140:97feb9bacc10 5790 */
<> 140:97feb9bacc10 5791
<> 140:97feb9bacc10 5792
<> 140:97feb9bacc10 5793 /**
<> 140:97feb9bacc10 5794 * @defgroup SQRT Square Root
<> 140:97feb9bacc10 5795 *
<> 140:97feb9bacc10 5796 * Computes the square root of a number.
<> 140:97feb9bacc10 5797 * There are separate functions for Q15, Q31, and floating-point data types.
<> 140:97feb9bacc10 5798 * The square root function is computed using the Newton-Raphson algorithm.
<> 140:97feb9bacc10 5799 * This is an iterative algorithm of the form:
<> 140:97feb9bacc10 5800 * <pre>
<> 140:97feb9bacc10 5801 * x1 = x0 - f(x0)/f'(x0)
<> 140:97feb9bacc10 5802 * </pre>
<> 140:97feb9bacc10 5803 * where <code>x1</code> is the current estimate,
<> 140:97feb9bacc10 5804 * <code>x0</code> is the previous estimate, and
<> 140:97feb9bacc10 5805 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
<> 140:97feb9bacc10 5806 * For the square root function, the algorithm reduces to:
<> 140:97feb9bacc10 5807 * <pre>
<> 140:97feb9bacc10 5808 * x0 = in/2 [initial guess]
<> 140:97feb9bacc10 5809 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
<> 140:97feb9bacc10 5810 * </pre>
<> 140:97feb9bacc10 5811 */
<> 140:97feb9bacc10 5812
<> 140:97feb9bacc10 5813
<> 140:97feb9bacc10 5814 /**
<> 140:97feb9bacc10 5815 * @addtogroup SQRT
<> 140:97feb9bacc10 5816 * @{
<> 140:97feb9bacc10 5817 */
<> 140:97feb9bacc10 5818
<> 140:97feb9bacc10 5819 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 5823 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 140:97feb9bacc10 5824 * <code>in</code> is negative value and returns zero output for negative values.
<> 140:97feb9bacc10 5825 */
AnnaBridge 145:64910690c574 5826 CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32(
<> 140:97feb9bacc10 5827 float32_t in,
<> 140:97feb9bacc10 5828 float32_t * pOut)
<> 140:97feb9bacc10 5829 {
AnnaBridge 145:64910690c574 5830 if (in >= 0.0f)
<> 140:97feb9bacc10 5831 {
<> 140:97feb9bacc10 5832
AnnaBridge 145:64910690c574 5833 #if (__FPU_USED == 1) && defined ( __CC_ARM )
<> 140:97feb9bacc10 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));
<> 140:97feb9bacc10 5841 #else
<> 140:97feb9bacc10 5842 *pOut = sqrtf(in);
<> 140:97feb9bacc10 5843 #endif
<> 140:97feb9bacc10 5844
<> 140:97feb9bacc10 5845 return (ARM_MATH_SUCCESS);
<> 140:97feb9bacc10 5846 }
<> 140:97feb9bacc10 5847 else
<> 140:97feb9bacc10 5848 {
<> 140:97feb9bacc10 5849 *pOut = 0.0f;
<> 140:97feb9bacc10 5850 return (ARM_MATH_ARGUMENT_ERROR);
<> 140:97feb9bacc10 5851 }
<> 140:97feb9bacc10 5852 }
<> 140:97feb9bacc10 5853
<> 140:97feb9bacc10 5854
<> 140:97feb9bacc10 5855 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 5859 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 140:97feb9bacc10 5860 * <code>in</code> is negative value and returns zero output for negative values.
<> 140:97feb9bacc10 5861 */
<> 140:97feb9bacc10 5862 arm_status arm_sqrt_q31(
<> 140:97feb9bacc10 5863 q31_t in,
<> 140:97feb9bacc10 5864 q31_t * pOut);
<> 140:97feb9bacc10 5865
AnnaBridge 145:64910690c574 5866
<> 140:97feb9bacc10 5867 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 5871 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 140:97feb9bacc10 5872 * <code>in</code> is negative value and returns zero output for negative values.
<> 140:97feb9bacc10 5873 */
<> 140:97feb9bacc10 5874 arm_status arm_sqrt_q15(
<> 140:97feb9bacc10 5875 q15_t in,
<> 140:97feb9bacc10 5876 q15_t * pOut);
<> 140:97feb9bacc10 5877
<> 140:97feb9bacc10 5878 /**
<> 140:97feb9bacc10 5879 * @} end of SQRT group
<> 140:97feb9bacc10 5880 */
<> 140:97feb9bacc10 5881
<> 140:97feb9bacc10 5882
<> 140:97feb9bacc10 5883 /**
<> 140:97feb9bacc10 5884 * @brief floating-point Circular write function.
<> 140:97feb9bacc10 5885 */
AnnaBridge 145:64910690c574 5886 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32(
<> 140:97feb9bacc10 5887 int32_t * circBuffer,
<> 140:97feb9bacc10 5888 int32_t L,
<> 140:97feb9bacc10 5889 uint16_t * writeOffset,
<> 140:97feb9bacc10 5890 int32_t bufferInc,
<> 140:97feb9bacc10 5891 const int32_t * src,
<> 140:97feb9bacc10 5892 int32_t srcInc,
<> 140:97feb9bacc10 5893 uint32_t blockSize)
<> 140:97feb9bacc10 5894 {
<> 140:97feb9bacc10 5895 uint32_t i = 0u;
<> 140:97feb9bacc10 5896 int32_t wOffset;
<> 140:97feb9bacc10 5897
<> 140:97feb9bacc10 5898 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 5899 * to the current location where the input samples to be copied */
<> 140:97feb9bacc10 5900 wOffset = *writeOffset;
<> 140:97feb9bacc10 5901
<> 140:97feb9bacc10 5902 /* Loop over the blockSize */
<> 140:97feb9bacc10 5903 i = blockSize;
<> 140:97feb9bacc10 5904
AnnaBridge 145:64910690c574 5905 while (i > 0u)
<> 140:97feb9bacc10 5906 {
<> 140:97feb9bacc10 5907 /* copy the input sample to the circular buffer */
<> 140:97feb9bacc10 5908 circBuffer[wOffset] = *src;
<> 140:97feb9bacc10 5909
<> 140:97feb9bacc10 5910 /* Update the input pointer */
<> 140:97feb9bacc10 5911 src += srcInc;
<> 140:97feb9bacc10 5912
<> 140:97feb9bacc10 5913 /* Circularly update wOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 5914 wOffset += bufferInc;
AnnaBridge 145:64910690c574 5915 if (wOffset >= L)
<> 140:97feb9bacc10 5916 wOffset -= L;
<> 140:97feb9bacc10 5917
<> 140:97feb9bacc10 5918 /* Decrement the loop counter */
<> 140:97feb9bacc10 5919 i--;
<> 140:97feb9bacc10 5920 }
<> 140:97feb9bacc10 5921
<> 140:97feb9bacc10 5922 /* Update the index pointer */
AnnaBridge 145:64910690c574 5923 *writeOffset = (uint16_t)wOffset;
<> 140:97feb9bacc10 5924 }
<> 140:97feb9bacc10 5925
<> 140:97feb9bacc10 5926
<> 140:97feb9bacc10 5927
<> 140:97feb9bacc10 5928 /**
<> 140:97feb9bacc10 5929 * @brief floating-point Circular Read function.
<> 140:97feb9bacc10 5930 */
AnnaBridge 145:64910690c574 5931 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32(
<> 140:97feb9bacc10 5932 int32_t * circBuffer,
<> 140:97feb9bacc10 5933 int32_t L,
<> 140:97feb9bacc10 5934 int32_t * readOffset,
<> 140:97feb9bacc10 5935 int32_t bufferInc,
<> 140:97feb9bacc10 5936 int32_t * dst,
<> 140:97feb9bacc10 5937 int32_t * dst_base,
<> 140:97feb9bacc10 5938 int32_t dst_length,
<> 140:97feb9bacc10 5939 int32_t dstInc,
<> 140:97feb9bacc10 5940 uint32_t blockSize)
<> 140:97feb9bacc10 5941 {
<> 140:97feb9bacc10 5942 uint32_t i = 0u;
<> 140:97feb9bacc10 5943 int32_t rOffset, dst_end;
<> 140:97feb9bacc10 5944
<> 140:97feb9bacc10 5945 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 5946 * to the current location from where the input samples to be read */
<> 140:97feb9bacc10 5947 rOffset = *readOffset;
<> 140:97feb9bacc10 5948 dst_end = (int32_t) (dst_base + dst_length);
<> 140:97feb9bacc10 5949
<> 140:97feb9bacc10 5950 /* Loop over the blockSize */
<> 140:97feb9bacc10 5951 i = blockSize;
<> 140:97feb9bacc10 5952
AnnaBridge 145:64910690c574 5953 while (i > 0u)
<> 140:97feb9bacc10 5954 {
<> 140:97feb9bacc10 5955 /* copy the sample from the circular buffer to the destination buffer */
<> 140:97feb9bacc10 5956 *dst = circBuffer[rOffset];
<> 140:97feb9bacc10 5957
<> 140:97feb9bacc10 5958 /* Update the input pointer */
<> 140:97feb9bacc10 5959 dst += dstInc;
<> 140:97feb9bacc10 5960
AnnaBridge 145:64910690c574 5961 if (dst == (int32_t *) dst_end)
<> 140:97feb9bacc10 5962 {
<> 140:97feb9bacc10 5963 dst = dst_base;
<> 140:97feb9bacc10 5964 }
<> 140:97feb9bacc10 5965
<> 140:97feb9bacc10 5966 /* Circularly update rOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 5967 rOffset += bufferInc;
<> 140:97feb9bacc10 5968
AnnaBridge 145:64910690c574 5969 if (rOffset >= L)
<> 140:97feb9bacc10 5970 {
<> 140:97feb9bacc10 5971 rOffset -= L;
<> 140:97feb9bacc10 5972 }
<> 140:97feb9bacc10 5973
<> 140:97feb9bacc10 5974 /* Decrement the loop counter */
<> 140:97feb9bacc10 5975 i--;
<> 140:97feb9bacc10 5976 }
<> 140:97feb9bacc10 5977
<> 140:97feb9bacc10 5978 /* Update the index pointer */
<> 140:97feb9bacc10 5979 *readOffset = rOffset;
<> 140:97feb9bacc10 5980 }
<> 140:97feb9bacc10 5981
AnnaBridge 145:64910690c574 5982
<> 140:97feb9bacc10 5983 /**
<> 140:97feb9bacc10 5984 * @brief Q15 Circular write function.
<> 140:97feb9bacc10 5985 */
AnnaBridge 145:64910690c574 5986 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15(
<> 140:97feb9bacc10 5987 q15_t * circBuffer,
<> 140:97feb9bacc10 5988 int32_t L,
<> 140:97feb9bacc10 5989 uint16_t * writeOffset,
<> 140:97feb9bacc10 5990 int32_t bufferInc,
<> 140:97feb9bacc10 5991 const q15_t * src,
<> 140:97feb9bacc10 5992 int32_t srcInc,
<> 140:97feb9bacc10 5993 uint32_t blockSize)
<> 140:97feb9bacc10 5994 {
<> 140:97feb9bacc10 5995 uint32_t i = 0u;
<> 140:97feb9bacc10 5996 int32_t wOffset;
<> 140:97feb9bacc10 5997
<> 140:97feb9bacc10 5998 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 5999 * to the current location where the input samples to be copied */
<> 140:97feb9bacc10 6000 wOffset = *writeOffset;
<> 140:97feb9bacc10 6001
<> 140:97feb9bacc10 6002 /* Loop over the blockSize */
<> 140:97feb9bacc10 6003 i = blockSize;
<> 140:97feb9bacc10 6004
AnnaBridge 145:64910690c574 6005 while (i > 0u)
<> 140:97feb9bacc10 6006 {
<> 140:97feb9bacc10 6007 /* copy the input sample to the circular buffer */
<> 140:97feb9bacc10 6008 circBuffer[wOffset] = *src;
<> 140:97feb9bacc10 6009
<> 140:97feb9bacc10 6010 /* Update the input pointer */
<> 140:97feb9bacc10 6011 src += srcInc;
<> 140:97feb9bacc10 6012
<> 140:97feb9bacc10 6013 /* Circularly update wOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 6014 wOffset += bufferInc;
AnnaBridge 145:64910690c574 6015 if (wOffset >= L)
<> 140:97feb9bacc10 6016 wOffset -= L;
<> 140:97feb9bacc10 6017
<> 140:97feb9bacc10 6018 /* Decrement the loop counter */
<> 140:97feb9bacc10 6019 i--;
<> 140:97feb9bacc10 6020 }
<> 140:97feb9bacc10 6021
<> 140:97feb9bacc10 6022 /* Update the index pointer */
AnnaBridge 145:64910690c574 6023 *writeOffset = (uint16_t)wOffset;
<> 140:97feb9bacc10 6024 }
<> 140:97feb9bacc10 6025
<> 140:97feb9bacc10 6026
<> 140:97feb9bacc10 6027 /**
<> 140:97feb9bacc10 6028 * @brief Q15 Circular Read function.
<> 140:97feb9bacc10 6029 */
AnnaBridge 145:64910690c574 6030 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15(
<> 140:97feb9bacc10 6031 q15_t * circBuffer,
<> 140:97feb9bacc10 6032 int32_t L,
<> 140:97feb9bacc10 6033 int32_t * readOffset,
<> 140:97feb9bacc10 6034 int32_t bufferInc,
<> 140:97feb9bacc10 6035 q15_t * dst,
<> 140:97feb9bacc10 6036 q15_t * dst_base,
<> 140:97feb9bacc10 6037 int32_t dst_length,
<> 140:97feb9bacc10 6038 int32_t dstInc,
<> 140:97feb9bacc10 6039 uint32_t blockSize)
<> 140:97feb9bacc10 6040 {
<> 140:97feb9bacc10 6041 uint32_t i = 0;
<> 140:97feb9bacc10 6042 int32_t rOffset, dst_end;
<> 140:97feb9bacc10 6043
<> 140:97feb9bacc10 6044 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 6045 * to the current location from where the input samples to be read */
<> 140:97feb9bacc10 6046 rOffset = *readOffset;
<> 140:97feb9bacc10 6047
<> 140:97feb9bacc10 6048 dst_end = (int32_t) (dst_base + dst_length);
<> 140:97feb9bacc10 6049
<> 140:97feb9bacc10 6050 /* Loop over the blockSize */
<> 140:97feb9bacc10 6051 i = blockSize;
<> 140:97feb9bacc10 6052
AnnaBridge 145:64910690c574 6053 while (i > 0u)
<> 140:97feb9bacc10 6054 {
<> 140:97feb9bacc10 6055 /* copy the sample from the circular buffer to the destination buffer */
<> 140:97feb9bacc10 6056 *dst = circBuffer[rOffset];
<> 140:97feb9bacc10 6057
<> 140:97feb9bacc10 6058 /* Update the input pointer */
<> 140:97feb9bacc10 6059 dst += dstInc;
<> 140:97feb9bacc10 6060
AnnaBridge 145:64910690c574 6061 if (dst == (q15_t *) dst_end)
<> 140:97feb9bacc10 6062 {
<> 140:97feb9bacc10 6063 dst = dst_base;
<> 140:97feb9bacc10 6064 }
<> 140:97feb9bacc10 6065
<> 140:97feb9bacc10 6066 /* Circularly update wOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 6067 rOffset += bufferInc;
<> 140:97feb9bacc10 6068
AnnaBridge 145:64910690c574 6069 if (rOffset >= L)
<> 140:97feb9bacc10 6070 {
<> 140:97feb9bacc10 6071 rOffset -= L;
<> 140:97feb9bacc10 6072 }
<> 140:97feb9bacc10 6073
<> 140:97feb9bacc10 6074 /* Decrement the loop counter */
<> 140:97feb9bacc10 6075 i--;
<> 140:97feb9bacc10 6076 }
<> 140:97feb9bacc10 6077
<> 140:97feb9bacc10 6078 /* Update the index pointer */
<> 140:97feb9bacc10 6079 *readOffset = rOffset;
<> 140:97feb9bacc10 6080 }
<> 140:97feb9bacc10 6081
<> 140:97feb9bacc10 6082
<> 140:97feb9bacc10 6083 /**
<> 140:97feb9bacc10 6084 * @brief Q7 Circular write function.
<> 140:97feb9bacc10 6085 */
AnnaBridge 145:64910690c574 6086 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7(
<> 140:97feb9bacc10 6087 q7_t * circBuffer,
<> 140:97feb9bacc10 6088 int32_t L,
<> 140:97feb9bacc10 6089 uint16_t * writeOffset,
<> 140:97feb9bacc10 6090 int32_t bufferInc,
<> 140:97feb9bacc10 6091 const q7_t * src,
<> 140:97feb9bacc10 6092 int32_t srcInc,
<> 140:97feb9bacc10 6093 uint32_t blockSize)
<> 140:97feb9bacc10 6094 {
<> 140:97feb9bacc10 6095 uint32_t i = 0u;
<> 140:97feb9bacc10 6096 int32_t wOffset;
<> 140:97feb9bacc10 6097
<> 140:97feb9bacc10 6098 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 6099 * to the current location where the input samples to be copied */
<> 140:97feb9bacc10 6100 wOffset = *writeOffset;
<> 140:97feb9bacc10 6101
<> 140:97feb9bacc10 6102 /* Loop over the blockSize */
<> 140:97feb9bacc10 6103 i = blockSize;
<> 140:97feb9bacc10 6104
AnnaBridge 145:64910690c574 6105 while (i > 0u)
<> 140:97feb9bacc10 6106 {
<> 140:97feb9bacc10 6107 /* copy the input sample to the circular buffer */
<> 140:97feb9bacc10 6108 circBuffer[wOffset] = *src;
<> 140:97feb9bacc10 6109
<> 140:97feb9bacc10 6110 /* Update the input pointer */
<> 140:97feb9bacc10 6111 src += srcInc;
<> 140:97feb9bacc10 6112
<> 140:97feb9bacc10 6113 /* Circularly update wOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 6114 wOffset += bufferInc;
AnnaBridge 145:64910690c574 6115 if (wOffset >= L)
<> 140:97feb9bacc10 6116 wOffset -= L;
<> 140:97feb9bacc10 6117
<> 140:97feb9bacc10 6118 /* Decrement the loop counter */
<> 140:97feb9bacc10 6119 i--;
<> 140:97feb9bacc10 6120 }
<> 140:97feb9bacc10 6121
<> 140:97feb9bacc10 6122 /* Update the index pointer */
AnnaBridge 145:64910690c574 6123 *writeOffset = (uint16_t)wOffset;
<> 140:97feb9bacc10 6124 }
<> 140:97feb9bacc10 6125
<> 140:97feb9bacc10 6126
<> 140:97feb9bacc10 6127 /**
<> 140:97feb9bacc10 6128 * @brief Q7 Circular Read function.
<> 140:97feb9bacc10 6129 */
AnnaBridge 145:64910690c574 6130 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7(
<> 140:97feb9bacc10 6131 q7_t * circBuffer,
<> 140:97feb9bacc10 6132 int32_t L,
<> 140:97feb9bacc10 6133 int32_t * readOffset,
<> 140:97feb9bacc10 6134 int32_t bufferInc,
<> 140:97feb9bacc10 6135 q7_t * dst,
<> 140:97feb9bacc10 6136 q7_t * dst_base,
<> 140:97feb9bacc10 6137 int32_t dst_length,
<> 140:97feb9bacc10 6138 int32_t dstInc,
<> 140:97feb9bacc10 6139 uint32_t blockSize)
<> 140:97feb9bacc10 6140 {
<> 140:97feb9bacc10 6141 uint32_t i = 0;
<> 140:97feb9bacc10 6142 int32_t rOffset, dst_end;
<> 140:97feb9bacc10 6143
<> 140:97feb9bacc10 6144 /* Copy the value of Index pointer that points
<> 140:97feb9bacc10 6145 * to the current location from where the input samples to be read */
<> 140:97feb9bacc10 6146 rOffset = *readOffset;
<> 140:97feb9bacc10 6147
<> 140:97feb9bacc10 6148 dst_end = (int32_t) (dst_base + dst_length);
<> 140:97feb9bacc10 6149
<> 140:97feb9bacc10 6150 /* Loop over the blockSize */
<> 140:97feb9bacc10 6151 i = blockSize;
<> 140:97feb9bacc10 6152
AnnaBridge 145:64910690c574 6153 while (i > 0u)
<> 140:97feb9bacc10 6154 {
<> 140:97feb9bacc10 6155 /* copy the sample from the circular buffer to the destination buffer */
<> 140:97feb9bacc10 6156 *dst = circBuffer[rOffset];
<> 140:97feb9bacc10 6157
<> 140:97feb9bacc10 6158 /* Update the input pointer */
<> 140:97feb9bacc10 6159 dst += dstInc;
<> 140:97feb9bacc10 6160
AnnaBridge 145:64910690c574 6161 if (dst == (q7_t *) dst_end)
<> 140:97feb9bacc10 6162 {
<> 140:97feb9bacc10 6163 dst = dst_base;
<> 140:97feb9bacc10 6164 }
<> 140:97feb9bacc10 6165
<> 140:97feb9bacc10 6166 /* Circularly update rOffset. Watch out for positive and negative value */
<> 140:97feb9bacc10 6167 rOffset += bufferInc;
<> 140:97feb9bacc10 6168
AnnaBridge 145:64910690c574 6169 if (rOffset >= L)
<> 140:97feb9bacc10 6170 {
<> 140:97feb9bacc10 6171 rOffset -= L;
<> 140:97feb9bacc10 6172 }
<> 140:97feb9bacc10 6173
<> 140:97feb9bacc10 6174 /* Decrement the loop counter */
<> 140:97feb9bacc10 6175 i--;
<> 140:97feb9bacc10 6176 }
<> 140:97feb9bacc10 6177
<> 140:97feb9bacc10 6178 /* Update the index pointer */
<> 140:97feb9bacc10 6179 *readOffset = rOffset;
<> 140:97feb9bacc10 6180 }
<> 140:97feb9bacc10 6181
<> 140:97feb9bacc10 6182
<> 140:97feb9bacc10 6183 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6189 void arm_power_q31(
<> 140:97feb9bacc10 6190 q31_t * pSrc,
<> 140:97feb9bacc10 6191 uint32_t blockSize,
<> 140:97feb9bacc10 6192 q63_t * pResult);
<> 140:97feb9bacc10 6193
AnnaBridge 145:64910690c574 6194
<> 140:97feb9bacc10 6195 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6201 void arm_power_f32(
<> 140:97feb9bacc10 6202 float32_t * pSrc,
<> 140:97feb9bacc10 6203 uint32_t blockSize,
<> 140:97feb9bacc10 6204 float32_t * pResult);
<> 140:97feb9bacc10 6205
AnnaBridge 145:64910690c574 6206
<> 140:97feb9bacc10 6207 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6213 void arm_power_q15(
<> 140:97feb9bacc10 6214 q15_t * pSrc,
<> 140:97feb9bacc10 6215 uint32_t blockSize,
<> 140:97feb9bacc10 6216 q63_t * pResult);
<> 140:97feb9bacc10 6217
AnnaBridge 145:64910690c574 6218
<> 140:97feb9bacc10 6219 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6225 void arm_power_q7(
<> 140:97feb9bacc10 6226 q7_t * pSrc,
<> 140:97feb9bacc10 6227 uint32_t blockSize,
<> 140:97feb9bacc10 6228 q31_t * pResult);
<> 140:97feb9bacc10 6229
AnnaBridge 145:64910690c574 6230
<> 140:97feb9bacc10 6231 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6237 void arm_mean_q7(
<> 140:97feb9bacc10 6238 q7_t * pSrc,
<> 140:97feb9bacc10 6239 uint32_t blockSize,
<> 140:97feb9bacc10 6240 q7_t * pResult);
<> 140:97feb9bacc10 6241
AnnaBridge 145:64910690c574 6242
<> 140:97feb9bacc10 6243 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6248 */
<> 140:97feb9bacc10 6249 void arm_mean_q15(
<> 140:97feb9bacc10 6250 q15_t * pSrc,
<> 140:97feb9bacc10 6251 uint32_t blockSize,
<> 140:97feb9bacc10 6252 q15_t * pResult);
<> 140:97feb9bacc10 6253
AnnaBridge 145:64910690c574 6254
<> 140:97feb9bacc10 6255 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6260 */
<> 140:97feb9bacc10 6261 void arm_mean_q31(
<> 140:97feb9bacc10 6262 q31_t * pSrc,
<> 140:97feb9bacc10 6263 uint32_t blockSize,
<> 140:97feb9bacc10 6264 q31_t * pResult);
<> 140:97feb9bacc10 6265
AnnaBridge 145:64910690c574 6266
<> 140:97feb9bacc10 6267 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6272 */
<> 140:97feb9bacc10 6273 void arm_mean_f32(
<> 140:97feb9bacc10 6274 float32_t * pSrc,
<> 140:97feb9bacc10 6275 uint32_t blockSize,
<> 140:97feb9bacc10 6276 float32_t * pResult);
<> 140:97feb9bacc10 6277
AnnaBridge 145:64910690c574 6278
<> 140:97feb9bacc10 6279 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6285 void arm_var_f32(
<> 140:97feb9bacc10 6286 float32_t * pSrc,
<> 140:97feb9bacc10 6287 uint32_t blockSize,
<> 140:97feb9bacc10 6288 float32_t * pResult);
<> 140:97feb9bacc10 6289
AnnaBridge 145:64910690c574 6290
<> 140:97feb9bacc10 6291 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6297 void arm_var_q31(
<> 140:97feb9bacc10 6298 q31_t * pSrc,
<> 140:97feb9bacc10 6299 uint32_t blockSize,
<> 140:97feb9bacc10 6300 q31_t * pResult);
<> 140:97feb9bacc10 6301
AnnaBridge 145:64910690c574 6302
<> 140:97feb9bacc10 6303 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6309 void arm_var_q15(
<> 140:97feb9bacc10 6310 q15_t * pSrc,
<> 140:97feb9bacc10 6311 uint32_t blockSize,
<> 140:97feb9bacc10 6312 q15_t * pResult);
<> 140:97feb9bacc10 6313
AnnaBridge 145:64910690c574 6314
<> 140:97feb9bacc10 6315 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6321 void arm_rms_f32(
<> 140:97feb9bacc10 6322 float32_t * pSrc,
<> 140:97feb9bacc10 6323 uint32_t blockSize,
<> 140:97feb9bacc10 6324 float32_t * pResult);
<> 140:97feb9bacc10 6325
AnnaBridge 145:64910690c574 6326
<> 140:97feb9bacc10 6327 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6333 void arm_rms_q31(
<> 140:97feb9bacc10 6334 q31_t * pSrc,
<> 140:97feb9bacc10 6335 uint32_t blockSize,
<> 140:97feb9bacc10 6336 q31_t * pResult);
<> 140:97feb9bacc10 6337
AnnaBridge 145:64910690c574 6338
<> 140:97feb9bacc10 6339 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6345 void arm_rms_q15(
<> 140:97feb9bacc10 6346 q15_t * pSrc,
<> 140:97feb9bacc10 6347 uint32_t blockSize,
<> 140:97feb9bacc10 6348 q15_t * pResult);
<> 140:97feb9bacc10 6349
AnnaBridge 145:64910690c574 6350
<> 140:97feb9bacc10 6351 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6357 void arm_std_f32(
<> 140:97feb9bacc10 6358 float32_t * pSrc,
<> 140:97feb9bacc10 6359 uint32_t blockSize,
<> 140:97feb9bacc10 6360 float32_t * pResult);
<> 140:97feb9bacc10 6361
AnnaBridge 145:64910690c574 6362
<> 140:97feb9bacc10 6363 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6369 void arm_std_q31(
<> 140:97feb9bacc10 6370 q31_t * pSrc,
<> 140:97feb9bacc10 6371 uint32_t blockSize,
<> 140:97feb9bacc10 6372 q31_t * pResult);
<> 140:97feb9bacc10 6373
AnnaBridge 145:64910690c574 6374
<> 140:97feb9bacc10 6375 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6381 void arm_std_q15(
<> 140:97feb9bacc10 6382 q15_t * pSrc,
<> 140:97feb9bacc10 6383 uint32_t blockSize,
<> 140:97feb9bacc10 6384 q15_t * pResult);
<> 140:97feb9bacc10 6385
AnnaBridge 145:64910690c574 6386
<> 140:97feb9bacc10 6387 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6393 void arm_cmplx_mag_f32(
<> 140:97feb9bacc10 6394 float32_t * pSrc,
<> 140:97feb9bacc10 6395 float32_t * pDst,
<> 140:97feb9bacc10 6396 uint32_t numSamples);
<> 140:97feb9bacc10 6397
AnnaBridge 145:64910690c574 6398
<> 140:97feb9bacc10 6399 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6405 void arm_cmplx_mag_q31(
<> 140:97feb9bacc10 6406 q31_t * pSrc,
<> 140:97feb9bacc10 6407 q31_t * pDst,
<> 140:97feb9bacc10 6408 uint32_t numSamples);
<> 140:97feb9bacc10 6409
AnnaBridge 145:64910690c574 6410
<> 140:97feb9bacc10 6411 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6417 void arm_cmplx_mag_q15(
<> 140:97feb9bacc10 6418 q15_t * pSrc,
<> 140:97feb9bacc10 6419 q15_t * pDst,
<> 140:97feb9bacc10 6420 uint32_t numSamples);
<> 140:97feb9bacc10 6421
AnnaBridge 145:64910690c574 6422
<> 140:97feb9bacc10 6423 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6431 void arm_cmplx_dot_prod_q15(
<> 140:97feb9bacc10 6432 q15_t * pSrcA,
<> 140:97feb9bacc10 6433 q15_t * pSrcB,
<> 140:97feb9bacc10 6434 uint32_t numSamples,
<> 140:97feb9bacc10 6435 q31_t * realResult,
<> 140:97feb9bacc10 6436 q31_t * imagResult);
<> 140:97feb9bacc10 6437
AnnaBridge 145:64910690c574 6438
<> 140:97feb9bacc10 6439 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6447 void arm_cmplx_dot_prod_q31(
<> 140:97feb9bacc10 6448 q31_t * pSrcA,
<> 140:97feb9bacc10 6449 q31_t * pSrcB,
<> 140:97feb9bacc10 6450 uint32_t numSamples,
<> 140:97feb9bacc10 6451 q63_t * realResult,
<> 140:97feb9bacc10 6452 q63_t * imagResult);
<> 140:97feb9bacc10 6453
AnnaBridge 145:64910690c574 6454
<> 140:97feb9bacc10 6455 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6463 void arm_cmplx_dot_prod_f32(
<> 140:97feb9bacc10 6464 float32_t * pSrcA,
<> 140:97feb9bacc10 6465 float32_t * pSrcB,
<> 140:97feb9bacc10 6466 uint32_t numSamples,
<> 140:97feb9bacc10 6467 float32_t * realResult,
<> 140:97feb9bacc10 6468 float32_t * imagResult);
<> 140:97feb9bacc10 6469
AnnaBridge 145:64910690c574 6470
<> 140:97feb9bacc10 6471 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6478 void arm_cmplx_mult_real_q15(
<> 140:97feb9bacc10 6479 q15_t * pSrcCmplx,
<> 140:97feb9bacc10 6480 q15_t * pSrcReal,
<> 140:97feb9bacc10 6481 q15_t * pCmplxDst,
<> 140:97feb9bacc10 6482 uint32_t numSamples);
<> 140:97feb9bacc10 6483
AnnaBridge 145:64910690c574 6484
<> 140:97feb9bacc10 6485 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6492 void arm_cmplx_mult_real_q31(
<> 140:97feb9bacc10 6493 q31_t * pSrcCmplx,
<> 140:97feb9bacc10 6494 q31_t * pSrcReal,
<> 140:97feb9bacc10 6495 q31_t * pCmplxDst,
<> 140:97feb9bacc10 6496 uint32_t numSamples);
<> 140:97feb9bacc10 6497
AnnaBridge 145:64910690c574 6498
<> 140:97feb9bacc10 6499 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6506 void arm_cmplx_mult_real_f32(
<> 140:97feb9bacc10 6507 float32_t * pSrcCmplx,
<> 140:97feb9bacc10 6508 float32_t * pSrcReal,
<> 140:97feb9bacc10 6509 float32_t * pCmplxDst,
<> 140:97feb9bacc10 6510 uint32_t numSamples);
<> 140:97feb9bacc10 6511
AnnaBridge 145:64910690c574 6512
<> 140:97feb9bacc10 6513 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6520 void arm_min_q7(
<> 140:97feb9bacc10 6521 q7_t * pSrc,
<> 140:97feb9bacc10 6522 uint32_t blockSize,
<> 140:97feb9bacc10 6523 q7_t * result,
<> 140:97feb9bacc10 6524 uint32_t * index);
<> 140:97feb9bacc10 6525
AnnaBridge 145:64910690c574 6526
<> 140:97feb9bacc10 6527 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6534 void arm_min_q15(
<> 140:97feb9bacc10 6535 q15_t * pSrc,
<> 140:97feb9bacc10 6536 uint32_t blockSize,
<> 140:97feb9bacc10 6537 q15_t * pResult,
<> 140:97feb9bacc10 6538 uint32_t * pIndex);
<> 140:97feb9bacc10 6539
AnnaBridge 145:64910690c574 6540
<> 140:97feb9bacc10 6541 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6547 */
<> 140:97feb9bacc10 6548 void arm_min_q31(
<> 140:97feb9bacc10 6549 q31_t * pSrc,
<> 140:97feb9bacc10 6550 uint32_t blockSize,
<> 140:97feb9bacc10 6551 q31_t * pResult,
<> 140:97feb9bacc10 6552 uint32_t * pIndex);
<> 140:97feb9bacc10 6553
AnnaBridge 145:64910690c574 6554
<> 140:97feb9bacc10 6555 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6562 void arm_min_f32(
<> 140:97feb9bacc10 6563 float32_t * pSrc,
<> 140:97feb9bacc10 6564 uint32_t blockSize,
<> 140:97feb9bacc10 6565 float32_t * pResult,
<> 140:97feb9bacc10 6566 uint32_t * pIndex);
<> 140:97feb9bacc10 6567
AnnaBridge 145:64910690c574 6568
<> 140:97feb9bacc10 6569 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6575 */
<> 140:97feb9bacc10 6576 void arm_max_q7(
<> 140:97feb9bacc10 6577 q7_t * pSrc,
<> 140:97feb9bacc10 6578 uint32_t blockSize,
<> 140:97feb9bacc10 6579 q7_t * pResult,
<> 140:97feb9bacc10 6580 uint32_t * pIndex);
<> 140:97feb9bacc10 6581
AnnaBridge 145:64910690c574 6582
<> 140:97feb9bacc10 6583 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6589 */
<> 140:97feb9bacc10 6590 void arm_max_q15(
<> 140:97feb9bacc10 6591 q15_t * pSrc,
<> 140:97feb9bacc10 6592 uint32_t blockSize,
<> 140:97feb9bacc10 6593 q15_t * pResult,
<> 140:97feb9bacc10 6594 uint32_t * pIndex);
<> 140:97feb9bacc10 6595
AnnaBridge 145:64910690c574 6596
<> 140:97feb9bacc10 6597 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6603 */
<> 140:97feb9bacc10 6604 void arm_max_q31(
<> 140:97feb9bacc10 6605 q31_t * pSrc,
<> 140:97feb9bacc10 6606 uint32_t blockSize,
<> 140:97feb9bacc10 6607 q31_t * pResult,
<> 140:97feb9bacc10 6608 uint32_t * pIndex);
<> 140:97feb9bacc10 6609
AnnaBridge 145:64910690c574 6610
<> 140:97feb9bacc10 6611 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6617 */
<> 140:97feb9bacc10 6618 void arm_max_f32(
<> 140:97feb9bacc10 6619 float32_t * pSrc,
<> 140:97feb9bacc10 6620 uint32_t blockSize,
<> 140:97feb9bacc10 6621 float32_t * pResult,
<> 140:97feb9bacc10 6622 uint32_t * pIndex);
<> 140:97feb9bacc10 6623
AnnaBridge 145:64910690c574 6624
<> 140:97feb9bacc10 6625 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6632 void arm_cmplx_mult_cmplx_q15(
<> 140:97feb9bacc10 6633 q15_t * pSrcA,
<> 140:97feb9bacc10 6634 q15_t * pSrcB,
<> 140:97feb9bacc10 6635 q15_t * pDst,
<> 140:97feb9bacc10 6636 uint32_t numSamples);
<> 140:97feb9bacc10 6637
AnnaBridge 145:64910690c574 6638
<> 140:97feb9bacc10 6639 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6646 void arm_cmplx_mult_cmplx_q31(
<> 140:97feb9bacc10 6647 q31_t * pSrcA,
<> 140:97feb9bacc10 6648 q31_t * pSrcB,
<> 140:97feb9bacc10 6649 q31_t * pDst,
<> 140:97feb9bacc10 6650 uint32_t numSamples);
<> 140:97feb9bacc10 6651
AnnaBridge 145:64910690c574 6652
<> 140:97feb9bacc10 6653 /**
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 6660 void arm_cmplx_mult_cmplx_f32(
<> 140:97feb9bacc10 6661 float32_t * pSrcA,
<> 140:97feb9bacc10 6662 float32_t * pSrcB,
<> 140:97feb9bacc10 6663 float32_t * pDst,
<> 140:97feb9bacc10 6664 uint32_t numSamples);
<> 140:97feb9bacc10 6665
AnnaBridge 145:64910690c574 6666
<> 140:97feb9bacc10 6667 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6672 */
<> 140:97feb9bacc10 6673 void arm_float_to_q31(
<> 140:97feb9bacc10 6674 float32_t * pSrc,
<> 140:97feb9bacc10 6675 q31_t * pDst,
<> 140:97feb9bacc10 6676 uint32_t blockSize);
<> 140:97feb9bacc10 6677
AnnaBridge 145:64910690c574 6678
<> 140:97feb9bacc10 6679 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6684 */
<> 140:97feb9bacc10 6685 void arm_float_to_q15(
<> 140:97feb9bacc10 6686 float32_t * pSrc,
<> 140:97feb9bacc10 6687 q15_t * pDst,
<> 140:97feb9bacc10 6688 uint32_t blockSize);
<> 140:97feb9bacc10 6689
AnnaBridge 145:64910690c574 6690
<> 140:97feb9bacc10 6691 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6696 */
<> 140:97feb9bacc10 6697 void arm_float_to_q7(
<> 140:97feb9bacc10 6698 float32_t * pSrc,
<> 140:97feb9bacc10 6699 q7_t * pDst,
<> 140:97feb9bacc10 6700 uint32_t blockSize);
<> 140:97feb9bacc10 6701
<> 140:97feb9bacc10 6702
<> 140:97feb9bacc10 6703 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6708 */
<> 140:97feb9bacc10 6709 void arm_q31_to_q15(
<> 140:97feb9bacc10 6710 q31_t * pSrc,
<> 140:97feb9bacc10 6711 q15_t * pDst,
<> 140:97feb9bacc10 6712 uint32_t blockSize);
<> 140:97feb9bacc10 6713
AnnaBridge 145:64910690c574 6714
<> 140:97feb9bacc10 6715 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6720 */
<> 140:97feb9bacc10 6721 void arm_q31_to_q7(
<> 140:97feb9bacc10 6722 q31_t * pSrc,
<> 140:97feb9bacc10 6723 q7_t * pDst,
<> 140:97feb9bacc10 6724 uint32_t blockSize);
<> 140:97feb9bacc10 6725
AnnaBridge 145:64910690c574 6726
<> 140:97feb9bacc10 6727 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6732 */
<> 140:97feb9bacc10 6733 void arm_q15_to_float(
<> 140:97feb9bacc10 6734 q15_t * pSrc,
<> 140:97feb9bacc10 6735 float32_t * pDst,
<> 140:97feb9bacc10 6736 uint32_t blockSize);
<> 140:97feb9bacc10 6737
<> 140:97feb9bacc10 6738
<> 140:97feb9bacc10 6739 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6744 */
<> 140:97feb9bacc10 6745 void arm_q15_to_q31(
<> 140:97feb9bacc10 6746 q15_t * pSrc,
<> 140:97feb9bacc10 6747 q31_t * pDst,
<> 140:97feb9bacc10 6748 uint32_t blockSize);
<> 140:97feb9bacc10 6749
<> 140:97feb9bacc10 6750
<> 140:97feb9bacc10 6751 /**
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 6756 */
<> 140:97feb9bacc10 6757 void arm_q15_to_q7(
<> 140:97feb9bacc10 6758 q15_t * pSrc,
<> 140:97feb9bacc10 6759 q7_t * pDst,
<> 140:97feb9bacc10 6760 uint32_t blockSize);
<> 140:97feb9bacc10 6761
<> 140:97feb9bacc10 6762
<> 140:97feb9bacc10 6763 /**
<> 140:97feb9bacc10 6764 * @ingroup groupInterpolation
<> 140:97feb9bacc10 6765 */
<> 140:97feb9bacc10 6766
<> 140:97feb9bacc10 6767 /**
<> 140:97feb9bacc10 6768 * @defgroup BilinearInterpolate Bilinear Interpolation
<> 140:97feb9bacc10 6769 *
<> 140:97feb9bacc10 6770 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
<> 140:97feb9bacc10 6771 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
<> 140:97feb9bacc10 6772 * determines values between the grid points.
<> 140:97feb9bacc10 6773 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
<> 140:97feb9bacc10 6774 * Bilinear interpolation is often used in image processing to rescale images.
<> 140:97feb9bacc10 6775 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
<> 140:97feb9bacc10 6776 *
<> 140:97feb9bacc10 6777 * <b>Algorithm</b>
<> 140:97feb9bacc10 6778 * \par
<> 140:97feb9bacc10 6779 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
<> 140:97feb9bacc10 6780 * For floating-point, the instance structure is defined as:
<> 140:97feb9bacc10 6781 * <pre>
<> 140:97feb9bacc10 6782 * typedef struct
<> 140:97feb9bacc10 6783 * {
<> 140:97feb9bacc10 6784 * uint16_t numRows;
<> 140:97feb9bacc10 6785 * uint16_t numCols;
<> 140:97feb9bacc10 6786 * float32_t *pData;
<> 140:97feb9bacc10 6787 * } arm_bilinear_interp_instance_f32;
<> 140:97feb9bacc10 6788 * </pre>
<> 140:97feb9bacc10 6789 *
<> 140:97feb9bacc10 6790 * \par
<> 140:97feb9bacc10 6791 * where <code>numRows</code> specifies the number of rows in the table;
<> 140:97feb9bacc10 6792 * <code>numCols</code> specifies the number of columns in the table;
<> 140:97feb9bacc10 6793 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
<> 140:97feb9bacc10 6794 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
<> 140:97feb9bacc10 6795 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
<> 140:97feb9bacc10 6796 *
<> 140:97feb9bacc10 6797 * \par
<> 140:97feb9bacc10 6798 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
<> 140:97feb9bacc10 6799 * <pre>
<> 140:97feb9bacc10 6800 * XF = floor(x)
<> 140:97feb9bacc10 6801 * YF = floor(y)
<> 140:97feb9bacc10 6802 * </pre>
<> 140:97feb9bacc10 6803 * \par
<> 140:97feb9bacc10 6804 * The interpolated output point is computed as:
<> 140:97feb9bacc10 6805 * <pre>
<> 140:97feb9bacc10 6806 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
<> 140:97feb9bacc10 6807 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
<> 140:97feb9bacc10 6808 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
<> 140:97feb9bacc10 6809 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
<> 140:97feb9bacc10 6810 * </pre>
<> 140:97feb9bacc10 6811 * Note that the coordinates (x, y) contain integer and fractional components.
<> 140:97feb9bacc10 6812 * The integer components specify which portion of the table to use while the
<> 140:97feb9bacc10 6813 * fractional components control the interpolation processor.
<> 140:97feb9bacc10 6814 *
<> 140:97feb9bacc10 6815 * \par
<> 140:97feb9bacc10 6816 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
<> 140:97feb9bacc10 6817 */
<> 140:97feb9bacc10 6818
<> 140:97feb9bacc10 6819 /**
<> 140:97feb9bacc10 6820 * @addtogroup BilinearInterpolate
<> 140:97feb9bacc10 6821 * @{
<> 140:97feb9bacc10 6822 */
<> 140:97feb9bacc10 6823
AnnaBridge 145:64910690c574 6824
<> 140:97feb9bacc10 6825 /**
<> 140:97feb9bacc10 6826 *
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6831 * @return out interpolated value.
<> 140:97feb9bacc10 6832 */
AnnaBridge 145:64910690c574 6833 CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32(
<> 140:97feb9bacc10 6834 const arm_bilinear_interp_instance_f32 * S,
<> 140:97feb9bacc10 6835 float32_t X,
<> 140:97feb9bacc10 6836 float32_t Y)
<> 140:97feb9bacc10 6837 {
<> 140:97feb9bacc10 6838 float32_t out;
<> 140:97feb9bacc10 6839 float32_t f00, f01, f10, f11;
<> 140:97feb9bacc10 6840 float32_t *pData = S->pData;
<> 140:97feb9bacc10 6841 int32_t xIndex, yIndex, index;
<> 140:97feb9bacc10 6842 float32_t xdiff, ydiff;
<> 140:97feb9bacc10 6843 float32_t b1, b2, b3, b4;
<> 140:97feb9bacc10 6844
<> 140:97feb9bacc10 6845 xIndex = (int32_t) X;
<> 140:97feb9bacc10 6846 yIndex = (int32_t) Y;
<> 140:97feb9bacc10 6847
<> 140:97feb9bacc10 6848 /* Care taken for table outside boundary */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 6851 {
<> 140:97feb9bacc10 6852 return (0);
<> 140:97feb9bacc10 6853 }
<> 140:97feb9bacc10 6854
<> 140:97feb9bacc10 6855 /* Calculation of index for two nearest points in X-direction */
<> 140:97feb9bacc10 6856 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
<> 140:97feb9bacc10 6857
<> 140:97feb9bacc10 6858
<> 140:97feb9bacc10 6859 /* Read two nearest points in X-direction */
<> 140:97feb9bacc10 6860 f00 = pData[index];
<> 140:97feb9bacc10 6861 f01 = pData[index + 1];
<> 140:97feb9bacc10 6862
<> 140:97feb9bacc10 6863 /* Calculation of index for two nearest points in Y-direction */
<> 140:97feb9bacc10 6864 index = (xIndex - 1) + (yIndex) * S->numCols;
<> 140:97feb9bacc10 6865
<> 140:97feb9bacc10 6866
<> 140:97feb9bacc10 6867 /* Read two nearest points in Y-direction */
<> 140:97feb9bacc10 6868 f10 = pData[index];
<> 140:97feb9bacc10 6869 f11 = pData[index + 1];
<> 140:97feb9bacc10 6870
<> 140:97feb9bacc10 6871 /* Calculation of intermediate values */
<> 140:97feb9bacc10 6872 b1 = f00;
<> 140:97feb9bacc10 6873 b2 = f01 - f00;
<> 140:97feb9bacc10 6874 b3 = f10 - f00;
<> 140:97feb9bacc10 6875 b4 = f00 - f01 - f10 + f11;
<> 140:97feb9bacc10 6876
<> 140:97feb9bacc10 6877 /* Calculation of fractional part in X */
<> 140:97feb9bacc10 6878 xdiff = X - xIndex;
<> 140:97feb9bacc10 6879
<> 140:97feb9bacc10 6880 /* Calculation of fractional part in Y */
<> 140:97feb9bacc10 6881 ydiff = Y - yIndex;
<> 140:97feb9bacc10 6882
<> 140:97feb9bacc10 6883 /* Calculation of bi-linear interpolated output */
<> 140:97feb9bacc10 6884 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
<> 140:97feb9bacc10 6885
<> 140:97feb9bacc10 6886 /* return to application */
<> 140:97feb9bacc10 6887 return (out);
<> 140:97feb9bacc10 6888 }
<> 140:97feb9bacc10 6889
AnnaBridge 145:64910690c574 6890
<> 140:97feb9bacc10 6891 /**
<> 140:97feb9bacc10 6892 *
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6897 * @return out interpolated value.
<> 140:97feb9bacc10 6898 */
AnnaBridge 145:64910690c574 6899 CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31(
<> 140:97feb9bacc10 6900 arm_bilinear_interp_instance_q31 * S,
<> 140:97feb9bacc10 6901 q31_t X,
<> 140:97feb9bacc10 6902 q31_t Y)
<> 140:97feb9bacc10 6903 {
<> 140:97feb9bacc10 6904 q31_t out; /* Temporary output */
<> 140:97feb9bacc10 6905 q31_t acc = 0; /* output */
<> 140:97feb9bacc10 6906 q31_t xfract, yfract; /* X, Y fractional parts */
<> 140:97feb9bacc10 6907 q31_t x1, x2, y1, y2; /* Nearest output values */
<> 140:97feb9bacc10 6908 int32_t rI, cI; /* Row and column indices */
<> 140:97feb9bacc10 6909 q31_t *pYData = S->pData; /* pointer to output table values */
<> 140:97feb9bacc10 6910 uint32_t nCols = S->numCols; /* num of rows */
<> 140:97feb9bacc10 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);
<> 140:97feb9bacc10 6916
<> 140:97feb9bacc10 6917 /* Input is in 12.20 format */
<> 140:97feb9bacc10 6918 /* 12 bits for the table index */
<> 140:97feb9bacc10 6919 /* Index value calculation */
AnnaBridge 145:64910690c574 6920 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 140:97feb9bacc10 6921
<> 140:97feb9bacc10 6922 /* Care taken for table outside boundary */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 6925 {
<> 140:97feb9bacc10 6926 return (0);
<> 140:97feb9bacc10 6927 }
<> 140:97feb9bacc10 6928
<> 140:97feb9bacc10 6929 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 6930 /* shift left xfract by 11 to keep 1.31 format */
<> 140:97feb9bacc10 6931 xfract = (X & 0x000FFFFF) << 11u;
<> 140:97feb9bacc10 6932
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 6936
<> 140:97feb9bacc10 6937 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 6938 /* shift left yfract by 11 to keep 1.31 format */
<> 140:97feb9bacc10 6939 yfract = (Y & 0x000FFFFF) << 11u;
<> 140:97feb9bacc10 6940
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 6944
<> 140:97feb9bacc10 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));
<> 140:97feb9bacc10 6947 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
<> 140:97feb9bacc10 6948
<> 140:97feb9bacc10 6949 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
<> 140:97feb9bacc10 6950 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
<> 140:97feb9bacc10 6951 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
<> 140:97feb9bacc10 6952
<> 140:97feb9bacc10 6953 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 140:97feb9bacc10 6954 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
<> 140:97feb9bacc10 6955 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 140:97feb9bacc10 6956
<> 140:97feb9bacc10 6957 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 140:97feb9bacc10 6958 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
<> 140:97feb9bacc10 6959 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 140:97feb9bacc10 6960
<> 140:97feb9bacc10 6961 /* Convert acc to 1.31(q31) format */
AnnaBridge 145:64910690c574 6962 return ((q31_t)(acc << 2));
<> 140:97feb9bacc10 6963 }
<> 140:97feb9bacc10 6964
AnnaBridge 145:64910690c574 6965
<> 140:97feb9bacc10 6966 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 6971 * @return out interpolated value.
<> 140:97feb9bacc10 6972 */
AnnaBridge 145:64910690c574 6973 CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(
<> 140:97feb9bacc10 6974 arm_bilinear_interp_instance_q15 * S,
<> 140:97feb9bacc10 6975 q31_t X,
<> 140:97feb9bacc10 6976 q31_t Y)
<> 140:97feb9bacc10 6977 {
<> 140:97feb9bacc10 6978 q63_t acc = 0; /* output */
<> 140:97feb9bacc10 6979 q31_t out; /* Temporary output */
<> 140:97feb9bacc10 6980 q15_t x1, x2, y1, y2; /* Nearest output values */
<> 140:97feb9bacc10 6981 q31_t xfract, yfract; /* X, Y fractional parts */
<> 140:97feb9bacc10 6982 int32_t rI, cI; /* Row and column indices */
<> 140:97feb9bacc10 6983 q15_t *pYData = S->pData; /* pointer to output table values */
<> 140:97feb9bacc10 6984 uint32_t nCols = S->numCols; /* num of rows */
<> 140:97feb9bacc10 6985
<> 140:97feb9bacc10 6986 /* Input is in 12.20 format */
<> 140:97feb9bacc10 6987 /* 12 bits for the table index */
<> 140:97feb9bacc10 6988 /* Index value calculation */
AnnaBridge 145:64910690c574 6989 rI = ((X & (q31_t)0xFFF00000) >> 20);
<> 140:97feb9bacc10 6990
<> 140:97feb9bacc10 6991 /* Input is in 12.20 format */
<> 140:97feb9bacc10 6992 /* 12 bits for the table index */
<> 140:97feb9bacc10 6993 /* Index value calculation */
AnnaBridge 145:64910690c574 6994 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 140:97feb9bacc10 6995
<> 140:97feb9bacc10 6996 /* Care taken for table outside boundary */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 6999 {
<> 140:97feb9bacc10 7000 return (0);
<> 140:97feb9bacc10 7001 }
<> 140:97feb9bacc10 7002
<> 140:97feb9bacc10 7003 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 7004 /* xfract should be in 12.20 format */
<> 140:97feb9bacc10 7005 xfract = (X & 0x000FFFFF);
<> 140:97feb9bacc10 7006
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 7010
<> 140:97feb9bacc10 7011 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 7012 /* yfract should be in 12.20 format */
<> 140:97feb9bacc10 7013 yfract = (Y & 0x000FFFFF);
<> 140:97feb9bacc10 7014
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 7018
<> 140:97feb9bacc10 7019 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
<> 140:97feb9bacc10 7020
<> 140:97feb9bacc10 7021 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
<> 140:97feb9bacc10 7022 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
<> 140:97feb9bacc10 7023 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
<> 140:97feb9bacc10 7024 acc = ((q63_t) out * (0xFFFFF - yfract));
<> 140:97feb9bacc10 7025
<> 140:97feb9bacc10 7026 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
<> 140:97feb9bacc10 7027 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
<> 140:97feb9bacc10 7028 acc += ((q63_t) out * (xfract));
<> 140:97feb9bacc10 7029
<> 140:97feb9bacc10 7030 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
<> 140:97feb9bacc10 7031 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
<> 140:97feb9bacc10 7032 acc += ((q63_t) out * (yfract));
<> 140:97feb9bacc10 7033
<> 140:97feb9bacc10 7034 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
<> 140:97feb9bacc10 7035 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
<> 140:97feb9bacc10 7036 acc += ((q63_t) out * (yfract));
<> 140:97feb9bacc10 7037
<> 140:97feb9bacc10 7038 /* acc is in 13.51 format and down shift acc by 36 times */
<> 140:97feb9bacc10 7039 /* Convert out to 1.15 format */
AnnaBridge 145:64910690c574 7040 return ((q15_t)(acc >> 36));
<> 140:97feb9bacc10 7041 }
<> 140:97feb9bacc10 7042
AnnaBridge 145:64910690c574 7043
<> 140:97feb9bacc10 7044 /**
<> 140:97feb9bacc10 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.
<> 140:97feb9bacc10 7049 * @return out interpolated value.
<> 140:97feb9bacc10 7050 */
AnnaBridge 145:64910690c574 7051 CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7(
<> 140:97feb9bacc10 7052 arm_bilinear_interp_instance_q7 * S,
<> 140:97feb9bacc10 7053 q31_t X,
<> 140:97feb9bacc10 7054 q31_t Y)
<> 140:97feb9bacc10 7055 {
<> 140:97feb9bacc10 7056 q63_t acc = 0; /* output */
<> 140:97feb9bacc10 7057 q31_t out; /* Temporary output */
<> 140:97feb9bacc10 7058 q31_t xfract, yfract; /* X, Y fractional parts */
<> 140:97feb9bacc10 7059 q7_t x1, x2, y1, y2; /* Nearest output values */
<> 140:97feb9bacc10 7060 int32_t rI, cI; /* Row and column indices */
<> 140:97feb9bacc10 7061 q7_t *pYData = S->pData; /* pointer to output table values */
<> 140:97feb9bacc10 7062 uint32_t nCols = S->numCols; /* num of rows */
<> 140:97feb9bacc10 7063
<> 140:97feb9bacc10 7064 /* Input is in 12.20 format */
<> 140:97feb9bacc10 7065 /* 12 bits for the table index */
<> 140:97feb9bacc10 7066 /* Index value calculation */
AnnaBridge 145:64910690c574 7067 rI = ((X & (q31_t)0xFFF00000) >> 20);
<> 140:97feb9bacc10 7068
<> 140:97feb9bacc10 7069 /* Input is in 12.20 format */
<> 140:97feb9bacc10 7070 /* 12 bits for the table index */
<> 140:97feb9bacc10 7071 /* Index value calculation */
AnnaBridge 145:64910690c574 7072 cI = ((Y & (q31_t)0xFFF00000) >> 20);
<> 140:97feb9bacc10 7073
<> 140:97feb9bacc10 7074 /* Care taken for table outside boundary */
<> 140:97feb9bacc10 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))
<> 140:97feb9bacc10 7077 {
<> 140:97feb9bacc10 7078 return (0);
<> 140:97feb9bacc10 7079 }
<> 140:97feb9bacc10 7080
<> 140:97feb9bacc10 7081 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 7082 /* xfract should be in 12.20 format */
AnnaBridge 145:64910690c574 7083 xfract = (X & (q31_t)0x000FFFFF);
<> 140:97feb9bacc10 7084
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 7088
<> 140:97feb9bacc10 7089 /* 20 bits for the fractional part */
<> 140:97feb9bacc10 7090 /* yfract should be in 12.20 format */
AnnaBridge 145:64910690c574 7091 yfract = (Y & (q31_t)0x000FFFFF);
<> 140:97feb9bacc10 7092
<> 140:97feb9bacc10 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];
<> 140:97feb9bacc10 7096
<> 140:97feb9bacc10 7097 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
<> 140:97feb9bacc10 7098 out = ((x1 * (0xFFFFF - xfract)));
<> 140:97feb9bacc10 7099 acc = (((q63_t) out * (0xFFFFF - yfract)));
<> 140:97feb9bacc10 7100
<> 140:97feb9bacc10 7101 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
<> 140:97feb9bacc10 7102 out = ((x2 * (0xFFFFF - yfract)));
<> 140:97feb9bacc10 7103 acc += (((q63_t) out * (xfract)));
<> 140:97feb9bacc10 7104
<> 140:97feb9bacc10 7105 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
<> 140:97feb9bacc10 7106 out = ((y1 * (0xFFFFF - xfract)));
<> 140:97feb9bacc10 7107 acc += (((q63_t) out * (yfract)));
<> 140:97feb9bacc10 7108
<> 140:97feb9bacc10 7109 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
<> 140:97feb9bacc10 7110 out = ((y2 * (yfract)));
<> 140:97feb9bacc10 7111 acc += (((q63_t) out * (xfract)));
<> 140:97feb9bacc10 7112
<> 140:97feb9bacc10 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));
<> 140:97feb9bacc10 7115 }
<> 140:97feb9bacc10 7116
<> 140:97feb9bacc10 7117 /**
<> 140:97feb9bacc10 7118 * @} end of BilinearInterpolate group
<> 140:97feb9bacc10 7119 */
AnnaBridge 145:64910690c574 7120
AnnaBridge 145:64910690c574 7121
AnnaBridge 145:64910690c574 7122 /* SMMLAR */
<> 140:97feb9bacc10 7123 #define multAcc_32x32_keep32_R(a, x, y) \
<> 140:97feb9bacc10 7124 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 140:97feb9bacc10 7125
AnnaBridge 145:64910690c574 7126 /* SMMLSR */
<> 140:97feb9bacc10 7127 #define multSub_32x32_keep32_R(a, x, y) \
<> 140:97feb9bacc10 7128 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 140:97feb9bacc10 7129
AnnaBridge 145:64910690c574 7130 /* SMMULR */
<> 140:97feb9bacc10 7131 #define mult_32x32_keep32_R(a, x, y) \
<> 140:97feb9bacc10 7132 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
<> 140:97feb9bacc10 7133
AnnaBridge 145:64910690c574 7134 /* SMMLA */
<> 140:97feb9bacc10 7135 #define multAcc_32x32_keep32(a, x, y) \
<> 140:97feb9bacc10 7136 a += (q31_t) (((q63_t) x * y) >> 32)
<> 140:97feb9bacc10 7137
AnnaBridge 145:64910690c574 7138 /* SMMLS */
<> 140:97feb9bacc10 7139 #define multSub_32x32_keep32(a, x, y) \
<> 140:97feb9bacc10 7140 a -= (q31_t) (((q63_t) x * y) >> 32)
<> 140:97feb9bacc10 7141
AnnaBridge 145:64910690c574 7142 /* SMMUL */
<> 140:97feb9bacc10 7143 #define mult_32x32_keep32(a, x, y) \
<> 140:97feb9bacc10 7144 a = (q31_t) (((q63_t) x * y ) >> 32)
<> 140:97feb9bacc10 7145
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 7166 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 7182 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 7194 #define LOW_OPTIMIZATION_EXIT
<> 140:97feb9bacc10 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 */
<> 140:97feb9bacc10 7205 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 140:97feb9bacc10 7206
AnnaBridge 145:64910690c574 7207 #elif defined ( __TI_ARM__ )
AnnaBridge 145:64910690c574 7208 #define LOW_OPTIMIZATION_ENTER
<> 140:97feb9bacc10 7209 #define LOW_OPTIMIZATION_EXIT
<> 140:97feb9bacc10 7210 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 140:97feb9bacc10 7211 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 7224
<> 140:97feb9bacc10 7225 #endif
<> 140:97feb9bacc10 7226
<> 140:97feb9bacc10 7227
AnnaBridge 145:64910690c574 7228 #ifdef __cplusplus
<> 140:97feb9bacc10 7229 }
<> 140:97feb9bacc10 7230 #endif
<> 140:97feb9bacc10 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
<> 140:97feb9bacc10 7251
<> 140:97feb9bacc10 7252 #endif /* _ARM_MATH_H */
<> 140:97feb9bacc10 7253
<> 140:97feb9bacc10 7254 /**
<> 140:97feb9bacc10 7255 *
<> 140:97feb9bacc10 7256 * End of file.
<> 140:97feb9bacc10 7257 */