The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Wed Apr 12 16:07:08 2017 +0100
Revision:
140:97feb9bacc10
Parent:
129:0ab6a29f35bf
Child:
145:64910690c574
Release 140 of the mbed library

Ports for Upcoming Targets

3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 129:0ab6a29f35bf 1 /* ----------------------------------------------------------------------
<> 129:0ab6a29f35bf 2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 129:0ab6a29f35bf 3 *
<> 129:0ab6a29f35bf 4 * $Date: 19. March 2015
<> 129:0ab6a29f35bf 5 * $Revision: V.1.4.5
<> 129:0ab6a29f35bf 6 *
<> 129:0ab6a29f35bf 7 * Project: CMSIS DSP Library
<> 129:0ab6a29f35bf 8 * Title: arm_math.h
<> 129:0ab6a29f35bf 9 *
<> 129:0ab6a29f35bf 10 * Description: Public header file for CMSIS DSP Library
<> 129:0ab6a29f35bf 11 *
<> 129:0ab6a29f35bf 12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
<> 129:0ab6a29f35bf 13 *
<> 129:0ab6a29f35bf 14 * Redistribution and use in source and binary forms, with or without
<> 129:0ab6a29f35bf 15 * modification, are permitted provided that the following conditions
<> 129:0ab6a29f35bf 16 * are met:
<> 129:0ab6a29f35bf 17 * - Redistributions of source code must retain the above copyright
<> 129:0ab6a29f35bf 18 * notice, this list of conditions and the following disclaimer.
<> 129:0ab6a29f35bf 19 * - Redistributions in binary form must reproduce the above copyright
<> 129:0ab6a29f35bf 20 * notice, this list of conditions and the following disclaimer in
<> 129:0ab6a29f35bf 21 * the documentation and/or other materials provided with the
<> 129:0ab6a29f35bf 22 * distribution.
<> 129:0ab6a29f35bf 23 * - Neither the name of ARM LIMITED nor the names of its contributors
<> 129:0ab6a29f35bf 24 * may be used to endorse or promote products derived from this
<> 129:0ab6a29f35bf 25 * software without specific prior written permission.
<> 129:0ab6a29f35bf 26 *
<> 129:0ab6a29f35bf 27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<> 129:0ab6a29f35bf 28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<> 129:0ab6a29f35bf 29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
<> 129:0ab6a29f35bf 30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
<> 129:0ab6a29f35bf 31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
<> 129:0ab6a29f35bf 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
<> 129:0ab6a29f35bf 33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 129:0ab6a29f35bf 34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 129:0ab6a29f35bf 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
<> 129:0ab6a29f35bf 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
<> 129:0ab6a29f35bf 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
<> 129:0ab6a29f35bf 38 * POSSIBILITY OF SUCH DAMAGE.
<> 129:0ab6a29f35bf 39 * -------------------------------------------------------------------- */
<> 129:0ab6a29f35bf 40
<> 129:0ab6a29f35bf 41 /**
<> 129:0ab6a29f35bf 42 \mainpage CMSIS DSP Software Library
<> 129:0ab6a29f35bf 43 *
<> 129:0ab6a29f35bf 44 * Introduction
<> 129:0ab6a29f35bf 45 * ------------
<> 129:0ab6a29f35bf 46 *
<> 129:0ab6a29f35bf 47 * This user manual describes the CMSIS DSP software library,
<> 129:0ab6a29f35bf 48 * a suite of common signal processing functions for use on Cortex-M processor based devices.
<> 129:0ab6a29f35bf 49 *
<> 129:0ab6a29f35bf 50 * The library is divided into a number of functions each covering a specific category:
<> 129:0ab6a29f35bf 51 * - Basic math functions
<> 129:0ab6a29f35bf 52 * - Fast math functions
<> 129:0ab6a29f35bf 53 * - Complex math functions
<> 129:0ab6a29f35bf 54 * - Filters
<> 129:0ab6a29f35bf 55 * - Matrix functions
<> 129:0ab6a29f35bf 56 * - Transforms
<> 129:0ab6a29f35bf 57 * - Motor control functions
<> 129:0ab6a29f35bf 58 * - Statistical functions
<> 129:0ab6a29f35bf 59 * - Support functions
<> 129:0ab6a29f35bf 60 * - Interpolation functions
<> 129:0ab6a29f35bf 61 *
<> 129:0ab6a29f35bf 62 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
<> 129:0ab6a29f35bf 63 * 32-bit integer and 32-bit floating-point values.
<> 129:0ab6a29f35bf 64 *
<> 129:0ab6a29f35bf 65 * Using the Library
<> 129:0ab6a29f35bf 66 * ------------
<> 129:0ab6a29f35bf 67 *
<> 129:0ab6a29f35bf 68 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
<> 129:0ab6a29f35bf 69 * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7)
<> 129:0ab6a29f35bf 70 * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7)
<> 129:0ab6a29f35bf 71 * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7)
<> 129:0ab6a29f35bf 72 * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7)
<> 129:0ab6a29f35bf 73 * - arm_cortexM7l_math.lib (Little endian on Cortex-M7)
<> 129:0ab6a29f35bf 74 * - arm_cortexM7b_math.lib (Big endian on Cortex-M7)
<> 129:0ab6a29f35bf 75 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
<> 129:0ab6a29f35bf 76 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
<> 129:0ab6a29f35bf 77 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
<> 129:0ab6a29f35bf 78 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
<> 129:0ab6a29f35bf 79 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
<> 129:0ab6a29f35bf 80 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
<> 129:0ab6a29f35bf 81 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+)
<> 129:0ab6a29f35bf 82 * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+)
<> 129:0ab6a29f35bf 83 *
<> 129:0ab6a29f35bf 84 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
<> 129:0ab6a29f35bf 85 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 87 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
<> 129:0ab6a29f35bf 88 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
<> 129:0ab6a29f35bf 89 *
<> 129:0ab6a29f35bf 90 * Examples
<> 129:0ab6a29f35bf 91 * --------
<> 129:0ab6a29f35bf 92 *
<> 129:0ab6a29f35bf 93 * The library ships with a number of examples which demonstrate how to use the library functions.
<> 129:0ab6a29f35bf 94 *
<> 129:0ab6a29f35bf 95 * Toolchain Support
<> 129:0ab6a29f35bf 96 * ------------
<> 129:0ab6a29f35bf 97 *
<> 129:0ab6a29f35bf 98 * The library has been developed and tested with MDK-ARM version 5.14.0.0
<> 129:0ab6a29f35bf 99 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
<> 129:0ab6a29f35bf 100 *
<> 129:0ab6a29f35bf 101 * Building the Library
<> 129:0ab6a29f35bf 102 * ------------
<> 129:0ab6a29f35bf 103 *
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 105 * - arm_cortexM_math.uvprojx
<> 129:0ab6a29f35bf 106 *
<> 129:0ab6a29f35bf 107 *
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 109 *
<> 129:0ab6a29f35bf 110 * Pre-processor Macros
<> 129:0ab6a29f35bf 111 * ------------
<> 129:0ab6a29f35bf 112 *
<> 129:0ab6a29f35bf 113 * Each library project have differant pre-processor macros.
<> 129:0ab6a29f35bf 114 *
<> 129:0ab6a29f35bf 115 * - UNALIGNED_SUPPORT_DISABLE:
<> 129:0ab6a29f35bf 116 *
<> 129:0ab6a29f35bf 117 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
<> 129:0ab6a29f35bf 118 *
<> 129:0ab6a29f35bf 119 * - ARM_MATH_BIG_ENDIAN:
<> 129:0ab6a29f35bf 120 *
<> 129:0ab6a29f35bf 121 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
<> 129:0ab6a29f35bf 122 *
<> 129:0ab6a29f35bf 123 * - ARM_MATH_MATRIX_CHECK:
<> 129:0ab6a29f35bf 124 *
<> 129:0ab6a29f35bf 125 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
<> 129:0ab6a29f35bf 126 *
<> 129:0ab6a29f35bf 127 * - ARM_MATH_ROUNDING:
<> 129:0ab6a29f35bf 128 *
<> 129:0ab6a29f35bf 129 * Define macro ARM_MATH_ROUNDING for rounding on support functions
<> 129:0ab6a29f35bf 130 *
<> 129:0ab6a29f35bf 131 * - ARM_MATH_CMx:
<> 129:0ab6a29f35bf 132 *
<> 129:0ab6a29f35bf 133 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
<> 129:0ab6a29f35bf 134 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
<> 129:0ab6a29f35bf 135 * ARM_MATH_CM7 for building the library on cortex-M7.
<> 129:0ab6a29f35bf 136 *
<> 129:0ab6a29f35bf 137 * - __FPU_PRESENT:
<> 129:0ab6a29f35bf 138 *
<> 129:0ab6a29f35bf 139 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
<> 129:0ab6a29f35bf 140 *
<> 129:0ab6a29f35bf 141 * <hr>
<> 129:0ab6a29f35bf 142 * CMSIS-DSP in ARM::CMSIS Pack
<> 129:0ab6a29f35bf 143 * -----------------------------
<> 129:0ab6a29f35bf 144 *
<> 129:0ab6a29f35bf 145 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
<> 129:0ab6a29f35bf 146 * |File/Folder |Content |
<> 129:0ab6a29f35bf 147 * |------------------------------|------------------------------------------------------------------------|
<> 129:0ab6a29f35bf 148 * |\b CMSIS\\Documentation\\DSP | This documentation |
<> 129:0ab6a29f35bf 149 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
<> 129:0ab6a29f35bf 150 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
<> 129:0ab6a29f35bf 151 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
<> 129:0ab6a29f35bf 152 *
<> 129:0ab6a29f35bf 153 * <hr>
<> 129:0ab6a29f35bf 154 * Revision History of CMSIS-DSP
<> 129:0ab6a29f35bf 155 * ------------
<> 129:0ab6a29f35bf 156 * Please refer to \ref ChangeLog_pg.
<> 129:0ab6a29f35bf 157 *
<> 129:0ab6a29f35bf 158 * Copyright Notice
<> 129:0ab6a29f35bf 159 * ------------
<> 129:0ab6a29f35bf 160 *
<> 129:0ab6a29f35bf 161 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 129:0ab6a29f35bf 162 */
<> 129:0ab6a29f35bf 163
<> 129:0ab6a29f35bf 164
<> 129:0ab6a29f35bf 165 /**
<> 129:0ab6a29f35bf 166 * @defgroup groupMath Basic Math Functions
<> 129:0ab6a29f35bf 167 */
<> 129:0ab6a29f35bf 168
<> 129:0ab6a29f35bf 169 /**
<> 129:0ab6a29f35bf 170 * @defgroup groupFastMath Fast Math Functions
<> 129:0ab6a29f35bf 171 * This set of functions provides a fast approximation to sine, cosine, and square root.
<> 129:0ab6a29f35bf 172 * As compared to most of the other functions in the CMSIS math library, the fast math functions
<> 129:0ab6a29f35bf 173 * operate on individual values and not arrays.
<> 129:0ab6a29f35bf 174 * There are separate functions for Q15, Q31, and floating-point data.
<> 129:0ab6a29f35bf 175 *
<> 129:0ab6a29f35bf 176 */
<> 129:0ab6a29f35bf 177
<> 129:0ab6a29f35bf 178 /**
<> 129:0ab6a29f35bf 179 * @defgroup groupCmplxMath Complex Math Functions
<> 129:0ab6a29f35bf 180 * This set of functions operates on complex data vectors.
<> 129:0ab6a29f35bf 181 * The data in the complex arrays is stored in an interleaved fashion
<> 129:0ab6a29f35bf 182 * (real, imag, real, imag, ...).
<> 129:0ab6a29f35bf 183 * In the API functions, the number of samples in a complex array refers
<> 129:0ab6a29f35bf 184 * to the number of complex values; the array contains twice this number of
<> 129:0ab6a29f35bf 185 * real values.
<> 129:0ab6a29f35bf 186 */
<> 129:0ab6a29f35bf 187
<> 129:0ab6a29f35bf 188 /**
<> 129:0ab6a29f35bf 189 * @defgroup groupFilters Filtering Functions
<> 129:0ab6a29f35bf 190 */
<> 129:0ab6a29f35bf 191
<> 129:0ab6a29f35bf 192 /**
<> 129:0ab6a29f35bf 193 * @defgroup groupMatrix Matrix Functions
<> 129:0ab6a29f35bf 194 *
<> 129:0ab6a29f35bf 195 * This set of functions provides basic matrix math operations.
<> 129:0ab6a29f35bf 196 * The functions operate on matrix data structures. For example,
<> 129:0ab6a29f35bf 197 * the type
<> 129:0ab6a29f35bf 198 * definition for the floating-point matrix structure is shown
<> 129:0ab6a29f35bf 199 * below:
<> 129:0ab6a29f35bf 200 * <pre>
<> 129:0ab6a29f35bf 201 * typedef struct
<> 129:0ab6a29f35bf 202 * {
<> 129:0ab6a29f35bf 203 * uint16_t numRows; // number of rows of the matrix.
<> 129:0ab6a29f35bf 204 * uint16_t numCols; // number of columns of the matrix.
<> 129:0ab6a29f35bf 205 * float32_t *pData; // points to the data of the matrix.
<> 129:0ab6a29f35bf 206 * } arm_matrix_instance_f32;
<> 129:0ab6a29f35bf 207 * </pre>
<> 129:0ab6a29f35bf 208 * There are similar definitions for Q15 and Q31 data types.
<> 129:0ab6a29f35bf 209 *
<> 129:0ab6a29f35bf 210 * The structure specifies the size of the matrix and then points to
<> 129:0ab6a29f35bf 211 * an array of data. The array is of size <code>numRows X numCols</code>
<> 129:0ab6a29f35bf 212 * and the values are arranged in row order. That is, the
<> 129:0ab6a29f35bf 213 * matrix element (i, j) is stored at:
<> 129:0ab6a29f35bf 214 * <pre>
<> 129:0ab6a29f35bf 215 * pData[i*numCols + j]
<> 129:0ab6a29f35bf 216 * </pre>
<> 129:0ab6a29f35bf 217 *
<> 129:0ab6a29f35bf 218 * \par Init Functions
<> 129:0ab6a29f35bf 219 * There is an associated initialization function for each type of matrix
<> 129:0ab6a29f35bf 220 * data structure.
<> 129:0ab6a29f35bf 221 * The initialization function sets the values of the internal structure fields.
<> 129:0ab6a29f35bf 222 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
<> 129:0ab6a29f35bf 223 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
<> 129:0ab6a29f35bf 224 *
<> 129:0ab6a29f35bf 225 * \par
<> 129:0ab6a29f35bf 226 * Use of the initialization function is optional. However, if initialization function is used
<> 129:0ab6a29f35bf 227 * then the instance structure cannot be placed into a const data section.
<> 129:0ab6a29f35bf 228 * To place the instance structure in a const data
<> 129:0ab6a29f35bf 229 * section, manually initialize the data structure. For example:
<> 129:0ab6a29f35bf 230 * <pre>
<> 129:0ab6a29f35bf 231 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
<> 129:0ab6a29f35bf 232 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
<> 129:0ab6a29f35bf 233 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
<> 129:0ab6a29f35bf 234 * </pre>
<> 129:0ab6a29f35bf 235 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
<> 129:0ab6a29f35bf 236 * specifies the number of columns, and <code>pData</code> points to the
<> 129:0ab6a29f35bf 237 * data array.
<> 129:0ab6a29f35bf 238 *
<> 129:0ab6a29f35bf 239 * \par Size Checking
<> 129:0ab6a29f35bf 240 * By default all of the matrix functions perform size checking on the input and
<> 129:0ab6a29f35bf 241 * output matrices. For example, the matrix addition function verifies that the
<> 129:0ab6a29f35bf 242 * two input matrices and the output matrix all have the same number of rows and
<> 129:0ab6a29f35bf 243 * columns. If the size check fails the functions return:
<> 129:0ab6a29f35bf 244 * <pre>
<> 129:0ab6a29f35bf 245 * ARM_MATH_SIZE_MISMATCH
<> 129:0ab6a29f35bf 246 * </pre>
<> 129:0ab6a29f35bf 247 * Otherwise the functions return
<> 129:0ab6a29f35bf 248 * <pre>
<> 129:0ab6a29f35bf 249 * ARM_MATH_SUCCESS
<> 129:0ab6a29f35bf 250 * </pre>
<> 129:0ab6a29f35bf 251 * There is some overhead associated with this matrix size checking.
<> 129:0ab6a29f35bf 252 * The matrix size checking is enabled via the \#define
<> 129:0ab6a29f35bf 253 * <pre>
<> 129:0ab6a29f35bf 254 * ARM_MATH_MATRIX_CHECK
<> 129:0ab6a29f35bf 255 * </pre>
<> 129:0ab6a29f35bf 256 * within the library project settings. By default this macro is defined
<> 129:0ab6a29f35bf 257 * and size checking is enabled. By changing the project settings and
<> 129:0ab6a29f35bf 258 * undefining this macro size checking is eliminated and the functions
<> 129:0ab6a29f35bf 259 * run a bit faster. With size checking disabled the functions always
<> 129:0ab6a29f35bf 260 * return <code>ARM_MATH_SUCCESS</code>.
<> 129:0ab6a29f35bf 261 */
<> 129:0ab6a29f35bf 262
<> 129:0ab6a29f35bf 263 /**
<> 129:0ab6a29f35bf 264 * @defgroup groupTransforms Transform Functions
<> 129:0ab6a29f35bf 265 */
<> 129:0ab6a29f35bf 266
<> 129:0ab6a29f35bf 267 /**
<> 129:0ab6a29f35bf 268 * @defgroup groupController Controller Functions
<> 129:0ab6a29f35bf 269 */
<> 129:0ab6a29f35bf 270
<> 129:0ab6a29f35bf 271 /**
<> 129:0ab6a29f35bf 272 * @defgroup groupStats Statistics Functions
<> 129:0ab6a29f35bf 273 */
<> 129:0ab6a29f35bf 274 /**
<> 129:0ab6a29f35bf 275 * @defgroup groupSupport Support Functions
<> 129:0ab6a29f35bf 276 */
<> 129:0ab6a29f35bf 277
<> 129:0ab6a29f35bf 278 /**
<> 129:0ab6a29f35bf 279 * @defgroup groupInterpolation Interpolation Functions
<> 129:0ab6a29f35bf 280 * These functions perform 1- and 2-dimensional interpolation of data.
<> 129:0ab6a29f35bf 281 * Linear interpolation is used for 1-dimensional data and
<> 129:0ab6a29f35bf 282 * bilinear interpolation is used for 2-dimensional data.
<> 129:0ab6a29f35bf 283 */
<> 129:0ab6a29f35bf 284
<> 129:0ab6a29f35bf 285 /**
<> 129:0ab6a29f35bf 286 * @defgroup groupExamples Examples
<> 129:0ab6a29f35bf 287 */
<> 129:0ab6a29f35bf 288 #ifndef _ARM_MATH_H
<> 129:0ab6a29f35bf 289 #define _ARM_MATH_H
<> 129:0ab6a29f35bf 290
<> 129:0ab6a29f35bf 291 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
<> 129:0ab6a29f35bf 292
<> 129:0ab6a29f35bf 293 #if defined(ARM_MATH_CM7)
<> 129:0ab6a29f35bf 294 #include "core_cm7.h"
<> 129:0ab6a29f35bf 295 #elif defined (ARM_MATH_CM4)
<> 129:0ab6a29f35bf 296 #include "core_cm4.h"
<> 129:0ab6a29f35bf 297 #elif defined (ARM_MATH_CM3)
<> 129:0ab6a29f35bf 298 #include "core_cm3.h"
<> 129:0ab6a29f35bf 299 #elif defined (ARM_MATH_CM0)
<> 129:0ab6a29f35bf 300 #include "core_cm0.h"
<> 129:0ab6a29f35bf 301 #define ARM_MATH_CM0_FAMILY
<> 129:0ab6a29f35bf 302 #elif defined (ARM_MATH_CM0PLUS)
<> 129:0ab6a29f35bf 303 #include "core_cm0plus.h"
<> 129:0ab6a29f35bf 304 #define ARM_MATH_CM0_FAMILY
<> 129:0ab6a29f35bf 305 #else
<> 129:0ab6a29f35bf 306 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
<> 129:0ab6a29f35bf 307 #endif
<> 129:0ab6a29f35bf 308
<> 129:0ab6a29f35bf 309 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
<> 129:0ab6a29f35bf 310 #include "string.h"
<> 129:0ab6a29f35bf 311 #include "math.h"
<> 129:0ab6a29f35bf 312 #ifdef __cplusplus
<> 129:0ab6a29f35bf 313 extern "C"
<> 129:0ab6a29f35bf 314 {
<> 129:0ab6a29f35bf 315 #endif
<> 129:0ab6a29f35bf 316
<> 129:0ab6a29f35bf 317
<> 129:0ab6a29f35bf 318 /**
<> 129:0ab6a29f35bf 319 * @brief Macros required for reciprocal calculation in Normalized LMS
<> 129:0ab6a29f35bf 320 */
<> 129:0ab6a29f35bf 321
<> 129:0ab6a29f35bf 322 #define DELTA_Q31 (0x100)
<> 129:0ab6a29f35bf 323 #define DELTA_Q15 0x5
<> 129:0ab6a29f35bf 324 #define INDEX_MASK 0x0000003F
<> 129:0ab6a29f35bf 325 #ifndef PI
<> 129:0ab6a29f35bf 326 #define PI 3.14159265358979f
<> 129:0ab6a29f35bf 327 #endif
<> 129:0ab6a29f35bf 328
<> 129:0ab6a29f35bf 329 /**
<> 129:0ab6a29f35bf 330 * @brief Macros required for SINE and COSINE Fast math approximations
<> 129:0ab6a29f35bf 331 */
<> 129:0ab6a29f35bf 332
<> 129:0ab6a29f35bf 333 #define FAST_MATH_TABLE_SIZE 512
<> 129:0ab6a29f35bf 334 #define FAST_MATH_Q31_SHIFT (32 - 10)
<> 129:0ab6a29f35bf 335 #define FAST_MATH_Q15_SHIFT (16 - 10)
<> 129:0ab6a29f35bf 336 #define CONTROLLER_Q31_SHIFT (32 - 9)
<> 129:0ab6a29f35bf 337 #define TABLE_SIZE 256
<> 129:0ab6a29f35bf 338 #define TABLE_SPACING_Q31 0x400000
<> 129:0ab6a29f35bf 339 #define TABLE_SPACING_Q15 0x80
<> 129:0ab6a29f35bf 340
<> 129:0ab6a29f35bf 341 /**
<> 129:0ab6a29f35bf 342 * @brief Macros required for SINE and COSINE Controller functions
<> 129:0ab6a29f35bf 343 */
<> 129:0ab6a29f35bf 344 /* 1.31(q31) Fixed value of 2/360 */
<> 129:0ab6a29f35bf 345 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
<> 129:0ab6a29f35bf 346 #define INPUT_SPACING 0xB60B61
<> 129:0ab6a29f35bf 347
<> 129:0ab6a29f35bf 348 /**
<> 129:0ab6a29f35bf 349 * @brief Macro for Unaligned Support
<> 129:0ab6a29f35bf 350 */
<> 129:0ab6a29f35bf 351 #ifndef UNALIGNED_SUPPORT_DISABLE
<> 129:0ab6a29f35bf 352 #define ALIGN4
<> 129:0ab6a29f35bf 353 #else
<> 129:0ab6a29f35bf 354 #if defined (__GNUC__)
<> 129:0ab6a29f35bf 355 #define ALIGN4 __attribute__((aligned(4)))
<> 129:0ab6a29f35bf 356 #else
<> 129:0ab6a29f35bf 357 #define ALIGN4 __align(4)
<> 129:0ab6a29f35bf 358 #endif
<> 129:0ab6a29f35bf 359 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
<> 129:0ab6a29f35bf 360
<> 129:0ab6a29f35bf 361 /**
<> 129:0ab6a29f35bf 362 * @brief Error status returned by some functions in the library.
<> 129:0ab6a29f35bf 363 */
<> 129:0ab6a29f35bf 364
<> 129:0ab6a29f35bf 365 typedef enum
<> 129:0ab6a29f35bf 366 {
<> 129:0ab6a29f35bf 367 ARM_MATH_SUCCESS = 0, /**< No error */
<> 129:0ab6a29f35bf 368 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
<> 129:0ab6a29f35bf 369 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
<> 129:0ab6a29f35bf 370 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
<> 129:0ab6a29f35bf 371 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
<> 129:0ab6a29f35bf 372 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
<> 129:0ab6a29f35bf 373 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
<> 129:0ab6a29f35bf 374 } arm_status;
<> 129:0ab6a29f35bf 375
<> 129:0ab6a29f35bf 376 /**
<> 129:0ab6a29f35bf 377 * @brief 8-bit fractional data type in 1.7 format.
<> 129:0ab6a29f35bf 378 */
<> 129:0ab6a29f35bf 379 typedef int8_t q7_t;
<> 129:0ab6a29f35bf 380
<> 129:0ab6a29f35bf 381 /**
<> 129:0ab6a29f35bf 382 * @brief 16-bit fractional data type in 1.15 format.
<> 129:0ab6a29f35bf 383 */
<> 129:0ab6a29f35bf 384 typedef int16_t q15_t;
<> 129:0ab6a29f35bf 385
<> 129:0ab6a29f35bf 386 /**
<> 129:0ab6a29f35bf 387 * @brief 32-bit fractional data type in 1.31 format.
<> 129:0ab6a29f35bf 388 */
<> 129:0ab6a29f35bf 389 typedef int32_t q31_t;
<> 129:0ab6a29f35bf 390
<> 129:0ab6a29f35bf 391 /**
<> 129:0ab6a29f35bf 392 * @brief 64-bit fractional data type in 1.63 format.
<> 129:0ab6a29f35bf 393 */
<> 129:0ab6a29f35bf 394 typedef int64_t q63_t;
<> 129:0ab6a29f35bf 395
<> 129:0ab6a29f35bf 396 /**
<> 129:0ab6a29f35bf 397 * @brief 32-bit floating-point type definition.
<> 129:0ab6a29f35bf 398 */
<> 129:0ab6a29f35bf 399 typedef float float32_t;
<> 129:0ab6a29f35bf 400
<> 129:0ab6a29f35bf 401 /**
<> 129:0ab6a29f35bf 402 * @brief 64-bit floating-point type definition.
<> 129:0ab6a29f35bf 403 */
<> 129:0ab6a29f35bf 404 typedef double float64_t;
<> 129:0ab6a29f35bf 405
<> 129:0ab6a29f35bf 406 /**
<> 129:0ab6a29f35bf 407 * @brief definition to read/write two 16 bit values.
<> 129:0ab6a29f35bf 408 */
<> 129:0ab6a29f35bf 409 #if defined __CC_ARM
<> 129:0ab6a29f35bf 410 #define __SIMD32_TYPE int32_t __packed
<> 129:0ab6a29f35bf 411 #define CMSIS_UNUSED __attribute__((unused))
<> 129:0ab6a29f35bf 412 #elif defined __ICCARM__
<> 129:0ab6a29f35bf 413 #define __SIMD32_TYPE int32_t __packed
<> 129:0ab6a29f35bf 414 #define CMSIS_UNUSED
<> 129:0ab6a29f35bf 415 #elif defined __GNUC__
<> 129:0ab6a29f35bf 416 #define __SIMD32_TYPE int32_t
<> 129:0ab6a29f35bf 417 #define CMSIS_UNUSED __attribute__((unused))
<> 129:0ab6a29f35bf 418 #elif defined __CSMC__ /* Cosmic */
<> 129:0ab6a29f35bf 419 #define __SIMD32_TYPE int32_t
<> 129:0ab6a29f35bf 420 #define CMSIS_UNUSED
<> 129:0ab6a29f35bf 421 #elif defined __TASKING__
<> 129:0ab6a29f35bf 422 #define __SIMD32_TYPE __unaligned int32_t
<> 129:0ab6a29f35bf 423 #define CMSIS_UNUSED
<> 129:0ab6a29f35bf 424 #else
<> 129:0ab6a29f35bf 425 #error Unknown compiler
<> 129:0ab6a29f35bf 426 #endif
<> 129:0ab6a29f35bf 427
<> 129:0ab6a29f35bf 428 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
<> 129:0ab6a29f35bf 429 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
<> 129:0ab6a29f35bf 430
<> 129:0ab6a29f35bf 431 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
<> 129:0ab6a29f35bf 432
<> 129:0ab6a29f35bf 433 #define __SIMD64(addr) (*(int64_t **) & (addr))
<> 129:0ab6a29f35bf 434
<> 129:0ab6a29f35bf 435 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 129:0ab6a29f35bf 436 /**
<> 129:0ab6a29f35bf 437 * @brief definition to pack two 16 bit values.
<> 129:0ab6a29f35bf 438 */
<> 129:0ab6a29f35bf 439 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
<> 129:0ab6a29f35bf 440 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
<> 129:0ab6a29f35bf 441 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
<> 129:0ab6a29f35bf 442 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
<> 129:0ab6a29f35bf 443
<> 129:0ab6a29f35bf 444 #endif
<> 129:0ab6a29f35bf 445
<> 129:0ab6a29f35bf 446
<> 129:0ab6a29f35bf 447 /**
<> 129:0ab6a29f35bf 448 * @brief definition to pack four 8 bit values.
<> 129:0ab6a29f35bf 449 */
<> 129:0ab6a29f35bf 450 #ifndef ARM_MATH_BIG_ENDIAN
<> 129:0ab6a29f35bf 451
<> 129:0ab6a29f35bf 452 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
<> 129:0ab6a29f35bf 453 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
<> 129:0ab6a29f35bf 454 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
<> 129:0ab6a29f35bf 455 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
<> 129:0ab6a29f35bf 456 #else
<> 129:0ab6a29f35bf 457
<> 129:0ab6a29f35bf 458 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
<> 129:0ab6a29f35bf 459 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
<> 129:0ab6a29f35bf 460 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
<> 129:0ab6a29f35bf 461 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
<> 129:0ab6a29f35bf 462
<> 129:0ab6a29f35bf 463 #endif
<> 129:0ab6a29f35bf 464
<> 129:0ab6a29f35bf 465
<> 129:0ab6a29f35bf 466 /**
<> 129:0ab6a29f35bf 467 * @brief Clips Q63 to Q31 values.
<> 129:0ab6a29f35bf 468 */
<> 129:0ab6a29f35bf 469 static __INLINE q31_t clip_q63_to_q31(
<> 129:0ab6a29f35bf 470 q63_t x)
<> 129:0ab6a29f35bf 471 {
<> 129:0ab6a29f35bf 472 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 129:0ab6a29f35bf 473 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
<> 129:0ab6a29f35bf 474 }
<> 129:0ab6a29f35bf 475
<> 129:0ab6a29f35bf 476 /**
<> 129:0ab6a29f35bf 477 * @brief Clips Q63 to Q15 values.
<> 129:0ab6a29f35bf 478 */
<> 129:0ab6a29f35bf 479 static __INLINE q15_t clip_q63_to_q15(
<> 129:0ab6a29f35bf 480 q63_t x)
<> 129:0ab6a29f35bf 481 {
<> 129:0ab6a29f35bf 482 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 129:0ab6a29f35bf 483 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
<> 129:0ab6a29f35bf 484 }
<> 129:0ab6a29f35bf 485
<> 129:0ab6a29f35bf 486 /**
<> 129:0ab6a29f35bf 487 * @brief Clips Q31 to Q7 values.
<> 129:0ab6a29f35bf 488 */
<> 129:0ab6a29f35bf 489 static __INLINE q7_t clip_q31_to_q7(
<> 129:0ab6a29f35bf 490 q31_t x)
<> 129:0ab6a29f35bf 491 {
<> 129:0ab6a29f35bf 492 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
<> 129:0ab6a29f35bf 493 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
<> 129:0ab6a29f35bf 494 }
<> 129:0ab6a29f35bf 495
<> 129:0ab6a29f35bf 496 /**
<> 129:0ab6a29f35bf 497 * @brief Clips Q31 to Q15 values.
<> 129:0ab6a29f35bf 498 */
<> 129:0ab6a29f35bf 499 static __INLINE q15_t clip_q31_to_q15(
<> 129:0ab6a29f35bf 500 q31_t x)
<> 129:0ab6a29f35bf 501 {
<> 129:0ab6a29f35bf 502 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
<> 129:0ab6a29f35bf 503 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
<> 129:0ab6a29f35bf 504 }
<> 129:0ab6a29f35bf 505
<> 129:0ab6a29f35bf 506 /**
<> 129:0ab6a29f35bf 507 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
<> 129:0ab6a29f35bf 508 */
<> 129:0ab6a29f35bf 509
<> 129:0ab6a29f35bf 510 static __INLINE q63_t mult32x64(
<> 129:0ab6a29f35bf 511 q63_t x,
<> 129:0ab6a29f35bf 512 q31_t y)
<> 129:0ab6a29f35bf 513 {
<> 129:0ab6a29f35bf 514 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
<> 129:0ab6a29f35bf 515 (((q63_t) (x >> 32) * y)));
<> 129:0ab6a29f35bf 516 }
<> 129:0ab6a29f35bf 517
<> 129:0ab6a29f35bf 518
<> 129:0ab6a29f35bf 519 //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
<> 129:0ab6a29f35bf 520 //#define __CLZ __clz
<> 129:0ab6a29f35bf 521 //#endif
<> 129:0ab6a29f35bf 522
<> 129:0ab6a29f35bf 523 //note: function can be removed when all toolchain support __CLZ for Cortex-M0
<> 129:0ab6a29f35bf 524 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
<> 129:0ab6a29f35bf 525
<> 129:0ab6a29f35bf 526 static __INLINE uint32_t __CLZ(
<> 129:0ab6a29f35bf 527 q31_t data);
<> 129:0ab6a29f35bf 528
<> 129:0ab6a29f35bf 529
<> 129:0ab6a29f35bf 530 static __INLINE uint32_t __CLZ(
<> 129:0ab6a29f35bf 531 q31_t data)
<> 129:0ab6a29f35bf 532 {
<> 129:0ab6a29f35bf 533 uint32_t count = 0;
<> 129:0ab6a29f35bf 534 uint32_t mask = 0x80000000;
<> 129:0ab6a29f35bf 535
<> 129:0ab6a29f35bf 536 while((data & mask) == 0)
<> 129:0ab6a29f35bf 537 {
<> 129:0ab6a29f35bf 538 count += 1u;
<> 129:0ab6a29f35bf 539 mask = mask >> 1u;
<> 129:0ab6a29f35bf 540 }
<> 129:0ab6a29f35bf 541
<> 129:0ab6a29f35bf 542 return (count);
<> 129:0ab6a29f35bf 543
<> 129:0ab6a29f35bf 544 }
<> 129:0ab6a29f35bf 545
<> 129:0ab6a29f35bf 546 #endif
<> 129:0ab6a29f35bf 547
<> 129:0ab6a29f35bf 548 /**
<> 129:0ab6a29f35bf 549 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
<> 129:0ab6a29f35bf 550 */
<> 129:0ab6a29f35bf 551
<> 129:0ab6a29f35bf 552 static __INLINE uint32_t arm_recip_q31(
<> 129:0ab6a29f35bf 553 q31_t in,
<> 129:0ab6a29f35bf 554 q31_t * dst,
<> 129:0ab6a29f35bf 555 q31_t * pRecipTable)
<> 129:0ab6a29f35bf 556 {
<> 129:0ab6a29f35bf 557
<> 129:0ab6a29f35bf 558 uint32_t out, tempVal;
<> 129:0ab6a29f35bf 559 uint32_t index, i;
<> 129:0ab6a29f35bf 560 uint32_t signBits;
<> 129:0ab6a29f35bf 561
<> 129:0ab6a29f35bf 562 if(in > 0)
<> 129:0ab6a29f35bf 563 {
<> 129:0ab6a29f35bf 564 signBits = __CLZ(in) - 1;
<> 129:0ab6a29f35bf 565 }
<> 129:0ab6a29f35bf 566 else
<> 129:0ab6a29f35bf 567 {
<> 129:0ab6a29f35bf 568 signBits = __CLZ(-in) - 1;
<> 129:0ab6a29f35bf 569 }
<> 129:0ab6a29f35bf 570
<> 129:0ab6a29f35bf 571 /* Convert input sample to 1.31 format */
<> 129:0ab6a29f35bf 572 in = in << signBits;
<> 129:0ab6a29f35bf 573
<> 129:0ab6a29f35bf 574 /* calculation of index for initial approximated Val */
<> 129:0ab6a29f35bf 575 index = (uint32_t) (in >> 24u);
<> 129:0ab6a29f35bf 576 index = (index & INDEX_MASK);
<> 129:0ab6a29f35bf 577
<> 129:0ab6a29f35bf 578 /* 1.31 with exp 1 */
<> 129:0ab6a29f35bf 579 out = pRecipTable[index];
<> 129:0ab6a29f35bf 580
<> 129:0ab6a29f35bf 581 /* calculation of reciprocal value */
<> 129:0ab6a29f35bf 582 /* running approximation for two iterations */
<> 129:0ab6a29f35bf 583 for (i = 0u; i < 2u; i++)
<> 129:0ab6a29f35bf 584 {
<> 129:0ab6a29f35bf 585 tempVal = (q31_t) (((q63_t) in * out) >> 31u);
<> 129:0ab6a29f35bf 586 tempVal = 0x7FFFFFFF - tempVal;
<> 129:0ab6a29f35bf 587 /* 1.31 with exp 1 */
<> 129:0ab6a29f35bf 588 //out = (q31_t) (((q63_t) out * tempVal) >> 30u);
<> 129:0ab6a29f35bf 589 out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u);
<> 129:0ab6a29f35bf 590 }
<> 129:0ab6a29f35bf 591
<> 129:0ab6a29f35bf 592 /* write output */
<> 129:0ab6a29f35bf 593 *dst = out;
<> 129:0ab6a29f35bf 594
<> 129:0ab6a29f35bf 595 /* return num of signbits of out = 1/in value */
<> 129:0ab6a29f35bf 596 return (signBits + 1u);
<> 129:0ab6a29f35bf 597
<> 129:0ab6a29f35bf 598 }
<> 129:0ab6a29f35bf 599
<> 129:0ab6a29f35bf 600 /**
<> 129:0ab6a29f35bf 601 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
<> 129:0ab6a29f35bf 602 */
<> 129:0ab6a29f35bf 603 static __INLINE uint32_t arm_recip_q15(
<> 129:0ab6a29f35bf 604 q15_t in,
<> 129:0ab6a29f35bf 605 q15_t * dst,
<> 129:0ab6a29f35bf 606 q15_t * pRecipTable)
<> 129:0ab6a29f35bf 607 {
<> 129:0ab6a29f35bf 608
<> 129:0ab6a29f35bf 609 uint32_t out = 0, tempVal = 0;
<> 129:0ab6a29f35bf 610 uint32_t index = 0, i = 0;
<> 129:0ab6a29f35bf 611 uint32_t signBits = 0;
<> 129:0ab6a29f35bf 612
<> 129:0ab6a29f35bf 613 if(in > 0)
<> 129:0ab6a29f35bf 614 {
<> 129:0ab6a29f35bf 615 signBits = __CLZ(in) - 17;
<> 129:0ab6a29f35bf 616 }
<> 129:0ab6a29f35bf 617 else
<> 129:0ab6a29f35bf 618 {
<> 129:0ab6a29f35bf 619 signBits = __CLZ(-in) - 17;
<> 129:0ab6a29f35bf 620 }
<> 129:0ab6a29f35bf 621
<> 129:0ab6a29f35bf 622 /* Convert input sample to 1.15 format */
<> 129:0ab6a29f35bf 623 in = in << signBits;
<> 129:0ab6a29f35bf 624
<> 129:0ab6a29f35bf 625 /* calculation of index for initial approximated Val */
<> 129:0ab6a29f35bf 626 index = in >> 8;
<> 129:0ab6a29f35bf 627 index = (index & INDEX_MASK);
<> 129:0ab6a29f35bf 628
<> 129:0ab6a29f35bf 629 /* 1.15 with exp 1 */
<> 129:0ab6a29f35bf 630 out = pRecipTable[index];
<> 129:0ab6a29f35bf 631
<> 129:0ab6a29f35bf 632 /* calculation of reciprocal value */
<> 129:0ab6a29f35bf 633 /* running approximation for two iterations */
<> 129:0ab6a29f35bf 634 for (i = 0; i < 2; i++)
<> 129:0ab6a29f35bf 635 {
<> 129:0ab6a29f35bf 636 tempVal = (q15_t) (((q31_t) in * out) >> 15);
<> 129:0ab6a29f35bf 637 tempVal = 0x7FFF - tempVal;
<> 129:0ab6a29f35bf 638 /* 1.15 with exp 1 */
<> 129:0ab6a29f35bf 639 out = (q15_t) (((q31_t) out * tempVal) >> 14);
<> 129:0ab6a29f35bf 640 }
<> 129:0ab6a29f35bf 641
<> 129:0ab6a29f35bf 642 /* write output */
<> 129:0ab6a29f35bf 643 *dst = out;
<> 129:0ab6a29f35bf 644
<> 129:0ab6a29f35bf 645 /* return num of signbits of out = 1/in value */
<> 129:0ab6a29f35bf 646 return (signBits + 1);
<> 129:0ab6a29f35bf 647
<> 129:0ab6a29f35bf 648 }
<> 129:0ab6a29f35bf 649
<> 129:0ab6a29f35bf 650
<> 129:0ab6a29f35bf 651 /*
<> 129:0ab6a29f35bf 652 * @brief C custom defined intrinisic function for only M0 processors
<> 129:0ab6a29f35bf 653 */
<> 129:0ab6a29f35bf 654 #if defined(ARM_MATH_CM0_FAMILY)
<> 129:0ab6a29f35bf 655
<> 129:0ab6a29f35bf 656 static __INLINE q31_t __SSAT(
<> 129:0ab6a29f35bf 657 q31_t x,
<> 129:0ab6a29f35bf 658 uint32_t y)
<> 129:0ab6a29f35bf 659 {
<> 129:0ab6a29f35bf 660 int32_t posMax, negMin;
<> 129:0ab6a29f35bf 661 uint32_t i;
<> 129:0ab6a29f35bf 662
<> 129:0ab6a29f35bf 663 posMax = 1;
<> 129:0ab6a29f35bf 664 for (i = 0; i < (y - 1); i++)
<> 129:0ab6a29f35bf 665 {
<> 129:0ab6a29f35bf 666 posMax = posMax * 2;
<> 129:0ab6a29f35bf 667 }
<> 129:0ab6a29f35bf 668
<> 129:0ab6a29f35bf 669 if(x > 0)
<> 129:0ab6a29f35bf 670 {
<> 129:0ab6a29f35bf 671 posMax = (posMax - 1);
<> 129:0ab6a29f35bf 672
<> 129:0ab6a29f35bf 673 if(x > posMax)
<> 129:0ab6a29f35bf 674 {
<> 129:0ab6a29f35bf 675 x = posMax;
<> 129:0ab6a29f35bf 676 }
<> 129:0ab6a29f35bf 677 }
<> 129:0ab6a29f35bf 678 else
<> 129:0ab6a29f35bf 679 {
<> 129:0ab6a29f35bf 680 negMin = -posMax;
<> 129:0ab6a29f35bf 681
<> 129:0ab6a29f35bf 682 if(x < negMin)
<> 129:0ab6a29f35bf 683 {
<> 129:0ab6a29f35bf 684 x = negMin;
<> 129:0ab6a29f35bf 685 }
<> 129:0ab6a29f35bf 686 }
<> 129:0ab6a29f35bf 687 return (x);
<> 129:0ab6a29f35bf 688
<> 129:0ab6a29f35bf 689
<> 129:0ab6a29f35bf 690 }
<> 129:0ab6a29f35bf 691
<> 129:0ab6a29f35bf 692 #endif /* end of ARM_MATH_CM0_FAMILY */
<> 129:0ab6a29f35bf 693
<> 129:0ab6a29f35bf 694
<> 129:0ab6a29f35bf 695
<> 129:0ab6a29f35bf 696 /*
<> 129:0ab6a29f35bf 697 * @brief C custom defined intrinsic function for M3 and M0 processors
<> 129:0ab6a29f35bf 698 */
<> 129:0ab6a29f35bf 699 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 129:0ab6a29f35bf 700
<> 129:0ab6a29f35bf 701 /*
<> 129:0ab6a29f35bf 702 * @brief C custom defined QADD8 for M3 and M0 processors
<> 129:0ab6a29f35bf 703 */
<> 129:0ab6a29f35bf 704 static __INLINE q31_t __QADD8(
<> 129:0ab6a29f35bf 705 q31_t x,
<> 129:0ab6a29f35bf 706 q31_t y)
<> 129:0ab6a29f35bf 707 {
<> 129:0ab6a29f35bf 708
<> 129:0ab6a29f35bf 709 q31_t sum;
<> 129:0ab6a29f35bf 710 q7_t r, s, t, u;
<> 129:0ab6a29f35bf 711
<> 129:0ab6a29f35bf 712 r = (q7_t) x;
<> 129:0ab6a29f35bf 713 s = (q7_t) y;
<> 129:0ab6a29f35bf 714
<> 129:0ab6a29f35bf 715 r = __SSAT((q31_t) (r + s), 8);
<> 129:0ab6a29f35bf 716 s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8);
<> 129:0ab6a29f35bf 717 t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8);
<> 129:0ab6a29f35bf 718 u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8);
<> 129:0ab6a29f35bf 719
<> 129:0ab6a29f35bf 720 sum =
<> 129:0ab6a29f35bf 721 (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) |
<> 129:0ab6a29f35bf 722 (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF);
<> 129:0ab6a29f35bf 723
<> 129:0ab6a29f35bf 724 return sum;
<> 129:0ab6a29f35bf 725
<> 129:0ab6a29f35bf 726 }
<> 129:0ab6a29f35bf 727
<> 129:0ab6a29f35bf 728 /*
<> 129:0ab6a29f35bf 729 * @brief C custom defined QSUB8 for M3 and M0 processors
<> 129:0ab6a29f35bf 730 */
<> 129:0ab6a29f35bf 731 static __INLINE q31_t __QSUB8(
<> 129:0ab6a29f35bf 732 q31_t x,
<> 129:0ab6a29f35bf 733 q31_t y)
<> 129:0ab6a29f35bf 734 {
<> 129:0ab6a29f35bf 735
<> 129:0ab6a29f35bf 736 q31_t sum;
<> 129:0ab6a29f35bf 737 q31_t r, s, t, u;
<> 129:0ab6a29f35bf 738
<> 129:0ab6a29f35bf 739 r = (q7_t) x;
<> 129:0ab6a29f35bf 740 s = (q7_t) y;
<> 129:0ab6a29f35bf 741
<> 129:0ab6a29f35bf 742 r = __SSAT((r - s), 8);
<> 129:0ab6a29f35bf 743 s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8;
<> 129:0ab6a29f35bf 744 t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16;
<> 129:0ab6a29f35bf 745 u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24;
<> 129:0ab6a29f35bf 746
<> 129:0ab6a29f35bf 747 sum =
<> 129:0ab6a29f35bf 748 (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r &
<> 129:0ab6a29f35bf 749 0x000000FF);
<> 129:0ab6a29f35bf 750
<> 129:0ab6a29f35bf 751 return sum;
<> 129:0ab6a29f35bf 752 }
<> 129:0ab6a29f35bf 753
<> 129:0ab6a29f35bf 754 /*
<> 129:0ab6a29f35bf 755 * @brief C custom defined QADD16 for M3 and M0 processors
<> 129:0ab6a29f35bf 756 */
<> 129:0ab6a29f35bf 757
<> 129:0ab6a29f35bf 758 /*
<> 129:0ab6a29f35bf 759 * @brief C custom defined QADD16 for M3 and M0 processors
<> 129:0ab6a29f35bf 760 */
<> 129:0ab6a29f35bf 761 static __INLINE q31_t __QADD16(
<> 129:0ab6a29f35bf 762 q31_t x,
<> 129:0ab6a29f35bf 763 q31_t y)
<> 129:0ab6a29f35bf 764 {
<> 129:0ab6a29f35bf 765
<> 129:0ab6a29f35bf 766 q31_t sum;
<> 129:0ab6a29f35bf 767 q31_t r, s;
<> 129:0ab6a29f35bf 768
<> 129:0ab6a29f35bf 769 r = (q15_t) x;
<> 129:0ab6a29f35bf 770 s = (q15_t) y;
<> 129:0ab6a29f35bf 771
<> 129:0ab6a29f35bf 772 r = __SSAT(r + s, 16);
<> 129:0ab6a29f35bf 773 s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16;
<> 129:0ab6a29f35bf 774
<> 129:0ab6a29f35bf 775 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 776
<> 129:0ab6a29f35bf 777 return sum;
<> 129:0ab6a29f35bf 778
<> 129:0ab6a29f35bf 779 }
<> 129:0ab6a29f35bf 780
<> 129:0ab6a29f35bf 781 /*
<> 129:0ab6a29f35bf 782 * @brief C custom defined SHADD16 for M3 and M0 processors
<> 129:0ab6a29f35bf 783 */
<> 129:0ab6a29f35bf 784 static __INLINE q31_t __SHADD16(
<> 129:0ab6a29f35bf 785 q31_t x,
<> 129:0ab6a29f35bf 786 q31_t y)
<> 129:0ab6a29f35bf 787 {
<> 129:0ab6a29f35bf 788
<> 129:0ab6a29f35bf 789 q31_t sum;
<> 129:0ab6a29f35bf 790 q31_t r, s;
<> 129:0ab6a29f35bf 791
<> 129:0ab6a29f35bf 792 r = (q15_t) x;
<> 129:0ab6a29f35bf 793 s = (q15_t) y;
<> 129:0ab6a29f35bf 794
<> 129:0ab6a29f35bf 795 r = ((r >> 1) + (s >> 1));
<> 129:0ab6a29f35bf 796 s = ((q31_t) ((x >> 17) + (y >> 17))) << 16;
<> 129:0ab6a29f35bf 797
<> 129:0ab6a29f35bf 798 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 799
<> 129:0ab6a29f35bf 800 return sum;
<> 129:0ab6a29f35bf 801
<> 129:0ab6a29f35bf 802 }
<> 129:0ab6a29f35bf 803
<> 129:0ab6a29f35bf 804 /*
<> 129:0ab6a29f35bf 805 * @brief C custom defined QSUB16 for M3 and M0 processors
<> 129:0ab6a29f35bf 806 */
<> 129:0ab6a29f35bf 807 static __INLINE q31_t __QSUB16(
<> 129:0ab6a29f35bf 808 q31_t x,
<> 129:0ab6a29f35bf 809 q31_t y)
<> 129:0ab6a29f35bf 810 {
<> 129:0ab6a29f35bf 811
<> 129:0ab6a29f35bf 812 q31_t sum;
<> 129:0ab6a29f35bf 813 q31_t r, s;
<> 129:0ab6a29f35bf 814
<> 129:0ab6a29f35bf 815 r = (q15_t) x;
<> 129:0ab6a29f35bf 816 s = (q15_t) y;
<> 129:0ab6a29f35bf 817
<> 129:0ab6a29f35bf 818 r = __SSAT(r - s, 16);
<> 129:0ab6a29f35bf 819 s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16;
<> 129:0ab6a29f35bf 820
<> 129:0ab6a29f35bf 821 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 822
<> 129:0ab6a29f35bf 823 return sum;
<> 129:0ab6a29f35bf 824 }
<> 129:0ab6a29f35bf 825
<> 129:0ab6a29f35bf 826 /*
<> 129:0ab6a29f35bf 827 * @brief C custom defined SHSUB16 for M3 and M0 processors
<> 129:0ab6a29f35bf 828 */
<> 129:0ab6a29f35bf 829 static __INLINE q31_t __SHSUB16(
<> 129:0ab6a29f35bf 830 q31_t x,
<> 129:0ab6a29f35bf 831 q31_t y)
<> 129:0ab6a29f35bf 832 {
<> 129:0ab6a29f35bf 833
<> 129:0ab6a29f35bf 834 q31_t diff;
<> 129:0ab6a29f35bf 835 q31_t r, s;
<> 129:0ab6a29f35bf 836
<> 129:0ab6a29f35bf 837 r = (q15_t) x;
<> 129:0ab6a29f35bf 838 s = (q15_t) y;
<> 129:0ab6a29f35bf 839
<> 129:0ab6a29f35bf 840 r = ((r >> 1) - (s >> 1));
<> 129:0ab6a29f35bf 841 s = (((x >> 17) - (y >> 17)) << 16);
<> 129:0ab6a29f35bf 842
<> 129:0ab6a29f35bf 843 diff = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 844
<> 129:0ab6a29f35bf 845 return diff;
<> 129:0ab6a29f35bf 846 }
<> 129:0ab6a29f35bf 847
<> 129:0ab6a29f35bf 848 /*
<> 129:0ab6a29f35bf 849 * @brief C custom defined QASX for M3 and M0 processors
<> 129:0ab6a29f35bf 850 */
<> 129:0ab6a29f35bf 851 static __INLINE q31_t __QASX(
<> 129:0ab6a29f35bf 852 q31_t x,
<> 129:0ab6a29f35bf 853 q31_t y)
<> 129:0ab6a29f35bf 854 {
<> 129:0ab6a29f35bf 855
<> 129:0ab6a29f35bf 856 q31_t sum = 0;
<> 129:0ab6a29f35bf 857
<> 129:0ab6a29f35bf 858 sum =
<> 129:0ab6a29f35bf 859 ((sum +
<> 129:0ab6a29f35bf 860 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) +
<> 129:0ab6a29f35bf 861 clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16)));
<> 129:0ab6a29f35bf 862
<> 129:0ab6a29f35bf 863 return sum;
<> 129:0ab6a29f35bf 864 }
<> 129:0ab6a29f35bf 865
<> 129:0ab6a29f35bf 866 /*
<> 129:0ab6a29f35bf 867 * @brief C custom defined SHASX for M3 and M0 processors
<> 129:0ab6a29f35bf 868 */
<> 129:0ab6a29f35bf 869 static __INLINE q31_t __SHASX(
<> 129:0ab6a29f35bf 870 q31_t x,
<> 129:0ab6a29f35bf 871 q31_t y)
<> 129:0ab6a29f35bf 872 {
<> 129:0ab6a29f35bf 873
<> 129:0ab6a29f35bf 874 q31_t sum;
<> 129:0ab6a29f35bf 875 q31_t r, s;
<> 129:0ab6a29f35bf 876
<> 129:0ab6a29f35bf 877 r = (q15_t) x;
<> 129:0ab6a29f35bf 878 s = (q15_t) y;
<> 129:0ab6a29f35bf 879
<> 129:0ab6a29f35bf 880 r = ((r >> 1) - (y >> 17));
<> 129:0ab6a29f35bf 881 s = (((x >> 17) + (s >> 1)) << 16);
<> 129:0ab6a29f35bf 882
<> 129:0ab6a29f35bf 883 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 884
<> 129:0ab6a29f35bf 885 return sum;
<> 129:0ab6a29f35bf 886 }
<> 129:0ab6a29f35bf 887
<> 129:0ab6a29f35bf 888
<> 129:0ab6a29f35bf 889 /*
<> 129:0ab6a29f35bf 890 * @brief C custom defined QSAX for M3 and M0 processors
<> 129:0ab6a29f35bf 891 */
<> 129:0ab6a29f35bf 892 static __INLINE q31_t __QSAX(
<> 129:0ab6a29f35bf 893 q31_t x,
<> 129:0ab6a29f35bf 894 q31_t y)
<> 129:0ab6a29f35bf 895 {
<> 129:0ab6a29f35bf 896
<> 129:0ab6a29f35bf 897 q31_t sum = 0;
<> 129:0ab6a29f35bf 898
<> 129:0ab6a29f35bf 899 sum =
<> 129:0ab6a29f35bf 900 ((sum +
<> 129:0ab6a29f35bf 901 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) +
<> 129:0ab6a29f35bf 902 clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16)));
<> 129:0ab6a29f35bf 903
<> 129:0ab6a29f35bf 904 return sum;
<> 129:0ab6a29f35bf 905 }
<> 129:0ab6a29f35bf 906
<> 129:0ab6a29f35bf 907 /*
<> 129:0ab6a29f35bf 908 * @brief C custom defined SHSAX for M3 and M0 processors
<> 129:0ab6a29f35bf 909 */
<> 129:0ab6a29f35bf 910 static __INLINE q31_t __SHSAX(
<> 129:0ab6a29f35bf 911 q31_t x,
<> 129:0ab6a29f35bf 912 q31_t y)
<> 129:0ab6a29f35bf 913 {
<> 129:0ab6a29f35bf 914
<> 129:0ab6a29f35bf 915 q31_t sum;
<> 129:0ab6a29f35bf 916 q31_t r, s;
<> 129:0ab6a29f35bf 917
<> 129:0ab6a29f35bf 918 r = (q15_t) x;
<> 129:0ab6a29f35bf 919 s = (q15_t) y;
<> 129:0ab6a29f35bf 920
<> 129:0ab6a29f35bf 921 r = ((r >> 1) + (y >> 17));
<> 129:0ab6a29f35bf 922 s = (((x >> 17) - (s >> 1)) << 16);
<> 129:0ab6a29f35bf 923
<> 129:0ab6a29f35bf 924 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 129:0ab6a29f35bf 925
<> 129:0ab6a29f35bf 926 return sum;
<> 129:0ab6a29f35bf 927 }
<> 129:0ab6a29f35bf 928
<> 129:0ab6a29f35bf 929 /*
<> 129:0ab6a29f35bf 930 * @brief C custom defined SMUSDX for M3 and M0 processors
<> 129:0ab6a29f35bf 931 */
<> 129:0ab6a29f35bf 932 static __INLINE q31_t __SMUSDX(
<> 129:0ab6a29f35bf 933 q31_t x,
<> 129:0ab6a29f35bf 934 q31_t y)
<> 129:0ab6a29f35bf 935 {
<> 129:0ab6a29f35bf 936
<> 129:0ab6a29f35bf 937 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) -
<> 129:0ab6a29f35bf 938 ((q15_t) (x >> 16) * (q15_t) y)));
<> 129:0ab6a29f35bf 939 }
<> 129:0ab6a29f35bf 940
<> 129:0ab6a29f35bf 941 /*
<> 129:0ab6a29f35bf 942 * @brief C custom defined SMUADX for M3 and M0 processors
<> 129:0ab6a29f35bf 943 */
<> 129:0ab6a29f35bf 944 static __INLINE q31_t __SMUADX(
<> 129:0ab6a29f35bf 945 q31_t x,
<> 129:0ab6a29f35bf 946 q31_t y)
<> 129:0ab6a29f35bf 947 {
<> 129:0ab6a29f35bf 948
<> 129:0ab6a29f35bf 949 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) +
<> 129:0ab6a29f35bf 950 ((q15_t) (x >> 16) * (q15_t) y)));
<> 129:0ab6a29f35bf 951 }
<> 129:0ab6a29f35bf 952
<> 129:0ab6a29f35bf 953 /*
<> 129:0ab6a29f35bf 954 * @brief C custom defined QADD for M3 and M0 processors
<> 129:0ab6a29f35bf 955 */
<> 129:0ab6a29f35bf 956 static __INLINE q31_t __QADD(
<> 129:0ab6a29f35bf 957 q31_t x,
<> 129:0ab6a29f35bf 958 q31_t y)
<> 129:0ab6a29f35bf 959 {
<> 129:0ab6a29f35bf 960 return clip_q63_to_q31((q63_t) x + y);
<> 129:0ab6a29f35bf 961 }
<> 129:0ab6a29f35bf 962
<> 129:0ab6a29f35bf 963 /*
<> 129:0ab6a29f35bf 964 * @brief C custom defined QSUB for M3 and M0 processors
<> 129:0ab6a29f35bf 965 */
<> 129:0ab6a29f35bf 966 static __INLINE q31_t __QSUB(
<> 129:0ab6a29f35bf 967 q31_t x,
<> 129:0ab6a29f35bf 968 q31_t y)
<> 129:0ab6a29f35bf 969 {
<> 129:0ab6a29f35bf 970 return clip_q63_to_q31((q63_t) x - y);
<> 129:0ab6a29f35bf 971 }
<> 129:0ab6a29f35bf 972
<> 129:0ab6a29f35bf 973 /*
<> 129:0ab6a29f35bf 974 * @brief C custom defined SMLAD for M3 and M0 processors
<> 129:0ab6a29f35bf 975 */
<> 129:0ab6a29f35bf 976 static __INLINE q31_t __SMLAD(
<> 129:0ab6a29f35bf 977 q31_t x,
<> 129:0ab6a29f35bf 978 q31_t y,
<> 129:0ab6a29f35bf 979 q31_t sum)
<> 129:0ab6a29f35bf 980 {
<> 129:0ab6a29f35bf 981
<> 129:0ab6a29f35bf 982 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 129:0ab6a29f35bf 983 ((q15_t) x * (q15_t) y));
<> 129:0ab6a29f35bf 984 }
<> 129:0ab6a29f35bf 985
<> 129:0ab6a29f35bf 986 /*
<> 129:0ab6a29f35bf 987 * @brief C custom defined SMLADX for M3 and M0 processors
<> 129:0ab6a29f35bf 988 */
<> 129:0ab6a29f35bf 989 static __INLINE q31_t __SMLADX(
<> 129:0ab6a29f35bf 990 q31_t x,
<> 129:0ab6a29f35bf 991 q31_t y,
<> 129:0ab6a29f35bf 992 q31_t sum)
<> 129:0ab6a29f35bf 993 {
<> 129:0ab6a29f35bf 994
<> 129:0ab6a29f35bf 995 return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 129:0ab6a29f35bf 996 ((q15_t) x * (q15_t) (y >> 16)));
<> 129:0ab6a29f35bf 997 }
<> 129:0ab6a29f35bf 998
<> 129:0ab6a29f35bf 999 /*
<> 129:0ab6a29f35bf 1000 * @brief C custom defined SMLSDX for M3 and M0 processors
<> 129:0ab6a29f35bf 1001 */
<> 129:0ab6a29f35bf 1002 static __INLINE q31_t __SMLSDX(
<> 129:0ab6a29f35bf 1003 q31_t x,
<> 129:0ab6a29f35bf 1004 q31_t y,
<> 129:0ab6a29f35bf 1005 q31_t sum)
<> 129:0ab6a29f35bf 1006 {
<> 129:0ab6a29f35bf 1007
<> 129:0ab6a29f35bf 1008 return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 129:0ab6a29f35bf 1009 ((q15_t) x * (q15_t) (y >> 16)));
<> 129:0ab6a29f35bf 1010 }
<> 129:0ab6a29f35bf 1011
<> 129:0ab6a29f35bf 1012 /*
<> 129:0ab6a29f35bf 1013 * @brief C custom defined SMLALD for M3 and M0 processors
<> 129:0ab6a29f35bf 1014 */
<> 129:0ab6a29f35bf 1015 static __INLINE q63_t __SMLALD(
<> 129:0ab6a29f35bf 1016 q31_t x,
<> 129:0ab6a29f35bf 1017 q31_t y,
<> 129:0ab6a29f35bf 1018 q63_t sum)
<> 129:0ab6a29f35bf 1019 {
<> 129:0ab6a29f35bf 1020
<> 129:0ab6a29f35bf 1021 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 129:0ab6a29f35bf 1022 ((q15_t) x * (q15_t) y));
<> 129:0ab6a29f35bf 1023 }
<> 129:0ab6a29f35bf 1024
<> 129:0ab6a29f35bf 1025 /*
<> 129:0ab6a29f35bf 1026 * @brief C custom defined SMLALDX for M3 and M0 processors
<> 129:0ab6a29f35bf 1027 */
<> 129:0ab6a29f35bf 1028 static __INLINE q63_t __SMLALDX(
<> 129:0ab6a29f35bf 1029 q31_t x,
<> 129:0ab6a29f35bf 1030 q31_t y,
<> 129:0ab6a29f35bf 1031 q63_t sum)
<> 129:0ab6a29f35bf 1032 {
<> 129:0ab6a29f35bf 1033
<> 129:0ab6a29f35bf 1034 return (sum + ((q15_t) (x >> 16) * (q15_t) y)) +
<> 129:0ab6a29f35bf 1035 ((q15_t) x * (q15_t) (y >> 16));
<> 129:0ab6a29f35bf 1036 }
<> 129:0ab6a29f35bf 1037
<> 129:0ab6a29f35bf 1038 /*
<> 129:0ab6a29f35bf 1039 * @brief C custom defined SMUAD for M3 and M0 processors
<> 129:0ab6a29f35bf 1040 */
<> 129:0ab6a29f35bf 1041 static __INLINE q31_t __SMUAD(
<> 129:0ab6a29f35bf 1042 q31_t x,
<> 129:0ab6a29f35bf 1043 q31_t y)
<> 129:0ab6a29f35bf 1044 {
<> 129:0ab6a29f35bf 1045
<> 129:0ab6a29f35bf 1046 return (((x >> 16) * (y >> 16)) +
<> 129:0ab6a29f35bf 1047 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 129:0ab6a29f35bf 1048 }
<> 129:0ab6a29f35bf 1049
<> 129:0ab6a29f35bf 1050 /*
<> 129:0ab6a29f35bf 1051 * @brief C custom defined SMUSD for M3 and M0 processors
<> 129:0ab6a29f35bf 1052 */
<> 129:0ab6a29f35bf 1053 static __INLINE q31_t __SMUSD(
<> 129:0ab6a29f35bf 1054 q31_t x,
<> 129:0ab6a29f35bf 1055 q31_t y)
<> 129:0ab6a29f35bf 1056 {
<> 129:0ab6a29f35bf 1057
<> 129:0ab6a29f35bf 1058 return (-((x >> 16) * (y >> 16)) +
<> 129:0ab6a29f35bf 1059 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 129:0ab6a29f35bf 1060 }
<> 129:0ab6a29f35bf 1061
<> 129:0ab6a29f35bf 1062
<> 129:0ab6a29f35bf 1063 /*
<> 129:0ab6a29f35bf 1064 * @brief C custom defined SXTB16 for M3 and M0 processors
<> 129:0ab6a29f35bf 1065 */
<> 129:0ab6a29f35bf 1066 static __INLINE q31_t __SXTB16(
<> 129:0ab6a29f35bf 1067 q31_t x)
<> 129:0ab6a29f35bf 1068 {
<> 129:0ab6a29f35bf 1069
<> 129:0ab6a29f35bf 1070 return ((((x << 24) >> 24) & 0x0000FFFF) |
<> 129:0ab6a29f35bf 1071 (((x << 8) >> 8) & 0xFFFF0000));
<> 129:0ab6a29f35bf 1072 }
<> 129:0ab6a29f35bf 1073
<> 129:0ab6a29f35bf 1074
<> 129:0ab6a29f35bf 1075 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
<> 129:0ab6a29f35bf 1076
<> 129:0ab6a29f35bf 1077
<> 129:0ab6a29f35bf 1078 /**
<> 129:0ab6a29f35bf 1079 * @brief Instance structure for the Q7 FIR filter.
<> 129:0ab6a29f35bf 1080 */
<> 129:0ab6a29f35bf 1081 typedef struct
<> 129:0ab6a29f35bf 1082 {
<> 129:0ab6a29f35bf 1083 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 129:0ab6a29f35bf 1084 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 1085 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 1086 } arm_fir_instance_q7;
<> 129:0ab6a29f35bf 1087
<> 129:0ab6a29f35bf 1088 /**
<> 129:0ab6a29f35bf 1089 * @brief Instance structure for the Q15 FIR filter.
<> 129:0ab6a29f35bf 1090 */
<> 129:0ab6a29f35bf 1091 typedef struct
<> 129:0ab6a29f35bf 1092 {
<> 129:0ab6a29f35bf 1093 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 129:0ab6a29f35bf 1094 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 1095 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 1096 } arm_fir_instance_q15;
<> 129:0ab6a29f35bf 1097
<> 129:0ab6a29f35bf 1098 /**
<> 129:0ab6a29f35bf 1099 * @brief Instance structure for the Q31 FIR filter.
<> 129:0ab6a29f35bf 1100 */
<> 129:0ab6a29f35bf 1101 typedef struct
<> 129:0ab6a29f35bf 1102 {
<> 129:0ab6a29f35bf 1103 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 129:0ab6a29f35bf 1104 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 1105 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 1106 } arm_fir_instance_q31;
<> 129:0ab6a29f35bf 1107
<> 129:0ab6a29f35bf 1108 /**
<> 129:0ab6a29f35bf 1109 * @brief Instance structure for the floating-point FIR filter.
<> 129:0ab6a29f35bf 1110 */
<> 129:0ab6a29f35bf 1111 typedef struct
<> 129:0ab6a29f35bf 1112 {
<> 129:0ab6a29f35bf 1113 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 129:0ab6a29f35bf 1114 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 1115 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 1116 } arm_fir_instance_f32;
<> 129:0ab6a29f35bf 1117
<> 129:0ab6a29f35bf 1118
<> 129:0ab6a29f35bf 1119 /**
<> 129:0ab6a29f35bf 1120 * @brief Processing function for the Q7 FIR filter.
<> 129:0ab6a29f35bf 1121 * @param[in] *S points to an instance of the Q7 FIR filter structure.
<> 129:0ab6a29f35bf 1122 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1123 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1124 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1125 * @return none.
<> 129:0ab6a29f35bf 1126 */
<> 129:0ab6a29f35bf 1127 void arm_fir_q7(
<> 129:0ab6a29f35bf 1128 const arm_fir_instance_q7 * S,
<> 129:0ab6a29f35bf 1129 q7_t * pSrc,
<> 129:0ab6a29f35bf 1130 q7_t * pDst,
<> 129:0ab6a29f35bf 1131 uint32_t blockSize);
<> 129:0ab6a29f35bf 1132
<> 129:0ab6a29f35bf 1133
<> 129:0ab6a29f35bf 1134 /**
<> 129:0ab6a29f35bf 1135 * @brief Initialization function for the Q7 FIR filter.
<> 129:0ab6a29f35bf 1136 * @param[in,out] *S points to an instance of the Q7 FIR structure.
<> 129:0ab6a29f35bf 1137 * @param[in] numTaps Number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 1138 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1139 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1140 * @param[in] blockSize number of samples that are processed.
<> 129:0ab6a29f35bf 1141 * @return none
<> 129:0ab6a29f35bf 1142 */
<> 129:0ab6a29f35bf 1143 void arm_fir_init_q7(
<> 129:0ab6a29f35bf 1144 arm_fir_instance_q7 * S,
<> 129:0ab6a29f35bf 1145 uint16_t numTaps,
<> 129:0ab6a29f35bf 1146 q7_t * pCoeffs,
<> 129:0ab6a29f35bf 1147 q7_t * pState,
<> 129:0ab6a29f35bf 1148 uint32_t blockSize);
<> 129:0ab6a29f35bf 1149
<> 129:0ab6a29f35bf 1150
<> 129:0ab6a29f35bf 1151 /**
<> 129:0ab6a29f35bf 1152 * @brief Processing function for the Q15 FIR filter.
<> 129:0ab6a29f35bf 1153 * @param[in] *S points to an instance of the Q15 FIR structure.
<> 129:0ab6a29f35bf 1154 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1155 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1156 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1157 * @return none.
<> 129:0ab6a29f35bf 1158 */
<> 129:0ab6a29f35bf 1159 void arm_fir_q15(
<> 129:0ab6a29f35bf 1160 const arm_fir_instance_q15 * S,
<> 129:0ab6a29f35bf 1161 q15_t * pSrc,
<> 129:0ab6a29f35bf 1162 q15_t * pDst,
<> 129:0ab6a29f35bf 1163 uint32_t blockSize);
<> 129:0ab6a29f35bf 1164
<> 129:0ab6a29f35bf 1165 /**
<> 129:0ab6a29f35bf 1166 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 1167 * @param[in] *S points to an instance of the Q15 FIR filter structure.
<> 129:0ab6a29f35bf 1168 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1169 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1170 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1171 * @return none.
<> 129:0ab6a29f35bf 1172 */
<> 129:0ab6a29f35bf 1173 void arm_fir_fast_q15(
<> 129:0ab6a29f35bf 1174 const arm_fir_instance_q15 * S,
<> 129:0ab6a29f35bf 1175 q15_t * pSrc,
<> 129:0ab6a29f35bf 1176 q15_t * pDst,
<> 129:0ab6a29f35bf 1177 uint32_t blockSize);
<> 129:0ab6a29f35bf 1178
<> 129:0ab6a29f35bf 1179 /**
<> 129:0ab6a29f35bf 1180 * @brief Initialization function for the Q15 FIR filter.
<> 129:0ab6a29f35bf 1181 * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
<> 129:0ab6a29f35bf 1182 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
<> 129:0ab6a29f35bf 1183 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1184 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1185 * @param[in] blockSize number of samples that are processed at a time.
<> 129:0ab6a29f35bf 1186 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
<> 129:0ab6a29f35bf 1187 * <code>numTaps</code> is not a supported value.
<> 129:0ab6a29f35bf 1188 */
<> 129:0ab6a29f35bf 1189
<> 129:0ab6a29f35bf 1190 arm_status arm_fir_init_q15(
<> 129:0ab6a29f35bf 1191 arm_fir_instance_q15 * S,
<> 129:0ab6a29f35bf 1192 uint16_t numTaps,
<> 129:0ab6a29f35bf 1193 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 1194 q15_t * pState,
<> 129:0ab6a29f35bf 1195 uint32_t blockSize);
<> 129:0ab6a29f35bf 1196
<> 129:0ab6a29f35bf 1197 /**
<> 129:0ab6a29f35bf 1198 * @brief Processing function for the Q31 FIR filter.
<> 129:0ab6a29f35bf 1199 * @param[in] *S points to an instance of the Q31 FIR filter structure.
<> 129:0ab6a29f35bf 1200 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1201 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1202 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1203 * @return none.
<> 129:0ab6a29f35bf 1204 */
<> 129:0ab6a29f35bf 1205 void arm_fir_q31(
<> 129:0ab6a29f35bf 1206 const arm_fir_instance_q31 * S,
<> 129:0ab6a29f35bf 1207 q31_t * pSrc,
<> 129:0ab6a29f35bf 1208 q31_t * pDst,
<> 129:0ab6a29f35bf 1209 uint32_t blockSize);
<> 129:0ab6a29f35bf 1210
<> 129:0ab6a29f35bf 1211 /**
<> 129:0ab6a29f35bf 1212 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 1213 * @param[in] *S points to an instance of the Q31 FIR structure.
<> 129:0ab6a29f35bf 1214 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1215 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1216 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1217 * @return none.
<> 129:0ab6a29f35bf 1218 */
<> 129:0ab6a29f35bf 1219 void arm_fir_fast_q31(
<> 129:0ab6a29f35bf 1220 const arm_fir_instance_q31 * S,
<> 129:0ab6a29f35bf 1221 q31_t * pSrc,
<> 129:0ab6a29f35bf 1222 q31_t * pDst,
<> 129:0ab6a29f35bf 1223 uint32_t blockSize);
<> 129:0ab6a29f35bf 1224
<> 129:0ab6a29f35bf 1225 /**
<> 129:0ab6a29f35bf 1226 * @brief Initialization function for the Q31 FIR filter.
<> 129:0ab6a29f35bf 1227 * @param[in,out] *S points to an instance of the Q31 FIR structure.
<> 129:0ab6a29f35bf 1228 * @param[in] numTaps Number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 1229 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1230 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1231 * @param[in] blockSize number of samples that are processed at a time.
<> 129:0ab6a29f35bf 1232 * @return none.
<> 129:0ab6a29f35bf 1233 */
<> 129:0ab6a29f35bf 1234 void arm_fir_init_q31(
<> 129:0ab6a29f35bf 1235 arm_fir_instance_q31 * S,
<> 129:0ab6a29f35bf 1236 uint16_t numTaps,
<> 129:0ab6a29f35bf 1237 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 1238 q31_t * pState,
<> 129:0ab6a29f35bf 1239 uint32_t blockSize);
<> 129:0ab6a29f35bf 1240
<> 129:0ab6a29f35bf 1241 /**
<> 129:0ab6a29f35bf 1242 * @brief Processing function for the floating-point FIR filter.
<> 129:0ab6a29f35bf 1243 * @param[in] *S points to an instance of the floating-point FIR structure.
<> 129:0ab6a29f35bf 1244 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1245 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1246 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1247 * @return none.
<> 129:0ab6a29f35bf 1248 */
<> 129:0ab6a29f35bf 1249 void arm_fir_f32(
<> 129:0ab6a29f35bf 1250 const arm_fir_instance_f32 * S,
<> 129:0ab6a29f35bf 1251 float32_t * pSrc,
<> 129:0ab6a29f35bf 1252 float32_t * pDst,
<> 129:0ab6a29f35bf 1253 uint32_t blockSize);
<> 129:0ab6a29f35bf 1254
<> 129:0ab6a29f35bf 1255 /**
<> 129:0ab6a29f35bf 1256 * @brief Initialization function for the floating-point FIR filter.
<> 129:0ab6a29f35bf 1257 * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
<> 129:0ab6a29f35bf 1258 * @param[in] numTaps Number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 1259 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1260 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1261 * @param[in] blockSize number of samples that are processed at a time.
<> 129:0ab6a29f35bf 1262 * @return none.
<> 129:0ab6a29f35bf 1263 */
<> 129:0ab6a29f35bf 1264 void arm_fir_init_f32(
<> 129:0ab6a29f35bf 1265 arm_fir_instance_f32 * S,
<> 129:0ab6a29f35bf 1266 uint16_t numTaps,
<> 129:0ab6a29f35bf 1267 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 1268 float32_t * pState,
<> 129:0ab6a29f35bf 1269 uint32_t blockSize);
<> 129:0ab6a29f35bf 1270
<> 129:0ab6a29f35bf 1271
<> 129:0ab6a29f35bf 1272 /**
<> 129:0ab6a29f35bf 1273 * @brief Instance structure for the Q15 Biquad cascade filter.
<> 129:0ab6a29f35bf 1274 */
<> 129:0ab6a29f35bf 1275 typedef struct
<> 129:0ab6a29f35bf 1276 {
<> 129:0ab6a29f35bf 1277 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 1278 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 129:0ab6a29f35bf 1279 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 1280 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 129:0ab6a29f35bf 1281
<> 129:0ab6a29f35bf 1282 } arm_biquad_casd_df1_inst_q15;
<> 129:0ab6a29f35bf 1283
<> 129:0ab6a29f35bf 1284
<> 129:0ab6a29f35bf 1285 /**
<> 129:0ab6a29f35bf 1286 * @brief Instance structure for the Q31 Biquad cascade filter.
<> 129:0ab6a29f35bf 1287 */
<> 129:0ab6a29f35bf 1288 typedef struct
<> 129:0ab6a29f35bf 1289 {
<> 129:0ab6a29f35bf 1290 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 1291 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 129:0ab6a29f35bf 1292 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 1293 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 129:0ab6a29f35bf 1294
<> 129:0ab6a29f35bf 1295 } arm_biquad_casd_df1_inst_q31;
<> 129:0ab6a29f35bf 1296
<> 129:0ab6a29f35bf 1297 /**
<> 129:0ab6a29f35bf 1298 * @brief Instance structure for the floating-point Biquad cascade filter.
<> 129:0ab6a29f35bf 1299 */
<> 129:0ab6a29f35bf 1300 typedef struct
<> 129:0ab6a29f35bf 1301 {
<> 129:0ab6a29f35bf 1302 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 1303 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 129:0ab6a29f35bf 1304 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 1305
<> 129:0ab6a29f35bf 1306
<> 129:0ab6a29f35bf 1307 } arm_biquad_casd_df1_inst_f32;
<> 129:0ab6a29f35bf 1308
<> 129:0ab6a29f35bf 1309
<> 129:0ab6a29f35bf 1310
<> 129:0ab6a29f35bf 1311 /**
<> 129:0ab6a29f35bf 1312 * @brief Processing function for the Q15 Biquad cascade filter.
<> 129:0ab6a29f35bf 1313 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 129:0ab6a29f35bf 1314 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1315 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1316 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1317 * @return none.
<> 129:0ab6a29f35bf 1318 */
<> 129:0ab6a29f35bf 1319
<> 129:0ab6a29f35bf 1320 void arm_biquad_cascade_df1_q15(
<> 129:0ab6a29f35bf 1321 const arm_biquad_casd_df1_inst_q15 * S,
<> 129:0ab6a29f35bf 1322 q15_t * pSrc,
<> 129:0ab6a29f35bf 1323 q15_t * pDst,
<> 129:0ab6a29f35bf 1324 uint32_t blockSize);
<> 129:0ab6a29f35bf 1325
<> 129:0ab6a29f35bf 1326 /**
<> 129:0ab6a29f35bf 1327 * @brief Initialization function for the Q15 Biquad cascade filter.
<> 129:0ab6a29f35bf 1328 * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure.
<> 129:0ab6a29f35bf 1329 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 1330 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1331 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1332 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 129:0ab6a29f35bf 1333 * @return none
<> 129:0ab6a29f35bf 1334 */
<> 129:0ab6a29f35bf 1335
<> 129:0ab6a29f35bf 1336 void arm_biquad_cascade_df1_init_q15(
<> 129:0ab6a29f35bf 1337 arm_biquad_casd_df1_inst_q15 * S,
<> 129:0ab6a29f35bf 1338 uint8_t numStages,
<> 129:0ab6a29f35bf 1339 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 1340 q15_t * pState,
<> 129:0ab6a29f35bf 1341 int8_t postShift);
<> 129:0ab6a29f35bf 1342
<> 129:0ab6a29f35bf 1343
<> 129:0ab6a29f35bf 1344 /**
<> 129:0ab6a29f35bf 1345 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 1346 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 129:0ab6a29f35bf 1347 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1348 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1349 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1350 * @return none.
<> 129:0ab6a29f35bf 1351 */
<> 129:0ab6a29f35bf 1352
<> 129:0ab6a29f35bf 1353 void arm_biquad_cascade_df1_fast_q15(
<> 129:0ab6a29f35bf 1354 const arm_biquad_casd_df1_inst_q15 * S,
<> 129:0ab6a29f35bf 1355 q15_t * pSrc,
<> 129:0ab6a29f35bf 1356 q15_t * pDst,
<> 129:0ab6a29f35bf 1357 uint32_t blockSize);
<> 129:0ab6a29f35bf 1358
<> 129:0ab6a29f35bf 1359
<> 129:0ab6a29f35bf 1360 /**
<> 129:0ab6a29f35bf 1361 * @brief Processing function for the Q31 Biquad cascade filter
<> 129:0ab6a29f35bf 1362 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 129:0ab6a29f35bf 1363 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1364 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1365 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1366 * @return none.
<> 129:0ab6a29f35bf 1367 */
<> 129:0ab6a29f35bf 1368
<> 129:0ab6a29f35bf 1369 void arm_biquad_cascade_df1_q31(
<> 129:0ab6a29f35bf 1370 const arm_biquad_casd_df1_inst_q31 * S,
<> 129:0ab6a29f35bf 1371 q31_t * pSrc,
<> 129:0ab6a29f35bf 1372 q31_t * pDst,
<> 129:0ab6a29f35bf 1373 uint32_t blockSize);
<> 129:0ab6a29f35bf 1374
<> 129:0ab6a29f35bf 1375 /**
<> 129:0ab6a29f35bf 1376 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 1377 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 129:0ab6a29f35bf 1378 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1379 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1380 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1381 * @return none.
<> 129:0ab6a29f35bf 1382 */
<> 129:0ab6a29f35bf 1383
<> 129:0ab6a29f35bf 1384 void arm_biquad_cascade_df1_fast_q31(
<> 129:0ab6a29f35bf 1385 const arm_biquad_casd_df1_inst_q31 * S,
<> 129:0ab6a29f35bf 1386 q31_t * pSrc,
<> 129:0ab6a29f35bf 1387 q31_t * pDst,
<> 129:0ab6a29f35bf 1388 uint32_t blockSize);
<> 129:0ab6a29f35bf 1389
<> 129:0ab6a29f35bf 1390 /**
<> 129:0ab6a29f35bf 1391 * @brief Initialization function for the Q31 Biquad cascade filter.
<> 129:0ab6a29f35bf 1392 * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure.
<> 129:0ab6a29f35bf 1393 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 1394 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1395 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1396 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 129:0ab6a29f35bf 1397 * @return none
<> 129:0ab6a29f35bf 1398 */
<> 129:0ab6a29f35bf 1399
<> 129:0ab6a29f35bf 1400 void arm_biquad_cascade_df1_init_q31(
<> 129:0ab6a29f35bf 1401 arm_biquad_casd_df1_inst_q31 * S,
<> 129:0ab6a29f35bf 1402 uint8_t numStages,
<> 129:0ab6a29f35bf 1403 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 1404 q31_t * pState,
<> 129:0ab6a29f35bf 1405 int8_t postShift);
<> 129:0ab6a29f35bf 1406
<> 129:0ab6a29f35bf 1407 /**
<> 129:0ab6a29f35bf 1408 * @brief Processing function for the floating-point Biquad cascade filter.
<> 129:0ab6a29f35bf 1409 * @param[in] *S points to an instance of the floating-point Biquad cascade structure.
<> 129:0ab6a29f35bf 1410 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 1411 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 1412 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 1413 * @return none.
<> 129:0ab6a29f35bf 1414 */
<> 129:0ab6a29f35bf 1415
<> 129:0ab6a29f35bf 1416 void arm_biquad_cascade_df1_f32(
<> 129:0ab6a29f35bf 1417 const arm_biquad_casd_df1_inst_f32 * S,
<> 129:0ab6a29f35bf 1418 float32_t * pSrc,
<> 129:0ab6a29f35bf 1419 float32_t * pDst,
<> 129:0ab6a29f35bf 1420 uint32_t blockSize);
<> 129:0ab6a29f35bf 1421
<> 129:0ab6a29f35bf 1422 /**
<> 129:0ab6a29f35bf 1423 * @brief Initialization function for the floating-point Biquad cascade filter.
<> 129:0ab6a29f35bf 1424 * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure.
<> 129:0ab6a29f35bf 1425 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 1426 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 1427 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 1428 * @return none
<> 129:0ab6a29f35bf 1429 */
<> 129:0ab6a29f35bf 1430
<> 129:0ab6a29f35bf 1431 void arm_biquad_cascade_df1_init_f32(
<> 129:0ab6a29f35bf 1432 arm_biquad_casd_df1_inst_f32 * S,
<> 129:0ab6a29f35bf 1433 uint8_t numStages,
<> 129:0ab6a29f35bf 1434 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 1435 float32_t * pState);
<> 129:0ab6a29f35bf 1436
<> 129:0ab6a29f35bf 1437
<> 129:0ab6a29f35bf 1438 /**
<> 129:0ab6a29f35bf 1439 * @brief Instance structure for the floating-point matrix structure.
<> 129:0ab6a29f35bf 1440 */
<> 129:0ab6a29f35bf 1441
<> 129:0ab6a29f35bf 1442 typedef struct
<> 129:0ab6a29f35bf 1443 {
<> 129:0ab6a29f35bf 1444 uint16_t numRows; /**< number of rows of the matrix. */
<> 129:0ab6a29f35bf 1445 uint16_t numCols; /**< number of columns of the matrix. */
<> 129:0ab6a29f35bf 1446 float32_t *pData; /**< points to the data of the matrix. */
<> 129:0ab6a29f35bf 1447 } arm_matrix_instance_f32;
<> 129:0ab6a29f35bf 1448
<> 129:0ab6a29f35bf 1449
<> 129:0ab6a29f35bf 1450 /**
<> 129:0ab6a29f35bf 1451 * @brief Instance structure for the floating-point matrix structure.
<> 129:0ab6a29f35bf 1452 */
<> 129:0ab6a29f35bf 1453
<> 129:0ab6a29f35bf 1454 typedef struct
<> 129:0ab6a29f35bf 1455 {
<> 129:0ab6a29f35bf 1456 uint16_t numRows; /**< number of rows of the matrix. */
<> 129:0ab6a29f35bf 1457 uint16_t numCols; /**< number of columns of the matrix. */
<> 129:0ab6a29f35bf 1458 float64_t *pData; /**< points to the data of the matrix. */
<> 129:0ab6a29f35bf 1459 } arm_matrix_instance_f64;
<> 129:0ab6a29f35bf 1460
<> 129:0ab6a29f35bf 1461 /**
<> 129:0ab6a29f35bf 1462 * @brief Instance structure for the Q15 matrix structure.
<> 129:0ab6a29f35bf 1463 */
<> 129:0ab6a29f35bf 1464
<> 129:0ab6a29f35bf 1465 typedef struct
<> 129:0ab6a29f35bf 1466 {
<> 129:0ab6a29f35bf 1467 uint16_t numRows; /**< number of rows of the matrix. */
<> 129:0ab6a29f35bf 1468 uint16_t numCols; /**< number of columns of the matrix. */
<> 129:0ab6a29f35bf 1469 q15_t *pData; /**< points to the data of the matrix. */
<> 129:0ab6a29f35bf 1470
<> 129:0ab6a29f35bf 1471 } arm_matrix_instance_q15;
<> 129:0ab6a29f35bf 1472
<> 129:0ab6a29f35bf 1473 /**
<> 129:0ab6a29f35bf 1474 * @brief Instance structure for the Q31 matrix structure.
<> 129:0ab6a29f35bf 1475 */
<> 129:0ab6a29f35bf 1476
<> 129:0ab6a29f35bf 1477 typedef struct
<> 129:0ab6a29f35bf 1478 {
<> 129:0ab6a29f35bf 1479 uint16_t numRows; /**< number of rows of the matrix. */
<> 129:0ab6a29f35bf 1480 uint16_t numCols; /**< number of columns of the matrix. */
<> 129:0ab6a29f35bf 1481 q31_t *pData; /**< points to the data of the matrix. */
<> 129:0ab6a29f35bf 1482
<> 129:0ab6a29f35bf 1483 } arm_matrix_instance_q31;
<> 129:0ab6a29f35bf 1484
<> 129:0ab6a29f35bf 1485
<> 129:0ab6a29f35bf 1486
<> 129:0ab6a29f35bf 1487 /**
<> 129:0ab6a29f35bf 1488 * @brief Floating-point matrix addition.
<> 129:0ab6a29f35bf 1489 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1490 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1491 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1492 * @return The function returns either
<> 129:0ab6a29f35bf 1493 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1494 */
<> 129:0ab6a29f35bf 1495
<> 129:0ab6a29f35bf 1496 arm_status arm_mat_add_f32(
<> 129:0ab6a29f35bf 1497 const arm_matrix_instance_f32 * pSrcA,
<> 129:0ab6a29f35bf 1498 const arm_matrix_instance_f32 * pSrcB,
<> 129:0ab6a29f35bf 1499 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1500
<> 129:0ab6a29f35bf 1501 /**
<> 129:0ab6a29f35bf 1502 * @brief Q15 matrix addition.
<> 129:0ab6a29f35bf 1503 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1504 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1505 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1506 * @return The function returns either
<> 129:0ab6a29f35bf 1507 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1508 */
<> 129:0ab6a29f35bf 1509
<> 129:0ab6a29f35bf 1510 arm_status arm_mat_add_q15(
<> 129:0ab6a29f35bf 1511 const arm_matrix_instance_q15 * pSrcA,
<> 129:0ab6a29f35bf 1512 const arm_matrix_instance_q15 * pSrcB,
<> 129:0ab6a29f35bf 1513 arm_matrix_instance_q15 * pDst);
<> 129:0ab6a29f35bf 1514
<> 129:0ab6a29f35bf 1515 /**
<> 129:0ab6a29f35bf 1516 * @brief Q31 matrix addition.
<> 129:0ab6a29f35bf 1517 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1518 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1519 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1520 * @return The function returns either
<> 129:0ab6a29f35bf 1521 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1522 */
<> 129:0ab6a29f35bf 1523
<> 129:0ab6a29f35bf 1524 arm_status arm_mat_add_q31(
<> 129:0ab6a29f35bf 1525 const arm_matrix_instance_q31 * pSrcA,
<> 129:0ab6a29f35bf 1526 const arm_matrix_instance_q31 * pSrcB,
<> 129:0ab6a29f35bf 1527 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1528
<> 129:0ab6a29f35bf 1529 /**
<> 129:0ab6a29f35bf 1530 * @brief Floating-point, complex, matrix multiplication.
<> 129:0ab6a29f35bf 1531 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1532 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1533 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1534 * @return The function returns either
<> 129:0ab6a29f35bf 1535 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1536 */
<> 129:0ab6a29f35bf 1537
<> 129:0ab6a29f35bf 1538 arm_status arm_mat_cmplx_mult_f32(
<> 129:0ab6a29f35bf 1539 const arm_matrix_instance_f32 * pSrcA,
<> 129:0ab6a29f35bf 1540 const arm_matrix_instance_f32 * pSrcB,
<> 129:0ab6a29f35bf 1541 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1542
<> 129:0ab6a29f35bf 1543 /**
<> 129:0ab6a29f35bf 1544 * @brief Q15, complex, matrix multiplication.
<> 129:0ab6a29f35bf 1545 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1546 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1547 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1548 * @return The function returns either
<> 129:0ab6a29f35bf 1549 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1550 */
<> 129:0ab6a29f35bf 1551
<> 129:0ab6a29f35bf 1552 arm_status arm_mat_cmplx_mult_q15(
<> 129:0ab6a29f35bf 1553 const arm_matrix_instance_q15 * pSrcA,
<> 129:0ab6a29f35bf 1554 const arm_matrix_instance_q15 * pSrcB,
<> 129:0ab6a29f35bf 1555 arm_matrix_instance_q15 * pDst,
<> 129:0ab6a29f35bf 1556 q15_t * pScratch);
<> 129:0ab6a29f35bf 1557
<> 129:0ab6a29f35bf 1558 /**
<> 129:0ab6a29f35bf 1559 * @brief Q31, complex, matrix multiplication.
<> 129:0ab6a29f35bf 1560 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1561 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1562 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1563 * @return The function returns either
<> 129:0ab6a29f35bf 1564 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1565 */
<> 129:0ab6a29f35bf 1566
<> 129:0ab6a29f35bf 1567 arm_status arm_mat_cmplx_mult_q31(
<> 129:0ab6a29f35bf 1568 const arm_matrix_instance_q31 * pSrcA,
<> 129:0ab6a29f35bf 1569 const arm_matrix_instance_q31 * pSrcB,
<> 129:0ab6a29f35bf 1570 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1571
<> 129:0ab6a29f35bf 1572
<> 129:0ab6a29f35bf 1573 /**
<> 129:0ab6a29f35bf 1574 * @brief Floating-point matrix transpose.
<> 129:0ab6a29f35bf 1575 * @param[in] *pSrc points to the input matrix
<> 129:0ab6a29f35bf 1576 * @param[out] *pDst points to the output matrix
<> 129:0ab6a29f35bf 1577 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 129:0ab6a29f35bf 1578 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1579 */
<> 129:0ab6a29f35bf 1580
<> 129:0ab6a29f35bf 1581 arm_status arm_mat_trans_f32(
<> 129:0ab6a29f35bf 1582 const arm_matrix_instance_f32 * pSrc,
<> 129:0ab6a29f35bf 1583 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1584
<> 129:0ab6a29f35bf 1585
<> 129:0ab6a29f35bf 1586 /**
<> 129:0ab6a29f35bf 1587 * @brief Q15 matrix transpose.
<> 129:0ab6a29f35bf 1588 * @param[in] *pSrc points to the input matrix
<> 129:0ab6a29f35bf 1589 * @param[out] *pDst points to the output matrix
<> 129:0ab6a29f35bf 1590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 129:0ab6a29f35bf 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1592 */
<> 129:0ab6a29f35bf 1593
<> 129:0ab6a29f35bf 1594 arm_status arm_mat_trans_q15(
<> 129:0ab6a29f35bf 1595 const arm_matrix_instance_q15 * pSrc,
<> 129:0ab6a29f35bf 1596 arm_matrix_instance_q15 * pDst);
<> 129:0ab6a29f35bf 1597
<> 129:0ab6a29f35bf 1598 /**
<> 129:0ab6a29f35bf 1599 * @brief Q31 matrix transpose.
<> 129:0ab6a29f35bf 1600 * @param[in] *pSrc points to the input matrix
<> 129:0ab6a29f35bf 1601 * @param[out] *pDst points to the output matrix
<> 129:0ab6a29f35bf 1602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 129:0ab6a29f35bf 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1604 */
<> 129:0ab6a29f35bf 1605
<> 129:0ab6a29f35bf 1606 arm_status arm_mat_trans_q31(
<> 129:0ab6a29f35bf 1607 const arm_matrix_instance_q31 * pSrc,
<> 129:0ab6a29f35bf 1608 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1609
<> 129:0ab6a29f35bf 1610
<> 129:0ab6a29f35bf 1611 /**
<> 129:0ab6a29f35bf 1612 * @brief Floating-point matrix multiplication
<> 129:0ab6a29f35bf 1613 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1614 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1615 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1616 * @return The function returns either
<> 129:0ab6a29f35bf 1617 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1618 */
<> 129:0ab6a29f35bf 1619
<> 129:0ab6a29f35bf 1620 arm_status arm_mat_mult_f32(
<> 129:0ab6a29f35bf 1621 const arm_matrix_instance_f32 * pSrcA,
<> 129:0ab6a29f35bf 1622 const arm_matrix_instance_f32 * pSrcB,
<> 129:0ab6a29f35bf 1623 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1624
<> 129:0ab6a29f35bf 1625 /**
<> 129:0ab6a29f35bf 1626 * @brief Q15 matrix multiplication
<> 129:0ab6a29f35bf 1627 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1628 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1629 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1630 * @param[in] *pState points to the array for storing intermediate results
<> 129:0ab6a29f35bf 1631 * @return The function returns either
<> 129:0ab6a29f35bf 1632 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1633 */
<> 129:0ab6a29f35bf 1634
<> 129:0ab6a29f35bf 1635 arm_status arm_mat_mult_q15(
<> 129:0ab6a29f35bf 1636 const arm_matrix_instance_q15 * pSrcA,
<> 129:0ab6a29f35bf 1637 const arm_matrix_instance_q15 * pSrcB,
<> 129:0ab6a29f35bf 1638 arm_matrix_instance_q15 * pDst,
<> 129:0ab6a29f35bf 1639 q15_t * pState);
<> 129:0ab6a29f35bf 1640
<> 129:0ab6a29f35bf 1641 /**
<> 129:0ab6a29f35bf 1642 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 1643 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1644 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1645 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1646 * @param[in] *pState points to the array for storing intermediate results
<> 129:0ab6a29f35bf 1647 * @return The function returns either
<> 129:0ab6a29f35bf 1648 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1649 */
<> 129:0ab6a29f35bf 1650
<> 129:0ab6a29f35bf 1651 arm_status arm_mat_mult_fast_q15(
<> 129:0ab6a29f35bf 1652 const arm_matrix_instance_q15 * pSrcA,
<> 129:0ab6a29f35bf 1653 const arm_matrix_instance_q15 * pSrcB,
<> 129:0ab6a29f35bf 1654 arm_matrix_instance_q15 * pDst,
<> 129:0ab6a29f35bf 1655 q15_t * pState);
<> 129:0ab6a29f35bf 1656
<> 129:0ab6a29f35bf 1657 /**
<> 129:0ab6a29f35bf 1658 * @brief Q31 matrix multiplication
<> 129:0ab6a29f35bf 1659 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1660 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1661 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1662 * @return The function returns either
<> 129:0ab6a29f35bf 1663 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1664 */
<> 129:0ab6a29f35bf 1665
<> 129:0ab6a29f35bf 1666 arm_status arm_mat_mult_q31(
<> 129:0ab6a29f35bf 1667 const arm_matrix_instance_q31 * pSrcA,
<> 129:0ab6a29f35bf 1668 const arm_matrix_instance_q31 * pSrcB,
<> 129:0ab6a29f35bf 1669 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1670
<> 129:0ab6a29f35bf 1671 /**
<> 129:0ab6a29f35bf 1672 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 1673 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1674 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1675 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1676 * @return The function returns either
<> 129:0ab6a29f35bf 1677 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1678 */
<> 129:0ab6a29f35bf 1679
<> 129:0ab6a29f35bf 1680 arm_status arm_mat_mult_fast_q31(
<> 129:0ab6a29f35bf 1681 const arm_matrix_instance_q31 * pSrcA,
<> 129:0ab6a29f35bf 1682 const arm_matrix_instance_q31 * pSrcB,
<> 129:0ab6a29f35bf 1683 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1684
<> 129:0ab6a29f35bf 1685
<> 129:0ab6a29f35bf 1686 /**
<> 129:0ab6a29f35bf 1687 * @brief Floating-point matrix subtraction
<> 129:0ab6a29f35bf 1688 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1689 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1690 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1691 * @return The function returns either
<> 129:0ab6a29f35bf 1692 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1693 */
<> 129:0ab6a29f35bf 1694
<> 129:0ab6a29f35bf 1695 arm_status arm_mat_sub_f32(
<> 129:0ab6a29f35bf 1696 const arm_matrix_instance_f32 * pSrcA,
<> 129:0ab6a29f35bf 1697 const arm_matrix_instance_f32 * pSrcB,
<> 129:0ab6a29f35bf 1698 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1699
<> 129:0ab6a29f35bf 1700 /**
<> 129:0ab6a29f35bf 1701 * @brief Q15 matrix subtraction
<> 129:0ab6a29f35bf 1702 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1703 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1704 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1705 * @return The function returns either
<> 129:0ab6a29f35bf 1706 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1707 */
<> 129:0ab6a29f35bf 1708
<> 129:0ab6a29f35bf 1709 arm_status arm_mat_sub_q15(
<> 129:0ab6a29f35bf 1710 const arm_matrix_instance_q15 * pSrcA,
<> 129:0ab6a29f35bf 1711 const arm_matrix_instance_q15 * pSrcB,
<> 129:0ab6a29f35bf 1712 arm_matrix_instance_q15 * pDst);
<> 129:0ab6a29f35bf 1713
<> 129:0ab6a29f35bf 1714 /**
<> 129:0ab6a29f35bf 1715 * @brief Q31 matrix subtraction
<> 129:0ab6a29f35bf 1716 * @param[in] *pSrcA points to the first input matrix structure
<> 129:0ab6a29f35bf 1717 * @param[in] *pSrcB points to the second input matrix structure
<> 129:0ab6a29f35bf 1718 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1719 * @return The function returns either
<> 129:0ab6a29f35bf 1720 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1721 */
<> 129:0ab6a29f35bf 1722
<> 129:0ab6a29f35bf 1723 arm_status arm_mat_sub_q31(
<> 129:0ab6a29f35bf 1724 const arm_matrix_instance_q31 * pSrcA,
<> 129:0ab6a29f35bf 1725 const arm_matrix_instance_q31 * pSrcB,
<> 129:0ab6a29f35bf 1726 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1727
<> 129:0ab6a29f35bf 1728 /**
<> 129:0ab6a29f35bf 1729 * @brief Floating-point matrix scaling.
<> 129:0ab6a29f35bf 1730 * @param[in] *pSrc points to the input matrix
<> 129:0ab6a29f35bf 1731 * @param[in] scale scale factor
<> 129:0ab6a29f35bf 1732 * @param[out] *pDst points to the output matrix
<> 129:0ab6a29f35bf 1733 * @return The function returns either
<> 129:0ab6a29f35bf 1734 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1735 */
<> 129:0ab6a29f35bf 1736
<> 129:0ab6a29f35bf 1737 arm_status arm_mat_scale_f32(
<> 129:0ab6a29f35bf 1738 const arm_matrix_instance_f32 * pSrc,
<> 129:0ab6a29f35bf 1739 float32_t scale,
<> 129:0ab6a29f35bf 1740 arm_matrix_instance_f32 * pDst);
<> 129:0ab6a29f35bf 1741
<> 129:0ab6a29f35bf 1742 /**
<> 129:0ab6a29f35bf 1743 * @brief Q15 matrix scaling.
<> 129:0ab6a29f35bf 1744 * @param[in] *pSrc points to input matrix
<> 129:0ab6a29f35bf 1745 * @param[in] scaleFract fractional portion of the scale factor
<> 129:0ab6a29f35bf 1746 * @param[in] shift number of bits to shift the result by
<> 129:0ab6a29f35bf 1747 * @param[out] *pDst points to output matrix
<> 129:0ab6a29f35bf 1748 * @return The function returns either
<> 129:0ab6a29f35bf 1749 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1750 */
<> 129:0ab6a29f35bf 1751
<> 129:0ab6a29f35bf 1752 arm_status arm_mat_scale_q15(
<> 129:0ab6a29f35bf 1753 const arm_matrix_instance_q15 * pSrc,
<> 129:0ab6a29f35bf 1754 q15_t scaleFract,
<> 129:0ab6a29f35bf 1755 int32_t shift,
<> 129:0ab6a29f35bf 1756 arm_matrix_instance_q15 * pDst);
<> 129:0ab6a29f35bf 1757
<> 129:0ab6a29f35bf 1758 /**
<> 129:0ab6a29f35bf 1759 * @brief Q31 matrix scaling.
<> 129:0ab6a29f35bf 1760 * @param[in] *pSrc points to input matrix
<> 129:0ab6a29f35bf 1761 * @param[in] scaleFract fractional portion of the scale factor
<> 129:0ab6a29f35bf 1762 * @param[in] shift number of bits to shift the result by
<> 129:0ab6a29f35bf 1763 * @param[out] *pDst points to output matrix structure
<> 129:0ab6a29f35bf 1764 * @return The function returns either
<> 129:0ab6a29f35bf 1765 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 129:0ab6a29f35bf 1766 */
<> 129:0ab6a29f35bf 1767
<> 129:0ab6a29f35bf 1768 arm_status arm_mat_scale_q31(
<> 129:0ab6a29f35bf 1769 const arm_matrix_instance_q31 * pSrc,
<> 129:0ab6a29f35bf 1770 q31_t scaleFract,
<> 129:0ab6a29f35bf 1771 int32_t shift,
<> 129:0ab6a29f35bf 1772 arm_matrix_instance_q31 * pDst);
<> 129:0ab6a29f35bf 1773
<> 129:0ab6a29f35bf 1774
<> 129:0ab6a29f35bf 1775 /**
<> 129:0ab6a29f35bf 1776 * @brief Q31 matrix initialization.
<> 129:0ab6a29f35bf 1777 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 129:0ab6a29f35bf 1778 * @param[in] nRows number of rows in the matrix.
<> 129:0ab6a29f35bf 1779 * @param[in] nColumns number of columns in the matrix.
<> 129:0ab6a29f35bf 1780 * @param[in] *pData points to the matrix data array.
<> 129:0ab6a29f35bf 1781 * @return none
<> 129:0ab6a29f35bf 1782 */
<> 129:0ab6a29f35bf 1783
<> 129:0ab6a29f35bf 1784 void arm_mat_init_q31(
<> 129:0ab6a29f35bf 1785 arm_matrix_instance_q31 * S,
<> 129:0ab6a29f35bf 1786 uint16_t nRows,
<> 129:0ab6a29f35bf 1787 uint16_t nColumns,
<> 129:0ab6a29f35bf 1788 q31_t * pData);
<> 129:0ab6a29f35bf 1789
<> 129:0ab6a29f35bf 1790 /**
<> 129:0ab6a29f35bf 1791 * @brief Q15 matrix initialization.
<> 129:0ab6a29f35bf 1792 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 129:0ab6a29f35bf 1793 * @param[in] nRows number of rows in the matrix.
<> 129:0ab6a29f35bf 1794 * @param[in] nColumns number of columns in the matrix.
<> 129:0ab6a29f35bf 1795 * @param[in] *pData points to the matrix data array.
<> 129:0ab6a29f35bf 1796 * @return none
<> 129:0ab6a29f35bf 1797 */
<> 129:0ab6a29f35bf 1798
<> 129:0ab6a29f35bf 1799 void arm_mat_init_q15(
<> 129:0ab6a29f35bf 1800 arm_matrix_instance_q15 * S,
<> 129:0ab6a29f35bf 1801 uint16_t nRows,
<> 129:0ab6a29f35bf 1802 uint16_t nColumns,
<> 129:0ab6a29f35bf 1803 q15_t * pData);
<> 129:0ab6a29f35bf 1804
<> 129:0ab6a29f35bf 1805 /**
<> 129:0ab6a29f35bf 1806 * @brief Floating-point matrix initialization.
<> 129:0ab6a29f35bf 1807 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 129:0ab6a29f35bf 1808 * @param[in] nRows number of rows in the matrix.
<> 129:0ab6a29f35bf 1809 * @param[in] nColumns number of columns in the matrix.
<> 129:0ab6a29f35bf 1810 * @param[in] *pData points to the matrix data array.
<> 129:0ab6a29f35bf 1811 * @return none
<> 129:0ab6a29f35bf 1812 */
<> 129:0ab6a29f35bf 1813
<> 129:0ab6a29f35bf 1814 void arm_mat_init_f32(
<> 129:0ab6a29f35bf 1815 arm_matrix_instance_f32 * S,
<> 129:0ab6a29f35bf 1816 uint16_t nRows,
<> 129:0ab6a29f35bf 1817 uint16_t nColumns,
<> 129:0ab6a29f35bf 1818 float32_t * pData);
<> 129:0ab6a29f35bf 1819
<> 129:0ab6a29f35bf 1820
<> 129:0ab6a29f35bf 1821
<> 129:0ab6a29f35bf 1822 /**
<> 129:0ab6a29f35bf 1823 * @brief Instance structure for the Q15 PID Control.
<> 129:0ab6a29f35bf 1824 */
<> 129:0ab6a29f35bf 1825 typedef struct
<> 129:0ab6a29f35bf 1826 {
<> 129:0ab6a29f35bf 1827 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 129:0ab6a29f35bf 1828 #ifdef ARM_MATH_CM0_FAMILY
<> 129:0ab6a29f35bf 1829 q15_t A1;
<> 129:0ab6a29f35bf 1830 q15_t A2;
<> 129:0ab6a29f35bf 1831 #else
<> 129:0ab6a29f35bf 1832 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
<> 129:0ab6a29f35bf 1833 #endif
<> 129:0ab6a29f35bf 1834 q15_t state[3]; /**< The state array of length 3. */
<> 129:0ab6a29f35bf 1835 q15_t Kp; /**< The proportional gain. */
<> 129:0ab6a29f35bf 1836 q15_t Ki; /**< The integral gain. */
<> 129:0ab6a29f35bf 1837 q15_t Kd; /**< The derivative gain. */
<> 129:0ab6a29f35bf 1838 } arm_pid_instance_q15;
<> 129:0ab6a29f35bf 1839
<> 129:0ab6a29f35bf 1840 /**
<> 129:0ab6a29f35bf 1841 * @brief Instance structure for the Q31 PID Control.
<> 129:0ab6a29f35bf 1842 */
<> 129:0ab6a29f35bf 1843 typedef struct
<> 129:0ab6a29f35bf 1844 {
<> 129:0ab6a29f35bf 1845 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 129:0ab6a29f35bf 1846 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 129:0ab6a29f35bf 1847 q31_t A2; /**< The derived gain, A2 = Kd . */
<> 129:0ab6a29f35bf 1848 q31_t state[3]; /**< The state array of length 3. */
<> 129:0ab6a29f35bf 1849 q31_t Kp; /**< The proportional gain. */
<> 129:0ab6a29f35bf 1850 q31_t Ki; /**< The integral gain. */
<> 129:0ab6a29f35bf 1851 q31_t Kd; /**< The derivative gain. */
<> 129:0ab6a29f35bf 1852
<> 129:0ab6a29f35bf 1853 } arm_pid_instance_q31;
<> 129:0ab6a29f35bf 1854
<> 129:0ab6a29f35bf 1855 /**
<> 129:0ab6a29f35bf 1856 * @brief Instance structure for the floating-point PID Control.
<> 129:0ab6a29f35bf 1857 */
<> 129:0ab6a29f35bf 1858 typedef struct
<> 129:0ab6a29f35bf 1859 {
<> 129:0ab6a29f35bf 1860 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 129:0ab6a29f35bf 1861 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 129:0ab6a29f35bf 1862 float32_t A2; /**< The derived gain, A2 = Kd . */
<> 129:0ab6a29f35bf 1863 float32_t state[3]; /**< The state array of length 3. */
<> 129:0ab6a29f35bf 1864 float32_t Kp; /**< The proportional gain. */
<> 129:0ab6a29f35bf 1865 float32_t Ki; /**< The integral gain. */
<> 129:0ab6a29f35bf 1866 float32_t Kd; /**< The derivative gain. */
<> 129:0ab6a29f35bf 1867 } arm_pid_instance_f32;
<> 129:0ab6a29f35bf 1868
<> 129:0ab6a29f35bf 1869
<> 129:0ab6a29f35bf 1870
<> 129:0ab6a29f35bf 1871 /**
<> 129:0ab6a29f35bf 1872 * @brief Initialization function for the floating-point PID Control.
<> 129:0ab6a29f35bf 1873 * @param[in,out] *S points to an instance of the PID structure.
<> 129:0ab6a29f35bf 1874 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 129:0ab6a29f35bf 1875 * @return none.
<> 129:0ab6a29f35bf 1876 */
<> 129:0ab6a29f35bf 1877 void arm_pid_init_f32(
<> 129:0ab6a29f35bf 1878 arm_pid_instance_f32 * S,
<> 129:0ab6a29f35bf 1879 int32_t resetStateFlag);
<> 129:0ab6a29f35bf 1880
<> 129:0ab6a29f35bf 1881 /**
<> 129:0ab6a29f35bf 1882 * @brief Reset function for the floating-point PID Control.
<> 129:0ab6a29f35bf 1883 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 129:0ab6a29f35bf 1884 * @return none
<> 129:0ab6a29f35bf 1885 */
<> 129:0ab6a29f35bf 1886 void arm_pid_reset_f32(
<> 129:0ab6a29f35bf 1887 arm_pid_instance_f32 * S);
<> 129:0ab6a29f35bf 1888
<> 129:0ab6a29f35bf 1889
<> 129:0ab6a29f35bf 1890 /**
<> 129:0ab6a29f35bf 1891 * @brief Initialization function for the Q31 PID Control.
<> 129:0ab6a29f35bf 1892 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 129:0ab6a29f35bf 1893 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 129:0ab6a29f35bf 1894 * @return none.
<> 129:0ab6a29f35bf 1895 */
<> 129:0ab6a29f35bf 1896 void arm_pid_init_q31(
<> 129:0ab6a29f35bf 1897 arm_pid_instance_q31 * S,
<> 129:0ab6a29f35bf 1898 int32_t resetStateFlag);
<> 129:0ab6a29f35bf 1899
<> 129:0ab6a29f35bf 1900
<> 129:0ab6a29f35bf 1901 /**
<> 129:0ab6a29f35bf 1902 * @brief Reset function for the Q31 PID Control.
<> 129:0ab6a29f35bf 1903 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 129:0ab6a29f35bf 1904 * @return none
<> 129:0ab6a29f35bf 1905 */
<> 129:0ab6a29f35bf 1906
<> 129:0ab6a29f35bf 1907 void arm_pid_reset_q31(
<> 129:0ab6a29f35bf 1908 arm_pid_instance_q31 * S);
<> 129:0ab6a29f35bf 1909
<> 129:0ab6a29f35bf 1910 /**
<> 129:0ab6a29f35bf 1911 * @brief Initialization function for the Q15 PID Control.
<> 129:0ab6a29f35bf 1912 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 129:0ab6a29f35bf 1913 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 129:0ab6a29f35bf 1914 * @return none.
<> 129:0ab6a29f35bf 1915 */
<> 129:0ab6a29f35bf 1916 void arm_pid_init_q15(
<> 129:0ab6a29f35bf 1917 arm_pid_instance_q15 * S,
<> 129:0ab6a29f35bf 1918 int32_t resetStateFlag);
<> 129:0ab6a29f35bf 1919
<> 129:0ab6a29f35bf 1920 /**
<> 129:0ab6a29f35bf 1921 * @brief Reset function for the Q15 PID Control.
<> 129:0ab6a29f35bf 1922 * @param[in,out] *S points to an instance of the q15 PID Control structure
<> 129:0ab6a29f35bf 1923 * @return none
<> 129:0ab6a29f35bf 1924 */
<> 129:0ab6a29f35bf 1925 void arm_pid_reset_q15(
<> 129:0ab6a29f35bf 1926 arm_pid_instance_q15 * S);
<> 129:0ab6a29f35bf 1927
<> 129:0ab6a29f35bf 1928
<> 129:0ab6a29f35bf 1929 /**
<> 129:0ab6a29f35bf 1930 * @brief Instance structure for the floating-point Linear Interpolate function.
<> 129:0ab6a29f35bf 1931 */
<> 129:0ab6a29f35bf 1932 typedef struct
<> 129:0ab6a29f35bf 1933 {
<> 129:0ab6a29f35bf 1934 uint32_t nValues; /**< nValues */
<> 129:0ab6a29f35bf 1935 float32_t x1; /**< x1 */
<> 129:0ab6a29f35bf 1936 float32_t xSpacing; /**< xSpacing */
<> 129:0ab6a29f35bf 1937 float32_t *pYData; /**< pointer to the table of Y values */
<> 129:0ab6a29f35bf 1938 } arm_linear_interp_instance_f32;
<> 129:0ab6a29f35bf 1939
<> 129:0ab6a29f35bf 1940 /**
<> 129:0ab6a29f35bf 1941 * @brief Instance structure for the floating-point bilinear interpolation function.
<> 129:0ab6a29f35bf 1942 */
<> 129:0ab6a29f35bf 1943
<> 129:0ab6a29f35bf 1944 typedef struct
<> 129:0ab6a29f35bf 1945 {
<> 129:0ab6a29f35bf 1946 uint16_t numRows; /**< number of rows in the data table. */
<> 129:0ab6a29f35bf 1947 uint16_t numCols; /**< number of columns in the data table. */
<> 129:0ab6a29f35bf 1948 float32_t *pData; /**< points to the data table. */
<> 129:0ab6a29f35bf 1949 } arm_bilinear_interp_instance_f32;
<> 129:0ab6a29f35bf 1950
<> 129:0ab6a29f35bf 1951 /**
<> 129:0ab6a29f35bf 1952 * @brief Instance structure for the Q31 bilinear interpolation function.
<> 129:0ab6a29f35bf 1953 */
<> 129:0ab6a29f35bf 1954
<> 129:0ab6a29f35bf 1955 typedef struct
<> 129:0ab6a29f35bf 1956 {
<> 129:0ab6a29f35bf 1957 uint16_t numRows; /**< number of rows in the data table. */
<> 129:0ab6a29f35bf 1958 uint16_t numCols; /**< number of columns in the data table. */
<> 129:0ab6a29f35bf 1959 q31_t *pData; /**< points to the data table. */
<> 129:0ab6a29f35bf 1960 } arm_bilinear_interp_instance_q31;
<> 129:0ab6a29f35bf 1961
<> 129:0ab6a29f35bf 1962 /**
<> 129:0ab6a29f35bf 1963 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 129:0ab6a29f35bf 1964 */
<> 129:0ab6a29f35bf 1965
<> 129:0ab6a29f35bf 1966 typedef struct
<> 129:0ab6a29f35bf 1967 {
<> 129:0ab6a29f35bf 1968 uint16_t numRows; /**< number of rows in the data table. */
<> 129:0ab6a29f35bf 1969 uint16_t numCols; /**< number of columns in the data table. */
<> 129:0ab6a29f35bf 1970 q15_t *pData; /**< points to the data table. */
<> 129:0ab6a29f35bf 1971 } arm_bilinear_interp_instance_q15;
<> 129:0ab6a29f35bf 1972
<> 129:0ab6a29f35bf 1973 /**
<> 129:0ab6a29f35bf 1974 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 129:0ab6a29f35bf 1975 */
<> 129:0ab6a29f35bf 1976
<> 129:0ab6a29f35bf 1977 typedef struct
<> 129:0ab6a29f35bf 1978 {
<> 129:0ab6a29f35bf 1979 uint16_t numRows; /**< number of rows in the data table. */
<> 129:0ab6a29f35bf 1980 uint16_t numCols; /**< number of columns in the data table. */
<> 129:0ab6a29f35bf 1981 q7_t *pData; /**< points to the data table. */
<> 129:0ab6a29f35bf 1982 } arm_bilinear_interp_instance_q7;
<> 129:0ab6a29f35bf 1983
<> 129:0ab6a29f35bf 1984
<> 129:0ab6a29f35bf 1985 /**
<> 129:0ab6a29f35bf 1986 * @brief Q7 vector multiplication.
<> 129:0ab6a29f35bf 1987 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 1988 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 1989 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 1990 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 1991 * @return none.
<> 129:0ab6a29f35bf 1992 */
<> 129:0ab6a29f35bf 1993
<> 129:0ab6a29f35bf 1994 void arm_mult_q7(
<> 129:0ab6a29f35bf 1995 q7_t * pSrcA,
<> 129:0ab6a29f35bf 1996 q7_t * pSrcB,
<> 129:0ab6a29f35bf 1997 q7_t * pDst,
<> 129:0ab6a29f35bf 1998 uint32_t blockSize);
<> 129:0ab6a29f35bf 1999
<> 129:0ab6a29f35bf 2000 /**
<> 129:0ab6a29f35bf 2001 * @brief Q15 vector multiplication.
<> 129:0ab6a29f35bf 2002 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2003 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2004 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2005 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2006 * @return none.
<> 129:0ab6a29f35bf 2007 */
<> 129:0ab6a29f35bf 2008
<> 129:0ab6a29f35bf 2009 void arm_mult_q15(
<> 129:0ab6a29f35bf 2010 q15_t * pSrcA,
<> 129:0ab6a29f35bf 2011 q15_t * pSrcB,
<> 129:0ab6a29f35bf 2012 q15_t * pDst,
<> 129:0ab6a29f35bf 2013 uint32_t blockSize);
<> 129:0ab6a29f35bf 2014
<> 129:0ab6a29f35bf 2015 /**
<> 129:0ab6a29f35bf 2016 * @brief Q31 vector multiplication.
<> 129:0ab6a29f35bf 2017 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2018 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2019 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2020 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2021 * @return none.
<> 129:0ab6a29f35bf 2022 */
<> 129:0ab6a29f35bf 2023
<> 129:0ab6a29f35bf 2024 void arm_mult_q31(
<> 129:0ab6a29f35bf 2025 q31_t * pSrcA,
<> 129:0ab6a29f35bf 2026 q31_t * pSrcB,
<> 129:0ab6a29f35bf 2027 q31_t * pDst,
<> 129:0ab6a29f35bf 2028 uint32_t blockSize);
<> 129:0ab6a29f35bf 2029
<> 129:0ab6a29f35bf 2030 /**
<> 129:0ab6a29f35bf 2031 * @brief Floating-point vector multiplication.
<> 129:0ab6a29f35bf 2032 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2033 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2034 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2035 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2036 * @return none.
<> 129:0ab6a29f35bf 2037 */
<> 129:0ab6a29f35bf 2038
<> 129:0ab6a29f35bf 2039 void arm_mult_f32(
<> 129:0ab6a29f35bf 2040 float32_t * pSrcA,
<> 129:0ab6a29f35bf 2041 float32_t * pSrcB,
<> 129:0ab6a29f35bf 2042 float32_t * pDst,
<> 129:0ab6a29f35bf 2043 uint32_t blockSize);
<> 129:0ab6a29f35bf 2044
<> 129:0ab6a29f35bf 2045
<> 129:0ab6a29f35bf 2046
<> 129:0ab6a29f35bf 2047
<> 129:0ab6a29f35bf 2048
<> 129:0ab6a29f35bf 2049
<> 129:0ab6a29f35bf 2050 /**
<> 129:0ab6a29f35bf 2051 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2052 */
<> 129:0ab6a29f35bf 2053
<> 129:0ab6a29f35bf 2054 typedef struct
<> 129:0ab6a29f35bf 2055 {
<> 129:0ab6a29f35bf 2056 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2057 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2058 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2059 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
<> 129:0ab6a29f35bf 2060 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2061 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2062 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2063 } arm_cfft_radix2_instance_q15;
<> 129:0ab6a29f35bf 2064
<> 129:0ab6a29f35bf 2065 /* Deprecated */
<> 129:0ab6a29f35bf 2066 arm_status arm_cfft_radix2_init_q15(
<> 129:0ab6a29f35bf 2067 arm_cfft_radix2_instance_q15 * S,
<> 129:0ab6a29f35bf 2068 uint16_t fftLen,
<> 129:0ab6a29f35bf 2069 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2070 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2071
<> 129:0ab6a29f35bf 2072 /* Deprecated */
<> 129:0ab6a29f35bf 2073 void arm_cfft_radix2_q15(
<> 129:0ab6a29f35bf 2074 const arm_cfft_radix2_instance_q15 * S,
<> 129:0ab6a29f35bf 2075 q15_t * pSrc);
<> 129:0ab6a29f35bf 2076
<> 129:0ab6a29f35bf 2077
<> 129:0ab6a29f35bf 2078
<> 129:0ab6a29f35bf 2079 /**
<> 129:0ab6a29f35bf 2080 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2081 */
<> 129:0ab6a29f35bf 2082
<> 129:0ab6a29f35bf 2083 typedef struct
<> 129:0ab6a29f35bf 2084 {
<> 129:0ab6a29f35bf 2085 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2086 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2087 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2088 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 129:0ab6a29f35bf 2089 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2090 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2091 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2092 } arm_cfft_radix4_instance_q15;
<> 129:0ab6a29f35bf 2093
<> 129:0ab6a29f35bf 2094 /* Deprecated */
<> 129:0ab6a29f35bf 2095 arm_status arm_cfft_radix4_init_q15(
<> 129:0ab6a29f35bf 2096 arm_cfft_radix4_instance_q15 * S,
<> 129:0ab6a29f35bf 2097 uint16_t fftLen,
<> 129:0ab6a29f35bf 2098 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2099 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2100
<> 129:0ab6a29f35bf 2101 /* Deprecated */
<> 129:0ab6a29f35bf 2102 void arm_cfft_radix4_q15(
<> 129:0ab6a29f35bf 2103 const arm_cfft_radix4_instance_q15 * S,
<> 129:0ab6a29f35bf 2104 q15_t * pSrc);
<> 129:0ab6a29f35bf 2105
<> 129:0ab6a29f35bf 2106 /**
<> 129:0ab6a29f35bf 2107 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2108 */
<> 129:0ab6a29f35bf 2109
<> 129:0ab6a29f35bf 2110 typedef struct
<> 129:0ab6a29f35bf 2111 {
<> 129:0ab6a29f35bf 2112 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2113 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2114 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2115 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2116 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2117 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2118 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2119 } arm_cfft_radix2_instance_q31;
<> 129:0ab6a29f35bf 2120
<> 129:0ab6a29f35bf 2121 /* Deprecated */
<> 129:0ab6a29f35bf 2122 arm_status arm_cfft_radix2_init_q31(
<> 129:0ab6a29f35bf 2123 arm_cfft_radix2_instance_q31 * S,
<> 129:0ab6a29f35bf 2124 uint16_t fftLen,
<> 129:0ab6a29f35bf 2125 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2126 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2127
<> 129:0ab6a29f35bf 2128 /* Deprecated */
<> 129:0ab6a29f35bf 2129 void arm_cfft_radix2_q31(
<> 129:0ab6a29f35bf 2130 const arm_cfft_radix2_instance_q31 * S,
<> 129:0ab6a29f35bf 2131 q31_t * pSrc);
<> 129:0ab6a29f35bf 2132
<> 129:0ab6a29f35bf 2133 /**
<> 129:0ab6a29f35bf 2134 * @brief Instance structure for the Q31 CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2135 */
<> 129:0ab6a29f35bf 2136
<> 129:0ab6a29f35bf 2137 typedef struct
<> 129:0ab6a29f35bf 2138 {
<> 129:0ab6a29f35bf 2139 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2140 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2141 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2142 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 129:0ab6a29f35bf 2143 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2144 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2145 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2146 } arm_cfft_radix4_instance_q31;
<> 129:0ab6a29f35bf 2147
<> 129:0ab6a29f35bf 2148 /* Deprecated */
<> 129:0ab6a29f35bf 2149 void arm_cfft_radix4_q31(
<> 129:0ab6a29f35bf 2150 const arm_cfft_radix4_instance_q31 * S,
<> 129:0ab6a29f35bf 2151 q31_t * pSrc);
<> 129:0ab6a29f35bf 2152
<> 129:0ab6a29f35bf 2153 /* Deprecated */
<> 129:0ab6a29f35bf 2154 arm_status arm_cfft_radix4_init_q31(
<> 129:0ab6a29f35bf 2155 arm_cfft_radix4_instance_q31 * S,
<> 129:0ab6a29f35bf 2156 uint16_t fftLen,
<> 129:0ab6a29f35bf 2157 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2158 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2159
<> 129:0ab6a29f35bf 2160 /**
<> 129:0ab6a29f35bf 2161 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2162 */
<> 129:0ab6a29f35bf 2163
<> 129:0ab6a29f35bf 2164 typedef struct
<> 129:0ab6a29f35bf 2165 {
<> 129:0ab6a29f35bf 2166 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2167 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2168 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2169 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2170 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2171 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2172 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2173 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 129:0ab6a29f35bf 2174 } arm_cfft_radix2_instance_f32;
<> 129:0ab6a29f35bf 2175
<> 129:0ab6a29f35bf 2176 /* Deprecated */
<> 129:0ab6a29f35bf 2177 arm_status arm_cfft_radix2_init_f32(
<> 129:0ab6a29f35bf 2178 arm_cfft_radix2_instance_f32 * S,
<> 129:0ab6a29f35bf 2179 uint16_t fftLen,
<> 129:0ab6a29f35bf 2180 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2181 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2182
<> 129:0ab6a29f35bf 2183 /* Deprecated */
<> 129:0ab6a29f35bf 2184 void arm_cfft_radix2_f32(
<> 129:0ab6a29f35bf 2185 const arm_cfft_radix2_instance_f32 * S,
<> 129:0ab6a29f35bf 2186 float32_t * pSrc);
<> 129:0ab6a29f35bf 2187
<> 129:0ab6a29f35bf 2188 /**
<> 129:0ab6a29f35bf 2189 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2190 */
<> 129:0ab6a29f35bf 2191
<> 129:0ab6a29f35bf 2192 typedef struct
<> 129:0ab6a29f35bf 2193 {
<> 129:0ab6a29f35bf 2194 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2195 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 129:0ab6a29f35bf 2196 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2197 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2198 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2199 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2200 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 129:0ab6a29f35bf 2201 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 129:0ab6a29f35bf 2202 } arm_cfft_radix4_instance_f32;
<> 129:0ab6a29f35bf 2203
<> 129:0ab6a29f35bf 2204 /* Deprecated */
<> 129:0ab6a29f35bf 2205 arm_status arm_cfft_radix4_init_f32(
<> 129:0ab6a29f35bf 2206 arm_cfft_radix4_instance_f32 * S,
<> 129:0ab6a29f35bf 2207 uint16_t fftLen,
<> 129:0ab6a29f35bf 2208 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2209 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2210
<> 129:0ab6a29f35bf 2211 /* Deprecated */
<> 129:0ab6a29f35bf 2212 void arm_cfft_radix4_f32(
<> 129:0ab6a29f35bf 2213 const arm_cfft_radix4_instance_f32 * S,
<> 129:0ab6a29f35bf 2214 float32_t * pSrc);
<> 129:0ab6a29f35bf 2215
<> 129:0ab6a29f35bf 2216 /**
<> 129:0ab6a29f35bf 2217 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2218 */
<> 129:0ab6a29f35bf 2219
<> 129:0ab6a29f35bf 2220 typedef struct
<> 129:0ab6a29f35bf 2221 {
<> 129:0ab6a29f35bf 2222 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2223 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2224 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2225 uint16_t bitRevLength; /**< bit reversal table length. */
<> 129:0ab6a29f35bf 2226 } arm_cfft_instance_q15;
<> 129:0ab6a29f35bf 2227
<> 129:0ab6a29f35bf 2228 void arm_cfft_q15(
<> 129:0ab6a29f35bf 2229 const arm_cfft_instance_q15 * S,
<> 129:0ab6a29f35bf 2230 q15_t * p1,
<> 129:0ab6a29f35bf 2231 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2232 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2233
<> 129:0ab6a29f35bf 2234 /**
<> 129:0ab6a29f35bf 2235 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2236 */
<> 129:0ab6a29f35bf 2237
<> 129:0ab6a29f35bf 2238 typedef struct
<> 129:0ab6a29f35bf 2239 {
<> 129:0ab6a29f35bf 2240 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2241 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2242 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2243 uint16_t bitRevLength; /**< bit reversal table length. */
<> 129:0ab6a29f35bf 2244 } arm_cfft_instance_q31;
<> 129:0ab6a29f35bf 2245
<> 129:0ab6a29f35bf 2246 void arm_cfft_q31(
<> 129:0ab6a29f35bf 2247 const arm_cfft_instance_q31 * S,
<> 129:0ab6a29f35bf 2248 q31_t * p1,
<> 129:0ab6a29f35bf 2249 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2250 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2251
<> 129:0ab6a29f35bf 2252 /**
<> 129:0ab6a29f35bf 2253 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 129:0ab6a29f35bf 2254 */
<> 129:0ab6a29f35bf 2255
<> 129:0ab6a29f35bf 2256 typedef struct
<> 129:0ab6a29f35bf 2257 {
<> 129:0ab6a29f35bf 2258 uint16_t fftLen; /**< length of the FFT. */
<> 129:0ab6a29f35bf 2259 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 129:0ab6a29f35bf 2260 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 129:0ab6a29f35bf 2261 uint16_t bitRevLength; /**< bit reversal table length. */
<> 129:0ab6a29f35bf 2262 } arm_cfft_instance_f32;
<> 129:0ab6a29f35bf 2263
<> 129:0ab6a29f35bf 2264 void arm_cfft_f32(
<> 129:0ab6a29f35bf 2265 const arm_cfft_instance_f32 * S,
<> 129:0ab6a29f35bf 2266 float32_t * p1,
<> 129:0ab6a29f35bf 2267 uint8_t ifftFlag,
<> 129:0ab6a29f35bf 2268 uint8_t bitReverseFlag);
<> 129:0ab6a29f35bf 2269
<> 129:0ab6a29f35bf 2270 /**
<> 129:0ab6a29f35bf 2271 * @brief Instance structure for the Q15 RFFT/RIFFT function.
<> 129:0ab6a29f35bf 2272 */
<> 129:0ab6a29f35bf 2273
<> 129:0ab6a29f35bf 2274 typedef struct
<> 129:0ab6a29f35bf 2275 {
<> 129:0ab6a29f35bf 2276 uint32_t fftLenReal; /**< length of the real FFT. */
<> 129:0ab6a29f35bf 2277 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 129:0ab6a29f35bf 2278 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2279 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2280 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 129:0ab6a29f35bf 2281 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 129:0ab6a29f35bf 2282 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2283 } arm_rfft_instance_q15;
<> 129:0ab6a29f35bf 2284
<> 129:0ab6a29f35bf 2285 arm_status arm_rfft_init_q15(
<> 129:0ab6a29f35bf 2286 arm_rfft_instance_q15 * S,
<> 129:0ab6a29f35bf 2287 uint32_t fftLenReal,
<> 129:0ab6a29f35bf 2288 uint32_t ifftFlagR,
<> 129:0ab6a29f35bf 2289 uint32_t bitReverseFlag);
<> 129:0ab6a29f35bf 2290
<> 129:0ab6a29f35bf 2291 void arm_rfft_q15(
<> 129:0ab6a29f35bf 2292 const arm_rfft_instance_q15 * S,
<> 129:0ab6a29f35bf 2293 q15_t * pSrc,
<> 129:0ab6a29f35bf 2294 q15_t * pDst);
<> 129:0ab6a29f35bf 2295
<> 129:0ab6a29f35bf 2296 /**
<> 129:0ab6a29f35bf 2297 * @brief Instance structure for the Q31 RFFT/RIFFT function.
<> 129:0ab6a29f35bf 2298 */
<> 129:0ab6a29f35bf 2299
<> 129:0ab6a29f35bf 2300 typedef struct
<> 129:0ab6a29f35bf 2301 {
<> 129:0ab6a29f35bf 2302 uint32_t fftLenReal; /**< length of the real FFT. */
<> 129:0ab6a29f35bf 2303 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 129:0ab6a29f35bf 2304 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2305 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2306 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 129:0ab6a29f35bf 2307 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 129:0ab6a29f35bf 2308 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2309 } arm_rfft_instance_q31;
<> 129:0ab6a29f35bf 2310
<> 129:0ab6a29f35bf 2311 arm_status arm_rfft_init_q31(
<> 129:0ab6a29f35bf 2312 arm_rfft_instance_q31 * S,
<> 129:0ab6a29f35bf 2313 uint32_t fftLenReal,
<> 129:0ab6a29f35bf 2314 uint32_t ifftFlagR,
<> 129:0ab6a29f35bf 2315 uint32_t bitReverseFlag);
<> 129:0ab6a29f35bf 2316
<> 129:0ab6a29f35bf 2317 void arm_rfft_q31(
<> 129:0ab6a29f35bf 2318 const arm_rfft_instance_q31 * S,
<> 129:0ab6a29f35bf 2319 q31_t * pSrc,
<> 129:0ab6a29f35bf 2320 q31_t * pDst);
<> 129:0ab6a29f35bf 2321
<> 129:0ab6a29f35bf 2322 /**
<> 129:0ab6a29f35bf 2323 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 129:0ab6a29f35bf 2324 */
<> 129:0ab6a29f35bf 2325
<> 129:0ab6a29f35bf 2326 typedef struct
<> 129:0ab6a29f35bf 2327 {
<> 129:0ab6a29f35bf 2328 uint32_t fftLenReal; /**< length of the real FFT. */
<> 129:0ab6a29f35bf 2329 uint16_t fftLenBy2; /**< length of the complex FFT. */
<> 129:0ab6a29f35bf 2330 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 129:0ab6a29f35bf 2331 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 129:0ab6a29f35bf 2332 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 129:0ab6a29f35bf 2333 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 129:0ab6a29f35bf 2334 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 129:0ab6a29f35bf 2335 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2336 } arm_rfft_instance_f32;
<> 129:0ab6a29f35bf 2337
<> 129:0ab6a29f35bf 2338 arm_status arm_rfft_init_f32(
<> 129:0ab6a29f35bf 2339 arm_rfft_instance_f32 * S,
<> 129:0ab6a29f35bf 2340 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 129:0ab6a29f35bf 2341 uint32_t fftLenReal,
<> 129:0ab6a29f35bf 2342 uint32_t ifftFlagR,
<> 129:0ab6a29f35bf 2343 uint32_t bitReverseFlag);
<> 129:0ab6a29f35bf 2344
<> 129:0ab6a29f35bf 2345 void arm_rfft_f32(
<> 129:0ab6a29f35bf 2346 const arm_rfft_instance_f32 * S,
<> 129:0ab6a29f35bf 2347 float32_t * pSrc,
<> 129:0ab6a29f35bf 2348 float32_t * pDst);
<> 129:0ab6a29f35bf 2349
<> 129:0ab6a29f35bf 2350 /**
<> 129:0ab6a29f35bf 2351 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 129:0ab6a29f35bf 2352 */
<> 129:0ab6a29f35bf 2353
<> 129:0ab6a29f35bf 2354 typedef struct
<> 129:0ab6a29f35bf 2355 {
<> 129:0ab6a29f35bf 2356 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
<> 129:0ab6a29f35bf 2357 uint16_t fftLenRFFT; /**< length of the real sequence */
<> 129:0ab6a29f35bf 2358 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
<> 129:0ab6a29f35bf 2359 } arm_rfft_fast_instance_f32 ;
<> 129:0ab6a29f35bf 2360
<> 129:0ab6a29f35bf 2361 arm_status arm_rfft_fast_init_f32 (
<> 129:0ab6a29f35bf 2362 arm_rfft_fast_instance_f32 * S,
<> 129:0ab6a29f35bf 2363 uint16_t fftLen);
<> 129:0ab6a29f35bf 2364
<> 129:0ab6a29f35bf 2365 void arm_rfft_fast_f32(
<> 129:0ab6a29f35bf 2366 arm_rfft_fast_instance_f32 * S,
<> 129:0ab6a29f35bf 2367 float32_t * p, float32_t * pOut,
<> 129:0ab6a29f35bf 2368 uint8_t ifftFlag);
<> 129:0ab6a29f35bf 2369
<> 129:0ab6a29f35bf 2370 /**
<> 129:0ab6a29f35bf 2371 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
<> 129:0ab6a29f35bf 2372 */
<> 129:0ab6a29f35bf 2373
<> 129:0ab6a29f35bf 2374 typedef struct
<> 129:0ab6a29f35bf 2375 {
<> 129:0ab6a29f35bf 2376 uint16_t N; /**< length of the DCT4. */
<> 129:0ab6a29f35bf 2377 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 129:0ab6a29f35bf 2378 float32_t normalize; /**< normalizing factor. */
<> 129:0ab6a29f35bf 2379 float32_t *pTwiddle; /**< points to the twiddle factor table. */
<> 129:0ab6a29f35bf 2380 float32_t *pCosFactor; /**< points to the cosFactor table. */
<> 129:0ab6a29f35bf 2381 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
<> 129:0ab6a29f35bf 2382 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2383 } arm_dct4_instance_f32;
<> 129:0ab6a29f35bf 2384
<> 129:0ab6a29f35bf 2385 /**
<> 129:0ab6a29f35bf 2386 * @brief Initialization function for the floating-point DCT4/IDCT4.
<> 129:0ab6a29f35bf 2387 * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure.
<> 129:0ab6a29f35bf 2388 * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
<> 129:0ab6a29f35bf 2389 * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
<> 129:0ab6a29f35bf 2390 * @param[in] N length of the DCT4.
<> 129:0ab6a29f35bf 2391 * @param[in] Nby2 half of the length of the DCT4.
<> 129:0ab6a29f35bf 2392 * @param[in] normalize normalizing factor.
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 2394 */
<> 129:0ab6a29f35bf 2395
<> 129:0ab6a29f35bf 2396 arm_status arm_dct4_init_f32(
<> 129:0ab6a29f35bf 2397 arm_dct4_instance_f32 * S,
<> 129:0ab6a29f35bf 2398 arm_rfft_instance_f32 * S_RFFT,
<> 129:0ab6a29f35bf 2399 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 129:0ab6a29f35bf 2400 uint16_t N,
<> 129:0ab6a29f35bf 2401 uint16_t Nby2,
<> 129:0ab6a29f35bf 2402 float32_t normalize);
<> 129:0ab6a29f35bf 2403
<> 129:0ab6a29f35bf 2404 /**
<> 129:0ab6a29f35bf 2405 * @brief Processing function for the floating-point DCT4/IDCT4.
<> 129:0ab6a29f35bf 2406 * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure.
<> 129:0ab6a29f35bf 2407 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 2408 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 129:0ab6a29f35bf 2409 * @return none.
<> 129:0ab6a29f35bf 2410 */
<> 129:0ab6a29f35bf 2411
<> 129:0ab6a29f35bf 2412 void arm_dct4_f32(
<> 129:0ab6a29f35bf 2413 const arm_dct4_instance_f32 * S,
<> 129:0ab6a29f35bf 2414 float32_t * pState,
<> 129:0ab6a29f35bf 2415 float32_t * pInlineBuffer);
<> 129:0ab6a29f35bf 2416
<> 129:0ab6a29f35bf 2417 /**
<> 129:0ab6a29f35bf 2418 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
<> 129:0ab6a29f35bf 2419 */
<> 129:0ab6a29f35bf 2420
<> 129:0ab6a29f35bf 2421 typedef struct
<> 129:0ab6a29f35bf 2422 {
<> 129:0ab6a29f35bf 2423 uint16_t N; /**< length of the DCT4. */
<> 129:0ab6a29f35bf 2424 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 129:0ab6a29f35bf 2425 q31_t normalize; /**< normalizing factor. */
<> 129:0ab6a29f35bf 2426 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 129:0ab6a29f35bf 2427 q31_t *pCosFactor; /**< points to the cosFactor table. */
<> 129:0ab6a29f35bf 2428 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
<> 129:0ab6a29f35bf 2429 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2430 } arm_dct4_instance_q31;
<> 129:0ab6a29f35bf 2431
<> 129:0ab6a29f35bf 2432 /**
<> 129:0ab6a29f35bf 2433 * @brief Initialization function for the Q31 DCT4/IDCT4.
<> 129:0ab6a29f35bf 2434 * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure.
<> 129:0ab6a29f35bf 2435 * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure
<> 129:0ab6a29f35bf 2436 * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure
<> 129:0ab6a29f35bf 2437 * @param[in] N length of the DCT4.
<> 129:0ab6a29f35bf 2438 * @param[in] Nby2 half of the length of the DCT4.
<> 129:0ab6a29f35bf 2439 * @param[in] normalize normalizing factor.
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 2441 */
<> 129:0ab6a29f35bf 2442
<> 129:0ab6a29f35bf 2443 arm_status arm_dct4_init_q31(
<> 129:0ab6a29f35bf 2444 arm_dct4_instance_q31 * S,
<> 129:0ab6a29f35bf 2445 arm_rfft_instance_q31 * S_RFFT,
<> 129:0ab6a29f35bf 2446 arm_cfft_radix4_instance_q31 * S_CFFT,
<> 129:0ab6a29f35bf 2447 uint16_t N,
<> 129:0ab6a29f35bf 2448 uint16_t Nby2,
<> 129:0ab6a29f35bf 2449 q31_t normalize);
<> 129:0ab6a29f35bf 2450
<> 129:0ab6a29f35bf 2451 /**
<> 129:0ab6a29f35bf 2452 * @brief Processing function for the Q31 DCT4/IDCT4.
<> 129:0ab6a29f35bf 2453 * @param[in] *S points to an instance of the Q31 DCT4 structure.
<> 129:0ab6a29f35bf 2454 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 2455 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 129:0ab6a29f35bf 2456 * @return none.
<> 129:0ab6a29f35bf 2457 */
<> 129:0ab6a29f35bf 2458
<> 129:0ab6a29f35bf 2459 void arm_dct4_q31(
<> 129:0ab6a29f35bf 2460 const arm_dct4_instance_q31 * S,
<> 129:0ab6a29f35bf 2461 q31_t * pState,
<> 129:0ab6a29f35bf 2462 q31_t * pInlineBuffer);
<> 129:0ab6a29f35bf 2463
<> 129:0ab6a29f35bf 2464 /**
<> 129:0ab6a29f35bf 2465 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
<> 129:0ab6a29f35bf 2466 */
<> 129:0ab6a29f35bf 2467
<> 129:0ab6a29f35bf 2468 typedef struct
<> 129:0ab6a29f35bf 2469 {
<> 129:0ab6a29f35bf 2470 uint16_t N; /**< length of the DCT4. */
<> 129:0ab6a29f35bf 2471 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 129:0ab6a29f35bf 2472 q15_t normalize; /**< normalizing factor. */
<> 129:0ab6a29f35bf 2473 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 129:0ab6a29f35bf 2474 q15_t *pCosFactor; /**< points to the cosFactor table. */
<> 129:0ab6a29f35bf 2475 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
<> 129:0ab6a29f35bf 2476 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 129:0ab6a29f35bf 2477 } arm_dct4_instance_q15;
<> 129:0ab6a29f35bf 2478
<> 129:0ab6a29f35bf 2479 /**
<> 129:0ab6a29f35bf 2480 * @brief Initialization function for the Q15 DCT4/IDCT4.
<> 129:0ab6a29f35bf 2481 * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure.
<> 129:0ab6a29f35bf 2482 * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
<> 129:0ab6a29f35bf 2483 * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
<> 129:0ab6a29f35bf 2484 * @param[in] N length of the DCT4.
<> 129:0ab6a29f35bf 2485 * @param[in] Nby2 half of the length of the DCT4.
<> 129:0ab6a29f35bf 2486 * @param[in] normalize normalizing factor.
<> 129:0ab6a29f35bf 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.
<> 129:0ab6a29f35bf 2488 */
<> 129:0ab6a29f35bf 2489
<> 129:0ab6a29f35bf 2490 arm_status arm_dct4_init_q15(
<> 129:0ab6a29f35bf 2491 arm_dct4_instance_q15 * S,
<> 129:0ab6a29f35bf 2492 arm_rfft_instance_q15 * S_RFFT,
<> 129:0ab6a29f35bf 2493 arm_cfft_radix4_instance_q15 * S_CFFT,
<> 129:0ab6a29f35bf 2494 uint16_t N,
<> 129:0ab6a29f35bf 2495 uint16_t Nby2,
<> 129:0ab6a29f35bf 2496 q15_t normalize);
<> 129:0ab6a29f35bf 2497
<> 129:0ab6a29f35bf 2498 /**
<> 129:0ab6a29f35bf 2499 * @brief Processing function for the Q15 DCT4/IDCT4.
<> 129:0ab6a29f35bf 2500 * @param[in] *S points to an instance of the Q15 DCT4 structure.
<> 129:0ab6a29f35bf 2501 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 2502 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 129:0ab6a29f35bf 2503 * @return none.
<> 129:0ab6a29f35bf 2504 */
<> 129:0ab6a29f35bf 2505
<> 129:0ab6a29f35bf 2506 void arm_dct4_q15(
<> 129:0ab6a29f35bf 2507 const arm_dct4_instance_q15 * S,
<> 129:0ab6a29f35bf 2508 q15_t * pState,
<> 129:0ab6a29f35bf 2509 q15_t * pInlineBuffer);
<> 129:0ab6a29f35bf 2510
<> 129:0ab6a29f35bf 2511 /**
<> 129:0ab6a29f35bf 2512 * @brief Floating-point vector addition.
<> 129:0ab6a29f35bf 2513 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2514 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2515 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2516 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2517 * @return none.
<> 129:0ab6a29f35bf 2518 */
<> 129:0ab6a29f35bf 2519
<> 129:0ab6a29f35bf 2520 void arm_add_f32(
<> 129:0ab6a29f35bf 2521 float32_t * pSrcA,
<> 129:0ab6a29f35bf 2522 float32_t * pSrcB,
<> 129:0ab6a29f35bf 2523 float32_t * pDst,
<> 129:0ab6a29f35bf 2524 uint32_t blockSize);
<> 129:0ab6a29f35bf 2525
<> 129:0ab6a29f35bf 2526 /**
<> 129:0ab6a29f35bf 2527 * @brief Q7 vector addition.
<> 129:0ab6a29f35bf 2528 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2529 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2530 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2531 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2532 * @return none.
<> 129:0ab6a29f35bf 2533 */
<> 129:0ab6a29f35bf 2534
<> 129:0ab6a29f35bf 2535 void arm_add_q7(
<> 129:0ab6a29f35bf 2536 q7_t * pSrcA,
<> 129:0ab6a29f35bf 2537 q7_t * pSrcB,
<> 129:0ab6a29f35bf 2538 q7_t * pDst,
<> 129:0ab6a29f35bf 2539 uint32_t blockSize);
<> 129:0ab6a29f35bf 2540
<> 129:0ab6a29f35bf 2541 /**
<> 129:0ab6a29f35bf 2542 * @brief Q15 vector addition.
<> 129:0ab6a29f35bf 2543 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2544 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2545 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2546 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2547 * @return none.
<> 129:0ab6a29f35bf 2548 */
<> 129:0ab6a29f35bf 2549
<> 129:0ab6a29f35bf 2550 void arm_add_q15(
<> 129:0ab6a29f35bf 2551 q15_t * pSrcA,
<> 129:0ab6a29f35bf 2552 q15_t * pSrcB,
<> 129:0ab6a29f35bf 2553 q15_t * pDst,
<> 129:0ab6a29f35bf 2554 uint32_t blockSize);
<> 129:0ab6a29f35bf 2555
<> 129:0ab6a29f35bf 2556 /**
<> 129:0ab6a29f35bf 2557 * @brief Q31 vector addition.
<> 129:0ab6a29f35bf 2558 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2559 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2560 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2561 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2562 * @return none.
<> 129:0ab6a29f35bf 2563 */
<> 129:0ab6a29f35bf 2564
<> 129:0ab6a29f35bf 2565 void arm_add_q31(
<> 129:0ab6a29f35bf 2566 q31_t * pSrcA,
<> 129:0ab6a29f35bf 2567 q31_t * pSrcB,
<> 129:0ab6a29f35bf 2568 q31_t * pDst,
<> 129:0ab6a29f35bf 2569 uint32_t blockSize);
<> 129:0ab6a29f35bf 2570
<> 129:0ab6a29f35bf 2571 /**
<> 129:0ab6a29f35bf 2572 * @brief Floating-point vector subtraction.
<> 129:0ab6a29f35bf 2573 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2574 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2575 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2576 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2577 * @return none.
<> 129:0ab6a29f35bf 2578 */
<> 129:0ab6a29f35bf 2579
<> 129:0ab6a29f35bf 2580 void arm_sub_f32(
<> 129:0ab6a29f35bf 2581 float32_t * pSrcA,
<> 129:0ab6a29f35bf 2582 float32_t * pSrcB,
<> 129:0ab6a29f35bf 2583 float32_t * pDst,
<> 129:0ab6a29f35bf 2584 uint32_t blockSize);
<> 129:0ab6a29f35bf 2585
<> 129:0ab6a29f35bf 2586 /**
<> 129:0ab6a29f35bf 2587 * @brief Q7 vector subtraction.
<> 129:0ab6a29f35bf 2588 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2589 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2590 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2591 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2592 * @return none.
<> 129:0ab6a29f35bf 2593 */
<> 129:0ab6a29f35bf 2594
<> 129:0ab6a29f35bf 2595 void arm_sub_q7(
<> 129:0ab6a29f35bf 2596 q7_t * pSrcA,
<> 129:0ab6a29f35bf 2597 q7_t * pSrcB,
<> 129:0ab6a29f35bf 2598 q7_t * pDst,
<> 129:0ab6a29f35bf 2599 uint32_t blockSize);
<> 129:0ab6a29f35bf 2600
<> 129:0ab6a29f35bf 2601 /**
<> 129:0ab6a29f35bf 2602 * @brief Q15 vector subtraction.
<> 129:0ab6a29f35bf 2603 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2604 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2605 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2606 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2607 * @return none.
<> 129:0ab6a29f35bf 2608 */
<> 129:0ab6a29f35bf 2609
<> 129:0ab6a29f35bf 2610 void arm_sub_q15(
<> 129:0ab6a29f35bf 2611 q15_t * pSrcA,
<> 129:0ab6a29f35bf 2612 q15_t * pSrcB,
<> 129:0ab6a29f35bf 2613 q15_t * pDst,
<> 129:0ab6a29f35bf 2614 uint32_t blockSize);
<> 129:0ab6a29f35bf 2615
<> 129:0ab6a29f35bf 2616 /**
<> 129:0ab6a29f35bf 2617 * @brief Q31 vector subtraction.
<> 129:0ab6a29f35bf 2618 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2619 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2620 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2621 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2622 * @return none.
<> 129:0ab6a29f35bf 2623 */
<> 129:0ab6a29f35bf 2624
<> 129:0ab6a29f35bf 2625 void arm_sub_q31(
<> 129:0ab6a29f35bf 2626 q31_t * pSrcA,
<> 129:0ab6a29f35bf 2627 q31_t * pSrcB,
<> 129:0ab6a29f35bf 2628 q31_t * pDst,
<> 129:0ab6a29f35bf 2629 uint32_t blockSize);
<> 129:0ab6a29f35bf 2630
<> 129:0ab6a29f35bf 2631 /**
<> 129:0ab6a29f35bf 2632 * @brief Multiplies a floating-point vector by a scalar.
<> 129:0ab6a29f35bf 2633 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2634 * @param[in] scale scale factor to be applied
<> 129:0ab6a29f35bf 2635 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2636 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2637 * @return none.
<> 129:0ab6a29f35bf 2638 */
<> 129:0ab6a29f35bf 2639
<> 129:0ab6a29f35bf 2640 void arm_scale_f32(
<> 129:0ab6a29f35bf 2641 float32_t * pSrc,
<> 129:0ab6a29f35bf 2642 float32_t scale,
<> 129:0ab6a29f35bf 2643 float32_t * pDst,
<> 129:0ab6a29f35bf 2644 uint32_t blockSize);
<> 129:0ab6a29f35bf 2645
<> 129:0ab6a29f35bf 2646 /**
<> 129:0ab6a29f35bf 2647 * @brief Multiplies a Q7 vector by a scalar.
<> 129:0ab6a29f35bf 2648 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2649 * @param[in] scaleFract fractional portion of the scale value
<> 129:0ab6a29f35bf 2650 * @param[in] shift number of bits to shift the result by
<> 129:0ab6a29f35bf 2651 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2652 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2653 * @return none.
<> 129:0ab6a29f35bf 2654 */
<> 129:0ab6a29f35bf 2655
<> 129:0ab6a29f35bf 2656 void arm_scale_q7(
<> 129:0ab6a29f35bf 2657 q7_t * pSrc,
<> 129:0ab6a29f35bf 2658 q7_t scaleFract,
<> 129:0ab6a29f35bf 2659 int8_t shift,
<> 129:0ab6a29f35bf 2660 q7_t * pDst,
<> 129:0ab6a29f35bf 2661 uint32_t blockSize);
<> 129:0ab6a29f35bf 2662
<> 129:0ab6a29f35bf 2663 /**
<> 129:0ab6a29f35bf 2664 * @brief Multiplies a Q15 vector by a scalar.
<> 129:0ab6a29f35bf 2665 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2666 * @param[in] scaleFract fractional portion of the scale value
<> 129:0ab6a29f35bf 2667 * @param[in] shift number of bits to shift the result by
<> 129:0ab6a29f35bf 2668 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2669 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2670 * @return none.
<> 129:0ab6a29f35bf 2671 */
<> 129:0ab6a29f35bf 2672
<> 129:0ab6a29f35bf 2673 void arm_scale_q15(
<> 129:0ab6a29f35bf 2674 q15_t * pSrc,
<> 129:0ab6a29f35bf 2675 q15_t scaleFract,
<> 129:0ab6a29f35bf 2676 int8_t shift,
<> 129:0ab6a29f35bf 2677 q15_t * pDst,
<> 129:0ab6a29f35bf 2678 uint32_t blockSize);
<> 129:0ab6a29f35bf 2679
<> 129:0ab6a29f35bf 2680 /**
<> 129:0ab6a29f35bf 2681 * @brief Multiplies a Q31 vector by a scalar.
<> 129:0ab6a29f35bf 2682 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2683 * @param[in] scaleFract fractional portion of the scale value
<> 129:0ab6a29f35bf 2684 * @param[in] shift number of bits to shift the result by
<> 129:0ab6a29f35bf 2685 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2686 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2687 * @return none.
<> 129:0ab6a29f35bf 2688 */
<> 129:0ab6a29f35bf 2689
<> 129:0ab6a29f35bf 2690 void arm_scale_q31(
<> 129:0ab6a29f35bf 2691 q31_t * pSrc,
<> 129:0ab6a29f35bf 2692 q31_t scaleFract,
<> 129:0ab6a29f35bf 2693 int8_t shift,
<> 129:0ab6a29f35bf 2694 q31_t * pDst,
<> 129:0ab6a29f35bf 2695 uint32_t blockSize);
<> 129:0ab6a29f35bf 2696
<> 129:0ab6a29f35bf 2697 /**
<> 129:0ab6a29f35bf 2698 * @brief Q7 vector absolute value.
<> 129:0ab6a29f35bf 2699 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 2700 * @param[out] *pDst points to the output buffer
<> 129:0ab6a29f35bf 2701 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2702 * @return none.
<> 129:0ab6a29f35bf 2703 */
<> 129:0ab6a29f35bf 2704
<> 129:0ab6a29f35bf 2705 void arm_abs_q7(
<> 129:0ab6a29f35bf 2706 q7_t * pSrc,
<> 129:0ab6a29f35bf 2707 q7_t * pDst,
<> 129:0ab6a29f35bf 2708 uint32_t blockSize);
<> 129:0ab6a29f35bf 2709
<> 129:0ab6a29f35bf 2710 /**
<> 129:0ab6a29f35bf 2711 * @brief Floating-point vector absolute value.
<> 129:0ab6a29f35bf 2712 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 2713 * @param[out] *pDst points to the output buffer
<> 129:0ab6a29f35bf 2714 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2715 * @return none.
<> 129:0ab6a29f35bf 2716 */
<> 129:0ab6a29f35bf 2717
<> 129:0ab6a29f35bf 2718 void arm_abs_f32(
<> 129:0ab6a29f35bf 2719 float32_t * pSrc,
<> 129:0ab6a29f35bf 2720 float32_t * pDst,
<> 129:0ab6a29f35bf 2721 uint32_t blockSize);
<> 129:0ab6a29f35bf 2722
<> 129:0ab6a29f35bf 2723 /**
<> 129:0ab6a29f35bf 2724 * @brief Q15 vector absolute value.
<> 129:0ab6a29f35bf 2725 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 2726 * @param[out] *pDst points to the output buffer
<> 129:0ab6a29f35bf 2727 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2728 * @return none.
<> 129:0ab6a29f35bf 2729 */
<> 129:0ab6a29f35bf 2730
<> 129:0ab6a29f35bf 2731 void arm_abs_q15(
<> 129:0ab6a29f35bf 2732 q15_t * pSrc,
<> 129:0ab6a29f35bf 2733 q15_t * pDst,
<> 129:0ab6a29f35bf 2734 uint32_t blockSize);
<> 129:0ab6a29f35bf 2735
<> 129:0ab6a29f35bf 2736 /**
<> 129:0ab6a29f35bf 2737 * @brief Q31 vector absolute value.
<> 129:0ab6a29f35bf 2738 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 2739 * @param[out] *pDst points to the output buffer
<> 129:0ab6a29f35bf 2740 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2741 * @return none.
<> 129:0ab6a29f35bf 2742 */
<> 129:0ab6a29f35bf 2743
<> 129:0ab6a29f35bf 2744 void arm_abs_q31(
<> 129:0ab6a29f35bf 2745 q31_t * pSrc,
<> 129:0ab6a29f35bf 2746 q31_t * pDst,
<> 129:0ab6a29f35bf 2747 uint32_t blockSize);
<> 129:0ab6a29f35bf 2748
<> 129:0ab6a29f35bf 2749 /**
<> 129:0ab6a29f35bf 2750 * @brief Dot product of floating-point vectors.
<> 129:0ab6a29f35bf 2751 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2752 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2753 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2754 * @param[out] *result output result returned here
<> 129:0ab6a29f35bf 2755 * @return none.
<> 129:0ab6a29f35bf 2756 */
<> 129:0ab6a29f35bf 2757
<> 129:0ab6a29f35bf 2758 void arm_dot_prod_f32(
<> 129:0ab6a29f35bf 2759 float32_t * pSrcA,
<> 129:0ab6a29f35bf 2760 float32_t * pSrcB,
<> 129:0ab6a29f35bf 2761 uint32_t blockSize,
<> 129:0ab6a29f35bf 2762 float32_t * result);
<> 129:0ab6a29f35bf 2763
<> 129:0ab6a29f35bf 2764 /**
<> 129:0ab6a29f35bf 2765 * @brief Dot product of Q7 vectors.
<> 129:0ab6a29f35bf 2766 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2767 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2768 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2769 * @param[out] *result output result returned here
<> 129:0ab6a29f35bf 2770 * @return none.
<> 129:0ab6a29f35bf 2771 */
<> 129:0ab6a29f35bf 2772
<> 129:0ab6a29f35bf 2773 void arm_dot_prod_q7(
<> 129:0ab6a29f35bf 2774 q7_t * pSrcA,
<> 129:0ab6a29f35bf 2775 q7_t * pSrcB,
<> 129:0ab6a29f35bf 2776 uint32_t blockSize,
<> 129:0ab6a29f35bf 2777 q31_t * result);
<> 129:0ab6a29f35bf 2778
<> 129:0ab6a29f35bf 2779 /**
<> 129:0ab6a29f35bf 2780 * @brief Dot product of Q15 vectors.
<> 129:0ab6a29f35bf 2781 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2782 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2783 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2784 * @param[out] *result output result returned here
<> 129:0ab6a29f35bf 2785 * @return none.
<> 129:0ab6a29f35bf 2786 */
<> 129:0ab6a29f35bf 2787
<> 129:0ab6a29f35bf 2788 void arm_dot_prod_q15(
<> 129:0ab6a29f35bf 2789 q15_t * pSrcA,
<> 129:0ab6a29f35bf 2790 q15_t * pSrcB,
<> 129:0ab6a29f35bf 2791 uint32_t blockSize,
<> 129:0ab6a29f35bf 2792 q63_t * result);
<> 129:0ab6a29f35bf 2793
<> 129:0ab6a29f35bf 2794 /**
<> 129:0ab6a29f35bf 2795 * @brief Dot product of Q31 vectors.
<> 129:0ab6a29f35bf 2796 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 2797 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 2798 * @param[in] blockSize number of samples in each vector
<> 129:0ab6a29f35bf 2799 * @param[out] *result output result returned here
<> 129:0ab6a29f35bf 2800 * @return none.
<> 129:0ab6a29f35bf 2801 */
<> 129:0ab6a29f35bf 2802
<> 129:0ab6a29f35bf 2803 void arm_dot_prod_q31(
<> 129:0ab6a29f35bf 2804 q31_t * pSrcA,
<> 129:0ab6a29f35bf 2805 q31_t * pSrcB,
<> 129:0ab6a29f35bf 2806 uint32_t blockSize,
<> 129:0ab6a29f35bf 2807 q63_t * result);
<> 129:0ab6a29f35bf 2808
<> 129:0ab6a29f35bf 2809 /**
<> 129:0ab6a29f35bf 2810 * @brief Shifts the elements of a Q7 vector a specified number of bits.
<> 129:0ab6a29f35bf 2811 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2812 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 129:0ab6a29f35bf 2813 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2814 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2815 * @return none.
<> 129:0ab6a29f35bf 2816 */
<> 129:0ab6a29f35bf 2817
<> 129:0ab6a29f35bf 2818 void arm_shift_q7(
<> 129:0ab6a29f35bf 2819 q7_t * pSrc,
<> 129:0ab6a29f35bf 2820 int8_t shiftBits,
<> 129:0ab6a29f35bf 2821 q7_t * pDst,
<> 129:0ab6a29f35bf 2822 uint32_t blockSize);
<> 129:0ab6a29f35bf 2823
<> 129:0ab6a29f35bf 2824 /**
<> 129:0ab6a29f35bf 2825 * @brief Shifts the elements of a Q15 vector a specified number of bits.
<> 129:0ab6a29f35bf 2826 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2827 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 129:0ab6a29f35bf 2828 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2829 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2830 * @return none.
<> 129:0ab6a29f35bf 2831 */
<> 129:0ab6a29f35bf 2832
<> 129:0ab6a29f35bf 2833 void arm_shift_q15(
<> 129:0ab6a29f35bf 2834 q15_t * pSrc,
<> 129:0ab6a29f35bf 2835 int8_t shiftBits,
<> 129:0ab6a29f35bf 2836 q15_t * pDst,
<> 129:0ab6a29f35bf 2837 uint32_t blockSize);
<> 129:0ab6a29f35bf 2838
<> 129:0ab6a29f35bf 2839 /**
<> 129:0ab6a29f35bf 2840 * @brief Shifts the elements of a Q31 vector a specified number of bits.
<> 129:0ab6a29f35bf 2841 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2842 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 129:0ab6a29f35bf 2843 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2844 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2845 * @return none.
<> 129:0ab6a29f35bf 2846 */
<> 129:0ab6a29f35bf 2847
<> 129:0ab6a29f35bf 2848 void arm_shift_q31(
<> 129:0ab6a29f35bf 2849 q31_t * pSrc,
<> 129:0ab6a29f35bf 2850 int8_t shiftBits,
<> 129:0ab6a29f35bf 2851 q31_t * pDst,
<> 129:0ab6a29f35bf 2852 uint32_t blockSize);
<> 129:0ab6a29f35bf 2853
<> 129:0ab6a29f35bf 2854 /**
<> 129:0ab6a29f35bf 2855 * @brief Adds a constant offset to a floating-point vector.
<> 129:0ab6a29f35bf 2856 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2857 * @param[in] offset is the offset to be added
<> 129:0ab6a29f35bf 2858 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2859 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2860 * @return none.
<> 129:0ab6a29f35bf 2861 */
<> 129:0ab6a29f35bf 2862
<> 129:0ab6a29f35bf 2863 void arm_offset_f32(
<> 129:0ab6a29f35bf 2864 float32_t * pSrc,
<> 129:0ab6a29f35bf 2865 float32_t offset,
<> 129:0ab6a29f35bf 2866 float32_t * pDst,
<> 129:0ab6a29f35bf 2867 uint32_t blockSize);
<> 129:0ab6a29f35bf 2868
<> 129:0ab6a29f35bf 2869 /**
<> 129:0ab6a29f35bf 2870 * @brief Adds a constant offset to a Q7 vector.
<> 129:0ab6a29f35bf 2871 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2872 * @param[in] offset is the offset to be added
<> 129:0ab6a29f35bf 2873 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2874 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2875 * @return none.
<> 129:0ab6a29f35bf 2876 */
<> 129:0ab6a29f35bf 2877
<> 129:0ab6a29f35bf 2878 void arm_offset_q7(
<> 129:0ab6a29f35bf 2879 q7_t * pSrc,
<> 129:0ab6a29f35bf 2880 q7_t offset,
<> 129:0ab6a29f35bf 2881 q7_t * pDst,
<> 129:0ab6a29f35bf 2882 uint32_t blockSize);
<> 129:0ab6a29f35bf 2883
<> 129:0ab6a29f35bf 2884 /**
<> 129:0ab6a29f35bf 2885 * @brief Adds a constant offset to a Q15 vector.
<> 129:0ab6a29f35bf 2886 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2887 * @param[in] offset is the offset to be added
<> 129:0ab6a29f35bf 2888 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2889 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2890 * @return none.
<> 129:0ab6a29f35bf 2891 */
<> 129:0ab6a29f35bf 2892
<> 129:0ab6a29f35bf 2893 void arm_offset_q15(
<> 129:0ab6a29f35bf 2894 q15_t * pSrc,
<> 129:0ab6a29f35bf 2895 q15_t offset,
<> 129:0ab6a29f35bf 2896 q15_t * pDst,
<> 129:0ab6a29f35bf 2897 uint32_t blockSize);
<> 129:0ab6a29f35bf 2898
<> 129:0ab6a29f35bf 2899 /**
<> 129:0ab6a29f35bf 2900 * @brief Adds a constant offset to a Q31 vector.
<> 129:0ab6a29f35bf 2901 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2902 * @param[in] offset is the offset to be added
<> 129:0ab6a29f35bf 2903 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2904 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2905 * @return none.
<> 129:0ab6a29f35bf 2906 */
<> 129:0ab6a29f35bf 2907
<> 129:0ab6a29f35bf 2908 void arm_offset_q31(
<> 129:0ab6a29f35bf 2909 q31_t * pSrc,
<> 129:0ab6a29f35bf 2910 q31_t offset,
<> 129:0ab6a29f35bf 2911 q31_t * pDst,
<> 129:0ab6a29f35bf 2912 uint32_t blockSize);
<> 129:0ab6a29f35bf 2913
<> 129:0ab6a29f35bf 2914 /**
<> 129:0ab6a29f35bf 2915 * @brief Negates the elements of a floating-point vector.
<> 129:0ab6a29f35bf 2916 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2917 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2918 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2919 * @return none.
<> 129:0ab6a29f35bf 2920 */
<> 129:0ab6a29f35bf 2921
<> 129:0ab6a29f35bf 2922 void arm_negate_f32(
<> 129:0ab6a29f35bf 2923 float32_t * pSrc,
<> 129:0ab6a29f35bf 2924 float32_t * pDst,
<> 129:0ab6a29f35bf 2925 uint32_t blockSize);
<> 129:0ab6a29f35bf 2926
<> 129:0ab6a29f35bf 2927 /**
<> 129:0ab6a29f35bf 2928 * @brief Negates the elements of a Q7 vector.
<> 129:0ab6a29f35bf 2929 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2930 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2931 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2932 * @return none.
<> 129:0ab6a29f35bf 2933 */
<> 129:0ab6a29f35bf 2934
<> 129:0ab6a29f35bf 2935 void arm_negate_q7(
<> 129:0ab6a29f35bf 2936 q7_t * pSrc,
<> 129:0ab6a29f35bf 2937 q7_t * pDst,
<> 129:0ab6a29f35bf 2938 uint32_t blockSize);
<> 129:0ab6a29f35bf 2939
<> 129:0ab6a29f35bf 2940 /**
<> 129:0ab6a29f35bf 2941 * @brief Negates the elements of a Q15 vector.
<> 129:0ab6a29f35bf 2942 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2943 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2944 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2945 * @return none.
<> 129:0ab6a29f35bf 2946 */
<> 129:0ab6a29f35bf 2947
<> 129:0ab6a29f35bf 2948 void arm_negate_q15(
<> 129:0ab6a29f35bf 2949 q15_t * pSrc,
<> 129:0ab6a29f35bf 2950 q15_t * pDst,
<> 129:0ab6a29f35bf 2951 uint32_t blockSize);
<> 129:0ab6a29f35bf 2952
<> 129:0ab6a29f35bf 2953 /**
<> 129:0ab6a29f35bf 2954 * @brief Negates the elements of a Q31 vector.
<> 129:0ab6a29f35bf 2955 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 2956 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 2957 * @param[in] blockSize number of samples in the vector
<> 129:0ab6a29f35bf 2958 * @return none.
<> 129:0ab6a29f35bf 2959 */
<> 129:0ab6a29f35bf 2960
<> 129:0ab6a29f35bf 2961 void arm_negate_q31(
<> 129:0ab6a29f35bf 2962 q31_t * pSrc,
<> 129:0ab6a29f35bf 2963 q31_t * pDst,
<> 129:0ab6a29f35bf 2964 uint32_t blockSize);
<> 129:0ab6a29f35bf 2965 /**
<> 129:0ab6a29f35bf 2966 * @brief Copies the elements of a floating-point vector.
<> 129:0ab6a29f35bf 2967 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 2968 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 2969 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 2970 * @return none.
<> 129:0ab6a29f35bf 2971 */
<> 129:0ab6a29f35bf 2972 void arm_copy_f32(
<> 129:0ab6a29f35bf 2973 float32_t * pSrc,
<> 129:0ab6a29f35bf 2974 float32_t * pDst,
<> 129:0ab6a29f35bf 2975 uint32_t blockSize);
<> 129:0ab6a29f35bf 2976
<> 129:0ab6a29f35bf 2977 /**
<> 129:0ab6a29f35bf 2978 * @brief Copies the elements of a Q7 vector.
<> 129:0ab6a29f35bf 2979 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 2980 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 2981 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 2982 * @return none.
<> 129:0ab6a29f35bf 2983 */
<> 129:0ab6a29f35bf 2984 void arm_copy_q7(
<> 129:0ab6a29f35bf 2985 q7_t * pSrc,
<> 129:0ab6a29f35bf 2986 q7_t * pDst,
<> 129:0ab6a29f35bf 2987 uint32_t blockSize);
<> 129:0ab6a29f35bf 2988
<> 129:0ab6a29f35bf 2989 /**
<> 129:0ab6a29f35bf 2990 * @brief Copies the elements of a Q15 vector.
<> 129:0ab6a29f35bf 2991 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 2992 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 2993 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 2994 * @return none.
<> 129:0ab6a29f35bf 2995 */
<> 129:0ab6a29f35bf 2996 void arm_copy_q15(
<> 129:0ab6a29f35bf 2997 q15_t * pSrc,
<> 129:0ab6a29f35bf 2998 q15_t * pDst,
<> 129:0ab6a29f35bf 2999 uint32_t blockSize);
<> 129:0ab6a29f35bf 3000
<> 129:0ab6a29f35bf 3001 /**
<> 129:0ab6a29f35bf 3002 * @brief Copies the elements of a Q31 vector.
<> 129:0ab6a29f35bf 3003 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 3004 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 3005 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 3006 * @return none.
<> 129:0ab6a29f35bf 3007 */
<> 129:0ab6a29f35bf 3008 void arm_copy_q31(
<> 129:0ab6a29f35bf 3009 q31_t * pSrc,
<> 129:0ab6a29f35bf 3010 q31_t * pDst,
<> 129:0ab6a29f35bf 3011 uint32_t blockSize);
<> 129:0ab6a29f35bf 3012 /**
<> 129:0ab6a29f35bf 3013 * @brief Fills a constant value into a floating-point vector.
<> 129:0ab6a29f35bf 3014 * @param[in] value input value to be filled
<> 129:0ab6a29f35bf 3015 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 3016 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 3017 * @return none.
<> 129:0ab6a29f35bf 3018 */
<> 129:0ab6a29f35bf 3019 void arm_fill_f32(
<> 129:0ab6a29f35bf 3020 float32_t value,
<> 129:0ab6a29f35bf 3021 float32_t * pDst,
<> 129:0ab6a29f35bf 3022 uint32_t blockSize);
<> 129:0ab6a29f35bf 3023
<> 129:0ab6a29f35bf 3024 /**
<> 129:0ab6a29f35bf 3025 * @brief Fills a constant value into a Q7 vector.
<> 129:0ab6a29f35bf 3026 * @param[in] value input value to be filled
<> 129:0ab6a29f35bf 3027 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 3028 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 3029 * @return none.
<> 129:0ab6a29f35bf 3030 */
<> 129:0ab6a29f35bf 3031 void arm_fill_q7(
<> 129:0ab6a29f35bf 3032 q7_t value,
<> 129:0ab6a29f35bf 3033 q7_t * pDst,
<> 129:0ab6a29f35bf 3034 uint32_t blockSize);
<> 129:0ab6a29f35bf 3035
<> 129:0ab6a29f35bf 3036 /**
<> 129:0ab6a29f35bf 3037 * @brief Fills a constant value into a Q15 vector.
<> 129:0ab6a29f35bf 3038 * @param[in] value input value to be filled
<> 129:0ab6a29f35bf 3039 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 3040 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 3041 * @return none.
<> 129:0ab6a29f35bf 3042 */
<> 129:0ab6a29f35bf 3043 void arm_fill_q15(
<> 129:0ab6a29f35bf 3044 q15_t value,
<> 129:0ab6a29f35bf 3045 q15_t * pDst,
<> 129:0ab6a29f35bf 3046 uint32_t blockSize);
<> 129:0ab6a29f35bf 3047
<> 129:0ab6a29f35bf 3048 /**
<> 129:0ab6a29f35bf 3049 * @brief Fills a constant value into a Q31 vector.
<> 129:0ab6a29f35bf 3050 * @param[in] value input value to be filled
<> 129:0ab6a29f35bf 3051 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 3052 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 3053 * @return none.
<> 129:0ab6a29f35bf 3054 */
<> 129:0ab6a29f35bf 3055 void arm_fill_q31(
<> 129:0ab6a29f35bf 3056 q31_t value,
<> 129:0ab6a29f35bf 3057 q31_t * pDst,
<> 129:0ab6a29f35bf 3058 uint32_t blockSize);
<> 129:0ab6a29f35bf 3059
<> 129:0ab6a29f35bf 3060 /**
<> 129:0ab6a29f35bf 3061 * @brief Convolution of floating-point sequences.
<> 129:0ab6a29f35bf 3062 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3063 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3064 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3065 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3066 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3067 * @return none.
<> 129:0ab6a29f35bf 3068 */
<> 129:0ab6a29f35bf 3069
<> 129:0ab6a29f35bf 3070 void arm_conv_f32(
<> 129:0ab6a29f35bf 3071 float32_t * pSrcA,
<> 129:0ab6a29f35bf 3072 uint32_t srcALen,
<> 129:0ab6a29f35bf 3073 float32_t * pSrcB,
<> 129:0ab6a29f35bf 3074 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3075 float32_t * pDst);
<> 129:0ab6a29f35bf 3076
<> 129:0ab6a29f35bf 3077
<> 129:0ab6a29f35bf 3078 /**
<> 129:0ab6a29f35bf 3079 * @brief Convolution of Q15 sequences.
<> 129:0ab6a29f35bf 3080 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3081 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3082 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3083 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3084 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3085 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3086 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 3087 * @return none.
<> 129:0ab6a29f35bf 3088 */
<> 129:0ab6a29f35bf 3089
<> 129:0ab6a29f35bf 3090
<> 129:0ab6a29f35bf 3091 void arm_conv_opt_q15(
<> 129:0ab6a29f35bf 3092 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3093 uint32_t srcALen,
<> 129:0ab6a29f35bf 3094 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3095 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3096 q15_t * pDst,
<> 129:0ab6a29f35bf 3097 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3098 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3099
<> 129:0ab6a29f35bf 3100
<> 129:0ab6a29f35bf 3101 /**
<> 129:0ab6a29f35bf 3102 * @brief Convolution of Q15 sequences.
<> 129:0ab6a29f35bf 3103 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3104 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3105 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3106 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3107 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3108 * @return none.
<> 129:0ab6a29f35bf 3109 */
<> 129:0ab6a29f35bf 3110
<> 129:0ab6a29f35bf 3111 void arm_conv_q15(
<> 129:0ab6a29f35bf 3112 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3113 uint32_t srcALen,
<> 129:0ab6a29f35bf 3114 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3115 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3116 q15_t * pDst);
<> 129:0ab6a29f35bf 3117
<> 129:0ab6a29f35bf 3118 /**
<> 129:0ab6a29f35bf 3119 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3120 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3121 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3122 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3123 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3124 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3125 * @return none.
<> 129:0ab6a29f35bf 3126 */
<> 129:0ab6a29f35bf 3127
<> 129:0ab6a29f35bf 3128 void arm_conv_fast_q15(
<> 129:0ab6a29f35bf 3129 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3130 uint32_t srcALen,
<> 129:0ab6a29f35bf 3131 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3132 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3133 q15_t * pDst);
<> 129:0ab6a29f35bf 3134
<> 129:0ab6a29f35bf 3135 /**
<> 129:0ab6a29f35bf 3136 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3137 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3138 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3139 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3140 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3141 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3142 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3143 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 3144 * @return none.
<> 129:0ab6a29f35bf 3145 */
<> 129:0ab6a29f35bf 3146
<> 129:0ab6a29f35bf 3147 void arm_conv_fast_opt_q15(
<> 129:0ab6a29f35bf 3148 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3149 uint32_t srcALen,
<> 129:0ab6a29f35bf 3150 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3151 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3152 q15_t * pDst,
<> 129:0ab6a29f35bf 3153 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3154 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3155
<> 129:0ab6a29f35bf 3156
<> 129:0ab6a29f35bf 3157
<> 129:0ab6a29f35bf 3158 /**
<> 129:0ab6a29f35bf 3159 * @brief Convolution of Q31 sequences.
<> 129:0ab6a29f35bf 3160 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3161 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3162 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3163 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3164 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3165 * @return none.
<> 129:0ab6a29f35bf 3166 */
<> 129:0ab6a29f35bf 3167
<> 129:0ab6a29f35bf 3168 void arm_conv_q31(
<> 129:0ab6a29f35bf 3169 q31_t * pSrcA,
<> 129:0ab6a29f35bf 3170 uint32_t srcALen,
<> 129:0ab6a29f35bf 3171 q31_t * pSrcB,
<> 129:0ab6a29f35bf 3172 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3173 q31_t * pDst);
<> 129:0ab6a29f35bf 3174
<> 129:0ab6a29f35bf 3175 /**
<> 129:0ab6a29f35bf 3176 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3177 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3178 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3179 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3180 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3181 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3182 * @return none.
<> 129:0ab6a29f35bf 3183 */
<> 129:0ab6a29f35bf 3184
<> 129:0ab6a29f35bf 3185 void arm_conv_fast_q31(
<> 129:0ab6a29f35bf 3186 q31_t * pSrcA,
<> 129:0ab6a29f35bf 3187 uint32_t srcALen,
<> 129:0ab6a29f35bf 3188 q31_t * pSrcB,
<> 129:0ab6a29f35bf 3189 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3190 q31_t * pDst);
<> 129:0ab6a29f35bf 3191
<> 129:0ab6a29f35bf 3192
<> 129:0ab6a29f35bf 3193 /**
<> 129:0ab6a29f35bf 3194 * @brief Convolution of Q7 sequences.
<> 129:0ab6a29f35bf 3195 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3196 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3197 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3198 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3199 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3200 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3201 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 3202 * @return none.
<> 129:0ab6a29f35bf 3203 */
<> 129:0ab6a29f35bf 3204
<> 129:0ab6a29f35bf 3205 void arm_conv_opt_q7(
<> 129:0ab6a29f35bf 3206 q7_t * pSrcA,
<> 129:0ab6a29f35bf 3207 uint32_t srcALen,
<> 129:0ab6a29f35bf 3208 q7_t * pSrcB,
<> 129:0ab6a29f35bf 3209 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3210 q7_t * pDst,
<> 129:0ab6a29f35bf 3211 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3212 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3213
<> 129:0ab6a29f35bf 3214
<> 129:0ab6a29f35bf 3215
<> 129:0ab6a29f35bf 3216 /**
<> 129:0ab6a29f35bf 3217 * @brief Convolution of Q7 sequences.
<> 129:0ab6a29f35bf 3218 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3219 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3220 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3221 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3222 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 129:0ab6a29f35bf 3223 * @return none.
<> 129:0ab6a29f35bf 3224 */
<> 129:0ab6a29f35bf 3225
<> 129:0ab6a29f35bf 3226 void arm_conv_q7(
<> 129:0ab6a29f35bf 3227 q7_t * pSrcA,
<> 129:0ab6a29f35bf 3228 uint32_t srcALen,
<> 129:0ab6a29f35bf 3229 q7_t * pSrcB,
<> 129:0ab6a29f35bf 3230 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3231 q7_t * pDst);
<> 129:0ab6a29f35bf 3232
<> 129:0ab6a29f35bf 3233
<> 129:0ab6a29f35bf 3234 /**
<> 129:0ab6a29f35bf 3235 * @brief Partial convolution of floating-point sequences.
<> 129:0ab6a29f35bf 3236 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3237 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3238 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3239 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3240 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3241 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3242 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3244 */
<> 129:0ab6a29f35bf 3245
<> 129:0ab6a29f35bf 3246 arm_status arm_conv_partial_f32(
<> 129:0ab6a29f35bf 3247 float32_t * pSrcA,
<> 129:0ab6a29f35bf 3248 uint32_t srcALen,
<> 129:0ab6a29f35bf 3249 float32_t * pSrcB,
<> 129:0ab6a29f35bf 3250 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3251 float32_t * pDst,
<> 129:0ab6a29f35bf 3252 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3253 uint32_t numPoints);
<> 129:0ab6a29f35bf 3254
<> 129:0ab6a29f35bf 3255 /**
<> 129:0ab6a29f35bf 3256 * @brief Partial convolution of Q15 sequences.
<> 129:0ab6a29f35bf 3257 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3258 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3259 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3260 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3261 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3262 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3263 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 3264 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3265 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3267 */
<> 129:0ab6a29f35bf 3268
<> 129:0ab6a29f35bf 3269 arm_status arm_conv_partial_opt_q15(
<> 129:0ab6a29f35bf 3270 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3271 uint32_t srcALen,
<> 129:0ab6a29f35bf 3272 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3273 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3274 q15_t * pDst,
<> 129:0ab6a29f35bf 3275 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3276 uint32_t numPoints,
<> 129:0ab6a29f35bf 3277 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3278 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3279
<> 129:0ab6a29f35bf 3280
<> 129:0ab6a29f35bf 3281 /**
<> 129:0ab6a29f35bf 3282 * @brief Partial convolution of Q15 sequences.
<> 129:0ab6a29f35bf 3283 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3284 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3285 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3286 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3287 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3288 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3289 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3291 */
<> 129:0ab6a29f35bf 3292
<> 129:0ab6a29f35bf 3293 arm_status arm_conv_partial_q15(
<> 129:0ab6a29f35bf 3294 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3295 uint32_t srcALen,
<> 129:0ab6a29f35bf 3296 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3297 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3298 q15_t * pDst,
<> 129:0ab6a29f35bf 3299 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3300 uint32_t numPoints);
<> 129:0ab6a29f35bf 3301
<> 129:0ab6a29f35bf 3302 /**
<> 129:0ab6a29f35bf 3303 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3304 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3305 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3306 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3307 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3308 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3309 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3310 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3312 */
<> 129:0ab6a29f35bf 3313
<> 129:0ab6a29f35bf 3314 arm_status arm_conv_partial_fast_q15(
<> 129:0ab6a29f35bf 3315 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3316 uint32_t srcALen,
<> 129:0ab6a29f35bf 3317 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3318 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3319 q15_t * pDst,
<> 129:0ab6a29f35bf 3320 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3321 uint32_t numPoints);
<> 129:0ab6a29f35bf 3322
<> 129:0ab6a29f35bf 3323
<> 129:0ab6a29f35bf 3324 /**
<> 129:0ab6a29f35bf 3325 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3326 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3327 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3328 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3329 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3330 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3331 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3332 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 3333 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3334 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3336 */
<> 129:0ab6a29f35bf 3337
<> 129:0ab6a29f35bf 3338 arm_status arm_conv_partial_fast_opt_q15(
<> 129:0ab6a29f35bf 3339 q15_t * pSrcA,
<> 129:0ab6a29f35bf 3340 uint32_t srcALen,
<> 129:0ab6a29f35bf 3341 q15_t * pSrcB,
<> 129:0ab6a29f35bf 3342 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3343 q15_t * pDst,
<> 129:0ab6a29f35bf 3344 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3345 uint32_t numPoints,
<> 129:0ab6a29f35bf 3346 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3347 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3348
<> 129:0ab6a29f35bf 3349
<> 129:0ab6a29f35bf 3350 /**
<> 129:0ab6a29f35bf 3351 * @brief Partial convolution of Q31 sequences.
<> 129:0ab6a29f35bf 3352 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3353 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3354 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3355 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3356 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3357 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3358 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3360 */
<> 129:0ab6a29f35bf 3361
<> 129:0ab6a29f35bf 3362 arm_status arm_conv_partial_q31(
<> 129:0ab6a29f35bf 3363 q31_t * pSrcA,
<> 129:0ab6a29f35bf 3364 uint32_t srcALen,
<> 129:0ab6a29f35bf 3365 q31_t * pSrcB,
<> 129:0ab6a29f35bf 3366 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3367 q31_t * pDst,
<> 129:0ab6a29f35bf 3368 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3369 uint32_t numPoints);
<> 129:0ab6a29f35bf 3370
<> 129:0ab6a29f35bf 3371
<> 129:0ab6a29f35bf 3372 /**
<> 129:0ab6a29f35bf 3373 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 3374 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3375 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3376 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3377 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3378 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3379 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3380 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3382 */
<> 129:0ab6a29f35bf 3383
<> 129:0ab6a29f35bf 3384 arm_status arm_conv_partial_fast_q31(
<> 129:0ab6a29f35bf 3385 q31_t * pSrcA,
<> 129:0ab6a29f35bf 3386 uint32_t srcALen,
<> 129:0ab6a29f35bf 3387 q31_t * pSrcB,
<> 129:0ab6a29f35bf 3388 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3389 q31_t * pDst,
<> 129:0ab6a29f35bf 3390 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3391 uint32_t numPoints);
<> 129:0ab6a29f35bf 3392
<> 129:0ab6a29f35bf 3393
<> 129:0ab6a29f35bf 3394 /**
<> 129:0ab6a29f35bf 3395 * @brief Partial convolution of Q7 sequences
<> 129:0ab6a29f35bf 3396 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3397 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3398 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3399 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3400 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3401 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3402 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 3403 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 3404 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3406 */
<> 129:0ab6a29f35bf 3407
<> 129:0ab6a29f35bf 3408 arm_status arm_conv_partial_opt_q7(
<> 129:0ab6a29f35bf 3409 q7_t * pSrcA,
<> 129:0ab6a29f35bf 3410 uint32_t srcALen,
<> 129:0ab6a29f35bf 3411 q7_t * pSrcB,
<> 129:0ab6a29f35bf 3412 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3413 q7_t * pDst,
<> 129:0ab6a29f35bf 3414 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3415 uint32_t numPoints,
<> 129:0ab6a29f35bf 3416 q15_t * pScratch1,
<> 129:0ab6a29f35bf 3417 q15_t * pScratch2);
<> 129:0ab6a29f35bf 3418
<> 129:0ab6a29f35bf 3419
<> 129:0ab6a29f35bf 3420 /**
<> 129:0ab6a29f35bf 3421 * @brief Partial convolution of Q7 sequences.
<> 129:0ab6a29f35bf 3422 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 3423 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 3424 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 3425 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 3426 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3427 * @param[in] firstIndex is the first output sample to start with.
<> 129:0ab6a29f35bf 3428 * @param[in] numPoints is the number of output points to be computed.
<> 129:0ab6a29f35bf 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].
<> 129:0ab6a29f35bf 3430 */
<> 129:0ab6a29f35bf 3431
<> 129:0ab6a29f35bf 3432 arm_status arm_conv_partial_q7(
<> 129:0ab6a29f35bf 3433 q7_t * pSrcA,
<> 129:0ab6a29f35bf 3434 uint32_t srcALen,
<> 129:0ab6a29f35bf 3435 q7_t * pSrcB,
<> 129:0ab6a29f35bf 3436 uint32_t srcBLen,
<> 129:0ab6a29f35bf 3437 q7_t * pDst,
<> 129:0ab6a29f35bf 3438 uint32_t firstIndex,
<> 129:0ab6a29f35bf 3439 uint32_t numPoints);
<> 129:0ab6a29f35bf 3440
<> 129:0ab6a29f35bf 3441
<> 129:0ab6a29f35bf 3442
<> 129:0ab6a29f35bf 3443 /**
<> 129:0ab6a29f35bf 3444 * @brief Instance structure for the Q15 FIR decimator.
<> 129:0ab6a29f35bf 3445 */
<> 129:0ab6a29f35bf 3446
<> 129:0ab6a29f35bf 3447 typedef struct
<> 129:0ab6a29f35bf 3448 {
<> 129:0ab6a29f35bf 3449 uint8_t M; /**< decimation factor. */
<> 129:0ab6a29f35bf 3450 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 3451 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 3452 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 3453 } arm_fir_decimate_instance_q15;
<> 129:0ab6a29f35bf 3454
<> 129:0ab6a29f35bf 3455 /**
<> 129:0ab6a29f35bf 3456 * @brief Instance structure for the Q31 FIR decimator.
<> 129:0ab6a29f35bf 3457 */
<> 129:0ab6a29f35bf 3458
<> 129:0ab6a29f35bf 3459 typedef struct
<> 129:0ab6a29f35bf 3460 {
<> 129:0ab6a29f35bf 3461 uint8_t M; /**< decimation factor. */
<> 129:0ab6a29f35bf 3462 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 3463 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 3464 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 3465
<> 129:0ab6a29f35bf 3466 } arm_fir_decimate_instance_q31;
<> 129:0ab6a29f35bf 3467
<> 129:0ab6a29f35bf 3468 /**
<> 129:0ab6a29f35bf 3469 * @brief Instance structure for the floating-point FIR decimator.
<> 129:0ab6a29f35bf 3470 */
<> 129:0ab6a29f35bf 3471
<> 129:0ab6a29f35bf 3472 typedef struct
<> 129:0ab6a29f35bf 3473 {
<> 129:0ab6a29f35bf 3474 uint8_t M; /**< decimation factor. */
<> 129:0ab6a29f35bf 3475 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 3476 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 3477 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 3478
<> 129:0ab6a29f35bf 3479 } arm_fir_decimate_instance_f32;
<> 129:0ab6a29f35bf 3480
<> 129:0ab6a29f35bf 3481
<> 129:0ab6a29f35bf 3482
<> 129:0ab6a29f35bf 3483 /**
<> 129:0ab6a29f35bf 3484 * @brief Processing function for the floating-point FIR decimator.
<> 129:0ab6a29f35bf 3485 * @param[in] *S points to an instance of the floating-point FIR decimator structure.
<> 129:0ab6a29f35bf 3486 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3487 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3488 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3489 * @return none
<> 129:0ab6a29f35bf 3490 */
<> 129:0ab6a29f35bf 3491
<> 129:0ab6a29f35bf 3492 void arm_fir_decimate_f32(
<> 129:0ab6a29f35bf 3493 const arm_fir_decimate_instance_f32 * S,
<> 129:0ab6a29f35bf 3494 float32_t * pSrc,
<> 129:0ab6a29f35bf 3495 float32_t * pDst,
<> 129:0ab6a29f35bf 3496 uint32_t blockSize);
<> 129:0ab6a29f35bf 3497
<> 129:0ab6a29f35bf 3498
<> 129:0ab6a29f35bf 3499 /**
<> 129:0ab6a29f35bf 3500 * @brief Initialization function for the floating-point FIR decimator.
<> 129:0ab6a29f35bf 3501 * @param[in,out] *S points to an instance of the floating-point FIR decimator structure.
<> 129:0ab6a29f35bf 3502 * @param[in] numTaps number of coefficients in the filter.
<> 129:0ab6a29f35bf 3503 * @param[in] M decimation factor.
<> 129:0ab6a29f35bf 3504 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3505 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3506 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3507 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3508 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 129:0ab6a29f35bf 3509 */
<> 129:0ab6a29f35bf 3510
<> 129:0ab6a29f35bf 3511 arm_status arm_fir_decimate_init_f32(
<> 129:0ab6a29f35bf 3512 arm_fir_decimate_instance_f32 * S,
<> 129:0ab6a29f35bf 3513 uint16_t numTaps,
<> 129:0ab6a29f35bf 3514 uint8_t M,
<> 129:0ab6a29f35bf 3515 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 3516 float32_t * pState,
<> 129:0ab6a29f35bf 3517 uint32_t blockSize);
<> 129:0ab6a29f35bf 3518
<> 129:0ab6a29f35bf 3519 /**
<> 129:0ab6a29f35bf 3520 * @brief Processing function for the Q15 FIR decimator.
<> 129:0ab6a29f35bf 3521 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 129:0ab6a29f35bf 3522 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3523 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3524 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3525 * @return none
<> 129:0ab6a29f35bf 3526 */
<> 129:0ab6a29f35bf 3527
<> 129:0ab6a29f35bf 3528 void arm_fir_decimate_q15(
<> 129:0ab6a29f35bf 3529 const arm_fir_decimate_instance_q15 * S,
<> 129:0ab6a29f35bf 3530 q15_t * pSrc,
<> 129:0ab6a29f35bf 3531 q15_t * pDst,
<> 129:0ab6a29f35bf 3532 uint32_t blockSize);
<> 129:0ab6a29f35bf 3533
<> 129:0ab6a29f35bf 3534 /**
<> 129:0ab6a29f35bf 3535 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 3536 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 129:0ab6a29f35bf 3537 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3538 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3539 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3540 * @return none
<> 129:0ab6a29f35bf 3541 */
<> 129:0ab6a29f35bf 3542
<> 129:0ab6a29f35bf 3543 void arm_fir_decimate_fast_q15(
<> 129:0ab6a29f35bf 3544 const arm_fir_decimate_instance_q15 * S,
<> 129:0ab6a29f35bf 3545 q15_t * pSrc,
<> 129:0ab6a29f35bf 3546 q15_t * pDst,
<> 129:0ab6a29f35bf 3547 uint32_t blockSize);
<> 129:0ab6a29f35bf 3548
<> 129:0ab6a29f35bf 3549
<> 129:0ab6a29f35bf 3550
<> 129:0ab6a29f35bf 3551 /**
<> 129:0ab6a29f35bf 3552 * @brief Initialization function for the Q15 FIR decimator.
<> 129:0ab6a29f35bf 3553 * @param[in,out] *S points to an instance of the Q15 FIR decimator structure.
<> 129:0ab6a29f35bf 3554 * @param[in] numTaps number of coefficients in the filter.
<> 129:0ab6a29f35bf 3555 * @param[in] M decimation factor.
<> 129:0ab6a29f35bf 3556 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3557 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3558 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3559 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3560 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 129:0ab6a29f35bf 3561 */
<> 129:0ab6a29f35bf 3562
<> 129:0ab6a29f35bf 3563 arm_status arm_fir_decimate_init_q15(
<> 129:0ab6a29f35bf 3564 arm_fir_decimate_instance_q15 * S,
<> 129:0ab6a29f35bf 3565 uint16_t numTaps,
<> 129:0ab6a29f35bf 3566 uint8_t M,
<> 129:0ab6a29f35bf 3567 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 3568 q15_t * pState,
<> 129:0ab6a29f35bf 3569 uint32_t blockSize);
<> 129:0ab6a29f35bf 3570
<> 129:0ab6a29f35bf 3571 /**
<> 129:0ab6a29f35bf 3572 * @brief Processing function for the Q31 FIR decimator.
<> 129:0ab6a29f35bf 3573 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 129:0ab6a29f35bf 3574 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3575 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3576 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3577 * @return none
<> 129:0ab6a29f35bf 3578 */
<> 129:0ab6a29f35bf 3579
<> 129:0ab6a29f35bf 3580 void arm_fir_decimate_q31(
<> 129:0ab6a29f35bf 3581 const arm_fir_decimate_instance_q31 * S,
<> 129:0ab6a29f35bf 3582 q31_t * pSrc,
<> 129:0ab6a29f35bf 3583 q31_t * pDst,
<> 129:0ab6a29f35bf 3584 uint32_t blockSize);
<> 129:0ab6a29f35bf 3585
<> 129:0ab6a29f35bf 3586 /**
<> 129:0ab6a29f35bf 3587 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 3588 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 129:0ab6a29f35bf 3589 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3590 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3591 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3592 * @return none
<> 129:0ab6a29f35bf 3593 */
<> 129:0ab6a29f35bf 3594
<> 129:0ab6a29f35bf 3595 void arm_fir_decimate_fast_q31(
<> 129:0ab6a29f35bf 3596 arm_fir_decimate_instance_q31 * S,
<> 129:0ab6a29f35bf 3597 q31_t * pSrc,
<> 129:0ab6a29f35bf 3598 q31_t * pDst,
<> 129:0ab6a29f35bf 3599 uint32_t blockSize);
<> 129:0ab6a29f35bf 3600
<> 129:0ab6a29f35bf 3601
<> 129:0ab6a29f35bf 3602 /**
<> 129:0ab6a29f35bf 3603 * @brief Initialization function for the Q31 FIR decimator.
<> 129:0ab6a29f35bf 3604 * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
<> 129:0ab6a29f35bf 3605 * @param[in] numTaps number of coefficients in the filter.
<> 129:0ab6a29f35bf 3606 * @param[in] M decimation factor.
<> 129:0ab6a29f35bf 3607 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3608 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3609 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3610 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3611 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 129:0ab6a29f35bf 3612 */
<> 129:0ab6a29f35bf 3613
<> 129:0ab6a29f35bf 3614 arm_status arm_fir_decimate_init_q31(
<> 129:0ab6a29f35bf 3615 arm_fir_decimate_instance_q31 * S,
<> 129:0ab6a29f35bf 3616 uint16_t numTaps,
<> 129:0ab6a29f35bf 3617 uint8_t M,
<> 129:0ab6a29f35bf 3618 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 3619 q31_t * pState,
<> 129:0ab6a29f35bf 3620 uint32_t blockSize);
<> 129:0ab6a29f35bf 3621
<> 129:0ab6a29f35bf 3622
<> 129:0ab6a29f35bf 3623
<> 129:0ab6a29f35bf 3624 /**
<> 129:0ab6a29f35bf 3625 * @brief Instance structure for the Q15 FIR interpolator.
<> 129:0ab6a29f35bf 3626 */
<> 129:0ab6a29f35bf 3627
<> 129:0ab6a29f35bf 3628 typedef struct
<> 129:0ab6a29f35bf 3629 {
<> 129:0ab6a29f35bf 3630 uint8_t L; /**< upsample factor. */
<> 129:0ab6a29f35bf 3631 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 129:0ab6a29f35bf 3632 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 129:0ab6a29f35bf 3633 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 129:0ab6a29f35bf 3634 } arm_fir_interpolate_instance_q15;
<> 129:0ab6a29f35bf 3635
<> 129:0ab6a29f35bf 3636 /**
<> 129:0ab6a29f35bf 3637 * @brief Instance structure for the Q31 FIR interpolator.
<> 129:0ab6a29f35bf 3638 */
<> 129:0ab6a29f35bf 3639
<> 129:0ab6a29f35bf 3640 typedef struct
<> 129:0ab6a29f35bf 3641 {
<> 129:0ab6a29f35bf 3642 uint8_t L; /**< upsample factor. */
<> 129:0ab6a29f35bf 3643 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 129:0ab6a29f35bf 3644 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 129:0ab6a29f35bf 3645 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 129:0ab6a29f35bf 3646 } arm_fir_interpolate_instance_q31;
<> 129:0ab6a29f35bf 3647
<> 129:0ab6a29f35bf 3648 /**
<> 129:0ab6a29f35bf 3649 * @brief Instance structure for the floating-point FIR interpolator.
<> 129:0ab6a29f35bf 3650 */
<> 129:0ab6a29f35bf 3651
<> 129:0ab6a29f35bf 3652 typedef struct
<> 129:0ab6a29f35bf 3653 {
<> 129:0ab6a29f35bf 3654 uint8_t L; /**< upsample factor. */
<> 129:0ab6a29f35bf 3655 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 129:0ab6a29f35bf 3656 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 129:0ab6a29f35bf 3657 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
<> 129:0ab6a29f35bf 3658 } arm_fir_interpolate_instance_f32;
<> 129:0ab6a29f35bf 3659
<> 129:0ab6a29f35bf 3660
<> 129:0ab6a29f35bf 3661 /**
<> 129:0ab6a29f35bf 3662 * @brief Processing function for the Q15 FIR interpolator.
<> 129:0ab6a29f35bf 3663 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 129:0ab6a29f35bf 3664 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3665 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 3666 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3667 * @return none.
<> 129:0ab6a29f35bf 3668 */
<> 129:0ab6a29f35bf 3669
<> 129:0ab6a29f35bf 3670 void arm_fir_interpolate_q15(
<> 129:0ab6a29f35bf 3671 const arm_fir_interpolate_instance_q15 * S,
<> 129:0ab6a29f35bf 3672 q15_t * pSrc,
<> 129:0ab6a29f35bf 3673 q15_t * pDst,
<> 129:0ab6a29f35bf 3674 uint32_t blockSize);
<> 129:0ab6a29f35bf 3675
<> 129:0ab6a29f35bf 3676
<> 129:0ab6a29f35bf 3677 /**
<> 129:0ab6a29f35bf 3678 * @brief Initialization function for the Q15 FIR interpolator.
<> 129:0ab6a29f35bf 3679 * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure.
<> 129:0ab6a29f35bf 3680 * @param[in] L upsample factor.
<> 129:0ab6a29f35bf 3681 * @param[in] numTaps number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 3682 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 129:0ab6a29f35bf 3683 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3684 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3685 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3686 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 129:0ab6a29f35bf 3687 */
<> 129:0ab6a29f35bf 3688
<> 129:0ab6a29f35bf 3689 arm_status arm_fir_interpolate_init_q15(
<> 129:0ab6a29f35bf 3690 arm_fir_interpolate_instance_q15 * S,
<> 129:0ab6a29f35bf 3691 uint8_t L,
<> 129:0ab6a29f35bf 3692 uint16_t numTaps,
<> 129:0ab6a29f35bf 3693 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 3694 q15_t * pState,
<> 129:0ab6a29f35bf 3695 uint32_t blockSize);
<> 129:0ab6a29f35bf 3696
<> 129:0ab6a29f35bf 3697 /**
<> 129:0ab6a29f35bf 3698 * @brief Processing function for the Q31 FIR interpolator.
<> 129:0ab6a29f35bf 3699 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 129:0ab6a29f35bf 3700 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3701 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 3702 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3703 * @return none.
<> 129:0ab6a29f35bf 3704 */
<> 129:0ab6a29f35bf 3705
<> 129:0ab6a29f35bf 3706 void arm_fir_interpolate_q31(
<> 129:0ab6a29f35bf 3707 const arm_fir_interpolate_instance_q31 * S,
<> 129:0ab6a29f35bf 3708 q31_t * pSrc,
<> 129:0ab6a29f35bf 3709 q31_t * pDst,
<> 129:0ab6a29f35bf 3710 uint32_t blockSize);
<> 129:0ab6a29f35bf 3711
<> 129:0ab6a29f35bf 3712 /**
<> 129:0ab6a29f35bf 3713 * @brief Initialization function for the Q31 FIR interpolator.
<> 129:0ab6a29f35bf 3714 * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure.
<> 129:0ab6a29f35bf 3715 * @param[in] L upsample factor.
<> 129:0ab6a29f35bf 3716 * @param[in] numTaps number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 3717 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 129:0ab6a29f35bf 3718 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3719 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3720 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3721 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 129:0ab6a29f35bf 3722 */
<> 129:0ab6a29f35bf 3723
<> 129:0ab6a29f35bf 3724 arm_status arm_fir_interpolate_init_q31(
<> 129:0ab6a29f35bf 3725 arm_fir_interpolate_instance_q31 * S,
<> 129:0ab6a29f35bf 3726 uint8_t L,
<> 129:0ab6a29f35bf 3727 uint16_t numTaps,
<> 129:0ab6a29f35bf 3728 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 3729 q31_t * pState,
<> 129:0ab6a29f35bf 3730 uint32_t blockSize);
<> 129:0ab6a29f35bf 3731
<> 129:0ab6a29f35bf 3732
<> 129:0ab6a29f35bf 3733 /**
<> 129:0ab6a29f35bf 3734 * @brief Processing function for the floating-point FIR interpolator.
<> 129:0ab6a29f35bf 3735 * @param[in] *S points to an instance of the floating-point FIR interpolator structure.
<> 129:0ab6a29f35bf 3736 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3737 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 3738 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3739 * @return none.
<> 129:0ab6a29f35bf 3740 */
<> 129:0ab6a29f35bf 3741
<> 129:0ab6a29f35bf 3742 void arm_fir_interpolate_f32(
<> 129:0ab6a29f35bf 3743 const arm_fir_interpolate_instance_f32 * S,
<> 129:0ab6a29f35bf 3744 float32_t * pSrc,
<> 129:0ab6a29f35bf 3745 float32_t * pDst,
<> 129:0ab6a29f35bf 3746 uint32_t blockSize);
<> 129:0ab6a29f35bf 3747
<> 129:0ab6a29f35bf 3748 /**
<> 129:0ab6a29f35bf 3749 * @brief Initialization function for the floating-point FIR interpolator.
<> 129:0ab6a29f35bf 3750 * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure.
<> 129:0ab6a29f35bf 3751 * @param[in] L upsample factor.
<> 129:0ab6a29f35bf 3752 * @param[in] numTaps number of filter coefficients in the filter.
<> 129:0ab6a29f35bf 3753 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 129:0ab6a29f35bf 3754 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3755 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 3756 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 129:0ab6a29f35bf 3757 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 129:0ab6a29f35bf 3758 */
<> 129:0ab6a29f35bf 3759
<> 129:0ab6a29f35bf 3760 arm_status arm_fir_interpolate_init_f32(
<> 129:0ab6a29f35bf 3761 arm_fir_interpolate_instance_f32 * S,
<> 129:0ab6a29f35bf 3762 uint8_t L,
<> 129:0ab6a29f35bf 3763 uint16_t numTaps,
<> 129:0ab6a29f35bf 3764 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 3765 float32_t * pState,
<> 129:0ab6a29f35bf 3766 uint32_t blockSize);
<> 129:0ab6a29f35bf 3767
<> 129:0ab6a29f35bf 3768 /**
<> 129:0ab6a29f35bf 3769 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
<> 129:0ab6a29f35bf 3770 */
<> 129:0ab6a29f35bf 3771
<> 129:0ab6a29f35bf 3772 typedef struct
<> 129:0ab6a29f35bf 3773 {
<> 129:0ab6a29f35bf 3774 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 3775 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 129:0ab6a29f35bf 3776 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 3777 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
<> 129:0ab6a29f35bf 3778
<> 129:0ab6a29f35bf 3779 } arm_biquad_cas_df1_32x64_ins_q31;
<> 129:0ab6a29f35bf 3780
<> 129:0ab6a29f35bf 3781
<> 129:0ab6a29f35bf 3782 /**
<> 129:0ab6a29f35bf 3783 * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 129:0ab6a29f35bf 3784 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3785 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3786 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 3787 * @return none.
<> 129:0ab6a29f35bf 3788 */
<> 129:0ab6a29f35bf 3789
<> 129:0ab6a29f35bf 3790 void arm_biquad_cas_df1_32x64_q31(
<> 129:0ab6a29f35bf 3791 const arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 129:0ab6a29f35bf 3792 q31_t * pSrc,
<> 129:0ab6a29f35bf 3793 q31_t * pDst,
<> 129:0ab6a29f35bf 3794 uint32_t blockSize);
<> 129:0ab6a29f35bf 3795
<> 129:0ab6a29f35bf 3796
<> 129:0ab6a29f35bf 3797 /**
<> 129:0ab6a29f35bf 3798 * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 129:0ab6a29f35bf 3799 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 3800 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3801 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3802 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
<> 129:0ab6a29f35bf 3803 * @return none
<> 129:0ab6a29f35bf 3804 */
<> 129:0ab6a29f35bf 3805
<> 129:0ab6a29f35bf 3806 void arm_biquad_cas_df1_32x64_init_q31(
<> 129:0ab6a29f35bf 3807 arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 129:0ab6a29f35bf 3808 uint8_t numStages,
<> 129:0ab6a29f35bf 3809 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 3810 q63_t * pState,
<> 129:0ab6a29f35bf 3811 uint8_t postShift);
<> 129:0ab6a29f35bf 3812
<> 129:0ab6a29f35bf 3813
<> 129:0ab6a29f35bf 3814
<> 129:0ab6a29f35bf 3815 /**
<> 129:0ab6a29f35bf 3816 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3817 */
<> 129:0ab6a29f35bf 3818
<> 129:0ab6a29f35bf 3819 typedef struct
<> 129:0ab6a29f35bf 3820 {
<> 129:0ab6a29f35bf 3821 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 3822 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 129:0ab6a29f35bf 3823 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 3824 } arm_biquad_cascade_df2T_instance_f32;
<> 129:0ab6a29f35bf 3825
<> 129:0ab6a29f35bf 3826
<> 129:0ab6a29f35bf 3827
<> 129:0ab6a29f35bf 3828 /**
<> 129:0ab6a29f35bf 3829 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3830 */
<> 129:0ab6a29f35bf 3831
<> 129:0ab6a29f35bf 3832 typedef struct
<> 129:0ab6a29f35bf 3833 {
<> 129:0ab6a29f35bf 3834 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 3835 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 129:0ab6a29f35bf 3836 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 3837 } arm_biquad_cascade_stereo_df2T_instance_f32;
<> 129:0ab6a29f35bf 3838
<> 129:0ab6a29f35bf 3839
<> 129:0ab6a29f35bf 3840
<> 129:0ab6a29f35bf 3841 /**
<> 129:0ab6a29f35bf 3842 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3843 */
<> 129:0ab6a29f35bf 3844
<> 129:0ab6a29f35bf 3845 typedef struct
<> 129:0ab6a29f35bf 3846 {
<> 129:0ab6a29f35bf 3847 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 129:0ab6a29f35bf 3848 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 129:0ab6a29f35bf 3849 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 129:0ab6a29f35bf 3850 } arm_biquad_cascade_df2T_instance_f64;
<> 129:0ab6a29f35bf 3851
<> 129:0ab6a29f35bf 3852
<> 129:0ab6a29f35bf 3853 /**
<> 129:0ab6a29f35bf 3854 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3855 * @param[in] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3856 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3857 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3858 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 3859 * @return none.
<> 129:0ab6a29f35bf 3860 */
<> 129:0ab6a29f35bf 3861
<> 129:0ab6a29f35bf 3862 void arm_biquad_cascade_df2T_f32(
<> 129:0ab6a29f35bf 3863 const arm_biquad_cascade_df2T_instance_f32 * S,
<> 129:0ab6a29f35bf 3864 float32_t * pSrc,
<> 129:0ab6a29f35bf 3865 float32_t * pDst,
<> 129:0ab6a29f35bf 3866 uint32_t blockSize);
<> 129:0ab6a29f35bf 3867
<> 129:0ab6a29f35bf 3868
<> 129:0ab6a29f35bf 3869 /**
<> 129:0ab6a29f35bf 3870 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
<> 129:0ab6a29f35bf 3871 * @param[in] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3872 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3873 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3874 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 3875 * @return none.
<> 129:0ab6a29f35bf 3876 */
<> 129:0ab6a29f35bf 3877
<> 129:0ab6a29f35bf 3878 void arm_biquad_cascade_stereo_df2T_f32(
<> 129:0ab6a29f35bf 3879 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 129:0ab6a29f35bf 3880 float32_t * pSrc,
<> 129:0ab6a29f35bf 3881 float32_t * pDst,
<> 129:0ab6a29f35bf 3882 uint32_t blockSize);
<> 129:0ab6a29f35bf 3883
<> 129:0ab6a29f35bf 3884 /**
<> 129:0ab6a29f35bf 3885 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3886 * @param[in] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3887 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 3888 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 3889 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 3890 * @return none.
<> 129:0ab6a29f35bf 3891 */
<> 129:0ab6a29f35bf 3892
<> 129:0ab6a29f35bf 3893 void arm_biquad_cascade_df2T_f64(
<> 129:0ab6a29f35bf 3894 const arm_biquad_cascade_df2T_instance_f64 * S,
<> 129:0ab6a29f35bf 3895 float64_t * pSrc,
<> 129:0ab6a29f35bf 3896 float64_t * pDst,
<> 129:0ab6a29f35bf 3897 uint32_t blockSize);
<> 129:0ab6a29f35bf 3898
<> 129:0ab6a29f35bf 3899
<> 129:0ab6a29f35bf 3900 /**
<> 129:0ab6a29f35bf 3901 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3902 * @param[in,out] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3903 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 3904 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3905 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3906 * @return none
<> 129:0ab6a29f35bf 3907 */
<> 129:0ab6a29f35bf 3908
<> 129:0ab6a29f35bf 3909 void arm_biquad_cascade_df2T_init_f32(
<> 129:0ab6a29f35bf 3910 arm_biquad_cascade_df2T_instance_f32 * S,
<> 129:0ab6a29f35bf 3911 uint8_t numStages,
<> 129:0ab6a29f35bf 3912 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 3913 float32_t * pState);
<> 129:0ab6a29f35bf 3914
<> 129:0ab6a29f35bf 3915
<> 129:0ab6a29f35bf 3916 /**
<> 129:0ab6a29f35bf 3917 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3918 * @param[in,out] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3919 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 3920 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3921 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3922 * @return none
<> 129:0ab6a29f35bf 3923 */
<> 129:0ab6a29f35bf 3924
<> 129:0ab6a29f35bf 3925 void arm_biquad_cascade_stereo_df2T_init_f32(
<> 129:0ab6a29f35bf 3926 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 129:0ab6a29f35bf 3927 uint8_t numStages,
<> 129:0ab6a29f35bf 3928 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 3929 float32_t * pState);
<> 129:0ab6a29f35bf 3930
<> 129:0ab6a29f35bf 3931
<> 129:0ab6a29f35bf 3932 /**
<> 129:0ab6a29f35bf 3933 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 129:0ab6a29f35bf 3934 * @param[in,out] *S points to an instance of the filter data structure.
<> 129:0ab6a29f35bf 3935 * @param[in] numStages number of 2nd order stages in the filter.
<> 129:0ab6a29f35bf 3936 * @param[in] *pCoeffs points to the filter coefficients.
<> 129:0ab6a29f35bf 3937 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 3938 * @return none
<> 129:0ab6a29f35bf 3939 */
<> 129:0ab6a29f35bf 3940
<> 129:0ab6a29f35bf 3941 void arm_biquad_cascade_df2T_init_f64(
<> 129:0ab6a29f35bf 3942 arm_biquad_cascade_df2T_instance_f64 * S,
<> 129:0ab6a29f35bf 3943 uint8_t numStages,
<> 129:0ab6a29f35bf 3944 float64_t * pCoeffs,
<> 129:0ab6a29f35bf 3945 float64_t * pState);
<> 129:0ab6a29f35bf 3946
<> 129:0ab6a29f35bf 3947
<> 129:0ab6a29f35bf 3948
<> 129:0ab6a29f35bf 3949 /**
<> 129:0ab6a29f35bf 3950 * @brief Instance structure for the Q15 FIR lattice filter.
<> 129:0ab6a29f35bf 3951 */
<> 129:0ab6a29f35bf 3952
<> 129:0ab6a29f35bf 3953 typedef struct
<> 129:0ab6a29f35bf 3954 {
<> 129:0ab6a29f35bf 3955 uint16_t numStages; /**< number of filter stages. */
<> 129:0ab6a29f35bf 3956 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3957 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3958 } arm_fir_lattice_instance_q15;
<> 129:0ab6a29f35bf 3959
<> 129:0ab6a29f35bf 3960 /**
<> 129:0ab6a29f35bf 3961 * @brief Instance structure for the Q31 FIR lattice filter.
<> 129:0ab6a29f35bf 3962 */
<> 129:0ab6a29f35bf 3963
<> 129:0ab6a29f35bf 3964 typedef struct
<> 129:0ab6a29f35bf 3965 {
<> 129:0ab6a29f35bf 3966 uint16_t numStages; /**< number of filter stages. */
<> 129:0ab6a29f35bf 3967 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3968 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3969 } arm_fir_lattice_instance_q31;
<> 129:0ab6a29f35bf 3970
<> 129:0ab6a29f35bf 3971 /**
<> 129:0ab6a29f35bf 3972 * @brief Instance structure for the floating-point FIR lattice filter.
<> 129:0ab6a29f35bf 3973 */
<> 129:0ab6a29f35bf 3974
<> 129:0ab6a29f35bf 3975 typedef struct
<> 129:0ab6a29f35bf 3976 {
<> 129:0ab6a29f35bf 3977 uint16_t numStages; /**< number of filter stages. */
<> 129:0ab6a29f35bf 3978 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3979 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 3980 } arm_fir_lattice_instance_f32;
<> 129:0ab6a29f35bf 3981
<> 129:0ab6a29f35bf 3982 /**
<> 129:0ab6a29f35bf 3983 * @brief Initialization function for the Q15 FIR lattice filter.
<> 129:0ab6a29f35bf 3984 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 129:0ab6a29f35bf 3985 * @param[in] numStages number of filter stages.
<> 129:0ab6a29f35bf 3986 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 3987 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 3988 * @return none.
<> 129:0ab6a29f35bf 3989 */
<> 129:0ab6a29f35bf 3990
<> 129:0ab6a29f35bf 3991 void arm_fir_lattice_init_q15(
<> 129:0ab6a29f35bf 3992 arm_fir_lattice_instance_q15 * S,
<> 129:0ab6a29f35bf 3993 uint16_t numStages,
<> 129:0ab6a29f35bf 3994 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 3995 q15_t * pState);
<> 129:0ab6a29f35bf 3996
<> 129:0ab6a29f35bf 3997
<> 129:0ab6a29f35bf 3998 /**
<> 129:0ab6a29f35bf 3999 * @brief Processing function for the Q15 FIR lattice filter.
<> 129:0ab6a29f35bf 4000 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 129:0ab6a29f35bf 4001 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4002 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 4003 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4004 * @return none.
<> 129:0ab6a29f35bf 4005 */
<> 129:0ab6a29f35bf 4006 void arm_fir_lattice_q15(
<> 129:0ab6a29f35bf 4007 const arm_fir_lattice_instance_q15 * S,
<> 129:0ab6a29f35bf 4008 q15_t * pSrc,
<> 129:0ab6a29f35bf 4009 q15_t * pDst,
<> 129:0ab6a29f35bf 4010 uint32_t blockSize);
<> 129:0ab6a29f35bf 4011
<> 129:0ab6a29f35bf 4012 /**
<> 129:0ab6a29f35bf 4013 * @brief Initialization function for the Q31 FIR lattice filter.
<> 129:0ab6a29f35bf 4014 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 129:0ab6a29f35bf 4015 * @param[in] numStages number of filter stages.
<> 129:0ab6a29f35bf 4016 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4017 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4018 * @return none.
<> 129:0ab6a29f35bf 4019 */
<> 129:0ab6a29f35bf 4020
<> 129:0ab6a29f35bf 4021 void arm_fir_lattice_init_q31(
<> 129:0ab6a29f35bf 4022 arm_fir_lattice_instance_q31 * S,
<> 129:0ab6a29f35bf 4023 uint16_t numStages,
<> 129:0ab6a29f35bf 4024 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 4025 q31_t * pState);
<> 129:0ab6a29f35bf 4026
<> 129:0ab6a29f35bf 4027
<> 129:0ab6a29f35bf 4028 /**
<> 129:0ab6a29f35bf 4029 * @brief Processing function for the Q31 FIR lattice filter.
<> 129:0ab6a29f35bf 4030 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 129:0ab6a29f35bf 4031 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4032 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4033 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4034 * @return none.
<> 129:0ab6a29f35bf 4035 */
<> 129:0ab6a29f35bf 4036
<> 129:0ab6a29f35bf 4037 void arm_fir_lattice_q31(
<> 129:0ab6a29f35bf 4038 const arm_fir_lattice_instance_q31 * S,
<> 129:0ab6a29f35bf 4039 q31_t * pSrc,
<> 129:0ab6a29f35bf 4040 q31_t * pDst,
<> 129:0ab6a29f35bf 4041 uint32_t blockSize);
<> 129:0ab6a29f35bf 4042
<> 129:0ab6a29f35bf 4043 /**
<> 129:0ab6a29f35bf 4044 * @brief Initialization function for the floating-point FIR lattice filter.
<> 129:0ab6a29f35bf 4045 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 129:0ab6a29f35bf 4046 * @param[in] numStages number of filter stages.
<> 129:0ab6a29f35bf 4047 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4048 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4049 * @return none.
<> 129:0ab6a29f35bf 4050 */
<> 129:0ab6a29f35bf 4051
<> 129:0ab6a29f35bf 4052 void arm_fir_lattice_init_f32(
<> 129:0ab6a29f35bf 4053 arm_fir_lattice_instance_f32 * S,
<> 129:0ab6a29f35bf 4054 uint16_t numStages,
<> 129:0ab6a29f35bf 4055 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 4056 float32_t * pState);
<> 129:0ab6a29f35bf 4057
<> 129:0ab6a29f35bf 4058 /**
<> 129:0ab6a29f35bf 4059 * @brief Processing function for the floating-point FIR lattice filter.
<> 129:0ab6a29f35bf 4060 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 129:0ab6a29f35bf 4061 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4062 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4063 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4064 * @return none.
<> 129:0ab6a29f35bf 4065 */
<> 129:0ab6a29f35bf 4066
<> 129:0ab6a29f35bf 4067 void arm_fir_lattice_f32(
<> 129:0ab6a29f35bf 4068 const arm_fir_lattice_instance_f32 * S,
<> 129:0ab6a29f35bf 4069 float32_t * pSrc,
<> 129:0ab6a29f35bf 4070 float32_t * pDst,
<> 129:0ab6a29f35bf 4071 uint32_t blockSize);
<> 129:0ab6a29f35bf 4072
<> 129:0ab6a29f35bf 4073 /**
<> 129:0ab6a29f35bf 4074 * @brief Instance structure for the Q15 IIR lattice filter.
<> 129:0ab6a29f35bf 4075 */
<> 129:0ab6a29f35bf 4076 typedef struct
<> 129:0ab6a29f35bf 4077 {
<> 129:0ab6a29f35bf 4078 uint16_t numStages; /**< number of stages in the filter. */
<> 129:0ab6a29f35bf 4079 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 129:0ab6a29f35bf 4080 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 4081 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 129:0ab6a29f35bf 4082 } arm_iir_lattice_instance_q15;
<> 129:0ab6a29f35bf 4083
<> 129:0ab6a29f35bf 4084 /**
<> 129:0ab6a29f35bf 4085 * @brief Instance structure for the Q31 IIR lattice filter.
<> 129:0ab6a29f35bf 4086 */
<> 129:0ab6a29f35bf 4087 typedef struct
<> 129:0ab6a29f35bf 4088 {
<> 129:0ab6a29f35bf 4089 uint16_t numStages; /**< number of stages in the filter. */
<> 129:0ab6a29f35bf 4090 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 129:0ab6a29f35bf 4091 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 4092 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 129:0ab6a29f35bf 4093 } arm_iir_lattice_instance_q31;
<> 129:0ab6a29f35bf 4094
<> 129:0ab6a29f35bf 4095 /**
<> 129:0ab6a29f35bf 4096 * @brief Instance structure for the floating-point IIR lattice filter.
<> 129:0ab6a29f35bf 4097 */
<> 129:0ab6a29f35bf 4098 typedef struct
<> 129:0ab6a29f35bf 4099 {
<> 129:0ab6a29f35bf 4100 uint16_t numStages; /**< number of stages in the filter. */
<> 129:0ab6a29f35bf 4101 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 129:0ab6a29f35bf 4102 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 129:0ab6a29f35bf 4103 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 129:0ab6a29f35bf 4104 } arm_iir_lattice_instance_f32;
<> 129:0ab6a29f35bf 4105
<> 129:0ab6a29f35bf 4106 /**
<> 129:0ab6a29f35bf 4107 * @brief Processing function for the floating-point IIR lattice filter.
<> 129:0ab6a29f35bf 4108 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 129:0ab6a29f35bf 4109 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4110 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 4111 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4112 * @return none.
<> 129:0ab6a29f35bf 4113 */
<> 129:0ab6a29f35bf 4114
<> 129:0ab6a29f35bf 4115 void arm_iir_lattice_f32(
<> 129:0ab6a29f35bf 4116 const arm_iir_lattice_instance_f32 * S,
<> 129:0ab6a29f35bf 4117 float32_t * pSrc,
<> 129:0ab6a29f35bf 4118 float32_t * pDst,
<> 129:0ab6a29f35bf 4119 uint32_t blockSize);
<> 129:0ab6a29f35bf 4120
<> 129:0ab6a29f35bf 4121 /**
<> 129:0ab6a29f35bf 4122 * @brief Initialization function for the floating-point IIR lattice filter.
<> 129:0ab6a29f35bf 4123 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 129:0ab6a29f35bf 4124 * @param[in] numStages number of stages in the filter.
<> 129:0ab6a29f35bf 4125 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4126 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 129:0ab6a29f35bf 4127 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1.
<> 129:0ab6a29f35bf 4128 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4129 * @return none.
<> 129:0ab6a29f35bf 4130 */
<> 129:0ab6a29f35bf 4131
<> 129:0ab6a29f35bf 4132 void arm_iir_lattice_init_f32(
<> 129:0ab6a29f35bf 4133 arm_iir_lattice_instance_f32 * S,
<> 129:0ab6a29f35bf 4134 uint16_t numStages,
<> 129:0ab6a29f35bf 4135 float32_t * pkCoeffs,
<> 129:0ab6a29f35bf 4136 float32_t * pvCoeffs,
<> 129:0ab6a29f35bf 4137 float32_t * pState,
<> 129:0ab6a29f35bf 4138 uint32_t blockSize);
<> 129:0ab6a29f35bf 4139
<> 129:0ab6a29f35bf 4140
<> 129:0ab6a29f35bf 4141 /**
<> 129:0ab6a29f35bf 4142 * @brief Processing function for the Q31 IIR lattice filter.
<> 129:0ab6a29f35bf 4143 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 129:0ab6a29f35bf 4144 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4145 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 4146 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4147 * @return none.
<> 129:0ab6a29f35bf 4148 */
<> 129:0ab6a29f35bf 4149
<> 129:0ab6a29f35bf 4150 void arm_iir_lattice_q31(
<> 129:0ab6a29f35bf 4151 const arm_iir_lattice_instance_q31 * S,
<> 129:0ab6a29f35bf 4152 q31_t * pSrc,
<> 129:0ab6a29f35bf 4153 q31_t * pDst,
<> 129:0ab6a29f35bf 4154 uint32_t blockSize);
<> 129:0ab6a29f35bf 4155
<> 129:0ab6a29f35bf 4156
<> 129:0ab6a29f35bf 4157 /**
<> 129:0ab6a29f35bf 4158 * @brief Initialization function for the Q31 IIR lattice filter.
<> 129:0ab6a29f35bf 4159 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 129:0ab6a29f35bf 4160 * @param[in] numStages number of stages in the filter.
<> 129:0ab6a29f35bf 4161 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4162 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 129:0ab6a29f35bf 4163 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
<> 129:0ab6a29f35bf 4164 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4165 * @return none.
<> 129:0ab6a29f35bf 4166 */
<> 129:0ab6a29f35bf 4167
<> 129:0ab6a29f35bf 4168 void arm_iir_lattice_init_q31(
<> 129:0ab6a29f35bf 4169 arm_iir_lattice_instance_q31 * S,
<> 129:0ab6a29f35bf 4170 uint16_t numStages,
<> 129:0ab6a29f35bf 4171 q31_t * pkCoeffs,
<> 129:0ab6a29f35bf 4172 q31_t * pvCoeffs,
<> 129:0ab6a29f35bf 4173 q31_t * pState,
<> 129:0ab6a29f35bf 4174 uint32_t blockSize);
<> 129:0ab6a29f35bf 4175
<> 129:0ab6a29f35bf 4176
<> 129:0ab6a29f35bf 4177 /**
<> 129:0ab6a29f35bf 4178 * @brief Processing function for the Q15 IIR lattice filter.
<> 129:0ab6a29f35bf 4179 * @param[in] *S points to an instance of the Q15 IIR lattice structure.
<> 129:0ab6a29f35bf 4180 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4181 * @param[out] *pDst points to the block of output data.
<> 129:0ab6a29f35bf 4182 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4183 * @return none.
<> 129:0ab6a29f35bf 4184 */
<> 129:0ab6a29f35bf 4185
<> 129:0ab6a29f35bf 4186 void arm_iir_lattice_q15(
<> 129:0ab6a29f35bf 4187 const arm_iir_lattice_instance_q15 * S,
<> 129:0ab6a29f35bf 4188 q15_t * pSrc,
<> 129:0ab6a29f35bf 4189 q15_t * pDst,
<> 129:0ab6a29f35bf 4190 uint32_t blockSize);
<> 129:0ab6a29f35bf 4191
<> 129:0ab6a29f35bf 4192
<> 129:0ab6a29f35bf 4193 /**
<> 129:0ab6a29f35bf 4194 * @brief Initialization function for the Q15 IIR lattice filter.
<> 129:0ab6a29f35bf 4195 * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
<> 129:0ab6a29f35bf 4196 * @param[in] numStages number of stages in the filter.
<> 129:0ab6a29f35bf 4197 * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
<> 129:0ab6a29f35bf 4198 * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
<> 129:0ab6a29f35bf 4199 * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
<> 129:0ab6a29f35bf 4200 * @param[in] blockSize number of samples to process per call.
<> 129:0ab6a29f35bf 4201 * @return none.
<> 129:0ab6a29f35bf 4202 */
<> 129:0ab6a29f35bf 4203
<> 129:0ab6a29f35bf 4204 void arm_iir_lattice_init_q15(
<> 129:0ab6a29f35bf 4205 arm_iir_lattice_instance_q15 * S,
<> 129:0ab6a29f35bf 4206 uint16_t numStages,
<> 129:0ab6a29f35bf 4207 q15_t * pkCoeffs,
<> 129:0ab6a29f35bf 4208 q15_t * pvCoeffs,
<> 129:0ab6a29f35bf 4209 q15_t * pState,
<> 129:0ab6a29f35bf 4210 uint32_t blockSize);
<> 129:0ab6a29f35bf 4211
<> 129:0ab6a29f35bf 4212 /**
<> 129:0ab6a29f35bf 4213 * @brief Instance structure for the floating-point LMS filter.
<> 129:0ab6a29f35bf 4214 */
<> 129:0ab6a29f35bf 4215
<> 129:0ab6a29f35bf 4216 typedef struct
<> 129:0ab6a29f35bf 4217 {
<> 129:0ab6a29f35bf 4218 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4219 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4220 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4221 float32_t mu; /**< step size that controls filter coefficient updates. */
<> 129:0ab6a29f35bf 4222 } arm_lms_instance_f32;
<> 129:0ab6a29f35bf 4223
<> 129:0ab6a29f35bf 4224 /**
<> 129:0ab6a29f35bf 4225 * @brief Processing function for floating-point LMS filter.
<> 129:0ab6a29f35bf 4226 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 129:0ab6a29f35bf 4227 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4228 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4229 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4230 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4231 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4232 * @return none.
<> 129:0ab6a29f35bf 4233 */
<> 129:0ab6a29f35bf 4234
<> 129:0ab6a29f35bf 4235 void arm_lms_f32(
<> 129:0ab6a29f35bf 4236 const arm_lms_instance_f32 * S,
<> 129:0ab6a29f35bf 4237 float32_t * pSrc,
<> 129:0ab6a29f35bf 4238 float32_t * pRef,
<> 129:0ab6a29f35bf 4239 float32_t * pOut,
<> 129:0ab6a29f35bf 4240 float32_t * pErr,
<> 129:0ab6a29f35bf 4241 uint32_t blockSize);
<> 129:0ab6a29f35bf 4242
<> 129:0ab6a29f35bf 4243 /**
<> 129:0ab6a29f35bf 4244 * @brief Initialization function for floating-point LMS filter.
<> 129:0ab6a29f35bf 4245 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 129:0ab6a29f35bf 4246 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4247 * @param[in] *pCoeffs points to the coefficient buffer.
<> 129:0ab6a29f35bf 4248 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 4249 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4250 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4251 * @return none.
<> 129:0ab6a29f35bf 4252 */
<> 129:0ab6a29f35bf 4253
<> 129:0ab6a29f35bf 4254 void arm_lms_init_f32(
<> 129:0ab6a29f35bf 4255 arm_lms_instance_f32 * S,
<> 129:0ab6a29f35bf 4256 uint16_t numTaps,
<> 129:0ab6a29f35bf 4257 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 4258 float32_t * pState,
<> 129:0ab6a29f35bf 4259 float32_t mu,
<> 129:0ab6a29f35bf 4260 uint32_t blockSize);
<> 129:0ab6a29f35bf 4261
<> 129:0ab6a29f35bf 4262 /**
<> 129:0ab6a29f35bf 4263 * @brief Instance structure for the Q15 LMS filter.
<> 129:0ab6a29f35bf 4264 */
<> 129:0ab6a29f35bf 4265
<> 129:0ab6a29f35bf 4266 typedef struct
<> 129:0ab6a29f35bf 4267 {
<> 129:0ab6a29f35bf 4268 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4269 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4270 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4271 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 129:0ab6a29f35bf 4272 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 129:0ab6a29f35bf 4273 } arm_lms_instance_q15;
<> 129:0ab6a29f35bf 4274
<> 129:0ab6a29f35bf 4275
<> 129:0ab6a29f35bf 4276 /**
<> 129:0ab6a29f35bf 4277 * @brief Initialization function for the Q15 LMS filter.
<> 129:0ab6a29f35bf 4278 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 129:0ab6a29f35bf 4279 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4280 * @param[in] *pCoeffs points to the coefficient buffer.
<> 129:0ab6a29f35bf 4281 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 4282 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4283 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4284 * @param[in] postShift bit shift applied to coefficients.
<> 129:0ab6a29f35bf 4285 * @return none.
<> 129:0ab6a29f35bf 4286 */
<> 129:0ab6a29f35bf 4287
<> 129:0ab6a29f35bf 4288 void arm_lms_init_q15(
<> 129:0ab6a29f35bf 4289 arm_lms_instance_q15 * S,
<> 129:0ab6a29f35bf 4290 uint16_t numTaps,
<> 129:0ab6a29f35bf 4291 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 4292 q15_t * pState,
<> 129:0ab6a29f35bf 4293 q15_t mu,
<> 129:0ab6a29f35bf 4294 uint32_t blockSize,
<> 129:0ab6a29f35bf 4295 uint32_t postShift);
<> 129:0ab6a29f35bf 4296
<> 129:0ab6a29f35bf 4297 /**
<> 129:0ab6a29f35bf 4298 * @brief Processing function for Q15 LMS filter.
<> 129:0ab6a29f35bf 4299 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 129:0ab6a29f35bf 4300 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4301 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4302 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4303 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4304 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4305 * @return none.
<> 129:0ab6a29f35bf 4306 */
<> 129:0ab6a29f35bf 4307
<> 129:0ab6a29f35bf 4308 void arm_lms_q15(
<> 129:0ab6a29f35bf 4309 const arm_lms_instance_q15 * S,
<> 129:0ab6a29f35bf 4310 q15_t * pSrc,
<> 129:0ab6a29f35bf 4311 q15_t * pRef,
<> 129:0ab6a29f35bf 4312 q15_t * pOut,
<> 129:0ab6a29f35bf 4313 q15_t * pErr,
<> 129:0ab6a29f35bf 4314 uint32_t blockSize);
<> 129:0ab6a29f35bf 4315
<> 129:0ab6a29f35bf 4316
<> 129:0ab6a29f35bf 4317 /**
<> 129:0ab6a29f35bf 4318 * @brief Instance structure for the Q31 LMS filter.
<> 129:0ab6a29f35bf 4319 */
<> 129:0ab6a29f35bf 4320
<> 129:0ab6a29f35bf 4321 typedef struct
<> 129:0ab6a29f35bf 4322 {
<> 129:0ab6a29f35bf 4323 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4324 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4325 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4326 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 129:0ab6a29f35bf 4327 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 129:0ab6a29f35bf 4328
<> 129:0ab6a29f35bf 4329 } arm_lms_instance_q31;
<> 129:0ab6a29f35bf 4330
<> 129:0ab6a29f35bf 4331 /**
<> 129:0ab6a29f35bf 4332 * @brief Processing function for Q31 LMS filter.
<> 129:0ab6a29f35bf 4333 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 129:0ab6a29f35bf 4334 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4335 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4336 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4337 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4338 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4339 * @return none.
<> 129:0ab6a29f35bf 4340 */
<> 129:0ab6a29f35bf 4341
<> 129:0ab6a29f35bf 4342 void arm_lms_q31(
<> 129:0ab6a29f35bf 4343 const arm_lms_instance_q31 * S,
<> 129:0ab6a29f35bf 4344 q31_t * pSrc,
<> 129:0ab6a29f35bf 4345 q31_t * pRef,
<> 129:0ab6a29f35bf 4346 q31_t * pOut,
<> 129:0ab6a29f35bf 4347 q31_t * pErr,
<> 129:0ab6a29f35bf 4348 uint32_t blockSize);
<> 129:0ab6a29f35bf 4349
<> 129:0ab6a29f35bf 4350 /**
<> 129:0ab6a29f35bf 4351 * @brief Initialization function for Q31 LMS filter.
<> 129:0ab6a29f35bf 4352 * @param[in] *S points to an instance of the Q31 LMS filter structure.
<> 129:0ab6a29f35bf 4353 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4354 * @param[in] *pCoeffs points to coefficient buffer.
<> 129:0ab6a29f35bf 4355 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 4356 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4357 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4358 * @param[in] postShift bit shift applied to coefficients.
<> 129:0ab6a29f35bf 4359 * @return none.
<> 129:0ab6a29f35bf 4360 */
<> 129:0ab6a29f35bf 4361
<> 129:0ab6a29f35bf 4362 void arm_lms_init_q31(
<> 129:0ab6a29f35bf 4363 arm_lms_instance_q31 * S,
<> 129:0ab6a29f35bf 4364 uint16_t numTaps,
<> 129:0ab6a29f35bf 4365 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 4366 q31_t * pState,
<> 129:0ab6a29f35bf 4367 q31_t mu,
<> 129:0ab6a29f35bf 4368 uint32_t blockSize,
<> 129:0ab6a29f35bf 4369 uint32_t postShift);
<> 129:0ab6a29f35bf 4370
<> 129:0ab6a29f35bf 4371 /**
<> 129:0ab6a29f35bf 4372 * @brief Instance structure for the floating-point normalized LMS filter.
<> 129:0ab6a29f35bf 4373 */
<> 129:0ab6a29f35bf 4374
<> 129:0ab6a29f35bf 4375 typedef struct
<> 129:0ab6a29f35bf 4376 {
<> 129:0ab6a29f35bf 4377 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4378 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4379 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4380 float32_t mu; /**< step size that control filter coefficient updates. */
<> 129:0ab6a29f35bf 4381 float32_t energy; /**< saves previous frame energy. */
<> 129:0ab6a29f35bf 4382 float32_t x0; /**< saves previous input sample. */
<> 129:0ab6a29f35bf 4383 } arm_lms_norm_instance_f32;
<> 129:0ab6a29f35bf 4384
<> 129:0ab6a29f35bf 4385 /**
<> 129:0ab6a29f35bf 4386 * @brief Processing function for floating-point normalized LMS filter.
<> 129:0ab6a29f35bf 4387 * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
<> 129:0ab6a29f35bf 4388 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4389 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4390 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4391 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4392 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4393 * @return none.
<> 129:0ab6a29f35bf 4394 */
<> 129:0ab6a29f35bf 4395
<> 129:0ab6a29f35bf 4396 void arm_lms_norm_f32(
<> 129:0ab6a29f35bf 4397 arm_lms_norm_instance_f32 * S,
<> 129:0ab6a29f35bf 4398 float32_t * pSrc,
<> 129:0ab6a29f35bf 4399 float32_t * pRef,
<> 129:0ab6a29f35bf 4400 float32_t * pOut,
<> 129:0ab6a29f35bf 4401 float32_t * pErr,
<> 129:0ab6a29f35bf 4402 uint32_t blockSize);
<> 129:0ab6a29f35bf 4403
<> 129:0ab6a29f35bf 4404 /**
<> 129:0ab6a29f35bf 4405 * @brief Initialization function for floating-point normalized LMS filter.
<> 129:0ab6a29f35bf 4406 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 129:0ab6a29f35bf 4407 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4408 * @param[in] *pCoeffs points to coefficient buffer.
<> 129:0ab6a29f35bf 4409 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 4410 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4411 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4412 * @return none.
<> 129:0ab6a29f35bf 4413 */
<> 129:0ab6a29f35bf 4414
<> 129:0ab6a29f35bf 4415 void arm_lms_norm_init_f32(
<> 129:0ab6a29f35bf 4416 arm_lms_norm_instance_f32 * S,
<> 129:0ab6a29f35bf 4417 uint16_t numTaps,
<> 129:0ab6a29f35bf 4418 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 4419 float32_t * pState,
<> 129:0ab6a29f35bf 4420 float32_t mu,
<> 129:0ab6a29f35bf 4421 uint32_t blockSize);
<> 129:0ab6a29f35bf 4422
<> 129:0ab6a29f35bf 4423
<> 129:0ab6a29f35bf 4424 /**
<> 129:0ab6a29f35bf 4425 * @brief Instance structure for the Q31 normalized LMS filter.
<> 129:0ab6a29f35bf 4426 */
<> 129:0ab6a29f35bf 4427 typedef struct
<> 129:0ab6a29f35bf 4428 {
<> 129:0ab6a29f35bf 4429 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4430 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4431 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4432 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 129:0ab6a29f35bf 4433 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 129:0ab6a29f35bf 4434 q31_t *recipTable; /**< points to the reciprocal initial value table. */
<> 129:0ab6a29f35bf 4435 q31_t energy; /**< saves previous frame energy. */
<> 129:0ab6a29f35bf 4436 q31_t x0; /**< saves previous input sample. */
<> 129:0ab6a29f35bf 4437 } arm_lms_norm_instance_q31;
<> 129:0ab6a29f35bf 4438
<> 129:0ab6a29f35bf 4439 /**
<> 129:0ab6a29f35bf 4440 * @brief Processing function for Q31 normalized LMS filter.
<> 129:0ab6a29f35bf 4441 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 129:0ab6a29f35bf 4442 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4443 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4444 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4445 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4446 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4447 * @return none.
<> 129:0ab6a29f35bf 4448 */
<> 129:0ab6a29f35bf 4449
<> 129:0ab6a29f35bf 4450 void arm_lms_norm_q31(
<> 129:0ab6a29f35bf 4451 arm_lms_norm_instance_q31 * S,
<> 129:0ab6a29f35bf 4452 q31_t * pSrc,
<> 129:0ab6a29f35bf 4453 q31_t * pRef,
<> 129:0ab6a29f35bf 4454 q31_t * pOut,
<> 129:0ab6a29f35bf 4455 q31_t * pErr,
<> 129:0ab6a29f35bf 4456 uint32_t blockSize);
<> 129:0ab6a29f35bf 4457
<> 129:0ab6a29f35bf 4458 /**
<> 129:0ab6a29f35bf 4459 * @brief Initialization function for Q31 normalized LMS filter.
<> 129:0ab6a29f35bf 4460 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 129:0ab6a29f35bf 4461 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4462 * @param[in] *pCoeffs points to coefficient buffer.
<> 129:0ab6a29f35bf 4463 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 4464 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4465 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4466 * @param[in] postShift bit shift applied to coefficients.
<> 129:0ab6a29f35bf 4467 * @return none.
<> 129:0ab6a29f35bf 4468 */
<> 129:0ab6a29f35bf 4469
<> 129:0ab6a29f35bf 4470 void arm_lms_norm_init_q31(
<> 129:0ab6a29f35bf 4471 arm_lms_norm_instance_q31 * S,
<> 129:0ab6a29f35bf 4472 uint16_t numTaps,
<> 129:0ab6a29f35bf 4473 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 4474 q31_t * pState,
<> 129:0ab6a29f35bf 4475 q31_t mu,
<> 129:0ab6a29f35bf 4476 uint32_t blockSize,
<> 129:0ab6a29f35bf 4477 uint8_t postShift);
<> 129:0ab6a29f35bf 4478
<> 129:0ab6a29f35bf 4479 /**
<> 129:0ab6a29f35bf 4480 * @brief Instance structure for the Q15 normalized LMS filter.
<> 129:0ab6a29f35bf 4481 */
<> 129:0ab6a29f35bf 4482
<> 129:0ab6a29f35bf 4483 typedef struct
<> 129:0ab6a29f35bf 4484 {
<> 129:0ab6a29f35bf 4485 uint16_t numTaps; /**< Number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4486 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 129:0ab6a29f35bf 4487 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4488 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 129:0ab6a29f35bf 4489 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 129:0ab6a29f35bf 4490 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
<> 129:0ab6a29f35bf 4491 q15_t energy; /**< saves previous frame energy. */
<> 129:0ab6a29f35bf 4492 q15_t x0; /**< saves previous input sample. */
<> 129:0ab6a29f35bf 4493 } arm_lms_norm_instance_q15;
<> 129:0ab6a29f35bf 4494
<> 129:0ab6a29f35bf 4495 /**
<> 129:0ab6a29f35bf 4496 * @brief Processing function for Q15 normalized LMS filter.
<> 129:0ab6a29f35bf 4497 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 129:0ab6a29f35bf 4498 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4499 * @param[in] *pRef points to the block of reference data.
<> 129:0ab6a29f35bf 4500 * @param[out] *pOut points to the block of output data.
<> 129:0ab6a29f35bf 4501 * @param[out] *pErr points to the block of error data.
<> 129:0ab6a29f35bf 4502 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4503 * @return none.
<> 129:0ab6a29f35bf 4504 */
<> 129:0ab6a29f35bf 4505
<> 129:0ab6a29f35bf 4506 void arm_lms_norm_q15(
<> 129:0ab6a29f35bf 4507 arm_lms_norm_instance_q15 * S,
<> 129:0ab6a29f35bf 4508 q15_t * pSrc,
<> 129:0ab6a29f35bf 4509 q15_t * pRef,
<> 129:0ab6a29f35bf 4510 q15_t * pOut,
<> 129:0ab6a29f35bf 4511 q15_t * pErr,
<> 129:0ab6a29f35bf 4512 uint32_t blockSize);
<> 129:0ab6a29f35bf 4513
<> 129:0ab6a29f35bf 4514
<> 129:0ab6a29f35bf 4515 /**
<> 129:0ab6a29f35bf 4516 * @brief Initialization function for Q15 normalized LMS filter.
<> 129:0ab6a29f35bf 4517 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 129:0ab6a29f35bf 4518 * @param[in] numTaps number of filter coefficients.
<> 129:0ab6a29f35bf 4519 * @param[in] *pCoeffs points to coefficient buffer.
<> 129:0ab6a29f35bf 4520 * @param[in] *pState points to state buffer.
<> 129:0ab6a29f35bf 4521 * @param[in] mu step size that controls filter coefficient updates.
<> 129:0ab6a29f35bf 4522 * @param[in] blockSize number of samples to process.
<> 129:0ab6a29f35bf 4523 * @param[in] postShift bit shift applied to coefficients.
<> 129:0ab6a29f35bf 4524 * @return none.
<> 129:0ab6a29f35bf 4525 */
<> 129:0ab6a29f35bf 4526
<> 129:0ab6a29f35bf 4527 void arm_lms_norm_init_q15(
<> 129:0ab6a29f35bf 4528 arm_lms_norm_instance_q15 * S,
<> 129:0ab6a29f35bf 4529 uint16_t numTaps,
<> 129:0ab6a29f35bf 4530 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 4531 q15_t * pState,
<> 129:0ab6a29f35bf 4532 q15_t mu,
<> 129:0ab6a29f35bf 4533 uint32_t blockSize,
<> 129:0ab6a29f35bf 4534 uint8_t postShift);
<> 129:0ab6a29f35bf 4535
<> 129:0ab6a29f35bf 4536 /**
<> 129:0ab6a29f35bf 4537 * @brief Correlation of floating-point sequences.
<> 129:0ab6a29f35bf 4538 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4539 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4540 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4541 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4542 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4543 * @return none.
<> 129:0ab6a29f35bf 4544 */
<> 129:0ab6a29f35bf 4545
<> 129:0ab6a29f35bf 4546 void arm_correlate_f32(
<> 129:0ab6a29f35bf 4547 float32_t * pSrcA,
<> 129:0ab6a29f35bf 4548 uint32_t srcALen,
<> 129:0ab6a29f35bf 4549 float32_t * pSrcB,
<> 129:0ab6a29f35bf 4550 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4551 float32_t * pDst);
<> 129:0ab6a29f35bf 4552
<> 129:0ab6a29f35bf 4553
<> 129:0ab6a29f35bf 4554 /**
<> 129:0ab6a29f35bf 4555 * @brief Correlation of Q15 sequences
<> 129:0ab6a29f35bf 4556 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4557 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4558 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4559 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4560 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4561 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 4562 * @return none.
<> 129:0ab6a29f35bf 4563 */
<> 129:0ab6a29f35bf 4564 void arm_correlate_opt_q15(
<> 129:0ab6a29f35bf 4565 q15_t * pSrcA,
<> 129:0ab6a29f35bf 4566 uint32_t srcALen,
<> 129:0ab6a29f35bf 4567 q15_t * pSrcB,
<> 129:0ab6a29f35bf 4568 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4569 q15_t * pDst,
<> 129:0ab6a29f35bf 4570 q15_t * pScratch);
<> 129:0ab6a29f35bf 4571
<> 129:0ab6a29f35bf 4572
<> 129:0ab6a29f35bf 4573 /**
<> 129:0ab6a29f35bf 4574 * @brief Correlation of Q15 sequences.
<> 129:0ab6a29f35bf 4575 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4576 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4577 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4578 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4579 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4580 * @return none.
<> 129:0ab6a29f35bf 4581 */
<> 129:0ab6a29f35bf 4582
<> 129:0ab6a29f35bf 4583 void arm_correlate_q15(
<> 129:0ab6a29f35bf 4584 q15_t * pSrcA,
<> 129:0ab6a29f35bf 4585 uint32_t srcALen,
<> 129:0ab6a29f35bf 4586 q15_t * pSrcB,
<> 129:0ab6a29f35bf 4587 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4588 q15_t * pDst);
<> 129:0ab6a29f35bf 4589
<> 129:0ab6a29f35bf 4590 /**
<> 129:0ab6a29f35bf 4591 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 4592 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4593 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4594 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4595 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4596 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4597 * @return none.
<> 129:0ab6a29f35bf 4598 */
<> 129:0ab6a29f35bf 4599
<> 129:0ab6a29f35bf 4600 void arm_correlate_fast_q15(
<> 129:0ab6a29f35bf 4601 q15_t * pSrcA,
<> 129:0ab6a29f35bf 4602 uint32_t srcALen,
<> 129:0ab6a29f35bf 4603 q15_t * pSrcB,
<> 129:0ab6a29f35bf 4604 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4605 q15_t * pDst);
<> 129:0ab6a29f35bf 4606
<> 129:0ab6a29f35bf 4607
<> 129:0ab6a29f35bf 4608
<> 129:0ab6a29f35bf 4609 /**
<> 129:0ab6a29f35bf 4610 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 129:0ab6a29f35bf 4611 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4612 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4613 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4614 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4615 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4616 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 4617 * @return none.
<> 129:0ab6a29f35bf 4618 */
<> 129:0ab6a29f35bf 4619
<> 129:0ab6a29f35bf 4620 void arm_correlate_fast_opt_q15(
<> 129:0ab6a29f35bf 4621 q15_t * pSrcA,
<> 129:0ab6a29f35bf 4622 uint32_t srcALen,
<> 129:0ab6a29f35bf 4623 q15_t * pSrcB,
<> 129:0ab6a29f35bf 4624 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4625 q15_t * pDst,
<> 129:0ab6a29f35bf 4626 q15_t * pScratch);
<> 129:0ab6a29f35bf 4627
<> 129:0ab6a29f35bf 4628 /**
<> 129:0ab6a29f35bf 4629 * @brief Correlation of Q31 sequences.
<> 129:0ab6a29f35bf 4630 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4631 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4632 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4633 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4634 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4635 * @return none.
<> 129:0ab6a29f35bf 4636 */
<> 129:0ab6a29f35bf 4637
<> 129:0ab6a29f35bf 4638 void arm_correlate_q31(
<> 129:0ab6a29f35bf 4639 q31_t * pSrcA,
<> 129:0ab6a29f35bf 4640 uint32_t srcALen,
<> 129:0ab6a29f35bf 4641 q31_t * pSrcB,
<> 129:0ab6a29f35bf 4642 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4643 q31_t * pDst);
<> 129:0ab6a29f35bf 4644
<> 129:0ab6a29f35bf 4645 /**
<> 129:0ab6a29f35bf 4646 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 129:0ab6a29f35bf 4647 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4648 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4649 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4650 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4651 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4652 * @return none.
<> 129:0ab6a29f35bf 4653 */
<> 129:0ab6a29f35bf 4654
<> 129:0ab6a29f35bf 4655 void arm_correlate_fast_q31(
<> 129:0ab6a29f35bf 4656 q31_t * pSrcA,
<> 129:0ab6a29f35bf 4657 uint32_t srcALen,
<> 129:0ab6a29f35bf 4658 q31_t * pSrcB,
<> 129:0ab6a29f35bf 4659 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4660 q31_t * pDst);
<> 129:0ab6a29f35bf 4661
<> 129:0ab6a29f35bf 4662
<> 129:0ab6a29f35bf 4663
<> 129:0ab6a29f35bf 4664 /**
<> 129:0ab6a29f35bf 4665 * @brief Correlation of Q7 sequences.
<> 129:0ab6a29f35bf 4666 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4667 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4668 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4669 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4670 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4671 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 129:0ab6a29f35bf 4672 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 129:0ab6a29f35bf 4673 * @return none.
<> 129:0ab6a29f35bf 4674 */
<> 129:0ab6a29f35bf 4675
<> 129:0ab6a29f35bf 4676 void arm_correlate_opt_q7(
<> 129:0ab6a29f35bf 4677 q7_t * pSrcA,
<> 129:0ab6a29f35bf 4678 uint32_t srcALen,
<> 129:0ab6a29f35bf 4679 q7_t * pSrcB,
<> 129:0ab6a29f35bf 4680 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4681 q7_t * pDst,
<> 129:0ab6a29f35bf 4682 q15_t * pScratch1,
<> 129:0ab6a29f35bf 4683 q15_t * pScratch2);
<> 129:0ab6a29f35bf 4684
<> 129:0ab6a29f35bf 4685
<> 129:0ab6a29f35bf 4686 /**
<> 129:0ab6a29f35bf 4687 * @brief Correlation of Q7 sequences.
<> 129:0ab6a29f35bf 4688 * @param[in] *pSrcA points to the first input sequence.
<> 129:0ab6a29f35bf 4689 * @param[in] srcALen length of the first input sequence.
<> 129:0ab6a29f35bf 4690 * @param[in] *pSrcB points to the second input sequence.
<> 129:0ab6a29f35bf 4691 * @param[in] srcBLen length of the second input sequence.
<> 129:0ab6a29f35bf 4692 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 129:0ab6a29f35bf 4693 * @return none.
<> 129:0ab6a29f35bf 4694 */
<> 129:0ab6a29f35bf 4695
<> 129:0ab6a29f35bf 4696 void arm_correlate_q7(
<> 129:0ab6a29f35bf 4697 q7_t * pSrcA,
<> 129:0ab6a29f35bf 4698 uint32_t srcALen,
<> 129:0ab6a29f35bf 4699 q7_t * pSrcB,
<> 129:0ab6a29f35bf 4700 uint32_t srcBLen,
<> 129:0ab6a29f35bf 4701 q7_t * pDst);
<> 129:0ab6a29f35bf 4702
<> 129:0ab6a29f35bf 4703
<> 129:0ab6a29f35bf 4704 /**
<> 129:0ab6a29f35bf 4705 * @brief Instance structure for the floating-point sparse FIR filter.
<> 129:0ab6a29f35bf 4706 */
<> 129:0ab6a29f35bf 4707 typedef struct
<> 129:0ab6a29f35bf 4708 {
<> 129:0ab6a29f35bf 4709 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4710 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 129:0ab6a29f35bf 4711 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 129:0ab6a29f35bf 4712 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 4713 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 129:0ab6a29f35bf 4714 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4715 } arm_fir_sparse_instance_f32;
<> 129:0ab6a29f35bf 4716
<> 129:0ab6a29f35bf 4717 /**
<> 129:0ab6a29f35bf 4718 * @brief Instance structure for the Q31 sparse FIR filter.
<> 129:0ab6a29f35bf 4719 */
<> 129:0ab6a29f35bf 4720
<> 129:0ab6a29f35bf 4721 typedef struct
<> 129:0ab6a29f35bf 4722 {
<> 129:0ab6a29f35bf 4723 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4724 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 129:0ab6a29f35bf 4725 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 129:0ab6a29f35bf 4726 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 4727 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 129:0ab6a29f35bf 4728 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4729 } arm_fir_sparse_instance_q31;
<> 129:0ab6a29f35bf 4730
<> 129:0ab6a29f35bf 4731 /**
<> 129:0ab6a29f35bf 4732 * @brief Instance structure for the Q15 sparse FIR filter.
<> 129:0ab6a29f35bf 4733 */
<> 129:0ab6a29f35bf 4734
<> 129:0ab6a29f35bf 4735 typedef struct
<> 129:0ab6a29f35bf 4736 {
<> 129:0ab6a29f35bf 4737 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4738 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 129:0ab6a29f35bf 4739 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 129:0ab6a29f35bf 4740 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 4741 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 129:0ab6a29f35bf 4742 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4743 } arm_fir_sparse_instance_q15;
<> 129:0ab6a29f35bf 4744
<> 129:0ab6a29f35bf 4745 /**
<> 129:0ab6a29f35bf 4746 * @brief Instance structure for the Q7 sparse FIR filter.
<> 129:0ab6a29f35bf 4747 */
<> 129:0ab6a29f35bf 4748
<> 129:0ab6a29f35bf 4749 typedef struct
<> 129:0ab6a29f35bf 4750 {
<> 129:0ab6a29f35bf 4751 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 129:0ab6a29f35bf 4752 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 129:0ab6a29f35bf 4753 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 129:0ab6a29f35bf 4754 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 129:0ab6a29f35bf 4755 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 129:0ab6a29f35bf 4756 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 129:0ab6a29f35bf 4757 } arm_fir_sparse_instance_q7;
<> 129:0ab6a29f35bf 4758
<> 129:0ab6a29f35bf 4759 /**
<> 129:0ab6a29f35bf 4760 * @brief Processing function for the floating-point sparse FIR filter.
<> 129:0ab6a29f35bf 4761 * @param[in] *S points to an instance of the floating-point sparse FIR structure.
<> 129:0ab6a29f35bf 4762 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4763 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4764 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4765 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 4766 * @return none.
<> 129:0ab6a29f35bf 4767 */
<> 129:0ab6a29f35bf 4768
<> 129:0ab6a29f35bf 4769 void arm_fir_sparse_f32(
<> 129:0ab6a29f35bf 4770 arm_fir_sparse_instance_f32 * S,
<> 129:0ab6a29f35bf 4771 float32_t * pSrc,
<> 129:0ab6a29f35bf 4772 float32_t * pDst,
<> 129:0ab6a29f35bf 4773 float32_t * pScratchIn,
<> 129:0ab6a29f35bf 4774 uint32_t blockSize);
<> 129:0ab6a29f35bf 4775
<> 129:0ab6a29f35bf 4776 /**
<> 129:0ab6a29f35bf 4777 * @brief Initialization function for the floating-point sparse FIR filter.
<> 129:0ab6a29f35bf 4778 * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
<> 129:0ab6a29f35bf 4779 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 129:0ab6a29f35bf 4780 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 129:0ab6a29f35bf 4781 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 4782 * @param[in] *pTapDelay points to the array of offset times.
<> 129:0ab6a29f35bf 4783 * @param[in] maxDelay maximum offset time supported.
<> 129:0ab6a29f35bf 4784 * @param[in] blockSize number of samples that will be processed per block.
<> 129:0ab6a29f35bf 4785 * @return none
<> 129:0ab6a29f35bf 4786 */
<> 129:0ab6a29f35bf 4787
<> 129:0ab6a29f35bf 4788 void arm_fir_sparse_init_f32(
<> 129:0ab6a29f35bf 4789 arm_fir_sparse_instance_f32 * S,
<> 129:0ab6a29f35bf 4790 uint16_t numTaps,
<> 129:0ab6a29f35bf 4791 float32_t * pCoeffs,
<> 129:0ab6a29f35bf 4792 float32_t * pState,
<> 129:0ab6a29f35bf 4793 int32_t * pTapDelay,
<> 129:0ab6a29f35bf 4794 uint16_t maxDelay,
<> 129:0ab6a29f35bf 4795 uint32_t blockSize);
<> 129:0ab6a29f35bf 4796
<> 129:0ab6a29f35bf 4797 /**
<> 129:0ab6a29f35bf 4798 * @brief Processing function for the Q31 sparse FIR filter.
<> 129:0ab6a29f35bf 4799 * @param[in] *S points to an instance of the Q31 sparse FIR structure.
<> 129:0ab6a29f35bf 4800 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4801 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4802 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4803 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 4804 * @return none.
<> 129:0ab6a29f35bf 4805 */
<> 129:0ab6a29f35bf 4806
<> 129:0ab6a29f35bf 4807 void arm_fir_sparse_q31(
<> 129:0ab6a29f35bf 4808 arm_fir_sparse_instance_q31 * S,
<> 129:0ab6a29f35bf 4809 q31_t * pSrc,
<> 129:0ab6a29f35bf 4810 q31_t * pDst,
<> 129:0ab6a29f35bf 4811 q31_t * pScratchIn,
<> 129:0ab6a29f35bf 4812 uint32_t blockSize);
<> 129:0ab6a29f35bf 4813
<> 129:0ab6a29f35bf 4814 /**
<> 129:0ab6a29f35bf 4815 * @brief Initialization function for the Q31 sparse FIR filter.
<> 129:0ab6a29f35bf 4816 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
<> 129:0ab6a29f35bf 4817 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 129:0ab6a29f35bf 4818 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 129:0ab6a29f35bf 4819 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 4820 * @param[in] *pTapDelay points to the array of offset times.
<> 129:0ab6a29f35bf 4821 * @param[in] maxDelay maximum offset time supported.
<> 129:0ab6a29f35bf 4822 * @param[in] blockSize number of samples that will be processed per block.
<> 129:0ab6a29f35bf 4823 * @return none
<> 129:0ab6a29f35bf 4824 */
<> 129:0ab6a29f35bf 4825
<> 129:0ab6a29f35bf 4826 void arm_fir_sparse_init_q31(
<> 129:0ab6a29f35bf 4827 arm_fir_sparse_instance_q31 * S,
<> 129:0ab6a29f35bf 4828 uint16_t numTaps,
<> 129:0ab6a29f35bf 4829 q31_t * pCoeffs,
<> 129:0ab6a29f35bf 4830 q31_t * pState,
<> 129:0ab6a29f35bf 4831 int32_t * pTapDelay,
<> 129:0ab6a29f35bf 4832 uint16_t maxDelay,
<> 129:0ab6a29f35bf 4833 uint32_t blockSize);
<> 129:0ab6a29f35bf 4834
<> 129:0ab6a29f35bf 4835 /**
<> 129:0ab6a29f35bf 4836 * @brief Processing function for the Q15 sparse FIR filter.
<> 129:0ab6a29f35bf 4837 * @param[in] *S points to an instance of the Q15 sparse FIR structure.
<> 129:0ab6a29f35bf 4838 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4839 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4840 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4841 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4842 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 4843 * @return none.
<> 129:0ab6a29f35bf 4844 */
<> 129:0ab6a29f35bf 4845
<> 129:0ab6a29f35bf 4846 void arm_fir_sparse_q15(
<> 129:0ab6a29f35bf 4847 arm_fir_sparse_instance_q15 * S,
<> 129:0ab6a29f35bf 4848 q15_t * pSrc,
<> 129:0ab6a29f35bf 4849 q15_t * pDst,
<> 129:0ab6a29f35bf 4850 q15_t * pScratchIn,
<> 129:0ab6a29f35bf 4851 q31_t * pScratchOut,
<> 129:0ab6a29f35bf 4852 uint32_t blockSize);
<> 129:0ab6a29f35bf 4853
<> 129:0ab6a29f35bf 4854
<> 129:0ab6a29f35bf 4855 /**
<> 129:0ab6a29f35bf 4856 * @brief Initialization function for the Q15 sparse FIR filter.
<> 129:0ab6a29f35bf 4857 * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
<> 129:0ab6a29f35bf 4858 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 129:0ab6a29f35bf 4859 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 129:0ab6a29f35bf 4860 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 4861 * @param[in] *pTapDelay points to the array of offset times.
<> 129:0ab6a29f35bf 4862 * @param[in] maxDelay maximum offset time supported.
<> 129:0ab6a29f35bf 4863 * @param[in] blockSize number of samples that will be processed per block.
<> 129:0ab6a29f35bf 4864 * @return none
<> 129:0ab6a29f35bf 4865 */
<> 129:0ab6a29f35bf 4866
<> 129:0ab6a29f35bf 4867 void arm_fir_sparse_init_q15(
<> 129:0ab6a29f35bf 4868 arm_fir_sparse_instance_q15 * S,
<> 129:0ab6a29f35bf 4869 uint16_t numTaps,
<> 129:0ab6a29f35bf 4870 q15_t * pCoeffs,
<> 129:0ab6a29f35bf 4871 q15_t * pState,
<> 129:0ab6a29f35bf 4872 int32_t * pTapDelay,
<> 129:0ab6a29f35bf 4873 uint16_t maxDelay,
<> 129:0ab6a29f35bf 4874 uint32_t blockSize);
<> 129:0ab6a29f35bf 4875
<> 129:0ab6a29f35bf 4876 /**
<> 129:0ab6a29f35bf 4877 * @brief Processing function for the Q7 sparse FIR filter.
<> 129:0ab6a29f35bf 4878 * @param[in] *S points to an instance of the Q7 sparse FIR structure.
<> 129:0ab6a29f35bf 4879 * @param[in] *pSrc points to the block of input data.
<> 129:0ab6a29f35bf 4880 * @param[out] *pDst points to the block of output data
<> 129:0ab6a29f35bf 4881 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4882 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 129:0ab6a29f35bf 4883 * @param[in] blockSize number of input samples to process per call.
<> 129:0ab6a29f35bf 4884 * @return none.
<> 129:0ab6a29f35bf 4885 */
<> 129:0ab6a29f35bf 4886
<> 129:0ab6a29f35bf 4887 void arm_fir_sparse_q7(
<> 129:0ab6a29f35bf 4888 arm_fir_sparse_instance_q7 * S,
<> 129:0ab6a29f35bf 4889 q7_t * pSrc,
<> 129:0ab6a29f35bf 4890 q7_t * pDst,
<> 129:0ab6a29f35bf 4891 q7_t * pScratchIn,
<> 129:0ab6a29f35bf 4892 q31_t * pScratchOut,
<> 129:0ab6a29f35bf 4893 uint32_t blockSize);
<> 129:0ab6a29f35bf 4894
<> 129:0ab6a29f35bf 4895 /**
<> 129:0ab6a29f35bf 4896 * @brief Initialization function for the Q7 sparse FIR filter.
<> 129:0ab6a29f35bf 4897 * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
<> 129:0ab6a29f35bf 4898 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 129:0ab6a29f35bf 4899 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 129:0ab6a29f35bf 4900 * @param[in] *pState points to the state buffer.
<> 129:0ab6a29f35bf 4901 * @param[in] *pTapDelay points to the array of offset times.
<> 129:0ab6a29f35bf 4902 * @param[in] maxDelay maximum offset time supported.
<> 129:0ab6a29f35bf 4903 * @param[in] blockSize number of samples that will be processed per block.
<> 129:0ab6a29f35bf 4904 * @return none
<> 129:0ab6a29f35bf 4905 */
<> 129:0ab6a29f35bf 4906
<> 129:0ab6a29f35bf 4907 void arm_fir_sparse_init_q7(
<> 129:0ab6a29f35bf 4908 arm_fir_sparse_instance_q7 * S,
<> 129:0ab6a29f35bf 4909 uint16_t numTaps,
<> 129:0ab6a29f35bf 4910 q7_t * pCoeffs,
<> 129:0ab6a29f35bf 4911 q7_t * pState,
<> 129:0ab6a29f35bf 4912 int32_t * pTapDelay,
<> 129:0ab6a29f35bf 4913 uint16_t maxDelay,
<> 129:0ab6a29f35bf 4914 uint32_t blockSize);
<> 129:0ab6a29f35bf 4915
<> 129:0ab6a29f35bf 4916
<> 129:0ab6a29f35bf 4917 /*
<> 129:0ab6a29f35bf 4918 * @brief Floating-point sin_cos function.
<> 129:0ab6a29f35bf 4919 * @param[in] theta input value in degrees
<> 129:0ab6a29f35bf 4920 * @param[out] *pSinVal points to the processed sine output.
<> 129:0ab6a29f35bf 4921 * @param[out] *pCosVal points to the processed cos output.
<> 129:0ab6a29f35bf 4922 * @return none.
<> 129:0ab6a29f35bf 4923 */
<> 129:0ab6a29f35bf 4924
<> 129:0ab6a29f35bf 4925 void arm_sin_cos_f32(
<> 129:0ab6a29f35bf 4926 float32_t theta,
<> 129:0ab6a29f35bf 4927 float32_t * pSinVal,
<> 129:0ab6a29f35bf 4928 float32_t * pCcosVal);
<> 129:0ab6a29f35bf 4929
<> 129:0ab6a29f35bf 4930 /*
<> 129:0ab6a29f35bf 4931 * @brief Q31 sin_cos function.
<> 129:0ab6a29f35bf 4932 * @param[in] theta scaled input value in degrees
<> 129:0ab6a29f35bf 4933 * @param[out] *pSinVal points to the processed sine output.
<> 129:0ab6a29f35bf 4934 * @param[out] *pCosVal points to the processed cosine output.
<> 129:0ab6a29f35bf 4935 * @return none.
<> 129:0ab6a29f35bf 4936 */
<> 129:0ab6a29f35bf 4937
<> 129:0ab6a29f35bf 4938 void arm_sin_cos_q31(
<> 129:0ab6a29f35bf 4939 q31_t theta,
<> 129:0ab6a29f35bf 4940 q31_t * pSinVal,
<> 129:0ab6a29f35bf 4941 q31_t * pCosVal);
<> 129:0ab6a29f35bf 4942
<> 129:0ab6a29f35bf 4943
<> 129:0ab6a29f35bf 4944 /**
<> 129:0ab6a29f35bf 4945 * @brief Floating-point complex conjugate.
<> 129:0ab6a29f35bf 4946 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 4947 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 4948 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 4949 * @return none.
<> 129:0ab6a29f35bf 4950 */
<> 129:0ab6a29f35bf 4951
<> 129:0ab6a29f35bf 4952 void arm_cmplx_conj_f32(
<> 129:0ab6a29f35bf 4953 float32_t * pSrc,
<> 129:0ab6a29f35bf 4954 float32_t * pDst,
<> 129:0ab6a29f35bf 4955 uint32_t numSamples);
<> 129:0ab6a29f35bf 4956
<> 129:0ab6a29f35bf 4957 /**
<> 129:0ab6a29f35bf 4958 * @brief Q31 complex conjugate.
<> 129:0ab6a29f35bf 4959 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 4960 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 4961 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 4962 * @return none.
<> 129:0ab6a29f35bf 4963 */
<> 129:0ab6a29f35bf 4964
<> 129:0ab6a29f35bf 4965 void arm_cmplx_conj_q31(
<> 129:0ab6a29f35bf 4966 q31_t * pSrc,
<> 129:0ab6a29f35bf 4967 q31_t * pDst,
<> 129:0ab6a29f35bf 4968 uint32_t numSamples);
<> 129:0ab6a29f35bf 4969
<> 129:0ab6a29f35bf 4970 /**
<> 129:0ab6a29f35bf 4971 * @brief Q15 complex conjugate.
<> 129:0ab6a29f35bf 4972 * @param[in] *pSrc points to the input vector
<> 129:0ab6a29f35bf 4973 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 4974 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 4975 * @return none.
<> 129:0ab6a29f35bf 4976 */
<> 129:0ab6a29f35bf 4977
<> 129:0ab6a29f35bf 4978 void arm_cmplx_conj_q15(
<> 129:0ab6a29f35bf 4979 q15_t * pSrc,
<> 129:0ab6a29f35bf 4980 q15_t * pDst,
<> 129:0ab6a29f35bf 4981 uint32_t numSamples);
<> 129:0ab6a29f35bf 4982
<> 129:0ab6a29f35bf 4983
<> 129:0ab6a29f35bf 4984
<> 129:0ab6a29f35bf 4985 /**
<> 129:0ab6a29f35bf 4986 * @brief Floating-point complex magnitude squared
<> 129:0ab6a29f35bf 4987 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 4988 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 4989 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 4990 * @return none.
<> 129:0ab6a29f35bf 4991 */
<> 129:0ab6a29f35bf 4992
<> 129:0ab6a29f35bf 4993 void arm_cmplx_mag_squared_f32(
<> 129:0ab6a29f35bf 4994 float32_t * pSrc,
<> 129:0ab6a29f35bf 4995 float32_t * pDst,
<> 129:0ab6a29f35bf 4996 uint32_t numSamples);
<> 129:0ab6a29f35bf 4997
<> 129:0ab6a29f35bf 4998 /**
<> 129:0ab6a29f35bf 4999 * @brief Q31 complex magnitude squared
<> 129:0ab6a29f35bf 5000 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 5001 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 5002 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 5003 * @return none.
<> 129:0ab6a29f35bf 5004 */
<> 129:0ab6a29f35bf 5005
<> 129:0ab6a29f35bf 5006 void arm_cmplx_mag_squared_q31(
<> 129:0ab6a29f35bf 5007 q31_t * pSrc,
<> 129:0ab6a29f35bf 5008 q31_t * pDst,
<> 129:0ab6a29f35bf 5009 uint32_t numSamples);
<> 129:0ab6a29f35bf 5010
<> 129:0ab6a29f35bf 5011 /**
<> 129:0ab6a29f35bf 5012 * @brief Q15 complex magnitude squared
<> 129:0ab6a29f35bf 5013 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 5014 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 5015 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 5016 * @return none.
<> 129:0ab6a29f35bf 5017 */
<> 129:0ab6a29f35bf 5018
<> 129:0ab6a29f35bf 5019 void arm_cmplx_mag_squared_q15(
<> 129:0ab6a29f35bf 5020 q15_t * pSrc,
<> 129:0ab6a29f35bf 5021 q15_t * pDst,
<> 129:0ab6a29f35bf 5022 uint32_t numSamples);
<> 129:0ab6a29f35bf 5023
<> 129:0ab6a29f35bf 5024
<> 129:0ab6a29f35bf 5025 /**
<> 129:0ab6a29f35bf 5026 * @ingroup groupController
<> 129:0ab6a29f35bf 5027 */
<> 129:0ab6a29f35bf 5028
<> 129:0ab6a29f35bf 5029 /**
<> 129:0ab6a29f35bf 5030 * @defgroup PID PID Motor Control
<> 129:0ab6a29f35bf 5031 *
<> 129:0ab6a29f35bf 5032 * A Proportional Integral Derivative (PID) controller is a generic feedback control
<> 129:0ab6a29f35bf 5033 * loop mechanism widely used in industrial control systems.
<> 129:0ab6a29f35bf 5034 * A PID controller is the most commonly used type of feedback controller.
<> 129:0ab6a29f35bf 5035 *
<> 129:0ab6a29f35bf 5036 * This set of functions implements (PID) controllers
<> 129:0ab6a29f35bf 5037 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
<> 129:0ab6a29f35bf 5038 * of data and each call to the function returns a single processed value.
<> 129:0ab6a29f35bf 5039 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
<> 129:0ab6a29f35bf 5040 * is the input sample value. The functions return the output value.
<> 129:0ab6a29f35bf 5041 *
<> 129:0ab6a29f35bf 5042 * \par Algorithm:
<> 129:0ab6a29f35bf 5043 * <pre>
<> 129:0ab6a29f35bf 5044 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
<> 129:0ab6a29f35bf 5045 * A0 = Kp + Ki + Kd
<> 129:0ab6a29f35bf 5046 * A1 = (-Kp ) - (2 * Kd )
<> 129:0ab6a29f35bf 5047 * A2 = Kd </pre>
<> 129:0ab6a29f35bf 5048 *
<> 129:0ab6a29f35bf 5049 * \par
<> 129:0ab6a29f35bf 5050 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
<> 129:0ab6a29f35bf 5051 *
<> 129:0ab6a29f35bf 5052 * \par
<> 129:0ab6a29f35bf 5053 * \image html PID.gif "Proportional Integral Derivative Controller"
<> 129:0ab6a29f35bf 5054 *
<> 129:0ab6a29f35bf 5055 * \par
<> 129:0ab6a29f35bf 5056 * The PID controller calculates an "error" value as the difference between
<> 129:0ab6a29f35bf 5057 * the measured output and the reference input.
<> 129:0ab6a29f35bf 5058 * The controller attempts to minimize the error by adjusting the process control inputs.
<> 129:0ab6a29f35bf 5059 * The proportional value determines the reaction to the current error,
<> 129:0ab6a29f35bf 5060 * the integral value determines the reaction based on the sum of recent errors,
<> 129:0ab6a29f35bf 5061 * and the derivative value determines the reaction based on the rate at which the error has been changing.
<> 129:0ab6a29f35bf 5062 *
<> 129:0ab6a29f35bf 5063 * \par Instance Structure
<> 129:0ab6a29f35bf 5064 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
<> 129:0ab6a29f35bf 5065 * A separate instance structure must be defined for each PID Controller.
<> 129:0ab6a29f35bf 5066 * There are separate instance structure declarations for each of the 3 supported data types.
<> 129:0ab6a29f35bf 5067 *
<> 129:0ab6a29f35bf 5068 * \par Reset Functions
<> 129:0ab6a29f35bf 5069 * There is also an associated reset function for each data type which clears the state array.
<> 129:0ab6a29f35bf 5070 *
<> 129:0ab6a29f35bf 5071 * \par Initialization Functions
<> 129:0ab6a29f35bf 5072 * There is also an associated initialization function for each data type.
<> 129:0ab6a29f35bf 5073 * The initialization function performs the following operations:
<> 129:0ab6a29f35bf 5074 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
<> 129:0ab6a29f35bf 5075 * - Zeros out the values in the state buffer.
<> 129:0ab6a29f35bf 5076 *
<> 129:0ab6a29f35bf 5077 * \par
<> 129:0ab6a29f35bf 5078 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
<> 129:0ab6a29f35bf 5079 *
<> 129:0ab6a29f35bf 5080 * \par Fixed-Point Behavior
<> 129:0ab6a29f35bf 5081 * Care must be taken when using the fixed-point versions of the PID Controller functions.
<> 129:0ab6a29f35bf 5082 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
<> 129:0ab6a29f35bf 5083 * Refer to the function specific documentation below for usage guidelines.
<> 129:0ab6a29f35bf 5084 */
<> 129:0ab6a29f35bf 5085
<> 129:0ab6a29f35bf 5086 /**
<> 129:0ab6a29f35bf 5087 * @addtogroup PID
<> 129:0ab6a29f35bf 5088 * @{
<> 129:0ab6a29f35bf 5089 */
<> 129:0ab6a29f35bf 5090
<> 129:0ab6a29f35bf 5091 /**
<> 129:0ab6a29f35bf 5092 * @brief Process function for the floating-point PID Control.
<> 129:0ab6a29f35bf 5093 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 129:0ab6a29f35bf 5094 * @param[in] in input sample to process
<> 129:0ab6a29f35bf 5095 * @return out processed output sample.
<> 129:0ab6a29f35bf 5096 */
<> 129:0ab6a29f35bf 5097
<> 129:0ab6a29f35bf 5098
<> 129:0ab6a29f35bf 5099 static __INLINE float32_t arm_pid_f32(
<> 129:0ab6a29f35bf 5100 arm_pid_instance_f32 * S,
<> 129:0ab6a29f35bf 5101 float32_t in)
<> 129:0ab6a29f35bf 5102 {
<> 129:0ab6a29f35bf 5103 float32_t out;
<> 129:0ab6a29f35bf 5104
<> 129:0ab6a29f35bf 5105 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
<> 129:0ab6a29f35bf 5106 out = (S->A0 * in) +
<> 129:0ab6a29f35bf 5107 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
<> 129:0ab6a29f35bf 5108
<> 129:0ab6a29f35bf 5109 /* Update state */
<> 129:0ab6a29f35bf 5110 S->state[1] = S->state[0];
<> 129:0ab6a29f35bf 5111 S->state[0] = in;
<> 129:0ab6a29f35bf 5112 S->state[2] = out;
<> 129:0ab6a29f35bf 5113
<> 129:0ab6a29f35bf 5114 /* return to application */
<> 129:0ab6a29f35bf 5115 return (out);
<> 129:0ab6a29f35bf 5116
<> 129:0ab6a29f35bf 5117 }
<> 129:0ab6a29f35bf 5118
<> 129:0ab6a29f35bf 5119 /**
<> 129:0ab6a29f35bf 5120 * @brief Process function for the Q31 PID Control.
<> 129:0ab6a29f35bf 5121 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 129:0ab6a29f35bf 5122 * @param[in] in input sample to process
<> 129:0ab6a29f35bf 5123 * @return out processed output sample.
<> 129:0ab6a29f35bf 5124 *
<> 129:0ab6a29f35bf 5125 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5126 * \par
<> 129:0ab6a29f35bf 5127 * The function is implemented using an internal 64-bit accumulator.
<> 129:0ab6a29f35bf 5128 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
<> 129:0ab6a29f35bf 5129 * Thus, if the accumulator result overflows it wraps around rather than clip.
<> 129:0ab6a29f35bf 5130 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
<> 129:0ab6a29f35bf 5131 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
<> 129:0ab6a29f35bf 5132 */
<> 129:0ab6a29f35bf 5133
<> 129:0ab6a29f35bf 5134 static __INLINE q31_t arm_pid_q31(
<> 129:0ab6a29f35bf 5135 arm_pid_instance_q31 * S,
<> 129:0ab6a29f35bf 5136 q31_t in)
<> 129:0ab6a29f35bf 5137 {
<> 129:0ab6a29f35bf 5138 q63_t acc;
<> 129:0ab6a29f35bf 5139 q31_t out;
<> 129:0ab6a29f35bf 5140
<> 129:0ab6a29f35bf 5141 /* acc = A0 * x[n] */
<> 129:0ab6a29f35bf 5142 acc = (q63_t) S->A0 * in;
<> 129:0ab6a29f35bf 5143
<> 129:0ab6a29f35bf 5144 /* acc += A1 * x[n-1] */
<> 129:0ab6a29f35bf 5145 acc += (q63_t) S->A1 * S->state[0];
<> 129:0ab6a29f35bf 5146
<> 129:0ab6a29f35bf 5147 /* acc += A2 * x[n-2] */
<> 129:0ab6a29f35bf 5148 acc += (q63_t) S->A2 * S->state[1];
<> 129:0ab6a29f35bf 5149
<> 129:0ab6a29f35bf 5150 /* convert output to 1.31 format to add y[n-1] */
<> 129:0ab6a29f35bf 5151 out = (q31_t) (acc >> 31u);
<> 129:0ab6a29f35bf 5152
<> 129:0ab6a29f35bf 5153 /* out += y[n-1] */
<> 129:0ab6a29f35bf 5154 out += S->state[2];
<> 129:0ab6a29f35bf 5155
<> 129:0ab6a29f35bf 5156 /* Update state */
<> 129:0ab6a29f35bf 5157 S->state[1] = S->state[0];
<> 129:0ab6a29f35bf 5158 S->state[0] = in;
<> 129:0ab6a29f35bf 5159 S->state[2] = out;
<> 129:0ab6a29f35bf 5160
<> 129:0ab6a29f35bf 5161 /* return to application */
<> 129:0ab6a29f35bf 5162 return (out);
<> 129:0ab6a29f35bf 5163
<> 129:0ab6a29f35bf 5164 }
<> 129:0ab6a29f35bf 5165
<> 129:0ab6a29f35bf 5166 /**
<> 129:0ab6a29f35bf 5167 * @brief Process function for the Q15 PID Control.
<> 129:0ab6a29f35bf 5168 * @param[in,out] *S points to an instance of the Q15 PID Control structure
<> 129:0ab6a29f35bf 5169 * @param[in] in input sample to process
<> 129:0ab6a29f35bf 5170 * @return out processed output sample.
<> 129:0ab6a29f35bf 5171 *
<> 129:0ab6a29f35bf 5172 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5173 * \par
<> 129:0ab6a29f35bf 5174 * The function is implemented using a 64-bit internal accumulator.
<> 129:0ab6a29f35bf 5175 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
<> 129:0ab6a29f35bf 5176 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
<> 129:0ab6a29f35bf 5177 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
<> 129:0ab6a29f35bf 5178 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
<> 129:0ab6a29f35bf 5179 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
<> 129:0ab6a29f35bf 5180 */
<> 129:0ab6a29f35bf 5181
<> 129:0ab6a29f35bf 5182 static __INLINE q15_t arm_pid_q15(
<> 129:0ab6a29f35bf 5183 arm_pid_instance_q15 * S,
<> 129:0ab6a29f35bf 5184 q15_t in)
<> 129:0ab6a29f35bf 5185 {
<> 129:0ab6a29f35bf 5186 q63_t acc;
<> 129:0ab6a29f35bf 5187 q15_t out;
<> 129:0ab6a29f35bf 5188
<> 129:0ab6a29f35bf 5189 #ifndef ARM_MATH_CM0_FAMILY
<> 129:0ab6a29f35bf 5190 __SIMD32_TYPE *vstate;
<> 129:0ab6a29f35bf 5191
<> 129:0ab6a29f35bf 5192 /* Implementation of PID controller */
<> 129:0ab6a29f35bf 5193
<> 129:0ab6a29f35bf 5194 /* acc = A0 * x[n] */
<> 129:0ab6a29f35bf 5195 acc = (q31_t) __SMUAD(S->A0, in);
<> 129:0ab6a29f35bf 5196
<> 129:0ab6a29f35bf 5197 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 129:0ab6a29f35bf 5198 vstate = __SIMD32_CONST(S->state);
<> 129:0ab6a29f35bf 5199 acc = __SMLALD(S->A1, (q31_t) *vstate, acc);
<> 129:0ab6a29f35bf 5200
<> 129:0ab6a29f35bf 5201 #else
<> 129:0ab6a29f35bf 5202 /* acc = A0 * x[n] */
<> 129:0ab6a29f35bf 5203 acc = ((q31_t) S->A0) * in;
<> 129:0ab6a29f35bf 5204
<> 129:0ab6a29f35bf 5205 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 129:0ab6a29f35bf 5206 acc += (q31_t) S->A1 * S->state[0];
<> 129:0ab6a29f35bf 5207 acc += (q31_t) S->A2 * S->state[1];
<> 129:0ab6a29f35bf 5208
<> 129:0ab6a29f35bf 5209 #endif
<> 129:0ab6a29f35bf 5210
<> 129:0ab6a29f35bf 5211 /* acc += y[n-1] */
<> 129:0ab6a29f35bf 5212 acc += (q31_t) S->state[2] << 15;
<> 129:0ab6a29f35bf 5213
<> 129:0ab6a29f35bf 5214 /* saturate the output */
<> 129:0ab6a29f35bf 5215 out = (q15_t) (__SSAT((acc >> 15), 16));
<> 129:0ab6a29f35bf 5216
<> 129:0ab6a29f35bf 5217 /* Update state */
<> 129:0ab6a29f35bf 5218 S->state[1] = S->state[0];
<> 129:0ab6a29f35bf 5219 S->state[0] = in;
<> 129:0ab6a29f35bf 5220 S->state[2] = out;
<> 129:0ab6a29f35bf 5221
<> 129:0ab6a29f35bf 5222 /* return to application */
<> 129:0ab6a29f35bf 5223 return (out);
<> 129:0ab6a29f35bf 5224
<> 129:0ab6a29f35bf 5225 }
<> 129:0ab6a29f35bf 5226
<> 129:0ab6a29f35bf 5227 /**
<> 129:0ab6a29f35bf 5228 * @} end of PID group
<> 129:0ab6a29f35bf 5229 */
<> 129:0ab6a29f35bf 5230
<> 129:0ab6a29f35bf 5231
<> 129:0ab6a29f35bf 5232 /**
<> 129:0ab6a29f35bf 5233 * @brief Floating-point matrix inverse.
<> 129:0ab6a29f35bf 5234 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 129:0ab6a29f35bf 5235 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 129:0ab6a29f35bf 5236 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 129:0ab6a29f35bf 5237 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 129:0ab6a29f35bf 5238 */
<> 129:0ab6a29f35bf 5239
<> 129:0ab6a29f35bf 5240 arm_status arm_mat_inverse_f32(
<> 129:0ab6a29f35bf 5241 const arm_matrix_instance_f32 * src,
<> 129:0ab6a29f35bf 5242 arm_matrix_instance_f32 * dst);
<> 129:0ab6a29f35bf 5243
<> 129:0ab6a29f35bf 5244
<> 129:0ab6a29f35bf 5245 /**
<> 129:0ab6a29f35bf 5246 * @brief Floating-point matrix inverse.
<> 129:0ab6a29f35bf 5247 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 129:0ab6a29f35bf 5248 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 129:0ab6a29f35bf 5249 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 129:0ab6a29f35bf 5250 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 129:0ab6a29f35bf 5251 */
<> 129:0ab6a29f35bf 5252
<> 129:0ab6a29f35bf 5253 arm_status arm_mat_inverse_f64(
<> 129:0ab6a29f35bf 5254 const arm_matrix_instance_f64 * src,
<> 129:0ab6a29f35bf 5255 arm_matrix_instance_f64 * dst);
<> 129:0ab6a29f35bf 5256
<> 129:0ab6a29f35bf 5257
<> 129:0ab6a29f35bf 5258
<> 129:0ab6a29f35bf 5259 /**
<> 129:0ab6a29f35bf 5260 * @ingroup groupController
<> 129:0ab6a29f35bf 5261 */
<> 129:0ab6a29f35bf 5262
<> 129:0ab6a29f35bf 5263
<> 129:0ab6a29f35bf 5264 /**
<> 129:0ab6a29f35bf 5265 * @defgroup clarke Vector Clarke Transform
<> 129:0ab6a29f35bf 5266 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
<> 129:0ab6a29f35bf 5267 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
<> 129:0ab6a29f35bf 5268 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
<> 129:0ab6a29f35bf 5269 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
<> 129:0ab6a29f35bf 5270 * \image html clarke.gif Stator current space vector and its components in (a,b).
<> 129:0ab6a29f35bf 5271 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
<> 129:0ab6a29f35bf 5272 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
<> 129:0ab6a29f35bf 5273 *
<> 129:0ab6a29f35bf 5274 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 129:0ab6a29f35bf 5275 * The library provides separate functions for Q31 and floating-point data types.
<> 129:0ab6a29f35bf 5276 * \par Algorithm
<> 129:0ab6a29f35bf 5277 * \image html clarkeFormula.gif
<> 129:0ab6a29f35bf 5278 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
<> 129:0ab6a29f35bf 5279 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
<> 129:0ab6a29f35bf 5280 * \par Fixed-Point Behavior
<> 129:0ab6a29f35bf 5281 * Care must be taken when using the Q31 version of the Clarke transform.
<> 129:0ab6a29f35bf 5282 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 129:0ab6a29f35bf 5283 * Refer to the function specific documentation below for usage guidelines.
<> 129:0ab6a29f35bf 5284 */
<> 129:0ab6a29f35bf 5285
<> 129:0ab6a29f35bf 5286 /**
<> 129:0ab6a29f35bf 5287 * @addtogroup clarke
<> 129:0ab6a29f35bf 5288 * @{
<> 129:0ab6a29f35bf 5289 */
<> 129:0ab6a29f35bf 5290
<> 129:0ab6a29f35bf 5291 /**
<> 129:0ab6a29f35bf 5292 *
<> 129:0ab6a29f35bf 5293 * @brief Floating-point Clarke transform
<> 129:0ab6a29f35bf 5294 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 129:0ab6a29f35bf 5295 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 129:0ab6a29f35bf 5296 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5297 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5298 * @return none.
<> 129:0ab6a29f35bf 5299 */
<> 129:0ab6a29f35bf 5300
<> 129:0ab6a29f35bf 5301 static __INLINE void arm_clarke_f32(
<> 129:0ab6a29f35bf 5302 float32_t Ia,
<> 129:0ab6a29f35bf 5303 float32_t Ib,
<> 129:0ab6a29f35bf 5304 float32_t * pIalpha,
<> 129:0ab6a29f35bf 5305 float32_t * pIbeta)
<> 129:0ab6a29f35bf 5306 {
<> 129:0ab6a29f35bf 5307 /* Calculate pIalpha using the equation, pIalpha = Ia */
<> 129:0ab6a29f35bf 5308 *pIalpha = Ia;
<> 129:0ab6a29f35bf 5309
<> 129:0ab6a29f35bf 5310 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
<> 129:0ab6a29f35bf 5311 *pIbeta =
<> 129:0ab6a29f35bf 5312 ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
<> 129:0ab6a29f35bf 5313
<> 129:0ab6a29f35bf 5314 }
<> 129:0ab6a29f35bf 5315
<> 129:0ab6a29f35bf 5316 /**
<> 129:0ab6a29f35bf 5317 * @brief Clarke transform for Q31 version
<> 129:0ab6a29f35bf 5318 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 129:0ab6a29f35bf 5319 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 129:0ab6a29f35bf 5320 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5321 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5322 * @return none.
<> 129:0ab6a29f35bf 5323 *
<> 129:0ab6a29f35bf 5324 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5325 * \par
<> 129:0ab6a29f35bf 5326 * The function is implemented using an internal 32-bit accumulator.
<> 129:0ab6a29f35bf 5327 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 129:0ab6a29f35bf 5328 * There is saturation on the addition, hence there is no risk of overflow.
<> 129:0ab6a29f35bf 5329 */
<> 129:0ab6a29f35bf 5330
<> 129:0ab6a29f35bf 5331 static __INLINE void arm_clarke_q31(
<> 129:0ab6a29f35bf 5332 q31_t Ia,
<> 129:0ab6a29f35bf 5333 q31_t Ib,
<> 129:0ab6a29f35bf 5334 q31_t * pIalpha,
<> 129:0ab6a29f35bf 5335 q31_t * pIbeta)
<> 129:0ab6a29f35bf 5336 {
<> 129:0ab6a29f35bf 5337 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5338
<> 129:0ab6a29f35bf 5339 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
<> 129:0ab6a29f35bf 5340 *pIalpha = Ia;
<> 129:0ab6a29f35bf 5341
<> 129:0ab6a29f35bf 5342 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
<> 129:0ab6a29f35bf 5343 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
<> 129:0ab6a29f35bf 5344
<> 129:0ab6a29f35bf 5345 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
<> 129:0ab6a29f35bf 5346 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
<> 129:0ab6a29f35bf 5347
<> 129:0ab6a29f35bf 5348 /* pIbeta is calculated by adding the intermediate products */
<> 129:0ab6a29f35bf 5349 *pIbeta = __QADD(product1, product2);
<> 129:0ab6a29f35bf 5350 }
<> 129:0ab6a29f35bf 5351
<> 129:0ab6a29f35bf 5352 /**
<> 129:0ab6a29f35bf 5353 * @} end of clarke group
<> 129:0ab6a29f35bf 5354 */
<> 129:0ab6a29f35bf 5355
<> 129:0ab6a29f35bf 5356 /**
<> 129:0ab6a29f35bf 5357 * @brief Converts the elements of the Q7 vector to Q31 vector.
<> 129:0ab6a29f35bf 5358 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 5359 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 5360 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 5361 * @return none.
<> 129:0ab6a29f35bf 5362 */
<> 129:0ab6a29f35bf 5363 void arm_q7_to_q31(
<> 129:0ab6a29f35bf 5364 q7_t * pSrc,
<> 129:0ab6a29f35bf 5365 q31_t * pDst,
<> 129:0ab6a29f35bf 5366 uint32_t blockSize);
<> 129:0ab6a29f35bf 5367
<> 129:0ab6a29f35bf 5368
<> 129:0ab6a29f35bf 5369
<> 129:0ab6a29f35bf 5370
<> 129:0ab6a29f35bf 5371 /**
<> 129:0ab6a29f35bf 5372 * @ingroup groupController
<> 129:0ab6a29f35bf 5373 */
<> 129:0ab6a29f35bf 5374
<> 129:0ab6a29f35bf 5375 /**
<> 129:0ab6a29f35bf 5376 * @defgroup inv_clarke Vector Inverse Clarke Transform
<> 129:0ab6a29f35bf 5377 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
<> 129:0ab6a29f35bf 5378 *
<> 129:0ab6a29f35bf 5379 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 129:0ab6a29f35bf 5380 * The library provides separate functions for Q31 and floating-point data types.
<> 129:0ab6a29f35bf 5381 * \par Algorithm
<> 129:0ab6a29f35bf 5382 * \image html clarkeInvFormula.gif
<> 129:0ab6a29f35bf 5383 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
<> 129:0ab6a29f35bf 5384 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
<> 129:0ab6a29f35bf 5385 * \par Fixed-Point Behavior
<> 129:0ab6a29f35bf 5386 * Care must be taken when using the Q31 version of the Clarke transform.
<> 129:0ab6a29f35bf 5387 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 129:0ab6a29f35bf 5388 * Refer to the function specific documentation below for usage guidelines.
<> 129:0ab6a29f35bf 5389 */
<> 129:0ab6a29f35bf 5390
<> 129:0ab6a29f35bf 5391 /**
<> 129:0ab6a29f35bf 5392 * @addtogroup inv_clarke
<> 129:0ab6a29f35bf 5393 * @{
<> 129:0ab6a29f35bf 5394 */
<> 129:0ab6a29f35bf 5395
<> 129:0ab6a29f35bf 5396 /**
<> 129:0ab6a29f35bf 5397 * @brief Floating-point Inverse Clarke transform
<> 129:0ab6a29f35bf 5398 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5399 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5400 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 129:0ab6a29f35bf 5401 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 129:0ab6a29f35bf 5402 * @return none.
<> 129:0ab6a29f35bf 5403 */
<> 129:0ab6a29f35bf 5404
<> 129:0ab6a29f35bf 5405
<> 129:0ab6a29f35bf 5406 static __INLINE void arm_inv_clarke_f32(
<> 129:0ab6a29f35bf 5407 float32_t Ialpha,
<> 129:0ab6a29f35bf 5408 float32_t Ibeta,
<> 129:0ab6a29f35bf 5409 float32_t * pIa,
<> 129:0ab6a29f35bf 5410 float32_t * pIb)
<> 129:0ab6a29f35bf 5411 {
<> 129:0ab6a29f35bf 5412 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 129:0ab6a29f35bf 5413 *pIa = Ialpha;
<> 129:0ab6a29f35bf 5414
<> 129:0ab6a29f35bf 5415 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
<> 129:0ab6a29f35bf 5416 *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
<> 129:0ab6a29f35bf 5417
<> 129:0ab6a29f35bf 5418 }
<> 129:0ab6a29f35bf 5419
<> 129:0ab6a29f35bf 5420 /**
<> 129:0ab6a29f35bf 5421 * @brief Inverse Clarke transform for Q31 version
<> 129:0ab6a29f35bf 5422 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5423 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5424 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 129:0ab6a29f35bf 5425 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 129:0ab6a29f35bf 5426 * @return none.
<> 129:0ab6a29f35bf 5427 *
<> 129:0ab6a29f35bf 5428 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5429 * \par
<> 129:0ab6a29f35bf 5430 * The function is implemented using an internal 32-bit accumulator.
<> 129:0ab6a29f35bf 5431 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 129:0ab6a29f35bf 5432 * There is saturation on the subtraction, hence there is no risk of overflow.
<> 129:0ab6a29f35bf 5433 */
<> 129:0ab6a29f35bf 5434
<> 129:0ab6a29f35bf 5435 static __INLINE void arm_inv_clarke_q31(
<> 129:0ab6a29f35bf 5436 q31_t Ialpha,
<> 129:0ab6a29f35bf 5437 q31_t Ibeta,
<> 129:0ab6a29f35bf 5438 q31_t * pIa,
<> 129:0ab6a29f35bf 5439 q31_t * pIb)
<> 129:0ab6a29f35bf 5440 {
<> 129:0ab6a29f35bf 5441 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5442
<> 129:0ab6a29f35bf 5443 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 129:0ab6a29f35bf 5444 *pIa = Ialpha;
<> 129:0ab6a29f35bf 5445
<> 129:0ab6a29f35bf 5446 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
<> 129:0ab6a29f35bf 5447 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
<> 129:0ab6a29f35bf 5448
<> 129:0ab6a29f35bf 5449 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
<> 129:0ab6a29f35bf 5450 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
<> 129:0ab6a29f35bf 5451
<> 129:0ab6a29f35bf 5452 /* pIb is calculated by subtracting the products */
<> 129:0ab6a29f35bf 5453 *pIb = __QSUB(product2, product1);
<> 129:0ab6a29f35bf 5454
<> 129:0ab6a29f35bf 5455 }
<> 129:0ab6a29f35bf 5456
<> 129:0ab6a29f35bf 5457 /**
<> 129:0ab6a29f35bf 5458 * @} end of inv_clarke group
<> 129:0ab6a29f35bf 5459 */
<> 129:0ab6a29f35bf 5460
<> 129:0ab6a29f35bf 5461 /**
<> 129:0ab6a29f35bf 5462 * @brief Converts the elements of the Q7 vector to Q15 vector.
<> 129:0ab6a29f35bf 5463 * @param[in] *pSrc input pointer
<> 129:0ab6a29f35bf 5464 * @param[out] *pDst output pointer
<> 129:0ab6a29f35bf 5465 * @param[in] blockSize number of samples to process
<> 129:0ab6a29f35bf 5466 * @return none.
<> 129:0ab6a29f35bf 5467 */
<> 129:0ab6a29f35bf 5468 void arm_q7_to_q15(
<> 129:0ab6a29f35bf 5469 q7_t * pSrc,
<> 129:0ab6a29f35bf 5470 q15_t * pDst,
<> 129:0ab6a29f35bf 5471 uint32_t blockSize);
<> 129:0ab6a29f35bf 5472
<> 129:0ab6a29f35bf 5473
<> 129:0ab6a29f35bf 5474
<> 129:0ab6a29f35bf 5475 /**
<> 129:0ab6a29f35bf 5476 * @ingroup groupController
<> 129:0ab6a29f35bf 5477 */
<> 129:0ab6a29f35bf 5478
<> 129:0ab6a29f35bf 5479 /**
<> 129:0ab6a29f35bf 5480 * @defgroup park Vector Park Transform
<> 129:0ab6a29f35bf 5481 *
<> 129:0ab6a29f35bf 5482 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
<> 129:0ab6a29f35bf 5483 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
<> 129:0ab6a29f35bf 5484 * from the stationary to the moving reference frame and control the spatial relationship between
<> 129:0ab6a29f35bf 5485 * the stator vector current and rotor flux vector.
<> 129:0ab6a29f35bf 5486 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
<> 129:0ab6a29f35bf 5487 * current vector and the relationship from the two reference frames:
<> 129:0ab6a29f35bf 5488 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
<> 129:0ab6a29f35bf 5489 *
<> 129:0ab6a29f35bf 5490 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 129:0ab6a29f35bf 5491 * The library provides separate functions for Q31 and floating-point data types.
<> 129:0ab6a29f35bf 5492 * \par Algorithm
<> 129:0ab6a29f35bf 5493 * \image html parkFormula.gif
<> 129:0ab6a29f35bf 5494 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
<> 129:0ab6a29f35bf 5495 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 129:0ab6a29f35bf 5496 * cosine and sine values of theta (rotor flux position).
<> 129:0ab6a29f35bf 5497 * \par Fixed-Point Behavior
<> 129:0ab6a29f35bf 5498 * Care must be taken when using the Q31 version of the Park transform.
<> 129:0ab6a29f35bf 5499 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 129:0ab6a29f35bf 5500 * Refer to the function specific documentation below for usage guidelines.
<> 129:0ab6a29f35bf 5501 */
<> 129:0ab6a29f35bf 5502
<> 129:0ab6a29f35bf 5503 /**
<> 129:0ab6a29f35bf 5504 * @addtogroup park
<> 129:0ab6a29f35bf 5505 * @{
<> 129:0ab6a29f35bf 5506 */
<> 129:0ab6a29f35bf 5507
<> 129:0ab6a29f35bf 5508 /**
<> 129:0ab6a29f35bf 5509 * @brief Floating-point Park transform
<> 129:0ab6a29f35bf 5510 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 129:0ab6a29f35bf 5511 * @param[in] Ibeta input two-phase vector coordinate beta
<> 129:0ab6a29f35bf 5512 * @param[out] *pId points to output rotor reference frame d
<> 129:0ab6a29f35bf 5513 * @param[out] *pIq points to output rotor reference frame q
<> 129:0ab6a29f35bf 5514 * @param[in] sinVal sine value of rotation angle theta
<> 129:0ab6a29f35bf 5515 * @param[in] cosVal cosine value of rotation angle theta
<> 129:0ab6a29f35bf 5516 * @return none.
<> 129:0ab6a29f35bf 5517 *
<> 129:0ab6a29f35bf 5518 * The function implements the forward Park transform.
<> 129:0ab6a29f35bf 5519 *
<> 129:0ab6a29f35bf 5520 */
<> 129:0ab6a29f35bf 5521
<> 129:0ab6a29f35bf 5522 static __INLINE void arm_park_f32(
<> 129:0ab6a29f35bf 5523 float32_t Ialpha,
<> 129:0ab6a29f35bf 5524 float32_t Ibeta,
<> 129:0ab6a29f35bf 5525 float32_t * pId,
<> 129:0ab6a29f35bf 5526 float32_t * pIq,
<> 129:0ab6a29f35bf 5527 float32_t sinVal,
<> 129:0ab6a29f35bf 5528 float32_t cosVal)
<> 129:0ab6a29f35bf 5529 {
<> 129:0ab6a29f35bf 5530 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
<> 129:0ab6a29f35bf 5531 *pId = Ialpha * cosVal + Ibeta * sinVal;
<> 129:0ab6a29f35bf 5532
<> 129:0ab6a29f35bf 5533 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
<> 129:0ab6a29f35bf 5534 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
<> 129:0ab6a29f35bf 5535
<> 129:0ab6a29f35bf 5536 }
<> 129:0ab6a29f35bf 5537
<> 129:0ab6a29f35bf 5538 /**
<> 129:0ab6a29f35bf 5539 * @brief Park transform for Q31 version
<> 129:0ab6a29f35bf 5540 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 129:0ab6a29f35bf 5541 * @param[in] Ibeta input two-phase vector coordinate beta
<> 129:0ab6a29f35bf 5542 * @param[out] *pId points to output rotor reference frame d
<> 129:0ab6a29f35bf 5543 * @param[out] *pIq points to output rotor reference frame q
<> 129:0ab6a29f35bf 5544 * @param[in] sinVal sine value of rotation angle theta
<> 129:0ab6a29f35bf 5545 * @param[in] cosVal cosine value of rotation angle theta
<> 129:0ab6a29f35bf 5546 * @return none.
<> 129:0ab6a29f35bf 5547 *
<> 129:0ab6a29f35bf 5548 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5549 * \par
<> 129:0ab6a29f35bf 5550 * The function is implemented using an internal 32-bit accumulator.
<> 129:0ab6a29f35bf 5551 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 129:0ab6a29f35bf 5552 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
<> 129:0ab6a29f35bf 5553 */
<> 129:0ab6a29f35bf 5554
<> 129:0ab6a29f35bf 5555
<> 129:0ab6a29f35bf 5556 static __INLINE void arm_park_q31(
<> 129:0ab6a29f35bf 5557 q31_t Ialpha,
<> 129:0ab6a29f35bf 5558 q31_t Ibeta,
<> 129:0ab6a29f35bf 5559 q31_t * pId,
<> 129:0ab6a29f35bf 5560 q31_t * pIq,
<> 129:0ab6a29f35bf 5561 q31_t sinVal,
<> 129:0ab6a29f35bf 5562 q31_t cosVal)
<> 129:0ab6a29f35bf 5563 {
<> 129:0ab6a29f35bf 5564 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5565 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5566
<> 129:0ab6a29f35bf 5567 /* Intermediate product is calculated by (Ialpha * cosVal) */
<> 129:0ab6a29f35bf 5568 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
<> 129:0ab6a29f35bf 5569
<> 129:0ab6a29f35bf 5570 /* Intermediate product is calculated by (Ibeta * sinVal) */
<> 129:0ab6a29f35bf 5571 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
<> 129:0ab6a29f35bf 5572
<> 129:0ab6a29f35bf 5573
<> 129:0ab6a29f35bf 5574 /* Intermediate product is calculated by (Ialpha * sinVal) */
<> 129:0ab6a29f35bf 5575 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
<> 129:0ab6a29f35bf 5576
<> 129:0ab6a29f35bf 5577 /* Intermediate product is calculated by (Ibeta * cosVal) */
<> 129:0ab6a29f35bf 5578 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
<> 129:0ab6a29f35bf 5579
<> 129:0ab6a29f35bf 5580 /* Calculate pId by adding the two intermediate products 1 and 2 */
<> 129:0ab6a29f35bf 5581 *pId = __QADD(product1, product2);
<> 129:0ab6a29f35bf 5582
<> 129:0ab6a29f35bf 5583 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
<> 129:0ab6a29f35bf 5584 *pIq = __QSUB(product4, product3);
<> 129:0ab6a29f35bf 5585 }
<> 129:0ab6a29f35bf 5586
<> 129:0ab6a29f35bf 5587 /**
<> 129:0ab6a29f35bf 5588 * @} end of park group
<> 129:0ab6a29f35bf 5589 */
<> 129:0ab6a29f35bf 5590
<> 129:0ab6a29f35bf 5591 /**
<> 129:0ab6a29f35bf 5592 * @brief Converts the elements of the Q7 vector to floating-point vector.
<> 129:0ab6a29f35bf 5593 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 5594 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 5595 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 5596 * @return none.
<> 129:0ab6a29f35bf 5597 */
<> 129:0ab6a29f35bf 5598 void arm_q7_to_float(
<> 129:0ab6a29f35bf 5599 q7_t * pSrc,
<> 129:0ab6a29f35bf 5600 float32_t * pDst,
<> 129:0ab6a29f35bf 5601 uint32_t blockSize);
<> 129:0ab6a29f35bf 5602
<> 129:0ab6a29f35bf 5603
<> 129:0ab6a29f35bf 5604 /**
<> 129:0ab6a29f35bf 5605 * @ingroup groupController
<> 129:0ab6a29f35bf 5606 */
<> 129:0ab6a29f35bf 5607
<> 129:0ab6a29f35bf 5608 /**
<> 129:0ab6a29f35bf 5609 * @defgroup inv_park Vector Inverse Park transform
<> 129:0ab6a29f35bf 5610 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
<> 129:0ab6a29f35bf 5611 *
<> 129:0ab6a29f35bf 5612 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 129:0ab6a29f35bf 5613 * The library provides separate functions for Q31 and floating-point data types.
<> 129:0ab6a29f35bf 5614 * \par Algorithm
<> 129:0ab6a29f35bf 5615 * \image html parkInvFormula.gif
<> 129:0ab6a29f35bf 5616 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
<> 129:0ab6a29f35bf 5617 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 129:0ab6a29f35bf 5618 * cosine and sine values of theta (rotor flux position).
<> 129:0ab6a29f35bf 5619 * \par Fixed-Point Behavior
<> 129:0ab6a29f35bf 5620 * Care must be taken when using the Q31 version of the Park transform.
<> 129:0ab6a29f35bf 5621 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 129:0ab6a29f35bf 5622 * Refer to the function specific documentation below for usage guidelines.
<> 129:0ab6a29f35bf 5623 */
<> 129:0ab6a29f35bf 5624
<> 129:0ab6a29f35bf 5625 /**
<> 129:0ab6a29f35bf 5626 * @addtogroup inv_park
<> 129:0ab6a29f35bf 5627 * @{
<> 129:0ab6a29f35bf 5628 */
<> 129:0ab6a29f35bf 5629
<> 129:0ab6a29f35bf 5630 /**
<> 129:0ab6a29f35bf 5631 * @brief Floating-point Inverse Park transform
<> 129:0ab6a29f35bf 5632 * @param[in] Id input coordinate of rotor reference frame d
<> 129:0ab6a29f35bf 5633 * @param[in] Iq input coordinate of rotor reference frame q
<> 129:0ab6a29f35bf 5634 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5635 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5636 * @param[in] sinVal sine value of rotation angle theta
<> 129:0ab6a29f35bf 5637 * @param[in] cosVal cosine value of rotation angle theta
<> 129:0ab6a29f35bf 5638 * @return none.
<> 129:0ab6a29f35bf 5639 */
<> 129:0ab6a29f35bf 5640
<> 129:0ab6a29f35bf 5641 static __INLINE void arm_inv_park_f32(
<> 129:0ab6a29f35bf 5642 float32_t Id,
<> 129:0ab6a29f35bf 5643 float32_t Iq,
<> 129:0ab6a29f35bf 5644 float32_t * pIalpha,
<> 129:0ab6a29f35bf 5645 float32_t * pIbeta,
<> 129:0ab6a29f35bf 5646 float32_t sinVal,
<> 129:0ab6a29f35bf 5647 float32_t cosVal)
<> 129:0ab6a29f35bf 5648 {
<> 129:0ab6a29f35bf 5649 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
<> 129:0ab6a29f35bf 5650 *pIalpha = Id * cosVal - Iq * sinVal;
<> 129:0ab6a29f35bf 5651
<> 129:0ab6a29f35bf 5652 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
<> 129:0ab6a29f35bf 5653 *pIbeta = Id * sinVal + Iq * cosVal;
<> 129:0ab6a29f35bf 5654
<> 129:0ab6a29f35bf 5655 }
<> 129:0ab6a29f35bf 5656
<> 129:0ab6a29f35bf 5657
<> 129:0ab6a29f35bf 5658 /**
<> 129:0ab6a29f35bf 5659 * @brief Inverse Park transform for Q31 version
<> 129:0ab6a29f35bf 5660 * @param[in] Id input coordinate of rotor reference frame d
<> 129:0ab6a29f35bf 5661 * @param[in] Iq input coordinate of rotor reference frame q
<> 129:0ab6a29f35bf 5662 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 129:0ab6a29f35bf 5663 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 129:0ab6a29f35bf 5664 * @param[in] sinVal sine value of rotation angle theta
<> 129:0ab6a29f35bf 5665 * @param[in] cosVal cosine value of rotation angle theta
<> 129:0ab6a29f35bf 5666 * @return none.
<> 129:0ab6a29f35bf 5667 *
<> 129:0ab6a29f35bf 5668 * <b>Scaling and Overflow Behavior:</b>
<> 129:0ab6a29f35bf 5669 * \par
<> 129:0ab6a29f35bf 5670 * The function is implemented using an internal 32-bit accumulator.
<> 129:0ab6a29f35bf 5671 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 129:0ab6a29f35bf 5672 * There is saturation on the addition, hence there is no risk of overflow.
<> 129:0ab6a29f35bf 5673 */
<> 129:0ab6a29f35bf 5674
<> 129:0ab6a29f35bf 5675
<> 129:0ab6a29f35bf 5676 static __INLINE void arm_inv_park_q31(
<> 129:0ab6a29f35bf 5677 q31_t Id,
<> 129:0ab6a29f35bf 5678 q31_t Iq,
<> 129:0ab6a29f35bf 5679 q31_t * pIalpha,
<> 129:0ab6a29f35bf 5680 q31_t * pIbeta,
<> 129:0ab6a29f35bf 5681 q31_t sinVal,
<> 129:0ab6a29f35bf 5682 q31_t cosVal)
<> 129:0ab6a29f35bf 5683 {
<> 129:0ab6a29f35bf 5684 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5685 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 129:0ab6a29f35bf 5686
<> 129:0ab6a29f35bf 5687 /* Intermediate product is calculated by (Id * cosVal) */
<> 129:0ab6a29f35bf 5688 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
<> 129:0ab6a29f35bf 5689
<> 129:0ab6a29f35bf 5690 /* Intermediate product is calculated by (Iq * sinVal) */
<> 129:0ab6a29f35bf 5691 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
<> 129:0ab6a29f35bf 5692
<> 129:0ab6a29f35bf 5693
<> 129:0ab6a29f35bf 5694 /* Intermediate product is calculated by (Id * sinVal) */
<> 129:0ab6a29f35bf 5695 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
<> 129:0ab6a29f35bf 5696
<> 129:0ab6a29f35bf 5697 /* Intermediate product is calculated by (Iq * cosVal) */
<> 129:0ab6a29f35bf 5698 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
<> 129:0ab6a29f35bf 5699
<> 129:0ab6a29f35bf 5700 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
<> 129:0ab6a29f35bf 5701 *pIalpha = __QSUB(product1, product2);
<> 129:0ab6a29f35bf 5702
<> 129:0ab6a29f35bf 5703 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
<> 129:0ab6a29f35bf 5704 *pIbeta = __QADD(product4, product3);
<> 129:0ab6a29f35bf 5705
<> 129:0ab6a29f35bf 5706 }
<> 129:0ab6a29f35bf 5707
<> 129:0ab6a29f35bf 5708 /**
<> 129:0ab6a29f35bf 5709 * @} end of Inverse park group
<> 129:0ab6a29f35bf 5710 */
<> 129:0ab6a29f35bf 5711
<> 129:0ab6a29f35bf 5712
<> 129:0ab6a29f35bf 5713 /**
<> 129:0ab6a29f35bf 5714 * @brief Converts the elements of the Q31 vector to floating-point vector.
<> 129:0ab6a29f35bf 5715 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 5716 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 5717 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 5718 * @return none.
<> 129:0ab6a29f35bf 5719 */
<> 129:0ab6a29f35bf 5720 void arm_q31_to_float(
<> 129:0ab6a29f35bf 5721 q31_t * pSrc,
<> 129:0ab6a29f35bf 5722 float32_t * pDst,
<> 129:0ab6a29f35bf 5723 uint32_t blockSize);
<> 129:0ab6a29f35bf 5724
<> 129:0ab6a29f35bf 5725 /**
<> 129:0ab6a29f35bf 5726 * @ingroup groupInterpolation
<> 129:0ab6a29f35bf 5727 */
<> 129:0ab6a29f35bf 5728
<> 129:0ab6a29f35bf 5729 /**
<> 129:0ab6a29f35bf 5730 * @defgroup LinearInterpolate Linear Interpolation
<> 129:0ab6a29f35bf 5731 *
<> 129:0ab6a29f35bf 5732 * Linear interpolation is a method of curve fitting using linear polynomials.
<> 129:0ab6a29f35bf 5733 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
<> 129:0ab6a29f35bf 5734 *
<> 129:0ab6a29f35bf 5735 * \par
<> 129:0ab6a29f35bf 5736 * \image html LinearInterp.gif "Linear interpolation"
<> 129:0ab6a29f35bf 5737 *
<> 129:0ab6a29f35bf 5738 * \par
<> 129:0ab6a29f35bf 5739 * A Linear Interpolate function calculates an output value(y), for the input(x)
<> 129:0ab6a29f35bf 5740 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
<> 129:0ab6a29f35bf 5741 *
<> 129:0ab6a29f35bf 5742 * \par Algorithm:
<> 129:0ab6a29f35bf 5743 * <pre>
<> 129:0ab6a29f35bf 5744 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
<> 129:0ab6a29f35bf 5745 * where x0, x1 are nearest values of input x
<> 129:0ab6a29f35bf 5746 * y0, y1 are nearest values to output y
<> 129:0ab6a29f35bf 5747 * </pre>
<> 129:0ab6a29f35bf 5748 *
<> 129:0ab6a29f35bf 5749 * \par
<> 129:0ab6a29f35bf 5750 * This set of functions implements Linear interpolation process
<> 129:0ab6a29f35bf 5751 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
<> 129:0ab6a29f35bf 5752 * sample of data and each call to the function returns a single processed value.
<> 129:0ab6a29f35bf 5753 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
<> 129:0ab6a29f35bf 5754 * <code>x</code> is the input sample value. The functions returns the output value.
<> 129:0ab6a29f35bf 5755 *
<> 129:0ab6a29f35bf 5756 * \par
<> 129:0ab6a29f35bf 5757 * if x is outside of the table boundary, Linear interpolation returns first value of the table
<> 129:0ab6a29f35bf 5758 * if x is below input range and returns last value of table if x is above range.
<> 129:0ab6a29f35bf 5759 */
<> 129:0ab6a29f35bf 5760
<> 129:0ab6a29f35bf 5761 /**
<> 129:0ab6a29f35bf 5762 * @addtogroup LinearInterpolate
<> 129:0ab6a29f35bf 5763 * @{
<> 129:0ab6a29f35bf 5764 */
<> 129:0ab6a29f35bf 5765
<> 129:0ab6a29f35bf 5766 /**
<> 129:0ab6a29f35bf 5767 * @brief Process function for the floating-point Linear Interpolation Function.
<> 129:0ab6a29f35bf 5768 * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure
<> 129:0ab6a29f35bf 5769 * @param[in] x input sample to process
<> 129:0ab6a29f35bf 5770 * @return y processed output sample.
<> 129:0ab6a29f35bf 5771 *
<> 129:0ab6a29f35bf 5772 */
<> 129:0ab6a29f35bf 5773
<> 129:0ab6a29f35bf 5774 static __INLINE float32_t arm_linear_interp_f32(
<> 129:0ab6a29f35bf 5775 arm_linear_interp_instance_f32 * S,
<> 129:0ab6a29f35bf 5776 float32_t x)
<> 129:0ab6a29f35bf 5777 {
<> 129:0ab6a29f35bf 5778
<> 129:0ab6a29f35bf 5779 float32_t y;
<> 129:0ab6a29f35bf 5780 float32_t x0, x1; /* Nearest input values */
<> 129:0ab6a29f35bf 5781 float32_t y0, y1; /* Nearest output values */
<> 129:0ab6a29f35bf 5782 float32_t xSpacing = S->xSpacing; /* spacing between input values */
<> 129:0ab6a29f35bf 5783 int32_t i; /* Index variable */
<> 129:0ab6a29f35bf 5784 float32_t *pYData = S->pYData; /* pointer to output table */
<> 129:0ab6a29f35bf 5785
<> 129:0ab6a29f35bf 5786 /* Calculation of index */
<> 129:0ab6a29f35bf 5787 i = (int32_t) ((x - S->x1) / xSpacing);
<> 129:0ab6a29f35bf 5788
<> 129:0ab6a29f35bf 5789 if(i < 0)
<> 129:0ab6a29f35bf 5790 {
<> 129:0ab6a29f35bf 5791 /* Iniatilize output for below specified range as least output value of table */
<> 129:0ab6a29f35bf 5792 y = pYData[0];
<> 129:0ab6a29f35bf 5793 }
<> 129:0ab6a29f35bf 5794 else if((uint32_t)i >= S->nValues)
<> 129:0ab6a29f35bf 5795 {
<> 129:0ab6a29f35bf 5796 /* Iniatilize output for above specified range as last output value of table */
<> 129:0ab6a29f35bf 5797 y = pYData[S->nValues - 1];
<> 129:0ab6a29f35bf 5798 }
<> 129:0ab6a29f35bf 5799 else
<> 129:0ab6a29f35bf 5800 {
<> 129:0ab6a29f35bf 5801 /* Calculation of nearest input values */
<> 129:0ab6a29f35bf 5802 x0 = S->x1 + i * xSpacing;
<> 129:0ab6a29f35bf 5803 x1 = S->x1 + (i + 1) * xSpacing;
<> 129:0ab6a29f35bf 5804
<> 129:0ab6a29f35bf 5805 /* Read of nearest output values */
<> 129:0ab6a29f35bf 5806 y0 = pYData[i];
<> 129:0ab6a29f35bf 5807 y1 = pYData[i + 1];
<> 129:0ab6a29f35bf 5808
<> 129:0ab6a29f35bf 5809 /* Calculation of output */
<> 129:0ab6a29f35bf 5810 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
<> 129:0ab6a29f35bf 5811
<> 129:0ab6a29f35bf 5812 }
<> 129:0ab6a29f35bf 5813
<> 129:0ab6a29f35bf 5814 /* returns output value */
<> 129:0ab6a29f35bf 5815 return (y);
<> 129:0ab6a29f35bf 5816 }
<> 129:0ab6a29f35bf 5817
<> 129:0ab6a29f35bf 5818 /**
<> 129:0ab6a29f35bf 5819 *
<> 129:0ab6a29f35bf 5820 * @brief Process function for the Q31 Linear Interpolation Function.
<> 129:0ab6a29f35bf 5821 * @param[in] *pYData pointer to Q31 Linear Interpolation table
<> 129:0ab6a29f35bf 5822 * @param[in] x input sample to process
<> 129:0ab6a29f35bf 5823 * @param[in] nValues number of table values
<> 129:0ab6a29f35bf 5824 * @return y processed output sample.
<> 129:0ab6a29f35bf 5825 *
<> 129:0ab6a29f35bf 5826 * \par
<> 129:0ab6a29f35bf 5827 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 129:0ab6a29f35bf 5828 * This function can support maximum of table size 2^12.
<> 129:0ab6a29f35bf 5829 *
<> 129:0ab6a29f35bf 5830 */
<> 129:0ab6a29f35bf 5831
<> 129:0ab6a29f35bf 5832
<> 129:0ab6a29f35bf 5833 static __INLINE q31_t arm_linear_interp_q31(
<> 129:0ab6a29f35bf 5834 q31_t * pYData,
<> 129:0ab6a29f35bf 5835 q31_t x,
<> 129:0ab6a29f35bf 5836 uint32_t nValues)
<> 129:0ab6a29f35bf 5837 {
<> 129:0ab6a29f35bf 5838 q31_t y; /* output */
<> 129:0ab6a29f35bf 5839 q31_t y0, y1; /* Nearest output values */
<> 129:0ab6a29f35bf 5840 q31_t fract; /* fractional part */
<> 129:0ab6a29f35bf 5841 int32_t index; /* Index to read nearest output values */
<> 129:0ab6a29f35bf 5842
<> 129:0ab6a29f35bf 5843 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 5844 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 5845 /* Index value calculation */
<> 129:0ab6a29f35bf 5846 index = ((x & 0xFFF00000) >> 20);
<> 129:0ab6a29f35bf 5847
<> 129:0ab6a29f35bf 5848 if(index >= (int32_t)(nValues - 1))
<> 129:0ab6a29f35bf 5849 {
<> 129:0ab6a29f35bf 5850 return (pYData[nValues - 1]);
<> 129:0ab6a29f35bf 5851 }
<> 129:0ab6a29f35bf 5852 else if(index < 0)
<> 129:0ab6a29f35bf 5853 {
<> 129:0ab6a29f35bf 5854 return (pYData[0]);
<> 129:0ab6a29f35bf 5855 }
<> 129:0ab6a29f35bf 5856 else
<> 129:0ab6a29f35bf 5857 {
<> 129:0ab6a29f35bf 5858
<> 129:0ab6a29f35bf 5859 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 5860 /* shift left by 11 to keep fract in 1.31 format */
<> 129:0ab6a29f35bf 5861 fract = (x & 0x000FFFFF) << 11;
<> 129:0ab6a29f35bf 5862
<> 129:0ab6a29f35bf 5863 /* Read two nearest output values from the index in 1.31(q31) format */
<> 129:0ab6a29f35bf 5864 y0 = pYData[index];
<> 129:0ab6a29f35bf 5865 y1 = pYData[index + 1u];
<> 129:0ab6a29f35bf 5866
<> 129:0ab6a29f35bf 5867 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
<> 129:0ab6a29f35bf 5868 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
<> 129:0ab6a29f35bf 5869
<> 129:0ab6a29f35bf 5870 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
<> 129:0ab6a29f35bf 5871 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
<> 129:0ab6a29f35bf 5872
<> 129:0ab6a29f35bf 5873 /* Convert y to 1.31 format */
<> 129:0ab6a29f35bf 5874 return (y << 1u);
<> 129:0ab6a29f35bf 5875
<> 129:0ab6a29f35bf 5876 }
<> 129:0ab6a29f35bf 5877
<> 129:0ab6a29f35bf 5878 }
<> 129:0ab6a29f35bf 5879
<> 129:0ab6a29f35bf 5880 /**
<> 129:0ab6a29f35bf 5881 *
<> 129:0ab6a29f35bf 5882 * @brief Process function for the Q15 Linear Interpolation Function.
<> 129:0ab6a29f35bf 5883 * @param[in] *pYData pointer to Q15 Linear Interpolation table
<> 129:0ab6a29f35bf 5884 * @param[in] x input sample to process
<> 129:0ab6a29f35bf 5885 * @param[in] nValues number of table values
<> 129:0ab6a29f35bf 5886 * @return y processed output sample.
<> 129:0ab6a29f35bf 5887 *
<> 129:0ab6a29f35bf 5888 * \par
<> 129:0ab6a29f35bf 5889 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 129:0ab6a29f35bf 5890 * This function can support maximum of table size 2^12.
<> 129:0ab6a29f35bf 5891 *
<> 129:0ab6a29f35bf 5892 */
<> 129:0ab6a29f35bf 5893
<> 129:0ab6a29f35bf 5894
<> 129:0ab6a29f35bf 5895 static __INLINE q15_t arm_linear_interp_q15(
<> 129:0ab6a29f35bf 5896 q15_t * pYData,
<> 129:0ab6a29f35bf 5897 q31_t x,
<> 129:0ab6a29f35bf 5898 uint32_t nValues)
<> 129:0ab6a29f35bf 5899 {
<> 129:0ab6a29f35bf 5900 q63_t y; /* output */
<> 129:0ab6a29f35bf 5901 q15_t y0, y1; /* Nearest output values */
<> 129:0ab6a29f35bf 5902 q31_t fract; /* fractional part */
<> 129:0ab6a29f35bf 5903 int32_t index; /* Index to read nearest output values */
<> 129:0ab6a29f35bf 5904
<> 129:0ab6a29f35bf 5905 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 5906 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 5907 /* Index value calculation */
<> 129:0ab6a29f35bf 5908 index = ((x & 0xFFF00000) >> 20u);
<> 129:0ab6a29f35bf 5909
<> 129:0ab6a29f35bf 5910 if(index >= (int32_t)(nValues - 1))
<> 129:0ab6a29f35bf 5911 {
<> 129:0ab6a29f35bf 5912 return (pYData[nValues - 1]);
<> 129:0ab6a29f35bf 5913 }
<> 129:0ab6a29f35bf 5914 else if(index < 0)
<> 129:0ab6a29f35bf 5915 {
<> 129:0ab6a29f35bf 5916 return (pYData[0]);
<> 129:0ab6a29f35bf 5917 }
<> 129:0ab6a29f35bf 5918 else
<> 129:0ab6a29f35bf 5919 {
<> 129:0ab6a29f35bf 5920 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 5921 /* fract is in 12.20 format */
<> 129:0ab6a29f35bf 5922 fract = (x & 0x000FFFFF);
<> 129:0ab6a29f35bf 5923
<> 129:0ab6a29f35bf 5924 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 5925 y0 = pYData[index];
<> 129:0ab6a29f35bf 5926 y1 = pYData[index + 1u];
<> 129:0ab6a29f35bf 5927
<> 129:0ab6a29f35bf 5928 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
<> 129:0ab6a29f35bf 5929 y = ((q63_t) y0 * (0xFFFFF - fract));
<> 129:0ab6a29f35bf 5930
<> 129:0ab6a29f35bf 5931 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
<> 129:0ab6a29f35bf 5932 y += ((q63_t) y1 * (fract));
<> 129:0ab6a29f35bf 5933
<> 129:0ab6a29f35bf 5934 /* convert y to 1.15 format */
<> 129:0ab6a29f35bf 5935 return (y >> 20);
<> 129:0ab6a29f35bf 5936 }
<> 129:0ab6a29f35bf 5937
<> 129:0ab6a29f35bf 5938
<> 129:0ab6a29f35bf 5939 }
<> 129:0ab6a29f35bf 5940
<> 129:0ab6a29f35bf 5941 /**
<> 129:0ab6a29f35bf 5942 *
<> 129:0ab6a29f35bf 5943 * @brief Process function for the Q7 Linear Interpolation Function.
<> 129:0ab6a29f35bf 5944 * @param[in] *pYData pointer to Q7 Linear Interpolation table
<> 129:0ab6a29f35bf 5945 * @param[in] x input sample to process
<> 129:0ab6a29f35bf 5946 * @param[in] nValues number of table values
<> 129:0ab6a29f35bf 5947 * @return y processed output sample.
<> 129:0ab6a29f35bf 5948 *
<> 129:0ab6a29f35bf 5949 * \par
<> 129:0ab6a29f35bf 5950 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 129:0ab6a29f35bf 5951 * This function can support maximum of table size 2^12.
<> 129:0ab6a29f35bf 5952 */
<> 129:0ab6a29f35bf 5953
<> 129:0ab6a29f35bf 5954
<> 129:0ab6a29f35bf 5955 static __INLINE q7_t arm_linear_interp_q7(
<> 129:0ab6a29f35bf 5956 q7_t * pYData,
<> 129:0ab6a29f35bf 5957 q31_t x,
<> 129:0ab6a29f35bf 5958 uint32_t nValues)
<> 129:0ab6a29f35bf 5959 {
<> 129:0ab6a29f35bf 5960 q31_t y; /* output */
<> 129:0ab6a29f35bf 5961 q7_t y0, y1; /* Nearest output values */
<> 129:0ab6a29f35bf 5962 q31_t fract; /* fractional part */
<> 129:0ab6a29f35bf 5963 uint32_t index; /* Index to read nearest output values */
<> 129:0ab6a29f35bf 5964
<> 129:0ab6a29f35bf 5965 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 5966 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 5967 /* Index value calculation */
<> 129:0ab6a29f35bf 5968 if (x < 0)
<> 129:0ab6a29f35bf 5969 {
<> 129:0ab6a29f35bf 5970 return (pYData[0]);
<> 129:0ab6a29f35bf 5971 }
<> 129:0ab6a29f35bf 5972 index = (x >> 20) & 0xfff;
<> 129:0ab6a29f35bf 5973
<> 129:0ab6a29f35bf 5974
<> 129:0ab6a29f35bf 5975 if(index >= (nValues - 1))
<> 129:0ab6a29f35bf 5976 {
<> 129:0ab6a29f35bf 5977 return (pYData[nValues - 1]);
<> 129:0ab6a29f35bf 5978 }
<> 129:0ab6a29f35bf 5979 else
<> 129:0ab6a29f35bf 5980 {
<> 129:0ab6a29f35bf 5981
<> 129:0ab6a29f35bf 5982 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 5983 /* fract is in 12.20 format */
<> 129:0ab6a29f35bf 5984 fract = (x & 0x000FFFFF);
<> 129:0ab6a29f35bf 5985
<> 129:0ab6a29f35bf 5986 /* Read two nearest output values from the index and are in 1.7(q7) format */
<> 129:0ab6a29f35bf 5987 y0 = pYData[index];
<> 129:0ab6a29f35bf 5988 y1 = pYData[index + 1u];
<> 129:0ab6a29f35bf 5989
<> 129:0ab6a29f35bf 5990 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
<> 129:0ab6a29f35bf 5991 y = ((y0 * (0xFFFFF - fract)));
<> 129:0ab6a29f35bf 5992
<> 129:0ab6a29f35bf 5993 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
<> 129:0ab6a29f35bf 5994 y += (y1 * fract);
<> 129:0ab6a29f35bf 5995
<> 129:0ab6a29f35bf 5996 /* convert y to 1.7(q7) format */
<> 129:0ab6a29f35bf 5997 return (y >> 20u);
<> 129:0ab6a29f35bf 5998
<> 129:0ab6a29f35bf 5999 }
<> 129:0ab6a29f35bf 6000
<> 129:0ab6a29f35bf 6001 }
<> 129:0ab6a29f35bf 6002 /**
<> 129:0ab6a29f35bf 6003 * @} end of LinearInterpolate group
<> 129:0ab6a29f35bf 6004 */
<> 129:0ab6a29f35bf 6005
<> 129:0ab6a29f35bf 6006 /**
<> 129:0ab6a29f35bf 6007 * @brief Fast approximation to the trigonometric sine function for floating-point data.
<> 129:0ab6a29f35bf 6008 * @param[in] x input value in radians.
<> 129:0ab6a29f35bf 6009 * @return sin(x).
<> 129:0ab6a29f35bf 6010 */
<> 129:0ab6a29f35bf 6011
<> 129:0ab6a29f35bf 6012 float32_t arm_sin_f32(
<> 129:0ab6a29f35bf 6013 float32_t x);
<> 129:0ab6a29f35bf 6014
<> 129:0ab6a29f35bf 6015 /**
<> 129:0ab6a29f35bf 6016 * @brief Fast approximation to the trigonometric sine function for Q31 data.
<> 129:0ab6a29f35bf 6017 * @param[in] x Scaled input value in radians.
<> 129:0ab6a29f35bf 6018 * @return sin(x).
<> 129:0ab6a29f35bf 6019 */
<> 129:0ab6a29f35bf 6020
<> 129:0ab6a29f35bf 6021 q31_t arm_sin_q31(
<> 129:0ab6a29f35bf 6022 q31_t x);
<> 129:0ab6a29f35bf 6023
<> 129:0ab6a29f35bf 6024 /**
<> 129:0ab6a29f35bf 6025 * @brief Fast approximation to the trigonometric sine function for Q15 data.
<> 129:0ab6a29f35bf 6026 * @param[in] x Scaled input value in radians.
<> 129:0ab6a29f35bf 6027 * @return sin(x).
<> 129:0ab6a29f35bf 6028 */
<> 129:0ab6a29f35bf 6029
<> 129:0ab6a29f35bf 6030 q15_t arm_sin_q15(
<> 129:0ab6a29f35bf 6031 q15_t x);
<> 129:0ab6a29f35bf 6032
<> 129:0ab6a29f35bf 6033 /**
<> 129:0ab6a29f35bf 6034 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
<> 129:0ab6a29f35bf 6035 * @param[in] x input value in radians.
<> 129:0ab6a29f35bf 6036 * @return cos(x).
<> 129:0ab6a29f35bf 6037 */
<> 129:0ab6a29f35bf 6038
<> 129:0ab6a29f35bf 6039 float32_t arm_cos_f32(
<> 129:0ab6a29f35bf 6040 float32_t x);
<> 129:0ab6a29f35bf 6041
<> 129:0ab6a29f35bf 6042 /**
<> 129:0ab6a29f35bf 6043 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
<> 129:0ab6a29f35bf 6044 * @param[in] x Scaled input value in radians.
<> 129:0ab6a29f35bf 6045 * @return cos(x).
<> 129:0ab6a29f35bf 6046 */
<> 129:0ab6a29f35bf 6047
<> 129:0ab6a29f35bf 6048 q31_t arm_cos_q31(
<> 129:0ab6a29f35bf 6049 q31_t x);
<> 129:0ab6a29f35bf 6050
<> 129:0ab6a29f35bf 6051 /**
<> 129:0ab6a29f35bf 6052 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
<> 129:0ab6a29f35bf 6053 * @param[in] x Scaled input value in radians.
<> 129:0ab6a29f35bf 6054 * @return cos(x).
<> 129:0ab6a29f35bf 6055 */
<> 129:0ab6a29f35bf 6056
<> 129:0ab6a29f35bf 6057 q15_t arm_cos_q15(
<> 129:0ab6a29f35bf 6058 q15_t x);
<> 129:0ab6a29f35bf 6059
<> 129:0ab6a29f35bf 6060
<> 129:0ab6a29f35bf 6061 /**
<> 129:0ab6a29f35bf 6062 * @ingroup groupFastMath
<> 129:0ab6a29f35bf 6063 */
<> 129:0ab6a29f35bf 6064
<> 129:0ab6a29f35bf 6065
<> 129:0ab6a29f35bf 6066 /**
<> 129:0ab6a29f35bf 6067 * @defgroup SQRT Square Root
<> 129:0ab6a29f35bf 6068 *
<> 129:0ab6a29f35bf 6069 * Computes the square root of a number.
<> 129:0ab6a29f35bf 6070 * There are separate functions for Q15, Q31, and floating-point data types.
<> 129:0ab6a29f35bf 6071 * The square root function is computed using the Newton-Raphson algorithm.
<> 129:0ab6a29f35bf 6072 * This is an iterative algorithm of the form:
<> 129:0ab6a29f35bf 6073 * <pre>
<> 129:0ab6a29f35bf 6074 * x1 = x0 - f(x0)/f'(x0)
<> 129:0ab6a29f35bf 6075 * </pre>
<> 129:0ab6a29f35bf 6076 * where <code>x1</code> is the current estimate,
<> 129:0ab6a29f35bf 6077 * <code>x0</code> is the previous estimate, and
<> 129:0ab6a29f35bf 6078 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
<> 129:0ab6a29f35bf 6079 * For the square root function, the algorithm reduces to:
<> 129:0ab6a29f35bf 6080 * <pre>
<> 129:0ab6a29f35bf 6081 * x0 = in/2 [initial guess]
<> 129:0ab6a29f35bf 6082 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
<> 129:0ab6a29f35bf 6083 * </pre>
<> 129:0ab6a29f35bf 6084 */
<> 129:0ab6a29f35bf 6085
<> 129:0ab6a29f35bf 6086
<> 129:0ab6a29f35bf 6087 /**
<> 129:0ab6a29f35bf 6088 * @addtogroup SQRT
<> 129:0ab6a29f35bf 6089 * @{
<> 129:0ab6a29f35bf 6090 */
<> 129:0ab6a29f35bf 6091
<> 129:0ab6a29f35bf 6092 /**
<> 129:0ab6a29f35bf 6093 * @brief Floating-point square root function.
<> 129:0ab6a29f35bf 6094 * @param[in] in input value.
<> 129:0ab6a29f35bf 6095 * @param[out] *pOut square root of input value.
<> 129:0ab6a29f35bf 6096 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 129:0ab6a29f35bf 6097 * <code>in</code> is negative value and returns zero output for negative values.
<> 129:0ab6a29f35bf 6098 */
<> 129:0ab6a29f35bf 6099
<> 129:0ab6a29f35bf 6100 static __INLINE arm_status arm_sqrt_f32(
<> 129:0ab6a29f35bf 6101 float32_t in,
<> 129:0ab6a29f35bf 6102 float32_t * pOut)
<> 129:0ab6a29f35bf 6103 {
<> 129:0ab6a29f35bf 6104 if(in >= 0.0f)
<> 129:0ab6a29f35bf 6105 {
<> 129:0ab6a29f35bf 6106
<> 129:0ab6a29f35bf 6107 // #if __FPU_USED
<> 129:0ab6a29f35bf 6108 #if (__FPU_USED == 1) && defined ( __CC_ARM )
<> 129:0ab6a29f35bf 6109 *pOut = __sqrtf(in);
<> 129:0ab6a29f35bf 6110 #else
<> 129:0ab6a29f35bf 6111 *pOut = sqrtf(in);
<> 129:0ab6a29f35bf 6112 #endif
<> 129:0ab6a29f35bf 6113
<> 129:0ab6a29f35bf 6114 return (ARM_MATH_SUCCESS);
<> 129:0ab6a29f35bf 6115 }
<> 129:0ab6a29f35bf 6116 else
<> 129:0ab6a29f35bf 6117 {
<> 129:0ab6a29f35bf 6118 *pOut = 0.0f;
<> 129:0ab6a29f35bf 6119 return (ARM_MATH_ARGUMENT_ERROR);
<> 129:0ab6a29f35bf 6120 }
<> 129:0ab6a29f35bf 6121
<> 129:0ab6a29f35bf 6122 }
<> 129:0ab6a29f35bf 6123
<> 129:0ab6a29f35bf 6124
<> 129:0ab6a29f35bf 6125 /**
<> 129:0ab6a29f35bf 6126 * @brief Q31 square root function.
<> 129:0ab6a29f35bf 6127 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
<> 129:0ab6a29f35bf 6128 * @param[out] *pOut square root of input value.
<> 129:0ab6a29f35bf 6129 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 129:0ab6a29f35bf 6130 * <code>in</code> is negative value and returns zero output for negative values.
<> 129:0ab6a29f35bf 6131 */
<> 129:0ab6a29f35bf 6132 arm_status arm_sqrt_q31(
<> 129:0ab6a29f35bf 6133 q31_t in,
<> 129:0ab6a29f35bf 6134 q31_t * pOut);
<> 129:0ab6a29f35bf 6135
<> 129:0ab6a29f35bf 6136 /**
<> 129:0ab6a29f35bf 6137 * @brief Q15 square root function.
<> 129:0ab6a29f35bf 6138 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
<> 129:0ab6a29f35bf 6139 * @param[out] *pOut square root of input value.
<> 129:0ab6a29f35bf 6140 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 129:0ab6a29f35bf 6141 * <code>in</code> is negative value and returns zero output for negative values.
<> 129:0ab6a29f35bf 6142 */
<> 129:0ab6a29f35bf 6143 arm_status arm_sqrt_q15(
<> 129:0ab6a29f35bf 6144 q15_t in,
<> 129:0ab6a29f35bf 6145 q15_t * pOut);
<> 129:0ab6a29f35bf 6146
<> 129:0ab6a29f35bf 6147 /**
<> 129:0ab6a29f35bf 6148 * @} end of SQRT group
<> 129:0ab6a29f35bf 6149 */
<> 129:0ab6a29f35bf 6150
<> 129:0ab6a29f35bf 6151
<> 129:0ab6a29f35bf 6152
<> 129:0ab6a29f35bf 6153
<> 129:0ab6a29f35bf 6154
<> 129:0ab6a29f35bf 6155
<> 129:0ab6a29f35bf 6156 /**
<> 129:0ab6a29f35bf 6157 * @brief floating-point Circular write function.
<> 129:0ab6a29f35bf 6158 */
<> 129:0ab6a29f35bf 6159
<> 129:0ab6a29f35bf 6160 static __INLINE void arm_circularWrite_f32(
<> 129:0ab6a29f35bf 6161 int32_t * circBuffer,
<> 129:0ab6a29f35bf 6162 int32_t L,
<> 129:0ab6a29f35bf 6163 uint16_t * writeOffset,
<> 129:0ab6a29f35bf 6164 int32_t bufferInc,
<> 129:0ab6a29f35bf 6165 const int32_t * src,
<> 129:0ab6a29f35bf 6166 int32_t srcInc,
<> 129:0ab6a29f35bf 6167 uint32_t blockSize)
<> 129:0ab6a29f35bf 6168 {
<> 129:0ab6a29f35bf 6169 uint32_t i = 0u;
<> 129:0ab6a29f35bf 6170 int32_t wOffset;
<> 129:0ab6a29f35bf 6171
<> 129:0ab6a29f35bf 6172 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6173 * to the current location where the input samples to be copied */
<> 129:0ab6a29f35bf 6174 wOffset = *writeOffset;
<> 129:0ab6a29f35bf 6175
<> 129:0ab6a29f35bf 6176 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6177 i = blockSize;
<> 129:0ab6a29f35bf 6178
<> 129:0ab6a29f35bf 6179 while(i > 0u)
<> 129:0ab6a29f35bf 6180 {
<> 129:0ab6a29f35bf 6181 /* copy the input sample to the circular buffer */
<> 129:0ab6a29f35bf 6182 circBuffer[wOffset] = *src;
<> 129:0ab6a29f35bf 6183
<> 129:0ab6a29f35bf 6184 /* Update the input pointer */
<> 129:0ab6a29f35bf 6185 src += srcInc;
<> 129:0ab6a29f35bf 6186
<> 129:0ab6a29f35bf 6187 /* Circularly update wOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6188 wOffset += bufferInc;
<> 129:0ab6a29f35bf 6189 if(wOffset >= L)
<> 129:0ab6a29f35bf 6190 wOffset -= L;
<> 129:0ab6a29f35bf 6191
<> 129:0ab6a29f35bf 6192 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6193 i--;
<> 129:0ab6a29f35bf 6194 }
<> 129:0ab6a29f35bf 6195
<> 129:0ab6a29f35bf 6196 /* Update the index pointer */
<> 129:0ab6a29f35bf 6197 *writeOffset = wOffset;
<> 129:0ab6a29f35bf 6198 }
<> 129:0ab6a29f35bf 6199
<> 129:0ab6a29f35bf 6200
<> 129:0ab6a29f35bf 6201
<> 129:0ab6a29f35bf 6202 /**
<> 129:0ab6a29f35bf 6203 * @brief floating-point Circular Read function.
<> 129:0ab6a29f35bf 6204 */
<> 129:0ab6a29f35bf 6205 static __INLINE void arm_circularRead_f32(
<> 129:0ab6a29f35bf 6206 int32_t * circBuffer,
<> 129:0ab6a29f35bf 6207 int32_t L,
<> 129:0ab6a29f35bf 6208 int32_t * readOffset,
<> 129:0ab6a29f35bf 6209 int32_t bufferInc,
<> 129:0ab6a29f35bf 6210 int32_t * dst,
<> 129:0ab6a29f35bf 6211 int32_t * dst_base,
<> 129:0ab6a29f35bf 6212 int32_t dst_length,
<> 129:0ab6a29f35bf 6213 int32_t dstInc,
<> 129:0ab6a29f35bf 6214 uint32_t blockSize)
<> 129:0ab6a29f35bf 6215 {
<> 129:0ab6a29f35bf 6216 uint32_t i = 0u;
<> 129:0ab6a29f35bf 6217 int32_t rOffset, dst_end;
<> 129:0ab6a29f35bf 6218
<> 129:0ab6a29f35bf 6219 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6220 * to the current location from where the input samples to be read */
<> 129:0ab6a29f35bf 6221 rOffset = *readOffset;
<> 129:0ab6a29f35bf 6222 dst_end = (int32_t) (dst_base + dst_length);
<> 129:0ab6a29f35bf 6223
<> 129:0ab6a29f35bf 6224 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6225 i = blockSize;
<> 129:0ab6a29f35bf 6226
<> 129:0ab6a29f35bf 6227 while(i > 0u)
<> 129:0ab6a29f35bf 6228 {
<> 129:0ab6a29f35bf 6229 /* copy the sample from the circular buffer to the destination buffer */
<> 129:0ab6a29f35bf 6230 *dst = circBuffer[rOffset];
<> 129:0ab6a29f35bf 6231
<> 129:0ab6a29f35bf 6232 /* Update the input pointer */
<> 129:0ab6a29f35bf 6233 dst += dstInc;
<> 129:0ab6a29f35bf 6234
<> 129:0ab6a29f35bf 6235 if(dst == (int32_t *) dst_end)
<> 129:0ab6a29f35bf 6236 {
<> 129:0ab6a29f35bf 6237 dst = dst_base;
<> 129:0ab6a29f35bf 6238 }
<> 129:0ab6a29f35bf 6239
<> 129:0ab6a29f35bf 6240 /* Circularly update rOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6241 rOffset += bufferInc;
<> 129:0ab6a29f35bf 6242
<> 129:0ab6a29f35bf 6243 if(rOffset >= L)
<> 129:0ab6a29f35bf 6244 {
<> 129:0ab6a29f35bf 6245 rOffset -= L;
<> 129:0ab6a29f35bf 6246 }
<> 129:0ab6a29f35bf 6247
<> 129:0ab6a29f35bf 6248 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6249 i--;
<> 129:0ab6a29f35bf 6250 }
<> 129:0ab6a29f35bf 6251
<> 129:0ab6a29f35bf 6252 /* Update the index pointer */
<> 129:0ab6a29f35bf 6253 *readOffset = rOffset;
<> 129:0ab6a29f35bf 6254 }
<> 129:0ab6a29f35bf 6255
<> 129:0ab6a29f35bf 6256 /**
<> 129:0ab6a29f35bf 6257 * @brief Q15 Circular write function.
<> 129:0ab6a29f35bf 6258 */
<> 129:0ab6a29f35bf 6259
<> 129:0ab6a29f35bf 6260 static __INLINE void arm_circularWrite_q15(
<> 129:0ab6a29f35bf 6261 q15_t * circBuffer,
<> 129:0ab6a29f35bf 6262 int32_t L,
<> 129:0ab6a29f35bf 6263 uint16_t * writeOffset,
<> 129:0ab6a29f35bf 6264 int32_t bufferInc,
<> 129:0ab6a29f35bf 6265 const q15_t * src,
<> 129:0ab6a29f35bf 6266 int32_t srcInc,
<> 129:0ab6a29f35bf 6267 uint32_t blockSize)
<> 129:0ab6a29f35bf 6268 {
<> 129:0ab6a29f35bf 6269 uint32_t i = 0u;
<> 129:0ab6a29f35bf 6270 int32_t wOffset;
<> 129:0ab6a29f35bf 6271
<> 129:0ab6a29f35bf 6272 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6273 * to the current location where the input samples to be copied */
<> 129:0ab6a29f35bf 6274 wOffset = *writeOffset;
<> 129:0ab6a29f35bf 6275
<> 129:0ab6a29f35bf 6276 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6277 i = blockSize;
<> 129:0ab6a29f35bf 6278
<> 129:0ab6a29f35bf 6279 while(i > 0u)
<> 129:0ab6a29f35bf 6280 {
<> 129:0ab6a29f35bf 6281 /* copy the input sample to the circular buffer */
<> 129:0ab6a29f35bf 6282 circBuffer[wOffset] = *src;
<> 129:0ab6a29f35bf 6283
<> 129:0ab6a29f35bf 6284 /* Update the input pointer */
<> 129:0ab6a29f35bf 6285 src += srcInc;
<> 129:0ab6a29f35bf 6286
<> 129:0ab6a29f35bf 6287 /* Circularly update wOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6288 wOffset += bufferInc;
<> 129:0ab6a29f35bf 6289 if(wOffset >= L)
<> 129:0ab6a29f35bf 6290 wOffset -= L;
<> 129:0ab6a29f35bf 6291
<> 129:0ab6a29f35bf 6292 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6293 i--;
<> 129:0ab6a29f35bf 6294 }
<> 129:0ab6a29f35bf 6295
<> 129:0ab6a29f35bf 6296 /* Update the index pointer */
<> 129:0ab6a29f35bf 6297 *writeOffset = wOffset;
<> 129:0ab6a29f35bf 6298 }
<> 129:0ab6a29f35bf 6299
<> 129:0ab6a29f35bf 6300
<> 129:0ab6a29f35bf 6301
<> 129:0ab6a29f35bf 6302 /**
<> 129:0ab6a29f35bf 6303 * @brief Q15 Circular Read function.
<> 129:0ab6a29f35bf 6304 */
<> 129:0ab6a29f35bf 6305 static __INLINE void arm_circularRead_q15(
<> 129:0ab6a29f35bf 6306 q15_t * circBuffer,
<> 129:0ab6a29f35bf 6307 int32_t L,
<> 129:0ab6a29f35bf 6308 int32_t * readOffset,
<> 129:0ab6a29f35bf 6309 int32_t bufferInc,
<> 129:0ab6a29f35bf 6310 q15_t * dst,
<> 129:0ab6a29f35bf 6311 q15_t * dst_base,
<> 129:0ab6a29f35bf 6312 int32_t dst_length,
<> 129:0ab6a29f35bf 6313 int32_t dstInc,
<> 129:0ab6a29f35bf 6314 uint32_t blockSize)
<> 129:0ab6a29f35bf 6315 {
<> 129:0ab6a29f35bf 6316 uint32_t i = 0;
<> 129:0ab6a29f35bf 6317 int32_t rOffset, dst_end;
<> 129:0ab6a29f35bf 6318
<> 129:0ab6a29f35bf 6319 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6320 * to the current location from where the input samples to be read */
<> 129:0ab6a29f35bf 6321 rOffset = *readOffset;
<> 129:0ab6a29f35bf 6322
<> 129:0ab6a29f35bf 6323 dst_end = (int32_t) (dst_base + dst_length);
<> 129:0ab6a29f35bf 6324
<> 129:0ab6a29f35bf 6325 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6326 i = blockSize;
<> 129:0ab6a29f35bf 6327
<> 129:0ab6a29f35bf 6328 while(i > 0u)
<> 129:0ab6a29f35bf 6329 {
<> 129:0ab6a29f35bf 6330 /* copy the sample from the circular buffer to the destination buffer */
<> 129:0ab6a29f35bf 6331 *dst = circBuffer[rOffset];
<> 129:0ab6a29f35bf 6332
<> 129:0ab6a29f35bf 6333 /* Update the input pointer */
<> 129:0ab6a29f35bf 6334 dst += dstInc;
<> 129:0ab6a29f35bf 6335
<> 129:0ab6a29f35bf 6336 if(dst == (q15_t *) dst_end)
<> 129:0ab6a29f35bf 6337 {
<> 129:0ab6a29f35bf 6338 dst = dst_base;
<> 129:0ab6a29f35bf 6339 }
<> 129:0ab6a29f35bf 6340
<> 129:0ab6a29f35bf 6341 /* Circularly update wOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6342 rOffset += bufferInc;
<> 129:0ab6a29f35bf 6343
<> 129:0ab6a29f35bf 6344 if(rOffset >= L)
<> 129:0ab6a29f35bf 6345 {
<> 129:0ab6a29f35bf 6346 rOffset -= L;
<> 129:0ab6a29f35bf 6347 }
<> 129:0ab6a29f35bf 6348
<> 129:0ab6a29f35bf 6349 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6350 i--;
<> 129:0ab6a29f35bf 6351 }
<> 129:0ab6a29f35bf 6352
<> 129:0ab6a29f35bf 6353 /* Update the index pointer */
<> 129:0ab6a29f35bf 6354 *readOffset = rOffset;
<> 129:0ab6a29f35bf 6355 }
<> 129:0ab6a29f35bf 6356
<> 129:0ab6a29f35bf 6357
<> 129:0ab6a29f35bf 6358 /**
<> 129:0ab6a29f35bf 6359 * @brief Q7 Circular write function.
<> 129:0ab6a29f35bf 6360 */
<> 129:0ab6a29f35bf 6361
<> 129:0ab6a29f35bf 6362 static __INLINE void arm_circularWrite_q7(
<> 129:0ab6a29f35bf 6363 q7_t * circBuffer,
<> 129:0ab6a29f35bf 6364 int32_t L,
<> 129:0ab6a29f35bf 6365 uint16_t * writeOffset,
<> 129:0ab6a29f35bf 6366 int32_t bufferInc,
<> 129:0ab6a29f35bf 6367 const q7_t * src,
<> 129:0ab6a29f35bf 6368 int32_t srcInc,
<> 129:0ab6a29f35bf 6369 uint32_t blockSize)
<> 129:0ab6a29f35bf 6370 {
<> 129:0ab6a29f35bf 6371 uint32_t i = 0u;
<> 129:0ab6a29f35bf 6372 int32_t wOffset;
<> 129:0ab6a29f35bf 6373
<> 129:0ab6a29f35bf 6374 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6375 * to the current location where the input samples to be copied */
<> 129:0ab6a29f35bf 6376 wOffset = *writeOffset;
<> 129:0ab6a29f35bf 6377
<> 129:0ab6a29f35bf 6378 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6379 i = blockSize;
<> 129:0ab6a29f35bf 6380
<> 129:0ab6a29f35bf 6381 while(i > 0u)
<> 129:0ab6a29f35bf 6382 {
<> 129:0ab6a29f35bf 6383 /* copy the input sample to the circular buffer */
<> 129:0ab6a29f35bf 6384 circBuffer[wOffset] = *src;
<> 129:0ab6a29f35bf 6385
<> 129:0ab6a29f35bf 6386 /* Update the input pointer */
<> 129:0ab6a29f35bf 6387 src += srcInc;
<> 129:0ab6a29f35bf 6388
<> 129:0ab6a29f35bf 6389 /* Circularly update wOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6390 wOffset += bufferInc;
<> 129:0ab6a29f35bf 6391 if(wOffset >= L)
<> 129:0ab6a29f35bf 6392 wOffset -= L;
<> 129:0ab6a29f35bf 6393
<> 129:0ab6a29f35bf 6394 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6395 i--;
<> 129:0ab6a29f35bf 6396 }
<> 129:0ab6a29f35bf 6397
<> 129:0ab6a29f35bf 6398 /* Update the index pointer */
<> 129:0ab6a29f35bf 6399 *writeOffset = wOffset;
<> 129:0ab6a29f35bf 6400 }
<> 129:0ab6a29f35bf 6401
<> 129:0ab6a29f35bf 6402
<> 129:0ab6a29f35bf 6403
<> 129:0ab6a29f35bf 6404 /**
<> 129:0ab6a29f35bf 6405 * @brief Q7 Circular Read function.
<> 129:0ab6a29f35bf 6406 */
<> 129:0ab6a29f35bf 6407 static __INLINE void arm_circularRead_q7(
<> 129:0ab6a29f35bf 6408 q7_t * circBuffer,
<> 129:0ab6a29f35bf 6409 int32_t L,
<> 129:0ab6a29f35bf 6410 int32_t * readOffset,
<> 129:0ab6a29f35bf 6411 int32_t bufferInc,
<> 129:0ab6a29f35bf 6412 q7_t * dst,
<> 129:0ab6a29f35bf 6413 q7_t * dst_base,
<> 129:0ab6a29f35bf 6414 int32_t dst_length,
<> 129:0ab6a29f35bf 6415 int32_t dstInc,
<> 129:0ab6a29f35bf 6416 uint32_t blockSize)
<> 129:0ab6a29f35bf 6417 {
<> 129:0ab6a29f35bf 6418 uint32_t i = 0;
<> 129:0ab6a29f35bf 6419 int32_t rOffset, dst_end;
<> 129:0ab6a29f35bf 6420
<> 129:0ab6a29f35bf 6421 /* Copy the value of Index pointer that points
<> 129:0ab6a29f35bf 6422 * to the current location from where the input samples to be read */
<> 129:0ab6a29f35bf 6423 rOffset = *readOffset;
<> 129:0ab6a29f35bf 6424
<> 129:0ab6a29f35bf 6425 dst_end = (int32_t) (dst_base + dst_length);
<> 129:0ab6a29f35bf 6426
<> 129:0ab6a29f35bf 6427 /* Loop over the blockSize */
<> 129:0ab6a29f35bf 6428 i = blockSize;
<> 129:0ab6a29f35bf 6429
<> 129:0ab6a29f35bf 6430 while(i > 0u)
<> 129:0ab6a29f35bf 6431 {
<> 129:0ab6a29f35bf 6432 /* copy the sample from the circular buffer to the destination buffer */
<> 129:0ab6a29f35bf 6433 *dst = circBuffer[rOffset];
<> 129:0ab6a29f35bf 6434
<> 129:0ab6a29f35bf 6435 /* Update the input pointer */
<> 129:0ab6a29f35bf 6436 dst += dstInc;
<> 129:0ab6a29f35bf 6437
<> 129:0ab6a29f35bf 6438 if(dst == (q7_t *) dst_end)
<> 129:0ab6a29f35bf 6439 {
<> 129:0ab6a29f35bf 6440 dst = dst_base;
<> 129:0ab6a29f35bf 6441 }
<> 129:0ab6a29f35bf 6442
<> 129:0ab6a29f35bf 6443 /* Circularly update rOffset. Watch out for positive and negative value */
<> 129:0ab6a29f35bf 6444 rOffset += bufferInc;
<> 129:0ab6a29f35bf 6445
<> 129:0ab6a29f35bf 6446 if(rOffset >= L)
<> 129:0ab6a29f35bf 6447 {
<> 129:0ab6a29f35bf 6448 rOffset -= L;
<> 129:0ab6a29f35bf 6449 }
<> 129:0ab6a29f35bf 6450
<> 129:0ab6a29f35bf 6451 /* Decrement the loop counter */
<> 129:0ab6a29f35bf 6452 i--;
<> 129:0ab6a29f35bf 6453 }
<> 129:0ab6a29f35bf 6454
<> 129:0ab6a29f35bf 6455 /* Update the index pointer */
<> 129:0ab6a29f35bf 6456 *readOffset = rOffset;
<> 129:0ab6a29f35bf 6457 }
<> 129:0ab6a29f35bf 6458
<> 129:0ab6a29f35bf 6459
<> 129:0ab6a29f35bf 6460 /**
<> 129:0ab6a29f35bf 6461 * @brief Sum of the squares of the elements of a Q31 vector.
<> 129:0ab6a29f35bf 6462 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6463 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6464 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6465 * @return none.
<> 129:0ab6a29f35bf 6466 */
<> 129:0ab6a29f35bf 6467
<> 129:0ab6a29f35bf 6468 void arm_power_q31(
<> 129:0ab6a29f35bf 6469 q31_t * pSrc,
<> 129:0ab6a29f35bf 6470 uint32_t blockSize,
<> 129:0ab6a29f35bf 6471 q63_t * pResult);
<> 129:0ab6a29f35bf 6472
<> 129:0ab6a29f35bf 6473 /**
<> 129:0ab6a29f35bf 6474 * @brief Sum of the squares of the elements of a floating-point vector.
<> 129:0ab6a29f35bf 6475 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6476 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6477 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6478 * @return none.
<> 129:0ab6a29f35bf 6479 */
<> 129:0ab6a29f35bf 6480
<> 129:0ab6a29f35bf 6481 void arm_power_f32(
<> 129:0ab6a29f35bf 6482 float32_t * pSrc,
<> 129:0ab6a29f35bf 6483 uint32_t blockSize,
<> 129:0ab6a29f35bf 6484 float32_t * pResult);
<> 129:0ab6a29f35bf 6485
<> 129:0ab6a29f35bf 6486 /**
<> 129:0ab6a29f35bf 6487 * @brief Sum of the squares of the elements of a Q15 vector.
<> 129:0ab6a29f35bf 6488 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6489 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6490 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6491 * @return none.
<> 129:0ab6a29f35bf 6492 */
<> 129:0ab6a29f35bf 6493
<> 129:0ab6a29f35bf 6494 void arm_power_q15(
<> 129:0ab6a29f35bf 6495 q15_t * pSrc,
<> 129:0ab6a29f35bf 6496 uint32_t blockSize,
<> 129:0ab6a29f35bf 6497 q63_t * pResult);
<> 129:0ab6a29f35bf 6498
<> 129:0ab6a29f35bf 6499 /**
<> 129:0ab6a29f35bf 6500 * @brief Sum of the squares of the elements of a Q7 vector.
<> 129:0ab6a29f35bf 6501 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6502 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6503 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6504 * @return none.
<> 129:0ab6a29f35bf 6505 */
<> 129:0ab6a29f35bf 6506
<> 129:0ab6a29f35bf 6507 void arm_power_q7(
<> 129:0ab6a29f35bf 6508 q7_t * pSrc,
<> 129:0ab6a29f35bf 6509 uint32_t blockSize,
<> 129:0ab6a29f35bf 6510 q31_t * pResult);
<> 129:0ab6a29f35bf 6511
<> 129:0ab6a29f35bf 6512 /**
<> 129:0ab6a29f35bf 6513 * @brief Mean value of a Q7 vector.
<> 129:0ab6a29f35bf 6514 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6515 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6516 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6517 * @return none.
<> 129:0ab6a29f35bf 6518 */
<> 129:0ab6a29f35bf 6519
<> 129:0ab6a29f35bf 6520 void arm_mean_q7(
<> 129:0ab6a29f35bf 6521 q7_t * pSrc,
<> 129:0ab6a29f35bf 6522 uint32_t blockSize,
<> 129:0ab6a29f35bf 6523 q7_t * pResult);
<> 129:0ab6a29f35bf 6524
<> 129:0ab6a29f35bf 6525 /**
<> 129:0ab6a29f35bf 6526 * @brief Mean value of a Q15 vector.
<> 129:0ab6a29f35bf 6527 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6528 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6529 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6530 * @return none.
<> 129:0ab6a29f35bf 6531 */
<> 129:0ab6a29f35bf 6532 void arm_mean_q15(
<> 129:0ab6a29f35bf 6533 q15_t * pSrc,
<> 129:0ab6a29f35bf 6534 uint32_t blockSize,
<> 129:0ab6a29f35bf 6535 q15_t * pResult);
<> 129:0ab6a29f35bf 6536
<> 129:0ab6a29f35bf 6537 /**
<> 129:0ab6a29f35bf 6538 * @brief Mean value of a Q31 vector.
<> 129:0ab6a29f35bf 6539 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6540 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6541 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6542 * @return none.
<> 129:0ab6a29f35bf 6543 */
<> 129:0ab6a29f35bf 6544 void arm_mean_q31(
<> 129:0ab6a29f35bf 6545 q31_t * pSrc,
<> 129:0ab6a29f35bf 6546 uint32_t blockSize,
<> 129:0ab6a29f35bf 6547 q31_t * pResult);
<> 129:0ab6a29f35bf 6548
<> 129:0ab6a29f35bf 6549 /**
<> 129:0ab6a29f35bf 6550 * @brief Mean value of a floating-point vector.
<> 129:0ab6a29f35bf 6551 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6552 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6553 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6554 * @return none.
<> 129:0ab6a29f35bf 6555 */
<> 129:0ab6a29f35bf 6556 void arm_mean_f32(
<> 129:0ab6a29f35bf 6557 float32_t * pSrc,
<> 129:0ab6a29f35bf 6558 uint32_t blockSize,
<> 129:0ab6a29f35bf 6559 float32_t * pResult);
<> 129:0ab6a29f35bf 6560
<> 129:0ab6a29f35bf 6561 /**
<> 129:0ab6a29f35bf 6562 * @brief Variance of the elements of a floating-point vector.
<> 129:0ab6a29f35bf 6563 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6564 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6565 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6566 * @return none.
<> 129:0ab6a29f35bf 6567 */
<> 129:0ab6a29f35bf 6568
<> 129:0ab6a29f35bf 6569 void arm_var_f32(
<> 129:0ab6a29f35bf 6570 float32_t * pSrc,
<> 129:0ab6a29f35bf 6571 uint32_t blockSize,
<> 129:0ab6a29f35bf 6572 float32_t * pResult);
<> 129:0ab6a29f35bf 6573
<> 129:0ab6a29f35bf 6574 /**
<> 129:0ab6a29f35bf 6575 * @brief Variance of the elements of a Q31 vector.
<> 129:0ab6a29f35bf 6576 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6577 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6578 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6579 * @return none.
<> 129:0ab6a29f35bf 6580 */
<> 129:0ab6a29f35bf 6581
<> 129:0ab6a29f35bf 6582 void arm_var_q31(
<> 129:0ab6a29f35bf 6583 q31_t * pSrc,
<> 129:0ab6a29f35bf 6584 uint32_t blockSize,
<> 129:0ab6a29f35bf 6585 q31_t * pResult);
<> 129:0ab6a29f35bf 6586
<> 129:0ab6a29f35bf 6587 /**
<> 129:0ab6a29f35bf 6588 * @brief Variance of the elements of a Q15 vector.
<> 129:0ab6a29f35bf 6589 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6590 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6591 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6592 * @return none.
<> 129:0ab6a29f35bf 6593 */
<> 129:0ab6a29f35bf 6594
<> 129:0ab6a29f35bf 6595 void arm_var_q15(
<> 129:0ab6a29f35bf 6596 q15_t * pSrc,
<> 129:0ab6a29f35bf 6597 uint32_t blockSize,
<> 129:0ab6a29f35bf 6598 q15_t * pResult);
<> 129:0ab6a29f35bf 6599
<> 129:0ab6a29f35bf 6600 /**
<> 129:0ab6a29f35bf 6601 * @brief Root Mean Square of the elements of a floating-point vector.
<> 129:0ab6a29f35bf 6602 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6603 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6604 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6605 * @return none.
<> 129:0ab6a29f35bf 6606 */
<> 129:0ab6a29f35bf 6607
<> 129:0ab6a29f35bf 6608 void arm_rms_f32(
<> 129:0ab6a29f35bf 6609 float32_t * pSrc,
<> 129:0ab6a29f35bf 6610 uint32_t blockSize,
<> 129:0ab6a29f35bf 6611 float32_t * pResult);
<> 129:0ab6a29f35bf 6612
<> 129:0ab6a29f35bf 6613 /**
<> 129:0ab6a29f35bf 6614 * @brief Root Mean Square of the elements of a Q31 vector.
<> 129:0ab6a29f35bf 6615 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6616 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6617 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6618 * @return none.
<> 129:0ab6a29f35bf 6619 */
<> 129:0ab6a29f35bf 6620
<> 129:0ab6a29f35bf 6621 void arm_rms_q31(
<> 129:0ab6a29f35bf 6622 q31_t * pSrc,
<> 129:0ab6a29f35bf 6623 uint32_t blockSize,
<> 129:0ab6a29f35bf 6624 q31_t * pResult);
<> 129:0ab6a29f35bf 6625
<> 129:0ab6a29f35bf 6626 /**
<> 129:0ab6a29f35bf 6627 * @brief Root Mean Square of the elements of a Q15 vector.
<> 129:0ab6a29f35bf 6628 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6629 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6630 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6631 * @return none.
<> 129:0ab6a29f35bf 6632 */
<> 129:0ab6a29f35bf 6633
<> 129:0ab6a29f35bf 6634 void arm_rms_q15(
<> 129:0ab6a29f35bf 6635 q15_t * pSrc,
<> 129:0ab6a29f35bf 6636 uint32_t blockSize,
<> 129:0ab6a29f35bf 6637 q15_t * pResult);
<> 129:0ab6a29f35bf 6638
<> 129:0ab6a29f35bf 6639 /**
<> 129:0ab6a29f35bf 6640 * @brief Standard deviation of the elements of a floating-point vector.
<> 129:0ab6a29f35bf 6641 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6642 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6643 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6644 * @return none.
<> 129:0ab6a29f35bf 6645 */
<> 129:0ab6a29f35bf 6646
<> 129:0ab6a29f35bf 6647 void arm_std_f32(
<> 129:0ab6a29f35bf 6648 float32_t * pSrc,
<> 129:0ab6a29f35bf 6649 uint32_t blockSize,
<> 129:0ab6a29f35bf 6650 float32_t * pResult);
<> 129:0ab6a29f35bf 6651
<> 129:0ab6a29f35bf 6652 /**
<> 129:0ab6a29f35bf 6653 * @brief Standard deviation of the elements of a Q31 vector.
<> 129:0ab6a29f35bf 6654 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6655 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6656 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6657 * @return none.
<> 129:0ab6a29f35bf 6658 */
<> 129:0ab6a29f35bf 6659
<> 129:0ab6a29f35bf 6660 void arm_std_q31(
<> 129:0ab6a29f35bf 6661 q31_t * pSrc,
<> 129:0ab6a29f35bf 6662 uint32_t blockSize,
<> 129:0ab6a29f35bf 6663 q31_t * pResult);
<> 129:0ab6a29f35bf 6664
<> 129:0ab6a29f35bf 6665 /**
<> 129:0ab6a29f35bf 6666 * @brief Standard deviation of the elements of a Q15 vector.
<> 129:0ab6a29f35bf 6667 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6668 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6669 * @param[out] *pResult is output value.
<> 129:0ab6a29f35bf 6670 * @return none.
<> 129:0ab6a29f35bf 6671 */
<> 129:0ab6a29f35bf 6672
<> 129:0ab6a29f35bf 6673 void arm_std_q15(
<> 129:0ab6a29f35bf 6674 q15_t * pSrc,
<> 129:0ab6a29f35bf 6675 uint32_t blockSize,
<> 129:0ab6a29f35bf 6676 q15_t * pResult);
<> 129:0ab6a29f35bf 6677
<> 129:0ab6a29f35bf 6678 /**
<> 129:0ab6a29f35bf 6679 * @brief Floating-point complex magnitude
<> 129:0ab6a29f35bf 6680 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 6681 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 6682 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 6683 * @return none.
<> 129:0ab6a29f35bf 6684 */
<> 129:0ab6a29f35bf 6685
<> 129:0ab6a29f35bf 6686 void arm_cmplx_mag_f32(
<> 129:0ab6a29f35bf 6687 float32_t * pSrc,
<> 129:0ab6a29f35bf 6688 float32_t * pDst,
<> 129:0ab6a29f35bf 6689 uint32_t numSamples);
<> 129:0ab6a29f35bf 6690
<> 129:0ab6a29f35bf 6691 /**
<> 129:0ab6a29f35bf 6692 * @brief Q31 complex magnitude
<> 129:0ab6a29f35bf 6693 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 6694 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 6695 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 6696 * @return none.
<> 129:0ab6a29f35bf 6697 */
<> 129:0ab6a29f35bf 6698
<> 129:0ab6a29f35bf 6699 void arm_cmplx_mag_q31(
<> 129:0ab6a29f35bf 6700 q31_t * pSrc,
<> 129:0ab6a29f35bf 6701 q31_t * pDst,
<> 129:0ab6a29f35bf 6702 uint32_t numSamples);
<> 129:0ab6a29f35bf 6703
<> 129:0ab6a29f35bf 6704 /**
<> 129:0ab6a29f35bf 6705 * @brief Q15 complex magnitude
<> 129:0ab6a29f35bf 6706 * @param[in] *pSrc points to the complex input vector
<> 129:0ab6a29f35bf 6707 * @param[out] *pDst points to the real output vector
<> 129:0ab6a29f35bf 6708 * @param[in] numSamples number of complex samples in the input vector
<> 129:0ab6a29f35bf 6709 * @return none.
<> 129:0ab6a29f35bf 6710 */
<> 129:0ab6a29f35bf 6711
<> 129:0ab6a29f35bf 6712 void arm_cmplx_mag_q15(
<> 129:0ab6a29f35bf 6713 q15_t * pSrc,
<> 129:0ab6a29f35bf 6714 q15_t * pDst,
<> 129:0ab6a29f35bf 6715 uint32_t numSamples);
<> 129:0ab6a29f35bf 6716
<> 129:0ab6a29f35bf 6717 /**
<> 129:0ab6a29f35bf 6718 * @brief Q15 complex dot product
<> 129:0ab6a29f35bf 6719 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6720 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6721 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6722 * @param[out] *realResult real part of the result returned here
<> 129:0ab6a29f35bf 6723 * @param[out] *imagResult imaginary part of the result returned here
<> 129:0ab6a29f35bf 6724 * @return none.
<> 129:0ab6a29f35bf 6725 */
<> 129:0ab6a29f35bf 6726
<> 129:0ab6a29f35bf 6727 void arm_cmplx_dot_prod_q15(
<> 129:0ab6a29f35bf 6728 q15_t * pSrcA,
<> 129:0ab6a29f35bf 6729 q15_t * pSrcB,
<> 129:0ab6a29f35bf 6730 uint32_t numSamples,
<> 129:0ab6a29f35bf 6731 q31_t * realResult,
<> 129:0ab6a29f35bf 6732 q31_t * imagResult);
<> 129:0ab6a29f35bf 6733
<> 129:0ab6a29f35bf 6734 /**
<> 129:0ab6a29f35bf 6735 * @brief Q31 complex dot product
<> 129:0ab6a29f35bf 6736 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6737 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6738 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6739 * @param[out] *realResult real part of the result returned here
<> 129:0ab6a29f35bf 6740 * @param[out] *imagResult imaginary part of the result returned here
<> 129:0ab6a29f35bf 6741 * @return none.
<> 129:0ab6a29f35bf 6742 */
<> 129:0ab6a29f35bf 6743
<> 129:0ab6a29f35bf 6744 void arm_cmplx_dot_prod_q31(
<> 129:0ab6a29f35bf 6745 q31_t * pSrcA,
<> 129:0ab6a29f35bf 6746 q31_t * pSrcB,
<> 129:0ab6a29f35bf 6747 uint32_t numSamples,
<> 129:0ab6a29f35bf 6748 q63_t * realResult,
<> 129:0ab6a29f35bf 6749 q63_t * imagResult);
<> 129:0ab6a29f35bf 6750
<> 129:0ab6a29f35bf 6751 /**
<> 129:0ab6a29f35bf 6752 * @brief Floating-point complex dot product
<> 129:0ab6a29f35bf 6753 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6754 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6755 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6756 * @param[out] *realResult real part of the result returned here
<> 129:0ab6a29f35bf 6757 * @param[out] *imagResult imaginary part of the result returned here
<> 129:0ab6a29f35bf 6758 * @return none.
<> 129:0ab6a29f35bf 6759 */
<> 129:0ab6a29f35bf 6760
<> 129:0ab6a29f35bf 6761 void arm_cmplx_dot_prod_f32(
<> 129:0ab6a29f35bf 6762 float32_t * pSrcA,
<> 129:0ab6a29f35bf 6763 float32_t * pSrcB,
<> 129:0ab6a29f35bf 6764 uint32_t numSamples,
<> 129:0ab6a29f35bf 6765 float32_t * realResult,
<> 129:0ab6a29f35bf 6766 float32_t * imagResult);
<> 129:0ab6a29f35bf 6767
<> 129:0ab6a29f35bf 6768 /**
<> 129:0ab6a29f35bf 6769 * @brief Q15 complex-by-real multiplication
<> 129:0ab6a29f35bf 6770 * @param[in] *pSrcCmplx points to the complex input vector
<> 129:0ab6a29f35bf 6771 * @param[in] *pSrcReal points to the real input vector
<> 129:0ab6a29f35bf 6772 * @param[out] *pCmplxDst points to the complex output vector
<> 129:0ab6a29f35bf 6773 * @param[in] numSamples number of samples in each vector
<> 129:0ab6a29f35bf 6774 * @return none.
<> 129:0ab6a29f35bf 6775 */
<> 129:0ab6a29f35bf 6776
<> 129:0ab6a29f35bf 6777 void arm_cmplx_mult_real_q15(
<> 129:0ab6a29f35bf 6778 q15_t * pSrcCmplx,
<> 129:0ab6a29f35bf 6779 q15_t * pSrcReal,
<> 129:0ab6a29f35bf 6780 q15_t * pCmplxDst,
<> 129:0ab6a29f35bf 6781 uint32_t numSamples);
<> 129:0ab6a29f35bf 6782
<> 129:0ab6a29f35bf 6783 /**
<> 129:0ab6a29f35bf 6784 * @brief Q31 complex-by-real multiplication
<> 129:0ab6a29f35bf 6785 * @param[in] *pSrcCmplx points to the complex input vector
<> 129:0ab6a29f35bf 6786 * @param[in] *pSrcReal points to the real input vector
<> 129:0ab6a29f35bf 6787 * @param[out] *pCmplxDst points to the complex output vector
<> 129:0ab6a29f35bf 6788 * @param[in] numSamples number of samples in each vector
<> 129:0ab6a29f35bf 6789 * @return none.
<> 129:0ab6a29f35bf 6790 */
<> 129:0ab6a29f35bf 6791
<> 129:0ab6a29f35bf 6792 void arm_cmplx_mult_real_q31(
<> 129:0ab6a29f35bf 6793 q31_t * pSrcCmplx,
<> 129:0ab6a29f35bf 6794 q31_t * pSrcReal,
<> 129:0ab6a29f35bf 6795 q31_t * pCmplxDst,
<> 129:0ab6a29f35bf 6796 uint32_t numSamples);
<> 129:0ab6a29f35bf 6797
<> 129:0ab6a29f35bf 6798 /**
<> 129:0ab6a29f35bf 6799 * @brief Floating-point complex-by-real multiplication
<> 129:0ab6a29f35bf 6800 * @param[in] *pSrcCmplx points to the complex input vector
<> 129:0ab6a29f35bf 6801 * @param[in] *pSrcReal points to the real input vector
<> 129:0ab6a29f35bf 6802 * @param[out] *pCmplxDst points to the complex output vector
<> 129:0ab6a29f35bf 6803 * @param[in] numSamples number of samples in each vector
<> 129:0ab6a29f35bf 6804 * @return none.
<> 129:0ab6a29f35bf 6805 */
<> 129:0ab6a29f35bf 6806
<> 129:0ab6a29f35bf 6807 void arm_cmplx_mult_real_f32(
<> 129:0ab6a29f35bf 6808 float32_t * pSrcCmplx,
<> 129:0ab6a29f35bf 6809 float32_t * pSrcReal,
<> 129:0ab6a29f35bf 6810 float32_t * pCmplxDst,
<> 129:0ab6a29f35bf 6811 uint32_t numSamples);
<> 129:0ab6a29f35bf 6812
<> 129:0ab6a29f35bf 6813 /**
<> 129:0ab6a29f35bf 6814 * @brief Minimum value of a Q7 vector.
<> 129:0ab6a29f35bf 6815 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6816 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6817 * @param[out] *result is output pointer
<> 129:0ab6a29f35bf 6818 * @param[in] index is the array index of the minimum value in the input buffer.
<> 129:0ab6a29f35bf 6819 * @return none.
<> 129:0ab6a29f35bf 6820 */
<> 129:0ab6a29f35bf 6821
<> 129:0ab6a29f35bf 6822 void arm_min_q7(
<> 129:0ab6a29f35bf 6823 q7_t * pSrc,
<> 129:0ab6a29f35bf 6824 uint32_t blockSize,
<> 129:0ab6a29f35bf 6825 q7_t * result,
<> 129:0ab6a29f35bf 6826 uint32_t * index);
<> 129:0ab6a29f35bf 6827
<> 129:0ab6a29f35bf 6828 /**
<> 129:0ab6a29f35bf 6829 * @brief Minimum value of a Q15 vector.
<> 129:0ab6a29f35bf 6830 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6831 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6832 * @param[out] *pResult is output pointer
<> 129:0ab6a29f35bf 6833 * @param[in] *pIndex is the array index of the minimum value in the input buffer.
<> 129:0ab6a29f35bf 6834 * @return none.
<> 129:0ab6a29f35bf 6835 */
<> 129:0ab6a29f35bf 6836
<> 129:0ab6a29f35bf 6837 void arm_min_q15(
<> 129:0ab6a29f35bf 6838 q15_t * pSrc,
<> 129:0ab6a29f35bf 6839 uint32_t blockSize,
<> 129:0ab6a29f35bf 6840 q15_t * pResult,
<> 129:0ab6a29f35bf 6841 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6842
<> 129:0ab6a29f35bf 6843 /**
<> 129:0ab6a29f35bf 6844 * @brief Minimum value of a Q31 vector.
<> 129:0ab6a29f35bf 6845 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6846 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6847 * @param[out] *pResult is output pointer
<> 129:0ab6a29f35bf 6848 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 129:0ab6a29f35bf 6849 * @return none.
<> 129:0ab6a29f35bf 6850 */
<> 129:0ab6a29f35bf 6851 void arm_min_q31(
<> 129:0ab6a29f35bf 6852 q31_t * pSrc,
<> 129:0ab6a29f35bf 6853 uint32_t blockSize,
<> 129:0ab6a29f35bf 6854 q31_t * pResult,
<> 129:0ab6a29f35bf 6855 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6856
<> 129:0ab6a29f35bf 6857 /**
<> 129:0ab6a29f35bf 6858 * @brief Minimum value of a floating-point vector.
<> 129:0ab6a29f35bf 6859 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 6860 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 6861 * @param[out] *pResult is output pointer
<> 129:0ab6a29f35bf 6862 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 129:0ab6a29f35bf 6863 * @return none.
<> 129:0ab6a29f35bf 6864 */
<> 129:0ab6a29f35bf 6865
<> 129:0ab6a29f35bf 6866 void arm_min_f32(
<> 129:0ab6a29f35bf 6867 float32_t * pSrc,
<> 129:0ab6a29f35bf 6868 uint32_t blockSize,
<> 129:0ab6a29f35bf 6869 float32_t * pResult,
<> 129:0ab6a29f35bf 6870 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6871
<> 129:0ab6a29f35bf 6872 /**
<> 129:0ab6a29f35bf 6873 * @brief Maximum value of a Q7 vector.
<> 129:0ab6a29f35bf 6874 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 6875 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6876 * @param[out] *pResult maximum value returned here
<> 129:0ab6a29f35bf 6877 * @param[out] *pIndex index of maximum value returned here
<> 129:0ab6a29f35bf 6878 * @return none.
<> 129:0ab6a29f35bf 6879 */
<> 129:0ab6a29f35bf 6880
<> 129:0ab6a29f35bf 6881 void arm_max_q7(
<> 129:0ab6a29f35bf 6882 q7_t * pSrc,
<> 129:0ab6a29f35bf 6883 uint32_t blockSize,
<> 129:0ab6a29f35bf 6884 q7_t * pResult,
<> 129:0ab6a29f35bf 6885 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6886
<> 129:0ab6a29f35bf 6887 /**
<> 129:0ab6a29f35bf 6888 * @brief Maximum value of a Q15 vector.
<> 129:0ab6a29f35bf 6889 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 6890 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6891 * @param[out] *pResult maximum value returned here
<> 129:0ab6a29f35bf 6892 * @param[out] *pIndex index of maximum value returned here
<> 129:0ab6a29f35bf 6893 * @return none.
<> 129:0ab6a29f35bf 6894 */
<> 129:0ab6a29f35bf 6895
<> 129:0ab6a29f35bf 6896 void arm_max_q15(
<> 129:0ab6a29f35bf 6897 q15_t * pSrc,
<> 129:0ab6a29f35bf 6898 uint32_t blockSize,
<> 129:0ab6a29f35bf 6899 q15_t * pResult,
<> 129:0ab6a29f35bf 6900 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6901
<> 129:0ab6a29f35bf 6902 /**
<> 129:0ab6a29f35bf 6903 * @brief Maximum value of a Q31 vector.
<> 129:0ab6a29f35bf 6904 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 6905 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6906 * @param[out] *pResult maximum value returned here
<> 129:0ab6a29f35bf 6907 * @param[out] *pIndex index of maximum value returned here
<> 129:0ab6a29f35bf 6908 * @return none.
<> 129:0ab6a29f35bf 6909 */
<> 129:0ab6a29f35bf 6910
<> 129:0ab6a29f35bf 6911 void arm_max_q31(
<> 129:0ab6a29f35bf 6912 q31_t * pSrc,
<> 129:0ab6a29f35bf 6913 uint32_t blockSize,
<> 129:0ab6a29f35bf 6914 q31_t * pResult,
<> 129:0ab6a29f35bf 6915 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6916
<> 129:0ab6a29f35bf 6917 /**
<> 129:0ab6a29f35bf 6918 * @brief Maximum value of a floating-point vector.
<> 129:0ab6a29f35bf 6919 * @param[in] *pSrc points to the input buffer
<> 129:0ab6a29f35bf 6920 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6921 * @param[out] *pResult maximum value returned here
<> 129:0ab6a29f35bf 6922 * @param[out] *pIndex index of maximum value returned here
<> 129:0ab6a29f35bf 6923 * @return none.
<> 129:0ab6a29f35bf 6924 */
<> 129:0ab6a29f35bf 6925
<> 129:0ab6a29f35bf 6926 void arm_max_f32(
<> 129:0ab6a29f35bf 6927 float32_t * pSrc,
<> 129:0ab6a29f35bf 6928 uint32_t blockSize,
<> 129:0ab6a29f35bf 6929 float32_t * pResult,
<> 129:0ab6a29f35bf 6930 uint32_t * pIndex);
<> 129:0ab6a29f35bf 6931
<> 129:0ab6a29f35bf 6932 /**
<> 129:0ab6a29f35bf 6933 * @brief Q15 complex-by-complex multiplication
<> 129:0ab6a29f35bf 6934 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6935 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6936 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 6937 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6938 * @return none.
<> 129:0ab6a29f35bf 6939 */
<> 129:0ab6a29f35bf 6940
<> 129:0ab6a29f35bf 6941 void arm_cmplx_mult_cmplx_q15(
<> 129:0ab6a29f35bf 6942 q15_t * pSrcA,
<> 129:0ab6a29f35bf 6943 q15_t * pSrcB,
<> 129:0ab6a29f35bf 6944 q15_t * pDst,
<> 129:0ab6a29f35bf 6945 uint32_t numSamples);
<> 129:0ab6a29f35bf 6946
<> 129:0ab6a29f35bf 6947 /**
<> 129:0ab6a29f35bf 6948 * @brief Q31 complex-by-complex multiplication
<> 129:0ab6a29f35bf 6949 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6950 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6951 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 6952 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6953 * @return none.
<> 129:0ab6a29f35bf 6954 */
<> 129:0ab6a29f35bf 6955
<> 129:0ab6a29f35bf 6956 void arm_cmplx_mult_cmplx_q31(
<> 129:0ab6a29f35bf 6957 q31_t * pSrcA,
<> 129:0ab6a29f35bf 6958 q31_t * pSrcB,
<> 129:0ab6a29f35bf 6959 q31_t * pDst,
<> 129:0ab6a29f35bf 6960 uint32_t numSamples);
<> 129:0ab6a29f35bf 6961
<> 129:0ab6a29f35bf 6962 /**
<> 129:0ab6a29f35bf 6963 * @brief Floating-point complex-by-complex multiplication
<> 129:0ab6a29f35bf 6964 * @param[in] *pSrcA points to the first input vector
<> 129:0ab6a29f35bf 6965 * @param[in] *pSrcB points to the second input vector
<> 129:0ab6a29f35bf 6966 * @param[out] *pDst points to the output vector
<> 129:0ab6a29f35bf 6967 * @param[in] numSamples number of complex samples in each vector
<> 129:0ab6a29f35bf 6968 * @return none.
<> 129:0ab6a29f35bf 6969 */
<> 129:0ab6a29f35bf 6970
<> 129:0ab6a29f35bf 6971 void arm_cmplx_mult_cmplx_f32(
<> 129:0ab6a29f35bf 6972 float32_t * pSrcA,
<> 129:0ab6a29f35bf 6973 float32_t * pSrcB,
<> 129:0ab6a29f35bf 6974 float32_t * pDst,
<> 129:0ab6a29f35bf 6975 uint32_t numSamples);
<> 129:0ab6a29f35bf 6976
<> 129:0ab6a29f35bf 6977 /**
<> 129:0ab6a29f35bf 6978 * @brief Converts the elements of the floating-point vector to Q31 vector.
<> 129:0ab6a29f35bf 6979 * @param[in] *pSrc points to the floating-point input vector
<> 129:0ab6a29f35bf 6980 * @param[out] *pDst points to the Q31 output vector
<> 129:0ab6a29f35bf 6981 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6982 * @return none.
<> 129:0ab6a29f35bf 6983 */
<> 129:0ab6a29f35bf 6984 void arm_float_to_q31(
<> 129:0ab6a29f35bf 6985 float32_t * pSrc,
<> 129:0ab6a29f35bf 6986 q31_t * pDst,
<> 129:0ab6a29f35bf 6987 uint32_t blockSize);
<> 129:0ab6a29f35bf 6988
<> 129:0ab6a29f35bf 6989 /**
<> 129:0ab6a29f35bf 6990 * @brief Converts the elements of the floating-point vector to Q15 vector.
<> 129:0ab6a29f35bf 6991 * @param[in] *pSrc points to the floating-point input vector
<> 129:0ab6a29f35bf 6992 * @param[out] *pDst points to the Q15 output vector
<> 129:0ab6a29f35bf 6993 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 6994 * @return none
<> 129:0ab6a29f35bf 6995 */
<> 129:0ab6a29f35bf 6996 void arm_float_to_q15(
<> 129:0ab6a29f35bf 6997 float32_t * pSrc,
<> 129:0ab6a29f35bf 6998 q15_t * pDst,
<> 129:0ab6a29f35bf 6999 uint32_t blockSize);
<> 129:0ab6a29f35bf 7000
<> 129:0ab6a29f35bf 7001 /**
<> 129:0ab6a29f35bf 7002 * @brief Converts the elements of the floating-point vector to Q7 vector.
<> 129:0ab6a29f35bf 7003 * @param[in] *pSrc points to the floating-point input vector
<> 129:0ab6a29f35bf 7004 * @param[out] *pDst points to the Q7 output vector
<> 129:0ab6a29f35bf 7005 * @param[in] blockSize length of the input vector
<> 129:0ab6a29f35bf 7006 * @return none
<> 129:0ab6a29f35bf 7007 */
<> 129:0ab6a29f35bf 7008 void arm_float_to_q7(
<> 129:0ab6a29f35bf 7009 float32_t * pSrc,
<> 129:0ab6a29f35bf 7010 q7_t * pDst,
<> 129:0ab6a29f35bf 7011 uint32_t blockSize);
<> 129:0ab6a29f35bf 7012
<> 129:0ab6a29f35bf 7013
<> 129:0ab6a29f35bf 7014 /**
<> 129:0ab6a29f35bf 7015 * @brief Converts the elements of the Q31 vector to Q15 vector.
<> 129:0ab6a29f35bf 7016 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 7017 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 7018 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 7019 * @return none.
<> 129:0ab6a29f35bf 7020 */
<> 129:0ab6a29f35bf 7021 void arm_q31_to_q15(
<> 129:0ab6a29f35bf 7022 q31_t * pSrc,
<> 129:0ab6a29f35bf 7023 q15_t * pDst,
<> 129:0ab6a29f35bf 7024 uint32_t blockSize);
<> 129:0ab6a29f35bf 7025
<> 129:0ab6a29f35bf 7026 /**
<> 129:0ab6a29f35bf 7027 * @brief Converts the elements of the Q31 vector to Q7 vector.
<> 129:0ab6a29f35bf 7028 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 7029 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 7030 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 7031 * @return none.
<> 129:0ab6a29f35bf 7032 */
<> 129:0ab6a29f35bf 7033 void arm_q31_to_q7(
<> 129:0ab6a29f35bf 7034 q31_t * pSrc,
<> 129:0ab6a29f35bf 7035 q7_t * pDst,
<> 129:0ab6a29f35bf 7036 uint32_t blockSize);
<> 129:0ab6a29f35bf 7037
<> 129:0ab6a29f35bf 7038 /**
<> 129:0ab6a29f35bf 7039 * @brief Converts the elements of the Q15 vector to floating-point vector.
<> 129:0ab6a29f35bf 7040 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 7041 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 7042 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 7043 * @return none.
<> 129:0ab6a29f35bf 7044 */
<> 129:0ab6a29f35bf 7045 void arm_q15_to_float(
<> 129:0ab6a29f35bf 7046 q15_t * pSrc,
<> 129:0ab6a29f35bf 7047 float32_t * pDst,
<> 129:0ab6a29f35bf 7048 uint32_t blockSize);
<> 129:0ab6a29f35bf 7049
<> 129:0ab6a29f35bf 7050
<> 129:0ab6a29f35bf 7051 /**
<> 129:0ab6a29f35bf 7052 * @brief Converts the elements of the Q15 vector to Q31 vector.
<> 129:0ab6a29f35bf 7053 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 7054 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 7055 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 7056 * @return none.
<> 129:0ab6a29f35bf 7057 */
<> 129:0ab6a29f35bf 7058 void arm_q15_to_q31(
<> 129:0ab6a29f35bf 7059 q15_t * pSrc,
<> 129:0ab6a29f35bf 7060 q31_t * pDst,
<> 129:0ab6a29f35bf 7061 uint32_t blockSize);
<> 129:0ab6a29f35bf 7062
<> 129:0ab6a29f35bf 7063
<> 129:0ab6a29f35bf 7064 /**
<> 129:0ab6a29f35bf 7065 * @brief Converts the elements of the Q15 vector to Q7 vector.
<> 129:0ab6a29f35bf 7066 * @param[in] *pSrc is input pointer
<> 129:0ab6a29f35bf 7067 * @param[out] *pDst is output pointer
<> 129:0ab6a29f35bf 7068 * @param[in] blockSize is the number of samples to process
<> 129:0ab6a29f35bf 7069 * @return none.
<> 129:0ab6a29f35bf 7070 */
<> 129:0ab6a29f35bf 7071 void arm_q15_to_q7(
<> 129:0ab6a29f35bf 7072 q15_t * pSrc,
<> 129:0ab6a29f35bf 7073 q7_t * pDst,
<> 129:0ab6a29f35bf 7074 uint32_t blockSize);
<> 129:0ab6a29f35bf 7075
<> 129:0ab6a29f35bf 7076
<> 129:0ab6a29f35bf 7077 /**
<> 129:0ab6a29f35bf 7078 * @ingroup groupInterpolation
<> 129:0ab6a29f35bf 7079 */
<> 129:0ab6a29f35bf 7080
<> 129:0ab6a29f35bf 7081 /**
<> 129:0ab6a29f35bf 7082 * @defgroup BilinearInterpolate Bilinear Interpolation
<> 129:0ab6a29f35bf 7083 *
<> 129:0ab6a29f35bf 7084 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
<> 129:0ab6a29f35bf 7085 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
<> 129:0ab6a29f35bf 7086 * determines values between the grid points.
<> 129:0ab6a29f35bf 7087 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
<> 129:0ab6a29f35bf 7088 * Bilinear interpolation is often used in image processing to rescale images.
<> 129:0ab6a29f35bf 7089 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
<> 129:0ab6a29f35bf 7090 *
<> 129:0ab6a29f35bf 7091 * <b>Algorithm</b>
<> 129:0ab6a29f35bf 7092 * \par
<> 129:0ab6a29f35bf 7093 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
<> 129:0ab6a29f35bf 7094 * For floating-point, the instance structure is defined as:
<> 129:0ab6a29f35bf 7095 * <pre>
<> 129:0ab6a29f35bf 7096 * typedef struct
<> 129:0ab6a29f35bf 7097 * {
<> 129:0ab6a29f35bf 7098 * uint16_t numRows;
<> 129:0ab6a29f35bf 7099 * uint16_t numCols;
<> 129:0ab6a29f35bf 7100 * float32_t *pData;
<> 129:0ab6a29f35bf 7101 * } arm_bilinear_interp_instance_f32;
<> 129:0ab6a29f35bf 7102 * </pre>
<> 129:0ab6a29f35bf 7103 *
<> 129:0ab6a29f35bf 7104 * \par
<> 129:0ab6a29f35bf 7105 * where <code>numRows</code> specifies the number of rows in the table;
<> 129:0ab6a29f35bf 7106 * <code>numCols</code> specifies the number of columns in the table;
<> 129:0ab6a29f35bf 7107 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
<> 129:0ab6a29f35bf 7108 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
<> 129:0ab6a29f35bf 7109 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
<> 129:0ab6a29f35bf 7110 *
<> 129:0ab6a29f35bf 7111 * \par
<> 129:0ab6a29f35bf 7112 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
<> 129:0ab6a29f35bf 7113 * <pre>
<> 129:0ab6a29f35bf 7114 * XF = floor(x)
<> 129:0ab6a29f35bf 7115 * YF = floor(y)
<> 129:0ab6a29f35bf 7116 * </pre>
<> 129:0ab6a29f35bf 7117 * \par
<> 129:0ab6a29f35bf 7118 * The interpolated output point is computed as:
<> 129:0ab6a29f35bf 7119 * <pre>
<> 129:0ab6a29f35bf 7120 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
<> 129:0ab6a29f35bf 7121 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
<> 129:0ab6a29f35bf 7122 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
<> 129:0ab6a29f35bf 7123 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
<> 129:0ab6a29f35bf 7124 * </pre>
<> 129:0ab6a29f35bf 7125 * Note that the coordinates (x, y) contain integer and fractional components.
<> 129:0ab6a29f35bf 7126 * The integer components specify which portion of the table to use while the
<> 129:0ab6a29f35bf 7127 * fractional components control the interpolation processor.
<> 129:0ab6a29f35bf 7128 *
<> 129:0ab6a29f35bf 7129 * \par
<> 129:0ab6a29f35bf 7130 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
<> 129:0ab6a29f35bf 7131 */
<> 129:0ab6a29f35bf 7132
<> 129:0ab6a29f35bf 7133 /**
<> 129:0ab6a29f35bf 7134 * @addtogroup BilinearInterpolate
<> 129:0ab6a29f35bf 7135 * @{
<> 129:0ab6a29f35bf 7136 */
<> 129:0ab6a29f35bf 7137
<> 129:0ab6a29f35bf 7138 /**
<> 129:0ab6a29f35bf 7139 *
<> 129:0ab6a29f35bf 7140 * @brief Floating-point bilinear interpolation.
<> 129:0ab6a29f35bf 7141 * @param[in,out] *S points to an instance of the interpolation structure.
<> 129:0ab6a29f35bf 7142 * @param[in] X interpolation coordinate.
<> 129:0ab6a29f35bf 7143 * @param[in] Y interpolation coordinate.
<> 129:0ab6a29f35bf 7144 * @return out interpolated value.
<> 129:0ab6a29f35bf 7145 */
<> 129:0ab6a29f35bf 7146
<> 129:0ab6a29f35bf 7147
<> 129:0ab6a29f35bf 7148 static __INLINE float32_t arm_bilinear_interp_f32(
<> 129:0ab6a29f35bf 7149 const arm_bilinear_interp_instance_f32 * S,
<> 129:0ab6a29f35bf 7150 float32_t X,
<> 129:0ab6a29f35bf 7151 float32_t Y)
<> 129:0ab6a29f35bf 7152 {
<> 129:0ab6a29f35bf 7153 float32_t out;
<> 129:0ab6a29f35bf 7154 float32_t f00, f01, f10, f11;
<> 129:0ab6a29f35bf 7155 float32_t *pData = S->pData;
<> 129:0ab6a29f35bf 7156 int32_t xIndex, yIndex, index;
<> 129:0ab6a29f35bf 7157 float32_t xdiff, ydiff;
<> 129:0ab6a29f35bf 7158 float32_t b1, b2, b3, b4;
<> 129:0ab6a29f35bf 7159
<> 129:0ab6a29f35bf 7160 xIndex = (int32_t) X;
<> 129:0ab6a29f35bf 7161 yIndex = (int32_t) Y;
<> 129:0ab6a29f35bf 7162
<> 129:0ab6a29f35bf 7163 /* Care taken for table outside boundary */
<> 129:0ab6a29f35bf 7164 /* Returns zero output when values are outside table boundary */
<> 129:0ab6a29f35bf 7165 if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0
<> 129:0ab6a29f35bf 7166 || yIndex > (S->numCols - 1))
<> 129:0ab6a29f35bf 7167 {
<> 129:0ab6a29f35bf 7168 return (0);
<> 129:0ab6a29f35bf 7169 }
<> 129:0ab6a29f35bf 7170
<> 129:0ab6a29f35bf 7171 /* Calculation of index for two nearest points in X-direction */
<> 129:0ab6a29f35bf 7172 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
<> 129:0ab6a29f35bf 7173
<> 129:0ab6a29f35bf 7174
<> 129:0ab6a29f35bf 7175 /* Read two nearest points in X-direction */
<> 129:0ab6a29f35bf 7176 f00 = pData[index];
<> 129:0ab6a29f35bf 7177 f01 = pData[index + 1];
<> 129:0ab6a29f35bf 7178
<> 129:0ab6a29f35bf 7179 /* Calculation of index for two nearest points in Y-direction */
<> 129:0ab6a29f35bf 7180 index = (xIndex - 1) + (yIndex) * S->numCols;
<> 129:0ab6a29f35bf 7181
<> 129:0ab6a29f35bf 7182
<> 129:0ab6a29f35bf 7183 /* Read two nearest points in Y-direction */
<> 129:0ab6a29f35bf 7184 f10 = pData[index];
<> 129:0ab6a29f35bf 7185 f11 = pData[index + 1];
<> 129:0ab6a29f35bf 7186
<> 129:0ab6a29f35bf 7187 /* Calculation of intermediate values */
<> 129:0ab6a29f35bf 7188 b1 = f00;
<> 129:0ab6a29f35bf 7189 b2 = f01 - f00;
<> 129:0ab6a29f35bf 7190 b3 = f10 - f00;
<> 129:0ab6a29f35bf 7191 b4 = f00 - f01 - f10 + f11;
<> 129:0ab6a29f35bf 7192
<> 129:0ab6a29f35bf 7193 /* Calculation of fractional part in X */
<> 129:0ab6a29f35bf 7194 xdiff = X - xIndex;
<> 129:0ab6a29f35bf 7195
<> 129:0ab6a29f35bf 7196 /* Calculation of fractional part in Y */
<> 129:0ab6a29f35bf 7197 ydiff = Y - yIndex;
<> 129:0ab6a29f35bf 7198
<> 129:0ab6a29f35bf 7199 /* Calculation of bi-linear interpolated output */
<> 129:0ab6a29f35bf 7200 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
<> 129:0ab6a29f35bf 7201
<> 129:0ab6a29f35bf 7202 /* return to application */
<> 129:0ab6a29f35bf 7203 return (out);
<> 129:0ab6a29f35bf 7204
<> 129:0ab6a29f35bf 7205 }
<> 129:0ab6a29f35bf 7206
<> 129:0ab6a29f35bf 7207 /**
<> 129:0ab6a29f35bf 7208 *
<> 129:0ab6a29f35bf 7209 * @brief Q31 bilinear interpolation.
<> 129:0ab6a29f35bf 7210 * @param[in,out] *S points to an instance of the interpolation structure.
<> 129:0ab6a29f35bf 7211 * @param[in] X interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7212 * @param[in] Y interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7213 * @return out interpolated value.
<> 129:0ab6a29f35bf 7214 */
<> 129:0ab6a29f35bf 7215
<> 129:0ab6a29f35bf 7216 static __INLINE q31_t arm_bilinear_interp_q31(
<> 129:0ab6a29f35bf 7217 arm_bilinear_interp_instance_q31 * S,
<> 129:0ab6a29f35bf 7218 q31_t X,
<> 129:0ab6a29f35bf 7219 q31_t Y)
<> 129:0ab6a29f35bf 7220 {
<> 129:0ab6a29f35bf 7221 q31_t out; /* Temporary output */
<> 129:0ab6a29f35bf 7222 q31_t acc = 0; /* output */
<> 129:0ab6a29f35bf 7223 q31_t xfract, yfract; /* X, Y fractional parts */
<> 129:0ab6a29f35bf 7224 q31_t x1, x2, y1, y2; /* Nearest output values */
<> 129:0ab6a29f35bf 7225 int32_t rI, cI; /* Row and column indices */
<> 129:0ab6a29f35bf 7226 q31_t *pYData = S->pData; /* pointer to output table values */
<> 129:0ab6a29f35bf 7227 uint32_t nCols = S->numCols; /* num of rows */
<> 129:0ab6a29f35bf 7228
<> 129:0ab6a29f35bf 7229
<> 129:0ab6a29f35bf 7230 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7231 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7232 /* Index value calculation */
<> 129:0ab6a29f35bf 7233 rI = ((X & 0xFFF00000) >> 20u);
<> 129:0ab6a29f35bf 7234
<> 129:0ab6a29f35bf 7235 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7236 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7237 /* Index value calculation */
<> 129:0ab6a29f35bf 7238 cI = ((Y & 0xFFF00000) >> 20u);
<> 129:0ab6a29f35bf 7239
<> 129:0ab6a29f35bf 7240 /* Care taken for table outside boundary */
<> 129:0ab6a29f35bf 7241 /* Returns zero output when values are outside table boundary */
<> 129:0ab6a29f35bf 7242 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 129:0ab6a29f35bf 7243 {
<> 129:0ab6a29f35bf 7244 return (0);
<> 129:0ab6a29f35bf 7245 }
<> 129:0ab6a29f35bf 7246
<> 129:0ab6a29f35bf 7247 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7248 /* shift left xfract by 11 to keep 1.31 format */
<> 129:0ab6a29f35bf 7249 xfract = (X & 0x000FFFFF) << 11u;
<> 129:0ab6a29f35bf 7250
<> 129:0ab6a29f35bf 7251 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7252 x1 = pYData[(rI) + nCols * (cI)];
<> 129:0ab6a29f35bf 7253 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 129:0ab6a29f35bf 7254
<> 129:0ab6a29f35bf 7255 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7256 /* shift left yfract by 11 to keep 1.31 format */
<> 129:0ab6a29f35bf 7257 yfract = (Y & 0x000FFFFF) << 11u;
<> 129:0ab6a29f35bf 7258
<> 129:0ab6a29f35bf 7259 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7260 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 129:0ab6a29f35bf 7261 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 129:0ab6a29f35bf 7262
<> 129:0ab6a29f35bf 7263 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
<> 129:0ab6a29f35bf 7264 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
<> 129:0ab6a29f35bf 7265 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
<> 129:0ab6a29f35bf 7266
<> 129:0ab6a29f35bf 7267 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
<> 129:0ab6a29f35bf 7268 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
<> 129:0ab6a29f35bf 7269 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
<> 129:0ab6a29f35bf 7270
<> 129:0ab6a29f35bf 7271 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 129:0ab6a29f35bf 7272 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
<> 129:0ab6a29f35bf 7273 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 129:0ab6a29f35bf 7274
<> 129:0ab6a29f35bf 7275 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 129:0ab6a29f35bf 7276 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
<> 129:0ab6a29f35bf 7277 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 129:0ab6a29f35bf 7278
<> 129:0ab6a29f35bf 7279 /* Convert acc to 1.31(q31) format */
<> 129:0ab6a29f35bf 7280 return (acc << 2u);
<> 129:0ab6a29f35bf 7281
<> 129:0ab6a29f35bf 7282 }
<> 129:0ab6a29f35bf 7283
<> 129:0ab6a29f35bf 7284 /**
<> 129:0ab6a29f35bf 7285 * @brief Q15 bilinear interpolation.
<> 129:0ab6a29f35bf 7286 * @param[in,out] *S points to an instance of the interpolation structure.
<> 129:0ab6a29f35bf 7287 * @param[in] X interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7288 * @param[in] Y interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7289 * @return out interpolated value.
<> 129:0ab6a29f35bf 7290 */
<> 129:0ab6a29f35bf 7291
<> 129:0ab6a29f35bf 7292 static __INLINE q15_t arm_bilinear_interp_q15(
<> 129:0ab6a29f35bf 7293 arm_bilinear_interp_instance_q15 * S,
<> 129:0ab6a29f35bf 7294 q31_t X,
<> 129:0ab6a29f35bf 7295 q31_t Y)
<> 129:0ab6a29f35bf 7296 {
<> 129:0ab6a29f35bf 7297 q63_t acc = 0; /* output */
<> 129:0ab6a29f35bf 7298 q31_t out; /* Temporary output */
<> 129:0ab6a29f35bf 7299 q15_t x1, x2, y1, y2; /* Nearest output values */
<> 129:0ab6a29f35bf 7300 q31_t xfract, yfract; /* X, Y fractional parts */
<> 129:0ab6a29f35bf 7301 int32_t rI, cI; /* Row and column indices */
<> 129:0ab6a29f35bf 7302 q15_t *pYData = S->pData; /* pointer to output table values */
<> 129:0ab6a29f35bf 7303 uint32_t nCols = S->numCols; /* num of rows */
<> 129:0ab6a29f35bf 7304
<> 129:0ab6a29f35bf 7305 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7306 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7307 /* Index value calculation */
<> 129:0ab6a29f35bf 7308 rI = ((X & 0xFFF00000) >> 20);
<> 129:0ab6a29f35bf 7309
<> 129:0ab6a29f35bf 7310 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7311 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7312 /* Index value calculation */
<> 129:0ab6a29f35bf 7313 cI = ((Y & 0xFFF00000) >> 20);
<> 129:0ab6a29f35bf 7314
<> 129:0ab6a29f35bf 7315 /* Care taken for table outside boundary */
<> 129:0ab6a29f35bf 7316 /* Returns zero output when values are outside table boundary */
<> 129:0ab6a29f35bf 7317 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 129:0ab6a29f35bf 7318 {
<> 129:0ab6a29f35bf 7319 return (0);
<> 129:0ab6a29f35bf 7320 }
<> 129:0ab6a29f35bf 7321
<> 129:0ab6a29f35bf 7322 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7323 /* xfract should be in 12.20 format */
<> 129:0ab6a29f35bf 7324 xfract = (X & 0x000FFFFF);
<> 129:0ab6a29f35bf 7325
<> 129:0ab6a29f35bf 7326 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7327 x1 = pYData[(rI) + nCols * (cI)];
<> 129:0ab6a29f35bf 7328 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 129:0ab6a29f35bf 7329
<> 129:0ab6a29f35bf 7330
<> 129:0ab6a29f35bf 7331 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7332 /* yfract should be in 12.20 format */
<> 129:0ab6a29f35bf 7333 yfract = (Y & 0x000FFFFF);
<> 129:0ab6a29f35bf 7334
<> 129:0ab6a29f35bf 7335 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7336 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 129:0ab6a29f35bf 7337 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 129:0ab6a29f35bf 7338
<> 129:0ab6a29f35bf 7339 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
<> 129:0ab6a29f35bf 7340
<> 129:0ab6a29f35bf 7341 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
<> 129:0ab6a29f35bf 7342 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
<> 129:0ab6a29f35bf 7343 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
<> 129:0ab6a29f35bf 7344 acc = ((q63_t) out * (0xFFFFF - yfract));
<> 129:0ab6a29f35bf 7345
<> 129:0ab6a29f35bf 7346 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
<> 129:0ab6a29f35bf 7347 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
<> 129:0ab6a29f35bf 7348 acc += ((q63_t) out * (xfract));
<> 129:0ab6a29f35bf 7349
<> 129:0ab6a29f35bf 7350 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
<> 129:0ab6a29f35bf 7351 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
<> 129:0ab6a29f35bf 7352 acc += ((q63_t) out * (yfract));
<> 129:0ab6a29f35bf 7353
<> 129:0ab6a29f35bf 7354 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
<> 129:0ab6a29f35bf 7355 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
<> 129:0ab6a29f35bf 7356 acc += ((q63_t) out * (yfract));
<> 129:0ab6a29f35bf 7357
<> 129:0ab6a29f35bf 7358 /* acc is in 13.51 format and down shift acc by 36 times */
<> 129:0ab6a29f35bf 7359 /* Convert out to 1.15 format */
<> 129:0ab6a29f35bf 7360 return (acc >> 36);
<> 129:0ab6a29f35bf 7361
<> 129:0ab6a29f35bf 7362 }
<> 129:0ab6a29f35bf 7363
<> 129:0ab6a29f35bf 7364 /**
<> 129:0ab6a29f35bf 7365 * @brief Q7 bilinear interpolation.
<> 129:0ab6a29f35bf 7366 * @param[in,out] *S points to an instance of the interpolation structure.
<> 129:0ab6a29f35bf 7367 * @param[in] X interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7368 * @param[in] Y interpolation coordinate in 12.20 format.
<> 129:0ab6a29f35bf 7369 * @return out interpolated value.
<> 129:0ab6a29f35bf 7370 */
<> 129:0ab6a29f35bf 7371
<> 129:0ab6a29f35bf 7372 static __INLINE q7_t arm_bilinear_interp_q7(
<> 129:0ab6a29f35bf 7373 arm_bilinear_interp_instance_q7 * S,
<> 129:0ab6a29f35bf 7374 q31_t X,
<> 129:0ab6a29f35bf 7375 q31_t Y)
<> 129:0ab6a29f35bf 7376 {
<> 129:0ab6a29f35bf 7377 q63_t acc = 0; /* output */
<> 129:0ab6a29f35bf 7378 q31_t out; /* Temporary output */
<> 129:0ab6a29f35bf 7379 q31_t xfract, yfract; /* X, Y fractional parts */
<> 129:0ab6a29f35bf 7380 q7_t x1, x2, y1, y2; /* Nearest output values */
<> 129:0ab6a29f35bf 7381 int32_t rI, cI; /* Row and column indices */
<> 129:0ab6a29f35bf 7382 q7_t *pYData = S->pData; /* pointer to output table values */
<> 129:0ab6a29f35bf 7383 uint32_t nCols = S->numCols; /* num of rows */
<> 129:0ab6a29f35bf 7384
<> 129:0ab6a29f35bf 7385 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7386 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7387 /* Index value calculation */
<> 129:0ab6a29f35bf 7388 rI = ((X & 0xFFF00000) >> 20);
<> 129:0ab6a29f35bf 7389
<> 129:0ab6a29f35bf 7390 /* Input is in 12.20 format */
<> 129:0ab6a29f35bf 7391 /* 12 bits for the table index */
<> 129:0ab6a29f35bf 7392 /* Index value calculation */
<> 129:0ab6a29f35bf 7393 cI = ((Y & 0xFFF00000) >> 20);
<> 129:0ab6a29f35bf 7394
<> 129:0ab6a29f35bf 7395 /* Care taken for table outside boundary */
<> 129:0ab6a29f35bf 7396 /* Returns zero output when values are outside table boundary */
<> 129:0ab6a29f35bf 7397 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 129:0ab6a29f35bf 7398 {
<> 129:0ab6a29f35bf 7399 return (0);
<> 129:0ab6a29f35bf 7400 }
<> 129:0ab6a29f35bf 7401
<> 129:0ab6a29f35bf 7402 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7403 /* xfract should be in 12.20 format */
<> 129:0ab6a29f35bf 7404 xfract = (X & 0x000FFFFF);
<> 129:0ab6a29f35bf 7405
<> 129:0ab6a29f35bf 7406 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7407 x1 = pYData[(rI) + nCols * (cI)];
<> 129:0ab6a29f35bf 7408 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 129:0ab6a29f35bf 7409
<> 129:0ab6a29f35bf 7410
<> 129:0ab6a29f35bf 7411 /* 20 bits for the fractional part */
<> 129:0ab6a29f35bf 7412 /* yfract should be in 12.20 format */
<> 129:0ab6a29f35bf 7413 yfract = (Y & 0x000FFFFF);
<> 129:0ab6a29f35bf 7414
<> 129:0ab6a29f35bf 7415 /* Read two nearest output values from the index */
<> 129:0ab6a29f35bf 7416 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 129:0ab6a29f35bf 7417 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 129:0ab6a29f35bf 7418
<> 129:0ab6a29f35bf 7419 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
<> 129:0ab6a29f35bf 7420 out = ((x1 * (0xFFFFF - xfract)));
<> 129:0ab6a29f35bf 7421 acc = (((q63_t) out * (0xFFFFF - yfract)));
<> 129:0ab6a29f35bf 7422
<> 129:0ab6a29f35bf 7423 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
<> 129:0ab6a29f35bf 7424 out = ((x2 * (0xFFFFF - yfract)));
<> 129:0ab6a29f35bf 7425 acc += (((q63_t) out * (xfract)));
<> 129:0ab6a29f35bf 7426
<> 129:0ab6a29f35bf 7427 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
<> 129:0ab6a29f35bf 7428 out = ((y1 * (0xFFFFF - xfract)));
<> 129:0ab6a29f35bf 7429 acc += (((q63_t) out * (yfract)));
<> 129:0ab6a29f35bf 7430
<> 129:0ab6a29f35bf 7431 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
<> 129:0ab6a29f35bf 7432 out = ((y2 * (yfract)));
<> 129:0ab6a29f35bf 7433 acc += (((q63_t) out * (xfract)));
<> 129:0ab6a29f35bf 7434
<> 129:0ab6a29f35bf 7435 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
<> 129:0ab6a29f35bf 7436 return (acc >> 40);
<> 129:0ab6a29f35bf 7437
<> 129:0ab6a29f35bf 7438 }
<> 129:0ab6a29f35bf 7439
<> 129:0ab6a29f35bf 7440 /**
<> 129:0ab6a29f35bf 7441 * @} end of BilinearInterpolate group
<> 129:0ab6a29f35bf 7442 */
<> 129:0ab6a29f35bf 7443
<> 129:0ab6a29f35bf 7444
<> 129:0ab6a29f35bf 7445 //SMMLAR
<> 129:0ab6a29f35bf 7446 #define multAcc_32x32_keep32_R(a, x, y) \
<> 129:0ab6a29f35bf 7447 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 129:0ab6a29f35bf 7448
<> 129:0ab6a29f35bf 7449 //SMMLSR
<> 129:0ab6a29f35bf 7450 #define multSub_32x32_keep32_R(a, x, y) \
<> 129:0ab6a29f35bf 7451 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 129:0ab6a29f35bf 7452
<> 129:0ab6a29f35bf 7453 //SMMULR
<> 129:0ab6a29f35bf 7454 #define mult_32x32_keep32_R(a, x, y) \
<> 129:0ab6a29f35bf 7455 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
<> 129:0ab6a29f35bf 7456
<> 129:0ab6a29f35bf 7457 //SMMLA
<> 129:0ab6a29f35bf 7458 #define multAcc_32x32_keep32(a, x, y) \
<> 129:0ab6a29f35bf 7459 a += (q31_t) (((q63_t) x * y) >> 32)
<> 129:0ab6a29f35bf 7460
<> 129:0ab6a29f35bf 7461 //SMMLS
<> 129:0ab6a29f35bf 7462 #define multSub_32x32_keep32(a, x, y) \
<> 129:0ab6a29f35bf 7463 a -= (q31_t) (((q63_t) x * y) >> 32)
<> 129:0ab6a29f35bf 7464
<> 129:0ab6a29f35bf 7465 //SMMUL
<> 129:0ab6a29f35bf 7466 #define mult_32x32_keep32(a, x, y) \
<> 129:0ab6a29f35bf 7467 a = (q31_t) (((q63_t) x * y ) >> 32)
<> 129:0ab6a29f35bf 7468
<> 129:0ab6a29f35bf 7469
<> 129:0ab6a29f35bf 7470 #if defined ( __CC_ARM ) //Keil
<> 129:0ab6a29f35bf 7471
<> 129:0ab6a29f35bf 7472 //Enter low optimization region - place directly above function definition
<> 129:0ab6a29f35bf 7473 #ifdef ARM_MATH_CM4
<> 129:0ab6a29f35bf 7474 #define LOW_OPTIMIZATION_ENTER \
<> 129:0ab6a29f35bf 7475 _Pragma ("push") \
<> 129:0ab6a29f35bf 7476 _Pragma ("O1")
<> 129:0ab6a29f35bf 7477 #else
<> 129:0ab6a29f35bf 7478 #define LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7479 #endif
<> 129:0ab6a29f35bf 7480
<> 129:0ab6a29f35bf 7481 //Exit low optimization region - place directly after end of function definition
<> 129:0ab6a29f35bf 7482 #ifdef ARM_MATH_CM4
<> 129:0ab6a29f35bf 7483 #define LOW_OPTIMIZATION_EXIT \
<> 129:0ab6a29f35bf 7484 _Pragma ("pop")
<> 129:0ab6a29f35bf 7485 #else
<> 129:0ab6a29f35bf 7486 #define LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7487 #endif
<> 129:0ab6a29f35bf 7488
<> 129:0ab6a29f35bf 7489 //Enter low optimization region - place directly above function definition
<> 129:0ab6a29f35bf 7490 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7491
<> 129:0ab6a29f35bf 7492 //Exit low optimization region - place directly after end of function definition
<> 129:0ab6a29f35bf 7493 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7494
<> 129:0ab6a29f35bf 7495 #elif defined(__ICCARM__) //IAR
<> 129:0ab6a29f35bf 7496
<> 129:0ab6a29f35bf 7497 //Enter low optimization region - place directly above function definition
<> 129:0ab6a29f35bf 7498 #ifdef ARM_MATH_CM4
<> 129:0ab6a29f35bf 7499 #define LOW_OPTIMIZATION_ENTER \
<> 129:0ab6a29f35bf 7500 _Pragma ("optimize=low")
<> 129:0ab6a29f35bf 7501 #else
<> 129:0ab6a29f35bf 7502 #define LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7503 #endif
<> 129:0ab6a29f35bf 7504
<> 129:0ab6a29f35bf 7505 //Exit low optimization region - place directly after end of function definition
<> 129:0ab6a29f35bf 7506 #define LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7507
<> 129:0ab6a29f35bf 7508 //Enter low optimization region - place directly above function definition
<> 129:0ab6a29f35bf 7509 #ifdef ARM_MATH_CM4
<> 129:0ab6a29f35bf 7510 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
<> 129:0ab6a29f35bf 7511 _Pragma ("optimize=low")
<> 129:0ab6a29f35bf 7512 #else
<> 129:0ab6a29f35bf 7513 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7514 #endif
<> 129:0ab6a29f35bf 7515
<> 129:0ab6a29f35bf 7516 //Exit low optimization region - place directly after end of function definition
<> 129:0ab6a29f35bf 7517 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7518
<> 129:0ab6a29f35bf 7519 #elif defined(__GNUC__)
<> 129:0ab6a29f35bf 7520
<> 129:0ab6a29f35bf 7521 #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
<> 129:0ab6a29f35bf 7522
<> 129:0ab6a29f35bf 7523 #define LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7524
<> 129:0ab6a29f35bf 7525 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7526
<> 129:0ab6a29f35bf 7527 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7528
<> 129:0ab6a29f35bf 7529 #elif defined(__CSMC__) // Cosmic
<> 129:0ab6a29f35bf 7530
<> 129:0ab6a29f35bf 7531 #define LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7532 #define LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7533 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7534 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7535
<> 129:0ab6a29f35bf 7536 #elif defined(__TASKING__) // TASKING
<> 129:0ab6a29f35bf 7537
<> 129:0ab6a29f35bf 7538 #define LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7539 #define LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7540 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 129:0ab6a29f35bf 7541 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 129:0ab6a29f35bf 7542
<> 129:0ab6a29f35bf 7543 #endif
<> 129:0ab6a29f35bf 7544
<> 129:0ab6a29f35bf 7545
<> 129:0ab6a29f35bf 7546 #ifdef __cplusplus
<> 129:0ab6a29f35bf 7547 }
<> 129:0ab6a29f35bf 7548 #endif
<> 129:0ab6a29f35bf 7549
<> 129:0ab6a29f35bf 7550
<> 129:0ab6a29f35bf 7551 #endif /* _ARM_MATH_H */
<> 129:0ab6a29f35bf 7552
<> 129:0ab6a29f35bf 7553 /**
<> 129:0ab6a29f35bf 7554 *
<> 129:0ab6a29f35bf 7555 * End of file.
<> 129:0ab6a29f35bf 7556 */