GameOpener / mbed-src

Fork of mbed-src by mbed official

Committer:
HiAlgoBoost
Date:
Sun Aug 09 05:18:54 2015 +0000
Revision:
603:f00c7e78e8b4
Parent:
525:c320967f86b9
Evening of August 8th version

Who changed what in which revision?

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