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:
Tue Mar 14 16:20:51 2017 +0000
Revision:
138:093f2bd7b9eb
Parent:
135:176b8275d35d
Child:
145:64910690c574
Release 138 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files https://github.com/ARMmbed/mbed-os/pull/3716
3741: STM32 remove warning in hal_tick_32b.c file https://github.com/ARMmbed/mbed-os/pull/3741
3780: STM32L4 : Fix GPIO G port compatibility https://github.com/ARMmbed/mbed-os/pull/3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) https://github.com/ARMmbed/mbed-os/pull/3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os https://github.com/ARMmbed/mbed-os/pull/3836
3840: STM32: gpio SPEED - always set High Speed by default https://github.com/ARMmbed/mbed-os/pull/3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) https://github.com/ARMmbed/mbed-os/pull/3844
3850: STM32: change spi error to debug warning https://github.com/ARMmbed/mbed-os/pull/3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform https://github.com/ARMmbed/mbed-os/pull/3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated https://github.com/ARMmbed/mbed-os/pull/3880
3795: Fix pwm period calc https://github.com/ARMmbed/mbed-os/pull/3795
3828: STM32 CAN API: correct format and type https://github.com/ARMmbed/mbed-os/pull/3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization https://github.com/ARMmbed/mbed-os/pull/3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) https://github.com/ARMmbed/mbed-os/pull/3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. https://github.com/ARMmbed/mbed-os/pull/3879
3902: Fix heap and stack size for NUCLEO_F746ZG https://github.com/ARMmbed/mbed-os/pull/3902
3829: can_write(): return error code when no tx mailboxes are available https://github.com/ARMmbed/mbed-os/pull/3829

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 135:176b8275d35d 1 /* ----------------------------------------------------------------------
<> 135:176b8275d35d 2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 135:176b8275d35d 3 *
<> 135:176b8275d35d 4 * $Date: 19. March 2015
<> 135:176b8275d35d 5 * $Revision: V.1.4.5
<> 135:176b8275d35d 6 *
<> 135:176b8275d35d 7 * Project: CMSIS DSP Library
<> 135:176b8275d35d 8 * Title: arm_math.h
<> 135:176b8275d35d 9 *
<> 135:176b8275d35d 10 * Description: Public header file for CMSIS DSP Library
<> 135:176b8275d35d 11 *
<> 135:176b8275d35d 12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
<> 135:176b8275d35d 13 *
<> 135:176b8275d35d 14 * Redistribution and use in source and binary forms, with or without
<> 135:176b8275d35d 15 * modification, are permitted provided that the following conditions
<> 135:176b8275d35d 16 * are met:
<> 135:176b8275d35d 17 * - Redistributions of source code must retain the above copyright
<> 135:176b8275d35d 18 * notice, this list of conditions and the following disclaimer.
<> 135:176b8275d35d 19 * - Redistributions in binary form must reproduce the above copyright
<> 135:176b8275d35d 20 * notice, this list of conditions and the following disclaimer in
<> 135:176b8275d35d 21 * the documentation and/or other materials provided with the
<> 135:176b8275d35d 22 * distribution.
<> 135:176b8275d35d 23 * - Neither the name of ARM LIMITED nor the names of its contributors
<> 135:176b8275d35d 24 * may be used to endorse or promote products derived from this
<> 135:176b8275d35d 25 * software without specific prior written permission.
<> 135:176b8275d35d 26 *
<> 135:176b8275d35d 27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<> 135:176b8275d35d 28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<> 135:176b8275d35d 29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
<> 135:176b8275d35d 30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
<> 135:176b8275d35d 31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
<> 135:176b8275d35d 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
<> 135:176b8275d35d 33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 135:176b8275d35d 34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 135:176b8275d35d 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
<> 135:176b8275d35d 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
<> 135:176b8275d35d 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
<> 135:176b8275d35d 38 * POSSIBILITY OF SUCH DAMAGE.
<> 135:176b8275d35d 39 * -------------------------------------------------------------------- */
<> 135:176b8275d35d 40
<> 135:176b8275d35d 41 /**
<> 135:176b8275d35d 42 \mainpage CMSIS DSP Software Library
<> 135:176b8275d35d 43 *
<> 135:176b8275d35d 44 * Introduction
<> 135:176b8275d35d 45 * ------------
<> 135:176b8275d35d 46 *
<> 135:176b8275d35d 47 * This user manual describes the CMSIS DSP software library,
<> 135:176b8275d35d 48 * a suite of common signal processing functions for use on Cortex-M processor based devices.
<> 135:176b8275d35d 49 *
<> 135:176b8275d35d 50 * The library is divided into a number of functions each covering a specific category:
<> 135:176b8275d35d 51 * - Basic math functions
<> 135:176b8275d35d 52 * - Fast math functions
<> 135:176b8275d35d 53 * - Complex math functions
<> 135:176b8275d35d 54 * - Filters
<> 135:176b8275d35d 55 * - Matrix functions
<> 135:176b8275d35d 56 * - Transforms
<> 135:176b8275d35d 57 * - Motor control functions
<> 135:176b8275d35d 58 * - Statistical functions
<> 135:176b8275d35d 59 * - Support functions
<> 135:176b8275d35d 60 * - Interpolation functions
<> 135:176b8275d35d 61 *
<> 135:176b8275d35d 62 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
<> 135:176b8275d35d 63 * 32-bit integer and 32-bit floating-point values.
<> 135:176b8275d35d 64 *
<> 135:176b8275d35d 65 * Using the Library
<> 135:176b8275d35d 66 * ------------
<> 135:176b8275d35d 67 *
<> 135:176b8275d35d 68 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
<> 135:176b8275d35d 69 * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7)
<> 135:176b8275d35d 70 * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7)
<> 135:176b8275d35d 71 * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7)
<> 135:176b8275d35d 72 * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7)
<> 135:176b8275d35d 73 * - arm_cortexM7l_math.lib (Little endian on Cortex-M7)
<> 135:176b8275d35d 74 * - arm_cortexM7b_math.lib (Big endian on Cortex-M7)
<> 135:176b8275d35d 75 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
<> 135:176b8275d35d 76 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
<> 135:176b8275d35d 77 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
<> 135:176b8275d35d 78 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
<> 135:176b8275d35d 79 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
<> 135:176b8275d35d 80 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
<> 135:176b8275d35d 81 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+)
<> 135:176b8275d35d 82 * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+)
<> 135:176b8275d35d 83 *
<> 135:176b8275d35d 84 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
<> 135:176b8275d35d 85 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 87 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
<> 135:176b8275d35d 88 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
<> 135:176b8275d35d 89 *
<> 135:176b8275d35d 90 * Examples
<> 135:176b8275d35d 91 * --------
<> 135:176b8275d35d 92 *
<> 135:176b8275d35d 93 * The library ships with a number of examples which demonstrate how to use the library functions.
<> 135:176b8275d35d 94 *
<> 135:176b8275d35d 95 * Toolchain Support
<> 135:176b8275d35d 96 * ------------
<> 135:176b8275d35d 97 *
<> 135:176b8275d35d 98 * The library has been developed and tested with MDK-ARM version 5.14.0.0
<> 135:176b8275d35d 99 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
<> 135:176b8275d35d 100 *
<> 135:176b8275d35d 101 * Building the Library
<> 135:176b8275d35d 102 * ------------
<> 135:176b8275d35d 103 *
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 105 * - arm_cortexM_math.uvprojx
<> 135:176b8275d35d 106 *
<> 135:176b8275d35d 107 *
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 109 *
<> 135:176b8275d35d 110 * Pre-processor Macros
<> 135:176b8275d35d 111 * ------------
<> 135:176b8275d35d 112 *
<> 135:176b8275d35d 113 * Each library project have differant pre-processor macros.
<> 135:176b8275d35d 114 *
<> 135:176b8275d35d 115 * - UNALIGNED_SUPPORT_DISABLE:
<> 135:176b8275d35d 116 *
<> 135:176b8275d35d 117 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
<> 135:176b8275d35d 118 *
<> 135:176b8275d35d 119 * - ARM_MATH_BIG_ENDIAN:
<> 135:176b8275d35d 120 *
<> 135:176b8275d35d 121 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
<> 135:176b8275d35d 122 *
<> 135:176b8275d35d 123 * - ARM_MATH_MATRIX_CHECK:
<> 135:176b8275d35d 124 *
<> 135:176b8275d35d 125 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
<> 135:176b8275d35d 126 *
<> 135:176b8275d35d 127 * - ARM_MATH_ROUNDING:
<> 135:176b8275d35d 128 *
<> 135:176b8275d35d 129 * Define macro ARM_MATH_ROUNDING for rounding on support functions
<> 135:176b8275d35d 130 *
<> 135:176b8275d35d 131 * - ARM_MATH_CMx:
<> 135:176b8275d35d 132 *
<> 135:176b8275d35d 133 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
<> 135:176b8275d35d 134 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
<> 135:176b8275d35d 135 * ARM_MATH_CM7 for building the library on cortex-M7.
<> 135:176b8275d35d 136 *
<> 135:176b8275d35d 137 * - __FPU_PRESENT:
<> 135:176b8275d35d 138 *
<> 135:176b8275d35d 139 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
<> 135:176b8275d35d 140 *
<> 135:176b8275d35d 141 * <hr>
<> 135:176b8275d35d 142 * CMSIS-DSP in ARM::CMSIS Pack
<> 135:176b8275d35d 143 * -----------------------------
<> 135:176b8275d35d 144 *
<> 135:176b8275d35d 145 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
<> 135:176b8275d35d 146 * |File/Folder |Content |
<> 135:176b8275d35d 147 * |------------------------------|------------------------------------------------------------------------|
<> 135:176b8275d35d 148 * |\b CMSIS\\Documentation\\DSP | This documentation |
<> 135:176b8275d35d 149 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
<> 135:176b8275d35d 150 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
<> 135:176b8275d35d 151 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
<> 135:176b8275d35d 152 *
<> 135:176b8275d35d 153 * <hr>
<> 135:176b8275d35d 154 * Revision History of CMSIS-DSP
<> 135:176b8275d35d 155 * ------------
<> 135:176b8275d35d 156 * Please refer to \ref ChangeLog_pg.
<> 135:176b8275d35d 157 *
<> 135:176b8275d35d 158 * Copyright Notice
<> 135:176b8275d35d 159 * ------------
<> 135:176b8275d35d 160 *
<> 135:176b8275d35d 161 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 135:176b8275d35d 162 */
<> 135:176b8275d35d 163
<> 135:176b8275d35d 164
<> 135:176b8275d35d 165 /**
<> 135:176b8275d35d 166 * @defgroup groupMath Basic Math Functions
<> 135:176b8275d35d 167 */
<> 135:176b8275d35d 168
<> 135:176b8275d35d 169 /**
<> 135:176b8275d35d 170 * @defgroup groupFastMath Fast Math Functions
<> 135:176b8275d35d 171 * This set of functions provides a fast approximation to sine, cosine, and square root.
<> 135:176b8275d35d 172 * As compared to most of the other functions in the CMSIS math library, the fast math functions
<> 135:176b8275d35d 173 * operate on individual values and not arrays.
<> 135:176b8275d35d 174 * There are separate functions for Q15, Q31, and floating-point data.
<> 135:176b8275d35d 175 *
<> 135:176b8275d35d 176 */
<> 135:176b8275d35d 177
<> 135:176b8275d35d 178 /**
<> 135:176b8275d35d 179 * @defgroup groupCmplxMath Complex Math Functions
<> 135:176b8275d35d 180 * This set of functions operates on complex data vectors.
<> 135:176b8275d35d 181 * The data in the complex arrays is stored in an interleaved fashion
<> 135:176b8275d35d 182 * (real, imag, real, imag, ...).
<> 135:176b8275d35d 183 * In the API functions, the number of samples in a complex array refers
<> 135:176b8275d35d 184 * to the number of complex values; the array contains twice this number of
<> 135:176b8275d35d 185 * real values.
<> 135:176b8275d35d 186 */
<> 135:176b8275d35d 187
<> 135:176b8275d35d 188 /**
<> 135:176b8275d35d 189 * @defgroup groupFilters Filtering Functions
<> 135:176b8275d35d 190 */
<> 135:176b8275d35d 191
<> 135:176b8275d35d 192 /**
<> 135:176b8275d35d 193 * @defgroup groupMatrix Matrix Functions
<> 135:176b8275d35d 194 *
<> 135:176b8275d35d 195 * This set of functions provides basic matrix math operations.
<> 135:176b8275d35d 196 * The functions operate on matrix data structures. For example,
<> 135:176b8275d35d 197 * the type
<> 135:176b8275d35d 198 * definition for the floating-point matrix structure is shown
<> 135:176b8275d35d 199 * below:
<> 135:176b8275d35d 200 * <pre>
<> 135:176b8275d35d 201 * typedef struct
<> 135:176b8275d35d 202 * {
<> 135:176b8275d35d 203 * uint16_t numRows; // number of rows of the matrix.
<> 135:176b8275d35d 204 * uint16_t numCols; // number of columns of the matrix.
<> 135:176b8275d35d 205 * float32_t *pData; // points to the data of the matrix.
<> 135:176b8275d35d 206 * } arm_matrix_instance_f32;
<> 135:176b8275d35d 207 * </pre>
<> 135:176b8275d35d 208 * There are similar definitions for Q15 and Q31 data types.
<> 135:176b8275d35d 209 *
<> 135:176b8275d35d 210 * The structure specifies the size of the matrix and then points to
<> 135:176b8275d35d 211 * an array of data. The array is of size <code>numRows X numCols</code>
<> 135:176b8275d35d 212 * and the values are arranged in row order. That is, the
<> 135:176b8275d35d 213 * matrix element (i, j) is stored at:
<> 135:176b8275d35d 214 * <pre>
<> 135:176b8275d35d 215 * pData[i*numCols + j]
<> 135:176b8275d35d 216 * </pre>
<> 135:176b8275d35d 217 *
<> 135:176b8275d35d 218 * \par Init Functions
<> 135:176b8275d35d 219 * There is an associated initialization function for each type of matrix
<> 135:176b8275d35d 220 * data structure.
<> 135:176b8275d35d 221 * The initialization function sets the values of the internal structure fields.
<> 135:176b8275d35d 222 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
<> 135:176b8275d35d 223 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
<> 135:176b8275d35d 224 *
<> 135:176b8275d35d 225 * \par
<> 135:176b8275d35d 226 * Use of the initialization function is optional. However, if initialization function is used
<> 135:176b8275d35d 227 * then the instance structure cannot be placed into a const data section.
<> 135:176b8275d35d 228 * To place the instance structure in a const data
<> 135:176b8275d35d 229 * section, manually initialize the data structure. For example:
<> 135:176b8275d35d 230 * <pre>
<> 135:176b8275d35d 231 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
<> 135:176b8275d35d 232 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
<> 135:176b8275d35d 233 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
<> 135:176b8275d35d 234 * </pre>
<> 135:176b8275d35d 235 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
<> 135:176b8275d35d 236 * specifies the number of columns, and <code>pData</code> points to the
<> 135:176b8275d35d 237 * data array.
<> 135:176b8275d35d 238 *
<> 135:176b8275d35d 239 * \par Size Checking
<> 135:176b8275d35d 240 * By default all of the matrix functions perform size checking on the input and
<> 135:176b8275d35d 241 * output matrices. For example, the matrix addition function verifies that the
<> 135:176b8275d35d 242 * two input matrices and the output matrix all have the same number of rows and
<> 135:176b8275d35d 243 * columns. If the size check fails the functions return:
<> 135:176b8275d35d 244 * <pre>
<> 135:176b8275d35d 245 * ARM_MATH_SIZE_MISMATCH
<> 135:176b8275d35d 246 * </pre>
<> 135:176b8275d35d 247 * Otherwise the functions return
<> 135:176b8275d35d 248 * <pre>
<> 135:176b8275d35d 249 * ARM_MATH_SUCCESS
<> 135:176b8275d35d 250 * </pre>
<> 135:176b8275d35d 251 * There is some overhead associated with this matrix size checking.
<> 135:176b8275d35d 252 * The matrix size checking is enabled via the \#define
<> 135:176b8275d35d 253 * <pre>
<> 135:176b8275d35d 254 * ARM_MATH_MATRIX_CHECK
<> 135:176b8275d35d 255 * </pre>
<> 135:176b8275d35d 256 * within the library project settings. By default this macro is defined
<> 135:176b8275d35d 257 * and size checking is enabled. By changing the project settings and
<> 135:176b8275d35d 258 * undefining this macro size checking is eliminated and the functions
<> 135:176b8275d35d 259 * run a bit faster. With size checking disabled the functions always
<> 135:176b8275d35d 260 * return <code>ARM_MATH_SUCCESS</code>.
<> 135:176b8275d35d 261 */
<> 135:176b8275d35d 262
<> 135:176b8275d35d 263 /**
<> 135:176b8275d35d 264 * @defgroup groupTransforms Transform Functions
<> 135:176b8275d35d 265 */
<> 135:176b8275d35d 266
<> 135:176b8275d35d 267 /**
<> 135:176b8275d35d 268 * @defgroup groupController Controller Functions
<> 135:176b8275d35d 269 */
<> 135:176b8275d35d 270
<> 135:176b8275d35d 271 /**
<> 135:176b8275d35d 272 * @defgroup groupStats Statistics Functions
<> 135:176b8275d35d 273 */
<> 135:176b8275d35d 274 /**
<> 135:176b8275d35d 275 * @defgroup groupSupport Support Functions
<> 135:176b8275d35d 276 */
<> 135:176b8275d35d 277
<> 135:176b8275d35d 278 /**
<> 135:176b8275d35d 279 * @defgroup groupInterpolation Interpolation Functions
<> 135:176b8275d35d 280 * These functions perform 1- and 2-dimensional interpolation of data.
<> 135:176b8275d35d 281 * Linear interpolation is used for 1-dimensional data and
<> 135:176b8275d35d 282 * bilinear interpolation is used for 2-dimensional data.
<> 135:176b8275d35d 283 */
<> 135:176b8275d35d 284
<> 135:176b8275d35d 285 /**
<> 135:176b8275d35d 286 * @defgroup groupExamples Examples
<> 135:176b8275d35d 287 */
<> 135:176b8275d35d 288 #ifndef _ARM_MATH_H
<> 135:176b8275d35d 289 #define _ARM_MATH_H
<> 135:176b8275d35d 290
<> 135:176b8275d35d 291 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
<> 135:176b8275d35d 292
<> 135:176b8275d35d 293 #if defined(ARM_MATH_CM7)
<> 135:176b8275d35d 294 #include "core_cm7.h"
<> 135:176b8275d35d 295 #elif defined (ARM_MATH_CM4)
<> 135:176b8275d35d 296 #include "core_cm4.h"
<> 135:176b8275d35d 297 #elif defined (ARM_MATH_CM3)
<> 135:176b8275d35d 298 #include "core_cm3.h"
<> 135:176b8275d35d 299 #elif defined (ARM_MATH_CM0)
<> 135:176b8275d35d 300 #include "core_cm0.h"
<> 135:176b8275d35d 301 #define ARM_MATH_CM0_FAMILY
<> 135:176b8275d35d 302 #elif defined (ARM_MATH_CM0PLUS)
<> 135:176b8275d35d 303 #include "core_cm0plus.h"
<> 135:176b8275d35d 304 #define ARM_MATH_CM0_FAMILY
<> 135:176b8275d35d 305 #else
<> 135:176b8275d35d 306 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
<> 135:176b8275d35d 307 #endif
<> 135:176b8275d35d 308
<> 135:176b8275d35d 309 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
<> 135:176b8275d35d 310 #include "string.h"
<> 135:176b8275d35d 311 #include "math.h"
<> 135:176b8275d35d 312 #ifdef __cplusplus
<> 135:176b8275d35d 313 extern "C"
<> 135:176b8275d35d 314 {
<> 135:176b8275d35d 315 #endif
<> 135:176b8275d35d 316
<> 135:176b8275d35d 317
<> 135:176b8275d35d 318 /**
<> 135:176b8275d35d 319 * @brief Macros required for reciprocal calculation in Normalized LMS
<> 135:176b8275d35d 320 */
<> 135:176b8275d35d 321
<> 135:176b8275d35d 322 #define DELTA_Q31 (0x100)
<> 135:176b8275d35d 323 #define DELTA_Q15 0x5
<> 135:176b8275d35d 324 #define INDEX_MASK 0x0000003F
<> 135:176b8275d35d 325 #ifndef PI
<> 135:176b8275d35d 326 #define PI 3.14159265358979f
<> 135:176b8275d35d 327 #endif
<> 135:176b8275d35d 328
<> 135:176b8275d35d 329 /**
<> 135:176b8275d35d 330 * @brief Macros required for SINE and COSINE Fast math approximations
<> 135:176b8275d35d 331 */
<> 135:176b8275d35d 332
<> 135:176b8275d35d 333 #define FAST_MATH_TABLE_SIZE 512
<> 135:176b8275d35d 334 #define FAST_MATH_Q31_SHIFT (32 - 10)
<> 135:176b8275d35d 335 #define FAST_MATH_Q15_SHIFT (16 - 10)
<> 135:176b8275d35d 336 #define CONTROLLER_Q31_SHIFT (32 - 9)
<> 135:176b8275d35d 337 #define TABLE_SIZE 256
<> 135:176b8275d35d 338 #define TABLE_SPACING_Q31 0x400000
<> 135:176b8275d35d 339 #define TABLE_SPACING_Q15 0x80
<> 135:176b8275d35d 340
<> 135:176b8275d35d 341 /**
<> 135:176b8275d35d 342 * @brief Macros required for SINE and COSINE Controller functions
<> 135:176b8275d35d 343 */
<> 135:176b8275d35d 344 /* 1.31(q31) Fixed value of 2/360 */
<> 135:176b8275d35d 345 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
<> 135:176b8275d35d 346 #define INPUT_SPACING 0xB60B61
<> 135:176b8275d35d 347
<> 135:176b8275d35d 348 /**
<> 135:176b8275d35d 349 * @brief Macro for Unaligned Support
<> 135:176b8275d35d 350 */
<> 135:176b8275d35d 351 #ifndef UNALIGNED_SUPPORT_DISABLE
<> 135:176b8275d35d 352 #define ALIGN4
<> 135:176b8275d35d 353 #else
<> 135:176b8275d35d 354 #if defined (__GNUC__)
<> 135:176b8275d35d 355 #define ALIGN4 __attribute__((aligned(4)))
<> 135:176b8275d35d 356 #else
<> 135:176b8275d35d 357 #define ALIGN4 __align(4)
<> 135:176b8275d35d 358 #endif
<> 135:176b8275d35d 359 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
<> 135:176b8275d35d 360
<> 135:176b8275d35d 361 /**
<> 135:176b8275d35d 362 * @brief Error status returned by some functions in the library.
<> 135:176b8275d35d 363 */
<> 135:176b8275d35d 364
<> 135:176b8275d35d 365 typedef enum
<> 135:176b8275d35d 366 {
<> 135:176b8275d35d 367 ARM_MATH_SUCCESS = 0, /**< No error */
<> 135:176b8275d35d 368 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
<> 135:176b8275d35d 369 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
<> 135:176b8275d35d 370 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
<> 135:176b8275d35d 371 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
<> 135:176b8275d35d 372 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
<> 135:176b8275d35d 373 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
<> 135:176b8275d35d 374 } arm_status;
<> 135:176b8275d35d 375
<> 135:176b8275d35d 376 /**
<> 135:176b8275d35d 377 * @brief 8-bit fractional data type in 1.7 format.
<> 135:176b8275d35d 378 */
<> 135:176b8275d35d 379 typedef int8_t q7_t;
<> 135:176b8275d35d 380
<> 135:176b8275d35d 381 /**
<> 135:176b8275d35d 382 * @brief 16-bit fractional data type in 1.15 format.
<> 135:176b8275d35d 383 */
<> 135:176b8275d35d 384 typedef int16_t q15_t;
<> 135:176b8275d35d 385
<> 135:176b8275d35d 386 /**
<> 135:176b8275d35d 387 * @brief 32-bit fractional data type in 1.31 format.
<> 135:176b8275d35d 388 */
<> 135:176b8275d35d 389 typedef int32_t q31_t;
<> 135:176b8275d35d 390
<> 135:176b8275d35d 391 /**
<> 135:176b8275d35d 392 * @brief 64-bit fractional data type in 1.63 format.
<> 135:176b8275d35d 393 */
<> 135:176b8275d35d 394 typedef int64_t q63_t;
<> 135:176b8275d35d 395
<> 135:176b8275d35d 396 /**
<> 135:176b8275d35d 397 * @brief 32-bit floating-point type definition.
<> 135:176b8275d35d 398 */
<> 135:176b8275d35d 399 typedef float float32_t;
<> 135:176b8275d35d 400
<> 135:176b8275d35d 401 /**
<> 135:176b8275d35d 402 * @brief 64-bit floating-point type definition.
<> 135:176b8275d35d 403 */
<> 135:176b8275d35d 404 typedef double float64_t;
<> 135:176b8275d35d 405
<> 135:176b8275d35d 406 /**
<> 135:176b8275d35d 407 * @brief definition to read/write two 16 bit values.
<> 135:176b8275d35d 408 */
<> 135:176b8275d35d 409 #if defined __CC_ARM
<> 135:176b8275d35d 410 #define __SIMD32_TYPE int32_t __packed
<> 135:176b8275d35d 411 #define CMSIS_UNUSED __attribute__((unused))
<> 135:176b8275d35d 412 #elif defined __ICCARM__
<> 135:176b8275d35d 413 #define __SIMD32_TYPE int32_t __packed
<> 135:176b8275d35d 414 #define CMSIS_UNUSED
<> 135:176b8275d35d 415 #elif defined __GNUC__
<> 135:176b8275d35d 416 #define __SIMD32_TYPE int32_t
<> 135:176b8275d35d 417 #define CMSIS_UNUSED __attribute__((unused))
<> 135:176b8275d35d 418 #elif defined __CSMC__ /* Cosmic */
<> 135:176b8275d35d 419 #define __SIMD32_TYPE int32_t
<> 135:176b8275d35d 420 #define CMSIS_UNUSED
<> 135:176b8275d35d 421 #elif defined __TASKING__
<> 135:176b8275d35d 422 #define __SIMD32_TYPE __unaligned int32_t
<> 135:176b8275d35d 423 #define CMSIS_UNUSED
<> 135:176b8275d35d 424 #else
<> 135:176b8275d35d 425 #error Unknown compiler
<> 135:176b8275d35d 426 #endif
<> 135:176b8275d35d 427
<> 135:176b8275d35d 428 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
<> 135:176b8275d35d 429 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
<> 135:176b8275d35d 430
<> 135:176b8275d35d 431 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
<> 135:176b8275d35d 432
<> 135:176b8275d35d 433 #define __SIMD64(addr) (*(int64_t **) & (addr))
<> 135:176b8275d35d 434
<> 135:176b8275d35d 435 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 135:176b8275d35d 436 /**
<> 135:176b8275d35d 437 * @brief definition to pack two 16 bit values.
<> 135:176b8275d35d 438 */
<> 135:176b8275d35d 439 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
<> 135:176b8275d35d 440 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
<> 135:176b8275d35d 441 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
<> 135:176b8275d35d 442 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
<> 135:176b8275d35d 443
<> 135:176b8275d35d 444 #endif
<> 135:176b8275d35d 445
<> 135:176b8275d35d 446
<> 135:176b8275d35d 447 /**
<> 135:176b8275d35d 448 * @brief definition to pack four 8 bit values.
<> 135:176b8275d35d 449 */
<> 135:176b8275d35d 450 #ifndef ARM_MATH_BIG_ENDIAN
<> 135:176b8275d35d 451
<> 135:176b8275d35d 452 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
<> 135:176b8275d35d 453 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
<> 135:176b8275d35d 454 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
<> 135:176b8275d35d 455 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
<> 135:176b8275d35d 456 #else
<> 135:176b8275d35d 457
<> 135:176b8275d35d 458 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
<> 135:176b8275d35d 459 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
<> 135:176b8275d35d 460 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
<> 135:176b8275d35d 461 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
<> 135:176b8275d35d 462
<> 135:176b8275d35d 463 #endif
<> 135:176b8275d35d 464
<> 135:176b8275d35d 465
<> 135:176b8275d35d 466 /**
<> 135:176b8275d35d 467 * @brief Clips Q63 to Q31 values.
<> 135:176b8275d35d 468 */
<> 135:176b8275d35d 469 static __INLINE q31_t clip_q63_to_q31(
<> 135:176b8275d35d 470 q63_t x)
<> 135:176b8275d35d 471 {
<> 135:176b8275d35d 472 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 135:176b8275d35d 473 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
<> 135:176b8275d35d 474 }
<> 135:176b8275d35d 475
<> 135:176b8275d35d 476 /**
<> 135:176b8275d35d 477 * @brief Clips Q63 to Q15 values.
<> 135:176b8275d35d 478 */
<> 135:176b8275d35d 479 static __INLINE q15_t clip_q63_to_q15(
<> 135:176b8275d35d 480 q63_t x)
<> 135:176b8275d35d 481 {
<> 135:176b8275d35d 482 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 135:176b8275d35d 483 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
<> 135:176b8275d35d 484 }
<> 135:176b8275d35d 485
<> 135:176b8275d35d 486 /**
<> 135:176b8275d35d 487 * @brief Clips Q31 to Q7 values.
<> 135:176b8275d35d 488 */
<> 135:176b8275d35d 489 static __INLINE q7_t clip_q31_to_q7(
<> 135:176b8275d35d 490 q31_t x)
<> 135:176b8275d35d 491 {
<> 135:176b8275d35d 492 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
<> 135:176b8275d35d 493 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
<> 135:176b8275d35d 494 }
<> 135:176b8275d35d 495
<> 135:176b8275d35d 496 /**
<> 135:176b8275d35d 497 * @brief Clips Q31 to Q15 values.
<> 135:176b8275d35d 498 */
<> 135:176b8275d35d 499 static __INLINE q15_t clip_q31_to_q15(
<> 135:176b8275d35d 500 q31_t x)
<> 135:176b8275d35d 501 {
<> 135:176b8275d35d 502 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
<> 135:176b8275d35d 503 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
<> 135:176b8275d35d 504 }
<> 135:176b8275d35d 505
<> 135:176b8275d35d 506 /**
<> 135:176b8275d35d 507 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
<> 135:176b8275d35d 508 */
<> 135:176b8275d35d 509
<> 135:176b8275d35d 510 static __INLINE q63_t mult32x64(
<> 135:176b8275d35d 511 q63_t x,
<> 135:176b8275d35d 512 q31_t y)
<> 135:176b8275d35d 513 {
<> 135:176b8275d35d 514 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
<> 135:176b8275d35d 515 (((q63_t) (x >> 32) * y)));
<> 135:176b8275d35d 516 }
<> 135:176b8275d35d 517
<> 135:176b8275d35d 518
<> 135:176b8275d35d 519 //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
<> 135:176b8275d35d 520 //#define __CLZ __clz
<> 135:176b8275d35d 521 //#endif
<> 135:176b8275d35d 522
<> 135:176b8275d35d 523 //note: function can be removed when all toolchain support __CLZ for Cortex-M0
<> 135:176b8275d35d 524 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
<> 135:176b8275d35d 525
<> 135:176b8275d35d 526 static __INLINE uint32_t __CLZ(
<> 135:176b8275d35d 527 q31_t data);
<> 135:176b8275d35d 528
<> 135:176b8275d35d 529
<> 135:176b8275d35d 530 static __INLINE uint32_t __CLZ(
<> 135:176b8275d35d 531 q31_t data)
<> 135:176b8275d35d 532 {
<> 135:176b8275d35d 533 uint32_t count = 0;
<> 135:176b8275d35d 534 uint32_t mask = 0x80000000;
<> 135:176b8275d35d 535
<> 135:176b8275d35d 536 while((data & mask) == 0)
<> 135:176b8275d35d 537 {
<> 135:176b8275d35d 538 count += 1u;
<> 135:176b8275d35d 539 mask = mask >> 1u;
<> 135:176b8275d35d 540 }
<> 135:176b8275d35d 541
<> 135:176b8275d35d 542 return (count);
<> 135:176b8275d35d 543
<> 135:176b8275d35d 544 }
<> 135:176b8275d35d 545
<> 135:176b8275d35d 546 #endif
<> 135:176b8275d35d 547
<> 135:176b8275d35d 548 /**
<> 135:176b8275d35d 549 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
<> 135:176b8275d35d 550 */
<> 135:176b8275d35d 551
<> 135:176b8275d35d 552 static __INLINE uint32_t arm_recip_q31(
<> 135:176b8275d35d 553 q31_t in,
<> 135:176b8275d35d 554 q31_t * dst,
<> 135:176b8275d35d 555 q31_t * pRecipTable)
<> 135:176b8275d35d 556 {
<> 135:176b8275d35d 557
<> 135:176b8275d35d 558 uint32_t out, tempVal;
<> 135:176b8275d35d 559 uint32_t index, i;
<> 135:176b8275d35d 560 uint32_t signBits;
<> 135:176b8275d35d 561
<> 135:176b8275d35d 562 if(in > 0)
<> 135:176b8275d35d 563 {
<> 135:176b8275d35d 564 signBits = __CLZ(in) - 1;
<> 135:176b8275d35d 565 }
<> 135:176b8275d35d 566 else
<> 135:176b8275d35d 567 {
<> 135:176b8275d35d 568 signBits = __CLZ(-in) - 1;
<> 135:176b8275d35d 569 }
<> 135:176b8275d35d 570
<> 135:176b8275d35d 571 /* Convert input sample to 1.31 format */
<> 135:176b8275d35d 572 in = in << signBits;
<> 135:176b8275d35d 573
<> 135:176b8275d35d 574 /* calculation of index for initial approximated Val */
<> 135:176b8275d35d 575 index = (uint32_t) (in >> 24u);
<> 135:176b8275d35d 576 index = (index & INDEX_MASK);
<> 135:176b8275d35d 577
<> 135:176b8275d35d 578 /* 1.31 with exp 1 */
<> 135:176b8275d35d 579 out = pRecipTable[index];
<> 135:176b8275d35d 580
<> 135:176b8275d35d 581 /* calculation of reciprocal value */
<> 135:176b8275d35d 582 /* running approximation for two iterations */
<> 135:176b8275d35d 583 for (i = 0u; i < 2u; i++)
<> 135:176b8275d35d 584 {
<> 135:176b8275d35d 585 tempVal = (q31_t) (((q63_t) in * out) >> 31u);
<> 135:176b8275d35d 586 tempVal = 0x7FFFFFFF - tempVal;
<> 135:176b8275d35d 587 /* 1.31 with exp 1 */
<> 135:176b8275d35d 588 //out = (q31_t) (((q63_t) out * tempVal) >> 30u);
<> 135:176b8275d35d 589 out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u);
<> 135:176b8275d35d 590 }
<> 135:176b8275d35d 591
<> 135:176b8275d35d 592 /* write output */
<> 135:176b8275d35d 593 *dst = out;
<> 135:176b8275d35d 594
<> 135:176b8275d35d 595 /* return num of signbits of out = 1/in value */
<> 135:176b8275d35d 596 return (signBits + 1u);
<> 135:176b8275d35d 597
<> 135:176b8275d35d 598 }
<> 135:176b8275d35d 599
<> 135:176b8275d35d 600 /**
<> 135:176b8275d35d 601 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
<> 135:176b8275d35d 602 */
<> 135:176b8275d35d 603 static __INLINE uint32_t arm_recip_q15(
<> 135:176b8275d35d 604 q15_t in,
<> 135:176b8275d35d 605 q15_t * dst,
<> 135:176b8275d35d 606 q15_t * pRecipTable)
<> 135:176b8275d35d 607 {
<> 135:176b8275d35d 608
<> 135:176b8275d35d 609 uint32_t out = 0, tempVal = 0;
<> 135:176b8275d35d 610 uint32_t index = 0, i = 0;
<> 135:176b8275d35d 611 uint32_t signBits = 0;
<> 135:176b8275d35d 612
<> 135:176b8275d35d 613 if(in > 0)
<> 135:176b8275d35d 614 {
<> 135:176b8275d35d 615 signBits = __CLZ(in) - 17;
<> 135:176b8275d35d 616 }
<> 135:176b8275d35d 617 else
<> 135:176b8275d35d 618 {
<> 135:176b8275d35d 619 signBits = __CLZ(-in) - 17;
<> 135:176b8275d35d 620 }
<> 135:176b8275d35d 621
<> 135:176b8275d35d 622 /* Convert input sample to 1.15 format */
<> 135:176b8275d35d 623 in = in << signBits;
<> 135:176b8275d35d 624
<> 135:176b8275d35d 625 /* calculation of index for initial approximated Val */
<> 135:176b8275d35d 626 index = in >> 8;
<> 135:176b8275d35d 627 index = (index & INDEX_MASK);
<> 135:176b8275d35d 628
<> 135:176b8275d35d 629 /* 1.15 with exp 1 */
<> 135:176b8275d35d 630 out = pRecipTable[index];
<> 135:176b8275d35d 631
<> 135:176b8275d35d 632 /* calculation of reciprocal value */
<> 135:176b8275d35d 633 /* running approximation for two iterations */
<> 135:176b8275d35d 634 for (i = 0; i < 2; i++)
<> 135:176b8275d35d 635 {
<> 135:176b8275d35d 636 tempVal = (q15_t) (((q31_t) in * out) >> 15);
<> 135:176b8275d35d 637 tempVal = 0x7FFF - tempVal;
<> 135:176b8275d35d 638 /* 1.15 with exp 1 */
<> 135:176b8275d35d 639 out = (q15_t) (((q31_t) out * tempVal) >> 14);
<> 135:176b8275d35d 640 }
<> 135:176b8275d35d 641
<> 135:176b8275d35d 642 /* write output */
<> 135:176b8275d35d 643 *dst = out;
<> 135:176b8275d35d 644
<> 135:176b8275d35d 645 /* return num of signbits of out = 1/in value */
<> 135:176b8275d35d 646 return (signBits + 1);
<> 135:176b8275d35d 647
<> 135:176b8275d35d 648 }
<> 135:176b8275d35d 649
<> 135:176b8275d35d 650
<> 135:176b8275d35d 651 /*
<> 135:176b8275d35d 652 * @brief C custom defined intrinisic function for only M0 processors
<> 135:176b8275d35d 653 */
<> 135:176b8275d35d 654 #if defined(ARM_MATH_CM0_FAMILY)
<> 135:176b8275d35d 655
<> 135:176b8275d35d 656 static __INLINE q31_t __SSAT(
<> 135:176b8275d35d 657 q31_t x,
<> 135:176b8275d35d 658 uint32_t y)
<> 135:176b8275d35d 659 {
<> 135:176b8275d35d 660 int32_t posMax, negMin;
<> 135:176b8275d35d 661 uint32_t i;
<> 135:176b8275d35d 662
<> 135:176b8275d35d 663 posMax = 1;
<> 135:176b8275d35d 664 for (i = 0; i < (y - 1); i++)
<> 135:176b8275d35d 665 {
<> 135:176b8275d35d 666 posMax = posMax * 2;
<> 135:176b8275d35d 667 }
<> 135:176b8275d35d 668
<> 135:176b8275d35d 669 if(x > 0)
<> 135:176b8275d35d 670 {
<> 135:176b8275d35d 671 posMax = (posMax - 1);
<> 135:176b8275d35d 672
<> 135:176b8275d35d 673 if(x > posMax)
<> 135:176b8275d35d 674 {
<> 135:176b8275d35d 675 x = posMax;
<> 135:176b8275d35d 676 }
<> 135:176b8275d35d 677 }
<> 135:176b8275d35d 678 else
<> 135:176b8275d35d 679 {
<> 135:176b8275d35d 680 negMin = -posMax;
<> 135:176b8275d35d 681
<> 135:176b8275d35d 682 if(x < negMin)
<> 135:176b8275d35d 683 {
<> 135:176b8275d35d 684 x = negMin;
<> 135:176b8275d35d 685 }
<> 135:176b8275d35d 686 }
<> 135:176b8275d35d 687 return (x);
<> 135:176b8275d35d 688
<> 135:176b8275d35d 689
<> 135:176b8275d35d 690 }
<> 135:176b8275d35d 691
<> 135:176b8275d35d 692 #endif /* end of ARM_MATH_CM0_FAMILY */
<> 135:176b8275d35d 693
<> 135:176b8275d35d 694
<> 135:176b8275d35d 695
<> 135:176b8275d35d 696 /*
<> 135:176b8275d35d 697 * @brief C custom defined intrinsic function for M3 and M0 processors
<> 135:176b8275d35d 698 */
<> 135:176b8275d35d 699 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 135:176b8275d35d 700
<> 135:176b8275d35d 701 /*
<> 135:176b8275d35d 702 * @brief C custom defined QADD8 for M3 and M0 processors
<> 135:176b8275d35d 703 */
<> 135:176b8275d35d 704 static __INLINE q31_t __QADD8(
<> 135:176b8275d35d 705 q31_t x,
<> 135:176b8275d35d 706 q31_t y)
<> 135:176b8275d35d 707 {
<> 135:176b8275d35d 708
<> 135:176b8275d35d 709 q31_t sum;
<> 135:176b8275d35d 710 q7_t r, s, t, u;
<> 135:176b8275d35d 711
<> 135:176b8275d35d 712 r = (q7_t) x;
<> 135:176b8275d35d 713 s = (q7_t) y;
<> 135:176b8275d35d 714
<> 135:176b8275d35d 715 r = __SSAT((q31_t) (r + s), 8);
<> 135:176b8275d35d 716 s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8);
<> 135:176b8275d35d 717 t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8);
<> 135:176b8275d35d 718 u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8);
<> 135:176b8275d35d 719
<> 135:176b8275d35d 720 sum =
<> 135:176b8275d35d 721 (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) |
<> 135:176b8275d35d 722 (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF);
<> 135:176b8275d35d 723
<> 135:176b8275d35d 724 return sum;
<> 135:176b8275d35d 725
<> 135:176b8275d35d 726 }
<> 135:176b8275d35d 727
<> 135:176b8275d35d 728 /*
<> 135:176b8275d35d 729 * @brief C custom defined QSUB8 for M3 and M0 processors
<> 135:176b8275d35d 730 */
<> 135:176b8275d35d 731 static __INLINE q31_t __QSUB8(
<> 135:176b8275d35d 732 q31_t x,
<> 135:176b8275d35d 733 q31_t y)
<> 135:176b8275d35d 734 {
<> 135:176b8275d35d 735
<> 135:176b8275d35d 736 q31_t sum;
<> 135:176b8275d35d 737 q31_t r, s, t, u;
<> 135:176b8275d35d 738
<> 135:176b8275d35d 739 r = (q7_t) x;
<> 135:176b8275d35d 740 s = (q7_t) y;
<> 135:176b8275d35d 741
<> 135:176b8275d35d 742 r = __SSAT((r - s), 8);
<> 135:176b8275d35d 743 s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8;
<> 135:176b8275d35d 744 t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16;
<> 135:176b8275d35d 745 u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24;
<> 135:176b8275d35d 746
<> 135:176b8275d35d 747 sum =
<> 135:176b8275d35d 748 (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r &
<> 135:176b8275d35d 749 0x000000FF);
<> 135:176b8275d35d 750
<> 135:176b8275d35d 751 return sum;
<> 135:176b8275d35d 752 }
<> 135:176b8275d35d 753
<> 135:176b8275d35d 754 /*
<> 135:176b8275d35d 755 * @brief C custom defined QADD16 for M3 and M0 processors
<> 135:176b8275d35d 756 */
<> 135:176b8275d35d 757
<> 135:176b8275d35d 758 /*
<> 135:176b8275d35d 759 * @brief C custom defined QADD16 for M3 and M0 processors
<> 135:176b8275d35d 760 */
<> 135:176b8275d35d 761 static __INLINE q31_t __QADD16(
<> 135:176b8275d35d 762 q31_t x,
<> 135:176b8275d35d 763 q31_t y)
<> 135:176b8275d35d 764 {
<> 135:176b8275d35d 765
<> 135:176b8275d35d 766 q31_t sum;
<> 135:176b8275d35d 767 q31_t r, s;
<> 135:176b8275d35d 768
<> 135:176b8275d35d 769 r = (q15_t) x;
<> 135:176b8275d35d 770 s = (q15_t) y;
<> 135:176b8275d35d 771
<> 135:176b8275d35d 772 r = __SSAT(r + s, 16);
<> 135:176b8275d35d 773 s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16;
<> 135:176b8275d35d 774
<> 135:176b8275d35d 775 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 776
<> 135:176b8275d35d 777 return sum;
<> 135:176b8275d35d 778
<> 135:176b8275d35d 779 }
<> 135:176b8275d35d 780
<> 135:176b8275d35d 781 /*
<> 135:176b8275d35d 782 * @brief C custom defined SHADD16 for M3 and M0 processors
<> 135:176b8275d35d 783 */
<> 135:176b8275d35d 784 static __INLINE q31_t __SHADD16(
<> 135:176b8275d35d 785 q31_t x,
<> 135:176b8275d35d 786 q31_t y)
<> 135:176b8275d35d 787 {
<> 135:176b8275d35d 788
<> 135:176b8275d35d 789 q31_t sum;
<> 135:176b8275d35d 790 q31_t r, s;
<> 135:176b8275d35d 791
<> 135:176b8275d35d 792 r = (q15_t) x;
<> 135:176b8275d35d 793 s = (q15_t) y;
<> 135:176b8275d35d 794
<> 135:176b8275d35d 795 r = ((r >> 1) + (s >> 1));
<> 135:176b8275d35d 796 s = ((q31_t) ((x >> 17) + (y >> 17))) << 16;
<> 135:176b8275d35d 797
<> 135:176b8275d35d 798 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 799
<> 135:176b8275d35d 800 return sum;
<> 135:176b8275d35d 801
<> 135:176b8275d35d 802 }
<> 135:176b8275d35d 803
<> 135:176b8275d35d 804 /*
<> 135:176b8275d35d 805 * @brief C custom defined QSUB16 for M3 and M0 processors
<> 135:176b8275d35d 806 */
<> 135:176b8275d35d 807 static __INLINE q31_t __QSUB16(
<> 135:176b8275d35d 808 q31_t x,
<> 135:176b8275d35d 809 q31_t y)
<> 135:176b8275d35d 810 {
<> 135:176b8275d35d 811
<> 135:176b8275d35d 812 q31_t sum;
<> 135:176b8275d35d 813 q31_t r, s;
<> 135:176b8275d35d 814
<> 135:176b8275d35d 815 r = (q15_t) x;
<> 135:176b8275d35d 816 s = (q15_t) y;
<> 135:176b8275d35d 817
<> 135:176b8275d35d 818 r = __SSAT(r - s, 16);
<> 135:176b8275d35d 819 s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16;
<> 135:176b8275d35d 820
<> 135:176b8275d35d 821 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 822
<> 135:176b8275d35d 823 return sum;
<> 135:176b8275d35d 824 }
<> 135:176b8275d35d 825
<> 135:176b8275d35d 826 /*
<> 135:176b8275d35d 827 * @brief C custom defined SHSUB16 for M3 and M0 processors
<> 135:176b8275d35d 828 */
<> 135:176b8275d35d 829 static __INLINE q31_t __SHSUB16(
<> 135:176b8275d35d 830 q31_t x,
<> 135:176b8275d35d 831 q31_t y)
<> 135:176b8275d35d 832 {
<> 135:176b8275d35d 833
<> 135:176b8275d35d 834 q31_t diff;
<> 135:176b8275d35d 835 q31_t r, s;
<> 135:176b8275d35d 836
<> 135:176b8275d35d 837 r = (q15_t) x;
<> 135:176b8275d35d 838 s = (q15_t) y;
<> 135:176b8275d35d 839
<> 135:176b8275d35d 840 r = ((r >> 1) - (s >> 1));
<> 135:176b8275d35d 841 s = (((x >> 17) - (y >> 17)) << 16);
<> 135:176b8275d35d 842
<> 135:176b8275d35d 843 diff = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 844
<> 135:176b8275d35d 845 return diff;
<> 135:176b8275d35d 846 }
<> 135:176b8275d35d 847
<> 135:176b8275d35d 848 /*
<> 135:176b8275d35d 849 * @brief C custom defined QASX for M3 and M0 processors
<> 135:176b8275d35d 850 */
<> 135:176b8275d35d 851 static __INLINE q31_t __QASX(
<> 135:176b8275d35d 852 q31_t x,
<> 135:176b8275d35d 853 q31_t y)
<> 135:176b8275d35d 854 {
<> 135:176b8275d35d 855
<> 135:176b8275d35d 856 q31_t sum = 0;
<> 135:176b8275d35d 857
<> 135:176b8275d35d 858 sum =
<> 135:176b8275d35d 859 ((sum +
<> 135:176b8275d35d 860 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) +
<> 135:176b8275d35d 861 clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16)));
<> 135:176b8275d35d 862
<> 135:176b8275d35d 863 return sum;
<> 135:176b8275d35d 864 }
<> 135:176b8275d35d 865
<> 135:176b8275d35d 866 /*
<> 135:176b8275d35d 867 * @brief C custom defined SHASX for M3 and M0 processors
<> 135:176b8275d35d 868 */
<> 135:176b8275d35d 869 static __INLINE q31_t __SHASX(
<> 135:176b8275d35d 870 q31_t x,
<> 135:176b8275d35d 871 q31_t y)
<> 135:176b8275d35d 872 {
<> 135:176b8275d35d 873
<> 135:176b8275d35d 874 q31_t sum;
<> 135:176b8275d35d 875 q31_t r, s;
<> 135:176b8275d35d 876
<> 135:176b8275d35d 877 r = (q15_t) x;
<> 135:176b8275d35d 878 s = (q15_t) y;
<> 135:176b8275d35d 879
<> 135:176b8275d35d 880 r = ((r >> 1) - (y >> 17));
<> 135:176b8275d35d 881 s = (((x >> 17) + (s >> 1)) << 16);
<> 135:176b8275d35d 882
<> 135:176b8275d35d 883 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 884
<> 135:176b8275d35d 885 return sum;
<> 135:176b8275d35d 886 }
<> 135:176b8275d35d 887
<> 135:176b8275d35d 888
<> 135:176b8275d35d 889 /*
<> 135:176b8275d35d 890 * @brief C custom defined QSAX for M3 and M0 processors
<> 135:176b8275d35d 891 */
<> 135:176b8275d35d 892 static __INLINE q31_t __QSAX(
<> 135:176b8275d35d 893 q31_t x,
<> 135:176b8275d35d 894 q31_t y)
<> 135:176b8275d35d 895 {
<> 135:176b8275d35d 896
<> 135:176b8275d35d 897 q31_t sum = 0;
<> 135:176b8275d35d 898
<> 135:176b8275d35d 899 sum =
<> 135:176b8275d35d 900 ((sum +
<> 135:176b8275d35d 901 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) +
<> 135:176b8275d35d 902 clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16)));
<> 135:176b8275d35d 903
<> 135:176b8275d35d 904 return sum;
<> 135:176b8275d35d 905 }
<> 135:176b8275d35d 906
<> 135:176b8275d35d 907 /*
<> 135:176b8275d35d 908 * @brief C custom defined SHSAX for M3 and M0 processors
<> 135:176b8275d35d 909 */
<> 135:176b8275d35d 910 static __INLINE q31_t __SHSAX(
<> 135:176b8275d35d 911 q31_t x,
<> 135:176b8275d35d 912 q31_t y)
<> 135:176b8275d35d 913 {
<> 135:176b8275d35d 914
<> 135:176b8275d35d 915 q31_t sum;
<> 135:176b8275d35d 916 q31_t r, s;
<> 135:176b8275d35d 917
<> 135:176b8275d35d 918 r = (q15_t) x;
<> 135:176b8275d35d 919 s = (q15_t) y;
<> 135:176b8275d35d 920
<> 135:176b8275d35d 921 r = ((r >> 1) + (y >> 17));
<> 135:176b8275d35d 922 s = (((x >> 17) - (s >> 1)) << 16);
<> 135:176b8275d35d 923
<> 135:176b8275d35d 924 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 135:176b8275d35d 925
<> 135:176b8275d35d 926 return sum;
<> 135:176b8275d35d 927 }
<> 135:176b8275d35d 928
<> 135:176b8275d35d 929 /*
<> 135:176b8275d35d 930 * @brief C custom defined SMUSDX for M3 and M0 processors
<> 135:176b8275d35d 931 */
<> 135:176b8275d35d 932 static __INLINE q31_t __SMUSDX(
<> 135:176b8275d35d 933 q31_t x,
<> 135:176b8275d35d 934 q31_t y)
<> 135:176b8275d35d 935 {
<> 135:176b8275d35d 936
<> 135:176b8275d35d 937 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) -
<> 135:176b8275d35d 938 ((q15_t) (x >> 16) * (q15_t) y)));
<> 135:176b8275d35d 939 }
<> 135:176b8275d35d 940
<> 135:176b8275d35d 941 /*
<> 135:176b8275d35d 942 * @brief C custom defined SMUADX for M3 and M0 processors
<> 135:176b8275d35d 943 */
<> 135:176b8275d35d 944 static __INLINE q31_t __SMUADX(
<> 135:176b8275d35d 945 q31_t x,
<> 135:176b8275d35d 946 q31_t y)
<> 135:176b8275d35d 947 {
<> 135:176b8275d35d 948
<> 135:176b8275d35d 949 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) +
<> 135:176b8275d35d 950 ((q15_t) (x >> 16) * (q15_t) y)));
<> 135:176b8275d35d 951 }
<> 135:176b8275d35d 952
<> 135:176b8275d35d 953 /*
<> 135:176b8275d35d 954 * @brief C custom defined QADD for M3 and M0 processors
<> 135:176b8275d35d 955 */
<> 135:176b8275d35d 956 static __INLINE q31_t __QADD(
<> 135:176b8275d35d 957 q31_t x,
<> 135:176b8275d35d 958 q31_t y)
<> 135:176b8275d35d 959 {
<> 135:176b8275d35d 960 return clip_q63_to_q31((q63_t) x + y);
<> 135:176b8275d35d 961 }
<> 135:176b8275d35d 962
<> 135:176b8275d35d 963 /*
<> 135:176b8275d35d 964 * @brief C custom defined QSUB for M3 and M0 processors
<> 135:176b8275d35d 965 */
<> 135:176b8275d35d 966 static __INLINE q31_t __QSUB(
<> 135:176b8275d35d 967 q31_t x,
<> 135:176b8275d35d 968 q31_t y)
<> 135:176b8275d35d 969 {
<> 135:176b8275d35d 970 return clip_q63_to_q31((q63_t) x - y);
<> 135:176b8275d35d 971 }
<> 135:176b8275d35d 972
<> 135:176b8275d35d 973 /*
<> 135:176b8275d35d 974 * @brief C custom defined SMLAD for M3 and M0 processors
<> 135:176b8275d35d 975 */
<> 135:176b8275d35d 976 static __INLINE q31_t __SMLAD(
<> 135:176b8275d35d 977 q31_t x,
<> 135:176b8275d35d 978 q31_t y,
<> 135:176b8275d35d 979 q31_t sum)
<> 135:176b8275d35d 980 {
<> 135:176b8275d35d 981
<> 135:176b8275d35d 982 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 135:176b8275d35d 983 ((q15_t) x * (q15_t) y));
<> 135:176b8275d35d 984 }
<> 135:176b8275d35d 985
<> 135:176b8275d35d 986 /*
<> 135:176b8275d35d 987 * @brief C custom defined SMLADX for M3 and M0 processors
<> 135:176b8275d35d 988 */
<> 135:176b8275d35d 989 static __INLINE q31_t __SMLADX(
<> 135:176b8275d35d 990 q31_t x,
<> 135:176b8275d35d 991 q31_t y,
<> 135:176b8275d35d 992 q31_t sum)
<> 135:176b8275d35d 993 {
<> 135:176b8275d35d 994
<> 135:176b8275d35d 995 return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 135:176b8275d35d 996 ((q15_t) x * (q15_t) (y >> 16)));
<> 135:176b8275d35d 997 }
<> 135:176b8275d35d 998
<> 135:176b8275d35d 999 /*
<> 135:176b8275d35d 1000 * @brief C custom defined SMLSDX for M3 and M0 processors
<> 135:176b8275d35d 1001 */
<> 135:176b8275d35d 1002 static __INLINE q31_t __SMLSDX(
<> 135:176b8275d35d 1003 q31_t x,
<> 135:176b8275d35d 1004 q31_t y,
<> 135:176b8275d35d 1005 q31_t sum)
<> 135:176b8275d35d 1006 {
<> 135:176b8275d35d 1007
<> 135:176b8275d35d 1008 return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 135:176b8275d35d 1009 ((q15_t) x * (q15_t) (y >> 16)));
<> 135:176b8275d35d 1010 }
<> 135:176b8275d35d 1011
<> 135:176b8275d35d 1012 /*
<> 135:176b8275d35d 1013 * @brief C custom defined SMLALD for M3 and M0 processors
<> 135:176b8275d35d 1014 */
<> 135:176b8275d35d 1015 static __INLINE q63_t __SMLALD(
<> 135:176b8275d35d 1016 q31_t x,
<> 135:176b8275d35d 1017 q31_t y,
<> 135:176b8275d35d 1018 q63_t sum)
<> 135:176b8275d35d 1019 {
<> 135:176b8275d35d 1020
<> 135:176b8275d35d 1021 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 135:176b8275d35d 1022 ((q15_t) x * (q15_t) y));
<> 135:176b8275d35d 1023 }
<> 135:176b8275d35d 1024
<> 135:176b8275d35d 1025 /*
<> 135:176b8275d35d 1026 * @brief C custom defined SMLALDX for M3 and M0 processors
<> 135:176b8275d35d 1027 */
<> 135:176b8275d35d 1028 static __INLINE q63_t __SMLALDX(
<> 135:176b8275d35d 1029 q31_t x,
<> 135:176b8275d35d 1030 q31_t y,
<> 135:176b8275d35d 1031 q63_t sum)
<> 135:176b8275d35d 1032 {
<> 135:176b8275d35d 1033
<> 135:176b8275d35d 1034 return (sum + ((q15_t) (x >> 16) * (q15_t) y)) +
<> 135:176b8275d35d 1035 ((q15_t) x * (q15_t) (y >> 16));
<> 135:176b8275d35d 1036 }
<> 135:176b8275d35d 1037
<> 135:176b8275d35d 1038 /*
<> 135:176b8275d35d 1039 * @brief C custom defined SMUAD for M3 and M0 processors
<> 135:176b8275d35d 1040 */
<> 135:176b8275d35d 1041 static __INLINE q31_t __SMUAD(
<> 135:176b8275d35d 1042 q31_t x,
<> 135:176b8275d35d 1043 q31_t y)
<> 135:176b8275d35d 1044 {
<> 135:176b8275d35d 1045
<> 135:176b8275d35d 1046 return (((x >> 16) * (y >> 16)) +
<> 135:176b8275d35d 1047 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 135:176b8275d35d 1048 }
<> 135:176b8275d35d 1049
<> 135:176b8275d35d 1050 /*
<> 135:176b8275d35d 1051 * @brief C custom defined SMUSD for M3 and M0 processors
<> 135:176b8275d35d 1052 */
<> 135:176b8275d35d 1053 static __INLINE q31_t __SMUSD(
<> 135:176b8275d35d 1054 q31_t x,
<> 135:176b8275d35d 1055 q31_t y)
<> 135:176b8275d35d 1056 {
<> 135:176b8275d35d 1057
<> 135:176b8275d35d 1058 return (-((x >> 16) * (y >> 16)) +
<> 135:176b8275d35d 1059 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 135:176b8275d35d 1060 }
<> 135:176b8275d35d 1061
<> 135:176b8275d35d 1062
<> 135:176b8275d35d 1063 /*
<> 135:176b8275d35d 1064 * @brief C custom defined SXTB16 for M3 and M0 processors
<> 135:176b8275d35d 1065 */
<> 135:176b8275d35d 1066 static __INLINE q31_t __SXTB16(
<> 135:176b8275d35d 1067 q31_t x)
<> 135:176b8275d35d 1068 {
<> 135:176b8275d35d 1069
<> 135:176b8275d35d 1070 return ((((x << 24) >> 24) & 0x0000FFFF) |
<> 135:176b8275d35d 1071 (((x << 8) >> 8) & 0xFFFF0000));
<> 135:176b8275d35d 1072 }
<> 135:176b8275d35d 1073
<> 135:176b8275d35d 1074
<> 135:176b8275d35d 1075 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
<> 135:176b8275d35d 1076
<> 135:176b8275d35d 1077
<> 135:176b8275d35d 1078 /**
<> 135:176b8275d35d 1079 * @brief Instance structure for the Q7 FIR filter.
<> 135:176b8275d35d 1080 */
<> 135:176b8275d35d 1081 typedef struct
<> 135:176b8275d35d 1082 {
<> 135:176b8275d35d 1083 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 135:176b8275d35d 1084 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 1085 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 1086 } arm_fir_instance_q7;
<> 135:176b8275d35d 1087
<> 135:176b8275d35d 1088 /**
<> 135:176b8275d35d 1089 * @brief Instance structure for the Q15 FIR filter.
<> 135:176b8275d35d 1090 */
<> 135:176b8275d35d 1091 typedef struct
<> 135:176b8275d35d 1092 {
<> 135:176b8275d35d 1093 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 135:176b8275d35d 1094 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 1095 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 1096 } arm_fir_instance_q15;
<> 135:176b8275d35d 1097
<> 135:176b8275d35d 1098 /**
<> 135:176b8275d35d 1099 * @brief Instance structure for the Q31 FIR filter.
<> 135:176b8275d35d 1100 */
<> 135:176b8275d35d 1101 typedef struct
<> 135:176b8275d35d 1102 {
<> 135:176b8275d35d 1103 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 135:176b8275d35d 1104 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 1105 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 1106 } arm_fir_instance_q31;
<> 135:176b8275d35d 1107
<> 135:176b8275d35d 1108 /**
<> 135:176b8275d35d 1109 * @brief Instance structure for the floating-point FIR filter.
<> 135:176b8275d35d 1110 */
<> 135:176b8275d35d 1111 typedef struct
<> 135:176b8275d35d 1112 {
<> 135:176b8275d35d 1113 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 135:176b8275d35d 1114 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 1115 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 1116 } arm_fir_instance_f32;
<> 135:176b8275d35d 1117
<> 135:176b8275d35d 1118
<> 135:176b8275d35d 1119 /**
<> 135:176b8275d35d 1120 * @brief Processing function for the Q7 FIR filter.
<> 135:176b8275d35d 1121 * @param[in] *S points to an instance of the Q7 FIR filter structure.
<> 135:176b8275d35d 1122 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1123 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1124 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1125 * @return none.
<> 135:176b8275d35d 1126 */
<> 135:176b8275d35d 1127 void arm_fir_q7(
<> 135:176b8275d35d 1128 const arm_fir_instance_q7 * S,
<> 135:176b8275d35d 1129 q7_t * pSrc,
<> 135:176b8275d35d 1130 q7_t * pDst,
<> 135:176b8275d35d 1131 uint32_t blockSize);
<> 135:176b8275d35d 1132
<> 135:176b8275d35d 1133
<> 135:176b8275d35d 1134 /**
<> 135:176b8275d35d 1135 * @brief Initialization function for the Q7 FIR filter.
<> 135:176b8275d35d 1136 * @param[in,out] *S points to an instance of the Q7 FIR structure.
<> 135:176b8275d35d 1137 * @param[in] numTaps Number of filter coefficients in the filter.
<> 135:176b8275d35d 1138 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1139 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1140 * @param[in] blockSize number of samples that are processed.
<> 135:176b8275d35d 1141 * @return none
<> 135:176b8275d35d 1142 */
<> 135:176b8275d35d 1143 void arm_fir_init_q7(
<> 135:176b8275d35d 1144 arm_fir_instance_q7 * S,
<> 135:176b8275d35d 1145 uint16_t numTaps,
<> 135:176b8275d35d 1146 q7_t * pCoeffs,
<> 135:176b8275d35d 1147 q7_t * pState,
<> 135:176b8275d35d 1148 uint32_t blockSize);
<> 135:176b8275d35d 1149
<> 135:176b8275d35d 1150
<> 135:176b8275d35d 1151 /**
<> 135:176b8275d35d 1152 * @brief Processing function for the Q15 FIR filter.
<> 135:176b8275d35d 1153 * @param[in] *S points to an instance of the Q15 FIR structure.
<> 135:176b8275d35d 1154 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1155 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1156 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1157 * @return none.
<> 135:176b8275d35d 1158 */
<> 135:176b8275d35d 1159 void arm_fir_q15(
<> 135:176b8275d35d 1160 const arm_fir_instance_q15 * S,
<> 135:176b8275d35d 1161 q15_t * pSrc,
<> 135:176b8275d35d 1162 q15_t * pDst,
<> 135:176b8275d35d 1163 uint32_t blockSize);
<> 135:176b8275d35d 1164
<> 135:176b8275d35d 1165 /**
<> 135:176b8275d35d 1166 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 1167 * @param[in] *S points to an instance of the Q15 FIR filter structure.
<> 135:176b8275d35d 1168 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1169 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1170 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1171 * @return none.
<> 135:176b8275d35d 1172 */
<> 135:176b8275d35d 1173 void arm_fir_fast_q15(
<> 135:176b8275d35d 1174 const arm_fir_instance_q15 * S,
<> 135:176b8275d35d 1175 q15_t * pSrc,
<> 135:176b8275d35d 1176 q15_t * pDst,
<> 135:176b8275d35d 1177 uint32_t blockSize);
<> 135:176b8275d35d 1178
<> 135:176b8275d35d 1179 /**
<> 135:176b8275d35d 1180 * @brief Initialization function for the Q15 FIR filter.
<> 135:176b8275d35d 1181 * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
<> 135:176b8275d35d 1182 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
<> 135:176b8275d35d 1183 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1184 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1185 * @param[in] blockSize number of samples that are processed at a time.
<> 135:176b8275d35d 1186 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
<> 135:176b8275d35d 1187 * <code>numTaps</code> is not a supported value.
<> 135:176b8275d35d 1188 */
<> 135:176b8275d35d 1189
<> 135:176b8275d35d 1190 arm_status arm_fir_init_q15(
<> 135:176b8275d35d 1191 arm_fir_instance_q15 * S,
<> 135:176b8275d35d 1192 uint16_t numTaps,
<> 135:176b8275d35d 1193 q15_t * pCoeffs,
<> 135:176b8275d35d 1194 q15_t * pState,
<> 135:176b8275d35d 1195 uint32_t blockSize);
<> 135:176b8275d35d 1196
<> 135:176b8275d35d 1197 /**
<> 135:176b8275d35d 1198 * @brief Processing function for the Q31 FIR filter.
<> 135:176b8275d35d 1199 * @param[in] *S points to an instance of the Q31 FIR filter structure.
<> 135:176b8275d35d 1200 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1201 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1202 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1203 * @return none.
<> 135:176b8275d35d 1204 */
<> 135:176b8275d35d 1205 void arm_fir_q31(
<> 135:176b8275d35d 1206 const arm_fir_instance_q31 * S,
<> 135:176b8275d35d 1207 q31_t * pSrc,
<> 135:176b8275d35d 1208 q31_t * pDst,
<> 135:176b8275d35d 1209 uint32_t blockSize);
<> 135:176b8275d35d 1210
<> 135:176b8275d35d 1211 /**
<> 135:176b8275d35d 1212 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 1213 * @param[in] *S points to an instance of the Q31 FIR structure.
<> 135:176b8275d35d 1214 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1215 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1216 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1217 * @return none.
<> 135:176b8275d35d 1218 */
<> 135:176b8275d35d 1219 void arm_fir_fast_q31(
<> 135:176b8275d35d 1220 const arm_fir_instance_q31 * S,
<> 135:176b8275d35d 1221 q31_t * pSrc,
<> 135:176b8275d35d 1222 q31_t * pDst,
<> 135:176b8275d35d 1223 uint32_t blockSize);
<> 135:176b8275d35d 1224
<> 135:176b8275d35d 1225 /**
<> 135:176b8275d35d 1226 * @brief Initialization function for the Q31 FIR filter.
<> 135:176b8275d35d 1227 * @param[in,out] *S points to an instance of the Q31 FIR structure.
<> 135:176b8275d35d 1228 * @param[in] numTaps Number of filter coefficients in the filter.
<> 135:176b8275d35d 1229 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1230 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1231 * @param[in] blockSize number of samples that are processed at a time.
<> 135:176b8275d35d 1232 * @return none.
<> 135:176b8275d35d 1233 */
<> 135:176b8275d35d 1234 void arm_fir_init_q31(
<> 135:176b8275d35d 1235 arm_fir_instance_q31 * S,
<> 135:176b8275d35d 1236 uint16_t numTaps,
<> 135:176b8275d35d 1237 q31_t * pCoeffs,
<> 135:176b8275d35d 1238 q31_t * pState,
<> 135:176b8275d35d 1239 uint32_t blockSize);
<> 135:176b8275d35d 1240
<> 135:176b8275d35d 1241 /**
<> 135:176b8275d35d 1242 * @brief Processing function for the floating-point FIR filter.
<> 135:176b8275d35d 1243 * @param[in] *S points to an instance of the floating-point FIR structure.
<> 135:176b8275d35d 1244 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1245 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1246 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1247 * @return none.
<> 135:176b8275d35d 1248 */
<> 135:176b8275d35d 1249 void arm_fir_f32(
<> 135:176b8275d35d 1250 const arm_fir_instance_f32 * S,
<> 135:176b8275d35d 1251 float32_t * pSrc,
<> 135:176b8275d35d 1252 float32_t * pDst,
<> 135:176b8275d35d 1253 uint32_t blockSize);
<> 135:176b8275d35d 1254
<> 135:176b8275d35d 1255 /**
<> 135:176b8275d35d 1256 * @brief Initialization function for the floating-point FIR filter.
<> 135:176b8275d35d 1257 * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
<> 135:176b8275d35d 1258 * @param[in] numTaps Number of filter coefficients in the filter.
<> 135:176b8275d35d 1259 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1260 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1261 * @param[in] blockSize number of samples that are processed at a time.
<> 135:176b8275d35d 1262 * @return none.
<> 135:176b8275d35d 1263 */
<> 135:176b8275d35d 1264 void arm_fir_init_f32(
<> 135:176b8275d35d 1265 arm_fir_instance_f32 * S,
<> 135:176b8275d35d 1266 uint16_t numTaps,
<> 135:176b8275d35d 1267 float32_t * pCoeffs,
<> 135:176b8275d35d 1268 float32_t * pState,
<> 135:176b8275d35d 1269 uint32_t blockSize);
<> 135:176b8275d35d 1270
<> 135:176b8275d35d 1271
<> 135:176b8275d35d 1272 /**
<> 135:176b8275d35d 1273 * @brief Instance structure for the Q15 Biquad cascade filter.
<> 135:176b8275d35d 1274 */
<> 135:176b8275d35d 1275 typedef struct
<> 135:176b8275d35d 1276 {
<> 135:176b8275d35d 1277 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 1278 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 135:176b8275d35d 1279 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 1280 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 135:176b8275d35d 1281
<> 135:176b8275d35d 1282 } arm_biquad_casd_df1_inst_q15;
<> 135:176b8275d35d 1283
<> 135:176b8275d35d 1284
<> 135:176b8275d35d 1285 /**
<> 135:176b8275d35d 1286 * @brief Instance structure for the Q31 Biquad cascade filter.
<> 135:176b8275d35d 1287 */
<> 135:176b8275d35d 1288 typedef struct
<> 135:176b8275d35d 1289 {
<> 135:176b8275d35d 1290 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 1291 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 135:176b8275d35d 1292 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 1293 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 135:176b8275d35d 1294
<> 135:176b8275d35d 1295 } arm_biquad_casd_df1_inst_q31;
<> 135:176b8275d35d 1296
<> 135:176b8275d35d 1297 /**
<> 135:176b8275d35d 1298 * @brief Instance structure for the floating-point Biquad cascade filter.
<> 135:176b8275d35d 1299 */
<> 135:176b8275d35d 1300 typedef struct
<> 135:176b8275d35d 1301 {
<> 135:176b8275d35d 1302 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 1303 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 135:176b8275d35d 1304 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 1305
<> 135:176b8275d35d 1306
<> 135:176b8275d35d 1307 } arm_biquad_casd_df1_inst_f32;
<> 135:176b8275d35d 1308
<> 135:176b8275d35d 1309
<> 135:176b8275d35d 1310
<> 135:176b8275d35d 1311 /**
<> 135:176b8275d35d 1312 * @brief Processing function for the Q15 Biquad cascade filter.
<> 135:176b8275d35d 1313 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 135:176b8275d35d 1314 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1315 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1316 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1317 * @return none.
<> 135:176b8275d35d 1318 */
<> 135:176b8275d35d 1319
<> 135:176b8275d35d 1320 void arm_biquad_cascade_df1_q15(
<> 135:176b8275d35d 1321 const arm_biquad_casd_df1_inst_q15 * S,
<> 135:176b8275d35d 1322 q15_t * pSrc,
<> 135:176b8275d35d 1323 q15_t * pDst,
<> 135:176b8275d35d 1324 uint32_t blockSize);
<> 135:176b8275d35d 1325
<> 135:176b8275d35d 1326 /**
<> 135:176b8275d35d 1327 * @brief Initialization function for the Q15 Biquad cascade filter.
<> 135:176b8275d35d 1328 * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure.
<> 135:176b8275d35d 1329 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 1330 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1331 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1332 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 135:176b8275d35d 1333 * @return none
<> 135:176b8275d35d 1334 */
<> 135:176b8275d35d 1335
<> 135:176b8275d35d 1336 void arm_biquad_cascade_df1_init_q15(
<> 135:176b8275d35d 1337 arm_biquad_casd_df1_inst_q15 * S,
<> 135:176b8275d35d 1338 uint8_t numStages,
<> 135:176b8275d35d 1339 q15_t * pCoeffs,
<> 135:176b8275d35d 1340 q15_t * pState,
<> 135:176b8275d35d 1341 int8_t postShift);
<> 135:176b8275d35d 1342
<> 135:176b8275d35d 1343
<> 135:176b8275d35d 1344 /**
<> 135:176b8275d35d 1345 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 1346 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 135:176b8275d35d 1347 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1348 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1349 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1350 * @return none.
<> 135:176b8275d35d 1351 */
<> 135:176b8275d35d 1352
<> 135:176b8275d35d 1353 void arm_biquad_cascade_df1_fast_q15(
<> 135:176b8275d35d 1354 const arm_biquad_casd_df1_inst_q15 * S,
<> 135:176b8275d35d 1355 q15_t * pSrc,
<> 135:176b8275d35d 1356 q15_t * pDst,
<> 135:176b8275d35d 1357 uint32_t blockSize);
<> 135:176b8275d35d 1358
<> 135:176b8275d35d 1359
<> 135:176b8275d35d 1360 /**
<> 135:176b8275d35d 1361 * @brief Processing function for the Q31 Biquad cascade filter
<> 135:176b8275d35d 1362 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 135:176b8275d35d 1363 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1364 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1365 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1366 * @return none.
<> 135:176b8275d35d 1367 */
<> 135:176b8275d35d 1368
<> 135:176b8275d35d 1369 void arm_biquad_cascade_df1_q31(
<> 135:176b8275d35d 1370 const arm_biquad_casd_df1_inst_q31 * S,
<> 135:176b8275d35d 1371 q31_t * pSrc,
<> 135:176b8275d35d 1372 q31_t * pDst,
<> 135:176b8275d35d 1373 uint32_t blockSize);
<> 135:176b8275d35d 1374
<> 135:176b8275d35d 1375 /**
<> 135:176b8275d35d 1376 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 1377 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 135:176b8275d35d 1378 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1379 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1380 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1381 * @return none.
<> 135:176b8275d35d 1382 */
<> 135:176b8275d35d 1383
<> 135:176b8275d35d 1384 void arm_biquad_cascade_df1_fast_q31(
<> 135:176b8275d35d 1385 const arm_biquad_casd_df1_inst_q31 * S,
<> 135:176b8275d35d 1386 q31_t * pSrc,
<> 135:176b8275d35d 1387 q31_t * pDst,
<> 135:176b8275d35d 1388 uint32_t blockSize);
<> 135:176b8275d35d 1389
<> 135:176b8275d35d 1390 /**
<> 135:176b8275d35d 1391 * @brief Initialization function for the Q31 Biquad cascade filter.
<> 135:176b8275d35d 1392 * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure.
<> 135:176b8275d35d 1393 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 1394 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1395 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1396 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 135:176b8275d35d 1397 * @return none
<> 135:176b8275d35d 1398 */
<> 135:176b8275d35d 1399
<> 135:176b8275d35d 1400 void arm_biquad_cascade_df1_init_q31(
<> 135:176b8275d35d 1401 arm_biquad_casd_df1_inst_q31 * S,
<> 135:176b8275d35d 1402 uint8_t numStages,
<> 135:176b8275d35d 1403 q31_t * pCoeffs,
<> 135:176b8275d35d 1404 q31_t * pState,
<> 135:176b8275d35d 1405 int8_t postShift);
<> 135:176b8275d35d 1406
<> 135:176b8275d35d 1407 /**
<> 135:176b8275d35d 1408 * @brief Processing function for the floating-point Biquad cascade filter.
<> 135:176b8275d35d 1409 * @param[in] *S points to an instance of the floating-point Biquad cascade structure.
<> 135:176b8275d35d 1410 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 1411 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 1412 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 1413 * @return none.
<> 135:176b8275d35d 1414 */
<> 135:176b8275d35d 1415
<> 135:176b8275d35d 1416 void arm_biquad_cascade_df1_f32(
<> 135:176b8275d35d 1417 const arm_biquad_casd_df1_inst_f32 * S,
<> 135:176b8275d35d 1418 float32_t * pSrc,
<> 135:176b8275d35d 1419 float32_t * pDst,
<> 135:176b8275d35d 1420 uint32_t blockSize);
<> 135:176b8275d35d 1421
<> 135:176b8275d35d 1422 /**
<> 135:176b8275d35d 1423 * @brief Initialization function for the floating-point Biquad cascade filter.
<> 135:176b8275d35d 1424 * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure.
<> 135:176b8275d35d 1425 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 1426 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 1427 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 1428 * @return none
<> 135:176b8275d35d 1429 */
<> 135:176b8275d35d 1430
<> 135:176b8275d35d 1431 void arm_biquad_cascade_df1_init_f32(
<> 135:176b8275d35d 1432 arm_biquad_casd_df1_inst_f32 * S,
<> 135:176b8275d35d 1433 uint8_t numStages,
<> 135:176b8275d35d 1434 float32_t * pCoeffs,
<> 135:176b8275d35d 1435 float32_t * pState);
<> 135:176b8275d35d 1436
<> 135:176b8275d35d 1437
<> 135:176b8275d35d 1438 /**
<> 135:176b8275d35d 1439 * @brief Instance structure for the floating-point matrix structure.
<> 135:176b8275d35d 1440 */
<> 135:176b8275d35d 1441
<> 135:176b8275d35d 1442 typedef struct
<> 135:176b8275d35d 1443 {
<> 135:176b8275d35d 1444 uint16_t numRows; /**< number of rows of the matrix. */
<> 135:176b8275d35d 1445 uint16_t numCols; /**< number of columns of the matrix. */
<> 135:176b8275d35d 1446 float32_t *pData; /**< points to the data of the matrix. */
<> 135:176b8275d35d 1447 } arm_matrix_instance_f32;
<> 135:176b8275d35d 1448
<> 135:176b8275d35d 1449
<> 135:176b8275d35d 1450 /**
<> 135:176b8275d35d 1451 * @brief Instance structure for the floating-point matrix structure.
<> 135:176b8275d35d 1452 */
<> 135:176b8275d35d 1453
<> 135:176b8275d35d 1454 typedef struct
<> 135:176b8275d35d 1455 {
<> 135:176b8275d35d 1456 uint16_t numRows; /**< number of rows of the matrix. */
<> 135:176b8275d35d 1457 uint16_t numCols; /**< number of columns of the matrix. */
<> 135:176b8275d35d 1458 float64_t *pData; /**< points to the data of the matrix. */
<> 135:176b8275d35d 1459 } arm_matrix_instance_f64;
<> 135:176b8275d35d 1460
<> 135:176b8275d35d 1461 /**
<> 135:176b8275d35d 1462 * @brief Instance structure for the Q15 matrix structure.
<> 135:176b8275d35d 1463 */
<> 135:176b8275d35d 1464
<> 135:176b8275d35d 1465 typedef struct
<> 135:176b8275d35d 1466 {
<> 135:176b8275d35d 1467 uint16_t numRows; /**< number of rows of the matrix. */
<> 135:176b8275d35d 1468 uint16_t numCols; /**< number of columns of the matrix. */
<> 135:176b8275d35d 1469 q15_t *pData; /**< points to the data of the matrix. */
<> 135:176b8275d35d 1470
<> 135:176b8275d35d 1471 } arm_matrix_instance_q15;
<> 135:176b8275d35d 1472
<> 135:176b8275d35d 1473 /**
<> 135:176b8275d35d 1474 * @brief Instance structure for the Q31 matrix structure.
<> 135:176b8275d35d 1475 */
<> 135:176b8275d35d 1476
<> 135:176b8275d35d 1477 typedef struct
<> 135:176b8275d35d 1478 {
<> 135:176b8275d35d 1479 uint16_t numRows; /**< number of rows of the matrix. */
<> 135:176b8275d35d 1480 uint16_t numCols; /**< number of columns of the matrix. */
<> 135:176b8275d35d 1481 q31_t *pData; /**< points to the data of the matrix. */
<> 135:176b8275d35d 1482
<> 135:176b8275d35d 1483 } arm_matrix_instance_q31;
<> 135:176b8275d35d 1484
<> 135:176b8275d35d 1485
<> 135:176b8275d35d 1486
<> 135:176b8275d35d 1487 /**
<> 135:176b8275d35d 1488 * @brief Floating-point matrix addition.
<> 135:176b8275d35d 1489 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1490 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1491 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1492 * @return The function returns either
<> 135:176b8275d35d 1493 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1494 */
<> 135:176b8275d35d 1495
<> 135:176b8275d35d 1496 arm_status arm_mat_add_f32(
<> 135:176b8275d35d 1497 const arm_matrix_instance_f32 * pSrcA,
<> 135:176b8275d35d 1498 const arm_matrix_instance_f32 * pSrcB,
<> 135:176b8275d35d 1499 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1500
<> 135:176b8275d35d 1501 /**
<> 135:176b8275d35d 1502 * @brief Q15 matrix addition.
<> 135:176b8275d35d 1503 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1504 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1505 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1506 * @return The function returns either
<> 135:176b8275d35d 1507 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1508 */
<> 135:176b8275d35d 1509
<> 135:176b8275d35d 1510 arm_status arm_mat_add_q15(
<> 135:176b8275d35d 1511 const arm_matrix_instance_q15 * pSrcA,
<> 135:176b8275d35d 1512 const arm_matrix_instance_q15 * pSrcB,
<> 135:176b8275d35d 1513 arm_matrix_instance_q15 * pDst);
<> 135:176b8275d35d 1514
<> 135:176b8275d35d 1515 /**
<> 135:176b8275d35d 1516 * @brief Q31 matrix addition.
<> 135:176b8275d35d 1517 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1518 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1519 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1520 * @return The function returns either
<> 135:176b8275d35d 1521 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1522 */
<> 135:176b8275d35d 1523
<> 135:176b8275d35d 1524 arm_status arm_mat_add_q31(
<> 135:176b8275d35d 1525 const arm_matrix_instance_q31 * pSrcA,
<> 135:176b8275d35d 1526 const arm_matrix_instance_q31 * pSrcB,
<> 135:176b8275d35d 1527 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1528
<> 135:176b8275d35d 1529 /**
<> 135:176b8275d35d 1530 * @brief Floating-point, complex, matrix multiplication.
<> 135:176b8275d35d 1531 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1532 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1533 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1534 * @return The function returns either
<> 135:176b8275d35d 1535 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1536 */
<> 135:176b8275d35d 1537
<> 135:176b8275d35d 1538 arm_status arm_mat_cmplx_mult_f32(
<> 135:176b8275d35d 1539 const arm_matrix_instance_f32 * pSrcA,
<> 135:176b8275d35d 1540 const arm_matrix_instance_f32 * pSrcB,
<> 135:176b8275d35d 1541 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1542
<> 135:176b8275d35d 1543 /**
<> 135:176b8275d35d 1544 * @brief Q15, complex, matrix multiplication.
<> 135:176b8275d35d 1545 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1546 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1547 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1548 * @return The function returns either
<> 135:176b8275d35d 1549 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1550 */
<> 135:176b8275d35d 1551
<> 135:176b8275d35d 1552 arm_status arm_mat_cmplx_mult_q15(
<> 135:176b8275d35d 1553 const arm_matrix_instance_q15 * pSrcA,
<> 135:176b8275d35d 1554 const arm_matrix_instance_q15 * pSrcB,
<> 135:176b8275d35d 1555 arm_matrix_instance_q15 * pDst,
<> 135:176b8275d35d 1556 q15_t * pScratch);
<> 135:176b8275d35d 1557
<> 135:176b8275d35d 1558 /**
<> 135:176b8275d35d 1559 * @brief Q31, complex, matrix multiplication.
<> 135:176b8275d35d 1560 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1561 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1562 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1563 * @return The function returns either
<> 135:176b8275d35d 1564 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1565 */
<> 135:176b8275d35d 1566
<> 135:176b8275d35d 1567 arm_status arm_mat_cmplx_mult_q31(
<> 135:176b8275d35d 1568 const arm_matrix_instance_q31 * pSrcA,
<> 135:176b8275d35d 1569 const arm_matrix_instance_q31 * pSrcB,
<> 135:176b8275d35d 1570 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1571
<> 135:176b8275d35d 1572
<> 135:176b8275d35d 1573 /**
<> 135:176b8275d35d 1574 * @brief Floating-point matrix transpose.
<> 135:176b8275d35d 1575 * @param[in] *pSrc points to the input matrix
<> 135:176b8275d35d 1576 * @param[out] *pDst points to the output matrix
<> 135:176b8275d35d 1577 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 135:176b8275d35d 1578 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1579 */
<> 135:176b8275d35d 1580
<> 135:176b8275d35d 1581 arm_status arm_mat_trans_f32(
<> 135:176b8275d35d 1582 const arm_matrix_instance_f32 * pSrc,
<> 135:176b8275d35d 1583 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1584
<> 135:176b8275d35d 1585
<> 135:176b8275d35d 1586 /**
<> 135:176b8275d35d 1587 * @brief Q15 matrix transpose.
<> 135:176b8275d35d 1588 * @param[in] *pSrc points to the input matrix
<> 135:176b8275d35d 1589 * @param[out] *pDst points to the output matrix
<> 135:176b8275d35d 1590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 135:176b8275d35d 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1592 */
<> 135:176b8275d35d 1593
<> 135:176b8275d35d 1594 arm_status arm_mat_trans_q15(
<> 135:176b8275d35d 1595 const arm_matrix_instance_q15 * pSrc,
<> 135:176b8275d35d 1596 arm_matrix_instance_q15 * pDst);
<> 135:176b8275d35d 1597
<> 135:176b8275d35d 1598 /**
<> 135:176b8275d35d 1599 * @brief Q31 matrix transpose.
<> 135:176b8275d35d 1600 * @param[in] *pSrc points to the input matrix
<> 135:176b8275d35d 1601 * @param[out] *pDst points to the output matrix
<> 135:176b8275d35d 1602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 135:176b8275d35d 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1604 */
<> 135:176b8275d35d 1605
<> 135:176b8275d35d 1606 arm_status arm_mat_trans_q31(
<> 135:176b8275d35d 1607 const arm_matrix_instance_q31 * pSrc,
<> 135:176b8275d35d 1608 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1609
<> 135:176b8275d35d 1610
<> 135:176b8275d35d 1611 /**
<> 135:176b8275d35d 1612 * @brief Floating-point matrix multiplication
<> 135:176b8275d35d 1613 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1614 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1615 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1616 * @return The function returns either
<> 135:176b8275d35d 1617 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1618 */
<> 135:176b8275d35d 1619
<> 135:176b8275d35d 1620 arm_status arm_mat_mult_f32(
<> 135:176b8275d35d 1621 const arm_matrix_instance_f32 * pSrcA,
<> 135:176b8275d35d 1622 const arm_matrix_instance_f32 * pSrcB,
<> 135:176b8275d35d 1623 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1624
<> 135:176b8275d35d 1625 /**
<> 135:176b8275d35d 1626 * @brief Q15 matrix multiplication
<> 135:176b8275d35d 1627 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1628 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1629 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1630 * @param[in] *pState points to the array for storing intermediate results
<> 135:176b8275d35d 1631 * @return The function returns either
<> 135:176b8275d35d 1632 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1633 */
<> 135:176b8275d35d 1634
<> 135:176b8275d35d 1635 arm_status arm_mat_mult_q15(
<> 135:176b8275d35d 1636 const arm_matrix_instance_q15 * pSrcA,
<> 135:176b8275d35d 1637 const arm_matrix_instance_q15 * pSrcB,
<> 135:176b8275d35d 1638 arm_matrix_instance_q15 * pDst,
<> 135:176b8275d35d 1639 q15_t * pState);
<> 135:176b8275d35d 1640
<> 135:176b8275d35d 1641 /**
<> 135:176b8275d35d 1642 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 1643 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1644 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1645 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1646 * @param[in] *pState points to the array for storing intermediate results
<> 135:176b8275d35d 1647 * @return The function returns either
<> 135:176b8275d35d 1648 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1649 */
<> 135:176b8275d35d 1650
<> 135:176b8275d35d 1651 arm_status arm_mat_mult_fast_q15(
<> 135:176b8275d35d 1652 const arm_matrix_instance_q15 * pSrcA,
<> 135:176b8275d35d 1653 const arm_matrix_instance_q15 * pSrcB,
<> 135:176b8275d35d 1654 arm_matrix_instance_q15 * pDst,
<> 135:176b8275d35d 1655 q15_t * pState);
<> 135:176b8275d35d 1656
<> 135:176b8275d35d 1657 /**
<> 135:176b8275d35d 1658 * @brief Q31 matrix multiplication
<> 135:176b8275d35d 1659 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1660 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1661 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1662 * @return The function returns either
<> 135:176b8275d35d 1663 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1664 */
<> 135:176b8275d35d 1665
<> 135:176b8275d35d 1666 arm_status arm_mat_mult_q31(
<> 135:176b8275d35d 1667 const arm_matrix_instance_q31 * pSrcA,
<> 135:176b8275d35d 1668 const arm_matrix_instance_q31 * pSrcB,
<> 135:176b8275d35d 1669 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1670
<> 135:176b8275d35d 1671 /**
<> 135:176b8275d35d 1672 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 1673 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1674 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1675 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1676 * @return The function returns either
<> 135:176b8275d35d 1677 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1678 */
<> 135:176b8275d35d 1679
<> 135:176b8275d35d 1680 arm_status arm_mat_mult_fast_q31(
<> 135:176b8275d35d 1681 const arm_matrix_instance_q31 * pSrcA,
<> 135:176b8275d35d 1682 const arm_matrix_instance_q31 * pSrcB,
<> 135:176b8275d35d 1683 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1684
<> 135:176b8275d35d 1685
<> 135:176b8275d35d 1686 /**
<> 135:176b8275d35d 1687 * @brief Floating-point matrix subtraction
<> 135:176b8275d35d 1688 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1689 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1690 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1691 * @return The function returns either
<> 135:176b8275d35d 1692 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1693 */
<> 135:176b8275d35d 1694
<> 135:176b8275d35d 1695 arm_status arm_mat_sub_f32(
<> 135:176b8275d35d 1696 const arm_matrix_instance_f32 * pSrcA,
<> 135:176b8275d35d 1697 const arm_matrix_instance_f32 * pSrcB,
<> 135:176b8275d35d 1698 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1699
<> 135:176b8275d35d 1700 /**
<> 135:176b8275d35d 1701 * @brief Q15 matrix subtraction
<> 135:176b8275d35d 1702 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1703 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1704 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1705 * @return The function returns either
<> 135:176b8275d35d 1706 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1707 */
<> 135:176b8275d35d 1708
<> 135:176b8275d35d 1709 arm_status arm_mat_sub_q15(
<> 135:176b8275d35d 1710 const arm_matrix_instance_q15 * pSrcA,
<> 135:176b8275d35d 1711 const arm_matrix_instance_q15 * pSrcB,
<> 135:176b8275d35d 1712 arm_matrix_instance_q15 * pDst);
<> 135:176b8275d35d 1713
<> 135:176b8275d35d 1714 /**
<> 135:176b8275d35d 1715 * @brief Q31 matrix subtraction
<> 135:176b8275d35d 1716 * @param[in] *pSrcA points to the first input matrix structure
<> 135:176b8275d35d 1717 * @param[in] *pSrcB points to the second input matrix structure
<> 135:176b8275d35d 1718 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1719 * @return The function returns either
<> 135:176b8275d35d 1720 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1721 */
<> 135:176b8275d35d 1722
<> 135:176b8275d35d 1723 arm_status arm_mat_sub_q31(
<> 135:176b8275d35d 1724 const arm_matrix_instance_q31 * pSrcA,
<> 135:176b8275d35d 1725 const arm_matrix_instance_q31 * pSrcB,
<> 135:176b8275d35d 1726 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1727
<> 135:176b8275d35d 1728 /**
<> 135:176b8275d35d 1729 * @brief Floating-point matrix scaling.
<> 135:176b8275d35d 1730 * @param[in] *pSrc points to the input matrix
<> 135:176b8275d35d 1731 * @param[in] scale scale factor
<> 135:176b8275d35d 1732 * @param[out] *pDst points to the output matrix
<> 135:176b8275d35d 1733 * @return The function returns either
<> 135:176b8275d35d 1734 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1735 */
<> 135:176b8275d35d 1736
<> 135:176b8275d35d 1737 arm_status arm_mat_scale_f32(
<> 135:176b8275d35d 1738 const arm_matrix_instance_f32 * pSrc,
<> 135:176b8275d35d 1739 float32_t scale,
<> 135:176b8275d35d 1740 arm_matrix_instance_f32 * pDst);
<> 135:176b8275d35d 1741
<> 135:176b8275d35d 1742 /**
<> 135:176b8275d35d 1743 * @brief Q15 matrix scaling.
<> 135:176b8275d35d 1744 * @param[in] *pSrc points to input matrix
<> 135:176b8275d35d 1745 * @param[in] scaleFract fractional portion of the scale factor
<> 135:176b8275d35d 1746 * @param[in] shift number of bits to shift the result by
<> 135:176b8275d35d 1747 * @param[out] *pDst points to output matrix
<> 135:176b8275d35d 1748 * @return The function returns either
<> 135:176b8275d35d 1749 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1750 */
<> 135:176b8275d35d 1751
<> 135:176b8275d35d 1752 arm_status arm_mat_scale_q15(
<> 135:176b8275d35d 1753 const arm_matrix_instance_q15 * pSrc,
<> 135:176b8275d35d 1754 q15_t scaleFract,
<> 135:176b8275d35d 1755 int32_t shift,
<> 135:176b8275d35d 1756 arm_matrix_instance_q15 * pDst);
<> 135:176b8275d35d 1757
<> 135:176b8275d35d 1758 /**
<> 135:176b8275d35d 1759 * @brief Q31 matrix scaling.
<> 135:176b8275d35d 1760 * @param[in] *pSrc points to input matrix
<> 135:176b8275d35d 1761 * @param[in] scaleFract fractional portion of the scale factor
<> 135:176b8275d35d 1762 * @param[in] shift number of bits to shift the result by
<> 135:176b8275d35d 1763 * @param[out] *pDst points to output matrix structure
<> 135:176b8275d35d 1764 * @return The function returns either
<> 135:176b8275d35d 1765 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 135:176b8275d35d 1766 */
<> 135:176b8275d35d 1767
<> 135:176b8275d35d 1768 arm_status arm_mat_scale_q31(
<> 135:176b8275d35d 1769 const arm_matrix_instance_q31 * pSrc,
<> 135:176b8275d35d 1770 q31_t scaleFract,
<> 135:176b8275d35d 1771 int32_t shift,
<> 135:176b8275d35d 1772 arm_matrix_instance_q31 * pDst);
<> 135:176b8275d35d 1773
<> 135:176b8275d35d 1774
<> 135:176b8275d35d 1775 /**
<> 135:176b8275d35d 1776 * @brief Q31 matrix initialization.
<> 135:176b8275d35d 1777 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 135:176b8275d35d 1778 * @param[in] nRows number of rows in the matrix.
<> 135:176b8275d35d 1779 * @param[in] nColumns number of columns in the matrix.
<> 135:176b8275d35d 1780 * @param[in] *pData points to the matrix data array.
<> 135:176b8275d35d 1781 * @return none
<> 135:176b8275d35d 1782 */
<> 135:176b8275d35d 1783
<> 135:176b8275d35d 1784 void arm_mat_init_q31(
<> 135:176b8275d35d 1785 arm_matrix_instance_q31 * S,
<> 135:176b8275d35d 1786 uint16_t nRows,
<> 135:176b8275d35d 1787 uint16_t nColumns,
<> 135:176b8275d35d 1788 q31_t * pData);
<> 135:176b8275d35d 1789
<> 135:176b8275d35d 1790 /**
<> 135:176b8275d35d 1791 * @brief Q15 matrix initialization.
<> 135:176b8275d35d 1792 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 135:176b8275d35d 1793 * @param[in] nRows number of rows in the matrix.
<> 135:176b8275d35d 1794 * @param[in] nColumns number of columns in the matrix.
<> 135:176b8275d35d 1795 * @param[in] *pData points to the matrix data array.
<> 135:176b8275d35d 1796 * @return none
<> 135:176b8275d35d 1797 */
<> 135:176b8275d35d 1798
<> 135:176b8275d35d 1799 void arm_mat_init_q15(
<> 135:176b8275d35d 1800 arm_matrix_instance_q15 * S,
<> 135:176b8275d35d 1801 uint16_t nRows,
<> 135:176b8275d35d 1802 uint16_t nColumns,
<> 135:176b8275d35d 1803 q15_t * pData);
<> 135:176b8275d35d 1804
<> 135:176b8275d35d 1805 /**
<> 135:176b8275d35d 1806 * @brief Floating-point matrix initialization.
<> 135:176b8275d35d 1807 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 135:176b8275d35d 1808 * @param[in] nRows number of rows in the matrix.
<> 135:176b8275d35d 1809 * @param[in] nColumns number of columns in the matrix.
<> 135:176b8275d35d 1810 * @param[in] *pData points to the matrix data array.
<> 135:176b8275d35d 1811 * @return none
<> 135:176b8275d35d 1812 */
<> 135:176b8275d35d 1813
<> 135:176b8275d35d 1814 void arm_mat_init_f32(
<> 135:176b8275d35d 1815 arm_matrix_instance_f32 * S,
<> 135:176b8275d35d 1816 uint16_t nRows,
<> 135:176b8275d35d 1817 uint16_t nColumns,
<> 135:176b8275d35d 1818 float32_t * pData);
<> 135:176b8275d35d 1819
<> 135:176b8275d35d 1820
<> 135:176b8275d35d 1821
<> 135:176b8275d35d 1822 /**
<> 135:176b8275d35d 1823 * @brief Instance structure for the Q15 PID Control.
<> 135:176b8275d35d 1824 */
<> 135:176b8275d35d 1825 typedef struct
<> 135:176b8275d35d 1826 {
<> 135:176b8275d35d 1827 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 135:176b8275d35d 1828 #ifdef ARM_MATH_CM0_FAMILY
<> 135:176b8275d35d 1829 q15_t A1;
<> 135:176b8275d35d 1830 q15_t A2;
<> 135:176b8275d35d 1831 #else
<> 135:176b8275d35d 1832 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
<> 135:176b8275d35d 1833 #endif
<> 135:176b8275d35d 1834 q15_t state[3]; /**< The state array of length 3. */
<> 135:176b8275d35d 1835 q15_t Kp; /**< The proportional gain. */
<> 135:176b8275d35d 1836 q15_t Ki; /**< The integral gain. */
<> 135:176b8275d35d 1837 q15_t Kd; /**< The derivative gain. */
<> 135:176b8275d35d 1838 } arm_pid_instance_q15;
<> 135:176b8275d35d 1839
<> 135:176b8275d35d 1840 /**
<> 135:176b8275d35d 1841 * @brief Instance structure for the Q31 PID Control.
<> 135:176b8275d35d 1842 */
<> 135:176b8275d35d 1843 typedef struct
<> 135:176b8275d35d 1844 {
<> 135:176b8275d35d 1845 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 135:176b8275d35d 1846 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 135:176b8275d35d 1847 q31_t A2; /**< The derived gain, A2 = Kd . */
<> 135:176b8275d35d 1848 q31_t state[3]; /**< The state array of length 3. */
<> 135:176b8275d35d 1849 q31_t Kp; /**< The proportional gain. */
<> 135:176b8275d35d 1850 q31_t Ki; /**< The integral gain. */
<> 135:176b8275d35d 1851 q31_t Kd; /**< The derivative gain. */
<> 135:176b8275d35d 1852
<> 135:176b8275d35d 1853 } arm_pid_instance_q31;
<> 135:176b8275d35d 1854
<> 135:176b8275d35d 1855 /**
<> 135:176b8275d35d 1856 * @brief Instance structure for the floating-point PID Control.
<> 135:176b8275d35d 1857 */
<> 135:176b8275d35d 1858 typedef struct
<> 135:176b8275d35d 1859 {
<> 135:176b8275d35d 1860 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 135:176b8275d35d 1861 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 135:176b8275d35d 1862 float32_t A2; /**< The derived gain, A2 = Kd . */
<> 135:176b8275d35d 1863 float32_t state[3]; /**< The state array of length 3. */
<> 135:176b8275d35d 1864 float32_t Kp; /**< The proportional gain. */
<> 135:176b8275d35d 1865 float32_t Ki; /**< The integral gain. */
<> 135:176b8275d35d 1866 float32_t Kd; /**< The derivative gain. */
<> 135:176b8275d35d 1867 } arm_pid_instance_f32;
<> 135:176b8275d35d 1868
<> 135:176b8275d35d 1869
<> 135:176b8275d35d 1870
<> 135:176b8275d35d 1871 /**
<> 135:176b8275d35d 1872 * @brief Initialization function for the floating-point PID Control.
<> 135:176b8275d35d 1873 * @param[in,out] *S points to an instance of the PID structure.
<> 135:176b8275d35d 1874 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 135:176b8275d35d 1875 * @return none.
<> 135:176b8275d35d 1876 */
<> 135:176b8275d35d 1877 void arm_pid_init_f32(
<> 135:176b8275d35d 1878 arm_pid_instance_f32 * S,
<> 135:176b8275d35d 1879 int32_t resetStateFlag);
<> 135:176b8275d35d 1880
<> 135:176b8275d35d 1881 /**
<> 135:176b8275d35d 1882 * @brief Reset function for the floating-point PID Control.
<> 135:176b8275d35d 1883 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 135:176b8275d35d 1884 * @return none
<> 135:176b8275d35d 1885 */
<> 135:176b8275d35d 1886 void arm_pid_reset_f32(
<> 135:176b8275d35d 1887 arm_pid_instance_f32 * S);
<> 135:176b8275d35d 1888
<> 135:176b8275d35d 1889
<> 135:176b8275d35d 1890 /**
<> 135:176b8275d35d 1891 * @brief Initialization function for the Q31 PID Control.
<> 135:176b8275d35d 1892 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 135:176b8275d35d 1893 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 135:176b8275d35d 1894 * @return none.
<> 135:176b8275d35d 1895 */
<> 135:176b8275d35d 1896 void arm_pid_init_q31(
<> 135:176b8275d35d 1897 arm_pid_instance_q31 * S,
<> 135:176b8275d35d 1898 int32_t resetStateFlag);
<> 135:176b8275d35d 1899
<> 135:176b8275d35d 1900
<> 135:176b8275d35d 1901 /**
<> 135:176b8275d35d 1902 * @brief Reset function for the Q31 PID Control.
<> 135:176b8275d35d 1903 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 135:176b8275d35d 1904 * @return none
<> 135:176b8275d35d 1905 */
<> 135:176b8275d35d 1906
<> 135:176b8275d35d 1907 void arm_pid_reset_q31(
<> 135:176b8275d35d 1908 arm_pid_instance_q31 * S);
<> 135:176b8275d35d 1909
<> 135:176b8275d35d 1910 /**
<> 135:176b8275d35d 1911 * @brief Initialization function for the Q15 PID Control.
<> 135:176b8275d35d 1912 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 135:176b8275d35d 1913 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 135:176b8275d35d 1914 * @return none.
<> 135:176b8275d35d 1915 */
<> 135:176b8275d35d 1916 void arm_pid_init_q15(
<> 135:176b8275d35d 1917 arm_pid_instance_q15 * S,
<> 135:176b8275d35d 1918 int32_t resetStateFlag);
<> 135:176b8275d35d 1919
<> 135:176b8275d35d 1920 /**
<> 135:176b8275d35d 1921 * @brief Reset function for the Q15 PID Control.
<> 135:176b8275d35d 1922 * @param[in,out] *S points to an instance of the q15 PID Control structure
<> 135:176b8275d35d 1923 * @return none
<> 135:176b8275d35d 1924 */
<> 135:176b8275d35d 1925 void arm_pid_reset_q15(
<> 135:176b8275d35d 1926 arm_pid_instance_q15 * S);
<> 135:176b8275d35d 1927
<> 135:176b8275d35d 1928
<> 135:176b8275d35d 1929 /**
<> 135:176b8275d35d 1930 * @brief Instance structure for the floating-point Linear Interpolate function.
<> 135:176b8275d35d 1931 */
<> 135:176b8275d35d 1932 typedef struct
<> 135:176b8275d35d 1933 {
<> 135:176b8275d35d 1934 uint32_t nValues; /**< nValues */
<> 135:176b8275d35d 1935 float32_t x1; /**< x1 */
<> 135:176b8275d35d 1936 float32_t xSpacing; /**< xSpacing */
<> 135:176b8275d35d 1937 float32_t *pYData; /**< pointer to the table of Y values */
<> 135:176b8275d35d 1938 } arm_linear_interp_instance_f32;
<> 135:176b8275d35d 1939
<> 135:176b8275d35d 1940 /**
<> 135:176b8275d35d 1941 * @brief Instance structure for the floating-point bilinear interpolation function.
<> 135:176b8275d35d 1942 */
<> 135:176b8275d35d 1943
<> 135:176b8275d35d 1944 typedef struct
<> 135:176b8275d35d 1945 {
<> 135:176b8275d35d 1946 uint16_t numRows; /**< number of rows in the data table. */
<> 135:176b8275d35d 1947 uint16_t numCols; /**< number of columns in the data table. */
<> 135:176b8275d35d 1948 float32_t *pData; /**< points to the data table. */
<> 135:176b8275d35d 1949 } arm_bilinear_interp_instance_f32;
<> 135:176b8275d35d 1950
<> 135:176b8275d35d 1951 /**
<> 135:176b8275d35d 1952 * @brief Instance structure for the Q31 bilinear interpolation function.
<> 135:176b8275d35d 1953 */
<> 135:176b8275d35d 1954
<> 135:176b8275d35d 1955 typedef struct
<> 135:176b8275d35d 1956 {
<> 135:176b8275d35d 1957 uint16_t numRows; /**< number of rows in the data table. */
<> 135:176b8275d35d 1958 uint16_t numCols; /**< number of columns in the data table. */
<> 135:176b8275d35d 1959 q31_t *pData; /**< points to the data table. */
<> 135:176b8275d35d 1960 } arm_bilinear_interp_instance_q31;
<> 135:176b8275d35d 1961
<> 135:176b8275d35d 1962 /**
<> 135:176b8275d35d 1963 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 135:176b8275d35d 1964 */
<> 135:176b8275d35d 1965
<> 135:176b8275d35d 1966 typedef struct
<> 135:176b8275d35d 1967 {
<> 135:176b8275d35d 1968 uint16_t numRows; /**< number of rows in the data table. */
<> 135:176b8275d35d 1969 uint16_t numCols; /**< number of columns in the data table. */
<> 135:176b8275d35d 1970 q15_t *pData; /**< points to the data table. */
<> 135:176b8275d35d 1971 } arm_bilinear_interp_instance_q15;
<> 135:176b8275d35d 1972
<> 135:176b8275d35d 1973 /**
<> 135:176b8275d35d 1974 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 135:176b8275d35d 1975 */
<> 135:176b8275d35d 1976
<> 135:176b8275d35d 1977 typedef struct
<> 135:176b8275d35d 1978 {
<> 135:176b8275d35d 1979 uint16_t numRows; /**< number of rows in the data table. */
<> 135:176b8275d35d 1980 uint16_t numCols; /**< number of columns in the data table. */
<> 135:176b8275d35d 1981 q7_t *pData; /**< points to the data table. */
<> 135:176b8275d35d 1982 } arm_bilinear_interp_instance_q7;
<> 135:176b8275d35d 1983
<> 135:176b8275d35d 1984
<> 135:176b8275d35d 1985 /**
<> 135:176b8275d35d 1986 * @brief Q7 vector multiplication.
<> 135:176b8275d35d 1987 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 1988 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 1989 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 1990 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 1991 * @return none.
<> 135:176b8275d35d 1992 */
<> 135:176b8275d35d 1993
<> 135:176b8275d35d 1994 void arm_mult_q7(
<> 135:176b8275d35d 1995 q7_t * pSrcA,
<> 135:176b8275d35d 1996 q7_t * pSrcB,
<> 135:176b8275d35d 1997 q7_t * pDst,
<> 135:176b8275d35d 1998 uint32_t blockSize);
<> 135:176b8275d35d 1999
<> 135:176b8275d35d 2000 /**
<> 135:176b8275d35d 2001 * @brief Q15 vector multiplication.
<> 135:176b8275d35d 2002 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2003 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2004 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2005 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2006 * @return none.
<> 135:176b8275d35d 2007 */
<> 135:176b8275d35d 2008
<> 135:176b8275d35d 2009 void arm_mult_q15(
<> 135:176b8275d35d 2010 q15_t * pSrcA,
<> 135:176b8275d35d 2011 q15_t * pSrcB,
<> 135:176b8275d35d 2012 q15_t * pDst,
<> 135:176b8275d35d 2013 uint32_t blockSize);
<> 135:176b8275d35d 2014
<> 135:176b8275d35d 2015 /**
<> 135:176b8275d35d 2016 * @brief Q31 vector multiplication.
<> 135:176b8275d35d 2017 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2018 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2019 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2020 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2021 * @return none.
<> 135:176b8275d35d 2022 */
<> 135:176b8275d35d 2023
<> 135:176b8275d35d 2024 void arm_mult_q31(
<> 135:176b8275d35d 2025 q31_t * pSrcA,
<> 135:176b8275d35d 2026 q31_t * pSrcB,
<> 135:176b8275d35d 2027 q31_t * pDst,
<> 135:176b8275d35d 2028 uint32_t blockSize);
<> 135:176b8275d35d 2029
<> 135:176b8275d35d 2030 /**
<> 135:176b8275d35d 2031 * @brief Floating-point vector multiplication.
<> 135:176b8275d35d 2032 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2033 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2034 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2035 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2036 * @return none.
<> 135:176b8275d35d 2037 */
<> 135:176b8275d35d 2038
<> 135:176b8275d35d 2039 void arm_mult_f32(
<> 135:176b8275d35d 2040 float32_t * pSrcA,
<> 135:176b8275d35d 2041 float32_t * pSrcB,
<> 135:176b8275d35d 2042 float32_t * pDst,
<> 135:176b8275d35d 2043 uint32_t blockSize);
<> 135:176b8275d35d 2044
<> 135:176b8275d35d 2045
<> 135:176b8275d35d 2046
<> 135:176b8275d35d 2047
<> 135:176b8275d35d 2048
<> 135:176b8275d35d 2049
<> 135:176b8275d35d 2050 /**
<> 135:176b8275d35d 2051 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 135:176b8275d35d 2052 */
<> 135:176b8275d35d 2053
<> 135:176b8275d35d 2054 typedef struct
<> 135:176b8275d35d 2055 {
<> 135:176b8275d35d 2056 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2057 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2058 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2059 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
<> 135:176b8275d35d 2060 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2061 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2062 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2063 } arm_cfft_radix2_instance_q15;
<> 135:176b8275d35d 2064
<> 135:176b8275d35d 2065 /* Deprecated */
<> 135:176b8275d35d 2066 arm_status arm_cfft_radix2_init_q15(
<> 135:176b8275d35d 2067 arm_cfft_radix2_instance_q15 * S,
<> 135:176b8275d35d 2068 uint16_t fftLen,
<> 135:176b8275d35d 2069 uint8_t ifftFlag,
<> 135:176b8275d35d 2070 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2071
<> 135:176b8275d35d 2072 /* Deprecated */
<> 135:176b8275d35d 2073 void arm_cfft_radix2_q15(
<> 135:176b8275d35d 2074 const arm_cfft_radix2_instance_q15 * S,
<> 135:176b8275d35d 2075 q15_t * pSrc);
<> 135:176b8275d35d 2076
<> 135:176b8275d35d 2077
<> 135:176b8275d35d 2078
<> 135:176b8275d35d 2079 /**
<> 135:176b8275d35d 2080 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 135:176b8275d35d 2081 */
<> 135:176b8275d35d 2082
<> 135:176b8275d35d 2083 typedef struct
<> 135:176b8275d35d 2084 {
<> 135:176b8275d35d 2085 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2086 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2087 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2088 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 135:176b8275d35d 2089 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2090 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2091 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2092 } arm_cfft_radix4_instance_q15;
<> 135:176b8275d35d 2093
<> 135:176b8275d35d 2094 /* Deprecated */
<> 135:176b8275d35d 2095 arm_status arm_cfft_radix4_init_q15(
<> 135:176b8275d35d 2096 arm_cfft_radix4_instance_q15 * S,
<> 135:176b8275d35d 2097 uint16_t fftLen,
<> 135:176b8275d35d 2098 uint8_t ifftFlag,
<> 135:176b8275d35d 2099 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2100
<> 135:176b8275d35d 2101 /* Deprecated */
<> 135:176b8275d35d 2102 void arm_cfft_radix4_q15(
<> 135:176b8275d35d 2103 const arm_cfft_radix4_instance_q15 * S,
<> 135:176b8275d35d 2104 q15_t * pSrc);
<> 135:176b8275d35d 2105
<> 135:176b8275d35d 2106 /**
<> 135:176b8275d35d 2107 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
<> 135:176b8275d35d 2108 */
<> 135:176b8275d35d 2109
<> 135:176b8275d35d 2110 typedef struct
<> 135:176b8275d35d 2111 {
<> 135:176b8275d35d 2112 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2113 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2114 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2115 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2116 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2117 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2118 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2119 } arm_cfft_radix2_instance_q31;
<> 135:176b8275d35d 2120
<> 135:176b8275d35d 2121 /* Deprecated */
<> 135:176b8275d35d 2122 arm_status arm_cfft_radix2_init_q31(
<> 135:176b8275d35d 2123 arm_cfft_radix2_instance_q31 * S,
<> 135:176b8275d35d 2124 uint16_t fftLen,
<> 135:176b8275d35d 2125 uint8_t ifftFlag,
<> 135:176b8275d35d 2126 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2127
<> 135:176b8275d35d 2128 /* Deprecated */
<> 135:176b8275d35d 2129 void arm_cfft_radix2_q31(
<> 135:176b8275d35d 2130 const arm_cfft_radix2_instance_q31 * S,
<> 135:176b8275d35d 2131 q31_t * pSrc);
<> 135:176b8275d35d 2132
<> 135:176b8275d35d 2133 /**
<> 135:176b8275d35d 2134 * @brief Instance structure for the Q31 CFFT/CIFFT function.
<> 135:176b8275d35d 2135 */
<> 135:176b8275d35d 2136
<> 135:176b8275d35d 2137 typedef struct
<> 135:176b8275d35d 2138 {
<> 135:176b8275d35d 2139 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2140 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2141 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2142 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 135:176b8275d35d 2143 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2144 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2145 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2146 } arm_cfft_radix4_instance_q31;
<> 135:176b8275d35d 2147
<> 135:176b8275d35d 2148 /* Deprecated */
<> 135:176b8275d35d 2149 void arm_cfft_radix4_q31(
<> 135:176b8275d35d 2150 const arm_cfft_radix4_instance_q31 * S,
<> 135:176b8275d35d 2151 q31_t * pSrc);
<> 135:176b8275d35d 2152
<> 135:176b8275d35d 2153 /* Deprecated */
<> 135:176b8275d35d 2154 arm_status arm_cfft_radix4_init_q31(
<> 135:176b8275d35d 2155 arm_cfft_radix4_instance_q31 * S,
<> 135:176b8275d35d 2156 uint16_t fftLen,
<> 135:176b8275d35d 2157 uint8_t ifftFlag,
<> 135:176b8275d35d 2158 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2159
<> 135:176b8275d35d 2160 /**
<> 135:176b8275d35d 2161 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 135:176b8275d35d 2162 */
<> 135:176b8275d35d 2163
<> 135:176b8275d35d 2164 typedef struct
<> 135:176b8275d35d 2165 {
<> 135:176b8275d35d 2166 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2167 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2168 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2169 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2170 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2171 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2172 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2173 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 135:176b8275d35d 2174 } arm_cfft_radix2_instance_f32;
<> 135:176b8275d35d 2175
<> 135:176b8275d35d 2176 /* Deprecated */
<> 135:176b8275d35d 2177 arm_status arm_cfft_radix2_init_f32(
<> 135:176b8275d35d 2178 arm_cfft_radix2_instance_f32 * S,
<> 135:176b8275d35d 2179 uint16_t fftLen,
<> 135:176b8275d35d 2180 uint8_t ifftFlag,
<> 135:176b8275d35d 2181 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2182
<> 135:176b8275d35d 2183 /* Deprecated */
<> 135:176b8275d35d 2184 void arm_cfft_radix2_f32(
<> 135:176b8275d35d 2185 const arm_cfft_radix2_instance_f32 * S,
<> 135:176b8275d35d 2186 float32_t * pSrc);
<> 135:176b8275d35d 2187
<> 135:176b8275d35d 2188 /**
<> 135:176b8275d35d 2189 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 135:176b8275d35d 2190 */
<> 135:176b8275d35d 2191
<> 135:176b8275d35d 2192 typedef struct
<> 135:176b8275d35d 2193 {
<> 135:176b8275d35d 2194 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2195 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 135:176b8275d35d 2196 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 135:176b8275d35d 2197 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2198 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2199 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2200 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 135:176b8275d35d 2201 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 135:176b8275d35d 2202 } arm_cfft_radix4_instance_f32;
<> 135:176b8275d35d 2203
<> 135:176b8275d35d 2204 /* Deprecated */
<> 135:176b8275d35d 2205 arm_status arm_cfft_radix4_init_f32(
<> 135:176b8275d35d 2206 arm_cfft_radix4_instance_f32 * S,
<> 135:176b8275d35d 2207 uint16_t fftLen,
<> 135:176b8275d35d 2208 uint8_t ifftFlag,
<> 135:176b8275d35d 2209 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2210
<> 135:176b8275d35d 2211 /* Deprecated */
<> 135:176b8275d35d 2212 void arm_cfft_radix4_f32(
<> 135:176b8275d35d 2213 const arm_cfft_radix4_instance_f32 * S,
<> 135:176b8275d35d 2214 float32_t * pSrc);
<> 135:176b8275d35d 2215
<> 135:176b8275d35d 2216 /**
<> 135:176b8275d35d 2217 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 135:176b8275d35d 2218 */
<> 135:176b8275d35d 2219
<> 135:176b8275d35d 2220 typedef struct
<> 135:176b8275d35d 2221 {
<> 135:176b8275d35d 2222 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2223 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2224 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2225 uint16_t bitRevLength; /**< bit reversal table length. */
<> 135:176b8275d35d 2226 } arm_cfft_instance_q15;
<> 135:176b8275d35d 2227
<> 135:176b8275d35d 2228 void arm_cfft_q15(
<> 135:176b8275d35d 2229 const arm_cfft_instance_q15 * S,
<> 135:176b8275d35d 2230 q15_t * p1,
<> 135:176b8275d35d 2231 uint8_t ifftFlag,
<> 135:176b8275d35d 2232 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2233
<> 135:176b8275d35d 2234 /**
<> 135:176b8275d35d 2235 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 135:176b8275d35d 2236 */
<> 135:176b8275d35d 2237
<> 135:176b8275d35d 2238 typedef struct
<> 135:176b8275d35d 2239 {
<> 135:176b8275d35d 2240 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2241 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2242 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2243 uint16_t bitRevLength; /**< bit reversal table length. */
<> 135:176b8275d35d 2244 } arm_cfft_instance_q31;
<> 135:176b8275d35d 2245
<> 135:176b8275d35d 2246 void arm_cfft_q31(
<> 135:176b8275d35d 2247 const arm_cfft_instance_q31 * S,
<> 135:176b8275d35d 2248 q31_t * p1,
<> 135:176b8275d35d 2249 uint8_t ifftFlag,
<> 135:176b8275d35d 2250 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2251
<> 135:176b8275d35d 2252 /**
<> 135:176b8275d35d 2253 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 135:176b8275d35d 2254 */
<> 135:176b8275d35d 2255
<> 135:176b8275d35d 2256 typedef struct
<> 135:176b8275d35d 2257 {
<> 135:176b8275d35d 2258 uint16_t fftLen; /**< length of the FFT. */
<> 135:176b8275d35d 2259 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 135:176b8275d35d 2260 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 135:176b8275d35d 2261 uint16_t bitRevLength; /**< bit reversal table length. */
<> 135:176b8275d35d 2262 } arm_cfft_instance_f32;
<> 135:176b8275d35d 2263
<> 135:176b8275d35d 2264 void arm_cfft_f32(
<> 135:176b8275d35d 2265 const arm_cfft_instance_f32 * S,
<> 135:176b8275d35d 2266 float32_t * p1,
<> 135:176b8275d35d 2267 uint8_t ifftFlag,
<> 135:176b8275d35d 2268 uint8_t bitReverseFlag);
<> 135:176b8275d35d 2269
<> 135:176b8275d35d 2270 /**
<> 135:176b8275d35d 2271 * @brief Instance structure for the Q15 RFFT/RIFFT function.
<> 135:176b8275d35d 2272 */
<> 135:176b8275d35d 2273
<> 135:176b8275d35d 2274 typedef struct
<> 135:176b8275d35d 2275 {
<> 135:176b8275d35d 2276 uint32_t fftLenReal; /**< length of the real FFT. */
<> 135:176b8275d35d 2277 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 135:176b8275d35d 2278 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 135:176b8275d35d 2279 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2280 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 135:176b8275d35d 2281 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 135:176b8275d35d 2282 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2283 } arm_rfft_instance_q15;
<> 135:176b8275d35d 2284
<> 135:176b8275d35d 2285 arm_status arm_rfft_init_q15(
<> 135:176b8275d35d 2286 arm_rfft_instance_q15 * S,
<> 135:176b8275d35d 2287 uint32_t fftLenReal,
<> 135:176b8275d35d 2288 uint32_t ifftFlagR,
<> 135:176b8275d35d 2289 uint32_t bitReverseFlag);
<> 135:176b8275d35d 2290
<> 135:176b8275d35d 2291 void arm_rfft_q15(
<> 135:176b8275d35d 2292 const arm_rfft_instance_q15 * S,
<> 135:176b8275d35d 2293 q15_t * pSrc,
<> 135:176b8275d35d 2294 q15_t * pDst);
<> 135:176b8275d35d 2295
<> 135:176b8275d35d 2296 /**
<> 135:176b8275d35d 2297 * @brief Instance structure for the Q31 RFFT/RIFFT function.
<> 135:176b8275d35d 2298 */
<> 135:176b8275d35d 2299
<> 135:176b8275d35d 2300 typedef struct
<> 135:176b8275d35d 2301 {
<> 135:176b8275d35d 2302 uint32_t fftLenReal; /**< length of the real FFT. */
<> 135:176b8275d35d 2303 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 135:176b8275d35d 2304 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 135:176b8275d35d 2305 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2306 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 135:176b8275d35d 2307 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 135:176b8275d35d 2308 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2309 } arm_rfft_instance_q31;
<> 135:176b8275d35d 2310
<> 135:176b8275d35d 2311 arm_status arm_rfft_init_q31(
<> 135:176b8275d35d 2312 arm_rfft_instance_q31 * S,
<> 135:176b8275d35d 2313 uint32_t fftLenReal,
<> 135:176b8275d35d 2314 uint32_t ifftFlagR,
<> 135:176b8275d35d 2315 uint32_t bitReverseFlag);
<> 135:176b8275d35d 2316
<> 135:176b8275d35d 2317 void arm_rfft_q31(
<> 135:176b8275d35d 2318 const arm_rfft_instance_q31 * S,
<> 135:176b8275d35d 2319 q31_t * pSrc,
<> 135:176b8275d35d 2320 q31_t * pDst);
<> 135:176b8275d35d 2321
<> 135:176b8275d35d 2322 /**
<> 135:176b8275d35d 2323 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 135:176b8275d35d 2324 */
<> 135:176b8275d35d 2325
<> 135:176b8275d35d 2326 typedef struct
<> 135:176b8275d35d 2327 {
<> 135:176b8275d35d 2328 uint32_t fftLenReal; /**< length of the real FFT. */
<> 135:176b8275d35d 2329 uint16_t fftLenBy2; /**< length of the complex FFT. */
<> 135:176b8275d35d 2330 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 135:176b8275d35d 2331 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 135:176b8275d35d 2332 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 135:176b8275d35d 2333 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 135:176b8275d35d 2334 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 135:176b8275d35d 2335 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2336 } arm_rfft_instance_f32;
<> 135:176b8275d35d 2337
<> 135:176b8275d35d 2338 arm_status arm_rfft_init_f32(
<> 135:176b8275d35d 2339 arm_rfft_instance_f32 * S,
<> 135:176b8275d35d 2340 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 135:176b8275d35d 2341 uint32_t fftLenReal,
<> 135:176b8275d35d 2342 uint32_t ifftFlagR,
<> 135:176b8275d35d 2343 uint32_t bitReverseFlag);
<> 135:176b8275d35d 2344
<> 135:176b8275d35d 2345 void arm_rfft_f32(
<> 135:176b8275d35d 2346 const arm_rfft_instance_f32 * S,
<> 135:176b8275d35d 2347 float32_t * pSrc,
<> 135:176b8275d35d 2348 float32_t * pDst);
<> 135:176b8275d35d 2349
<> 135:176b8275d35d 2350 /**
<> 135:176b8275d35d 2351 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 135:176b8275d35d 2352 */
<> 135:176b8275d35d 2353
<> 135:176b8275d35d 2354 typedef struct
<> 135:176b8275d35d 2355 {
<> 135:176b8275d35d 2356 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
<> 135:176b8275d35d 2357 uint16_t fftLenRFFT; /**< length of the real sequence */
<> 135:176b8275d35d 2358 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
<> 135:176b8275d35d 2359 } arm_rfft_fast_instance_f32 ;
<> 135:176b8275d35d 2360
<> 135:176b8275d35d 2361 arm_status arm_rfft_fast_init_f32 (
<> 135:176b8275d35d 2362 arm_rfft_fast_instance_f32 * S,
<> 135:176b8275d35d 2363 uint16_t fftLen);
<> 135:176b8275d35d 2364
<> 135:176b8275d35d 2365 void arm_rfft_fast_f32(
<> 135:176b8275d35d 2366 arm_rfft_fast_instance_f32 * S,
<> 135:176b8275d35d 2367 float32_t * p, float32_t * pOut,
<> 135:176b8275d35d 2368 uint8_t ifftFlag);
<> 135:176b8275d35d 2369
<> 135:176b8275d35d 2370 /**
<> 135:176b8275d35d 2371 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
<> 135:176b8275d35d 2372 */
<> 135:176b8275d35d 2373
<> 135:176b8275d35d 2374 typedef struct
<> 135:176b8275d35d 2375 {
<> 135:176b8275d35d 2376 uint16_t N; /**< length of the DCT4. */
<> 135:176b8275d35d 2377 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 135:176b8275d35d 2378 float32_t normalize; /**< normalizing factor. */
<> 135:176b8275d35d 2379 float32_t *pTwiddle; /**< points to the twiddle factor table. */
<> 135:176b8275d35d 2380 float32_t *pCosFactor; /**< points to the cosFactor table. */
<> 135:176b8275d35d 2381 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
<> 135:176b8275d35d 2382 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2383 } arm_dct4_instance_f32;
<> 135:176b8275d35d 2384
<> 135:176b8275d35d 2385 /**
<> 135:176b8275d35d 2386 * @brief Initialization function for the floating-point DCT4/IDCT4.
<> 135:176b8275d35d 2387 * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure.
<> 135:176b8275d35d 2388 * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
<> 135:176b8275d35d 2389 * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
<> 135:176b8275d35d 2390 * @param[in] N length of the DCT4.
<> 135:176b8275d35d 2391 * @param[in] Nby2 half of the length of the DCT4.
<> 135:176b8275d35d 2392 * @param[in] normalize normalizing factor.
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 2394 */
<> 135:176b8275d35d 2395
<> 135:176b8275d35d 2396 arm_status arm_dct4_init_f32(
<> 135:176b8275d35d 2397 arm_dct4_instance_f32 * S,
<> 135:176b8275d35d 2398 arm_rfft_instance_f32 * S_RFFT,
<> 135:176b8275d35d 2399 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 135:176b8275d35d 2400 uint16_t N,
<> 135:176b8275d35d 2401 uint16_t Nby2,
<> 135:176b8275d35d 2402 float32_t normalize);
<> 135:176b8275d35d 2403
<> 135:176b8275d35d 2404 /**
<> 135:176b8275d35d 2405 * @brief Processing function for the floating-point DCT4/IDCT4.
<> 135:176b8275d35d 2406 * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure.
<> 135:176b8275d35d 2407 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 2408 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 135:176b8275d35d 2409 * @return none.
<> 135:176b8275d35d 2410 */
<> 135:176b8275d35d 2411
<> 135:176b8275d35d 2412 void arm_dct4_f32(
<> 135:176b8275d35d 2413 const arm_dct4_instance_f32 * S,
<> 135:176b8275d35d 2414 float32_t * pState,
<> 135:176b8275d35d 2415 float32_t * pInlineBuffer);
<> 135:176b8275d35d 2416
<> 135:176b8275d35d 2417 /**
<> 135:176b8275d35d 2418 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
<> 135:176b8275d35d 2419 */
<> 135:176b8275d35d 2420
<> 135:176b8275d35d 2421 typedef struct
<> 135:176b8275d35d 2422 {
<> 135:176b8275d35d 2423 uint16_t N; /**< length of the DCT4. */
<> 135:176b8275d35d 2424 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 135:176b8275d35d 2425 q31_t normalize; /**< normalizing factor. */
<> 135:176b8275d35d 2426 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 135:176b8275d35d 2427 q31_t *pCosFactor; /**< points to the cosFactor table. */
<> 135:176b8275d35d 2428 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
<> 135:176b8275d35d 2429 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2430 } arm_dct4_instance_q31;
<> 135:176b8275d35d 2431
<> 135:176b8275d35d 2432 /**
<> 135:176b8275d35d 2433 * @brief Initialization function for the Q31 DCT4/IDCT4.
<> 135:176b8275d35d 2434 * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure.
<> 135:176b8275d35d 2435 * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure
<> 135:176b8275d35d 2436 * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure
<> 135:176b8275d35d 2437 * @param[in] N length of the DCT4.
<> 135:176b8275d35d 2438 * @param[in] Nby2 half of the length of the DCT4.
<> 135:176b8275d35d 2439 * @param[in] normalize normalizing factor.
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 2441 */
<> 135:176b8275d35d 2442
<> 135:176b8275d35d 2443 arm_status arm_dct4_init_q31(
<> 135:176b8275d35d 2444 arm_dct4_instance_q31 * S,
<> 135:176b8275d35d 2445 arm_rfft_instance_q31 * S_RFFT,
<> 135:176b8275d35d 2446 arm_cfft_radix4_instance_q31 * S_CFFT,
<> 135:176b8275d35d 2447 uint16_t N,
<> 135:176b8275d35d 2448 uint16_t Nby2,
<> 135:176b8275d35d 2449 q31_t normalize);
<> 135:176b8275d35d 2450
<> 135:176b8275d35d 2451 /**
<> 135:176b8275d35d 2452 * @brief Processing function for the Q31 DCT4/IDCT4.
<> 135:176b8275d35d 2453 * @param[in] *S points to an instance of the Q31 DCT4 structure.
<> 135:176b8275d35d 2454 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 2455 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 135:176b8275d35d 2456 * @return none.
<> 135:176b8275d35d 2457 */
<> 135:176b8275d35d 2458
<> 135:176b8275d35d 2459 void arm_dct4_q31(
<> 135:176b8275d35d 2460 const arm_dct4_instance_q31 * S,
<> 135:176b8275d35d 2461 q31_t * pState,
<> 135:176b8275d35d 2462 q31_t * pInlineBuffer);
<> 135:176b8275d35d 2463
<> 135:176b8275d35d 2464 /**
<> 135:176b8275d35d 2465 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
<> 135:176b8275d35d 2466 */
<> 135:176b8275d35d 2467
<> 135:176b8275d35d 2468 typedef struct
<> 135:176b8275d35d 2469 {
<> 135:176b8275d35d 2470 uint16_t N; /**< length of the DCT4. */
<> 135:176b8275d35d 2471 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 135:176b8275d35d 2472 q15_t normalize; /**< normalizing factor. */
<> 135:176b8275d35d 2473 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 135:176b8275d35d 2474 q15_t *pCosFactor; /**< points to the cosFactor table. */
<> 135:176b8275d35d 2475 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
<> 135:176b8275d35d 2476 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 135:176b8275d35d 2477 } arm_dct4_instance_q15;
<> 135:176b8275d35d 2478
<> 135:176b8275d35d 2479 /**
<> 135:176b8275d35d 2480 * @brief Initialization function for the Q15 DCT4/IDCT4.
<> 135:176b8275d35d 2481 * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure.
<> 135:176b8275d35d 2482 * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
<> 135:176b8275d35d 2483 * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
<> 135:176b8275d35d 2484 * @param[in] N length of the DCT4.
<> 135:176b8275d35d 2485 * @param[in] Nby2 half of the length of the DCT4.
<> 135:176b8275d35d 2486 * @param[in] normalize normalizing factor.
<> 135:176b8275d35d 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.
<> 135:176b8275d35d 2488 */
<> 135:176b8275d35d 2489
<> 135:176b8275d35d 2490 arm_status arm_dct4_init_q15(
<> 135:176b8275d35d 2491 arm_dct4_instance_q15 * S,
<> 135:176b8275d35d 2492 arm_rfft_instance_q15 * S_RFFT,
<> 135:176b8275d35d 2493 arm_cfft_radix4_instance_q15 * S_CFFT,
<> 135:176b8275d35d 2494 uint16_t N,
<> 135:176b8275d35d 2495 uint16_t Nby2,
<> 135:176b8275d35d 2496 q15_t normalize);
<> 135:176b8275d35d 2497
<> 135:176b8275d35d 2498 /**
<> 135:176b8275d35d 2499 * @brief Processing function for the Q15 DCT4/IDCT4.
<> 135:176b8275d35d 2500 * @param[in] *S points to an instance of the Q15 DCT4 structure.
<> 135:176b8275d35d 2501 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 2502 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 135:176b8275d35d 2503 * @return none.
<> 135:176b8275d35d 2504 */
<> 135:176b8275d35d 2505
<> 135:176b8275d35d 2506 void arm_dct4_q15(
<> 135:176b8275d35d 2507 const arm_dct4_instance_q15 * S,
<> 135:176b8275d35d 2508 q15_t * pState,
<> 135:176b8275d35d 2509 q15_t * pInlineBuffer);
<> 135:176b8275d35d 2510
<> 135:176b8275d35d 2511 /**
<> 135:176b8275d35d 2512 * @brief Floating-point vector addition.
<> 135:176b8275d35d 2513 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2514 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2515 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2516 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2517 * @return none.
<> 135:176b8275d35d 2518 */
<> 135:176b8275d35d 2519
<> 135:176b8275d35d 2520 void arm_add_f32(
<> 135:176b8275d35d 2521 float32_t * pSrcA,
<> 135:176b8275d35d 2522 float32_t * pSrcB,
<> 135:176b8275d35d 2523 float32_t * pDst,
<> 135:176b8275d35d 2524 uint32_t blockSize);
<> 135:176b8275d35d 2525
<> 135:176b8275d35d 2526 /**
<> 135:176b8275d35d 2527 * @brief Q7 vector addition.
<> 135:176b8275d35d 2528 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2529 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2530 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2531 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2532 * @return none.
<> 135:176b8275d35d 2533 */
<> 135:176b8275d35d 2534
<> 135:176b8275d35d 2535 void arm_add_q7(
<> 135:176b8275d35d 2536 q7_t * pSrcA,
<> 135:176b8275d35d 2537 q7_t * pSrcB,
<> 135:176b8275d35d 2538 q7_t * pDst,
<> 135:176b8275d35d 2539 uint32_t blockSize);
<> 135:176b8275d35d 2540
<> 135:176b8275d35d 2541 /**
<> 135:176b8275d35d 2542 * @brief Q15 vector addition.
<> 135:176b8275d35d 2543 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2544 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2545 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2546 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2547 * @return none.
<> 135:176b8275d35d 2548 */
<> 135:176b8275d35d 2549
<> 135:176b8275d35d 2550 void arm_add_q15(
<> 135:176b8275d35d 2551 q15_t * pSrcA,
<> 135:176b8275d35d 2552 q15_t * pSrcB,
<> 135:176b8275d35d 2553 q15_t * pDst,
<> 135:176b8275d35d 2554 uint32_t blockSize);
<> 135:176b8275d35d 2555
<> 135:176b8275d35d 2556 /**
<> 135:176b8275d35d 2557 * @brief Q31 vector addition.
<> 135:176b8275d35d 2558 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2559 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2560 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2561 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2562 * @return none.
<> 135:176b8275d35d 2563 */
<> 135:176b8275d35d 2564
<> 135:176b8275d35d 2565 void arm_add_q31(
<> 135:176b8275d35d 2566 q31_t * pSrcA,
<> 135:176b8275d35d 2567 q31_t * pSrcB,
<> 135:176b8275d35d 2568 q31_t * pDst,
<> 135:176b8275d35d 2569 uint32_t blockSize);
<> 135:176b8275d35d 2570
<> 135:176b8275d35d 2571 /**
<> 135:176b8275d35d 2572 * @brief Floating-point vector subtraction.
<> 135:176b8275d35d 2573 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2574 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2575 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2576 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2577 * @return none.
<> 135:176b8275d35d 2578 */
<> 135:176b8275d35d 2579
<> 135:176b8275d35d 2580 void arm_sub_f32(
<> 135:176b8275d35d 2581 float32_t * pSrcA,
<> 135:176b8275d35d 2582 float32_t * pSrcB,
<> 135:176b8275d35d 2583 float32_t * pDst,
<> 135:176b8275d35d 2584 uint32_t blockSize);
<> 135:176b8275d35d 2585
<> 135:176b8275d35d 2586 /**
<> 135:176b8275d35d 2587 * @brief Q7 vector subtraction.
<> 135:176b8275d35d 2588 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2589 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2590 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2591 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2592 * @return none.
<> 135:176b8275d35d 2593 */
<> 135:176b8275d35d 2594
<> 135:176b8275d35d 2595 void arm_sub_q7(
<> 135:176b8275d35d 2596 q7_t * pSrcA,
<> 135:176b8275d35d 2597 q7_t * pSrcB,
<> 135:176b8275d35d 2598 q7_t * pDst,
<> 135:176b8275d35d 2599 uint32_t blockSize);
<> 135:176b8275d35d 2600
<> 135:176b8275d35d 2601 /**
<> 135:176b8275d35d 2602 * @brief Q15 vector subtraction.
<> 135:176b8275d35d 2603 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2604 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2605 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2606 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2607 * @return none.
<> 135:176b8275d35d 2608 */
<> 135:176b8275d35d 2609
<> 135:176b8275d35d 2610 void arm_sub_q15(
<> 135:176b8275d35d 2611 q15_t * pSrcA,
<> 135:176b8275d35d 2612 q15_t * pSrcB,
<> 135:176b8275d35d 2613 q15_t * pDst,
<> 135:176b8275d35d 2614 uint32_t blockSize);
<> 135:176b8275d35d 2615
<> 135:176b8275d35d 2616 /**
<> 135:176b8275d35d 2617 * @brief Q31 vector subtraction.
<> 135:176b8275d35d 2618 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2619 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2620 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2621 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2622 * @return none.
<> 135:176b8275d35d 2623 */
<> 135:176b8275d35d 2624
<> 135:176b8275d35d 2625 void arm_sub_q31(
<> 135:176b8275d35d 2626 q31_t * pSrcA,
<> 135:176b8275d35d 2627 q31_t * pSrcB,
<> 135:176b8275d35d 2628 q31_t * pDst,
<> 135:176b8275d35d 2629 uint32_t blockSize);
<> 135:176b8275d35d 2630
<> 135:176b8275d35d 2631 /**
<> 135:176b8275d35d 2632 * @brief Multiplies a floating-point vector by a scalar.
<> 135:176b8275d35d 2633 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2634 * @param[in] scale scale factor to be applied
<> 135:176b8275d35d 2635 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2636 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2637 * @return none.
<> 135:176b8275d35d 2638 */
<> 135:176b8275d35d 2639
<> 135:176b8275d35d 2640 void arm_scale_f32(
<> 135:176b8275d35d 2641 float32_t * pSrc,
<> 135:176b8275d35d 2642 float32_t scale,
<> 135:176b8275d35d 2643 float32_t * pDst,
<> 135:176b8275d35d 2644 uint32_t blockSize);
<> 135:176b8275d35d 2645
<> 135:176b8275d35d 2646 /**
<> 135:176b8275d35d 2647 * @brief Multiplies a Q7 vector by a scalar.
<> 135:176b8275d35d 2648 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2649 * @param[in] scaleFract fractional portion of the scale value
<> 135:176b8275d35d 2650 * @param[in] shift number of bits to shift the result by
<> 135:176b8275d35d 2651 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2652 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2653 * @return none.
<> 135:176b8275d35d 2654 */
<> 135:176b8275d35d 2655
<> 135:176b8275d35d 2656 void arm_scale_q7(
<> 135:176b8275d35d 2657 q7_t * pSrc,
<> 135:176b8275d35d 2658 q7_t scaleFract,
<> 135:176b8275d35d 2659 int8_t shift,
<> 135:176b8275d35d 2660 q7_t * pDst,
<> 135:176b8275d35d 2661 uint32_t blockSize);
<> 135:176b8275d35d 2662
<> 135:176b8275d35d 2663 /**
<> 135:176b8275d35d 2664 * @brief Multiplies a Q15 vector by a scalar.
<> 135:176b8275d35d 2665 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2666 * @param[in] scaleFract fractional portion of the scale value
<> 135:176b8275d35d 2667 * @param[in] shift number of bits to shift the result by
<> 135:176b8275d35d 2668 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2669 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2670 * @return none.
<> 135:176b8275d35d 2671 */
<> 135:176b8275d35d 2672
<> 135:176b8275d35d 2673 void arm_scale_q15(
<> 135:176b8275d35d 2674 q15_t * pSrc,
<> 135:176b8275d35d 2675 q15_t scaleFract,
<> 135:176b8275d35d 2676 int8_t shift,
<> 135:176b8275d35d 2677 q15_t * pDst,
<> 135:176b8275d35d 2678 uint32_t blockSize);
<> 135:176b8275d35d 2679
<> 135:176b8275d35d 2680 /**
<> 135:176b8275d35d 2681 * @brief Multiplies a Q31 vector by a scalar.
<> 135:176b8275d35d 2682 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2683 * @param[in] scaleFract fractional portion of the scale value
<> 135:176b8275d35d 2684 * @param[in] shift number of bits to shift the result by
<> 135:176b8275d35d 2685 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2686 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2687 * @return none.
<> 135:176b8275d35d 2688 */
<> 135:176b8275d35d 2689
<> 135:176b8275d35d 2690 void arm_scale_q31(
<> 135:176b8275d35d 2691 q31_t * pSrc,
<> 135:176b8275d35d 2692 q31_t scaleFract,
<> 135:176b8275d35d 2693 int8_t shift,
<> 135:176b8275d35d 2694 q31_t * pDst,
<> 135:176b8275d35d 2695 uint32_t blockSize);
<> 135:176b8275d35d 2696
<> 135:176b8275d35d 2697 /**
<> 135:176b8275d35d 2698 * @brief Q7 vector absolute value.
<> 135:176b8275d35d 2699 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 2700 * @param[out] *pDst points to the output buffer
<> 135:176b8275d35d 2701 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2702 * @return none.
<> 135:176b8275d35d 2703 */
<> 135:176b8275d35d 2704
<> 135:176b8275d35d 2705 void arm_abs_q7(
<> 135:176b8275d35d 2706 q7_t * pSrc,
<> 135:176b8275d35d 2707 q7_t * pDst,
<> 135:176b8275d35d 2708 uint32_t blockSize);
<> 135:176b8275d35d 2709
<> 135:176b8275d35d 2710 /**
<> 135:176b8275d35d 2711 * @brief Floating-point vector absolute value.
<> 135:176b8275d35d 2712 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 2713 * @param[out] *pDst points to the output buffer
<> 135:176b8275d35d 2714 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2715 * @return none.
<> 135:176b8275d35d 2716 */
<> 135:176b8275d35d 2717
<> 135:176b8275d35d 2718 void arm_abs_f32(
<> 135:176b8275d35d 2719 float32_t * pSrc,
<> 135:176b8275d35d 2720 float32_t * pDst,
<> 135:176b8275d35d 2721 uint32_t blockSize);
<> 135:176b8275d35d 2722
<> 135:176b8275d35d 2723 /**
<> 135:176b8275d35d 2724 * @brief Q15 vector absolute value.
<> 135:176b8275d35d 2725 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 2726 * @param[out] *pDst points to the output buffer
<> 135:176b8275d35d 2727 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2728 * @return none.
<> 135:176b8275d35d 2729 */
<> 135:176b8275d35d 2730
<> 135:176b8275d35d 2731 void arm_abs_q15(
<> 135:176b8275d35d 2732 q15_t * pSrc,
<> 135:176b8275d35d 2733 q15_t * pDst,
<> 135:176b8275d35d 2734 uint32_t blockSize);
<> 135:176b8275d35d 2735
<> 135:176b8275d35d 2736 /**
<> 135:176b8275d35d 2737 * @brief Q31 vector absolute value.
<> 135:176b8275d35d 2738 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 2739 * @param[out] *pDst points to the output buffer
<> 135:176b8275d35d 2740 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2741 * @return none.
<> 135:176b8275d35d 2742 */
<> 135:176b8275d35d 2743
<> 135:176b8275d35d 2744 void arm_abs_q31(
<> 135:176b8275d35d 2745 q31_t * pSrc,
<> 135:176b8275d35d 2746 q31_t * pDst,
<> 135:176b8275d35d 2747 uint32_t blockSize);
<> 135:176b8275d35d 2748
<> 135:176b8275d35d 2749 /**
<> 135:176b8275d35d 2750 * @brief Dot product of floating-point vectors.
<> 135:176b8275d35d 2751 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2752 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2753 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2754 * @param[out] *result output result returned here
<> 135:176b8275d35d 2755 * @return none.
<> 135:176b8275d35d 2756 */
<> 135:176b8275d35d 2757
<> 135:176b8275d35d 2758 void arm_dot_prod_f32(
<> 135:176b8275d35d 2759 float32_t * pSrcA,
<> 135:176b8275d35d 2760 float32_t * pSrcB,
<> 135:176b8275d35d 2761 uint32_t blockSize,
<> 135:176b8275d35d 2762 float32_t * result);
<> 135:176b8275d35d 2763
<> 135:176b8275d35d 2764 /**
<> 135:176b8275d35d 2765 * @brief Dot product of Q7 vectors.
<> 135:176b8275d35d 2766 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2767 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2768 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2769 * @param[out] *result output result returned here
<> 135:176b8275d35d 2770 * @return none.
<> 135:176b8275d35d 2771 */
<> 135:176b8275d35d 2772
<> 135:176b8275d35d 2773 void arm_dot_prod_q7(
<> 135:176b8275d35d 2774 q7_t * pSrcA,
<> 135:176b8275d35d 2775 q7_t * pSrcB,
<> 135:176b8275d35d 2776 uint32_t blockSize,
<> 135:176b8275d35d 2777 q31_t * result);
<> 135:176b8275d35d 2778
<> 135:176b8275d35d 2779 /**
<> 135:176b8275d35d 2780 * @brief Dot product of Q15 vectors.
<> 135:176b8275d35d 2781 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2782 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2783 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2784 * @param[out] *result output result returned here
<> 135:176b8275d35d 2785 * @return none.
<> 135:176b8275d35d 2786 */
<> 135:176b8275d35d 2787
<> 135:176b8275d35d 2788 void arm_dot_prod_q15(
<> 135:176b8275d35d 2789 q15_t * pSrcA,
<> 135:176b8275d35d 2790 q15_t * pSrcB,
<> 135:176b8275d35d 2791 uint32_t blockSize,
<> 135:176b8275d35d 2792 q63_t * result);
<> 135:176b8275d35d 2793
<> 135:176b8275d35d 2794 /**
<> 135:176b8275d35d 2795 * @brief Dot product of Q31 vectors.
<> 135:176b8275d35d 2796 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 2797 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 2798 * @param[in] blockSize number of samples in each vector
<> 135:176b8275d35d 2799 * @param[out] *result output result returned here
<> 135:176b8275d35d 2800 * @return none.
<> 135:176b8275d35d 2801 */
<> 135:176b8275d35d 2802
<> 135:176b8275d35d 2803 void arm_dot_prod_q31(
<> 135:176b8275d35d 2804 q31_t * pSrcA,
<> 135:176b8275d35d 2805 q31_t * pSrcB,
<> 135:176b8275d35d 2806 uint32_t blockSize,
<> 135:176b8275d35d 2807 q63_t * result);
<> 135:176b8275d35d 2808
<> 135:176b8275d35d 2809 /**
<> 135:176b8275d35d 2810 * @brief Shifts the elements of a Q7 vector a specified number of bits.
<> 135:176b8275d35d 2811 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2812 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 135:176b8275d35d 2813 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2814 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2815 * @return none.
<> 135:176b8275d35d 2816 */
<> 135:176b8275d35d 2817
<> 135:176b8275d35d 2818 void arm_shift_q7(
<> 135:176b8275d35d 2819 q7_t * pSrc,
<> 135:176b8275d35d 2820 int8_t shiftBits,
<> 135:176b8275d35d 2821 q7_t * pDst,
<> 135:176b8275d35d 2822 uint32_t blockSize);
<> 135:176b8275d35d 2823
<> 135:176b8275d35d 2824 /**
<> 135:176b8275d35d 2825 * @brief Shifts the elements of a Q15 vector a specified number of bits.
<> 135:176b8275d35d 2826 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2827 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 135:176b8275d35d 2828 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2829 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2830 * @return none.
<> 135:176b8275d35d 2831 */
<> 135:176b8275d35d 2832
<> 135:176b8275d35d 2833 void arm_shift_q15(
<> 135:176b8275d35d 2834 q15_t * pSrc,
<> 135:176b8275d35d 2835 int8_t shiftBits,
<> 135:176b8275d35d 2836 q15_t * pDst,
<> 135:176b8275d35d 2837 uint32_t blockSize);
<> 135:176b8275d35d 2838
<> 135:176b8275d35d 2839 /**
<> 135:176b8275d35d 2840 * @brief Shifts the elements of a Q31 vector a specified number of bits.
<> 135:176b8275d35d 2841 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2842 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 135:176b8275d35d 2843 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2844 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2845 * @return none.
<> 135:176b8275d35d 2846 */
<> 135:176b8275d35d 2847
<> 135:176b8275d35d 2848 void arm_shift_q31(
<> 135:176b8275d35d 2849 q31_t * pSrc,
<> 135:176b8275d35d 2850 int8_t shiftBits,
<> 135:176b8275d35d 2851 q31_t * pDst,
<> 135:176b8275d35d 2852 uint32_t blockSize);
<> 135:176b8275d35d 2853
<> 135:176b8275d35d 2854 /**
<> 135:176b8275d35d 2855 * @brief Adds a constant offset to a floating-point vector.
<> 135:176b8275d35d 2856 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2857 * @param[in] offset is the offset to be added
<> 135:176b8275d35d 2858 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2859 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2860 * @return none.
<> 135:176b8275d35d 2861 */
<> 135:176b8275d35d 2862
<> 135:176b8275d35d 2863 void arm_offset_f32(
<> 135:176b8275d35d 2864 float32_t * pSrc,
<> 135:176b8275d35d 2865 float32_t offset,
<> 135:176b8275d35d 2866 float32_t * pDst,
<> 135:176b8275d35d 2867 uint32_t blockSize);
<> 135:176b8275d35d 2868
<> 135:176b8275d35d 2869 /**
<> 135:176b8275d35d 2870 * @brief Adds a constant offset to a Q7 vector.
<> 135:176b8275d35d 2871 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2872 * @param[in] offset is the offset to be added
<> 135:176b8275d35d 2873 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2874 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2875 * @return none.
<> 135:176b8275d35d 2876 */
<> 135:176b8275d35d 2877
<> 135:176b8275d35d 2878 void arm_offset_q7(
<> 135:176b8275d35d 2879 q7_t * pSrc,
<> 135:176b8275d35d 2880 q7_t offset,
<> 135:176b8275d35d 2881 q7_t * pDst,
<> 135:176b8275d35d 2882 uint32_t blockSize);
<> 135:176b8275d35d 2883
<> 135:176b8275d35d 2884 /**
<> 135:176b8275d35d 2885 * @brief Adds a constant offset to a Q15 vector.
<> 135:176b8275d35d 2886 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2887 * @param[in] offset is the offset to be added
<> 135:176b8275d35d 2888 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2889 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2890 * @return none.
<> 135:176b8275d35d 2891 */
<> 135:176b8275d35d 2892
<> 135:176b8275d35d 2893 void arm_offset_q15(
<> 135:176b8275d35d 2894 q15_t * pSrc,
<> 135:176b8275d35d 2895 q15_t offset,
<> 135:176b8275d35d 2896 q15_t * pDst,
<> 135:176b8275d35d 2897 uint32_t blockSize);
<> 135:176b8275d35d 2898
<> 135:176b8275d35d 2899 /**
<> 135:176b8275d35d 2900 * @brief Adds a constant offset to a Q31 vector.
<> 135:176b8275d35d 2901 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2902 * @param[in] offset is the offset to be added
<> 135:176b8275d35d 2903 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2904 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2905 * @return none.
<> 135:176b8275d35d 2906 */
<> 135:176b8275d35d 2907
<> 135:176b8275d35d 2908 void arm_offset_q31(
<> 135:176b8275d35d 2909 q31_t * pSrc,
<> 135:176b8275d35d 2910 q31_t offset,
<> 135:176b8275d35d 2911 q31_t * pDst,
<> 135:176b8275d35d 2912 uint32_t blockSize);
<> 135:176b8275d35d 2913
<> 135:176b8275d35d 2914 /**
<> 135:176b8275d35d 2915 * @brief Negates the elements of a floating-point vector.
<> 135:176b8275d35d 2916 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2917 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2918 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2919 * @return none.
<> 135:176b8275d35d 2920 */
<> 135:176b8275d35d 2921
<> 135:176b8275d35d 2922 void arm_negate_f32(
<> 135:176b8275d35d 2923 float32_t * pSrc,
<> 135:176b8275d35d 2924 float32_t * pDst,
<> 135:176b8275d35d 2925 uint32_t blockSize);
<> 135:176b8275d35d 2926
<> 135:176b8275d35d 2927 /**
<> 135:176b8275d35d 2928 * @brief Negates the elements of a Q7 vector.
<> 135:176b8275d35d 2929 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2930 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2931 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2932 * @return none.
<> 135:176b8275d35d 2933 */
<> 135:176b8275d35d 2934
<> 135:176b8275d35d 2935 void arm_negate_q7(
<> 135:176b8275d35d 2936 q7_t * pSrc,
<> 135:176b8275d35d 2937 q7_t * pDst,
<> 135:176b8275d35d 2938 uint32_t blockSize);
<> 135:176b8275d35d 2939
<> 135:176b8275d35d 2940 /**
<> 135:176b8275d35d 2941 * @brief Negates the elements of a Q15 vector.
<> 135:176b8275d35d 2942 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2943 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2944 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2945 * @return none.
<> 135:176b8275d35d 2946 */
<> 135:176b8275d35d 2947
<> 135:176b8275d35d 2948 void arm_negate_q15(
<> 135:176b8275d35d 2949 q15_t * pSrc,
<> 135:176b8275d35d 2950 q15_t * pDst,
<> 135:176b8275d35d 2951 uint32_t blockSize);
<> 135:176b8275d35d 2952
<> 135:176b8275d35d 2953 /**
<> 135:176b8275d35d 2954 * @brief Negates the elements of a Q31 vector.
<> 135:176b8275d35d 2955 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 2956 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 2957 * @param[in] blockSize number of samples in the vector
<> 135:176b8275d35d 2958 * @return none.
<> 135:176b8275d35d 2959 */
<> 135:176b8275d35d 2960
<> 135:176b8275d35d 2961 void arm_negate_q31(
<> 135:176b8275d35d 2962 q31_t * pSrc,
<> 135:176b8275d35d 2963 q31_t * pDst,
<> 135:176b8275d35d 2964 uint32_t blockSize);
<> 135:176b8275d35d 2965 /**
<> 135:176b8275d35d 2966 * @brief Copies the elements of a floating-point vector.
<> 135:176b8275d35d 2967 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 2968 * @param[out] *pDst output pointer
<> 135:176b8275d35d 2969 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 2970 * @return none.
<> 135:176b8275d35d 2971 */
<> 135:176b8275d35d 2972 void arm_copy_f32(
<> 135:176b8275d35d 2973 float32_t * pSrc,
<> 135:176b8275d35d 2974 float32_t * pDst,
<> 135:176b8275d35d 2975 uint32_t blockSize);
<> 135:176b8275d35d 2976
<> 135:176b8275d35d 2977 /**
<> 135:176b8275d35d 2978 * @brief Copies the elements of a Q7 vector.
<> 135:176b8275d35d 2979 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 2980 * @param[out] *pDst output pointer
<> 135:176b8275d35d 2981 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 2982 * @return none.
<> 135:176b8275d35d 2983 */
<> 135:176b8275d35d 2984 void arm_copy_q7(
<> 135:176b8275d35d 2985 q7_t * pSrc,
<> 135:176b8275d35d 2986 q7_t * pDst,
<> 135:176b8275d35d 2987 uint32_t blockSize);
<> 135:176b8275d35d 2988
<> 135:176b8275d35d 2989 /**
<> 135:176b8275d35d 2990 * @brief Copies the elements of a Q15 vector.
<> 135:176b8275d35d 2991 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 2992 * @param[out] *pDst output pointer
<> 135:176b8275d35d 2993 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 2994 * @return none.
<> 135:176b8275d35d 2995 */
<> 135:176b8275d35d 2996 void arm_copy_q15(
<> 135:176b8275d35d 2997 q15_t * pSrc,
<> 135:176b8275d35d 2998 q15_t * pDst,
<> 135:176b8275d35d 2999 uint32_t blockSize);
<> 135:176b8275d35d 3000
<> 135:176b8275d35d 3001 /**
<> 135:176b8275d35d 3002 * @brief Copies the elements of a Q31 vector.
<> 135:176b8275d35d 3003 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 3004 * @param[out] *pDst output pointer
<> 135:176b8275d35d 3005 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 3006 * @return none.
<> 135:176b8275d35d 3007 */
<> 135:176b8275d35d 3008 void arm_copy_q31(
<> 135:176b8275d35d 3009 q31_t * pSrc,
<> 135:176b8275d35d 3010 q31_t * pDst,
<> 135:176b8275d35d 3011 uint32_t blockSize);
<> 135:176b8275d35d 3012 /**
<> 135:176b8275d35d 3013 * @brief Fills a constant value into a floating-point vector.
<> 135:176b8275d35d 3014 * @param[in] value input value to be filled
<> 135:176b8275d35d 3015 * @param[out] *pDst output pointer
<> 135:176b8275d35d 3016 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 3017 * @return none.
<> 135:176b8275d35d 3018 */
<> 135:176b8275d35d 3019 void arm_fill_f32(
<> 135:176b8275d35d 3020 float32_t value,
<> 135:176b8275d35d 3021 float32_t * pDst,
<> 135:176b8275d35d 3022 uint32_t blockSize);
<> 135:176b8275d35d 3023
<> 135:176b8275d35d 3024 /**
<> 135:176b8275d35d 3025 * @brief Fills a constant value into a Q7 vector.
<> 135:176b8275d35d 3026 * @param[in] value input value to be filled
<> 135:176b8275d35d 3027 * @param[out] *pDst output pointer
<> 135:176b8275d35d 3028 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 3029 * @return none.
<> 135:176b8275d35d 3030 */
<> 135:176b8275d35d 3031 void arm_fill_q7(
<> 135:176b8275d35d 3032 q7_t value,
<> 135:176b8275d35d 3033 q7_t * pDst,
<> 135:176b8275d35d 3034 uint32_t blockSize);
<> 135:176b8275d35d 3035
<> 135:176b8275d35d 3036 /**
<> 135:176b8275d35d 3037 * @brief Fills a constant value into a Q15 vector.
<> 135:176b8275d35d 3038 * @param[in] value input value to be filled
<> 135:176b8275d35d 3039 * @param[out] *pDst output pointer
<> 135:176b8275d35d 3040 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 3041 * @return none.
<> 135:176b8275d35d 3042 */
<> 135:176b8275d35d 3043 void arm_fill_q15(
<> 135:176b8275d35d 3044 q15_t value,
<> 135:176b8275d35d 3045 q15_t * pDst,
<> 135:176b8275d35d 3046 uint32_t blockSize);
<> 135:176b8275d35d 3047
<> 135:176b8275d35d 3048 /**
<> 135:176b8275d35d 3049 * @brief Fills a constant value into a Q31 vector.
<> 135:176b8275d35d 3050 * @param[in] value input value to be filled
<> 135:176b8275d35d 3051 * @param[out] *pDst output pointer
<> 135:176b8275d35d 3052 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 3053 * @return none.
<> 135:176b8275d35d 3054 */
<> 135:176b8275d35d 3055 void arm_fill_q31(
<> 135:176b8275d35d 3056 q31_t value,
<> 135:176b8275d35d 3057 q31_t * pDst,
<> 135:176b8275d35d 3058 uint32_t blockSize);
<> 135:176b8275d35d 3059
<> 135:176b8275d35d 3060 /**
<> 135:176b8275d35d 3061 * @brief Convolution of floating-point sequences.
<> 135:176b8275d35d 3062 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3063 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3064 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3065 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3066 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3067 * @return none.
<> 135:176b8275d35d 3068 */
<> 135:176b8275d35d 3069
<> 135:176b8275d35d 3070 void arm_conv_f32(
<> 135:176b8275d35d 3071 float32_t * pSrcA,
<> 135:176b8275d35d 3072 uint32_t srcALen,
<> 135:176b8275d35d 3073 float32_t * pSrcB,
<> 135:176b8275d35d 3074 uint32_t srcBLen,
<> 135:176b8275d35d 3075 float32_t * pDst);
<> 135:176b8275d35d 3076
<> 135:176b8275d35d 3077
<> 135:176b8275d35d 3078 /**
<> 135:176b8275d35d 3079 * @brief Convolution of Q15 sequences.
<> 135:176b8275d35d 3080 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3081 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3082 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3083 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3084 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3085 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3086 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 135:176b8275d35d 3087 * @return none.
<> 135:176b8275d35d 3088 */
<> 135:176b8275d35d 3089
<> 135:176b8275d35d 3090
<> 135:176b8275d35d 3091 void arm_conv_opt_q15(
<> 135:176b8275d35d 3092 q15_t * pSrcA,
<> 135:176b8275d35d 3093 uint32_t srcALen,
<> 135:176b8275d35d 3094 q15_t * pSrcB,
<> 135:176b8275d35d 3095 uint32_t srcBLen,
<> 135:176b8275d35d 3096 q15_t * pDst,
<> 135:176b8275d35d 3097 q15_t * pScratch1,
<> 135:176b8275d35d 3098 q15_t * pScratch2);
<> 135:176b8275d35d 3099
<> 135:176b8275d35d 3100
<> 135:176b8275d35d 3101 /**
<> 135:176b8275d35d 3102 * @brief Convolution of Q15 sequences.
<> 135:176b8275d35d 3103 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3104 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3105 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3106 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3107 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3108 * @return none.
<> 135:176b8275d35d 3109 */
<> 135:176b8275d35d 3110
<> 135:176b8275d35d 3111 void arm_conv_q15(
<> 135:176b8275d35d 3112 q15_t * pSrcA,
<> 135:176b8275d35d 3113 uint32_t srcALen,
<> 135:176b8275d35d 3114 q15_t * pSrcB,
<> 135:176b8275d35d 3115 uint32_t srcBLen,
<> 135:176b8275d35d 3116 q15_t * pDst);
<> 135:176b8275d35d 3117
<> 135:176b8275d35d 3118 /**
<> 135:176b8275d35d 3119 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3120 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3121 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3122 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3123 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3124 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3125 * @return none.
<> 135:176b8275d35d 3126 */
<> 135:176b8275d35d 3127
<> 135:176b8275d35d 3128 void arm_conv_fast_q15(
<> 135:176b8275d35d 3129 q15_t * pSrcA,
<> 135:176b8275d35d 3130 uint32_t srcALen,
<> 135:176b8275d35d 3131 q15_t * pSrcB,
<> 135:176b8275d35d 3132 uint32_t srcBLen,
<> 135:176b8275d35d 3133 q15_t * pDst);
<> 135:176b8275d35d 3134
<> 135:176b8275d35d 3135 /**
<> 135:176b8275d35d 3136 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3137 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3138 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3139 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3140 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3141 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3142 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3143 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 135:176b8275d35d 3144 * @return none.
<> 135:176b8275d35d 3145 */
<> 135:176b8275d35d 3146
<> 135:176b8275d35d 3147 void arm_conv_fast_opt_q15(
<> 135:176b8275d35d 3148 q15_t * pSrcA,
<> 135:176b8275d35d 3149 uint32_t srcALen,
<> 135:176b8275d35d 3150 q15_t * pSrcB,
<> 135:176b8275d35d 3151 uint32_t srcBLen,
<> 135:176b8275d35d 3152 q15_t * pDst,
<> 135:176b8275d35d 3153 q15_t * pScratch1,
<> 135:176b8275d35d 3154 q15_t * pScratch2);
<> 135:176b8275d35d 3155
<> 135:176b8275d35d 3156
<> 135:176b8275d35d 3157
<> 135:176b8275d35d 3158 /**
<> 135:176b8275d35d 3159 * @brief Convolution of Q31 sequences.
<> 135:176b8275d35d 3160 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3161 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3162 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3163 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3164 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3165 * @return none.
<> 135:176b8275d35d 3166 */
<> 135:176b8275d35d 3167
<> 135:176b8275d35d 3168 void arm_conv_q31(
<> 135:176b8275d35d 3169 q31_t * pSrcA,
<> 135:176b8275d35d 3170 uint32_t srcALen,
<> 135:176b8275d35d 3171 q31_t * pSrcB,
<> 135:176b8275d35d 3172 uint32_t srcBLen,
<> 135:176b8275d35d 3173 q31_t * pDst);
<> 135:176b8275d35d 3174
<> 135:176b8275d35d 3175 /**
<> 135:176b8275d35d 3176 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3177 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3178 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3179 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3180 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3181 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3182 * @return none.
<> 135:176b8275d35d 3183 */
<> 135:176b8275d35d 3184
<> 135:176b8275d35d 3185 void arm_conv_fast_q31(
<> 135:176b8275d35d 3186 q31_t * pSrcA,
<> 135:176b8275d35d 3187 uint32_t srcALen,
<> 135:176b8275d35d 3188 q31_t * pSrcB,
<> 135:176b8275d35d 3189 uint32_t srcBLen,
<> 135:176b8275d35d 3190 q31_t * pDst);
<> 135:176b8275d35d 3191
<> 135:176b8275d35d 3192
<> 135:176b8275d35d 3193 /**
<> 135:176b8275d35d 3194 * @brief Convolution of Q7 sequences.
<> 135:176b8275d35d 3195 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3196 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3197 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3198 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3199 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3200 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3201 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 135:176b8275d35d 3202 * @return none.
<> 135:176b8275d35d 3203 */
<> 135:176b8275d35d 3204
<> 135:176b8275d35d 3205 void arm_conv_opt_q7(
<> 135:176b8275d35d 3206 q7_t * pSrcA,
<> 135:176b8275d35d 3207 uint32_t srcALen,
<> 135:176b8275d35d 3208 q7_t * pSrcB,
<> 135:176b8275d35d 3209 uint32_t srcBLen,
<> 135:176b8275d35d 3210 q7_t * pDst,
<> 135:176b8275d35d 3211 q15_t * pScratch1,
<> 135:176b8275d35d 3212 q15_t * pScratch2);
<> 135:176b8275d35d 3213
<> 135:176b8275d35d 3214
<> 135:176b8275d35d 3215
<> 135:176b8275d35d 3216 /**
<> 135:176b8275d35d 3217 * @brief Convolution of Q7 sequences.
<> 135:176b8275d35d 3218 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3219 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3220 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3221 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3222 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 135:176b8275d35d 3223 * @return none.
<> 135:176b8275d35d 3224 */
<> 135:176b8275d35d 3225
<> 135:176b8275d35d 3226 void arm_conv_q7(
<> 135:176b8275d35d 3227 q7_t * pSrcA,
<> 135:176b8275d35d 3228 uint32_t srcALen,
<> 135:176b8275d35d 3229 q7_t * pSrcB,
<> 135:176b8275d35d 3230 uint32_t srcBLen,
<> 135:176b8275d35d 3231 q7_t * pDst);
<> 135:176b8275d35d 3232
<> 135:176b8275d35d 3233
<> 135:176b8275d35d 3234 /**
<> 135:176b8275d35d 3235 * @brief Partial convolution of floating-point sequences.
<> 135:176b8275d35d 3236 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3237 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3238 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3239 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3240 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3241 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3242 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3244 */
<> 135:176b8275d35d 3245
<> 135:176b8275d35d 3246 arm_status arm_conv_partial_f32(
<> 135:176b8275d35d 3247 float32_t * pSrcA,
<> 135:176b8275d35d 3248 uint32_t srcALen,
<> 135:176b8275d35d 3249 float32_t * pSrcB,
<> 135:176b8275d35d 3250 uint32_t srcBLen,
<> 135:176b8275d35d 3251 float32_t * pDst,
<> 135:176b8275d35d 3252 uint32_t firstIndex,
<> 135:176b8275d35d 3253 uint32_t numPoints);
<> 135:176b8275d35d 3254
<> 135:176b8275d35d 3255 /**
<> 135:176b8275d35d 3256 * @brief Partial convolution of Q15 sequences.
<> 135:176b8275d35d 3257 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3258 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3259 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3260 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3261 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3262 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3263 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 3264 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3265 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3267 */
<> 135:176b8275d35d 3268
<> 135:176b8275d35d 3269 arm_status arm_conv_partial_opt_q15(
<> 135:176b8275d35d 3270 q15_t * pSrcA,
<> 135:176b8275d35d 3271 uint32_t srcALen,
<> 135:176b8275d35d 3272 q15_t * pSrcB,
<> 135:176b8275d35d 3273 uint32_t srcBLen,
<> 135:176b8275d35d 3274 q15_t * pDst,
<> 135:176b8275d35d 3275 uint32_t firstIndex,
<> 135:176b8275d35d 3276 uint32_t numPoints,
<> 135:176b8275d35d 3277 q15_t * pScratch1,
<> 135:176b8275d35d 3278 q15_t * pScratch2);
<> 135:176b8275d35d 3279
<> 135:176b8275d35d 3280
<> 135:176b8275d35d 3281 /**
<> 135:176b8275d35d 3282 * @brief Partial convolution of Q15 sequences.
<> 135:176b8275d35d 3283 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3284 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3285 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3286 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3287 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3288 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3289 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3291 */
<> 135:176b8275d35d 3292
<> 135:176b8275d35d 3293 arm_status arm_conv_partial_q15(
<> 135:176b8275d35d 3294 q15_t * pSrcA,
<> 135:176b8275d35d 3295 uint32_t srcALen,
<> 135:176b8275d35d 3296 q15_t * pSrcB,
<> 135:176b8275d35d 3297 uint32_t srcBLen,
<> 135:176b8275d35d 3298 q15_t * pDst,
<> 135:176b8275d35d 3299 uint32_t firstIndex,
<> 135:176b8275d35d 3300 uint32_t numPoints);
<> 135:176b8275d35d 3301
<> 135:176b8275d35d 3302 /**
<> 135:176b8275d35d 3303 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3304 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3305 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3306 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3307 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3308 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3309 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3310 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3312 */
<> 135:176b8275d35d 3313
<> 135:176b8275d35d 3314 arm_status arm_conv_partial_fast_q15(
<> 135:176b8275d35d 3315 q15_t * pSrcA,
<> 135:176b8275d35d 3316 uint32_t srcALen,
<> 135:176b8275d35d 3317 q15_t * pSrcB,
<> 135:176b8275d35d 3318 uint32_t srcBLen,
<> 135:176b8275d35d 3319 q15_t * pDst,
<> 135:176b8275d35d 3320 uint32_t firstIndex,
<> 135:176b8275d35d 3321 uint32_t numPoints);
<> 135:176b8275d35d 3322
<> 135:176b8275d35d 3323
<> 135:176b8275d35d 3324 /**
<> 135:176b8275d35d 3325 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3326 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3327 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3328 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3329 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3330 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3331 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3332 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 3333 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3334 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3336 */
<> 135:176b8275d35d 3337
<> 135:176b8275d35d 3338 arm_status arm_conv_partial_fast_opt_q15(
<> 135:176b8275d35d 3339 q15_t * pSrcA,
<> 135:176b8275d35d 3340 uint32_t srcALen,
<> 135:176b8275d35d 3341 q15_t * pSrcB,
<> 135:176b8275d35d 3342 uint32_t srcBLen,
<> 135:176b8275d35d 3343 q15_t * pDst,
<> 135:176b8275d35d 3344 uint32_t firstIndex,
<> 135:176b8275d35d 3345 uint32_t numPoints,
<> 135:176b8275d35d 3346 q15_t * pScratch1,
<> 135:176b8275d35d 3347 q15_t * pScratch2);
<> 135:176b8275d35d 3348
<> 135:176b8275d35d 3349
<> 135:176b8275d35d 3350 /**
<> 135:176b8275d35d 3351 * @brief Partial convolution of Q31 sequences.
<> 135:176b8275d35d 3352 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3353 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3354 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3355 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3356 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3357 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3358 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3360 */
<> 135:176b8275d35d 3361
<> 135:176b8275d35d 3362 arm_status arm_conv_partial_q31(
<> 135:176b8275d35d 3363 q31_t * pSrcA,
<> 135:176b8275d35d 3364 uint32_t srcALen,
<> 135:176b8275d35d 3365 q31_t * pSrcB,
<> 135:176b8275d35d 3366 uint32_t srcBLen,
<> 135:176b8275d35d 3367 q31_t * pDst,
<> 135:176b8275d35d 3368 uint32_t firstIndex,
<> 135:176b8275d35d 3369 uint32_t numPoints);
<> 135:176b8275d35d 3370
<> 135:176b8275d35d 3371
<> 135:176b8275d35d 3372 /**
<> 135:176b8275d35d 3373 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 3374 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3375 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3376 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3377 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3378 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3379 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3380 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3382 */
<> 135:176b8275d35d 3383
<> 135:176b8275d35d 3384 arm_status arm_conv_partial_fast_q31(
<> 135:176b8275d35d 3385 q31_t * pSrcA,
<> 135:176b8275d35d 3386 uint32_t srcALen,
<> 135:176b8275d35d 3387 q31_t * pSrcB,
<> 135:176b8275d35d 3388 uint32_t srcBLen,
<> 135:176b8275d35d 3389 q31_t * pDst,
<> 135:176b8275d35d 3390 uint32_t firstIndex,
<> 135:176b8275d35d 3391 uint32_t numPoints);
<> 135:176b8275d35d 3392
<> 135:176b8275d35d 3393
<> 135:176b8275d35d 3394 /**
<> 135:176b8275d35d 3395 * @brief Partial convolution of Q7 sequences
<> 135:176b8275d35d 3396 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3397 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3398 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3399 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3400 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3401 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3402 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 3403 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 3404 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3406 */
<> 135:176b8275d35d 3407
<> 135:176b8275d35d 3408 arm_status arm_conv_partial_opt_q7(
<> 135:176b8275d35d 3409 q7_t * pSrcA,
<> 135:176b8275d35d 3410 uint32_t srcALen,
<> 135:176b8275d35d 3411 q7_t * pSrcB,
<> 135:176b8275d35d 3412 uint32_t srcBLen,
<> 135:176b8275d35d 3413 q7_t * pDst,
<> 135:176b8275d35d 3414 uint32_t firstIndex,
<> 135:176b8275d35d 3415 uint32_t numPoints,
<> 135:176b8275d35d 3416 q15_t * pScratch1,
<> 135:176b8275d35d 3417 q15_t * pScratch2);
<> 135:176b8275d35d 3418
<> 135:176b8275d35d 3419
<> 135:176b8275d35d 3420 /**
<> 135:176b8275d35d 3421 * @brief Partial convolution of Q7 sequences.
<> 135:176b8275d35d 3422 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 3423 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 3424 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 3425 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 3426 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3427 * @param[in] firstIndex is the first output sample to start with.
<> 135:176b8275d35d 3428 * @param[in] numPoints is the number of output points to be computed.
<> 135:176b8275d35d 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].
<> 135:176b8275d35d 3430 */
<> 135:176b8275d35d 3431
<> 135:176b8275d35d 3432 arm_status arm_conv_partial_q7(
<> 135:176b8275d35d 3433 q7_t * pSrcA,
<> 135:176b8275d35d 3434 uint32_t srcALen,
<> 135:176b8275d35d 3435 q7_t * pSrcB,
<> 135:176b8275d35d 3436 uint32_t srcBLen,
<> 135:176b8275d35d 3437 q7_t * pDst,
<> 135:176b8275d35d 3438 uint32_t firstIndex,
<> 135:176b8275d35d 3439 uint32_t numPoints);
<> 135:176b8275d35d 3440
<> 135:176b8275d35d 3441
<> 135:176b8275d35d 3442
<> 135:176b8275d35d 3443 /**
<> 135:176b8275d35d 3444 * @brief Instance structure for the Q15 FIR decimator.
<> 135:176b8275d35d 3445 */
<> 135:176b8275d35d 3446
<> 135:176b8275d35d 3447 typedef struct
<> 135:176b8275d35d 3448 {
<> 135:176b8275d35d 3449 uint8_t M; /**< decimation factor. */
<> 135:176b8275d35d 3450 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 3451 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 3452 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 3453 } arm_fir_decimate_instance_q15;
<> 135:176b8275d35d 3454
<> 135:176b8275d35d 3455 /**
<> 135:176b8275d35d 3456 * @brief Instance structure for the Q31 FIR decimator.
<> 135:176b8275d35d 3457 */
<> 135:176b8275d35d 3458
<> 135:176b8275d35d 3459 typedef struct
<> 135:176b8275d35d 3460 {
<> 135:176b8275d35d 3461 uint8_t M; /**< decimation factor. */
<> 135:176b8275d35d 3462 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 3463 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 3464 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 3465
<> 135:176b8275d35d 3466 } arm_fir_decimate_instance_q31;
<> 135:176b8275d35d 3467
<> 135:176b8275d35d 3468 /**
<> 135:176b8275d35d 3469 * @brief Instance structure for the floating-point FIR decimator.
<> 135:176b8275d35d 3470 */
<> 135:176b8275d35d 3471
<> 135:176b8275d35d 3472 typedef struct
<> 135:176b8275d35d 3473 {
<> 135:176b8275d35d 3474 uint8_t M; /**< decimation factor. */
<> 135:176b8275d35d 3475 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 3476 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 3477 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 3478
<> 135:176b8275d35d 3479 } arm_fir_decimate_instance_f32;
<> 135:176b8275d35d 3480
<> 135:176b8275d35d 3481
<> 135:176b8275d35d 3482
<> 135:176b8275d35d 3483 /**
<> 135:176b8275d35d 3484 * @brief Processing function for the floating-point FIR decimator.
<> 135:176b8275d35d 3485 * @param[in] *S points to an instance of the floating-point FIR decimator structure.
<> 135:176b8275d35d 3486 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3487 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3488 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3489 * @return none
<> 135:176b8275d35d 3490 */
<> 135:176b8275d35d 3491
<> 135:176b8275d35d 3492 void arm_fir_decimate_f32(
<> 135:176b8275d35d 3493 const arm_fir_decimate_instance_f32 * S,
<> 135:176b8275d35d 3494 float32_t * pSrc,
<> 135:176b8275d35d 3495 float32_t * pDst,
<> 135:176b8275d35d 3496 uint32_t blockSize);
<> 135:176b8275d35d 3497
<> 135:176b8275d35d 3498
<> 135:176b8275d35d 3499 /**
<> 135:176b8275d35d 3500 * @brief Initialization function for the floating-point FIR decimator.
<> 135:176b8275d35d 3501 * @param[in,out] *S points to an instance of the floating-point FIR decimator structure.
<> 135:176b8275d35d 3502 * @param[in] numTaps number of coefficients in the filter.
<> 135:176b8275d35d 3503 * @param[in] M decimation factor.
<> 135:176b8275d35d 3504 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3505 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3506 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3507 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3508 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 135:176b8275d35d 3509 */
<> 135:176b8275d35d 3510
<> 135:176b8275d35d 3511 arm_status arm_fir_decimate_init_f32(
<> 135:176b8275d35d 3512 arm_fir_decimate_instance_f32 * S,
<> 135:176b8275d35d 3513 uint16_t numTaps,
<> 135:176b8275d35d 3514 uint8_t M,
<> 135:176b8275d35d 3515 float32_t * pCoeffs,
<> 135:176b8275d35d 3516 float32_t * pState,
<> 135:176b8275d35d 3517 uint32_t blockSize);
<> 135:176b8275d35d 3518
<> 135:176b8275d35d 3519 /**
<> 135:176b8275d35d 3520 * @brief Processing function for the Q15 FIR decimator.
<> 135:176b8275d35d 3521 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 135:176b8275d35d 3522 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3523 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3524 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3525 * @return none
<> 135:176b8275d35d 3526 */
<> 135:176b8275d35d 3527
<> 135:176b8275d35d 3528 void arm_fir_decimate_q15(
<> 135:176b8275d35d 3529 const arm_fir_decimate_instance_q15 * S,
<> 135:176b8275d35d 3530 q15_t * pSrc,
<> 135:176b8275d35d 3531 q15_t * pDst,
<> 135:176b8275d35d 3532 uint32_t blockSize);
<> 135:176b8275d35d 3533
<> 135:176b8275d35d 3534 /**
<> 135:176b8275d35d 3535 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 3536 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 135:176b8275d35d 3537 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3538 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3539 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3540 * @return none
<> 135:176b8275d35d 3541 */
<> 135:176b8275d35d 3542
<> 135:176b8275d35d 3543 void arm_fir_decimate_fast_q15(
<> 135:176b8275d35d 3544 const arm_fir_decimate_instance_q15 * S,
<> 135:176b8275d35d 3545 q15_t * pSrc,
<> 135:176b8275d35d 3546 q15_t * pDst,
<> 135:176b8275d35d 3547 uint32_t blockSize);
<> 135:176b8275d35d 3548
<> 135:176b8275d35d 3549
<> 135:176b8275d35d 3550
<> 135:176b8275d35d 3551 /**
<> 135:176b8275d35d 3552 * @brief Initialization function for the Q15 FIR decimator.
<> 135:176b8275d35d 3553 * @param[in,out] *S points to an instance of the Q15 FIR decimator structure.
<> 135:176b8275d35d 3554 * @param[in] numTaps number of coefficients in the filter.
<> 135:176b8275d35d 3555 * @param[in] M decimation factor.
<> 135:176b8275d35d 3556 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3557 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3558 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3559 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3560 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 135:176b8275d35d 3561 */
<> 135:176b8275d35d 3562
<> 135:176b8275d35d 3563 arm_status arm_fir_decimate_init_q15(
<> 135:176b8275d35d 3564 arm_fir_decimate_instance_q15 * S,
<> 135:176b8275d35d 3565 uint16_t numTaps,
<> 135:176b8275d35d 3566 uint8_t M,
<> 135:176b8275d35d 3567 q15_t * pCoeffs,
<> 135:176b8275d35d 3568 q15_t * pState,
<> 135:176b8275d35d 3569 uint32_t blockSize);
<> 135:176b8275d35d 3570
<> 135:176b8275d35d 3571 /**
<> 135:176b8275d35d 3572 * @brief Processing function for the Q31 FIR decimator.
<> 135:176b8275d35d 3573 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 135:176b8275d35d 3574 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3575 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3576 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3577 * @return none
<> 135:176b8275d35d 3578 */
<> 135:176b8275d35d 3579
<> 135:176b8275d35d 3580 void arm_fir_decimate_q31(
<> 135:176b8275d35d 3581 const arm_fir_decimate_instance_q31 * S,
<> 135:176b8275d35d 3582 q31_t * pSrc,
<> 135:176b8275d35d 3583 q31_t * pDst,
<> 135:176b8275d35d 3584 uint32_t blockSize);
<> 135:176b8275d35d 3585
<> 135:176b8275d35d 3586 /**
<> 135:176b8275d35d 3587 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 3588 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 135:176b8275d35d 3589 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3590 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3591 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3592 * @return none
<> 135:176b8275d35d 3593 */
<> 135:176b8275d35d 3594
<> 135:176b8275d35d 3595 void arm_fir_decimate_fast_q31(
<> 135:176b8275d35d 3596 arm_fir_decimate_instance_q31 * S,
<> 135:176b8275d35d 3597 q31_t * pSrc,
<> 135:176b8275d35d 3598 q31_t * pDst,
<> 135:176b8275d35d 3599 uint32_t blockSize);
<> 135:176b8275d35d 3600
<> 135:176b8275d35d 3601
<> 135:176b8275d35d 3602 /**
<> 135:176b8275d35d 3603 * @brief Initialization function for the Q31 FIR decimator.
<> 135:176b8275d35d 3604 * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
<> 135:176b8275d35d 3605 * @param[in] numTaps number of coefficients in the filter.
<> 135:176b8275d35d 3606 * @param[in] M decimation factor.
<> 135:176b8275d35d 3607 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3608 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3609 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3610 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3611 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 135:176b8275d35d 3612 */
<> 135:176b8275d35d 3613
<> 135:176b8275d35d 3614 arm_status arm_fir_decimate_init_q31(
<> 135:176b8275d35d 3615 arm_fir_decimate_instance_q31 * S,
<> 135:176b8275d35d 3616 uint16_t numTaps,
<> 135:176b8275d35d 3617 uint8_t M,
<> 135:176b8275d35d 3618 q31_t * pCoeffs,
<> 135:176b8275d35d 3619 q31_t * pState,
<> 135:176b8275d35d 3620 uint32_t blockSize);
<> 135:176b8275d35d 3621
<> 135:176b8275d35d 3622
<> 135:176b8275d35d 3623
<> 135:176b8275d35d 3624 /**
<> 135:176b8275d35d 3625 * @brief Instance structure for the Q15 FIR interpolator.
<> 135:176b8275d35d 3626 */
<> 135:176b8275d35d 3627
<> 135:176b8275d35d 3628 typedef struct
<> 135:176b8275d35d 3629 {
<> 135:176b8275d35d 3630 uint8_t L; /**< upsample factor. */
<> 135:176b8275d35d 3631 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 135:176b8275d35d 3632 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 135:176b8275d35d 3633 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 135:176b8275d35d 3634 } arm_fir_interpolate_instance_q15;
<> 135:176b8275d35d 3635
<> 135:176b8275d35d 3636 /**
<> 135:176b8275d35d 3637 * @brief Instance structure for the Q31 FIR interpolator.
<> 135:176b8275d35d 3638 */
<> 135:176b8275d35d 3639
<> 135:176b8275d35d 3640 typedef struct
<> 135:176b8275d35d 3641 {
<> 135:176b8275d35d 3642 uint8_t L; /**< upsample factor. */
<> 135:176b8275d35d 3643 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 135:176b8275d35d 3644 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 135:176b8275d35d 3645 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 135:176b8275d35d 3646 } arm_fir_interpolate_instance_q31;
<> 135:176b8275d35d 3647
<> 135:176b8275d35d 3648 /**
<> 135:176b8275d35d 3649 * @brief Instance structure for the floating-point FIR interpolator.
<> 135:176b8275d35d 3650 */
<> 135:176b8275d35d 3651
<> 135:176b8275d35d 3652 typedef struct
<> 135:176b8275d35d 3653 {
<> 135:176b8275d35d 3654 uint8_t L; /**< upsample factor. */
<> 135:176b8275d35d 3655 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 135:176b8275d35d 3656 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 135:176b8275d35d 3657 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
<> 135:176b8275d35d 3658 } arm_fir_interpolate_instance_f32;
<> 135:176b8275d35d 3659
<> 135:176b8275d35d 3660
<> 135:176b8275d35d 3661 /**
<> 135:176b8275d35d 3662 * @brief Processing function for the Q15 FIR interpolator.
<> 135:176b8275d35d 3663 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 135:176b8275d35d 3664 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3665 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 3666 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3667 * @return none.
<> 135:176b8275d35d 3668 */
<> 135:176b8275d35d 3669
<> 135:176b8275d35d 3670 void arm_fir_interpolate_q15(
<> 135:176b8275d35d 3671 const arm_fir_interpolate_instance_q15 * S,
<> 135:176b8275d35d 3672 q15_t * pSrc,
<> 135:176b8275d35d 3673 q15_t * pDst,
<> 135:176b8275d35d 3674 uint32_t blockSize);
<> 135:176b8275d35d 3675
<> 135:176b8275d35d 3676
<> 135:176b8275d35d 3677 /**
<> 135:176b8275d35d 3678 * @brief Initialization function for the Q15 FIR interpolator.
<> 135:176b8275d35d 3679 * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure.
<> 135:176b8275d35d 3680 * @param[in] L upsample factor.
<> 135:176b8275d35d 3681 * @param[in] numTaps number of filter coefficients in the filter.
<> 135:176b8275d35d 3682 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 135:176b8275d35d 3683 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3684 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3685 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3686 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 135:176b8275d35d 3687 */
<> 135:176b8275d35d 3688
<> 135:176b8275d35d 3689 arm_status arm_fir_interpolate_init_q15(
<> 135:176b8275d35d 3690 arm_fir_interpolate_instance_q15 * S,
<> 135:176b8275d35d 3691 uint8_t L,
<> 135:176b8275d35d 3692 uint16_t numTaps,
<> 135:176b8275d35d 3693 q15_t * pCoeffs,
<> 135:176b8275d35d 3694 q15_t * pState,
<> 135:176b8275d35d 3695 uint32_t blockSize);
<> 135:176b8275d35d 3696
<> 135:176b8275d35d 3697 /**
<> 135:176b8275d35d 3698 * @brief Processing function for the Q31 FIR interpolator.
<> 135:176b8275d35d 3699 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 135:176b8275d35d 3700 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3701 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 3702 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3703 * @return none.
<> 135:176b8275d35d 3704 */
<> 135:176b8275d35d 3705
<> 135:176b8275d35d 3706 void arm_fir_interpolate_q31(
<> 135:176b8275d35d 3707 const arm_fir_interpolate_instance_q31 * S,
<> 135:176b8275d35d 3708 q31_t * pSrc,
<> 135:176b8275d35d 3709 q31_t * pDst,
<> 135:176b8275d35d 3710 uint32_t blockSize);
<> 135:176b8275d35d 3711
<> 135:176b8275d35d 3712 /**
<> 135:176b8275d35d 3713 * @brief Initialization function for the Q31 FIR interpolator.
<> 135:176b8275d35d 3714 * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure.
<> 135:176b8275d35d 3715 * @param[in] L upsample factor.
<> 135:176b8275d35d 3716 * @param[in] numTaps number of filter coefficients in the filter.
<> 135:176b8275d35d 3717 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 135:176b8275d35d 3718 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3719 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3720 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3721 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 135:176b8275d35d 3722 */
<> 135:176b8275d35d 3723
<> 135:176b8275d35d 3724 arm_status arm_fir_interpolate_init_q31(
<> 135:176b8275d35d 3725 arm_fir_interpolate_instance_q31 * S,
<> 135:176b8275d35d 3726 uint8_t L,
<> 135:176b8275d35d 3727 uint16_t numTaps,
<> 135:176b8275d35d 3728 q31_t * pCoeffs,
<> 135:176b8275d35d 3729 q31_t * pState,
<> 135:176b8275d35d 3730 uint32_t blockSize);
<> 135:176b8275d35d 3731
<> 135:176b8275d35d 3732
<> 135:176b8275d35d 3733 /**
<> 135:176b8275d35d 3734 * @brief Processing function for the floating-point FIR interpolator.
<> 135:176b8275d35d 3735 * @param[in] *S points to an instance of the floating-point FIR interpolator structure.
<> 135:176b8275d35d 3736 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3737 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 3738 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3739 * @return none.
<> 135:176b8275d35d 3740 */
<> 135:176b8275d35d 3741
<> 135:176b8275d35d 3742 void arm_fir_interpolate_f32(
<> 135:176b8275d35d 3743 const arm_fir_interpolate_instance_f32 * S,
<> 135:176b8275d35d 3744 float32_t * pSrc,
<> 135:176b8275d35d 3745 float32_t * pDst,
<> 135:176b8275d35d 3746 uint32_t blockSize);
<> 135:176b8275d35d 3747
<> 135:176b8275d35d 3748 /**
<> 135:176b8275d35d 3749 * @brief Initialization function for the floating-point FIR interpolator.
<> 135:176b8275d35d 3750 * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure.
<> 135:176b8275d35d 3751 * @param[in] L upsample factor.
<> 135:176b8275d35d 3752 * @param[in] numTaps number of filter coefficients in the filter.
<> 135:176b8275d35d 3753 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 135:176b8275d35d 3754 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3755 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 3756 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 135:176b8275d35d 3757 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 135:176b8275d35d 3758 */
<> 135:176b8275d35d 3759
<> 135:176b8275d35d 3760 arm_status arm_fir_interpolate_init_f32(
<> 135:176b8275d35d 3761 arm_fir_interpolate_instance_f32 * S,
<> 135:176b8275d35d 3762 uint8_t L,
<> 135:176b8275d35d 3763 uint16_t numTaps,
<> 135:176b8275d35d 3764 float32_t * pCoeffs,
<> 135:176b8275d35d 3765 float32_t * pState,
<> 135:176b8275d35d 3766 uint32_t blockSize);
<> 135:176b8275d35d 3767
<> 135:176b8275d35d 3768 /**
<> 135:176b8275d35d 3769 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
<> 135:176b8275d35d 3770 */
<> 135:176b8275d35d 3771
<> 135:176b8275d35d 3772 typedef struct
<> 135:176b8275d35d 3773 {
<> 135:176b8275d35d 3774 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 3775 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 135:176b8275d35d 3776 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 3777 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
<> 135:176b8275d35d 3778
<> 135:176b8275d35d 3779 } arm_biquad_cas_df1_32x64_ins_q31;
<> 135:176b8275d35d 3780
<> 135:176b8275d35d 3781
<> 135:176b8275d35d 3782 /**
<> 135:176b8275d35d 3783 * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 135:176b8275d35d 3784 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3785 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3786 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 3787 * @return none.
<> 135:176b8275d35d 3788 */
<> 135:176b8275d35d 3789
<> 135:176b8275d35d 3790 void arm_biquad_cas_df1_32x64_q31(
<> 135:176b8275d35d 3791 const arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 135:176b8275d35d 3792 q31_t * pSrc,
<> 135:176b8275d35d 3793 q31_t * pDst,
<> 135:176b8275d35d 3794 uint32_t blockSize);
<> 135:176b8275d35d 3795
<> 135:176b8275d35d 3796
<> 135:176b8275d35d 3797 /**
<> 135:176b8275d35d 3798 * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 135:176b8275d35d 3799 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 3800 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3801 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3802 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
<> 135:176b8275d35d 3803 * @return none
<> 135:176b8275d35d 3804 */
<> 135:176b8275d35d 3805
<> 135:176b8275d35d 3806 void arm_biquad_cas_df1_32x64_init_q31(
<> 135:176b8275d35d 3807 arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 135:176b8275d35d 3808 uint8_t numStages,
<> 135:176b8275d35d 3809 q31_t * pCoeffs,
<> 135:176b8275d35d 3810 q63_t * pState,
<> 135:176b8275d35d 3811 uint8_t postShift);
<> 135:176b8275d35d 3812
<> 135:176b8275d35d 3813
<> 135:176b8275d35d 3814
<> 135:176b8275d35d 3815 /**
<> 135:176b8275d35d 3816 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3817 */
<> 135:176b8275d35d 3818
<> 135:176b8275d35d 3819 typedef struct
<> 135:176b8275d35d 3820 {
<> 135:176b8275d35d 3821 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 3822 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 135:176b8275d35d 3823 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 3824 } arm_biquad_cascade_df2T_instance_f32;
<> 135:176b8275d35d 3825
<> 135:176b8275d35d 3826
<> 135:176b8275d35d 3827
<> 135:176b8275d35d 3828 /**
<> 135:176b8275d35d 3829 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3830 */
<> 135:176b8275d35d 3831
<> 135:176b8275d35d 3832 typedef struct
<> 135:176b8275d35d 3833 {
<> 135:176b8275d35d 3834 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 3835 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 135:176b8275d35d 3836 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 3837 } arm_biquad_cascade_stereo_df2T_instance_f32;
<> 135:176b8275d35d 3838
<> 135:176b8275d35d 3839
<> 135:176b8275d35d 3840
<> 135:176b8275d35d 3841 /**
<> 135:176b8275d35d 3842 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3843 */
<> 135:176b8275d35d 3844
<> 135:176b8275d35d 3845 typedef struct
<> 135:176b8275d35d 3846 {
<> 135:176b8275d35d 3847 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 135:176b8275d35d 3848 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 135:176b8275d35d 3849 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 135:176b8275d35d 3850 } arm_biquad_cascade_df2T_instance_f64;
<> 135:176b8275d35d 3851
<> 135:176b8275d35d 3852
<> 135:176b8275d35d 3853 /**
<> 135:176b8275d35d 3854 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3855 * @param[in] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3856 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3857 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3858 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 3859 * @return none.
<> 135:176b8275d35d 3860 */
<> 135:176b8275d35d 3861
<> 135:176b8275d35d 3862 void arm_biquad_cascade_df2T_f32(
<> 135:176b8275d35d 3863 const arm_biquad_cascade_df2T_instance_f32 * S,
<> 135:176b8275d35d 3864 float32_t * pSrc,
<> 135:176b8275d35d 3865 float32_t * pDst,
<> 135:176b8275d35d 3866 uint32_t blockSize);
<> 135:176b8275d35d 3867
<> 135:176b8275d35d 3868
<> 135:176b8275d35d 3869 /**
<> 135:176b8275d35d 3870 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
<> 135:176b8275d35d 3871 * @param[in] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3872 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3873 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3874 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 3875 * @return none.
<> 135:176b8275d35d 3876 */
<> 135:176b8275d35d 3877
<> 135:176b8275d35d 3878 void arm_biquad_cascade_stereo_df2T_f32(
<> 135:176b8275d35d 3879 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 135:176b8275d35d 3880 float32_t * pSrc,
<> 135:176b8275d35d 3881 float32_t * pDst,
<> 135:176b8275d35d 3882 uint32_t blockSize);
<> 135:176b8275d35d 3883
<> 135:176b8275d35d 3884 /**
<> 135:176b8275d35d 3885 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3886 * @param[in] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3887 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 3888 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 3889 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 3890 * @return none.
<> 135:176b8275d35d 3891 */
<> 135:176b8275d35d 3892
<> 135:176b8275d35d 3893 void arm_biquad_cascade_df2T_f64(
<> 135:176b8275d35d 3894 const arm_biquad_cascade_df2T_instance_f64 * S,
<> 135:176b8275d35d 3895 float64_t * pSrc,
<> 135:176b8275d35d 3896 float64_t * pDst,
<> 135:176b8275d35d 3897 uint32_t blockSize);
<> 135:176b8275d35d 3898
<> 135:176b8275d35d 3899
<> 135:176b8275d35d 3900 /**
<> 135:176b8275d35d 3901 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3902 * @param[in,out] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3903 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 3904 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3905 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3906 * @return none
<> 135:176b8275d35d 3907 */
<> 135:176b8275d35d 3908
<> 135:176b8275d35d 3909 void arm_biquad_cascade_df2T_init_f32(
<> 135:176b8275d35d 3910 arm_biquad_cascade_df2T_instance_f32 * S,
<> 135:176b8275d35d 3911 uint8_t numStages,
<> 135:176b8275d35d 3912 float32_t * pCoeffs,
<> 135:176b8275d35d 3913 float32_t * pState);
<> 135:176b8275d35d 3914
<> 135:176b8275d35d 3915
<> 135:176b8275d35d 3916 /**
<> 135:176b8275d35d 3917 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3918 * @param[in,out] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3919 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 3920 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3921 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3922 * @return none
<> 135:176b8275d35d 3923 */
<> 135:176b8275d35d 3924
<> 135:176b8275d35d 3925 void arm_biquad_cascade_stereo_df2T_init_f32(
<> 135:176b8275d35d 3926 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 135:176b8275d35d 3927 uint8_t numStages,
<> 135:176b8275d35d 3928 float32_t * pCoeffs,
<> 135:176b8275d35d 3929 float32_t * pState);
<> 135:176b8275d35d 3930
<> 135:176b8275d35d 3931
<> 135:176b8275d35d 3932 /**
<> 135:176b8275d35d 3933 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 135:176b8275d35d 3934 * @param[in,out] *S points to an instance of the filter data structure.
<> 135:176b8275d35d 3935 * @param[in] numStages number of 2nd order stages in the filter.
<> 135:176b8275d35d 3936 * @param[in] *pCoeffs points to the filter coefficients.
<> 135:176b8275d35d 3937 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 3938 * @return none
<> 135:176b8275d35d 3939 */
<> 135:176b8275d35d 3940
<> 135:176b8275d35d 3941 void arm_biquad_cascade_df2T_init_f64(
<> 135:176b8275d35d 3942 arm_biquad_cascade_df2T_instance_f64 * S,
<> 135:176b8275d35d 3943 uint8_t numStages,
<> 135:176b8275d35d 3944 float64_t * pCoeffs,
<> 135:176b8275d35d 3945 float64_t * pState);
<> 135:176b8275d35d 3946
<> 135:176b8275d35d 3947
<> 135:176b8275d35d 3948
<> 135:176b8275d35d 3949 /**
<> 135:176b8275d35d 3950 * @brief Instance structure for the Q15 FIR lattice filter.
<> 135:176b8275d35d 3951 */
<> 135:176b8275d35d 3952
<> 135:176b8275d35d 3953 typedef struct
<> 135:176b8275d35d 3954 {
<> 135:176b8275d35d 3955 uint16_t numStages; /**< number of filter stages. */
<> 135:176b8275d35d 3956 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 135:176b8275d35d 3957 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 3958 } arm_fir_lattice_instance_q15;
<> 135:176b8275d35d 3959
<> 135:176b8275d35d 3960 /**
<> 135:176b8275d35d 3961 * @brief Instance structure for the Q31 FIR lattice filter.
<> 135:176b8275d35d 3962 */
<> 135:176b8275d35d 3963
<> 135:176b8275d35d 3964 typedef struct
<> 135:176b8275d35d 3965 {
<> 135:176b8275d35d 3966 uint16_t numStages; /**< number of filter stages. */
<> 135:176b8275d35d 3967 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 135:176b8275d35d 3968 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 3969 } arm_fir_lattice_instance_q31;
<> 135:176b8275d35d 3970
<> 135:176b8275d35d 3971 /**
<> 135:176b8275d35d 3972 * @brief Instance structure for the floating-point FIR lattice filter.
<> 135:176b8275d35d 3973 */
<> 135:176b8275d35d 3974
<> 135:176b8275d35d 3975 typedef struct
<> 135:176b8275d35d 3976 {
<> 135:176b8275d35d 3977 uint16_t numStages; /**< number of filter stages. */
<> 135:176b8275d35d 3978 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 135:176b8275d35d 3979 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 3980 } arm_fir_lattice_instance_f32;
<> 135:176b8275d35d 3981
<> 135:176b8275d35d 3982 /**
<> 135:176b8275d35d 3983 * @brief Initialization function for the Q15 FIR lattice filter.
<> 135:176b8275d35d 3984 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 135:176b8275d35d 3985 * @param[in] numStages number of filter stages.
<> 135:176b8275d35d 3986 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 3987 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 135:176b8275d35d 3988 * @return none.
<> 135:176b8275d35d 3989 */
<> 135:176b8275d35d 3990
<> 135:176b8275d35d 3991 void arm_fir_lattice_init_q15(
<> 135:176b8275d35d 3992 arm_fir_lattice_instance_q15 * S,
<> 135:176b8275d35d 3993 uint16_t numStages,
<> 135:176b8275d35d 3994 q15_t * pCoeffs,
<> 135:176b8275d35d 3995 q15_t * pState);
<> 135:176b8275d35d 3996
<> 135:176b8275d35d 3997
<> 135:176b8275d35d 3998 /**
<> 135:176b8275d35d 3999 * @brief Processing function for the Q15 FIR lattice filter.
<> 135:176b8275d35d 4000 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 135:176b8275d35d 4001 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4002 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 4003 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4004 * @return none.
<> 135:176b8275d35d 4005 */
<> 135:176b8275d35d 4006 void arm_fir_lattice_q15(
<> 135:176b8275d35d 4007 const arm_fir_lattice_instance_q15 * S,
<> 135:176b8275d35d 4008 q15_t * pSrc,
<> 135:176b8275d35d 4009 q15_t * pDst,
<> 135:176b8275d35d 4010 uint32_t blockSize);
<> 135:176b8275d35d 4011
<> 135:176b8275d35d 4012 /**
<> 135:176b8275d35d 4013 * @brief Initialization function for the Q31 FIR lattice filter.
<> 135:176b8275d35d 4014 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 135:176b8275d35d 4015 * @param[in] numStages number of filter stages.
<> 135:176b8275d35d 4016 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 4017 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 135:176b8275d35d 4018 * @return none.
<> 135:176b8275d35d 4019 */
<> 135:176b8275d35d 4020
<> 135:176b8275d35d 4021 void arm_fir_lattice_init_q31(
<> 135:176b8275d35d 4022 arm_fir_lattice_instance_q31 * S,
<> 135:176b8275d35d 4023 uint16_t numStages,
<> 135:176b8275d35d 4024 q31_t * pCoeffs,
<> 135:176b8275d35d 4025 q31_t * pState);
<> 135:176b8275d35d 4026
<> 135:176b8275d35d 4027
<> 135:176b8275d35d 4028 /**
<> 135:176b8275d35d 4029 * @brief Processing function for the Q31 FIR lattice filter.
<> 135:176b8275d35d 4030 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 135:176b8275d35d 4031 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4032 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4033 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4034 * @return none.
<> 135:176b8275d35d 4035 */
<> 135:176b8275d35d 4036
<> 135:176b8275d35d 4037 void arm_fir_lattice_q31(
<> 135:176b8275d35d 4038 const arm_fir_lattice_instance_q31 * S,
<> 135:176b8275d35d 4039 q31_t * pSrc,
<> 135:176b8275d35d 4040 q31_t * pDst,
<> 135:176b8275d35d 4041 uint32_t blockSize);
<> 135:176b8275d35d 4042
<> 135:176b8275d35d 4043 /**
<> 135:176b8275d35d 4044 * @brief Initialization function for the floating-point FIR lattice filter.
<> 135:176b8275d35d 4045 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 135:176b8275d35d 4046 * @param[in] numStages number of filter stages.
<> 135:176b8275d35d 4047 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 4048 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 135:176b8275d35d 4049 * @return none.
<> 135:176b8275d35d 4050 */
<> 135:176b8275d35d 4051
<> 135:176b8275d35d 4052 void arm_fir_lattice_init_f32(
<> 135:176b8275d35d 4053 arm_fir_lattice_instance_f32 * S,
<> 135:176b8275d35d 4054 uint16_t numStages,
<> 135:176b8275d35d 4055 float32_t * pCoeffs,
<> 135:176b8275d35d 4056 float32_t * pState);
<> 135:176b8275d35d 4057
<> 135:176b8275d35d 4058 /**
<> 135:176b8275d35d 4059 * @brief Processing function for the floating-point FIR lattice filter.
<> 135:176b8275d35d 4060 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 135:176b8275d35d 4061 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4062 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4063 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4064 * @return none.
<> 135:176b8275d35d 4065 */
<> 135:176b8275d35d 4066
<> 135:176b8275d35d 4067 void arm_fir_lattice_f32(
<> 135:176b8275d35d 4068 const arm_fir_lattice_instance_f32 * S,
<> 135:176b8275d35d 4069 float32_t * pSrc,
<> 135:176b8275d35d 4070 float32_t * pDst,
<> 135:176b8275d35d 4071 uint32_t blockSize);
<> 135:176b8275d35d 4072
<> 135:176b8275d35d 4073 /**
<> 135:176b8275d35d 4074 * @brief Instance structure for the Q15 IIR lattice filter.
<> 135:176b8275d35d 4075 */
<> 135:176b8275d35d 4076 typedef struct
<> 135:176b8275d35d 4077 {
<> 135:176b8275d35d 4078 uint16_t numStages; /**< number of stages in the filter. */
<> 135:176b8275d35d 4079 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 135:176b8275d35d 4080 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 4081 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 135:176b8275d35d 4082 } arm_iir_lattice_instance_q15;
<> 135:176b8275d35d 4083
<> 135:176b8275d35d 4084 /**
<> 135:176b8275d35d 4085 * @brief Instance structure for the Q31 IIR lattice filter.
<> 135:176b8275d35d 4086 */
<> 135:176b8275d35d 4087 typedef struct
<> 135:176b8275d35d 4088 {
<> 135:176b8275d35d 4089 uint16_t numStages; /**< number of stages in the filter. */
<> 135:176b8275d35d 4090 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 135:176b8275d35d 4091 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 4092 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 135:176b8275d35d 4093 } arm_iir_lattice_instance_q31;
<> 135:176b8275d35d 4094
<> 135:176b8275d35d 4095 /**
<> 135:176b8275d35d 4096 * @brief Instance structure for the floating-point IIR lattice filter.
<> 135:176b8275d35d 4097 */
<> 135:176b8275d35d 4098 typedef struct
<> 135:176b8275d35d 4099 {
<> 135:176b8275d35d 4100 uint16_t numStages; /**< number of stages in the filter. */
<> 135:176b8275d35d 4101 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 135:176b8275d35d 4102 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 135:176b8275d35d 4103 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 135:176b8275d35d 4104 } arm_iir_lattice_instance_f32;
<> 135:176b8275d35d 4105
<> 135:176b8275d35d 4106 /**
<> 135:176b8275d35d 4107 * @brief Processing function for the floating-point IIR lattice filter.
<> 135:176b8275d35d 4108 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 135:176b8275d35d 4109 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4110 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 4111 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4112 * @return none.
<> 135:176b8275d35d 4113 */
<> 135:176b8275d35d 4114
<> 135:176b8275d35d 4115 void arm_iir_lattice_f32(
<> 135:176b8275d35d 4116 const arm_iir_lattice_instance_f32 * S,
<> 135:176b8275d35d 4117 float32_t * pSrc,
<> 135:176b8275d35d 4118 float32_t * pDst,
<> 135:176b8275d35d 4119 uint32_t blockSize);
<> 135:176b8275d35d 4120
<> 135:176b8275d35d 4121 /**
<> 135:176b8275d35d 4122 * @brief Initialization function for the floating-point IIR lattice filter.
<> 135:176b8275d35d 4123 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 135:176b8275d35d 4124 * @param[in] numStages number of stages in the filter.
<> 135:176b8275d35d 4125 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 4126 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 135:176b8275d35d 4127 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1.
<> 135:176b8275d35d 4128 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4129 * @return none.
<> 135:176b8275d35d 4130 */
<> 135:176b8275d35d 4131
<> 135:176b8275d35d 4132 void arm_iir_lattice_init_f32(
<> 135:176b8275d35d 4133 arm_iir_lattice_instance_f32 * S,
<> 135:176b8275d35d 4134 uint16_t numStages,
<> 135:176b8275d35d 4135 float32_t * pkCoeffs,
<> 135:176b8275d35d 4136 float32_t * pvCoeffs,
<> 135:176b8275d35d 4137 float32_t * pState,
<> 135:176b8275d35d 4138 uint32_t blockSize);
<> 135:176b8275d35d 4139
<> 135:176b8275d35d 4140
<> 135:176b8275d35d 4141 /**
<> 135:176b8275d35d 4142 * @brief Processing function for the Q31 IIR lattice filter.
<> 135:176b8275d35d 4143 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 135:176b8275d35d 4144 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4145 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 4146 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4147 * @return none.
<> 135:176b8275d35d 4148 */
<> 135:176b8275d35d 4149
<> 135:176b8275d35d 4150 void arm_iir_lattice_q31(
<> 135:176b8275d35d 4151 const arm_iir_lattice_instance_q31 * S,
<> 135:176b8275d35d 4152 q31_t * pSrc,
<> 135:176b8275d35d 4153 q31_t * pDst,
<> 135:176b8275d35d 4154 uint32_t blockSize);
<> 135:176b8275d35d 4155
<> 135:176b8275d35d 4156
<> 135:176b8275d35d 4157 /**
<> 135:176b8275d35d 4158 * @brief Initialization function for the Q31 IIR lattice filter.
<> 135:176b8275d35d 4159 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 135:176b8275d35d 4160 * @param[in] numStages number of stages in the filter.
<> 135:176b8275d35d 4161 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 4162 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 135:176b8275d35d 4163 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
<> 135:176b8275d35d 4164 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4165 * @return none.
<> 135:176b8275d35d 4166 */
<> 135:176b8275d35d 4167
<> 135:176b8275d35d 4168 void arm_iir_lattice_init_q31(
<> 135:176b8275d35d 4169 arm_iir_lattice_instance_q31 * S,
<> 135:176b8275d35d 4170 uint16_t numStages,
<> 135:176b8275d35d 4171 q31_t * pkCoeffs,
<> 135:176b8275d35d 4172 q31_t * pvCoeffs,
<> 135:176b8275d35d 4173 q31_t * pState,
<> 135:176b8275d35d 4174 uint32_t blockSize);
<> 135:176b8275d35d 4175
<> 135:176b8275d35d 4176
<> 135:176b8275d35d 4177 /**
<> 135:176b8275d35d 4178 * @brief Processing function for the Q15 IIR lattice filter.
<> 135:176b8275d35d 4179 * @param[in] *S points to an instance of the Q15 IIR lattice structure.
<> 135:176b8275d35d 4180 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4181 * @param[out] *pDst points to the block of output data.
<> 135:176b8275d35d 4182 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4183 * @return none.
<> 135:176b8275d35d 4184 */
<> 135:176b8275d35d 4185
<> 135:176b8275d35d 4186 void arm_iir_lattice_q15(
<> 135:176b8275d35d 4187 const arm_iir_lattice_instance_q15 * S,
<> 135:176b8275d35d 4188 q15_t * pSrc,
<> 135:176b8275d35d 4189 q15_t * pDst,
<> 135:176b8275d35d 4190 uint32_t blockSize);
<> 135:176b8275d35d 4191
<> 135:176b8275d35d 4192
<> 135:176b8275d35d 4193 /**
<> 135:176b8275d35d 4194 * @brief Initialization function for the Q15 IIR lattice filter.
<> 135:176b8275d35d 4195 * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
<> 135:176b8275d35d 4196 * @param[in] numStages number of stages in the filter.
<> 135:176b8275d35d 4197 * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
<> 135:176b8275d35d 4198 * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
<> 135:176b8275d35d 4199 * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
<> 135:176b8275d35d 4200 * @param[in] blockSize number of samples to process per call.
<> 135:176b8275d35d 4201 * @return none.
<> 135:176b8275d35d 4202 */
<> 135:176b8275d35d 4203
<> 135:176b8275d35d 4204 void arm_iir_lattice_init_q15(
<> 135:176b8275d35d 4205 arm_iir_lattice_instance_q15 * S,
<> 135:176b8275d35d 4206 uint16_t numStages,
<> 135:176b8275d35d 4207 q15_t * pkCoeffs,
<> 135:176b8275d35d 4208 q15_t * pvCoeffs,
<> 135:176b8275d35d 4209 q15_t * pState,
<> 135:176b8275d35d 4210 uint32_t blockSize);
<> 135:176b8275d35d 4211
<> 135:176b8275d35d 4212 /**
<> 135:176b8275d35d 4213 * @brief Instance structure for the floating-point LMS filter.
<> 135:176b8275d35d 4214 */
<> 135:176b8275d35d 4215
<> 135:176b8275d35d 4216 typedef struct
<> 135:176b8275d35d 4217 {
<> 135:176b8275d35d 4218 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4219 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4220 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4221 float32_t mu; /**< step size that controls filter coefficient updates. */
<> 135:176b8275d35d 4222 } arm_lms_instance_f32;
<> 135:176b8275d35d 4223
<> 135:176b8275d35d 4224 /**
<> 135:176b8275d35d 4225 * @brief Processing function for floating-point LMS filter.
<> 135:176b8275d35d 4226 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 135:176b8275d35d 4227 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4228 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4229 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4230 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4231 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4232 * @return none.
<> 135:176b8275d35d 4233 */
<> 135:176b8275d35d 4234
<> 135:176b8275d35d 4235 void arm_lms_f32(
<> 135:176b8275d35d 4236 const arm_lms_instance_f32 * S,
<> 135:176b8275d35d 4237 float32_t * pSrc,
<> 135:176b8275d35d 4238 float32_t * pRef,
<> 135:176b8275d35d 4239 float32_t * pOut,
<> 135:176b8275d35d 4240 float32_t * pErr,
<> 135:176b8275d35d 4241 uint32_t blockSize);
<> 135:176b8275d35d 4242
<> 135:176b8275d35d 4243 /**
<> 135:176b8275d35d 4244 * @brief Initialization function for floating-point LMS filter.
<> 135:176b8275d35d 4245 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 135:176b8275d35d 4246 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4247 * @param[in] *pCoeffs points to the coefficient buffer.
<> 135:176b8275d35d 4248 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 4249 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4250 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4251 * @return none.
<> 135:176b8275d35d 4252 */
<> 135:176b8275d35d 4253
<> 135:176b8275d35d 4254 void arm_lms_init_f32(
<> 135:176b8275d35d 4255 arm_lms_instance_f32 * S,
<> 135:176b8275d35d 4256 uint16_t numTaps,
<> 135:176b8275d35d 4257 float32_t * pCoeffs,
<> 135:176b8275d35d 4258 float32_t * pState,
<> 135:176b8275d35d 4259 float32_t mu,
<> 135:176b8275d35d 4260 uint32_t blockSize);
<> 135:176b8275d35d 4261
<> 135:176b8275d35d 4262 /**
<> 135:176b8275d35d 4263 * @brief Instance structure for the Q15 LMS filter.
<> 135:176b8275d35d 4264 */
<> 135:176b8275d35d 4265
<> 135:176b8275d35d 4266 typedef struct
<> 135:176b8275d35d 4267 {
<> 135:176b8275d35d 4268 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4269 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4270 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4271 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 135:176b8275d35d 4272 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 135:176b8275d35d 4273 } arm_lms_instance_q15;
<> 135:176b8275d35d 4274
<> 135:176b8275d35d 4275
<> 135:176b8275d35d 4276 /**
<> 135:176b8275d35d 4277 * @brief Initialization function for the Q15 LMS filter.
<> 135:176b8275d35d 4278 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 135:176b8275d35d 4279 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4280 * @param[in] *pCoeffs points to the coefficient buffer.
<> 135:176b8275d35d 4281 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 4282 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4283 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4284 * @param[in] postShift bit shift applied to coefficients.
<> 135:176b8275d35d 4285 * @return none.
<> 135:176b8275d35d 4286 */
<> 135:176b8275d35d 4287
<> 135:176b8275d35d 4288 void arm_lms_init_q15(
<> 135:176b8275d35d 4289 arm_lms_instance_q15 * S,
<> 135:176b8275d35d 4290 uint16_t numTaps,
<> 135:176b8275d35d 4291 q15_t * pCoeffs,
<> 135:176b8275d35d 4292 q15_t * pState,
<> 135:176b8275d35d 4293 q15_t mu,
<> 135:176b8275d35d 4294 uint32_t blockSize,
<> 135:176b8275d35d 4295 uint32_t postShift);
<> 135:176b8275d35d 4296
<> 135:176b8275d35d 4297 /**
<> 135:176b8275d35d 4298 * @brief Processing function for Q15 LMS filter.
<> 135:176b8275d35d 4299 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 135:176b8275d35d 4300 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4301 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4302 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4303 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4304 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4305 * @return none.
<> 135:176b8275d35d 4306 */
<> 135:176b8275d35d 4307
<> 135:176b8275d35d 4308 void arm_lms_q15(
<> 135:176b8275d35d 4309 const arm_lms_instance_q15 * S,
<> 135:176b8275d35d 4310 q15_t * pSrc,
<> 135:176b8275d35d 4311 q15_t * pRef,
<> 135:176b8275d35d 4312 q15_t * pOut,
<> 135:176b8275d35d 4313 q15_t * pErr,
<> 135:176b8275d35d 4314 uint32_t blockSize);
<> 135:176b8275d35d 4315
<> 135:176b8275d35d 4316
<> 135:176b8275d35d 4317 /**
<> 135:176b8275d35d 4318 * @brief Instance structure for the Q31 LMS filter.
<> 135:176b8275d35d 4319 */
<> 135:176b8275d35d 4320
<> 135:176b8275d35d 4321 typedef struct
<> 135:176b8275d35d 4322 {
<> 135:176b8275d35d 4323 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4324 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4325 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4326 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 135:176b8275d35d 4327 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 135:176b8275d35d 4328
<> 135:176b8275d35d 4329 } arm_lms_instance_q31;
<> 135:176b8275d35d 4330
<> 135:176b8275d35d 4331 /**
<> 135:176b8275d35d 4332 * @brief Processing function for Q31 LMS filter.
<> 135:176b8275d35d 4333 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 135:176b8275d35d 4334 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4335 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4336 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4337 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4338 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4339 * @return none.
<> 135:176b8275d35d 4340 */
<> 135:176b8275d35d 4341
<> 135:176b8275d35d 4342 void arm_lms_q31(
<> 135:176b8275d35d 4343 const arm_lms_instance_q31 * S,
<> 135:176b8275d35d 4344 q31_t * pSrc,
<> 135:176b8275d35d 4345 q31_t * pRef,
<> 135:176b8275d35d 4346 q31_t * pOut,
<> 135:176b8275d35d 4347 q31_t * pErr,
<> 135:176b8275d35d 4348 uint32_t blockSize);
<> 135:176b8275d35d 4349
<> 135:176b8275d35d 4350 /**
<> 135:176b8275d35d 4351 * @brief Initialization function for Q31 LMS filter.
<> 135:176b8275d35d 4352 * @param[in] *S points to an instance of the Q31 LMS filter structure.
<> 135:176b8275d35d 4353 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4354 * @param[in] *pCoeffs points to coefficient buffer.
<> 135:176b8275d35d 4355 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 4356 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4357 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4358 * @param[in] postShift bit shift applied to coefficients.
<> 135:176b8275d35d 4359 * @return none.
<> 135:176b8275d35d 4360 */
<> 135:176b8275d35d 4361
<> 135:176b8275d35d 4362 void arm_lms_init_q31(
<> 135:176b8275d35d 4363 arm_lms_instance_q31 * S,
<> 135:176b8275d35d 4364 uint16_t numTaps,
<> 135:176b8275d35d 4365 q31_t * pCoeffs,
<> 135:176b8275d35d 4366 q31_t * pState,
<> 135:176b8275d35d 4367 q31_t mu,
<> 135:176b8275d35d 4368 uint32_t blockSize,
<> 135:176b8275d35d 4369 uint32_t postShift);
<> 135:176b8275d35d 4370
<> 135:176b8275d35d 4371 /**
<> 135:176b8275d35d 4372 * @brief Instance structure for the floating-point normalized LMS filter.
<> 135:176b8275d35d 4373 */
<> 135:176b8275d35d 4374
<> 135:176b8275d35d 4375 typedef struct
<> 135:176b8275d35d 4376 {
<> 135:176b8275d35d 4377 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4378 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4379 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4380 float32_t mu; /**< step size that control filter coefficient updates. */
<> 135:176b8275d35d 4381 float32_t energy; /**< saves previous frame energy. */
<> 135:176b8275d35d 4382 float32_t x0; /**< saves previous input sample. */
<> 135:176b8275d35d 4383 } arm_lms_norm_instance_f32;
<> 135:176b8275d35d 4384
<> 135:176b8275d35d 4385 /**
<> 135:176b8275d35d 4386 * @brief Processing function for floating-point normalized LMS filter.
<> 135:176b8275d35d 4387 * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
<> 135:176b8275d35d 4388 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4389 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4390 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4391 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4392 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4393 * @return none.
<> 135:176b8275d35d 4394 */
<> 135:176b8275d35d 4395
<> 135:176b8275d35d 4396 void arm_lms_norm_f32(
<> 135:176b8275d35d 4397 arm_lms_norm_instance_f32 * S,
<> 135:176b8275d35d 4398 float32_t * pSrc,
<> 135:176b8275d35d 4399 float32_t * pRef,
<> 135:176b8275d35d 4400 float32_t * pOut,
<> 135:176b8275d35d 4401 float32_t * pErr,
<> 135:176b8275d35d 4402 uint32_t blockSize);
<> 135:176b8275d35d 4403
<> 135:176b8275d35d 4404 /**
<> 135:176b8275d35d 4405 * @brief Initialization function for floating-point normalized LMS filter.
<> 135:176b8275d35d 4406 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 135:176b8275d35d 4407 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4408 * @param[in] *pCoeffs points to coefficient buffer.
<> 135:176b8275d35d 4409 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 4410 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4411 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4412 * @return none.
<> 135:176b8275d35d 4413 */
<> 135:176b8275d35d 4414
<> 135:176b8275d35d 4415 void arm_lms_norm_init_f32(
<> 135:176b8275d35d 4416 arm_lms_norm_instance_f32 * S,
<> 135:176b8275d35d 4417 uint16_t numTaps,
<> 135:176b8275d35d 4418 float32_t * pCoeffs,
<> 135:176b8275d35d 4419 float32_t * pState,
<> 135:176b8275d35d 4420 float32_t mu,
<> 135:176b8275d35d 4421 uint32_t blockSize);
<> 135:176b8275d35d 4422
<> 135:176b8275d35d 4423
<> 135:176b8275d35d 4424 /**
<> 135:176b8275d35d 4425 * @brief Instance structure for the Q31 normalized LMS filter.
<> 135:176b8275d35d 4426 */
<> 135:176b8275d35d 4427 typedef struct
<> 135:176b8275d35d 4428 {
<> 135:176b8275d35d 4429 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4430 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4431 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4432 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 135:176b8275d35d 4433 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 135:176b8275d35d 4434 q31_t *recipTable; /**< points to the reciprocal initial value table. */
<> 135:176b8275d35d 4435 q31_t energy; /**< saves previous frame energy. */
<> 135:176b8275d35d 4436 q31_t x0; /**< saves previous input sample. */
<> 135:176b8275d35d 4437 } arm_lms_norm_instance_q31;
<> 135:176b8275d35d 4438
<> 135:176b8275d35d 4439 /**
<> 135:176b8275d35d 4440 * @brief Processing function for Q31 normalized LMS filter.
<> 135:176b8275d35d 4441 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 135:176b8275d35d 4442 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4443 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4444 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4445 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4446 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4447 * @return none.
<> 135:176b8275d35d 4448 */
<> 135:176b8275d35d 4449
<> 135:176b8275d35d 4450 void arm_lms_norm_q31(
<> 135:176b8275d35d 4451 arm_lms_norm_instance_q31 * S,
<> 135:176b8275d35d 4452 q31_t * pSrc,
<> 135:176b8275d35d 4453 q31_t * pRef,
<> 135:176b8275d35d 4454 q31_t * pOut,
<> 135:176b8275d35d 4455 q31_t * pErr,
<> 135:176b8275d35d 4456 uint32_t blockSize);
<> 135:176b8275d35d 4457
<> 135:176b8275d35d 4458 /**
<> 135:176b8275d35d 4459 * @brief Initialization function for Q31 normalized LMS filter.
<> 135:176b8275d35d 4460 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 135:176b8275d35d 4461 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4462 * @param[in] *pCoeffs points to coefficient buffer.
<> 135:176b8275d35d 4463 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 4464 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4465 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4466 * @param[in] postShift bit shift applied to coefficients.
<> 135:176b8275d35d 4467 * @return none.
<> 135:176b8275d35d 4468 */
<> 135:176b8275d35d 4469
<> 135:176b8275d35d 4470 void arm_lms_norm_init_q31(
<> 135:176b8275d35d 4471 arm_lms_norm_instance_q31 * S,
<> 135:176b8275d35d 4472 uint16_t numTaps,
<> 135:176b8275d35d 4473 q31_t * pCoeffs,
<> 135:176b8275d35d 4474 q31_t * pState,
<> 135:176b8275d35d 4475 q31_t mu,
<> 135:176b8275d35d 4476 uint32_t blockSize,
<> 135:176b8275d35d 4477 uint8_t postShift);
<> 135:176b8275d35d 4478
<> 135:176b8275d35d 4479 /**
<> 135:176b8275d35d 4480 * @brief Instance structure for the Q15 normalized LMS filter.
<> 135:176b8275d35d 4481 */
<> 135:176b8275d35d 4482
<> 135:176b8275d35d 4483 typedef struct
<> 135:176b8275d35d 4484 {
<> 135:176b8275d35d 4485 uint16_t numTaps; /**< Number of coefficients in the filter. */
<> 135:176b8275d35d 4486 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 135:176b8275d35d 4487 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 135:176b8275d35d 4488 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 135:176b8275d35d 4489 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 135:176b8275d35d 4490 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
<> 135:176b8275d35d 4491 q15_t energy; /**< saves previous frame energy. */
<> 135:176b8275d35d 4492 q15_t x0; /**< saves previous input sample. */
<> 135:176b8275d35d 4493 } arm_lms_norm_instance_q15;
<> 135:176b8275d35d 4494
<> 135:176b8275d35d 4495 /**
<> 135:176b8275d35d 4496 * @brief Processing function for Q15 normalized LMS filter.
<> 135:176b8275d35d 4497 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 135:176b8275d35d 4498 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4499 * @param[in] *pRef points to the block of reference data.
<> 135:176b8275d35d 4500 * @param[out] *pOut points to the block of output data.
<> 135:176b8275d35d 4501 * @param[out] *pErr points to the block of error data.
<> 135:176b8275d35d 4502 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4503 * @return none.
<> 135:176b8275d35d 4504 */
<> 135:176b8275d35d 4505
<> 135:176b8275d35d 4506 void arm_lms_norm_q15(
<> 135:176b8275d35d 4507 arm_lms_norm_instance_q15 * S,
<> 135:176b8275d35d 4508 q15_t * pSrc,
<> 135:176b8275d35d 4509 q15_t * pRef,
<> 135:176b8275d35d 4510 q15_t * pOut,
<> 135:176b8275d35d 4511 q15_t * pErr,
<> 135:176b8275d35d 4512 uint32_t blockSize);
<> 135:176b8275d35d 4513
<> 135:176b8275d35d 4514
<> 135:176b8275d35d 4515 /**
<> 135:176b8275d35d 4516 * @brief Initialization function for Q15 normalized LMS filter.
<> 135:176b8275d35d 4517 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 135:176b8275d35d 4518 * @param[in] numTaps number of filter coefficients.
<> 135:176b8275d35d 4519 * @param[in] *pCoeffs points to coefficient buffer.
<> 135:176b8275d35d 4520 * @param[in] *pState points to state buffer.
<> 135:176b8275d35d 4521 * @param[in] mu step size that controls filter coefficient updates.
<> 135:176b8275d35d 4522 * @param[in] blockSize number of samples to process.
<> 135:176b8275d35d 4523 * @param[in] postShift bit shift applied to coefficients.
<> 135:176b8275d35d 4524 * @return none.
<> 135:176b8275d35d 4525 */
<> 135:176b8275d35d 4526
<> 135:176b8275d35d 4527 void arm_lms_norm_init_q15(
<> 135:176b8275d35d 4528 arm_lms_norm_instance_q15 * S,
<> 135:176b8275d35d 4529 uint16_t numTaps,
<> 135:176b8275d35d 4530 q15_t * pCoeffs,
<> 135:176b8275d35d 4531 q15_t * pState,
<> 135:176b8275d35d 4532 q15_t mu,
<> 135:176b8275d35d 4533 uint32_t blockSize,
<> 135:176b8275d35d 4534 uint8_t postShift);
<> 135:176b8275d35d 4535
<> 135:176b8275d35d 4536 /**
<> 135:176b8275d35d 4537 * @brief Correlation of floating-point sequences.
<> 135:176b8275d35d 4538 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4539 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4540 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4541 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4542 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4543 * @return none.
<> 135:176b8275d35d 4544 */
<> 135:176b8275d35d 4545
<> 135:176b8275d35d 4546 void arm_correlate_f32(
<> 135:176b8275d35d 4547 float32_t * pSrcA,
<> 135:176b8275d35d 4548 uint32_t srcALen,
<> 135:176b8275d35d 4549 float32_t * pSrcB,
<> 135:176b8275d35d 4550 uint32_t srcBLen,
<> 135:176b8275d35d 4551 float32_t * pDst);
<> 135:176b8275d35d 4552
<> 135:176b8275d35d 4553
<> 135:176b8275d35d 4554 /**
<> 135:176b8275d35d 4555 * @brief Correlation of Q15 sequences
<> 135:176b8275d35d 4556 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4557 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4558 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4559 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4560 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4561 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 4562 * @return none.
<> 135:176b8275d35d 4563 */
<> 135:176b8275d35d 4564 void arm_correlate_opt_q15(
<> 135:176b8275d35d 4565 q15_t * pSrcA,
<> 135:176b8275d35d 4566 uint32_t srcALen,
<> 135:176b8275d35d 4567 q15_t * pSrcB,
<> 135:176b8275d35d 4568 uint32_t srcBLen,
<> 135:176b8275d35d 4569 q15_t * pDst,
<> 135:176b8275d35d 4570 q15_t * pScratch);
<> 135:176b8275d35d 4571
<> 135:176b8275d35d 4572
<> 135:176b8275d35d 4573 /**
<> 135:176b8275d35d 4574 * @brief Correlation of Q15 sequences.
<> 135:176b8275d35d 4575 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4576 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4577 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4578 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4579 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4580 * @return none.
<> 135:176b8275d35d 4581 */
<> 135:176b8275d35d 4582
<> 135:176b8275d35d 4583 void arm_correlate_q15(
<> 135:176b8275d35d 4584 q15_t * pSrcA,
<> 135:176b8275d35d 4585 uint32_t srcALen,
<> 135:176b8275d35d 4586 q15_t * pSrcB,
<> 135:176b8275d35d 4587 uint32_t srcBLen,
<> 135:176b8275d35d 4588 q15_t * pDst);
<> 135:176b8275d35d 4589
<> 135:176b8275d35d 4590 /**
<> 135:176b8275d35d 4591 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 4592 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4593 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4594 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4595 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4596 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4597 * @return none.
<> 135:176b8275d35d 4598 */
<> 135:176b8275d35d 4599
<> 135:176b8275d35d 4600 void arm_correlate_fast_q15(
<> 135:176b8275d35d 4601 q15_t * pSrcA,
<> 135:176b8275d35d 4602 uint32_t srcALen,
<> 135:176b8275d35d 4603 q15_t * pSrcB,
<> 135:176b8275d35d 4604 uint32_t srcBLen,
<> 135:176b8275d35d 4605 q15_t * pDst);
<> 135:176b8275d35d 4606
<> 135:176b8275d35d 4607
<> 135:176b8275d35d 4608
<> 135:176b8275d35d 4609 /**
<> 135:176b8275d35d 4610 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 135:176b8275d35d 4611 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4612 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4613 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4614 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4615 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4616 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 4617 * @return none.
<> 135:176b8275d35d 4618 */
<> 135:176b8275d35d 4619
<> 135:176b8275d35d 4620 void arm_correlate_fast_opt_q15(
<> 135:176b8275d35d 4621 q15_t * pSrcA,
<> 135:176b8275d35d 4622 uint32_t srcALen,
<> 135:176b8275d35d 4623 q15_t * pSrcB,
<> 135:176b8275d35d 4624 uint32_t srcBLen,
<> 135:176b8275d35d 4625 q15_t * pDst,
<> 135:176b8275d35d 4626 q15_t * pScratch);
<> 135:176b8275d35d 4627
<> 135:176b8275d35d 4628 /**
<> 135:176b8275d35d 4629 * @brief Correlation of Q31 sequences.
<> 135:176b8275d35d 4630 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4631 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4632 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4633 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4634 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4635 * @return none.
<> 135:176b8275d35d 4636 */
<> 135:176b8275d35d 4637
<> 135:176b8275d35d 4638 void arm_correlate_q31(
<> 135:176b8275d35d 4639 q31_t * pSrcA,
<> 135:176b8275d35d 4640 uint32_t srcALen,
<> 135:176b8275d35d 4641 q31_t * pSrcB,
<> 135:176b8275d35d 4642 uint32_t srcBLen,
<> 135:176b8275d35d 4643 q31_t * pDst);
<> 135:176b8275d35d 4644
<> 135:176b8275d35d 4645 /**
<> 135:176b8275d35d 4646 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 135:176b8275d35d 4647 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4648 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4649 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4650 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4651 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4652 * @return none.
<> 135:176b8275d35d 4653 */
<> 135:176b8275d35d 4654
<> 135:176b8275d35d 4655 void arm_correlate_fast_q31(
<> 135:176b8275d35d 4656 q31_t * pSrcA,
<> 135:176b8275d35d 4657 uint32_t srcALen,
<> 135:176b8275d35d 4658 q31_t * pSrcB,
<> 135:176b8275d35d 4659 uint32_t srcBLen,
<> 135:176b8275d35d 4660 q31_t * pDst);
<> 135:176b8275d35d 4661
<> 135:176b8275d35d 4662
<> 135:176b8275d35d 4663
<> 135:176b8275d35d 4664 /**
<> 135:176b8275d35d 4665 * @brief Correlation of Q7 sequences.
<> 135:176b8275d35d 4666 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4667 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4668 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4669 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4670 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4671 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 135:176b8275d35d 4672 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 135:176b8275d35d 4673 * @return none.
<> 135:176b8275d35d 4674 */
<> 135:176b8275d35d 4675
<> 135:176b8275d35d 4676 void arm_correlate_opt_q7(
<> 135:176b8275d35d 4677 q7_t * pSrcA,
<> 135:176b8275d35d 4678 uint32_t srcALen,
<> 135:176b8275d35d 4679 q7_t * pSrcB,
<> 135:176b8275d35d 4680 uint32_t srcBLen,
<> 135:176b8275d35d 4681 q7_t * pDst,
<> 135:176b8275d35d 4682 q15_t * pScratch1,
<> 135:176b8275d35d 4683 q15_t * pScratch2);
<> 135:176b8275d35d 4684
<> 135:176b8275d35d 4685
<> 135:176b8275d35d 4686 /**
<> 135:176b8275d35d 4687 * @brief Correlation of Q7 sequences.
<> 135:176b8275d35d 4688 * @param[in] *pSrcA points to the first input sequence.
<> 135:176b8275d35d 4689 * @param[in] srcALen length of the first input sequence.
<> 135:176b8275d35d 4690 * @param[in] *pSrcB points to the second input sequence.
<> 135:176b8275d35d 4691 * @param[in] srcBLen length of the second input sequence.
<> 135:176b8275d35d 4692 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 135:176b8275d35d 4693 * @return none.
<> 135:176b8275d35d 4694 */
<> 135:176b8275d35d 4695
<> 135:176b8275d35d 4696 void arm_correlate_q7(
<> 135:176b8275d35d 4697 q7_t * pSrcA,
<> 135:176b8275d35d 4698 uint32_t srcALen,
<> 135:176b8275d35d 4699 q7_t * pSrcB,
<> 135:176b8275d35d 4700 uint32_t srcBLen,
<> 135:176b8275d35d 4701 q7_t * pDst);
<> 135:176b8275d35d 4702
<> 135:176b8275d35d 4703
<> 135:176b8275d35d 4704 /**
<> 135:176b8275d35d 4705 * @brief Instance structure for the floating-point sparse FIR filter.
<> 135:176b8275d35d 4706 */
<> 135:176b8275d35d 4707 typedef struct
<> 135:176b8275d35d 4708 {
<> 135:176b8275d35d 4709 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4710 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 135:176b8275d35d 4711 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 135:176b8275d35d 4712 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 4713 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 135:176b8275d35d 4714 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 135:176b8275d35d 4715 } arm_fir_sparse_instance_f32;
<> 135:176b8275d35d 4716
<> 135:176b8275d35d 4717 /**
<> 135:176b8275d35d 4718 * @brief Instance structure for the Q31 sparse FIR filter.
<> 135:176b8275d35d 4719 */
<> 135:176b8275d35d 4720
<> 135:176b8275d35d 4721 typedef struct
<> 135:176b8275d35d 4722 {
<> 135:176b8275d35d 4723 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4724 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 135:176b8275d35d 4725 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 135:176b8275d35d 4726 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 4727 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 135:176b8275d35d 4728 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 135:176b8275d35d 4729 } arm_fir_sparse_instance_q31;
<> 135:176b8275d35d 4730
<> 135:176b8275d35d 4731 /**
<> 135:176b8275d35d 4732 * @brief Instance structure for the Q15 sparse FIR filter.
<> 135:176b8275d35d 4733 */
<> 135:176b8275d35d 4734
<> 135:176b8275d35d 4735 typedef struct
<> 135:176b8275d35d 4736 {
<> 135:176b8275d35d 4737 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4738 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 135:176b8275d35d 4739 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 135:176b8275d35d 4740 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 4741 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 135:176b8275d35d 4742 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 135:176b8275d35d 4743 } arm_fir_sparse_instance_q15;
<> 135:176b8275d35d 4744
<> 135:176b8275d35d 4745 /**
<> 135:176b8275d35d 4746 * @brief Instance structure for the Q7 sparse FIR filter.
<> 135:176b8275d35d 4747 */
<> 135:176b8275d35d 4748
<> 135:176b8275d35d 4749 typedef struct
<> 135:176b8275d35d 4750 {
<> 135:176b8275d35d 4751 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 135:176b8275d35d 4752 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 135:176b8275d35d 4753 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 135:176b8275d35d 4754 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 135:176b8275d35d 4755 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 135:176b8275d35d 4756 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 135:176b8275d35d 4757 } arm_fir_sparse_instance_q7;
<> 135:176b8275d35d 4758
<> 135:176b8275d35d 4759 /**
<> 135:176b8275d35d 4760 * @brief Processing function for the floating-point sparse FIR filter.
<> 135:176b8275d35d 4761 * @param[in] *S points to an instance of the floating-point sparse FIR structure.
<> 135:176b8275d35d 4762 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4763 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4764 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4765 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 4766 * @return none.
<> 135:176b8275d35d 4767 */
<> 135:176b8275d35d 4768
<> 135:176b8275d35d 4769 void arm_fir_sparse_f32(
<> 135:176b8275d35d 4770 arm_fir_sparse_instance_f32 * S,
<> 135:176b8275d35d 4771 float32_t * pSrc,
<> 135:176b8275d35d 4772 float32_t * pDst,
<> 135:176b8275d35d 4773 float32_t * pScratchIn,
<> 135:176b8275d35d 4774 uint32_t blockSize);
<> 135:176b8275d35d 4775
<> 135:176b8275d35d 4776 /**
<> 135:176b8275d35d 4777 * @brief Initialization function for the floating-point sparse FIR filter.
<> 135:176b8275d35d 4778 * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
<> 135:176b8275d35d 4779 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 135:176b8275d35d 4780 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 135:176b8275d35d 4781 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 4782 * @param[in] *pTapDelay points to the array of offset times.
<> 135:176b8275d35d 4783 * @param[in] maxDelay maximum offset time supported.
<> 135:176b8275d35d 4784 * @param[in] blockSize number of samples that will be processed per block.
<> 135:176b8275d35d 4785 * @return none
<> 135:176b8275d35d 4786 */
<> 135:176b8275d35d 4787
<> 135:176b8275d35d 4788 void arm_fir_sparse_init_f32(
<> 135:176b8275d35d 4789 arm_fir_sparse_instance_f32 * S,
<> 135:176b8275d35d 4790 uint16_t numTaps,
<> 135:176b8275d35d 4791 float32_t * pCoeffs,
<> 135:176b8275d35d 4792 float32_t * pState,
<> 135:176b8275d35d 4793 int32_t * pTapDelay,
<> 135:176b8275d35d 4794 uint16_t maxDelay,
<> 135:176b8275d35d 4795 uint32_t blockSize);
<> 135:176b8275d35d 4796
<> 135:176b8275d35d 4797 /**
<> 135:176b8275d35d 4798 * @brief Processing function for the Q31 sparse FIR filter.
<> 135:176b8275d35d 4799 * @param[in] *S points to an instance of the Q31 sparse FIR structure.
<> 135:176b8275d35d 4800 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4801 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4802 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4803 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 4804 * @return none.
<> 135:176b8275d35d 4805 */
<> 135:176b8275d35d 4806
<> 135:176b8275d35d 4807 void arm_fir_sparse_q31(
<> 135:176b8275d35d 4808 arm_fir_sparse_instance_q31 * S,
<> 135:176b8275d35d 4809 q31_t * pSrc,
<> 135:176b8275d35d 4810 q31_t * pDst,
<> 135:176b8275d35d 4811 q31_t * pScratchIn,
<> 135:176b8275d35d 4812 uint32_t blockSize);
<> 135:176b8275d35d 4813
<> 135:176b8275d35d 4814 /**
<> 135:176b8275d35d 4815 * @brief Initialization function for the Q31 sparse FIR filter.
<> 135:176b8275d35d 4816 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
<> 135:176b8275d35d 4817 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 135:176b8275d35d 4818 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 135:176b8275d35d 4819 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 4820 * @param[in] *pTapDelay points to the array of offset times.
<> 135:176b8275d35d 4821 * @param[in] maxDelay maximum offset time supported.
<> 135:176b8275d35d 4822 * @param[in] blockSize number of samples that will be processed per block.
<> 135:176b8275d35d 4823 * @return none
<> 135:176b8275d35d 4824 */
<> 135:176b8275d35d 4825
<> 135:176b8275d35d 4826 void arm_fir_sparse_init_q31(
<> 135:176b8275d35d 4827 arm_fir_sparse_instance_q31 * S,
<> 135:176b8275d35d 4828 uint16_t numTaps,
<> 135:176b8275d35d 4829 q31_t * pCoeffs,
<> 135:176b8275d35d 4830 q31_t * pState,
<> 135:176b8275d35d 4831 int32_t * pTapDelay,
<> 135:176b8275d35d 4832 uint16_t maxDelay,
<> 135:176b8275d35d 4833 uint32_t blockSize);
<> 135:176b8275d35d 4834
<> 135:176b8275d35d 4835 /**
<> 135:176b8275d35d 4836 * @brief Processing function for the Q15 sparse FIR filter.
<> 135:176b8275d35d 4837 * @param[in] *S points to an instance of the Q15 sparse FIR structure.
<> 135:176b8275d35d 4838 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4839 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4840 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4841 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4842 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 4843 * @return none.
<> 135:176b8275d35d 4844 */
<> 135:176b8275d35d 4845
<> 135:176b8275d35d 4846 void arm_fir_sparse_q15(
<> 135:176b8275d35d 4847 arm_fir_sparse_instance_q15 * S,
<> 135:176b8275d35d 4848 q15_t * pSrc,
<> 135:176b8275d35d 4849 q15_t * pDst,
<> 135:176b8275d35d 4850 q15_t * pScratchIn,
<> 135:176b8275d35d 4851 q31_t * pScratchOut,
<> 135:176b8275d35d 4852 uint32_t blockSize);
<> 135:176b8275d35d 4853
<> 135:176b8275d35d 4854
<> 135:176b8275d35d 4855 /**
<> 135:176b8275d35d 4856 * @brief Initialization function for the Q15 sparse FIR filter.
<> 135:176b8275d35d 4857 * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
<> 135:176b8275d35d 4858 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 135:176b8275d35d 4859 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 135:176b8275d35d 4860 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 4861 * @param[in] *pTapDelay points to the array of offset times.
<> 135:176b8275d35d 4862 * @param[in] maxDelay maximum offset time supported.
<> 135:176b8275d35d 4863 * @param[in] blockSize number of samples that will be processed per block.
<> 135:176b8275d35d 4864 * @return none
<> 135:176b8275d35d 4865 */
<> 135:176b8275d35d 4866
<> 135:176b8275d35d 4867 void arm_fir_sparse_init_q15(
<> 135:176b8275d35d 4868 arm_fir_sparse_instance_q15 * S,
<> 135:176b8275d35d 4869 uint16_t numTaps,
<> 135:176b8275d35d 4870 q15_t * pCoeffs,
<> 135:176b8275d35d 4871 q15_t * pState,
<> 135:176b8275d35d 4872 int32_t * pTapDelay,
<> 135:176b8275d35d 4873 uint16_t maxDelay,
<> 135:176b8275d35d 4874 uint32_t blockSize);
<> 135:176b8275d35d 4875
<> 135:176b8275d35d 4876 /**
<> 135:176b8275d35d 4877 * @brief Processing function for the Q7 sparse FIR filter.
<> 135:176b8275d35d 4878 * @param[in] *S points to an instance of the Q7 sparse FIR structure.
<> 135:176b8275d35d 4879 * @param[in] *pSrc points to the block of input data.
<> 135:176b8275d35d 4880 * @param[out] *pDst points to the block of output data
<> 135:176b8275d35d 4881 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4882 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 135:176b8275d35d 4883 * @param[in] blockSize number of input samples to process per call.
<> 135:176b8275d35d 4884 * @return none.
<> 135:176b8275d35d 4885 */
<> 135:176b8275d35d 4886
<> 135:176b8275d35d 4887 void arm_fir_sparse_q7(
<> 135:176b8275d35d 4888 arm_fir_sparse_instance_q7 * S,
<> 135:176b8275d35d 4889 q7_t * pSrc,
<> 135:176b8275d35d 4890 q7_t * pDst,
<> 135:176b8275d35d 4891 q7_t * pScratchIn,
<> 135:176b8275d35d 4892 q31_t * pScratchOut,
<> 135:176b8275d35d 4893 uint32_t blockSize);
<> 135:176b8275d35d 4894
<> 135:176b8275d35d 4895 /**
<> 135:176b8275d35d 4896 * @brief Initialization function for the Q7 sparse FIR filter.
<> 135:176b8275d35d 4897 * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
<> 135:176b8275d35d 4898 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 135:176b8275d35d 4899 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 135:176b8275d35d 4900 * @param[in] *pState points to the state buffer.
<> 135:176b8275d35d 4901 * @param[in] *pTapDelay points to the array of offset times.
<> 135:176b8275d35d 4902 * @param[in] maxDelay maximum offset time supported.
<> 135:176b8275d35d 4903 * @param[in] blockSize number of samples that will be processed per block.
<> 135:176b8275d35d 4904 * @return none
<> 135:176b8275d35d 4905 */
<> 135:176b8275d35d 4906
<> 135:176b8275d35d 4907 void arm_fir_sparse_init_q7(
<> 135:176b8275d35d 4908 arm_fir_sparse_instance_q7 * S,
<> 135:176b8275d35d 4909 uint16_t numTaps,
<> 135:176b8275d35d 4910 q7_t * pCoeffs,
<> 135:176b8275d35d 4911 q7_t * pState,
<> 135:176b8275d35d 4912 int32_t * pTapDelay,
<> 135:176b8275d35d 4913 uint16_t maxDelay,
<> 135:176b8275d35d 4914 uint32_t blockSize);
<> 135:176b8275d35d 4915
<> 135:176b8275d35d 4916
<> 135:176b8275d35d 4917 /*
<> 135:176b8275d35d 4918 * @brief Floating-point sin_cos function.
<> 135:176b8275d35d 4919 * @param[in] theta input value in degrees
<> 135:176b8275d35d 4920 * @param[out] *pSinVal points to the processed sine output.
<> 135:176b8275d35d 4921 * @param[out] *pCosVal points to the processed cos output.
<> 135:176b8275d35d 4922 * @return none.
<> 135:176b8275d35d 4923 */
<> 135:176b8275d35d 4924
<> 135:176b8275d35d 4925 void arm_sin_cos_f32(
<> 135:176b8275d35d 4926 float32_t theta,
<> 135:176b8275d35d 4927 float32_t * pSinVal,
<> 135:176b8275d35d 4928 float32_t * pCcosVal);
<> 135:176b8275d35d 4929
<> 135:176b8275d35d 4930 /*
<> 135:176b8275d35d 4931 * @brief Q31 sin_cos function.
<> 135:176b8275d35d 4932 * @param[in] theta scaled input value in degrees
<> 135:176b8275d35d 4933 * @param[out] *pSinVal points to the processed sine output.
<> 135:176b8275d35d 4934 * @param[out] *pCosVal points to the processed cosine output.
<> 135:176b8275d35d 4935 * @return none.
<> 135:176b8275d35d 4936 */
<> 135:176b8275d35d 4937
<> 135:176b8275d35d 4938 void arm_sin_cos_q31(
<> 135:176b8275d35d 4939 q31_t theta,
<> 135:176b8275d35d 4940 q31_t * pSinVal,
<> 135:176b8275d35d 4941 q31_t * pCosVal);
<> 135:176b8275d35d 4942
<> 135:176b8275d35d 4943
<> 135:176b8275d35d 4944 /**
<> 135:176b8275d35d 4945 * @brief Floating-point complex conjugate.
<> 135:176b8275d35d 4946 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 4947 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 4948 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 4949 * @return none.
<> 135:176b8275d35d 4950 */
<> 135:176b8275d35d 4951
<> 135:176b8275d35d 4952 void arm_cmplx_conj_f32(
<> 135:176b8275d35d 4953 float32_t * pSrc,
<> 135:176b8275d35d 4954 float32_t * pDst,
<> 135:176b8275d35d 4955 uint32_t numSamples);
<> 135:176b8275d35d 4956
<> 135:176b8275d35d 4957 /**
<> 135:176b8275d35d 4958 * @brief Q31 complex conjugate.
<> 135:176b8275d35d 4959 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 4960 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 4961 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 4962 * @return none.
<> 135:176b8275d35d 4963 */
<> 135:176b8275d35d 4964
<> 135:176b8275d35d 4965 void arm_cmplx_conj_q31(
<> 135:176b8275d35d 4966 q31_t * pSrc,
<> 135:176b8275d35d 4967 q31_t * pDst,
<> 135:176b8275d35d 4968 uint32_t numSamples);
<> 135:176b8275d35d 4969
<> 135:176b8275d35d 4970 /**
<> 135:176b8275d35d 4971 * @brief Q15 complex conjugate.
<> 135:176b8275d35d 4972 * @param[in] *pSrc points to the input vector
<> 135:176b8275d35d 4973 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 4974 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 4975 * @return none.
<> 135:176b8275d35d 4976 */
<> 135:176b8275d35d 4977
<> 135:176b8275d35d 4978 void arm_cmplx_conj_q15(
<> 135:176b8275d35d 4979 q15_t * pSrc,
<> 135:176b8275d35d 4980 q15_t * pDst,
<> 135:176b8275d35d 4981 uint32_t numSamples);
<> 135:176b8275d35d 4982
<> 135:176b8275d35d 4983
<> 135:176b8275d35d 4984
<> 135:176b8275d35d 4985 /**
<> 135:176b8275d35d 4986 * @brief Floating-point complex magnitude squared
<> 135:176b8275d35d 4987 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 4988 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 4989 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 4990 * @return none.
<> 135:176b8275d35d 4991 */
<> 135:176b8275d35d 4992
<> 135:176b8275d35d 4993 void arm_cmplx_mag_squared_f32(
<> 135:176b8275d35d 4994 float32_t * pSrc,
<> 135:176b8275d35d 4995 float32_t * pDst,
<> 135:176b8275d35d 4996 uint32_t numSamples);
<> 135:176b8275d35d 4997
<> 135:176b8275d35d 4998 /**
<> 135:176b8275d35d 4999 * @brief Q31 complex magnitude squared
<> 135:176b8275d35d 5000 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 5001 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 5002 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 5003 * @return none.
<> 135:176b8275d35d 5004 */
<> 135:176b8275d35d 5005
<> 135:176b8275d35d 5006 void arm_cmplx_mag_squared_q31(
<> 135:176b8275d35d 5007 q31_t * pSrc,
<> 135:176b8275d35d 5008 q31_t * pDst,
<> 135:176b8275d35d 5009 uint32_t numSamples);
<> 135:176b8275d35d 5010
<> 135:176b8275d35d 5011 /**
<> 135:176b8275d35d 5012 * @brief Q15 complex magnitude squared
<> 135:176b8275d35d 5013 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 5014 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 5015 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 5016 * @return none.
<> 135:176b8275d35d 5017 */
<> 135:176b8275d35d 5018
<> 135:176b8275d35d 5019 void arm_cmplx_mag_squared_q15(
<> 135:176b8275d35d 5020 q15_t * pSrc,
<> 135:176b8275d35d 5021 q15_t * pDst,
<> 135:176b8275d35d 5022 uint32_t numSamples);
<> 135:176b8275d35d 5023
<> 135:176b8275d35d 5024
<> 135:176b8275d35d 5025 /**
<> 135:176b8275d35d 5026 * @ingroup groupController
<> 135:176b8275d35d 5027 */
<> 135:176b8275d35d 5028
<> 135:176b8275d35d 5029 /**
<> 135:176b8275d35d 5030 * @defgroup PID PID Motor Control
<> 135:176b8275d35d 5031 *
<> 135:176b8275d35d 5032 * A Proportional Integral Derivative (PID) controller is a generic feedback control
<> 135:176b8275d35d 5033 * loop mechanism widely used in industrial control systems.
<> 135:176b8275d35d 5034 * A PID controller is the most commonly used type of feedback controller.
<> 135:176b8275d35d 5035 *
<> 135:176b8275d35d 5036 * This set of functions implements (PID) controllers
<> 135:176b8275d35d 5037 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
<> 135:176b8275d35d 5038 * of data and each call to the function returns a single processed value.
<> 135:176b8275d35d 5039 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
<> 135:176b8275d35d 5040 * is the input sample value. The functions return the output value.
<> 135:176b8275d35d 5041 *
<> 135:176b8275d35d 5042 * \par Algorithm:
<> 135:176b8275d35d 5043 * <pre>
<> 135:176b8275d35d 5044 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
<> 135:176b8275d35d 5045 * A0 = Kp + Ki + Kd
<> 135:176b8275d35d 5046 * A1 = (-Kp ) - (2 * Kd )
<> 135:176b8275d35d 5047 * A2 = Kd </pre>
<> 135:176b8275d35d 5048 *
<> 135:176b8275d35d 5049 * \par
<> 135:176b8275d35d 5050 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
<> 135:176b8275d35d 5051 *
<> 135:176b8275d35d 5052 * \par
<> 135:176b8275d35d 5053 * \image html PID.gif "Proportional Integral Derivative Controller"
<> 135:176b8275d35d 5054 *
<> 135:176b8275d35d 5055 * \par
<> 135:176b8275d35d 5056 * The PID controller calculates an "error" value as the difference between
<> 135:176b8275d35d 5057 * the measured output and the reference input.
<> 135:176b8275d35d 5058 * The controller attempts to minimize the error by adjusting the process control inputs.
<> 135:176b8275d35d 5059 * The proportional value determines the reaction to the current error,
<> 135:176b8275d35d 5060 * the integral value determines the reaction based on the sum of recent errors,
<> 135:176b8275d35d 5061 * and the derivative value determines the reaction based on the rate at which the error has been changing.
<> 135:176b8275d35d 5062 *
<> 135:176b8275d35d 5063 * \par Instance Structure
<> 135:176b8275d35d 5064 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
<> 135:176b8275d35d 5065 * A separate instance structure must be defined for each PID Controller.
<> 135:176b8275d35d 5066 * There are separate instance structure declarations for each of the 3 supported data types.
<> 135:176b8275d35d 5067 *
<> 135:176b8275d35d 5068 * \par Reset Functions
<> 135:176b8275d35d 5069 * There is also an associated reset function for each data type which clears the state array.
<> 135:176b8275d35d 5070 *
<> 135:176b8275d35d 5071 * \par Initialization Functions
<> 135:176b8275d35d 5072 * There is also an associated initialization function for each data type.
<> 135:176b8275d35d 5073 * The initialization function performs the following operations:
<> 135:176b8275d35d 5074 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
<> 135:176b8275d35d 5075 * - Zeros out the values in the state buffer.
<> 135:176b8275d35d 5076 *
<> 135:176b8275d35d 5077 * \par
<> 135:176b8275d35d 5078 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
<> 135:176b8275d35d 5079 *
<> 135:176b8275d35d 5080 * \par Fixed-Point Behavior
<> 135:176b8275d35d 5081 * Care must be taken when using the fixed-point versions of the PID Controller functions.
<> 135:176b8275d35d 5082 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
<> 135:176b8275d35d 5083 * Refer to the function specific documentation below for usage guidelines.
<> 135:176b8275d35d 5084 */
<> 135:176b8275d35d 5085
<> 135:176b8275d35d 5086 /**
<> 135:176b8275d35d 5087 * @addtogroup PID
<> 135:176b8275d35d 5088 * @{
<> 135:176b8275d35d 5089 */
<> 135:176b8275d35d 5090
<> 135:176b8275d35d 5091 /**
<> 135:176b8275d35d 5092 * @brief Process function for the floating-point PID Control.
<> 135:176b8275d35d 5093 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 135:176b8275d35d 5094 * @param[in] in input sample to process
<> 135:176b8275d35d 5095 * @return out processed output sample.
<> 135:176b8275d35d 5096 */
<> 135:176b8275d35d 5097
<> 135:176b8275d35d 5098
<> 135:176b8275d35d 5099 static __INLINE float32_t arm_pid_f32(
<> 135:176b8275d35d 5100 arm_pid_instance_f32 * S,
<> 135:176b8275d35d 5101 float32_t in)
<> 135:176b8275d35d 5102 {
<> 135:176b8275d35d 5103 float32_t out;
<> 135:176b8275d35d 5104
<> 135:176b8275d35d 5105 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
<> 135:176b8275d35d 5106 out = (S->A0 * in) +
<> 135:176b8275d35d 5107 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
<> 135:176b8275d35d 5108
<> 135:176b8275d35d 5109 /* Update state */
<> 135:176b8275d35d 5110 S->state[1] = S->state[0];
<> 135:176b8275d35d 5111 S->state[0] = in;
<> 135:176b8275d35d 5112 S->state[2] = out;
<> 135:176b8275d35d 5113
<> 135:176b8275d35d 5114 /* return to application */
<> 135:176b8275d35d 5115 return (out);
<> 135:176b8275d35d 5116
<> 135:176b8275d35d 5117 }
<> 135:176b8275d35d 5118
<> 135:176b8275d35d 5119 /**
<> 135:176b8275d35d 5120 * @brief Process function for the Q31 PID Control.
<> 135:176b8275d35d 5121 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 135:176b8275d35d 5122 * @param[in] in input sample to process
<> 135:176b8275d35d 5123 * @return out processed output sample.
<> 135:176b8275d35d 5124 *
<> 135:176b8275d35d 5125 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5126 * \par
<> 135:176b8275d35d 5127 * The function is implemented using an internal 64-bit accumulator.
<> 135:176b8275d35d 5128 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
<> 135:176b8275d35d 5129 * Thus, if the accumulator result overflows it wraps around rather than clip.
<> 135:176b8275d35d 5130 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
<> 135:176b8275d35d 5131 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
<> 135:176b8275d35d 5132 */
<> 135:176b8275d35d 5133
<> 135:176b8275d35d 5134 static __INLINE q31_t arm_pid_q31(
<> 135:176b8275d35d 5135 arm_pid_instance_q31 * S,
<> 135:176b8275d35d 5136 q31_t in)
<> 135:176b8275d35d 5137 {
<> 135:176b8275d35d 5138 q63_t acc;
<> 135:176b8275d35d 5139 q31_t out;
<> 135:176b8275d35d 5140
<> 135:176b8275d35d 5141 /* acc = A0 * x[n] */
<> 135:176b8275d35d 5142 acc = (q63_t) S->A0 * in;
<> 135:176b8275d35d 5143
<> 135:176b8275d35d 5144 /* acc += A1 * x[n-1] */
<> 135:176b8275d35d 5145 acc += (q63_t) S->A1 * S->state[0];
<> 135:176b8275d35d 5146
<> 135:176b8275d35d 5147 /* acc += A2 * x[n-2] */
<> 135:176b8275d35d 5148 acc += (q63_t) S->A2 * S->state[1];
<> 135:176b8275d35d 5149
<> 135:176b8275d35d 5150 /* convert output to 1.31 format to add y[n-1] */
<> 135:176b8275d35d 5151 out = (q31_t) (acc >> 31u);
<> 135:176b8275d35d 5152
<> 135:176b8275d35d 5153 /* out += y[n-1] */
<> 135:176b8275d35d 5154 out += S->state[2];
<> 135:176b8275d35d 5155
<> 135:176b8275d35d 5156 /* Update state */
<> 135:176b8275d35d 5157 S->state[1] = S->state[0];
<> 135:176b8275d35d 5158 S->state[0] = in;
<> 135:176b8275d35d 5159 S->state[2] = out;
<> 135:176b8275d35d 5160
<> 135:176b8275d35d 5161 /* return to application */
<> 135:176b8275d35d 5162 return (out);
<> 135:176b8275d35d 5163
<> 135:176b8275d35d 5164 }
<> 135:176b8275d35d 5165
<> 135:176b8275d35d 5166 /**
<> 135:176b8275d35d 5167 * @brief Process function for the Q15 PID Control.
<> 135:176b8275d35d 5168 * @param[in,out] *S points to an instance of the Q15 PID Control structure
<> 135:176b8275d35d 5169 * @param[in] in input sample to process
<> 135:176b8275d35d 5170 * @return out processed output sample.
<> 135:176b8275d35d 5171 *
<> 135:176b8275d35d 5172 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5173 * \par
<> 135:176b8275d35d 5174 * The function is implemented using a 64-bit internal accumulator.
<> 135:176b8275d35d 5175 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
<> 135:176b8275d35d 5176 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
<> 135:176b8275d35d 5177 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
<> 135:176b8275d35d 5178 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
<> 135:176b8275d35d 5179 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
<> 135:176b8275d35d 5180 */
<> 135:176b8275d35d 5181
<> 135:176b8275d35d 5182 static __INLINE q15_t arm_pid_q15(
<> 135:176b8275d35d 5183 arm_pid_instance_q15 * S,
<> 135:176b8275d35d 5184 q15_t in)
<> 135:176b8275d35d 5185 {
<> 135:176b8275d35d 5186 q63_t acc;
<> 135:176b8275d35d 5187 q15_t out;
<> 135:176b8275d35d 5188
<> 135:176b8275d35d 5189 #ifndef ARM_MATH_CM0_FAMILY
<> 135:176b8275d35d 5190 __SIMD32_TYPE *vstate;
<> 135:176b8275d35d 5191
<> 135:176b8275d35d 5192 /* Implementation of PID controller */
<> 135:176b8275d35d 5193
<> 135:176b8275d35d 5194 /* acc = A0 * x[n] */
<> 135:176b8275d35d 5195 acc = (q31_t) __SMUAD(S->A0, in);
<> 135:176b8275d35d 5196
<> 135:176b8275d35d 5197 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 135:176b8275d35d 5198 vstate = __SIMD32_CONST(S->state);
<> 135:176b8275d35d 5199 acc = __SMLALD(S->A1, (q31_t) *vstate, acc);
<> 135:176b8275d35d 5200
<> 135:176b8275d35d 5201 #else
<> 135:176b8275d35d 5202 /* acc = A0 * x[n] */
<> 135:176b8275d35d 5203 acc = ((q31_t) S->A0) * in;
<> 135:176b8275d35d 5204
<> 135:176b8275d35d 5205 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 135:176b8275d35d 5206 acc += (q31_t) S->A1 * S->state[0];
<> 135:176b8275d35d 5207 acc += (q31_t) S->A2 * S->state[1];
<> 135:176b8275d35d 5208
<> 135:176b8275d35d 5209 #endif
<> 135:176b8275d35d 5210
<> 135:176b8275d35d 5211 /* acc += y[n-1] */
<> 135:176b8275d35d 5212 acc += (q31_t) S->state[2] << 15;
<> 135:176b8275d35d 5213
<> 135:176b8275d35d 5214 /* saturate the output */
<> 135:176b8275d35d 5215 out = (q15_t) (__SSAT((acc >> 15), 16));
<> 135:176b8275d35d 5216
<> 135:176b8275d35d 5217 /* Update state */
<> 135:176b8275d35d 5218 S->state[1] = S->state[0];
<> 135:176b8275d35d 5219 S->state[0] = in;
<> 135:176b8275d35d 5220 S->state[2] = out;
<> 135:176b8275d35d 5221
<> 135:176b8275d35d 5222 /* return to application */
<> 135:176b8275d35d 5223 return (out);
<> 135:176b8275d35d 5224
<> 135:176b8275d35d 5225 }
<> 135:176b8275d35d 5226
<> 135:176b8275d35d 5227 /**
<> 135:176b8275d35d 5228 * @} end of PID group
<> 135:176b8275d35d 5229 */
<> 135:176b8275d35d 5230
<> 135:176b8275d35d 5231
<> 135:176b8275d35d 5232 /**
<> 135:176b8275d35d 5233 * @brief Floating-point matrix inverse.
<> 135:176b8275d35d 5234 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 135:176b8275d35d 5235 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 135:176b8275d35d 5236 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 135:176b8275d35d 5237 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 135:176b8275d35d 5238 */
<> 135:176b8275d35d 5239
<> 135:176b8275d35d 5240 arm_status arm_mat_inverse_f32(
<> 135:176b8275d35d 5241 const arm_matrix_instance_f32 * src,
<> 135:176b8275d35d 5242 arm_matrix_instance_f32 * dst);
<> 135:176b8275d35d 5243
<> 135:176b8275d35d 5244
<> 135:176b8275d35d 5245 /**
<> 135:176b8275d35d 5246 * @brief Floating-point matrix inverse.
<> 135:176b8275d35d 5247 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 135:176b8275d35d 5248 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 135:176b8275d35d 5249 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 135:176b8275d35d 5250 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 135:176b8275d35d 5251 */
<> 135:176b8275d35d 5252
<> 135:176b8275d35d 5253 arm_status arm_mat_inverse_f64(
<> 135:176b8275d35d 5254 const arm_matrix_instance_f64 * src,
<> 135:176b8275d35d 5255 arm_matrix_instance_f64 * dst);
<> 135:176b8275d35d 5256
<> 135:176b8275d35d 5257
<> 135:176b8275d35d 5258
<> 135:176b8275d35d 5259 /**
<> 135:176b8275d35d 5260 * @ingroup groupController
<> 135:176b8275d35d 5261 */
<> 135:176b8275d35d 5262
<> 135:176b8275d35d 5263
<> 135:176b8275d35d 5264 /**
<> 135:176b8275d35d 5265 * @defgroup clarke Vector Clarke Transform
<> 135:176b8275d35d 5266 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
<> 135:176b8275d35d 5267 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
<> 135:176b8275d35d 5268 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
<> 135:176b8275d35d 5269 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
<> 135:176b8275d35d 5270 * \image html clarke.gif Stator current space vector and its components in (a,b).
<> 135:176b8275d35d 5271 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
<> 135:176b8275d35d 5272 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
<> 135:176b8275d35d 5273 *
<> 135:176b8275d35d 5274 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 135:176b8275d35d 5275 * The library provides separate functions for Q31 and floating-point data types.
<> 135:176b8275d35d 5276 * \par Algorithm
<> 135:176b8275d35d 5277 * \image html clarkeFormula.gif
<> 135:176b8275d35d 5278 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
<> 135:176b8275d35d 5279 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
<> 135:176b8275d35d 5280 * \par Fixed-Point Behavior
<> 135:176b8275d35d 5281 * Care must be taken when using the Q31 version of the Clarke transform.
<> 135:176b8275d35d 5282 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 135:176b8275d35d 5283 * Refer to the function specific documentation below for usage guidelines.
<> 135:176b8275d35d 5284 */
<> 135:176b8275d35d 5285
<> 135:176b8275d35d 5286 /**
<> 135:176b8275d35d 5287 * @addtogroup clarke
<> 135:176b8275d35d 5288 * @{
<> 135:176b8275d35d 5289 */
<> 135:176b8275d35d 5290
<> 135:176b8275d35d 5291 /**
<> 135:176b8275d35d 5292 *
<> 135:176b8275d35d 5293 * @brief Floating-point Clarke transform
<> 135:176b8275d35d 5294 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 135:176b8275d35d 5295 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 135:176b8275d35d 5296 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5297 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5298 * @return none.
<> 135:176b8275d35d 5299 */
<> 135:176b8275d35d 5300
<> 135:176b8275d35d 5301 static __INLINE void arm_clarke_f32(
<> 135:176b8275d35d 5302 float32_t Ia,
<> 135:176b8275d35d 5303 float32_t Ib,
<> 135:176b8275d35d 5304 float32_t * pIalpha,
<> 135:176b8275d35d 5305 float32_t * pIbeta)
<> 135:176b8275d35d 5306 {
<> 135:176b8275d35d 5307 /* Calculate pIalpha using the equation, pIalpha = Ia */
<> 135:176b8275d35d 5308 *pIalpha = Ia;
<> 135:176b8275d35d 5309
<> 135:176b8275d35d 5310 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
<> 135:176b8275d35d 5311 *pIbeta =
<> 135:176b8275d35d 5312 ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
<> 135:176b8275d35d 5313
<> 135:176b8275d35d 5314 }
<> 135:176b8275d35d 5315
<> 135:176b8275d35d 5316 /**
<> 135:176b8275d35d 5317 * @brief Clarke transform for Q31 version
<> 135:176b8275d35d 5318 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 135:176b8275d35d 5319 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 135:176b8275d35d 5320 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5321 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5322 * @return none.
<> 135:176b8275d35d 5323 *
<> 135:176b8275d35d 5324 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5325 * \par
<> 135:176b8275d35d 5326 * The function is implemented using an internal 32-bit accumulator.
<> 135:176b8275d35d 5327 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 135:176b8275d35d 5328 * There is saturation on the addition, hence there is no risk of overflow.
<> 135:176b8275d35d 5329 */
<> 135:176b8275d35d 5330
<> 135:176b8275d35d 5331 static __INLINE void arm_clarke_q31(
<> 135:176b8275d35d 5332 q31_t Ia,
<> 135:176b8275d35d 5333 q31_t Ib,
<> 135:176b8275d35d 5334 q31_t * pIalpha,
<> 135:176b8275d35d 5335 q31_t * pIbeta)
<> 135:176b8275d35d 5336 {
<> 135:176b8275d35d 5337 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5338
<> 135:176b8275d35d 5339 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
<> 135:176b8275d35d 5340 *pIalpha = Ia;
<> 135:176b8275d35d 5341
<> 135:176b8275d35d 5342 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
<> 135:176b8275d35d 5343 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
<> 135:176b8275d35d 5344
<> 135:176b8275d35d 5345 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
<> 135:176b8275d35d 5346 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
<> 135:176b8275d35d 5347
<> 135:176b8275d35d 5348 /* pIbeta is calculated by adding the intermediate products */
<> 135:176b8275d35d 5349 *pIbeta = __QADD(product1, product2);
<> 135:176b8275d35d 5350 }
<> 135:176b8275d35d 5351
<> 135:176b8275d35d 5352 /**
<> 135:176b8275d35d 5353 * @} end of clarke group
<> 135:176b8275d35d 5354 */
<> 135:176b8275d35d 5355
<> 135:176b8275d35d 5356 /**
<> 135:176b8275d35d 5357 * @brief Converts the elements of the Q7 vector to Q31 vector.
<> 135:176b8275d35d 5358 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 5359 * @param[out] *pDst output pointer
<> 135:176b8275d35d 5360 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 5361 * @return none.
<> 135:176b8275d35d 5362 */
<> 135:176b8275d35d 5363 void arm_q7_to_q31(
<> 135:176b8275d35d 5364 q7_t * pSrc,
<> 135:176b8275d35d 5365 q31_t * pDst,
<> 135:176b8275d35d 5366 uint32_t blockSize);
<> 135:176b8275d35d 5367
<> 135:176b8275d35d 5368
<> 135:176b8275d35d 5369
<> 135:176b8275d35d 5370
<> 135:176b8275d35d 5371 /**
<> 135:176b8275d35d 5372 * @ingroup groupController
<> 135:176b8275d35d 5373 */
<> 135:176b8275d35d 5374
<> 135:176b8275d35d 5375 /**
<> 135:176b8275d35d 5376 * @defgroup inv_clarke Vector Inverse Clarke Transform
<> 135:176b8275d35d 5377 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
<> 135:176b8275d35d 5378 *
<> 135:176b8275d35d 5379 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 135:176b8275d35d 5380 * The library provides separate functions for Q31 and floating-point data types.
<> 135:176b8275d35d 5381 * \par Algorithm
<> 135:176b8275d35d 5382 * \image html clarkeInvFormula.gif
<> 135:176b8275d35d 5383 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
<> 135:176b8275d35d 5384 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
<> 135:176b8275d35d 5385 * \par Fixed-Point Behavior
<> 135:176b8275d35d 5386 * Care must be taken when using the Q31 version of the Clarke transform.
<> 135:176b8275d35d 5387 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 135:176b8275d35d 5388 * Refer to the function specific documentation below for usage guidelines.
<> 135:176b8275d35d 5389 */
<> 135:176b8275d35d 5390
<> 135:176b8275d35d 5391 /**
<> 135:176b8275d35d 5392 * @addtogroup inv_clarke
<> 135:176b8275d35d 5393 * @{
<> 135:176b8275d35d 5394 */
<> 135:176b8275d35d 5395
<> 135:176b8275d35d 5396 /**
<> 135:176b8275d35d 5397 * @brief Floating-point Inverse Clarke transform
<> 135:176b8275d35d 5398 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5399 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5400 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 135:176b8275d35d 5401 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 135:176b8275d35d 5402 * @return none.
<> 135:176b8275d35d 5403 */
<> 135:176b8275d35d 5404
<> 135:176b8275d35d 5405
<> 135:176b8275d35d 5406 static __INLINE void arm_inv_clarke_f32(
<> 135:176b8275d35d 5407 float32_t Ialpha,
<> 135:176b8275d35d 5408 float32_t Ibeta,
<> 135:176b8275d35d 5409 float32_t * pIa,
<> 135:176b8275d35d 5410 float32_t * pIb)
<> 135:176b8275d35d 5411 {
<> 135:176b8275d35d 5412 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 135:176b8275d35d 5413 *pIa = Ialpha;
<> 135:176b8275d35d 5414
<> 135:176b8275d35d 5415 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
<> 135:176b8275d35d 5416 *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
<> 135:176b8275d35d 5417
<> 135:176b8275d35d 5418 }
<> 135:176b8275d35d 5419
<> 135:176b8275d35d 5420 /**
<> 135:176b8275d35d 5421 * @brief Inverse Clarke transform for Q31 version
<> 135:176b8275d35d 5422 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5423 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5424 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 135:176b8275d35d 5425 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 135:176b8275d35d 5426 * @return none.
<> 135:176b8275d35d 5427 *
<> 135:176b8275d35d 5428 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5429 * \par
<> 135:176b8275d35d 5430 * The function is implemented using an internal 32-bit accumulator.
<> 135:176b8275d35d 5431 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 135:176b8275d35d 5432 * There is saturation on the subtraction, hence there is no risk of overflow.
<> 135:176b8275d35d 5433 */
<> 135:176b8275d35d 5434
<> 135:176b8275d35d 5435 static __INLINE void arm_inv_clarke_q31(
<> 135:176b8275d35d 5436 q31_t Ialpha,
<> 135:176b8275d35d 5437 q31_t Ibeta,
<> 135:176b8275d35d 5438 q31_t * pIa,
<> 135:176b8275d35d 5439 q31_t * pIb)
<> 135:176b8275d35d 5440 {
<> 135:176b8275d35d 5441 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5442
<> 135:176b8275d35d 5443 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 135:176b8275d35d 5444 *pIa = Ialpha;
<> 135:176b8275d35d 5445
<> 135:176b8275d35d 5446 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
<> 135:176b8275d35d 5447 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
<> 135:176b8275d35d 5448
<> 135:176b8275d35d 5449 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
<> 135:176b8275d35d 5450 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
<> 135:176b8275d35d 5451
<> 135:176b8275d35d 5452 /* pIb is calculated by subtracting the products */
<> 135:176b8275d35d 5453 *pIb = __QSUB(product2, product1);
<> 135:176b8275d35d 5454
<> 135:176b8275d35d 5455 }
<> 135:176b8275d35d 5456
<> 135:176b8275d35d 5457 /**
<> 135:176b8275d35d 5458 * @} end of inv_clarke group
<> 135:176b8275d35d 5459 */
<> 135:176b8275d35d 5460
<> 135:176b8275d35d 5461 /**
<> 135:176b8275d35d 5462 * @brief Converts the elements of the Q7 vector to Q15 vector.
<> 135:176b8275d35d 5463 * @param[in] *pSrc input pointer
<> 135:176b8275d35d 5464 * @param[out] *pDst output pointer
<> 135:176b8275d35d 5465 * @param[in] blockSize number of samples to process
<> 135:176b8275d35d 5466 * @return none.
<> 135:176b8275d35d 5467 */
<> 135:176b8275d35d 5468 void arm_q7_to_q15(
<> 135:176b8275d35d 5469 q7_t * pSrc,
<> 135:176b8275d35d 5470 q15_t * pDst,
<> 135:176b8275d35d 5471 uint32_t blockSize);
<> 135:176b8275d35d 5472
<> 135:176b8275d35d 5473
<> 135:176b8275d35d 5474
<> 135:176b8275d35d 5475 /**
<> 135:176b8275d35d 5476 * @ingroup groupController
<> 135:176b8275d35d 5477 */
<> 135:176b8275d35d 5478
<> 135:176b8275d35d 5479 /**
<> 135:176b8275d35d 5480 * @defgroup park Vector Park Transform
<> 135:176b8275d35d 5481 *
<> 135:176b8275d35d 5482 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
<> 135:176b8275d35d 5483 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
<> 135:176b8275d35d 5484 * from the stationary to the moving reference frame and control the spatial relationship between
<> 135:176b8275d35d 5485 * the stator vector current and rotor flux vector.
<> 135:176b8275d35d 5486 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
<> 135:176b8275d35d 5487 * current vector and the relationship from the two reference frames:
<> 135:176b8275d35d 5488 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
<> 135:176b8275d35d 5489 *
<> 135:176b8275d35d 5490 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 135:176b8275d35d 5491 * The library provides separate functions for Q31 and floating-point data types.
<> 135:176b8275d35d 5492 * \par Algorithm
<> 135:176b8275d35d 5493 * \image html parkFormula.gif
<> 135:176b8275d35d 5494 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
<> 135:176b8275d35d 5495 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 135:176b8275d35d 5496 * cosine and sine values of theta (rotor flux position).
<> 135:176b8275d35d 5497 * \par Fixed-Point Behavior
<> 135:176b8275d35d 5498 * Care must be taken when using the Q31 version of the Park transform.
<> 135:176b8275d35d 5499 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 135:176b8275d35d 5500 * Refer to the function specific documentation below for usage guidelines.
<> 135:176b8275d35d 5501 */
<> 135:176b8275d35d 5502
<> 135:176b8275d35d 5503 /**
<> 135:176b8275d35d 5504 * @addtogroup park
<> 135:176b8275d35d 5505 * @{
<> 135:176b8275d35d 5506 */
<> 135:176b8275d35d 5507
<> 135:176b8275d35d 5508 /**
<> 135:176b8275d35d 5509 * @brief Floating-point Park transform
<> 135:176b8275d35d 5510 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 135:176b8275d35d 5511 * @param[in] Ibeta input two-phase vector coordinate beta
<> 135:176b8275d35d 5512 * @param[out] *pId points to output rotor reference frame d
<> 135:176b8275d35d 5513 * @param[out] *pIq points to output rotor reference frame q
<> 135:176b8275d35d 5514 * @param[in] sinVal sine value of rotation angle theta
<> 135:176b8275d35d 5515 * @param[in] cosVal cosine value of rotation angle theta
<> 135:176b8275d35d 5516 * @return none.
<> 135:176b8275d35d 5517 *
<> 135:176b8275d35d 5518 * The function implements the forward Park transform.
<> 135:176b8275d35d 5519 *
<> 135:176b8275d35d 5520 */
<> 135:176b8275d35d 5521
<> 135:176b8275d35d 5522 static __INLINE void arm_park_f32(
<> 135:176b8275d35d 5523 float32_t Ialpha,
<> 135:176b8275d35d 5524 float32_t Ibeta,
<> 135:176b8275d35d 5525 float32_t * pId,
<> 135:176b8275d35d 5526 float32_t * pIq,
<> 135:176b8275d35d 5527 float32_t sinVal,
<> 135:176b8275d35d 5528 float32_t cosVal)
<> 135:176b8275d35d 5529 {
<> 135:176b8275d35d 5530 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
<> 135:176b8275d35d 5531 *pId = Ialpha * cosVal + Ibeta * sinVal;
<> 135:176b8275d35d 5532
<> 135:176b8275d35d 5533 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
<> 135:176b8275d35d 5534 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
<> 135:176b8275d35d 5535
<> 135:176b8275d35d 5536 }
<> 135:176b8275d35d 5537
<> 135:176b8275d35d 5538 /**
<> 135:176b8275d35d 5539 * @brief Park transform for Q31 version
<> 135:176b8275d35d 5540 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 135:176b8275d35d 5541 * @param[in] Ibeta input two-phase vector coordinate beta
<> 135:176b8275d35d 5542 * @param[out] *pId points to output rotor reference frame d
<> 135:176b8275d35d 5543 * @param[out] *pIq points to output rotor reference frame q
<> 135:176b8275d35d 5544 * @param[in] sinVal sine value of rotation angle theta
<> 135:176b8275d35d 5545 * @param[in] cosVal cosine value of rotation angle theta
<> 135:176b8275d35d 5546 * @return none.
<> 135:176b8275d35d 5547 *
<> 135:176b8275d35d 5548 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5549 * \par
<> 135:176b8275d35d 5550 * The function is implemented using an internal 32-bit accumulator.
<> 135:176b8275d35d 5551 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 135:176b8275d35d 5552 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
<> 135:176b8275d35d 5553 */
<> 135:176b8275d35d 5554
<> 135:176b8275d35d 5555
<> 135:176b8275d35d 5556 static __INLINE void arm_park_q31(
<> 135:176b8275d35d 5557 q31_t Ialpha,
<> 135:176b8275d35d 5558 q31_t Ibeta,
<> 135:176b8275d35d 5559 q31_t * pId,
<> 135:176b8275d35d 5560 q31_t * pIq,
<> 135:176b8275d35d 5561 q31_t sinVal,
<> 135:176b8275d35d 5562 q31_t cosVal)
<> 135:176b8275d35d 5563 {
<> 135:176b8275d35d 5564 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5565 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5566
<> 135:176b8275d35d 5567 /* Intermediate product is calculated by (Ialpha * cosVal) */
<> 135:176b8275d35d 5568 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
<> 135:176b8275d35d 5569
<> 135:176b8275d35d 5570 /* Intermediate product is calculated by (Ibeta * sinVal) */
<> 135:176b8275d35d 5571 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
<> 135:176b8275d35d 5572
<> 135:176b8275d35d 5573
<> 135:176b8275d35d 5574 /* Intermediate product is calculated by (Ialpha * sinVal) */
<> 135:176b8275d35d 5575 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
<> 135:176b8275d35d 5576
<> 135:176b8275d35d 5577 /* Intermediate product is calculated by (Ibeta * cosVal) */
<> 135:176b8275d35d 5578 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
<> 135:176b8275d35d 5579
<> 135:176b8275d35d 5580 /* Calculate pId by adding the two intermediate products 1 and 2 */
<> 135:176b8275d35d 5581 *pId = __QADD(product1, product2);
<> 135:176b8275d35d 5582
<> 135:176b8275d35d 5583 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
<> 135:176b8275d35d 5584 *pIq = __QSUB(product4, product3);
<> 135:176b8275d35d 5585 }
<> 135:176b8275d35d 5586
<> 135:176b8275d35d 5587 /**
<> 135:176b8275d35d 5588 * @} end of park group
<> 135:176b8275d35d 5589 */
<> 135:176b8275d35d 5590
<> 135:176b8275d35d 5591 /**
<> 135:176b8275d35d 5592 * @brief Converts the elements of the Q7 vector to floating-point vector.
<> 135:176b8275d35d 5593 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 5594 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 5595 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 5596 * @return none.
<> 135:176b8275d35d 5597 */
<> 135:176b8275d35d 5598 void arm_q7_to_float(
<> 135:176b8275d35d 5599 q7_t * pSrc,
<> 135:176b8275d35d 5600 float32_t * pDst,
<> 135:176b8275d35d 5601 uint32_t blockSize);
<> 135:176b8275d35d 5602
<> 135:176b8275d35d 5603
<> 135:176b8275d35d 5604 /**
<> 135:176b8275d35d 5605 * @ingroup groupController
<> 135:176b8275d35d 5606 */
<> 135:176b8275d35d 5607
<> 135:176b8275d35d 5608 /**
<> 135:176b8275d35d 5609 * @defgroup inv_park Vector Inverse Park transform
<> 135:176b8275d35d 5610 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
<> 135:176b8275d35d 5611 *
<> 135:176b8275d35d 5612 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 135:176b8275d35d 5613 * The library provides separate functions for Q31 and floating-point data types.
<> 135:176b8275d35d 5614 * \par Algorithm
<> 135:176b8275d35d 5615 * \image html parkInvFormula.gif
<> 135:176b8275d35d 5616 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
<> 135:176b8275d35d 5617 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 135:176b8275d35d 5618 * cosine and sine values of theta (rotor flux position).
<> 135:176b8275d35d 5619 * \par Fixed-Point Behavior
<> 135:176b8275d35d 5620 * Care must be taken when using the Q31 version of the Park transform.
<> 135:176b8275d35d 5621 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 135:176b8275d35d 5622 * Refer to the function specific documentation below for usage guidelines.
<> 135:176b8275d35d 5623 */
<> 135:176b8275d35d 5624
<> 135:176b8275d35d 5625 /**
<> 135:176b8275d35d 5626 * @addtogroup inv_park
<> 135:176b8275d35d 5627 * @{
<> 135:176b8275d35d 5628 */
<> 135:176b8275d35d 5629
<> 135:176b8275d35d 5630 /**
<> 135:176b8275d35d 5631 * @brief Floating-point Inverse Park transform
<> 135:176b8275d35d 5632 * @param[in] Id input coordinate of rotor reference frame d
<> 135:176b8275d35d 5633 * @param[in] Iq input coordinate of rotor reference frame q
<> 135:176b8275d35d 5634 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5635 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5636 * @param[in] sinVal sine value of rotation angle theta
<> 135:176b8275d35d 5637 * @param[in] cosVal cosine value of rotation angle theta
<> 135:176b8275d35d 5638 * @return none.
<> 135:176b8275d35d 5639 */
<> 135:176b8275d35d 5640
<> 135:176b8275d35d 5641 static __INLINE void arm_inv_park_f32(
<> 135:176b8275d35d 5642 float32_t Id,
<> 135:176b8275d35d 5643 float32_t Iq,
<> 135:176b8275d35d 5644 float32_t * pIalpha,
<> 135:176b8275d35d 5645 float32_t * pIbeta,
<> 135:176b8275d35d 5646 float32_t sinVal,
<> 135:176b8275d35d 5647 float32_t cosVal)
<> 135:176b8275d35d 5648 {
<> 135:176b8275d35d 5649 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
<> 135:176b8275d35d 5650 *pIalpha = Id * cosVal - Iq * sinVal;
<> 135:176b8275d35d 5651
<> 135:176b8275d35d 5652 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
<> 135:176b8275d35d 5653 *pIbeta = Id * sinVal + Iq * cosVal;
<> 135:176b8275d35d 5654
<> 135:176b8275d35d 5655 }
<> 135:176b8275d35d 5656
<> 135:176b8275d35d 5657
<> 135:176b8275d35d 5658 /**
<> 135:176b8275d35d 5659 * @brief Inverse Park transform for Q31 version
<> 135:176b8275d35d 5660 * @param[in] Id input coordinate of rotor reference frame d
<> 135:176b8275d35d 5661 * @param[in] Iq input coordinate of rotor reference frame q
<> 135:176b8275d35d 5662 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 135:176b8275d35d 5663 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 135:176b8275d35d 5664 * @param[in] sinVal sine value of rotation angle theta
<> 135:176b8275d35d 5665 * @param[in] cosVal cosine value of rotation angle theta
<> 135:176b8275d35d 5666 * @return none.
<> 135:176b8275d35d 5667 *
<> 135:176b8275d35d 5668 * <b>Scaling and Overflow Behavior:</b>
<> 135:176b8275d35d 5669 * \par
<> 135:176b8275d35d 5670 * The function is implemented using an internal 32-bit accumulator.
<> 135:176b8275d35d 5671 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 135:176b8275d35d 5672 * There is saturation on the addition, hence there is no risk of overflow.
<> 135:176b8275d35d 5673 */
<> 135:176b8275d35d 5674
<> 135:176b8275d35d 5675
<> 135:176b8275d35d 5676 static __INLINE void arm_inv_park_q31(
<> 135:176b8275d35d 5677 q31_t Id,
<> 135:176b8275d35d 5678 q31_t Iq,
<> 135:176b8275d35d 5679 q31_t * pIalpha,
<> 135:176b8275d35d 5680 q31_t * pIbeta,
<> 135:176b8275d35d 5681 q31_t sinVal,
<> 135:176b8275d35d 5682 q31_t cosVal)
<> 135:176b8275d35d 5683 {
<> 135:176b8275d35d 5684 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5685 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 135:176b8275d35d 5686
<> 135:176b8275d35d 5687 /* Intermediate product is calculated by (Id * cosVal) */
<> 135:176b8275d35d 5688 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
<> 135:176b8275d35d 5689
<> 135:176b8275d35d 5690 /* Intermediate product is calculated by (Iq * sinVal) */
<> 135:176b8275d35d 5691 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
<> 135:176b8275d35d 5692
<> 135:176b8275d35d 5693
<> 135:176b8275d35d 5694 /* Intermediate product is calculated by (Id * sinVal) */
<> 135:176b8275d35d 5695 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
<> 135:176b8275d35d 5696
<> 135:176b8275d35d 5697 /* Intermediate product is calculated by (Iq * cosVal) */
<> 135:176b8275d35d 5698 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
<> 135:176b8275d35d 5699
<> 135:176b8275d35d 5700 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
<> 135:176b8275d35d 5701 *pIalpha = __QSUB(product1, product2);
<> 135:176b8275d35d 5702
<> 135:176b8275d35d 5703 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
<> 135:176b8275d35d 5704 *pIbeta = __QADD(product4, product3);
<> 135:176b8275d35d 5705
<> 135:176b8275d35d 5706 }
<> 135:176b8275d35d 5707
<> 135:176b8275d35d 5708 /**
<> 135:176b8275d35d 5709 * @} end of Inverse park group
<> 135:176b8275d35d 5710 */
<> 135:176b8275d35d 5711
<> 135:176b8275d35d 5712
<> 135:176b8275d35d 5713 /**
<> 135:176b8275d35d 5714 * @brief Converts the elements of the Q31 vector to floating-point vector.
<> 135:176b8275d35d 5715 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 5716 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 5717 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 5718 * @return none.
<> 135:176b8275d35d 5719 */
<> 135:176b8275d35d 5720 void arm_q31_to_float(
<> 135:176b8275d35d 5721 q31_t * pSrc,
<> 135:176b8275d35d 5722 float32_t * pDst,
<> 135:176b8275d35d 5723 uint32_t blockSize);
<> 135:176b8275d35d 5724
<> 135:176b8275d35d 5725 /**
<> 135:176b8275d35d 5726 * @ingroup groupInterpolation
<> 135:176b8275d35d 5727 */
<> 135:176b8275d35d 5728
<> 135:176b8275d35d 5729 /**
<> 135:176b8275d35d 5730 * @defgroup LinearInterpolate Linear Interpolation
<> 135:176b8275d35d 5731 *
<> 135:176b8275d35d 5732 * Linear interpolation is a method of curve fitting using linear polynomials.
<> 135:176b8275d35d 5733 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
<> 135:176b8275d35d 5734 *
<> 135:176b8275d35d 5735 * \par
<> 135:176b8275d35d 5736 * \image html LinearInterp.gif "Linear interpolation"
<> 135:176b8275d35d 5737 *
<> 135:176b8275d35d 5738 * \par
<> 135:176b8275d35d 5739 * A Linear Interpolate function calculates an output value(y), for the input(x)
<> 135:176b8275d35d 5740 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
<> 135:176b8275d35d 5741 *
<> 135:176b8275d35d 5742 * \par Algorithm:
<> 135:176b8275d35d 5743 * <pre>
<> 135:176b8275d35d 5744 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
<> 135:176b8275d35d 5745 * where x0, x1 are nearest values of input x
<> 135:176b8275d35d 5746 * y0, y1 are nearest values to output y
<> 135:176b8275d35d 5747 * </pre>
<> 135:176b8275d35d 5748 *
<> 135:176b8275d35d 5749 * \par
<> 135:176b8275d35d 5750 * This set of functions implements Linear interpolation process
<> 135:176b8275d35d 5751 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
<> 135:176b8275d35d 5752 * sample of data and each call to the function returns a single processed value.
<> 135:176b8275d35d 5753 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
<> 135:176b8275d35d 5754 * <code>x</code> is the input sample value. The functions returns the output value.
<> 135:176b8275d35d 5755 *
<> 135:176b8275d35d 5756 * \par
<> 135:176b8275d35d 5757 * if x is outside of the table boundary, Linear interpolation returns first value of the table
<> 135:176b8275d35d 5758 * if x is below input range and returns last value of table if x is above range.
<> 135:176b8275d35d 5759 */
<> 135:176b8275d35d 5760
<> 135:176b8275d35d 5761 /**
<> 135:176b8275d35d 5762 * @addtogroup LinearInterpolate
<> 135:176b8275d35d 5763 * @{
<> 135:176b8275d35d 5764 */
<> 135:176b8275d35d 5765
<> 135:176b8275d35d 5766 /**
<> 135:176b8275d35d 5767 * @brief Process function for the floating-point Linear Interpolation Function.
<> 135:176b8275d35d 5768 * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure
<> 135:176b8275d35d 5769 * @param[in] x input sample to process
<> 135:176b8275d35d 5770 * @return y processed output sample.
<> 135:176b8275d35d 5771 *
<> 135:176b8275d35d 5772 */
<> 135:176b8275d35d 5773
<> 135:176b8275d35d 5774 static __INLINE float32_t arm_linear_interp_f32(
<> 135:176b8275d35d 5775 arm_linear_interp_instance_f32 * S,
<> 135:176b8275d35d 5776 float32_t x)
<> 135:176b8275d35d 5777 {
<> 135:176b8275d35d 5778
<> 135:176b8275d35d 5779 float32_t y;
<> 135:176b8275d35d 5780 float32_t x0, x1; /* Nearest input values */
<> 135:176b8275d35d 5781 float32_t y0, y1; /* Nearest output values */
<> 135:176b8275d35d 5782 float32_t xSpacing = S->xSpacing; /* spacing between input values */
<> 135:176b8275d35d 5783 int32_t i; /* Index variable */
<> 135:176b8275d35d 5784 float32_t *pYData = S->pYData; /* pointer to output table */
<> 135:176b8275d35d 5785
<> 135:176b8275d35d 5786 /* Calculation of index */
<> 135:176b8275d35d 5787 i = (int32_t) ((x - S->x1) / xSpacing);
<> 135:176b8275d35d 5788
<> 135:176b8275d35d 5789 if(i < 0)
<> 135:176b8275d35d 5790 {
<> 135:176b8275d35d 5791 /* Iniatilize output for below specified range as least output value of table */
<> 135:176b8275d35d 5792 y = pYData[0];
<> 135:176b8275d35d 5793 }
<> 135:176b8275d35d 5794 else if((uint32_t)i >= S->nValues)
<> 135:176b8275d35d 5795 {
<> 135:176b8275d35d 5796 /* Iniatilize output for above specified range as last output value of table */
<> 135:176b8275d35d 5797 y = pYData[S->nValues - 1];
<> 135:176b8275d35d 5798 }
<> 135:176b8275d35d 5799 else
<> 135:176b8275d35d 5800 {
<> 135:176b8275d35d 5801 /* Calculation of nearest input values */
<> 135:176b8275d35d 5802 x0 = S->x1 + i * xSpacing;
<> 135:176b8275d35d 5803 x1 = S->x1 + (i + 1) * xSpacing;
<> 135:176b8275d35d 5804
<> 135:176b8275d35d 5805 /* Read of nearest output values */
<> 135:176b8275d35d 5806 y0 = pYData[i];
<> 135:176b8275d35d 5807 y1 = pYData[i + 1];
<> 135:176b8275d35d 5808
<> 135:176b8275d35d 5809 /* Calculation of output */
<> 135:176b8275d35d 5810 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
<> 135:176b8275d35d 5811
<> 135:176b8275d35d 5812 }
<> 135:176b8275d35d 5813
<> 135:176b8275d35d 5814 /* returns output value */
<> 135:176b8275d35d 5815 return (y);
<> 135:176b8275d35d 5816 }
<> 135:176b8275d35d 5817
<> 135:176b8275d35d 5818 /**
<> 135:176b8275d35d 5819 *
<> 135:176b8275d35d 5820 * @brief Process function for the Q31 Linear Interpolation Function.
<> 135:176b8275d35d 5821 * @param[in] *pYData pointer to Q31 Linear Interpolation table
<> 135:176b8275d35d 5822 * @param[in] x input sample to process
<> 135:176b8275d35d 5823 * @param[in] nValues number of table values
<> 135:176b8275d35d 5824 * @return y processed output sample.
<> 135:176b8275d35d 5825 *
<> 135:176b8275d35d 5826 * \par
<> 135:176b8275d35d 5827 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 135:176b8275d35d 5828 * This function can support maximum of table size 2^12.
<> 135:176b8275d35d 5829 *
<> 135:176b8275d35d 5830 */
<> 135:176b8275d35d 5831
<> 135:176b8275d35d 5832
<> 135:176b8275d35d 5833 static __INLINE q31_t arm_linear_interp_q31(
<> 135:176b8275d35d 5834 q31_t * pYData,
<> 135:176b8275d35d 5835 q31_t x,
<> 135:176b8275d35d 5836 uint32_t nValues)
<> 135:176b8275d35d 5837 {
<> 135:176b8275d35d 5838 q31_t y; /* output */
<> 135:176b8275d35d 5839 q31_t y0, y1; /* Nearest output values */
<> 135:176b8275d35d 5840 q31_t fract; /* fractional part */
<> 135:176b8275d35d 5841 int32_t index; /* Index to read nearest output values */
<> 135:176b8275d35d 5842
<> 135:176b8275d35d 5843 /* Input is in 12.20 format */
<> 135:176b8275d35d 5844 /* 12 bits for the table index */
<> 135:176b8275d35d 5845 /* Index value calculation */
<> 135:176b8275d35d 5846 index = ((x & 0xFFF00000) >> 20);
<> 135:176b8275d35d 5847
<> 135:176b8275d35d 5848 if(index >= (int32_t)(nValues - 1))
<> 135:176b8275d35d 5849 {
<> 135:176b8275d35d 5850 return (pYData[nValues - 1]);
<> 135:176b8275d35d 5851 }
<> 135:176b8275d35d 5852 else if(index < 0)
<> 135:176b8275d35d 5853 {
<> 135:176b8275d35d 5854 return (pYData[0]);
<> 135:176b8275d35d 5855 }
<> 135:176b8275d35d 5856 else
<> 135:176b8275d35d 5857 {
<> 135:176b8275d35d 5858
<> 135:176b8275d35d 5859 /* 20 bits for the fractional part */
<> 135:176b8275d35d 5860 /* shift left by 11 to keep fract in 1.31 format */
<> 135:176b8275d35d 5861 fract = (x & 0x000FFFFF) << 11;
<> 135:176b8275d35d 5862
<> 135:176b8275d35d 5863 /* Read two nearest output values from the index in 1.31(q31) format */
<> 135:176b8275d35d 5864 y0 = pYData[index];
<> 135:176b8275d35d 5865 y1 = pYData[index + 1u];
<> 135:176b8275d35d 5866
<> 135:176b8275d35d 5867 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
<> 135:176b8275d35d 5868 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
<> 135:176b8275d35d 5869
<> 135:176b8275d35d 5870 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
<> 135:176b8275d35d 5871 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
<> 135:176b8275d35d 5872
<> 135:176b8275d35d 5873 /* Convert y to 1.31 format */
<> 135:176b8275d35d 5874 return (y << 1u);
<> 135:176b8275d35d 5875
<> 135:176b8275d35d 5876 }
<> 135:176b8275d35d 5877
<> 135:176b8275d35d 5878 }
<> 135:176b8275d35d 5879
<> 135:176b8275d35d 5880 /**
<> 135:176b8275d35d 5881 *
<> 135:176b8275d35d 5882 * @brief Process function for the Q15 Linear Interpolation Function.
<> 135:176b8275d35d 5883 * @param[in] *pYData pointer to Q15 Linear Interpolation table
<> 135:176b8275d35d 5884 * @param[in] x input sample to process
<> 135:176b8275d35d 5885 * @param[in] nValues number of table values
<> 135:176b8275d35d 5886 * @return y processed output sample.
<> 135:176b8275d35d 5887 *
<> 135:176b8275d35d 5888 * \par
<> 135:176b8275d35d 5889 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 135:176b8275d35d 5890 * This function can support maximum of table size 2^12.
<> 135:176b8275d35d 5891 *
<> 135:176b8275d35d 5892 */
<> 135:176b8275d35d 5893
<> 135:176b8275d35d 5894
<> 135:176b8275d35d 5895 static __INLINE q15_t arm_linear_interp_q15(
<> 135:176b8275d35d 5896 q15_t * pYData,
<> 135:176b8275d35d 5897 q31_t x,
<> 135:176b8275d35d 5898 uint32_t nValues)
<> 135:176b8275d35d 5899 {
<> 135:176b8275d35d 5900 q63_t y; /* output */
<> 135:176b8275d35d 5901 q15_t y0, y1; /* Nearest output values */
<> 135:176b8275d35d 5902 q31_t fract; /* fractional part */
<> 135:176b8275d35d 5903 int32_t index; /* Index to read nearest output values */
<> 135:176b8275d35d 5904
<> 135:176b8275d35d 5905 /* Input is in 12.20 format */
<> 135:176b8275d35d 5906 /* 12 bits for the table index */
<> 135:176b8275d35d 5907 /* Index value calculation */
<> 135:176b8275d35d 5908 index = ((x & 0xFFF00000) >> 20u);
<> 135:176b8275d35d 5909
<> 135:176b8275d35d 5910 if(index >= (int32_t)(nValues - 1))
<> 135:176b8275d35d 5911 {
<> 135:176b8275d35d 5912 return (pYData[nValues - 1]);
<> 135:176b8275d35d 5913 }
<> 135:176b8275d35d 5914 else if(index < 0)
<> 135:176b8275d35d 5915 {
<> 135:176b8275d35d 5916 return (pYData[0]);
<> 135:176b8275d35d 5917 }
<> 135:176b8275d35d 5918 else
<> 135:176b8275d35d 5919 {
<> 135:176b8275d35d 5920 /* 20 bits for the fractional part */
<> 135:176b8275d35d 5921 /* fract is in 12.20 format */
<> 135:176b8275d35d 5922 fract = (x & 0x000FFFFF);
<> 135:176b8275d35d 5923
<> 135:176b8275d35d 5924 /* Read two nearest output values from the index */
<> 135:176b8275d35d 5925 y0 = pYData[index];
<> 135:176b8275d35d 5926 y1 = pYData[index + 1u];
<> 135:176b8275d35d 5927
<> 135:176b8275d35d 5928 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
<> 135:176b8275d35d 5929 y = ((q63_t) y0 * (0xFFFFF - fract));
<> 135:176b8275d35d 5930
<> 135:176b8275d35d 5931 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
<> 135:176b8275d35d 5932 y += ((q63_t) y1 * (fract));
<> 135:176b8275d35d 5933
<> 135:176b8275d35d 5934 /* convert y to 1.15 format */
<> 135:176b8275d35d 5935 return (y >> 20);
<> 135:176b8275d35d 5936 }
<> 135:176b8275d35d 5937
<> 135:176b8275d35d 5938
<> 135:176b8275d35d 5939 }
<> 135:176b8275d35d 5940
<> 135:176b8275d35d 5941 /**
<> 135:176b8275d35d 5942 *
<> 135:176b8275d35d 5943 * @brief Process function for the Q7 Linear Interpolation Function.
<> 135:176b8275d35d 5944 * @param[in] *pYData pointer to Q7 Linear Interpolation table
<> 135:176b8275d35d 5945 * @param[in] x input sample to process
<> 135:176b8275d35d 5946 * @param[in] nValues number of table values
<> 135:176b8275d35d 5947 * @return y processed output sample.
<> 135:176b8275d35d 5948 *
<> 135:176b8275d35d 5949 * \par
<> 135:176b8275d35d 5950 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 135:176b8275d35d 5951 * This function can support maximum of table size 2^12.
<> 135:176b8275d35d 5952 */
<> 135:176b8275d35d 5953
<> 135:176b8275d35d 5954
<> 135:176b8275d35d 5955 static __INLINE q7_t arm_linear_interp_q7(
<> 135:176b8275d35d 5956 q7_t * pYData,
<> 135:176b8275d35d 5957 q31_t x,
<> 135:176b8275d35d 5958 uint32_t nValues)
<> 135:176b8275d35d 5959 {
<> 135:176b8275d35d 5960 q31_t y; /* output */
<> 135:176b8275d35d 5961 q7_t y0, y1; /* Nearest output values */
<> 135:176b8275d35d 5962 q31_t fract; /* fractional part */
<> 135:176b8275d35d 5963 uint32_t index; /* Index to read nearest output values */
<> 135:176b8275d35d 5964
<> 135:176b8275d35d 5965 /* Input is in 12.20 format */
<> 135:176b8275d35d 5966 /* 12 bits for the table index */
<> 135:176b8275d35d 5967 /* Index value calculation */
<> 135:176b8275d35d 5968 if (x < 0)
<> 135:176b8275d35d 5969 {
<> 135:176b8275d35d 5970 return (pYData[0]);
<> 135:176b8275d35d 5971 }
<> 135:176b8275d35d 5972 index = (x >> 20) & 0xfff;
<> 135:176b8275d35d 5973
<> 135:176b8275d35d 5974
<> 135:176b8275d35d 5975 if(index >= (nValues - 1))
<> 135:176b8275d35d 5976 {
<> 135:176b8275d35d 5977 return (pYData[nValues - 1]);
<> 135:176b8275d35d 5978 }
<> 135:176b8275d35d 5979 else
<> 135:176b8275d35d 5980 {
<> 135:176b8275d35d 5981
<> 135:176b8275d35d 5982 /* 20 bits for the fractional part */
<> 135:176b8275d35d 5983 /* fract is in 12.20 format */
<> 135:176b8275d35d 5984 fract = (x & 0x000FFFFF);
<> 135:176b8275d35d 5985
<> 135:176b8275d35d 5986 /* Read two nearest output values from the index and are in 1.7(q7) format */
<> 135:176b8275d35d 5987 y0 = pYData[index];
<> 135:176b8275d35d 5988 y1 = pYData[index + 1u];
<> 135:176b8275d35d 5989
<> 135:176b8275d35d 5990 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
<> 135:176b8275d35d 5991 y = ((y0 * (0xFFFFF - fract)));
<> 135:176b8275d35d 5992
<> 135:176b8275d35d 5993 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
<> 135:176b8275d35d 5994 y += (y1 * fract);
<> 135:176b8275d35d 5995
<> 135:176b8275d35d 5996 /* convert y to 1.7(q7) format */
<> 135:176b8275d35d 5997 return (y >> 20u);
<> 135:176b8275d35d 5998
<> 135:176b8275d35d 5999 }
<> 135:176b8275d35d 6000
<> 135:176b8275d35d 6001 }
<> 135:176b8275d35d 6002 /**
<> 135:176b8275d35d 6003 * @} end of LinearInterpolate group
<> 135:176b8275d35d 6004 */
<> 135:176b8275d35d 6005
<> 135:176b8275d35d 6006 /**
<> 135:176b8275d35d 6007 * @brief Fast approximation to the trigonometric sine function for floating-point data.
<> 135:176b8275d35d 6008 * @param[in] x input value in radians.
<> 135:176b8275d35d 6009 * @return sin(x).
<> 135:176b8275d35d 6010 */
<> 135:176b8275d35d 6011
<> 135:176b8275d35d 6012 float32_t arm_sin_f32(
<> 135:176b8275d35d 6013 float32_t x);
<> 135:176b8275d35d 6014
<> 135:176b8275d35d 6015 /**
<> 135:176b8275d35d 6016 * @brief Fast approximation to the trigonometric sine function for Q31 data.
<> 135:176b8275d35d 6017 * @param[in] x Scaled input value in radians.
<> 135:176b8275d35d 6018 * @return sin(x).
<> 135:176b8275d35d 6019 */
<> 135:176b8275d35d 6020
<> 135:176b8275d35d 6021 q31_t arm_sin_q31(
<> 135:176b8275d35d 6022 q31_t x);
<> 135:176b8275d35d 6023
<> 135:176b8275d35d 6024 /**
<> 135:176b8275d35d 6025 * @brief Fast approximation to the trigonometric sine function for Q15 data.
<> 135:176b8275d35d 6026 * @param[in] x Scaled input value in radians.
<> 135:176b8275d35d 6027 * @return sin(x).
<> 135:176b8275d35d 6028 */
<> 135:176b8275d35d 6029
<> 135:176b8275d35d 6030 q15_t arm_sin_q15(
<> 135:176b8275d35d 6031 q15_t x);
<> 135:176b8275d35d 6032
<> 135:176b8275d35d 6033 /**
<> 135:176b8275d35d 6034 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
<> 135:176b8275d35d 6035 * @param[in] x input value in radians.
<> 135:176b8275d35d 6036 * @return cos(x).
<> 135:176b8275d35d 6037 */
<> 135:176b8275d35d 6038
<> 135:176b8275d35d 6039 float32_t arm_cos_f32(
<> 135:176b8275d35d 6040 float32_t x);
<> 135:176b8275d35d 6041
<> 135:176b8275d35d 6042 /**
<> 135:176b8275d35d 6043 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
<> 135:176b8275d35d 6044 * @param[in] x Scaled input value in radians.
<> 135:176b8275d35d 6045 * @return cos(x).
<> 135:176b8275d35d 6046 */
<> 135:176b8275d35d 6047
<> 135:176b8275d35d 6048 q31_t arm_cos_q31(
<> 135:176b8275d35d 6049 q31_t x);
<> 135:176b8275d35d 6050
<> 135:176b8275d35d 6051 /**
<> 135:176b8275d35d 6052 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
<> 135:176b8275d35d 6053 * @param[in] x Scaled input value in radians.
<> 135:176b8275d35d 6054 * @return cos(x).
<> 135:176b8275d35d 6055 */
<> 135:176b8275d35d 6056
<> 135:176b8275d35d 6057 q15_t arm_cos_q15(
<> 135:176b8275d35d 6058 q15_t x);
<> 135:176b8275d35d 6059
<> 135:176b8275d35d 6060
<> 135:176b8275d35d 6061 /**
<> 135:176b8275d35d 6062 * @ingroup groupFastMath
<> 135:176b8275d35d 6063 */
<> 135:176b8275d35d 6064
<> 135:176b8275d35d 6065
<> 135:176b8275d35d 6066 /**
<> 135:176b8275d35d 6067 * @defgroup SQRT Square Root
<> 135:176b8275d35d 6068 *
<> 135:176b8275d35d 6069 * Computes the square root of a number.
<> 135:176b8275d35d 6070 * There are separate functions for Q15, Q31, and floating-point data types.
<> 135:176b8275d35d 6071 * The square root function is computed using the Newton-Raphson algorithm.
<> 135:176b8275d35d 6072 * This is an iterative algorithm of the form:
<> 135:176b8275d35d 6073 * <pre>
<> 135:176b8275d35d 6074 * x1 = x0 - f(x0)/f'(x0)
<> 135:176b8275d35d 6075 * </pre>
<> 135:176b8275d35d 6076 * where <code>x1</code> is the current estimate,
<> 135:176b8275d35d 6077 * <code>x0</code> is the previous estimate, and
<> 135:176b8275d35d 6078 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
<> 135:176b8275d35d 6079 * For the square root function, the algorithm reduces to:
<> 135:176b8275d35d 6080 * <pre>
<> 135:176b8275d35d 6081 * x0 = in/2 [initial guess]
<> 135:176b8275d35d 6082 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
<> 135:176b8275d35d 6083 * </pre>
<> 135:176b8275d35d 6084 */
<> 135:176b8275d35d 6085
<> 135:176b8275d35d 6086
<> 135:176b8275d35d 6087 /**
<> 135:176b8275d35d 6088 * @addtogroup SQRT
<> 135:176b8275d35d 6089 * @{
<> 135:176b8275d35d 6090 */
<> 135:176b8275d35d 6091
<> 135:176b8275d35d 6092 /**
<> 135:176b8275d35d 6093 * @brief Floating-point square root function.
<> 135:176b8275d35d 6094 * @param[in] in input value.
<> 135:176b8275d35d 6095 * @param[out] *pOut square root of input value.
<> 135:176b8275d35d 6096 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 135:176b8275d35d 6097 * <code>in</code> is negative value and returns zero output for negative values.
<> 135:176b8275d35d 6098 */
<> 135:176b8275d35d 6099
<> 135:176b8275d35d 6100 static __INLINE arm_status arm_sqrt_f32(
<> 135:176b8275d35d 6101 float32_t in,
<> 135:176b8275d35d 6102 float32_t * pOut)
<> 135:176b8275d35d 6103 {
<> 135:176b8275d35d 6104 if(in >= 0.0f)
<> 135:176b8275d35d 6105 {
<> 135:176b8275d35d 6106
<> 135:176b8275d35d 6107 // #if __FPU_USED
<> 135:176b8275d35d 6108 #if (__FPU_USED == 1) && defined ( __CC_ARM )
<> 135:176b8275d35d 6109 *pOut = __sqrtf(in);
<> 135:176b8275d35d 6110 #else
<> 135:176b8275d35d 6111 *pOut = sqrtf(in);
<> 135:176b8275d35d 6112 #endif
<> 135:176b8275d35d 6113
<> 135:176b8275d35d 6114 return (ARM_MATH_SUCCESS);
<> 135:176b8275d35d 6115 }
<> 135:176b8275d35d 6116 else
<> 135:176b8275d35d 6117 {
<> 135:176b8275d35d 6118 *pOut = 0.0f;
<> 135:176b8275d35d 6119 return (ARM_MATH_ARGUMENT_ERROR);
<> 135:176b8275d35d 6120 }
<> 135:176b8275d35d 6121
<> 135:176b8275d35d 6122 }
<> 135:176b8275d35d 6123
<> 135:176b8275d35d 6124
<> 135:176b8275d35d 6125 /**
<> 135:176b8275d35d 6126 * @brief Q31 square root function.
<> 135:176b8275d35d 6127 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
<> 135:176b8275d35d 6128 * @param[out] *pOut square root of input value.
<> 135:176b8275d35d 6129 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 135:176b8275d35d 6130 * <code>in</code> is negative value and returns zero output for negative values.
<> 135:176b8275d35d 6131 */
<> 135:176b8275d35d 6132 arm_status arm_sqrt_q31(
<> 135:176b8275d35d 6133 q31_t in,
<> 135:176b8275d35d 6134 q31_t * pOut);
<> 135:176b8275d35d 6135
<> 135:176b8275d35d 6136 /**
<> 135:176b8275d35d 6137 * @brief Q15 square root function.
<> 135:176b8275d35d 6138 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
<> 135:176b8275d35d 6139 * @param[out] *pOut square root of input value.
<> 135:176b8275d35d 6140 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 135:176b8275d35d 6141 * <code>in</code> is negative value and returns zero output for negative values.
<> 135:176b8275d35d 6142 */
<> 135:176b8275d35d 6143 arm_status arm_sqrt_q15(
<> 135:176b8275d35d 6144 q15_t in,
<> 135:176b8275d35d 6145 q15_t * pOut);
<> 135:176b8275d35d 6146
<> 135:176b8275d35d 6147 /**
<> 135:176b8275d35d 6148 * @} end of SQRT group
<> 135:176b8275d35d 6149 */
<> 135:176b8275d35d 6150
<> 135:176b8275d35d 6151
<> 135:176b8275d35d 6152
<> 135:176b8275d35d 6153
<> 135:176b8275d35d 6154
<> 135:176b8275d35d 6155
<> 135:176b8275d35d 6156 /**
<> 135:176b8275d35d 6157 * @brief floating-point Circular write function.
<> 135:176b8275d35d 6158 */
<> 135:176b8275d35d 6159
<> 135:176b8275d35d 6160 static __INLINE void arm_circularWrite_f32(
<> 135:176b8275d35d 6161 int32_t * circBuffer,
<> 135:176b8275d35d 6162 int32_t L,
<> 135:176b8275d35d 6163 uint16_t * writeOffset,
<> 135:176b8275d35d 6164 int32_t bufferInc,
<> 135:176b8275d35d 6165 const int32_t * src,
<> 135:176b8275d35d 6166 int32_t srcInc,
<> 135:176b8275d35d 6167 uint32_t blockSize)
<> 135:176b8275d35d 6168 {
<> 135:176b8275d35d 6169 uint32_t i = 0u;
<> 135:176b8275d35d 6170 int32_t wOffset;
<> 135:176b8275d35d 6171
<> 135:176b8275d35d 6172 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6173 * to the current location where the input samples to be copied */
<> 135:176b8275d35d 6174 wOffset = *writeOffset;
<> 135:176b8275d35d 6175
<> 135:176b8275d35d 6176 /* Loop over the blockSize */
<> 135:176b8275d35d 6177 i = blockSize;
<> 135:176b8275d35d 6178
<> 135:176b8275d35d 6179 while(i > 0u)
<> 135:176b8275d35d 6180 {
<> 135:176b8275d35d 6181 /* copy the input sample to the circular buffer */
<> 135:176b8275d35d 6182 circBuffer[wOffset] = *src;
<> 135:176b8275d35d 6183
<> 135:176b8275d35d 6184 /* Update the input pointer */
<> 135:176b8275d35d 6185 src += srcInc;
<> 135:176b8275d35d 6186
<> 135:176b8275d35d 6187 /* Circularly update wOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6188 wOffset += bufferInc;
<> 135:176b8275d35d 6189 if(wOffset >= L)
<> 135:176b8275d35d 6190 wOffset -= L;
<> 135:176b8275d35d 6191
<> 135:176b8275d35d 6192 /* Decrement the loop counter */
<> 135:176b8275d35d 6193 i--;
<> 135:176b8275d35d 6194 }
<> 135:176b8275d35d 6195
<> 135:176b8275d35d 6196 /* Update the index pointer */
<> 135:176b8275d35d 6197 *writeOffset = wOffset;
<> 135:176b8275d35d 6198 }
<> 135:176b8275d35d 6199
<> 135:176b8275d35d 6200
<> 135:176b8275d35d 6201
<> 135:176b8275d35d 6202 /**
<> 135:176b8275d35d 6203 * @brief floating-point Circular Read function.
<> 135:176b8275d35d 6204 */
<> 135:176b8275d35d 6205 static __INLINE void arm_circularRead_f32(
<> 135:176b8275d35d 6206 int32_t * circBuffer,
<> 135:176b8275d35d 6207 int32_t L,
<> 135:176b8275d35d 6208 int32_t * readOffset,
<> 135:176b8275d35d 6209 int32_t bufferInc,
<> 135:176b8275d35d 6210 int32_t * dst,
<> 135:176b8275d35d 6211 int32_t * dst_base,
<> 135:176b8275d35d 6212 int32_t dst_length,
<> 135:176b8275d35d 6213 int32_t dstInc,
<> 135:176b8275d35d 6214 uint32_t blockSize)
<> 135:176b8275d35d 6215 {
<> 135:176b8275d35d 6216 uint32_t i = 0u;
<> 135:176b8275d35d 6217 int32_t rOffset, dst_end;
<> 135:176b8275d35d 6218
<> 135:176b8275d35d 6219 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6220 * to the current location from where the input samples to be read */
<> 135:176b8275d35d 6221 rOffset = *readOffset;
<> 135:176b8275d35d 6222 dst_end = (int32_t) (dst_base + dst_length);
<> 135:176b8275d35d 6223
<> 135:176b8275d35d 6224 /* Loop over the blockSize */
<> 135:176b8275d35d 6225 i = blockSize;
<> 135:176b8275d35d 6226
<> 135:176b8275d35d 6227 while(i > 0u)
<> 135:176b8275d35d 6228 {
<> 135:176b8275d35d 6229 /* copy the sample from the circular buffer to the destination buffer */
<> 135:176b8275d35d 6230 *dst = circBuffer[rOffset];
<> 135:176b8275d35d 6231
<> 135:176b8275d35d 6232 /* Update the input pointer */
<> 135:176b8275d35d 6233 dst += dstInc;
<> 135:176b8275d35d 6234
<> 135:176b8275d35d 6235 if(dst == (int32_t *) dst_end)
<> 135:176b8275d35d 6236 {
<> 135:176b8275d35d 6237 dst = dst_base;
<> 135:176b8275d35d 6238 }
<> 135:176b8275d35d 6239
<> 135:176b8275d35d 6240 /* Circularly update rOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6241 rOffset += bufferInc;
<> 135:176b8275d35d 6242
<> 135:176b8275d35d 6243 if(rOffset >= L)
<> 135:176b8275d35d 6244 {
<> 135:176b8275d35d 6245 rOffset -= L;
<> 135:176b8275d35d 6246 }
<> 135:176b8275d35d 6247
<> 135:176b8275d35d 6248 /* Decrement the loop counter */
<> 135:176b8275d35d 6249 i--;
<> 135:176b8275d35d 6250 }
<> 135:176b8275d35d 6251
<> 135:176b8275d35d 6252 /* Update the index pointer */
<> 135:176b8275d35d 6253 *readOffset = rOffset;
<> 135:176b8275d35d 6254 }
<> 135:176b8275d35d 6255
<> 135:176b8275d35d 6256 /**
<> 135:176b8275d35d 6257 * @brief Q15 Circular write function.
<> 135:176b8275d35d 6258 */
<> 135:176b8275d35d 6259
<> 135:176b8275d35d 6260 static __INLINE void arm_circularWrite_q15(
<> 135:176b8275d35d 6261 q15_t * circBuffer,
<> 135:176b8275d35d 6262 int32_t L,
<> 135:176b8275d35d 6263 uint16_t * writeOffset,
<> 135:176b8275d35d 6264 int32_t bufferInc,
<> 135:176b8275d35d 6265 const q15_t * src,
<> 135:176b8275d35d 6266 int32_t srcInc,
<> 135:176b8275d35d 6267 uint32_t blockSize)
<> 135:176b8275d35d 6268 {
<> 135:176b8275d35d 6269 uint32_t i = 0u;
<> 135:176b8275d35d 6270 int32_t wOffset;
<> 135:176b8275d35d 6271
<> 135:176b8275d35d 6272 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6273 * to the current location where the input samples to be copied */
<> 135:176b8275d35d 6274 wOffset = *writeOffset;
<> 135:176b8275d35d 6275
<> 135:176b8275d35d 6276 /* Loop over the blockSize */
<> 135:176b8275d35d 6277 i = blockSize;
<> 135:176b8275d35d 6278
<> 135:176b8275d35d 6279 while(i > 0u)
<> 135:176b8275d35d 6280 {
<> 135:176b8275d35d 6281 /* copy the input sample to the circular buffer */
<> 135:176b8275d35d 6282 circBuffer[wOffset] = *src;
<> 135:176b8275d35d 6283
<> 135:176b8275d35d 6284 /* Update the input pointer */
<> 135:176b8275d35d 6285 src += srcInc;
<> 135:176b8275d35d 6286
<> 135:176b8275d35d 6287 /* Circularly update wOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6288 wOffset += bufferInc;
<> 135:176b8275d35d 6289 if(wOffset >= L)
<> 135:176b8275d35d 6290 wOffset -= L;
<> 135:176b8275d35d 6291
<> 135:176b8275d35d 6292 /* Decrement the loop counter */
<> 135:176b8275d35d 6293 i--;
<> 135:176b8275d35d 6294 }
<> 135:176b8275d35d 6295
<> 135:176b8275d35d 6296 /* Update the index pointer */
<> 135:176b8275d35d 6297 *writeOffset = wOffset;
<> 135:176b8275d35d 6298 }
<> 135:176b8275d35d 6299
<> 135:176b8275d35d 6300
<> 135:176b8275d35d 6301
<> 135:176b8275d35d 6302 /**
<> 135:176b8275d35d 6303 * @brief Q15 Circular Read function.
<> 135:176b8275d35d 6304 */
<> 135:176b8275d35d 6305 static __INLINE void arm_circularRead_q15(
<> 135:176b8275d35d 6306 q15_t * circBuffer,
<> 135:176b8275d35d 6307 int32_t L,
<> 135:176b8275d35d 6308 int32_t * readOffset,
<> 135:176b8275d35d 6309 int32_t bufferInc,
<> 135:176b8275d35d 6310 q15_t * dst,
<> 135:176b8275d35d 6311 q15_t * dst_base,
<> 135:176b8275d35d 6312 int32_t dst_length,
<> 135:176b8275d35d 6313 int32_t dstInc,
<> 135:176b8275d35d 6314 uint32_t blockSize)
<> 135:176b8275d35d 6315 {
<> 135:176b8275d35d 6316 uint32_t i = 0;
<> 135:176b8275d35d 6317 int32_t rOffset, dst_end;
<> 135:176b8275d35d 6318
<> 135:176b8275d35d 6319 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6320 * to the current location from where the input samples to be read */
<> 135:176b8275d35d 6321 rOffset = *readOffset;
<> 135:176b8275d35d 6322
<> 135:176b8275d35d 6323 dst_end = (int32_t) (dst_base + dst_length);
<> 135:176b8275d35d 6324
<> 135:176b8275d35d 6325 /* Loop over the blockSize */
<> 135:176b8275d35d 6326 i = blockSize;
<> 135:176b8275d35d 6327
<> 135:176b8275d35d 6328 while(i > 0u)
<> 135:176b8275d35d 6329 {
<> 135:176b8275d35d 6330 /* copy the sample from the circular buffer to the destination buffer */
<> 135:176b8275d35d 6331 *dst = circBuffer[rOffset];
<> 135:176b8275d35d 6332
<> 135:176b8275d35d 6333 /* Update the input pointer */
<> 135:176b8275d35d 6334 dst += dstInc;
<> 135:176b8275d35d 6335
<> 135:176b8275d35d 6336 if(dst == (q15_t *) dst_end)
<> 135:176b8275d35d 6337 {
<> 135:176b8275d35d 6338 dst = dst_base;
<> 135:176b8275d35d 6339 }
<> 135:176b8275d35d 6340
<> 135:176b8275d35d 6341 /* Circularly update wOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6342 rOffset += bufferInc;
<> 135:176b8275d35d 6343
<> 135:176b8275d35d 6344 if(rOffset >= L)
<> 135:176b8275d35d 6345 {
<> 135:176b8275d35d 6346 rOffset -= L;
<> 135:176b8275d35d 6347 }
<> 135:176b8275d35d 6348
<> 135:176b8275d35d 6349 /* Decrement the loop counter */
<> 135:176b8275d35d 6350 i--;
<> 135:176b8275d35d 6351 }
<> 135:176b8275d35d 6352
<> 135:176b8275d35d 6353 /* Update the index pointer */
<> 135:176b8275d35d 6354 *readOffset = rOffset;
<> 135:176b8275d35d 6355 }
<> 135:176b8275d35d 6356
<> 135:176b8275d35d 6357
<> 135:176b8275d35d 6358 /**
<> 135:176b8275d35d 6359 * @brief Q7 Circular write function.
<> 135:176b8275d35d 6360 */
<> 135:176b8275d35d 6361
<> 135:176b8275d35d 6362 static __INLINE void arm_circularWrite_q7(
<> 135:176b8275d35d 6363 q7_t * circBuffer,
<> 135:176b8275d35d 6364 int32_t L,
<> 135:176b8275d35d 6365 uint16_t * writeOffset,
<> 135:176b8275d35d 6366 int32_t bufferInc,
<> 135:176b8275d35d 6367 const q7_t * src,
<> 135:176b8275d35d 6368 int32_t srcInc,
<> 135:176b8275d35d 6369 uint32_t blockSize)
<> 135:176b8275d35d 6370 {
<> 135:176b8275d35d 6371 uint32_t i = 0u;
<> 135:176b8275d35d 6372 int32_t wOffset;
<> 135:176b8275d35d 6373
<> 135:176b8275d35d 6374 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6375 * to the current location where the input samples to be copied */
<> 135:176b8275d35d 6376 wOffset = *writeOffset;
<> 135:176b8275d35d 6377
<> 135:176b8275d35d 6378 /* Loop over the blockSize */
<> 135:176b8275d35d 6379 i = blockSize;
<> 135:176b8275d35d 6380
<> 135:176b8275d35d 6381 while(i > 0u)
<> 135:176b8275d35d 6382 {
<> 135:176b8275d35d 6383 /* copy the input sample to the circular buffer */
<> 135:176b8275d35d 6384 circBuffer[wOffset] = *src;
<> 135:176b8275d35d 6385
<> 135:176b8275d35d 6386 /* Update the input pointer */
<> 135:176b8275d35d 6387 src += srcInc;
<> 135:176b8275d35d 6388
<> 135:176b8275d35d 6389 /* Circularly update wOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6390 wOffset += bufferInc;
<> 135:176b8275d35d 6391 if(wOffset >= L)
<> 135:176b8275d35d 6392 wOffset -= L;
<> 135:176b8275d35d 6393
<> 135:176b8275d35d 6394 /* Decrement the loop counter */
<> 135:176b8275d35d 6395 i--;
<> 135:176b8275d35d 6396 }
<> 135:176b8275d35d 6397
<> 135:176b8275d35d 6398 /* Update the index pointer */
<> 135:176b8275d35d 6399 *writeOffset = wOffset;
<> 135:176b8275d35d 6400 }
<> 135:176b8275d35d 6401
<> 135:176b8275d35d 6402
<> 135:176b8275d35d 6403
<> 135:176b8275d35d 6404 /**
<> 135:176b8275d35d 6405 * @brief Q7 Circular Read function.
<> 135:176b8275d35d 6406 */
<> 135:176b8275d35d 6407 static __INLINE void arm_circularRead_q7(
<> 135:176b8275d35d 6408 q7_t * circBuffer,
<> 135:176b8275d35d 6409 int32_t L,
<> 135:176b8275d35d 6410 int32_t * readOffset,
<> 135:176b8275d35d 6411 int32_t bufferInc,
<> 135:176b8275d35d 6412 q7_t * dst,
<> 135:176b8275d35d 6413 q7_t * dst_base,
<> 135:176b8275d35d 6414 int32_t dst_length,
<> 135:176b8275d35d 6415 int32_t dstInc,
<> 135:176b8275d35d 6416 uint32_t blockSize)
<> 135:176b8275d35d 6417 {
<> 135:176b8275d35d 6418 uint32_t i = 0;
<> 135:176b8275d35d 6419 int32_t rOffset, dst_end;
<> 135:176b8275d35d 6420
<> 135:176b8275d35d 6421 /* Copy the value of Index pointer that points
<> 135:176b8275d35d 6422 * to the current location from where the input samples to be read */
<> 135:176b8275d35d 6423 rOffset = *readOffset;
<> 135:176b8275d35d 6424
<> 135:176b8275d35d 6425 dst_end = (int32_t) (dst_base + dst_length);
<> 135:176b8275d35d 6426
<> 135:176b8275d35d 6427 /* Loop over the blockSize */
<> 135:176b8275d35d 6428 i = blockSize;
<> 135:176b8275d35d 6429
<> 135:176b8275d35d 6430 while(i > 0u)
<> 135:176b8275d35d 6431 {
<> 135:176b8275d35d 6432 /* copy the sample from the circular buffer to the destination buffer */
<> 135:176b8275d35d 6433 *dst = circBuffer[rOffset];
<> 135:176b8275d35d 6434
<> 135:176b8275d35d 6435 /* Update the input pointer */
<> 135:176b8275d35d 6436 dst += dstInc;
<> 135:176b8275d35d 6437
<> 135:176b8275d35d 6438 if(dst == (q7_t *) dst_end)
<> 135:176b8275d35d 6439 {
<> 135:176b8275d35d 6440 dst = dst_base;
<> 135:176b8275d35d 6441 }
<> 135:176b8275d35d 6442
<> 135:176b8275d35d 6443 /* Circularly update rOffset. Watch out for positive and negative value */
<> 135:176b8275d35d 6444 rOffset += bufferInc;
<> 135:176b8275d35d 6445
<> 135:176b8275d35d 6446 if(rOffset >= L)
<> 135:176b8275d35d 6447 {
<> 135:176b8275d35d 6448 rOffset -= L;
<> 135:176b8275d35d 6449 }
<> 135:176b8275d35d 6450
<> 135:176b8275d35d 6451 /* Decrement the loop counter */
<> 135:176b8275d35d 6452 i--;
<> 135:176b8275d35d 6453 }
<> 135:176b8275d35d 6454
<> 135:176b8275d35d 6455 /* Update the index pointer */
<> 135:176b8275d35d 6456 *readOffset = rOffset;
<> 135:176b8275d35d 6457 }
<> 135:176b8275d35d 6458
<> 135:176b8275d35d 6459
<> 135:176b8275d35d 6460 /**
<> 135:176b8275d35d 6461 * @brief Sum of the squares of the elements of a Q31 vector.
<> 135:176b8275d35d 6462 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6463 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6464 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6465 * @return none.
<> 135:176b8275d35d 6466 */
<> 135:176b8275d35d 6467
<> 135:176b8275d35d 6468 void arm_power_q31(
<> 135:176b8275d35d 6469 q31_t * pSrc,
<> 135:176b8275d35d 6470 uint32_t blockSize,
<> 135:176b8275d35d 6471 q63_t * pResult);
<> 135:176b8275d35d 6472
<> 135:176b8275d35d 6473 /**
<> 135:176b8275d35d 6474 * @brief Sum of the squares of the elements of a floating-point vector.
<> 135:176b8275d35d 6475 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6476 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6477 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6478 * @return none.
<> 135:176b8275d35d 6479 */
<> 135:176b8275d35d 6480
<> 135:176b8275d35d 6481 void arm_power_f32(
<> 135:176b8275d35d 6482 float32_t * pSrc,
<> 135:176b8275d35d 6483 uint32_t blockSize,
<> 135:176b8275d35d 6484 float32_t * pResult);
<> 135:176b8275d35d 6485
<> 135:176b8275d35d 6486 /**
<> 135:176b8275d35d 6487 * @brief Sum of the squares of the elements of a Q15 vector.
<> 135:176b8275d35d 6488 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6489 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6490 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6491 * @return none.
<> 135:176b8275d35d 6492 */
<> 135:176b8275d35d 6493
<> 135:176b8275d35d 6494 void arm_power_q15(
<> 135:176b8275d35d 6495 q15_t * pSrc,
<> 135:176b8275d35d 6496 uint32_t blockSize,
<> 135:176b8275d35d 6497 q63_t * pResult);
<> 135:176b8275d35d 6498
<> 135:176b8275d35d 6499 /**
<> 135:176b8275d35d 6500 * @brief Sum of the squares of the elements of a Q7 vector.
<> 135:176b8275d35d 6501 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6502 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6503 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6504 * @return none.
<> 135:176b8275d35d 6505 */
<> 135:176b8275d35d 6506
<> 135:176b8275d35d 6507 void arm_power_q7(
<> 135:176b8275d35d 6508 q7_t * pSrc,
<> 135:176b8275d35d 6509 uint32_t blockSize,
<> 135:176b8275d35d 6510 q31_t * pResult);
<> 135:176b8275d35d 6511
<> 135:176b8275d35d 6512 /**
<> 135:176b8275d35d 6513 * @brief Mean value of a Q7 vector.
<> 135:176b8275d35d 6514 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6515 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6516 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6517 * @return none.
<> 135:176b8275d35d 6518 */
<> 135:176b8275d35d 6519
<> 135:176b8275d35d 6520 void arm_mean_q7(
<> 135:176b8275d35d 6521 q7_t * pSrc,
<> 135:176b8275d35d 6522 uint32_t blockSize,
<> 135:176b8275d35d 6523 q7_t * pResult);
<> 135:176b8275d35d 6524
<> 135:176b8275d35d 6525 /**
<> 135:176b8275d35d 6526 * @brief Mean value of a Q15 vector.
<> 135:176b8275d35d 6527 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6528 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6529 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6530 * @return none.
<> 135:176b8275d35d 6531 */
<> 135:176b8275d35d 6532 void arm_mean_q15(
<> 135:176b8275d35d 6533 q15_t * pSrc,
<> 135:176b8275d35d 6534 uint32_t blockSize,
<> 135:176b8275d35d 6535 q15_t * pResult);
<> 135:176b8275d35d 6536
<> 135:176b8275d35d 6537 /**
<> 135:176b8275d35d 6538 * @brief Mean value of a Q31 vector.
<> 135:176b8275d35d 6539 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6540 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6541 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6542 * @return none.
<> 135:176b8275d35d 6543 */
<> 135:176b8275d35d 6544 void arm_mean_q31(
<> 135:176b8275d35d 6545 q31_t * pSrc,
<> 135:176b8275d35d 6546 uint32_t blockSize,
<> 135:176b8275d35d 6547 q31_t * pResult);
<> 135:176b8275d35d 6548
<> 135:176b8275d35d 6549 /**
<> 135:176b8275d35d 6550 * @brief Mean value of a floating-point vector.
<> 135:176b8275d35d 6551 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6552 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6553 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6554 * @return none.
<> 135:176b8275d35d 6555 */
<> 135:176b8275d35d 6556 void arm_mean_f32(
<> 135:176b8275d35d 6557 float32_t * pSrc,
<> 135:176b8275d35d 6558 uint32_t blockSize,
<> 135:176b8275d35d 6559 float32_t * pResult);
<> 135:176b8275d35d 6560
<> 135:176b8275d35d 6561 /**
<> 135:176b8275d35d 6562 * @brief Variance of the elements of a floating-point vector.
<> 135:176b8275d35d 6563 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6564 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6565 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6566 * @return none.
<> 135:176b8275d35d 6567 */
<> 135:176b8275d35d 6568
<> 135:176b8275d35d 6569 void arm_var_f32(
<> 135:176b8275d35d 6570 float32_t * pSrc,
<> 135:176b8275d35d 6571 uint32_t blockSize,
<> 135:176b8275d35d 6572 float32_t * pResult);
<> 135:176b8275d35d 6573
<> 135:176b8275d35d 6574 /**
<> 135:176b8275d35d 6575 * @brief Variance of the elements of a Q31 vector.
<> 135:176b8275d35d 6576 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6577 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6578 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6579 * @return none.
<> 135:176b8275d35d 6580 */
<> 135:176b8275d35d 6581
<> 135:176b8275d35d 6582 void arm_var_q31(
<> 135:176b8275d35d 6583 q31_t * pSrc,
<> 135:176b8275d35d 6584 uint32_t blockSize,
<> 135:176b8275d35d 6585 q31_t * pResult);
<> 135:176b8275d35d 6586
<> 135:176b8275d35d 6587 /**
<> 135:176b8275d35d 6588 * @brief Variance of the elements of a Q15 vector.
<> 135:176b8275d35d 6589 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6590 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6591 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6592 * @return none.
<> 135:176b8275d35d 6593 */
<> 135:176b8275d35d 6594
<> 135:176b8275d35d 6595 void arm_var_q15(
<> 135:176b8275d35d 6596 q15_t * pSrc,
<> 135:176b8275d35d 6597 uint32_t blockSize,
<> 135:176b8275d35d 6598 q15_t * pResult);
<> 135:176b8275d35d 6599
<> 135:176b8275d35d 6600 /**
<> 135:176b8275d35d 6601 * @brief Root Mean Square of the elements of a floating-point vector.
<> 135:176b8275d35d 6602 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6603 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6604 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6605 * @return none.
<> 135:176b8275d35d 6606 */
<> 135:176b8275d35d 6607
<> 135:176b8275d35d 6608 void arm_rms_f32(
<> 135:176b8275d35d 6609 float32_t * pSrc,
<> 135:176b8275d35d 6610 uint32_t blockSize,
<> 135:176b8275d35d 6611 float32_t * pResult);
<> 135:176b8275d35d 6612
<> 135:176b8275d35d 6613 /**
<> 135:176b8275d35d 6614 * @brief Root Mean Square of the elements of a Q31 vector.
<> 135:176b8275d35d 6615 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6616 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6617 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6618 * @return none.
<> 135:176b8275d35d 6619 */
<> 135:176b8275d35d 6620
<> 135:176b8275d35d 6621 void arm_rms_q31(
<> 135:176b8275d35d 6622 q31_t * pSrc,
<> 135:176b8275d35d 6623 uint32_t blockSize,
<> 135:176b8275d35d 6624 q31_t * pResult);
<> 135:176b8275d35d 6625
<> 135:176b8275d35d 6626 /**
<> 135:176b8275d35d 6627 * @brief Root Mean Square of the elements of a Q15 vector.
<> 135:176b8275d35d 6628 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6629 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6630 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6631 * @return none.
<> 135:176b8275d35d 6632 */
<> 135:176b8275d35d 6633
<> 135:176b8275d35d 6634 void arm_rms_q15(
<> 135:176b8275d35d 6635 q15_t * pSrc,
<> 135:176b8275d35d 6636 uint32_t blockSize,
<> 135:176b8275d35d 6637 q15_t * pResult);
<> 135:176b8275d35d 6638
<> 135:176b8275d35d 6639 /**
<> 135:176b8275d35d 6640 * @brief Standard deviation of the elements of a floating-point vector.
<> 135:176b8275d35d 6641 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6642 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6643 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6644 * @return none.
<> 135:176b8275d35d 6645 */
<> 135:176b8275d35d 6646
<> 135:176b8275d35d 6647 void arm_std_f32(
<> 135:176b8275d35d 6648 float32_t * pSrc,
<> 135:176b8275d35d 6649 uint32_t blockSize,
<> 135:176b8275d35d 6650 float32_t * pResult);
<> 135:176b8275d35d 6651
<> 135:176b8275d35d 6652 /**
<> 135:176b8275d35d 6653 * @brief Standard deviation of the elements of a Q31 vector.
<> 135:176b8275d35d 6654 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6655 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6656 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6657 * @return none.
<> 135:176b8275d35d 6658 */
<> 135:176b8275d35d 6659
<> 135:176b8275d35d 6660 void arm_std_q31(
<> 135:176b8275d35d 6661 q31_t * pSrc,
<> 135:176b8275d35d 6662 uint32_t blockSize,
<> 135:176b8275d35d 6663 q31_t * pResult);
<> 135:176b8275d35d 6664
<> 135:176b8275d35d 6665 /**
<> 135:176b8275d35d 6666 * @brief Standard deviation of the elements of a Q15 vector.
<> 135:176b8275d35d 6667 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6668 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6669 * @param[out] *pResult is output value.
<> 135:176b8275d35d 6670 * @return none.
<> 135:176b8275d35d 6671 */
<> 135:176b8275d35d 6672
<> 135:176b8275d35d 6673 void arm_std_q15(
<> 135:176b8275d35d 6674 q15_t * pSrc,
<> 135:176b8275d35d 6675 uint32_t blockSize,
<> 135:176b8275d35d 6676 q15_t * pResult);
<> 135:176b8275d35d 6677
<> 135:176b8275d35d 6678 /**
<> 135:176b8275d35d 6679 * @brief Floating-point complex magnitude
<> 135:176b8275d35d 6680 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 6681 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 6682 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 6683 * @return none.
<> 135:176b8275d35d 6684 */
<> 135:176b8275d35d 6685
<> 135:176b8275d35d 6686 void arm_cmplx_mag_f32(
<> 135:176b8275d35d 6687 float32_t * pSrc,
<> 135:176b8275d35d 6688 float32_t * pDst,
<> 135:176b8275d35d 6689 uint32_t numSamples);
<> 135:176b8275d35d 6690
<> 135:176b8275d35d 6691 /**
<> 135:176b8275d35d 6692 * @brief Q31 complex magnitude
<> 135:176b8275d35d 6693 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 6694 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 6695 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 6696 * @return none.
<> 135:176b8275d35d 6697 */
<> 135:176b8275d35d 6698
<> 135:176b8275d35d 6699 void arm_cmplx_mag_q31(
<> 135:176b8275d35d 6700 q31_t * pSrc,
<> 135:176b8275d35d 6701 q31_t * pDst,
<> 135:176b8275d35d 6702 uint32_t numSamples);
<> 135:176b8275d35d 6703
<> 135:176b8275d35d 6704 /**
<> 135:176b8275d35d 6705 * @brief Q15 complex magnitude
<> 135:176b8275d35d 6706 * @param[in] *pSrc points to the complex input vector
<> 135:176b8275d35d 6707 * @param[out] *pDst points to the real output vector
<> 135:176b8275d35d 6708 * @param[in] numSamples number of complex samples in the input vector
<> 135:176b8275d35d 6709 * @return none.
<> 135:176b8275d35d 6710 */
<> 135:176b8275d35d 6711
<> 135:176b8275d35d 6712 void arm_cmplx_mag_q15(
<> 135:176b8275d35d 6713 q15_t * pSrc,
<> 135:176b8275d35d 6714 q15_t * pDst,
<> 135:176b8275d35d 6715 uint32_t numSamples);
<> 135:176b8275d35d 6716
<> 135:176b8275d35d 6717 /**
<> 135:176b8275d35d 6718 * @brief Q15 complex dot product
<> 135:176b8275d35d 6719 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6720 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6721 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6722 * @param[out] *realResult real part of the result returned here
<> 135:176b8275d35d 6723 * @param[out] *imagResult imaginary part of the result returned here
<> 135:176b8275d35d 6724 * @return none.
<> 135:176b8275d35d 6725 */
<> 135:176b8275d35d 6726
<> 135:176b8275d35d 6727 void arm_cmplx_dot_prod_q15(
<> 135:176b8275d35d 6728 q15_t * pSrcA,
<> 135:176b8275d35d 6729 q15_t * pSrcB,
<> 135:176b8275d35d 6730 uint32_t numSamples,
<> 135:176b8275d35d 6731 q31_t * realResult,
<> 135:176b8275d35d 6732 q31_t * imagResult);
<> 135:176b8275d35d 6733
<> 135:176b8275d35d 6734 /**
<> 135:176b8275d35d 6735 * @brief Q31 complex dot product
<> 135:176b8275d35d 6736 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6737 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6738 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6739 * @param[out] *realResult real part of the result returned here
<> 135:176b8275d35d 6740 * @param[out] *imagResult imaginary part of the result returned here
<> 135:176b8275d35d 6741 * @return none.
<> 135:176b8275d35d 6742 */
<> 135:176b8275d35d 6743
<> 135:176b8275d35d 6744 void arm_cmplx_dot_prod_q31(
<> 135:176b8275d35d 6745 q31_t * pSrcA,
<> 135:176b8275d35d 6746 q31_t * pSrcB,
<> 135:176b8275d35d 6747 uint32_t numSamples,
<> 135:176b8275d35d 6748 q63_t * realResult,
<> 135:176b8275d35d 6749 q63_t * imagResult);
<> 135:176b8275d35d 6750
<> 135:176b8275d35d 6751 /**
<> 135:176b8275d35d 6752 * @brief Floating-point complex dot product
<> 135:176b8275d35d 6753 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6754 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6755 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6756 * @param[out] *realResult real part of the result returned here
<> 135:176b8275d35d 6757 * @param[out] *imagResult imaginary part of the result returned here
<> 135:176b8275d35d 6758 * @return none.
<> 135:176b8275d35d 6759 */
<> 135:176b8275d35d 6760
<> 135:176b8275d35d 6761 void arm_cmplx_dot_prod_f32(
<> 135:176b8275d35d 6762 float32_t * pSrcA,
<> 135:176b8275d35d 6763 float32_t * pSrcB,
<> 135:176b8275d35d 6764 uint32_t numSamples,
<> 135:176b8275d35d 6765 float32_t * realResult,
<> 135:176b8275d35d 6766 float32_t * imagResult);
<> 135:176b8275d35d 6767
<> 135:176b8275d35d 6768 /**
<> 135:176b8275d35d 6769 * @brief Q15 complex-by-real multiplication
<> 135:176b8275d35d 6770 * @param[in] *pSrcCmplx points to the complex input vector
<> 135:176b8275d35d 6771 * @param[in] *pSrcReal points to the real input vector
<> 135:176b8275d35d 6772 * @param[out] *pCmplxDst points to the complex output vector
<> 135:176b8275d35d 6773 * @param[in] numSamples number of samples in each vector
<> 135:176b8275d35d 6774 * @return none.
<> 135:176b8275d35d 6775 */
<> 135:176b8275d35d 6776
<> 135:176b8275d35d 6777 void arm_cmplx_mult_real_q15(
<> 135:176b8275d35d 6778 q15_t * pSrcCmplx,
<> 135:176b8275d35d 6779 q15_t * pSrcReal,
<> 135:176b8275d35d 6780 q15_t * pCmplxDst,
<> 135:176b8275d35d 6781 uint32_t numSamples);
<> 135:176b8275d35d 6782
<> 135:176b8275d35d 6783 /**
<> 135:176b8275d35d 6784 * @brief Q31 complex-by-real multiplication
<> 135:176b8275d35d 6785 * @param[in] *pSrcCmplx points to the complex input vector
<> 135:176b8275d35d 6786 * @param[in] *pSrcReal points to the real input vector
<> 135:176b8275d35d 6787 * @param[out] *pCmplxDst points to the complex output vector
<> 135:176b8275d35d 6788 * @param[in] numSamples number of samples in each vector
<> 135:176b8275d35d 6789 * @return none.
<> 135:176b8275d35d 6790 */
<> 135:176b8275d35d 6791
<> 135:176b8275d35d 6792 void arm_cmplx_mult_real_q31(
<> 135:176b8275d35d 6793 q31_t * pSrcCmplx,
<> 135:176b8275d35d 6794 q31_t * pSrcReal,
<> 135:176b8275d35d 6795 q31_t * pCmplxDst,
<> 135:176b8275d35d 6796 uint32_t numSamples);
<> 135:176b8275d35d 6797
<> 135:176b8275d35d 6798 /**
<> 135:176b8275d35d 6799 * @brief Floating-point complex-by-real multiplication
<> 135:176b8275d35d 6800 * @param[in] *pSrcCmplx points to the complex input vector
<> 135:176b8275d35d 6801 * @param[in] *pSrcReal points to the real input vector
<> 135:176b8275d35d 6802 * @param[out] *pCmplxDst points to the complex output vector
<> 135:176b8275d35d 6803 * @param[in] numSamples number of samples in each vector
<> 135:176b8275d35d 6804 * @return none.
<> 135:176b8275d35d 6805 */
<> 135:176b8275d35d 6806
<> 135:176b8275d35d 6807 void arm_cmplx_mult_real_f32(
<> 135:176b8275d35d 6808 float32_t * pSrcCmplx,
<> 135:176b8275d35d 6809 float32_t * pSrcReal,
<> 135:176b8275d35d 6810 float32_t * pCmplxDst,
<> 135:176b8275d35d 6811 uint32_t numSamples);
<> 135:176b8275d35d 6812
<> 135:176b8275d35d 6813 /**
<> 135:176b8275d35d 6814 * @brief Minimum value of a Q7 vector.
<> 135:176b8275d35d 6815 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6816 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6817 * @param[out] *result is output pointer
<> 135:176b8275d35d 6818 * @param[in] index is the array index of the minimum value in the input buffer.
<> 135:176b8275d35d 6819 * @return none.
<> 135:176b8275d35d 6820 */
<> 135:176b8275d35d 6821
<> 135:176b8275d35d 6822 void arm_min_q7(
<> 135:176b8275d35d 6823 q7_t * pSrc,
<> 135:176b8275d35d 6824 uint32_t blockSize,
<> 135:176b8275d35d 6825 q7_t * result,
<> 135:176b8275d35d 6826 uint32_t * index);
<> 135:176b8275d35d 6827
<> 135:176b8275d35d 6828 /**
<> 135:176b8275d35d 6829 * @brief Minimum value of a Q15 vector.
<> 135:176b8275d35d 6830 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6831 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6832 * @param[out] *pResult is output pointer
<> 135:176b8275d35d 6833 * @param[in] *pIndex is the array index of the minimum value in the input buffer.
<> 135:176b8275d35d 6834 * @return none.
<> 135:176b8275d35d 6835 */
<> 135:176b8275d35d 6836
<> 135:176b8275d35d 6837 void arm_min_q15(
<> 135:176b8275d35d 6838 q15_t * pSrc,
<> 135:176b8275d35d 6839 uint32_t blockSize,
<> 135:176b8275d35d 6840 q15_t * pResult,
<> 135:176b8275d35d 6841 uint32_t * pIndex);
<> 135:176b8275d35d 6842
<> 135:176b8275d35d 6843 /**
<> 135:176b8275d35d 6844 * @brief Minimum value of a Q31 vector.
<> 135:176b8275d35d 6845 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6846 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6847 * @param[out] *pResult is output pointer
<> 135:176b8275d35d 6848 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 135:176b8275d35d 6849 * @return none.
<> 135:176b8275d35d 6850 */
<> 135:176b8275d35d 6851 void arm_min_q31(
<> 135:176b8275d35d 6852 q31_t * pSrc,
<> 135:176b8275d35d 6853 uint32_t blockSize,
<> 135:176b8275d35d 6854 q31_t * pResult,
<> 135:176b8275d35d 6855 uint32_t * pIndex);
<> 135:176b8275d35d 6856
<> 135:176b8275d35d 6857 /**
<> 135:176b8275d35d 6858 * @brief Minimum value of a floating-point vector.
<> 135:176b8275d35d 6859 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 6860 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 6861 * @param[out] *pResult is output pointer
<> 135:176b8275d35d 6862 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 135:176b8275d35d 6863 * @return none.
<> 135:176b8275d35d 6864 */
<> 135:176b8275d35d 6865
<> 135:176b8275d35d 6866 void arm_min_f32(
<> 135:176b8275d35d 6867 float32_t * pSrc,
<> 135:176b8275d35d 6868 uint32_t blockSize,
<> 135:176b8275d35d 6869 float32_t * pResult,
<> 135:176b8275d35d 6870 uint32_t * pIndex);
<> 135:176b8275d35d 6871
<> 135:176b8275d35d 6872 /**
<> 135:176b8275d35d 6873 * @brief Maximum value of a Q7 vector.
<> 135:176b8275d35d 6874 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 6875 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6876 * @param[out] *pResult maximum value returned here
<> 135:176b8275d35d 6877 * @param[out] *pIndex index of maximum value returned here
<> 135:176b8275d35d 6878 * @return none.
<> 135:176b8275d35d 6879 */
<> 135:176b8275d35d 6880
<> 135:176b8275d35d 6881 void arm_max_q7(
<> 135:176b8275d35d 6882 q7_t * pSrc,
<> 135:176b8275d35d 6883 uint32_t blockSize,
<> 135:176b8275d35d 6884 q7_t * pResult,
<> 135:176b8275d35d 6885 uint32_t * pIndex);
<> 135:176b8275d35d 6886
<> 135:176b8275d35d 6887 /**
<> 135:176b8275d35d 6888 * @brief Maximum value of a Q15 vector.
<> 135:176b8275d35d 6889 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 6890 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6891 * @param[out] *pResult maximum value returned here
<> 135:176b8275d35d 6892 * @param[out] *pIndex index of maximum value returned here
<> 135:176b8275d35d 6893 * @return none.
<> 135:176b8275d35d 6894 */
<> 135:176b8275d35d 6895
<> 135:176b8275d35d 6896 void arm_max_q15(
<> 135:176b8275d35d 6897 q15_t * pSrc,
<> 135:176b8275d35d 6898 uint32_t blockSize,
<> 135:176b8275d35d 6899 q15_t * pResult,
<> 135:176b8275d35d 6900 uint32_t * pIndex);
<> 135:176b8275d35d 6901
<> 135:176b8275d35d 6902 /**
<> 135:176b8275d35d 6903 * @brief Maximum value of a Q31 vector.
<> 135:176b8275d35d 6904 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 6905 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6906 * @param[out] *pResult maximum value returned here
<> 135:176b8275d35d 6907 * @param[out] *pIndex index of maximum value returned here
<> 135:176b8275d35d 6908 * @return none.
<> 135:176b8275d35d 6909 */
<> 135:176b8275d35d 6910
<> 135:176b8275d35d 6911 void arm_max_q31(
<> 135:176b8275d35d 6912 q31_t * pSrc,
<> 135:176b8275d35d 6913 uint32_t blockSize,
<> 135:176b8275d35d 6914 q31_t * pResult,
<> 135:176b8275d35d 6915 uint32_t * pIndex);
<> 135:176b8275d35d 6916
<> 135:176b8275d35d 6917 /**
<> 135:176b8275d35d 6918 * @brief Maximum value of a floating-point vector.
<> 135:176b8275d35d 6919 * @param[in] *pSrc points to the input buffer
<> 135:176b8275d35d 6920 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6921 * @param[out] *pResult maximum value returned here
<> 135:176b8275d35d 6922 * @param[out] *pIndex index of maximum value returned here
<> 135:176b8275d35d 6923 * @return none.
<> 135:176b8275d35d 6924 */
<> 135:176b8275d35d 6925
<> 135:176b8275d35d 6926 void arm_max_f32(
<> 135:176b8275d35d 6927 float32_t * pSrc,
<> 135:176b8275d35d 6928 uint32_t blockSize,
<> 135:176b8275d35d 6929 float32_t * pResult,
<> 135:176b8275d35d 6930 uint32_t * pIndex);
<> 135:176b8275d35d 6931
<> 135:176b8275d35d 6932 /**
<> 135:176b8275d35d 6933 * @brief Q15 complex-by-complex multiplication
<> 135:176b8275d35d 6934 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6935 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6936 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 6937 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6938 * @return none.
<> 135:176b8275d35d 6939 */
<> 135:176b8275d35d 6940
<> 135:176b8275d35d 6941 void arm_cmplx_mult_cmplx_q15(
<> 135:176b8275d35d 6942 q15_t * pSrcA,
<> 135:176b8275d35d 6943 q15_t * pSrcB,
<> 135:176b8275d35d 6944 q15_t * pDst,
<> 135:176b8275d35d 6945 uint32_t numSamples);
<> 135:176b8275d35d 6946
<> 135:176b8275d35d 6947 /**
<> 135:176b8275d35d 6948 * @brief Q31 complex-by-complex multiplication
<> 135:176b8275d35d 6949 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6950 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6951 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 6952 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6953 * @return none.
<> 135:176b8275d35d 6954 */
<> 135:176b8275d35d 6955
<> 135:176b8275d35d 6956 void arm_cmplx_mult_cmplx_q31(
<> 135:176b8275d35d 6957 q31_t * pSrcA,
<> 135:176b8275d35d 6958 q31_t * pSrcB,
<> 135:176b8275d35d 6959 q31_t * pDst,
<> 135:176b8275d35d 6960 uint32_t numSamples);
<> 135:176b8275d35d 6961
<> 135:176b8275d35d 6962 /**
<> 135:176b8275d35d 6963 * @brief Floating-point complex-by-complex multiplication
<> 135:176b8275d35d 6964 * @param[in] *pSrcA points to the first input vector
<> 135:176b8275d35d 6965 * @param[in] *pSrcB points to the second input vector
<> 135:176b8275d35d 6966 * @param[out] *pDst points to the output vector
<> 135:176b8275d35d 6967 * @param[in] numSamples number of complex samples in each vector
<> 135:176b8275d35d 6968 * @return none.
<> 135:176b8275d35d 6969 */
<> 135:176b8275d35d 6970
<> 135:176b8275d35d 6971 void arm_cmplx_mult_cmplx_f32(
<> 135:176b8275d35d 6972 float32_t * pSrcA,
<> 135:176b8275d35d 6973 float32_t * pSrcB,
<> 135:176b8275d35d 6974 float32_t * pDst,
<> 135:176b8275d35d 6975 uint32_t numSamples);
<> 135:176b8275d35d 6976
<> 135:176b8275d35d 6977 /**
<> 135:176b8275d35d 6978 * @brief Converts the elements of the floating-point vector to Q31 vector.
<> 135:176b8275d35d 6979 * @param[in] *pSrc points to the floating-point input vector
<> 135:176b8275d35d 6980 * @param[out] *pDst points to the Q31 output vector
<> 135:176b8275d35d 6981 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6982 * @return none.
<> 135:176b8275d35d 6983 */
<> 135:176b8275d35d 6984 void arm_float_to_q31(
<> 135:176b8275d35d 6985 float32_t * pSrc,
<> 135:176b8275d35d 6986 q31_t * pDst,
<> 135:176b8275d35d 6987 uint32_t blockSize);
<> 135:176b8275d35d 6988
<> 135:176b8275d35d 6989 /**
<> 135:176b8275d35d 6990 * @brief Converts the elements of the floating-point vector to Q15 vector.
<> 135:176b8275d35d 6991 * @param[in] *pSrc points to the floating-point input vector
<> 135:176b8275d35d 6992 * @param[out] *pDst points to the Q15 output vector
<> 135:176b8275d35d 6993 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 6994 * @return none
<> 135:176b8275d35d 6995 */
<> 135:176b8275d35d 6996 void arm_float_to_q15(
<> 135:176b8275d35d 6997 float32_t * pSrc,
<> 135:176b8275d35d 6998 q15_t * pDst,
<> 135:176b8275d35d 6999 uint32_t blockSize);
<> 135:176b8275d35d 7000
<> 135:176b8275d35d 7001 /**
<> 135:176b8275d35d 7002 * @brief Converts the elements of the floating-point vector to Q7 vector.
<> 135:176b8275d35d 7003 * @param[in] *pSrc points to the floating-point input vector
<> 135:176b8275d35d 7004 * @param[out] *pDst points to the Q7 output vector
<> 135:176b8275d35d 7005 * @param[in] blockSize length of the input vector
<> 135:176b8275d35d 7006 * @return none
<> 135:176b8275d35d 7007 */
<> 135:176b8275d35d 7008 void arm_float_to_q7(
<> 135:176b8275d35d 7009 float32_t * pSrc,
<> 135:176b8275d35d 7010 q7_t * pDst,
<> 135:176b8275d35d 7011 uint32_t blockSize);
<> 135:176b8275d35d 7012
<> 135:176b8275d35d 7013
<> 135:176b8275d35d 7014 /**
<> 135:176b8275d35d 7015 * @brief Converts the elements of the Q31 vector to Q15 vector.
<> 135:176b8275d35d 7016 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 7017 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 7018 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 7019 * @return none.
<> 135:176b8275d35d 7020 */
<> 135:176b8275d35d 7021 void arm_q31_to_q15(
<> 135:176b8275d35d 7022 q31_t * pSrc,
<> 135:176b8275d35d 7023 q15_t * pDst,
<> 135:176b8275d35d 7024 uint32_t blockSize);
<> 135:176b8275d35d 7025
<> 135:176b8275d35d 7026 /**
<> 135:176b8275d35d 7027 * @brief Converts the elements of the Q31 vector to Q7 vector.
<> 135:176b8275d35d 7028 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 7029 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 7030 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 7031 * @return none.
<> 135:176b8275d35d 7032 */
<> 135:176b8275d35d 7033 void arm_q31_to_q7(
<> 135:176b8275d35d 7034 q31_t * pSrc,
<> 135:176b8275d35d 7035 q7_t * pDst,
<> 135:176b8275d35d 7036 uint32_t blockSize);
<> 135:176b8275d35d 7037
<> 135:176b8275d35d 7038 /**
<> 135:176b8275d35d 7039 * @brief Converts the elements of the Q15 vector to floating-point vector.
<> 135:176b8275d35d 7040 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 7041 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 7042 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 7043 * @return none.
<> 135:176b8275d35d 7044 */
<> 135:176b8275d35d 7045 void arm_q15_to_float(
<> 135:176b8275d35d 7046 q15_t * pSrc,
<> 135:176b8275d35d 7047 float32_t * pDst,
<> 135:176b8275d35d 7048 uint32_t blockSize);
<> 135:176b8275d35d 7049
<> 135:176b8275d35d 7050
<> 135:176b8275d35d 7051 /**
<> 135:176b8275d35d 7052 * @brief Converts the elements of the Q15 vector to Q31 vector.
<> 135:176b8275d35d 7053 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 7054 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 7055 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 7056 * @return none.
<> 135:176b8275d35d 7057 */
<> 135:176b8275d35d 7058 void arm_q15_to_q31(
<> 135:176b8275d35d 7059 q15_t * pSrc,
<> 135:176b8275d35d 7060 q31_t * pDst,
<> 135:176b8275d35d 7061 uint32_t blockSize);
<> 135:176b8275d35d 7062
<> 135:176b8275d35d 7063
<> 135:176b8275d35d 7064 /**
<> 135:176b8275d35d 7065 * @brief Converts the elements of the Q15 vector to Q7 vector.
<> 135:176b8275d35d 7066 * @param[in] *pSrc is input pointer
<> 135:176b8275d35d 7067 * @param[out] *pDst is output pointer
<> 135:176b8275d35d 7068 * @param[in] blockSize is the number of samples to process
<> 135:176b8275d35d 7069 * @return none.
<> 135:176b8275d35d 7070 */
<> 135:176b8275d35d 7071 void arm_q15_to_q7(
<> 135:176b8275d35d 7072 q15_t * pSrc,
<> 135:176b8275d35d 7073 q7_t * pDst,
<> 135:176b8275d35d 7074 uint32_t blockSize);
<> 135:176b8275d35d 7075
<> 135:176b8275d35d 7076
<> 135:176b8275d35d 7077 /**
<> 135:176b8275d35d 7078 * @ingroup groupInterpolation
<> 135:176b8275d35d 7079 */
<> 135:176b8275d35d 7080
<> 135:176b8275d35d 7081 /**
<> 135:176b8275d35d 7082 * @defgroup BilinearInterpolate Bilinear Interpolation
<> 135:176b8275d35d 7083 *
<> 135:176b8275d35d 7084 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
<> 135:176b8275d35d 7085 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
<> 135:176b8275d35d 7086 * determines values between the grid points.
<> 135:176b8275d35d 7087 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
<> 135:176b8275d35d 7088 * Bilinear interpolation is often used in image processing to rescale images.
<> 135:176b8275d35d 7089 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
<> 135:176b8275d35d 7090 *
<> 135:176b8275d35d 7091 * <b>Algorithm</b>
<> 135:176b8275d35d 7092 * \par
<> 135:176b8275d35d 7093 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
<> 135:176b8275d35d 7094 * For floating-point, the instance structure is defined as:
<> 135:176b8275d35d 7095 * <pre>
<> 135:176b8275d35d 7096 * typedef struct
<> 135:176b8275d35d 7097 * {
<> 135:176b8275d35d 7098 * uint16_t numRows;
<> 135:176b8275d35d 7099 * uint16_t numCols;
<> 135:176b8275d35d 7100 * float32_t *pData;
<> 135:176b8275d35d 7101 * } arm_bilinear_interp_instance_f32;
<> 135:176b8275d35d 7102 * </pre>
<> 135:176b8275d35d 7103 *
<> 135:176b8275d35d 7104 * \par
<> 135:176b8275d35d 7105 * where <code>numRows</code> specifies the number of rows in the table;
<> 135:176b8275d35d 7106 * <code>numCols</code> specifies the number of columns in the table;
<> 135:176b8275d35d 7107 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
<> 135:176b8275d35d 7108 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
<> 135:176b8275d35d 7109 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
<> 135:176b8275d35d 7110 *
<> 135:176b8275d35d 7111 * \par
<> 135:176b8275d35d 7112 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
<> 135:176b8275d35d 7113 * <pre>
<> 135:176b8275d35d 7114 * XF = floor(x)
<> 135:176b8275d35d 7115 * YF = floor(y)
<> 135:176b8275d35d 7116 * </pre>
<> 135:176b8275d35d 7117 * \par
<> 135:176b8275d35d 7118 * The interpolated output point is computed as:
<> 135:176b8275d35d 7119 * <pre>
<> 135:176b8275d35d 7120 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
<> 135:176b8275d35d 7121 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
<> 135:176b8275d35d 7122 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
<> 135:176b8275d35d 7123 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
<> 135:176b8275d35d 7124 * </pre>
<> 135:176b8275d35d 7125 * Note that the coordinates (x, y) contain integer and fractional components.
<> 135:176b8275d35d 7126 * The integer components specify which portion of the table to use while the
<> 135:176b8275d35d 7127 * fractional components control the interpolation processor.
<> 135:176b8275d35d 7128 *
<> 135:176b8275d35d 7129 * \par
<> 135:176b8275d35d 7130 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
<> 135:176b8275d35d 7131 */
<> 135:176b8275d35d 7132
<> 135:176b8275d35d 7133 /**
<> 135:176b8275d35d 7134 * @addtogroup BilinearInterpolate
<> 135:176b8275d35d 7135 * @{
<> 135:176b8275d35d 7136 */
<> 135:176b8275d35d 7137
<> 135:176b8275d35d 7138 /**
<> 135:176b8275d35d 7139 *
<> 135:176b8275d35d 7140 * @brief Floating-point bilinear interpolation.
<> 135:176b8275d35d 7141 * @param[in,out] *S points to an instance of the interpolation structure.
<> 135:176b8275d35d 7142 * @param[in] X interpolation coordinate.
<> 135:176b8275d35d 7143 * @param[in] Y interpolation coordinate.
<> 135:176b8275d35d 7144 * @return out interpolated value.
<> 135:176b8275d35d 7145 */
<> 135:176b8275d35d 7146
<> 135:176b8275d35d 7147
<> 135:176b8275d35d 7148 static __INLINE float32_t arm_bilinear_interp_f32(
<> 135:176b8275d35d 7149 const arm_bilinear_interp_instance_f32 * S,
<> 135:176b8275d35d 7150 float32_t X,
<> 135:176b8275d35d 7151 float32_t Y)
<> 135:176b8275d35d 7152 {
<> 135:176b8275d35d 7153 float32_t out;
<> 135:176b8275d35d 7154 float32_t f00, f01, f10, f11;
<> 135:176b8275d35d 7155 float32_t *pData = S->pData;
<> 135:176b8275d35d 7156 int32_t xIndex, yIndex, index;
<> 135:176b8275d35d 7157 float32_t xdiff, ydiff;
<> 135:176b8275d35d 7158 float32_t b1, b2, b3, b4;
<> 135:176b8275d35d 7159
<> 135:176b8275d35d 7160 xIndex = (int32_t) X;
<> 135:176b8275d35d 7161 yIndex = (int32_t) Y;
<> 135:176b8275d35d 7162
<> 135:176b8275d35d 7163 /* Care taken for table outside boundary */
<> 135:176b8275d35d 7164 /* Returns zero output when values are outside table boundary */
<> 135:176b8275d35d 7165 if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0
<> 135:176b8275d35d 7166 || yIndex > (S->numCols - 1))
<> 135:176b8275d35d 7167 {
<> 135:176b8275d35d 7168 return (0);
<> 135:176b8275d35d 7169 }
<> 135:176b8275d35d 7170
<> 135:176b8275d35d 7171 /* Calculation of index for two nearest points in X-direction */
<> 135:176b8275d35d 7172 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
<> 135:176b8275d35d 7173
<> 135:176b8275d35d 7174
<> 135:176b8275d35d 7175 /* Read two nearest points in X-direction */
<> 135:176b8275d35d 7176 f00 = pData[index];
<> 135:176b8275d35d 7177 f01 = pData[index + 1];
<> 135:176b8275d35d 7178
<> 135:176b8275d35d 7179 /* Calculation of index for two nearest points in Y-direction */
<> 135:176b8275d35d 7180 index = (xIndex - 1) + (yIndex) * S->numCols;
<> 135:176b8275d35d 7181
<> 135:176b8275d35d 7182
<> 135:176b8275d35d 7183 /* Read two nearest points in Y-direction */
<> 135:176b8275d35d 7184 f10 = pData[index];
<> 135:176b8275d35d 7185 f11 = pData[index + 1];
<> 135:176b8275d35d 7186
<> 135:176b8275d35d 7187 /* Calculation of intermediate values */
<> 135:176b8275d35d 7188 b1 = f00;
<> 135:176b8275d35d 7189 b2 = f01 - f00;
<> 135:176b8275d35d 7190 b3 = f10 - f00;
<> 135:176b8275d35d 7191 b4 = f00 - f01 - f10 + f11;
<> 135:176b8275d35d 7192
<> 135:176b8275d35d 7193 /* Calculation of fractional part in X */
<> 135:176b8275d35d 7194 xdiff = X - xIndex;
<> 135:176b8275d35d 7195
<> 135:176b8275d35d 7196 /* Calculation of fractional part in Y */
<> 135:176b8275d35d 7197 ydiff = Y - yIndex;
<> 135:176b8275d35d 7198
<> 135:176b8275d35d 7199 /* Calculation of bi-linear interpolated output */
<> 135:176b8275d35d 7200 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
<> 135:176b8275d35d 7201
<> 135:176b8275d35d 7202 /* return to application */
<> 135:176b8275d35d 7203 return (out);
<> 135:176b8275d35d 7204
<> 135:176b8275d35d 7205 }
<> 135:176b8275d35d 7206
<> 135:176b8275d35d 7207 /**
<> 135:176b8275d35d 7208 *
<> 135:176b8275d35d 7209 * @brief Q31 bilinear interpolation.
<> 135:176b8275d35d 7210 * @param[in,out] *S points to an instance of the interpolation structure.
<> 135:176b8275d35d 7211 * @param[in] X interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7212 * @param[in] Y interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7213 * @return out interpolated value.
<> 135:176b8275d35d 7214 */
<> 135:176b8275d35d 7215
<> 135:176b8275d35d 7216 static __INLINE q31_t arm_bilinear_interp_q31(
<> 135:176b8275d35d 7217 arm_bilinear_interp_instance_q31 * S,
<> 135:176b8275d35d 7218 q31_t X,
<> 135:176b8275d35d 7219 q31_t Y)
<> 135:176b8275d35d 7220 {
<> 135:176b8275d35d 7221 q31_t out; /* Temporary output */
<> 135:176b8275d35d 7222 q31_t acc = 0; /* output */
<> 135:176b8275d35d 7223 q31_t xfract, yfract; /* X, Y fractional parts */
<> 135:176b8275d35d 7224 q31_t x1, x2, y1, y2; /* Nearest output values */
<> 135:176b8275d35d 7225 int32_t rI, cI; /* Row and column indices */
<> 135:176b8275d35d 7226 q31_t *pYData = S->pData; /* pointer to output table values */
<> 135:176b8275d35d 7227 uint32_t nCols = S->numCols; /* num of rows */
<> 135:176b8275d35d 7228
<> 135:176b8275d35d 7229
<> 135:176b8275d35d 7230 /* Input is in 12.20 format */
<> 135:176b8275d35d 7231 /* 12 bits for the table index */
<> 135:176b8275d35d 7232 /* Index value calculation */
<> 135:176b8275d35d 7233 rI = ((X & 0xFFF00000) >> 20u);
<> 135:176b8275d35d 7234
<> 135:176b8275d35d 7235 /* Input is in 12.20 format */
<> 135:176b8275d35d 7236 /* 12 bits for the table index */
<> 135:176b8275d35d 7237 /* Index value calculation */
<> 135:176b8275d35d 7238 cI = ((Y & 0xFFF00000) >> 20u);
<> 135:176b8275d35d 7239
<> 135:176b8275d35d 7240 /* Care taken for table outside boundary */
<> 135:176b8275d35d 7241 /* Returns zero output when values are outside table boundary */
<> 135:176b8275d35d 7242 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 135:176b8275d35d 7243 {
<> 135:176b8275d35d 7244 return (0);
<> 135:176b8275d35d 7245 }
<> 135:176b8275d35d 7246
<> 135:176b8275d35d 7247 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7248 /* shift left xfract by 11 to keep 1.31 format */
<> 135:176b8275d35d 7249 xfract = (X & 0x000FFFFF) << 11u;
<> 135:176b8275d35d 7250
<> 135:176b8275d35d 7251 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7252 x1 = pYData[(rI) + nCols * (cI)];
<> 135:176b8275d35d 7253 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 135:176b8275d35d 7254
<> 135:176b8275d35d 7255 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7256 /* shift left yfract by 11 to keep 1.31 format */
<> 135:176b8275d35d 7257 yfract = (Y & 0x000FFFFF) << 11u;
<> 135:176b8275d35d 7258
<> 135:176b8275d35d 7259 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7260 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 135:176b8275d35d 7261 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 135:176b8275d35d 7262
<> 135:176b8275d35d 7263 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
<> 135:176b8275d35d 7264 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
<> 135:176b8275d35d 7265 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
<> 135:176b8275d35d 7266
<> 135:176b8275d35d 7267 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
<> 135:176b8275d35d 7268 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
<> 135:176b8275d35d 7269 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
<> 135:176b8275d35d 7270
<> 135:176b8275d35d 7271 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 135:176b8275d35d 7272 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
<> 135:176b8275d35d 7273 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 135:176b8275d35d 7274
<> 135:176b8275d35d 7275 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 135:176b8275d35d 7276 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
<> 135:176b8275d35d 7277 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 135:176b8275d35d 7278
<> 135:176b8275d35d 7279 /* Convert acc to 1.31(q31) format */
<> 135:176b8275d35d 7280 return (acc << 2u);
<> 135:176b8275d35d 7281
<> 135:176b8275d35d 7282 }
<> 135:176b8275d35d 7283
<> 135:176b8275d35d 7284 /**
<> 135:176b8275d35d 7285 * @brief Q15 bilinear interpolation.
<> 135:176b8275d35d 7286 * @param[in,out] *S points to an instance of the interpolation structure.
<> 135:176b8275d35d 7287 * @param[in] X interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7288 * @param[in] Y interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7289 * @return out interpolated value.
<> 135:176b8275d35d 7290 */
<> 135:176b8275d35d 7291
<> 135:176b8275d35d 7292 static __INLINE q15_t arm_bilinear_interp_q15(
<> 135:176b8275d35d 7293 arm_bilinear_interp_instance_q15 * S,
<> 135:176b8275d35d 7294 q31_t X,
<> 135:176b8275d35d 7295 q31_t Y)
<> 135:176b8275d35d 7296 {
<> 135:176b8275d35d 7297 q63_t acc = 0; /* output */
<> 135:176b8275d35d 7298 q31_t out; /* Temporary output */
<> 135:176b8275d35d 7299 q15_t x1, x2, y1, y2; /* Nearest output values */
<> 135:176b8275d35d 7300 q31_t xfract, yfract; /* X, Y fractional parts */
<> 135:176b8275d35d 7301 int32_t rI, cI; /* Row and column indices */
<> 135:176b8275d35d 7302 q15_t *pYData = S->pData; /* pointer to output table values */
<> 135:176b8275d35d 7303 uint32_t nCols = S->numCols; /* num of rows */
<> 135:176b8275d35d 7304
<> 135:176b8275d35d 7305 /* Input is in 12.20 format */
<> 135:176b8275d35d 7306 /* 12 bits for the table index */
<> 135:176b8275d35d 7307 /* Index value calculation */
<> 135:176b8275d35d 7308 rI = ((X & 0xFFF00000) >> 20);
<> 135:176b8275d35d 7309
<> 135:176b8275d35d 7310 /* Input is in 12.20 format */
<> 135:176b8275d35d 7311 /* 12 bits for the table index */
<> 135:176b8275d35d 7312 /* Index value calculation */
<> 135:176b8275d35d 7313 cI = ((Y & 0xFFF00000) >> 20);
<> 135:176b8275d35d 7314
<> 135:176b8275d35d 7315 /* Care taken for table outside boundary */
<> 135:176b8275d35d 7316 /* Returns zero output when values are outside table boundary */
<> 135:176b8275d35d 7317 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 135:176b8275d35d 7318 {
<> 135:176b8275d35d 7319 return (0);
<> 135:176b8275d35d 7320 }
<> 135:176b8275d35d 7321
<> 135:176b8275d35d 7322 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7323 /* xfract should be in 12.20 format */
<> 135:176b8275d35d 7324 xfract = (X & 0x000FFFFF);
<> 135:176b8275d35d 7325
<> 135:176b8275d35d 7326 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7327 x1 = pYData[(rI) + nCols * (cI)];
<> 135:176b8275d35d 7328 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 135:176b8275d35d 7329
<> 135:176b8275d35d 7330
<> 135:176b8275d35d 7331 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7332 /* yfract should be in 12.20 format */
<> 135:176b8275d35d 7333 yfract = (Y & 0x000FFFFF);
<> 135:176b8275d35d 7334
<> 135:176b8275d35d 7335 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7336 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 135:176b8275d35d 7337 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 135:176b8275d35d 7338
<> 135:176b8275d35d 7339 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
<> 135:176b8275d35d 7340
<> 135:176b8275d35d 7341 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
<> 135:176b8275d35d 7342 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
<> 135:176b8275d35d 7343 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
<> 135:176b8275d35d 7344 acc = ((q63_t) out * (0xFFFFF - yfract));
<> 135:176b8275d35d 7345
<> 135:176b8275d35d 7346 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
<> 135:176b8275d35d 7347 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
<> 135:176b8275d35d 7348 acc += ((q63_t) out * (xfract));
<> 135:176b8275d35d 7349
<> 135:176b8275d35d 7350 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
<> 135:176b8275d35d 7351 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
<> 135:176b8275d35d 7352 acc += ((q63_t) out * (yfract));
<> 135:176b8275d35d 7353
<> 135:176b8275d35d 7354 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
<> 135:176b8275d35d 7355 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
<> 135:176b8275d35d 7356 acc += ((q63_t) out * (yfract));
<> 135:176b8275d35d 7357
<> 135:176b8275d35d 7358 /* acc is in 13.51 format and down shift acc by 36 times */
<> 135:176b8275d35d 7359 /* Convert out to 1.15 format */
<> 135:176b8275d35d 7360 return (acc >> 36);
<> 135:176b8275d35d 7361
<> 135:176b8275d35d 7362 }
<> 135:176b8275d35d 7363
<> 135:176b8275d35d 7364 /**
<> 135:176b8275d35d 7365 * @brief Q7 bilinear interpolation.
<> 135:176b8275d35d 7366 * @param[in,out] *S points to an instance of the interpolation structure.
<> 135:176b8275d35d 7367 * @param[in] X interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7368 * @param[in] Y interpolation coordinate in 12.20 format.
<> 135:176b8275d35d 7369 * @return out interpolated value.
<> 135:176b8275d35d 7370 */
<> 135:176b8275d35d 7371
<> 135:176b8275d35d 7372 static __INLINE q7_t arm_bilinear_interp_q7(
<> 135:176b8275d35d 7373 arm_bilinear_interp_instance_q7 * S,
<> 135:176b8275d35d 7374 q31_t X,
<> 135:176b8275d35d 7375 q31_t Y)
<> 135:176b8275d35d 7376 {
<> 135:176b8275d35d 7377 q63_t acc = 0; /* output */
<> 135:176b8275d35d 7378 q31_t out; /* Temporary output */
<> 135:176b8275d35d 7379 q31_t xfract, yfract; /* X, Y fractional parts */
<> 135:176b8275d35d 7380 q7_t x1, x2, y1, y2; /* Nearest output values */
<> 135:176b8275d35d 7381 int32_t rI, cI; /* Row and column indices */
<> 135:176b8275d35d 7382 q7_t *pYData = S->pData; /* pointer to output table values */
<> 135:176b8275d35d 7383 uint32_t nCols = S->numCols; /* num of rows */
<> 135:176b8275d35d 7384
<> 135:176b8275d35d 7385 /* Input is in 12.20 format */
<> 135:176b8275d35d 7386 /* 12 bits for the table index */
<> 135:176b8275d35d 7387 /* Index value calculation */
<> 135:176b8275d35d 7388 rI = ((X & 0xFFF00000) >> 20);
<> 135:176b8275d35d 7389
<> 135:176b8275d35d 7390 /* Input is in 12.20 format */
<> 135:176b8275d35d 7391 /* 12 bits for the table index */
<> 135:176b8275d35d 7392 /* Index value calculation */
<> 135:176b8275d35d 7393 cI = ((Y & 0xFFF00000) >> 20);
<> 135:176b8275d35d 7394
<> 135:176b8275d35d 7395 /* Care taken for table outside boundary */
<> 135:176b8275d35d 7396 /* Returns zero output when values are outside table boundary */
<> 135:176b8275d35d 7397 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 135:176b8275d35d 7398 {
<> 135:176b8275d35d 7399 return (0);
<> 135:176b8275d35d 7400 }
<> 135:176b8275d35d 7401
<> 135:176b8275d35d 7402 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7403 /* xfract should be in 12.20 format */
<> 135:176b8275d35d 7404 xfract = (X & 0x000FFFFF);
<> 135:176b8275d35d 7405
<> 135:176b8275d35d 7406 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7407 x1 = pYData[(rI) + nCols * (cI)];
<> 135:176b8275d35d 7408 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 135:176b8275d35d 7409
<> 135:176b8275d35d 7410
<> 135:176b8275d35d 7411 /* 20 bits for the fractional part */
<> 135:176b8275d35d 7412 /* yfract should be in 12.20 format */
<> 135:176b8275d35d 7413 yfract = (Y & 0x000FFFFF);
<> 135:176b8275d35d 7414
<> 135:176b8275d35d 7415 /* Read two nearest output values from the index */
<> 135:176b8275d35d 7416 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 135:176b8275d35d 7417 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 135:176b8275d35d 7418
<> 135:176b8275d35d 7419 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
<> 135:176b8275d35d 7420 out = ((x1 * (0xFFFFF - xfract)));
<> 135:176b8275d35d 7421 acc = (((q63_t) out * (0xFFFFF - yfract)));
<> 135:176b8275d35d 7422
<> 135:176b8275d35d 7423 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
<> 135:176b8275d35d 7424 out = ((x2 * (0xFFFFF - yfract)));
<> 135:176b8275d35d 7425 acc += (((q63_t) out * (xfract)));
<> 135:176b8275d35d 7426
<> 135:176b8275d35d 7427 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
<> 135:176b8275d35d 7428 out = ((y1 * (0xFFFFF - xfract)));
<> 135:176b8275d35d 7429 acc += (((q63_t) out * (yfract)));
<> 135:176b8275d35d 7430
<> 135:176b8275d35d 7431 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
<> 135:176b8275d35d 7432 out = ((y2 * (yfract)));
<> 135:176b8275d35d 7433 acc += (((q63_t) out * (xfract)));
<> 135:176b8275d35d 7434
<> 135:176b8275d35d 7435 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
<> 135:176b8275d35d 7436 return (acc >> 40);
<> 135:176b8275d35d 7437
<> 135:176b8275d35d 7438 }
<> 135:176b8275d35d 7439
<> 135:176b8275d35d 7440 /**
<> 135:176b8275d35d 7441 * @} end of BilinearInterpolate group
<> 135:176b8275d35d 7442 */
<> 135:176b8275d35d 7443
<> 135:176b8275d35d 7444
<> 135:176b8275d35d 7445 //SMMLAR
<> 135:176b8275d35d 7446 #define multAcc_32x32_keep32_R(a, x, y) \
<> 135:176b8275d35d 7447 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 135:176b8275d35d 7448
<> 135:176b8275d35d 7449 //SMMLSR
<> 135:176b8275d35d 7450 #define multSub_32x32_keep32_R(a, x, y) \
<> 135:176b8275d35d 7451 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 135:176b8275d35d 7452
<> 135:176b8275d35d 7453 //SMMULR
<> 135:176b8275d35d 7454 #define mult_32x32_keep32_R(a, x, y) \
<> 135:176b8275d35d 7455 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
<> 135:176b8275d35d 7456
<> 135:176b8275d35d 7457 //SMMLA
<> 135:176b8275d35d 7458 #define multAcc_32x32_keep32(a, x, y) \
<> 135:176b8275d35d 7459 a += (q31_t) (((q63_t) x * y) >> 32)
<> 135:176b8275d35d 7460
<> 135:176b8275d35d 7461 //SMMLS
<> 135:176b8275d35d 7462 #define multSub_32x32_keep32(a, x, y) \
<> 135:176b8275d35d 7463 a -= (q31_t) (((q63_t) x * y) >> 32)
<> 135:176b8275d35d 7464
<> 135:176b8275d35d 7465 //SMMUL
<> 135:176b8275d35d 7466 #define mult_32x32_keep32(a, x, y) \
<> 135:176b8275d35d 7467 a = (q31_t) (((q63_t) x * y ) >> 32)
<> 135:176b8275d35d 7468
<> 135:176b8275d35d 7469
<> 135:176b8275d35d 7470 #if defined ( __CC_ARM ) //Keil
<> 135:176b8275d35d 7471
<> 135:176b8275d35d 7472 //Enter low optimization region - place directly above function definition
<> 135:176b8275d35d 7473 #ifdef ARM_MATH_CM4
<> 135:176b8275d35d 7474 #define LOW_OPTIMIZATION_ENTER \
<> 135:176b8275d35d 7475 _Pragma ("push") \
<> 135:176b8275d35d 7476 _Pragma ("O1")
<> 135:176b8275d35d 7477 #else
<> 135:176b8275d35d 7478 #define LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7479 #endif
<> 135:176b8275d35d 7480
<> 135:176b8275d35d 7481 //Exit low optimization region - place directly after end of function definition
<> 135:176b8275d35d 7482 #ifdef ARM_MATH_CM4
<> 135:176b8275d35d 7483 #define LOW_OPTIMIZATION_EXIT \
<> 135:176b8275d35d 7484 _Pragma ("pop")
<> 135:176b8275d35d 7485 #else
<> 135:176b8275d35d 7486 #define LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7487 #endif
<> 135:176b8275d35d 7488
<> 135:176b8275d35d 7489 //Enter low optimization region - place directly above function definition
<> 135:176b8275d35d 7490 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7491
<> 135:176b8275d35d 7492 //Exit low optimization region - place directly after end of function definition
<> 135:176b8275d35d 7493 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7494
<> 135:176b8275d35d 7495 #elif defined(__ICCARM__) //IAR
<> 135:176b8275d35d 7496
<> 135:176b8275d35d 7497 //Enter low optimization region - place directly above function definition
<> 135:176b8275d35d 7498 #ifdef ARM_MATH_CM4
<> 135:176b8275d35d 7499 #define LOW_OPTIMIZATION_ENTER \
<> 135:176b8275d35d 7500 _Pragma ("optimize=low")
<> 135:176b8275d35d 7501 #else
<> 135:176b8275d35d 7502 #define LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7503 #endif
<> 135:176b8275d35d 7504
<> 135:176b8275d35d 7505 //Exit low optimization region - place directly after end of function definition
<> 135:176b8275d35d 7506 #define LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7507
<> 135:176b8275d35d 7508 //Enter low optimization region - place directly above function definition
<> 135:176b8275d35d 7509 #ifdef ARM_MATH_CM4
<> 135:176b8275d35d 7510 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
<> 135:176b8275d35d 7511 _Pragma ("optimize=low")
<> 135:176b8275d35d 7512 #else
<> 135:176b8275d35d 7513 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7514 #endif
<> 135:176b8275d35d 7515
<> 135:176b8275d35d 7516 //Exit low optimization region - place directly after end of function definition
<> 135:176b8275d35d 7517 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7518
<> 135:176b8275d35d 7519 #elif defined(__GNUC__)
<> 135:176b8275d35d 7520
<> 135:176b8275d35d 7521 #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
<> 135:176b8275d35d 7522
<> 135:176b8275d35d 7523 #define LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7524
<> 135:176b8275d35d 7525 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7526
<> 135:176b8275d35d 7527 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7528
<> 135:176b8275d35d 7529 #elif defined(__CSMC__) // Cosmic
<> 135:176b8275d35d 7530
<> 135:176b8275d35d 7531 #define LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7532 #define LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7533 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7534 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7535
<> 135:176b8275d35d 7536 #elif defined(__TASKING__) // TASKING
<> 135:176b8275d35d 7537
<> 135:176b8275d35d 7538 #define LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7539 #define LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7540 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 135:176b8275d35d 7541 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 135:176b8275d35d 7542
<> 135:176b8275d35d 7543 #endif
<> 135:176b8275d35d 7544
<> 135:176b8275d35d 7545
<> 135:176b8275d35d 7546 #ifdef __cplusplus
<> 135:176b8275d35d 7547 }
<> 135:176b8275d35d 7548 #endif
<> 135:176b8275d35d 7549
<> 135:176b8275d35d 7550
<> 135:176b8275d35d 7551 #endif /* _ARM_MATH_H */
<> 135:176b8275d35d 7552
<> 135:176b8275d35d 7553 /**
<> 135:176b8275d35d 7554 *
<> 135:176b8275d35d 7555 * End of file.
<> 135:176b8275d35d 7556 */