Forked.

Fork of mbed-dev by mbed official

Committer:
mbed_official
Date:
Fri Nov 20 10:00:12 2015 +0000
Revision:
25:ac5b0a371348
Synchronized with git revision a4b777d8b25f9146e77396273dc9631c38583eb9

Full URL: https://github.com/mbedmicro/mbed/commit/a4b777d8b25f9146e77396273dc9631c38583eb9/

Added new Nucleo target - F410RB

Who changed what in which revision?

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