temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

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