Maxim mbed development library

Dependents:   sensomed

Committer:
switches
Date:
Tue Nov 08 18:27:11 2016 +0000
Revision:
0:0e018d759a2a
Initial commit

Who changed what in which revision?

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