Preliminary main mbed library for nexpaq development

Committer:
nexpaq
Date:
Fri Nov 04 20:27:58 2016 +0000
Revision:
0:6c56fb4bc5f0
Moving to library for sharing updates

Who changed what in which revision?

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