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:
133:99b5ccf27215
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
<> 133:99b5ccf27215 1 /* ----------------------------------------------------------------------
<> 133:99b5ccf27215 2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 133:99b5ccf27215 3 *
<> 133:99b5ccf27215 4 * $Date: 19. March 2015
<> 133:99b5ccf27215 5 * $Revision: V.1.4.5
<> 133:99b5ccf27215 6 *
<> 133:99b5ccf27215 7 * Project: CMSIS DSP Library
<> 133:99b5ccf27215 8 * Title: arm_math.h
<> 133:99b5ccf27215 9 *
<> 133:99b5ccf27215 10 * Description: Public header file for CMSIS DSP Library
<> 133:99b5ccf27215 11 *
<> 133:99b5ccf27215 12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
<> 133:99b5ccf27215 13 *
<> 133:99b5ccf27215 14 * Redistribution and use in source and binary forms, with or without
<> 133:99b5ccf27215 15 * modification, are permitted provided that the following conditions
<> 133:99b5ccf27215 16 * are met:
<> 133:99b5ccf27215 17 * - Redistributions of source code must retain the above copyright
<> 133:99b5ccf27215 18 * notice, this list of conditions and the following disclaimer.
<> 133:99b5ccf27215 19 * - Redistributions in binary form must reproduce the above copyright
<> 133:99b5ccf27215 20 * notice, this list of conditions and the following disclaimer in
<> 133:99b5ccf27215 21 * the documentation and/or other materials provided with the
<> 133:99b5ccf27215 22 * distribution.
<> 133:99b5ccf27215 23 * - Neither the name of ARM LIMITED nor the names of its contributors
<> 133:99b5ccf27215 24 * may be used to endorse or promote products derived from this
<> 133:99b5ccf27215 25 * software without specific prior written permission.
<> 133:99b5ccf27215 26 *
<> 133:99b5ccf27215 27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<> 133:99b5ccf27215 28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<> 133:99b5ccf27215 29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
<> 133:99b5ccf27215 30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
<> 133:99b5ccf27215 31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
<> 133:99b5ccf27215 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
<> 133:99b5ccf27215 33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 133:99b5ccf27215 34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 133:99b5ccf27215 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
<> 133:99b5ccf27215 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
<> 133:99b5ccf27215 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
<> 133:99b5ccf27215 38 * POSSIBILITY OF SUCH DAMAGE.
<> 133:99b5ccf27215 39 * -------------------------------------------------------------------- */
<> 133:99b5ccf27215 40
<> 133:99b5ccf27215 41 /**
<> 133:99b5ccf27215 42 \mainpage CMSIS DSP Software Library
<> 133:99b5ccf27215 43 *
<> 133:99b5ccf27215 44 * Introduction
<> 133:99b5ccf27215 45 * ------------
<> 133:99b5ccf27215 46 *
<> 133:99b5ccf27215 47 * This user manual describes the CMSIS DSP software library,
<> 133:99b5ccf27215 48 * a suite of common signal processing functions for use on Cortex-M processor based devices.
<> 133:99b5ccf27215 49 *
<> 133:99b5ccf27215 50 * The library is divided into a number of functions each covering a specific category:
<> 133:99b5ccf27215 51 * - Basic math functions
<> 133:99b5ccf27215 52 * - Fast math functions
<> 133:99b5ccf27215 53 * - Complex math functions
<> 133:99b5ccf27215 54 * - Filters
<> 133:99b5ccf27215 55 * - Matrix functions
<> 133:99b5ccf27215 56 * - Transforms
<> 133:99b5ccf27215 57 * - Motor control functions
<> 133:99b5ccf27215 58 * - Statistical functions
<> 133:99b5ccf27215 59 * - Support functions
<> 133:99b5ccf27215 60 * - Interpolation functions
<> 133:99b5ccf27215 61 *
<> 133:99b5ccf27215 62 * The library has separate functions for operating on 8-bit integers, 16-bit integers,
<> 133:99b5ccf27215 63 * 32-bit integer and 32-bit floating-point values.
<> 133:99b5ccf27215 64 *
<> 133:99b5ccf27215 65 * Using the Library
<> 133:99b5ccf27215 66 * ------------
<> 133:99b5ccf27215 67 *
<> 133:99b5ccf27215 68 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
<> 133:99b5ccf27215 69 * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7)
<> 133:99b5ccf27215 70 * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7)
<> 133:99b5ccf27215 71 * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7)
<> 133:99b5ccf27215 72 * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7)
<> 133:99b5ccf27215 73 * - arm_cortexM7l_math.lib (Little endian on Cortex-M7)
<> 133:99b5ccf27215 74 * - arm_cortexM7b_math.lib (Big endian on Cortex-M7)
<> 133:99b5ccf27215 75 * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
<> 133:99b5ccf27215 76 * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4)
<> 133:99b5ccf27215 77 * - arm_cortexM4l_math.lib (Little endian on Cortex-M4)
<> 133:99b5ccf27215 78 * - arm_cortexM4b_math.lib (Big endian on Cortex-M4)
<> 133:99b5ccf27215 79 * - arm_cortexM3l_math.lib (Little endian on Cortex-M3)
<> 133:99b5ccf27215 80 * - arm_cortexM3b_math.lib (Big endian on Cortex-M3)
<> 133:99b5ccf27215 81 * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+)
<> 133:99b5ccf27215 82 * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+)
<> 133:99b5ccf27215 83 *
<> 133:99b5ccf27215 84 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder.
<> 133:99b5ccf27215 85 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 87 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or
<> 133:99b5ccf27215 88 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
<> 133:99b5ccf27215 89 *
<> 133:99b5ccf27215 90 * Examples
<> 133:99b5ccf27215 91 * --------
<> 133:99b5ccf27215 92 *
<> 133:99b5ccf27215 93 * The library ships with a number of examples which demonstrate how to use the library functions.
<> 133:99b5ccf27215 94 *
<> 133:99b5ccf27215 95 * Toolchain Support
<> 133:99b5ccf27215 96 * ------------
<> 133:99b5ccf27215 97 *
<> 133:99b5ccf27215 98 * The library has been developed and tested with MDK-ARM version 5.14.0.0
<> 133:99b5ccf27215 99 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
<> 133:99b5ccf27215 100 *
<> 133:99b5ccf27215 101 * Building the Library
<> 133:99b5ccf27215 102 * ------------
<> 133:99b5ccf27215 103 *
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 105 * - arm_cortexM_math.uvprojx
<> 133:99b5ccf27215 106 *
<> 133:99b5ccf27215 107 *
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 109 *
<> 133:99b5ccf27215 110 * Pre-processor Macros
<> 133:99b5ccf27215 111 * ------------
<> 133:99b5ccf27215 112 *
<> 133:99b5ccf27215 113 * Each library project have differant pre-processor macros.
<> 133:99b5ccf27215 114 *
<> 133:99b5ccf27215 115 * - UNALIGNED_SUPPORT_DISABLE:
<> 133:99b5ccf27215 116 *
<> 133:99b5ccf27215 117 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
<> 133:99b5ccf27215 118 *
<> 133:99b5ccf27215 119 * - ARM_MATH_BIG_ENDIAN:
<> 133:99b5ccf27215 120 *
<> 133:99b5ccf27215 121 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
<> 133:99b5ccf27215 122 *
<> 133:99b5ccf27215 123 * - ARM_MATH_MATRIX_CHECK:
<> 133:99b5ccf27215 124 *
<> 133:99b5ccf27215 125 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
<> 133:99b5ccf27215 126 *
<> 133:99b5ccf27215 127 * - ARM_MATH_ROUNDING:
<> 133:99b5ccf27215 128 *
<> 133:99b5ccf27215 129 * Define macro ARM_MATH_ROUNDING for rounding on support functions
<> 133:99b5ccf27215 130 *
<> 133:99b5ccf27215 131 * - ARM_MATH_CMx:
<> 133:99b5ccf27215 132 *
<> 133:99b5ccf27215 133 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
<> 133:99b5ccf27215 134 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and
<> 133:99b5ccf27215 135 * ARM_MATH_CM7 for building the library on cortex-M7.
<> 133:99b5ccf27215 136 *
<> 133:99b5ccf27215 137 * - __FPU_PRESENT:
<> 133:99b5ccf27215 138 *
<> 133:99b5ccf27215 139 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
<> 133:99b5ccf27215 140 *
<> 133:99b5ccf27215 141 * <hr>
<> 133:99b5ccf27215 142 * CMSIS-DSP in ARM::CMSIS Pack
<> 133:99b5ccf27215 143 * -----------------------------
<> 133:99b5ccf27215 144 *
<> 133:99b5ccf27215 145 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories:
<> 133:99b5ccf27215 146 * |File/Folder |Content |
<> 133:99b5ccf27215 147 * |------------------------------|------------------------------------------------------------------------|
<> 133:99b5ccf27215 148 * |\b CMSIS\\Documentation\\DSP | This documentation |
<> 133:99b5ccf27215 149 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) |
<> 133:99b5ccf27215 150 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions |
<> 133:99b5ccf27215 151 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library |
<> 133:99b5ccf27215 152 *
<> 133:99b5ccf27215 153 * <hr>
<> 133:99b5ccf27215 154 * Revision History of CMSIS-DSP
<> 133:99b5ccf27215 155 * ------------
<> 133:99b5ccf27215 156 * Please refer to \ref ChangeLog_pg.
<> 133:99b5ccf27215 157 *
<> 133:99b5ccf27215 158 * Copyright Notice
<> 133:99b5ccf27215 159 * ------------
<> 133:99b5ccf27215 160 *
<> 133:99b5ccf27215 161 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
<> 133:99b5ccf27215 162 */
<> 133:99b5ccf27215 163
<> 133:99b5ccf27215 164
<> 133:99b5ccf27215 165 /**
<> 133:99b5ccf27215 166 * @defgroup groupMath Basic Math Functions
<> 133:99b5ccf27215 167 */
<> 133:99b5ccf27215 168
<> 133:99b5ccf27215 169 /**
<> 133:99b5ccf27215 170 * @defgroup groupFastMath Fast Math Functions
<> 133:99b5ccf27215 171 * This set of functions provides a fast approximation to sine, cosine, and square root.
<> 133:99b5ccf27215 172 * As compared to most of the other functions in the CMSIS math library, the fast math functions
<> 133:99b5ccf27215 173 * operate on individual values and not arrays.
<> 133:99b5ccf27215 174 * There are separate functions for Q15, Q31, and floating-point data.
<> 133:99b5ccf27215 175 *
<> 133:99b5ccf27215 176 */
<> 133:99b5ccf27215 177
<> 133:99b5ccf27215 178 /**
<> 133:99b5ccf27215 179 * @defgroup groupCmplxMath Complex Math Functions
<> 133:99b5ccf27215 180 * This set of functions operates on complex data vectors.
<> 133:99b5ccf27215 181 * The data in the complex arrays is stored in an interleaved fashion
<> 133:99b5ccf27215 182 * (real, imag, real, imag, ...).
<> 133:99b5ccf27215 183 * In the API functions, the number of samples in a complex array refers
<> 133:99b5ccf27215 184 * to the number of complex values; the array contains twice this number of
<> 133:99b5ccf27215 185 * real values.
<> 133:99b5ccf27215 186 */
<> 133:99b5ccf27215 187
<> 133:99b5ccf27215 188 /**
<> 133:99b5ccf27215 189 * @defgroup groupFilters Filtering Functions
<> 133:99b5ccf27215 190 */
<> 133:99b5ccf27215 191
<> 133:99b5ccf27215 192 /**
<> 133:99b5ccf27215 193 * @defgroup groupMatrix Matrix Functions
<> 133:99b5ccf27215 194 *
<> 133:99b5ccf27215 195 * This set of functions provides basic matrix math operations.
<> 133:99b5ccf27215 196 * The functions operate on matrix data structures. For example,
<> 133:99b5ccf27215 197 * the type
<> 133:99b5ccf27215 198 * definition for the floating-point matrix structure is shown
<> 133:99b5ccf27215 199 * below:
<> 133:99b5ccf27215 200 * <pre>
<> 133:99b5ccf27215 201 * typedef struct
<> 133:99b5ccf27215 202 * {
<> 133:99b5ccf27215 203 * uint16_t numRows; // number of rows of the matrix.
<> 133:99b5ccf27215 204 * uint16_t numCols; // number of columns of the matrix.
<> 133:99b5ccf27215 205 * float32_t *pData; // points to the data of the matrix.
<> 133:99b5ccf27215 206 * } arm_matrix_instance_f32;
<> 133:99b5ccf27215 207 * </pre>
<> 133:99b5ccf27215 208 * There are similar definitions for Q15 and Q31 data types.
<> 133:99b5ccf27215 209 *
<> 133:99b5ccf27215 210 * The structure specifies the size of the matrix and then points to
<> 133:99b5ccf27215 211 * an array of data. The array is of size <code>numRows X numCols</code>
<> 133:99b5ccf27215 212 * and the values are arranged in row order. That is, the
<> 133:99b5ccf27215 213 * matrix element (i, j) is stored at:
<> 133:99b5ccf27215 214 * <pre>
<> 133:99b5ccf27215 215 * pData[i*numCols + j]
<> 133:99b5ccf27215 216 * </pre>
<> 133:99b5ccf27215 217 *
<> 133:99b5ccf27215 218 * \par Init Functions
<> 133:99b5ccf27215 219 * There is an associated initialization function for each type of matrix
<> 133:99b5ccf27215 220 * data structure.
<> 133:99b5ccf27215 221 * The initialization function sets the values of the internal structure fields.
<> 133:99b5ccf27215 222 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code>
<> 133:99b5ccf27215 223 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively.
<> 133:99b5ccf27215 224 *
<> 133:99b5ccf27215 225 * \par
<> 133:99b5ccf27215 226 * Use of the initialization function is optional. However, if initialization function is used
<> 133:99b5ccf27215 227 * then the instance structure cannot be placed into a const data section.
<> 133:99b5ccf27215 228 * To place the instance structure in a const data
<> 133:99b5ccf27215 229 * section, manually initialize the data structure. For example:
<> 133:99b5ccf27215 230 * <pre>
<> 133:99b5ccf27215 231 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code>
<> 133:99b5ccf27215 232 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code>
<> 133:99b5ccf27215 233 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code>
<> 133:99b5ccf27215 234 * </pre>
<> 133:99b5ccf27215 235 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code>
<> 133:99b5ccf27215 236 * specifies the number of columns, and <code>pData</code> points to the
<> 133:99b5ccf27215 237 * data array.
<> 133:99b5ccf27215 238 *
<> 133:99b5ccf27215 239 * \par Size Checking
<> 133:99b5ccf27215 240 * By default all of the matrix functions perform size checking on the input and
<> 133:99b5ccf27215 241 * output matrices. For example, the matrix addition function verifies that the
<> 133:99b5ccf27215 242 * two input matrices and the output matrix all have the same number of rows and
<> 133:99b5ccf27215 243 * columns. If the size check fails the functions return:
<> 133:99b5ccf27215 244 * <pre>
<> 133:99b5ccf27215 245 * ARM_MATH_SIZE_MISMATCH
<> 133:99b5ccf27215 246 * </pre>
<> 133:99b5ccf27215 247 * Otherwise the functions return
<> 133:99b5ccf27215 248 * <pre>
<> 133:99b5ccf27215 249 * ARM_MATH_SUCCESS
<> 133:99b5ccf27215 250 * </pre>
<> 133:99b5ccf27215 251 * There is some overhead associated with this matrix size checking.
<> 133:99b5ccf27215 252 * The matrix size checking is enabled via the \#define
<> 133:99b5ccf27215 253 * <pre>
<> 133:99b5ccf27215 254 * ARM_MATH_MATRIX_CHECK
<> 133:99b5ccf27215 255 * </pre>
<> 133:99b5ccf27215 256 * within the library project settings. By default this macro is defined
<> 133:99b5ccf27215 257 * and size checking is enabled. By changing the project settings and
<> 133:99b5ccf27215 258 * undefining this macro size checking is eliminated and the functions
<> 133:99b5ccf27215 259 * run a bit faster. With size checking disabled the functions always
<> 133:99b5ccf27215 260 * return <code>ARM_MATH_SUCCESS</code>.
<> 133:99b5ccf27215 261 */
<> 133:99b5ccf27215 262
<> 133:99b5ccf27215 263 /**
<> 133:99b5ccf27215 264 * @defgroup groupTransforms Transform Functions
<> 133:99b5ccf27215 265 */
<> 133:99b5ccf27215 266
<> 133:99b5ccf27215 267 /**
<> 133:99b5ccf27215 268 * @defgroup groupController Controller Functions
<> 133:99b5ccf27215 269 */
<> 133:99b5ccf27215 270
<> 133:99b5ccf27215 271 /**
<> 133:99b5ccf27215 272 * @defgroup groupStats Statistics Functions
<> 133:99b5ccf27215 273 */
<> 133:99b5ccf27215 274 /**
<> 133:99b5ccf27215 275 * @defgroup groupSupport Support Functions
<> 133:99b5ccf27215 276 */
<> 133:99b5ccf27215 277
<> 133:99b5ccf27215 278 /**
<> 133:99b5ccf27215 279 * @defgroup groupInterpolation Interpolation Functions
<> 133:99b5ccf27215 280 * These functions perform 1- and 2-dimensional interpolation of data.
<> 133:99b5ccf27215 281 * Linear interpolation is used for 1-dimensional data and
<> 133:99b5ccf27215 282 * bilinear interpolation is used for 2-dimensional data.
<> 133:99b5ccf27215 283 */
<> 133:99b5ccf27215 284
<> 133:99b5ccf27215 285 /**
<> 133:99b5ccf27215 286 * @defgroup groupExamples Examples
<> 133:99b5ccf27215 287 */
<> 133:99b5ccf27215 288 #ifndef _ARM_MATH_H
<> 133:99b5ccf27215 289 #define _ARM_MATH_H
<> 133:99b5ccf27215 290
<> 133:99b5ccf27215 291 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
<> 133:99b5ccf27215 292
<> 133:99b5ccf27215 293 #if defined(ARM_MATH_CM7)
<> 133:99b5ccf27215 294 #include "core_cm7.h"
<> 133:99b5ccf27215 295 #elif defined (ARM_MATH_CM4)
<> 133:99b5ccf27215 296 #include "core_cm4.h"
<> 133:99b5ccf27215 297 #elif defined (ARM_MATH_CM3)
<> 133:99b5ccf27215 298 #include "core_cm3.h"
<> 133:99b5ccf27215 299 #elif defined (ARM_MATH_CM0)
<> 133:99b5ccf27215 300 #include "core_cm0.h"
<> 133:99b5ccf27215 301 #define ARM_MATH_CM0_FAMILY
<> 133:99b5ccf27215 302 #elif defined (ARM_MATH_CM0PLUS)
<> 133:99b5ccf27215 303 #include "core_cm0plus.h"
<> 133:99b5ccf27215 304 #define ARM_MATH_CM0_FAMILY
<> 133:99b5ccf27215 305 #else
<> 133:99b5ccf27215 306 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
<> 133:99b5ccf27215 307 #endif
<> 133:99b5ccf27215 308
<> 133:99b5ccf27215 309 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
<> 133:99b5ccf27215 310 #include "string.h"
<> 133:99b5ccf27215 311 #include "math.h"
<> 133:99b5ccf27215 312 #ifdef __cplusplus
<> 133:99b5ccf27215 313 extern "C"
<> 133:99b5ccf27215 314 {
<> 133:99b5ccf27215 315 #endif
<> 133:99b5ccf27215 316
<> 133:99b5ccf27215 317
<> 133:99b5ccf27215 318 /**
<> 133:99b5ccf27215 319 * @brief Macros required for reciprocal calculation in Normalized LMS
<> 133:99b5ccf27215 320 */
<> 133:99b5ccf27215 321
<> 133:99b5ccf27215 322 #define DELTA_Q31 (0x100)
<> 133:99b5ccf27215 323 #define DELTA_Q15 0x5
<> 133:99b5ccf27215 324 #define INDEX_MASK 0x0000003F
<> 133:99b5ccf27215 325 #ifndef PI
<> 133:99b5ccf27215 326 #define PI 3.14159265358979f
<> 133:99b5ccf27215 327 #endif
<> 133:99b5ccf27215 328
<> 133:99b5ccf27215 329 /**
<> 133:99b5ccf27215 330 * @brief Macros required for SINE and COSINE Fast math approximations
<> 133:99b5ccf27215 331 */
<> 133:99b5ccf27215 332
<> 133:99b5ccf27215 333 #define FAST_MATH_TABLE_SIZE 512
<> 133:99b5ccf27215 334 #define FAST_MATH_Q31_SHIFT (32 - 10)
<> 133:99b5ccf27215 335 #define FAST_MATH_Q15_SHIFT (16 - 10)
<> 133:99b5ccf27215 336 #define CONTROLLER_Q31_SHIFT (32 - 9)
<> 133:99b5ccf27215 337 #define TABLE_SIZE 256
<> 133:99b5ccf27215 338 #define TABLE_SPACING_Q31 0x400000
<> 133:99b5ccf27215 339 #define TABLE_SPACING_Q15 0x80
<> 133:99b5ccf27215 340
<> 133:99b5ccf27215 341 /**
<> 133:99b5ccf27215 342 * @brief Macros required for SINE and COSINE Controller functions
<> 133:99b5ccf27215 343 */
<> 133:99b5ccf27215 344 /* 1.31(q31) Fixed value of 2/360 */
<> 133:99b5ccf27215 345 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
<> 133:99b5ccf27215 346 #define INPUT_SPACING 0xB60B61
<> 133:99b5ccf27215 347
<> 133:99b5ccf27215 348 /**
<> 133:99b5ccf27215 349 * @brief Macro for Unaligned Support
<> 133:99b5ccf27215 350 */
<> 133:99b5ccf27215 351 #ifndef UNALIGNED_SUPPORT_DISABLE
<> 133:99b5ccf27215 352 #define ALIGN4
<> 133:99b5ccf27215 353 #else
<> 133:99b5ccf27215 354 #if defined (__GNUC__)
<> 133:99b5ccf27215 355 #define ALIGN4 __attribute__((aligned(4)))
<> 133:99b5ccf27215 356 #else
<> 133:99b5ccf27215 357 #define ALIGN4 __align(4)
<> 133:99b5ccf27215 358 #endif
<> 133:99b5ccf27215 359 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
<> 133:99b5ccf27215 360
<> 133:99b5ccf27215 361 /**
<> 133:99b5ccf27215 362 * @brief Error status returned by some functions in the library.
<> 133:99b5ccf27215 363 */
<> 133:99b5ccf27215 364
<> 133:99b5ccf27215 365 typedef enum
<> 133:99b5ccf27215 366 {
<> 133:99b5ccf27215 367 ARM_MATH_SUCCESS = 0, /**< No error */
<> 133:99b5ccf27215 368 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
<> 133:99b5ccf27215 369 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
<> 133:99b5ccf27215 370 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
<> 133:99b5ccf27215 371 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
<> 133:99b5ccf27215 372 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
<> 133:99b5ccf27215 373 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */
<> 133:99b5ccf27215 374 } arm_status;
<> 133:99b5ccf27215 375
<> 133:99b5ccf27215 376 /**
<> 133:99b5ccf27215 377 * @brief 8-bit fractional data type in 1.7 format.
<> 133:99b5ccf27215 378 */
<> 133:99b5ccf27215 379 typedef int8_t q7_t;
<> 133:99b5ccf27215 380
<> 133:99b5ccf27215 381 /**
<> 133:99b5ccf27215 382 * @brief 16-bit fractional data type in 1.15 format.
<> 133:99b5ccf27215 383 */
<> 133:99b5ccf27215 384 typedef int16_t q15_t;
<> 133:99b5ccf27215 385
<> 133:99b5ccf27215 386 /**
<> 133:99b5ccf27215 387 * @brief 32-bit fractional data type in 1.31 format.
<> 133:99b5ccf27215 388 */
<> 133:99b5ccf27215 389 typedef int32_t q31_t;
<> 133:99b5ccf27215 390
<> 133:99b5ccf27215 391 /**
<> 133:99b5ccf27215 392 * @brief 64-bit fractional data type in 1.63 format.
<> 133:99b5ccf27215 393 */
<> 133:99b5ccf27215 394 typedef int64_t q63_t;
<> 133:99b5ccf27215 395
<> 133:99b5ccf27215 396 /**
<> 133:99b5ccf27215 397 * @brief 32-bit floating-point type definition.
<> 133:99b5ccf27215 398 */
<> 133:99b5ccf27215 399 typedef float float32_t;
<> 133:99b5ccf27215 400
<> 133:99b5ccf27215 401 /**
<> 133:99b5ccf27215 402 * @brief 64-bit floating-point type definition.
<> 133:99b5ccf27215 403 */
<> 133:99b5ccf27215 404 typedef double float64_t;
<> 133:99b5ccf27215 405
<> 133:99b5ccf27215 406 /**
<> 133:99b5ccf27215 407 * @brief definition to read/write two 16 bit values.
<> 133:99b5ccf27215 408 */
<> 133:99b5ccf27215 409 #if defined __CC_ARM
<> 133:99b5ccf27215 410 #define __SIMD32_TYPE int32_t __packed
<> 133:99b5ccf27215 411 #define CMSIS_UNUSED __attribute__((unused))
<> 133:99b5ccf27215 412 #elif defined __ICCARM__
<> 133:99b5ccf27215 413 #define __SIMD32_TYPE int32_t __packed
<> 133:99b5ccf27215 414 #define CMSIS_UNUSED
<> 133:99b5ccf27215 415 #elif defined __GNUC__
<> 133:99b5ccf27215 416 #define __SIMD32_TYPE int32_t
<> 133:99b5ccf27215 417 #define CMSIS_UNUSED __attribute__((unused))
<> 133:99b5ccf27215 418 #elif defined __CSMC__ /* Cosmic */
<> 133:99b5ccf27215 419 #define __SIMD32_TYPE int32_t
<> 133:99b5ccf27215 420 #define CMSIS_UNUSED
<> 133:99b5ccf27215 421 #elif defined __TASKING__
<> 133:99b5ccf27215 422 #define __SIMD32_TYPE __unaligned int32_t
<> 133:99b5ccf27215 423 #define CMSIS_UNUSED
<> 133:99b5ccf27215 424 #else
<> 133:99b5ccf27215 425 #error Unknown compiler
<> 133:99b5ccf27215 426 #endif
<> 133:99b5ccf27215 427
<> 133:99b5ccf27215 428 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
<> 133:99b5ccf27215 429 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
<> 133:99b5ccf27215 430
<> 133:99b5ccf27215 431 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
<> 133:99b5ccf27215 432
<> 133:99b5ccf27215 433 #define __SIMD64(addr) (*(int64_t **) & (addr))
<> 133:99b5ccf27215 434
<> 133:99b5ccf27215 435 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 133:99b5ccf27215 436 /**
<> 133:99b5ccf27215 437 * @brief definition to pack two 16 bit values.
<> 133:99b5ccf27215 438 */
<> 133:99b5ccf27215 439 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
<> 133:99b5ccf27215 440 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
<> 133:99b5ccf27215 441 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
<> 133:99b5ccf27215 442 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
<> 133:99b5ccf27215 443
<> 133:99b5ccf27215 444 #endif
<> 133:99b5ccf27215 445
<> 133:99b5ccf27215 446
<> 133:99b5ccf27215 447 /**
<> 133:99b5ccf27215 448 * @brief definition to pack four 8 bit values.
<> 133:99b5ccf27215 449 */
<> 133:99b5ccf27215 450 #ifndef ARM_MATH_BIG_ENDIAN
<> 133:99b5ccf27215 451
<> 133:99b5ccf27215 452 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
<> 133:99b5ccf27215 453 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
<> 133:99b5ccf27215 454 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
<> 133:99b5ccf27215 455 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
<> 133:99b5ccf27215 456 #else
<> 133:99b5ccf27215 457
<> 133:99b5ccf27215 458 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
<> 133:99b5ccf27215 459 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
<> 133:99b5ccf27215 460 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
<> 133:99b5ccf27215 461 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
<> 133:99b5ccf27215 462
<> 133:99b5ccf27215 463 #endif
<> 133:99b5ccf27215 464
<> 133:99b5ccf27215 465
<> 133:99b5ccf27215 466 /**
<> 133:99b5ccf27215 467 * @brief Clips Q63 to Q31 values.
<> 133:99b5ccf27215 468 */
<> 133:99b5ccf27215 469 static __INLINE q31_t clip_q63_to_q31(
<> 133:99b5ccf27215 470 q63_t x)
<> 133:99b5ccf27215 471 {
<> 133:99b5ccf27215 472 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 133:99b5ccf27215 473 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
<> 133:99b5ccf27215 474 }
<> 133:99b5ccf27215 475
<> 133:99b5ccf27215 476 /**
<> 133:99b5ccf27215 477 * @brief Clips Q63 to Q15 values.
<> 133:99b5ccf27215 478 */
<> 133:99b5ccf27215 479 static __INLINE q15_t clip_q63_to_q15(
<> 133:99b5ccf27215 480 q63_t x)
<> 133:99b5ccf27215 481 {
<> 133:99b5ccf27215 482 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
<> 133:99b5ccf27215 483 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
<> 133:99b5ccf27215 484 }
<> 133:99b5ccf27215 485
<> 133:99b5ccf27215 486 /**
<> 133:99b5ccf27215 487 * @brief Clips Q31 to Q7 values.
<> 133:99b5ccf27215 488 */
<> 133:99b5ccf27215 489 static __INLINE q7_t clip_q31_to_q7(
<> 133:99b5ccf27215 490 q31_t x)
<> 133:99b5ccf27215 491 {
<> 133:99b5ccf27215 492 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
<> 133:99b5ccf27215 493 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
<> 133:99b5ccf27215 494 }
<> 133:99b5ccf27215 495
<> 133:99b5ccf27215 496 /**
<> 133:99b5ccf27215 497 * @brief Clips Q31 to Q15 values.
<> 133:99b5ccf27215 498 */
<> 133:99b5ccf27215 499 static __INLINE q15_t clip_q31_to_q15(
<> 133:99b5ccf27215 500 q31_t x)
<> 133:99b5ccf27215 501 {
<> 133:99b5ccf27215 502 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
<> 133:99b5ccf27215 503 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
<> 133:99b5ccf27215 504 }
<> 133:99b5ccf27215 505
<> 133:99b5ccf27215 506 /**
<> 133:99b5ccf27215 507 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
<> 133:99b5ccf27215 508 */
<> 133:99b5ccf27215 509
<> 133:99b5ccf27215 510 static __INLINE q63_t mult32x64(
<> 133:99b5ccf27215 511 q63_t x,
<> 133:99b5ccf27215 512 q31_t y)
<> 133:99b5ccf27215 513 {
<> 133:99b5ccf27215 514 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
<> 133:99b5ccf27215 515 (((q63_t) (x >> 32) * y)));
<> 133:99b5ccf27215 516 }
<> 133:99b5ccf27215 517
<> 133:99b5ccf27215 518
<> 133:99b5ccf27215 519 //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
<> 133:99b5ccf27215 520 //#define __CLZ __clz
<> 133:99b5ccf27215 521 //#endif
<> 133:99b5ccf27215 522
<> 133:99b5ccf27215 523 //note: function can be removed when all toolchain support __CLZ for Cortex-M0
<> 133:99b5ccf27215 524 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
<> 133:99b5ccf27215 525
<> 133:99b5ccf27215 526 static __INLINE uint32_t __CLZ(
<> 133:99b5ccf27215 527 q31_t data);
<> 133:99b5ccf27215 528
<> 133:99b5ccf27215 529
<> 133:99b5ccf27215 530 static __INLINE uint32_t __CLZ(
<> 133:99b5ccf27215 531 q31_t data)
<> 133:99b5ccf27215 532 {
<> 133:99b5ccf27215 533 uint32_t count = 0;
<> 133:99b5ccf27215 534 uint32_t mask = 0x80000000;
<> 133:99b5ccf27215 535
<> 133:99b5ccf27215 536 while((data & mask) == 0)
<> 133:99b5ccf27215 537 {
<> 133:99b5ccf27215 538 count += 1u;
<> 133:99b5ccf27215 539 mask = mask >> 1u;
<> 133:99b5ccf27215 540 }
<> 133:99b5ccf27215 541
<> 133:99b5ccf27215 542 return (count);
<> 133:99b5ccf27215 543
<> 133:99b5ccf27215 544 }
<> 133:99b5ccf27215 545
<> 133:99b5ccf27215 546 #endif
<> 133:99b5ccf27215 547
<> 133:99b5ccf27215 548 /**
<> 133:99b5ccf27215 549 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
<> 133:99b5ccf27215 550 */
<> 133:99b5ccf27215 551
<> 133:99b5ccf27215 552 static __INLINE uint32_t arm_recip_q31(
<> 133:99b5ccf27215 553 q31_t in,
<> 133:99b5ccf27215 554 q31_t * dst,
<> 133:99b5ccf27215 555 q31_t * pRecipTable)
<> 133:99b5ccf27215 556 {
<> 133:99b5ccf27215 557
<> 133:99b5ccf27215 558 uint32_t out, tempVal;
<> 133:99b5ccf27215 559 uint32_t index, i;
<> 133:99b5ccf27215 560 uint32_t signBits;
<> 133:99b5ccf27215 561
<> 133:99b5ccf27215 562 if(in > 0)
<> 133:99b5ccf27215 563 {
<> 133:99b5ccf27215 564 signBits = __CLZ(in) - 1;
<> 133:99b5ccf27215 565 }
<> 133:99b5ccf27215 566 else
<> 133:99b5ccf27215 567 {
<> 133:99b5ccf27215 568 signBits = __CLZ(-in) - 1;
<> 133:99b5ccf27215 569 }
<> 133:99b5ccf27215 570
<> 133:99b5ccf27215 571 /* Convert input sample to 1.31 format */
<> 133:99b5ccf27215 572 in = in << signBits;
<> 133:99b5ccf27215 573
<> 133:99b5ccf27215 574 /* calculation of index for initial approximated Val */
<> 133:99b5ccf27215 575 index = (uint32_t) (in >> 24u);
<> 133:99b5ccf27215 576 index = (index & INDEX_MASK);
<> 133:99b5ccf27215 577
<> 133:99b5ccf27215 578 /* 1.31 with exp 1 */
<> 133:99b5ccf27215 579 out = pRecipTable[index];
<> 133:99b5ccf27215 580
<> 133:99b5ccf27215 581 /* calculation of reciprocal value */
<> 133:99b5ccf27215 582 /* running approximation for two iterations */
<> 133:99b5ccf27215 583 for (i = 0u; i < 2u; i++)
<> 133:99b5ccf27215 584 {
<> 133:99b5ccf27215 585 tempVal = (q31_t) (((q63_t) in * out) >> 31u);
<> 133:99b5ccf27215 586 tempVal = 0x7FFFFFFF - tempVal;
<> 133:99b5ccf27215 587 /* 1.31 with exp 1 */
<> 133:99b5ccf27215 588 //out = (q31_t) (((q63_t) out * tempVal) >> 30u);
<> 133:99b5ccf27215 589 out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u);
<> 133:99b5ccf27215 590 }
<> 133:99b5ccf27215 591
<> 133:99b5ccf27215 592 /* write output */
<> 133:99b5ccf27215 593 *dst = out;
<> 133:99b5ccf27215 594
<> 133:99b5ccf27215 595 /* return num of signbits of out = 1/in value */
<> 133:99b5ccf27215 596 return (signBits + 1u);
<> 133:99b5ccf27215 597
<> 133:99b5ccf27215 598 }
<> 133:99b5ccf27215 599
<> 133:99b5ccf27215 600 /**
<> 133:99b5ccf27215 601 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type.
<> 133:99b5ccf27215 602 */
<> 133:99b5ccf27215 603 static __INLINE uint32_t arm_recip_q15(
<> 133:99b5ccf27215 604 q15_t in,
<> 133:99b5ccf27215 605 q15_t * dst,
<> 133:99b5ccf27215 606 q15_t * pRecipTable)
<> 133:99b5ccf27215 607 {
<> 133:99b5ccf27215 608
<> 133:99b5ccf27215 609 uint32_t out = 0, tempVal = 0;
<> 133:99b5ccf27215 610 uint32_t index = 0, i = 0;
<> 133:99b5ccf27215 611 uint32_t signBits = 0;
<> 133:99b5ccf27215 612
<> 133:99b5ccf27215 613 if(in > 0)
<> 133:99b5ccf27215 614 {
<> 133:99b5ccf27215 615 signBits = __CLZ(in) - 17;
<> 133:99b5ccf27215 616 }
<> 133:99b5ccf27215 617 else
<> 133:99b5ccf27215 618 {
<> 133:99b5ccf27215 619 signBits = __CLZ(-in) - 17;
<> 133:99b5ccf27215 620 }
<> 133:99b5ccf27215 621
<> 133:99b5ccf27215 622 /* Convert input sample to 1.15 format */
<> 133:99b5ccf27215 623 in = in << signBits;
<> 133:99b5ccf27215 624
<> 133:99b5ccf27215 625 /* calculation of index for initial approximated Val */
<> 133:99b5ccf27215 626 index = in >> 8;
<> 133:99b5ccf27215 627 index = (index & INDEX_MASK);
<> 133:99b5ccf27215 628
<> 133:99b5ccf27215 629 /* 1.15 with exp 1 */
<> 133:99b5ccf27215 630 out = pRecipTable[index];
<> 133:99b5ccf27215 631
<> 133:99b5ccf27215 632 /* calculation of reciprocal value */
<> 133:99b5ccf27215 633 /* running approximation for two iterations */
<> 133:99b5ccf27215 634 for (i = 0; i < 2; i++)
<> 133:99b5ccf27215 635 {
<> 133:99b5ccf27215 636 tempVal = (q15_t) (((q31_t) in * out) >> 15);
<> 133:99b5ccf27215 637 tempVal = 0x7FFF - tempVal;
<> 133:99b5ccf27215 638 /* 1.15 with exp 1 */
<> 133:99b5ccf27215 639 out = (q15_t) (((q31_t) out * tempVal) >> 14);
<> 133:99b5ccf27215 640 }
<> 133:99b5ccf27215 641
<> 133:99b5ccf27215 642 /* write output */
<> 133:99b5ccf27215 643 *dst = out;
<> 133:99b5ccf27215 644
<> 133:99b5ccf27215 645 /* return num of signbits of out = 1/in value */
<> 133:99b5ccf27215 646 return (signBits + 1);
<> 133:99b5ccf27215 647
<> 133:99b5ccf27215 648 }
<> 133:99b5ccf27215 649
<> 133:99b5ccf27215 650
<> 133:99b5ccf27215 651 /*
<> 133:99b5ccf27215 652 * @brief C custom defined intrinisic function for only M0 processors
<> 133:99b5ccf27215 653 */
<> 133:99b5ccf27215 654 #if defined(ARM_MATH_CM0_FAMILY)
<> 133:99b5ccf27215 655
<> 133:99b5ccf27215 656 static __INLINE q31_t __SSAT(
<> 133:99b5ccf27215 657 q31_t x,
<> 133:99b5ccf27215 658 uint32_t y)
<> 133:99b5ccf27215 659 {
<> 133:99b5ccf27215 660 int32_t posMax, negMin;
<> 133:99b5ccf27215 661 uint32_t i;
<> 133:99b5ccf27215 662
<> 133:99b5ccf27215 663 posMax = 1;
<> 133:99b5ccf27215 664 for (i = 0; i < (y - 1); i++)
<> 133:99b5ccf27215 665 {
<> 133:99b5ccf27215 666 posMax = posMax * 2;
<> 133:99b5ccf27215 667 }
<> 133:99b5ccf27215 668
<> 133:99b5ccf27215 669 if(x > 0)
<> 133:99b5ccf27215 670 {
<> 133:99b5ccf27215 671 posMax = (posMax - 1);
<> 133:99b5ccf27215 672
<> 133:99b5ccf27215 673 if(x > posMax)
<> 133:99b5ccf27215 674 {
<> 133:99b5ccf27215 675 x = posMax;
<> 133:99b5ccf27215 676 }
<> 133:99b5ccf27215 677 }
<> 133:99b5ccf27215 678 else
<> 133:99b5ccf27215 679 {
<> 133:99b5ccf27215 680 negMin = -posMax;
<> 133:99b5ccf27215 681
<> 133:99b5ccf27215 682 if(x < negMin)
<> 133:99b5ccf27215 683 {
<> 133:99b5ccf27215 684 x = negMin;
<> 133:99b5ccf27215 685 }
<> 133:99b5ccf27215 686 }
<> 133:99b5ccf27215 687 return (x);
<> 133:99b5ccf27215 688
<> 133:99b5ccf27215 689
<> 133:99b5ccf27215 690 }
<> 133:99b5ccf27215 691
<> 133:99b5ccf27215 692 #endif /* end of ARM_MATH_CM0_FAMILY */
<> 133:99b5ccf27215 693
<> 133:99b5ccf27215 694
<> 133:99b5ccf27215 695
<> 133:99b5ccf27215 696 /*
<> 133:99b5ccf27215 697 * @brief C custom defined intrinsic function for M3 and M0 processors
<> 133:99b5ccf27215 698 */
<> 133:99b5ccf27215 699 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
<> 133:99b5ccf27215 700
<> 133:99b5ccf27215 701 /*
<> 133:99b5ccf27215 702 * @brief C custom defined QADD8 for M3 and M0 processors
<> 133:99b5ccf27215 703 */
<> 133:99b5ccf27215 704 static __INLINE q31_t __QADD8(
<> 133:99b5ccf27215 705 q31_t x,
<> 133:99b5ccf27215 706 q31_t y)
<> 133:99b5ccf27215 707 {
<> 133:99b5ccf27215 708
<> 133:99b5ccf27215 709 q31_t sum;
<> 133:99b5ccf27215 710 q7_t r, s, t, u;
<> 133:99b5ccf27215 711
<> 133:99b5ccf27215 712 r = (q7_t) x;
<> 133:99b5ccf27215 713 s = (q7_t) y;
<> 133:99b5ccf27215 714
<> 133:99b5ccf27215 715 r = __SSAT((q31_t) (r + s), 8);
<> 133:99b5ccf27215 716 s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8);
<> 133:99b5ccf27215 717 t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8);
<> 133:99b5ccf27215 718 u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8);
<> 133:99b5ccf27215 719
<> 133:99b5ccf27215 720 sum =
<> 133:99b5ccf27215 721 (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) |
<> 133:99b5ccf27215 722 (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF);
<> 133:99b5ccf27215 723
<> 133:99b5ccf27215 724 return sum;
<> 133:99b5ccf27215 725
<> 133:99b5ccf27215 726 }
<> 133:99b5ccf27215 727
<> 133:99b5ccf27215 728 /*
<> 133:99b5ccf27215 729 * @brief C custom defined QSUB8 for M3 and M0 processors
<> 133:99b5ccf27215 730 */
<> 133:99b5ccf27215 731 static __INLINE q31_t __QSUB8(
<> 133:99b5ccf27215 732 q31_t x,
<> 133:99b5ccf27215 733 q31_t y)
<> 133:99b5ccf27215 734 {
<> 133:99b5ccf27215 735
<> 133:99b5ccf27215 736 q31_t sum;
<> 133:99b5ccf27215 737 q31_t r, s, t, u;
<> 133:99b5ccf27215 738
<> 133:99b5ccf27215 739 r = (q7_t) x;
<> 133:99b5ccf27215 740 s = (q7_t) y;
<> 133:99b5ccf27215 741
<> 133:99b5ccf27215 742 r = __SSAT((r - s), 8);
<> 133:99b5ccf27215 743 s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8;
<> 133:99b5ccf27215 744 t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16;
<> 133:99b5ccf27215 745 u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24;
<> 133:99b5ccf27215 746
<> 133:99b5ccf27215 747 sum =
<> 133:99b5ccf27215 748 (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r &
<> 133:99b5ccf27215 749 0x000000FF);
<> 133:99b5ccf27215 750
<> 133:99b5ccf27215 751 return sum;
<> 133:99b5ccf27215 752 }
<> 133:99b5ccf27215 753
<> 133:99b5ccf27215 754 /*
<> 133:99b5ccf27215 755 * @brief C custom defined QADD16 for M3 and M0 processors
<> 133:99b5ccf27215 756 */
<> 133:99b5ccf27215 757
<> 133:99b5ccf27215 758 /*
<> 133:99b5ccf27215 759 * @brief C custom defined QADD16 for M3 and M0 processors
<> 133:99b5ccf27215 760 */
<> 133:99b5ccf27215 761 static __INLINE q31_t __QADD16(
<> 133:99b5ccf27215 762 q31_t x,
<> 133:99b5ccf27215 763 q31_t y)
<> 133:99b5ccf27215 764 {
<> 133:99b5ccf27215 765
<> 133:99b5ccf27215 766 q31_t sum;
<> 133:99b5ccf27215 767 q31_t r, s;
<> 133:99b5ccf27215 768
<> 133:99b5ccf27215 769 r = (q15_t) x;
<> 133:99b5ccf27215 770 s = (q15_t) y;
<> 133:99b5ccf27215 771
<> 133:99b5ccf27215 772 r = __SSAT(r + s, 16);
<> 133:99b5ccf27215 773 s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16;
<> 133:99b5ccf27215 774
<> 133:99b5ccf27215 775 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 776
<> 133:99b5ccf27215 777 return sum;
<> 133:99b5ccf27215 778
<> 133:99b5ccf27215 779 }
<> 133:99b5ccf27215 780
<> 133:99b5ccf27215 781 /*
<> 133:99b5ccf27215 782 * @brief C custom defined SHADD16 for M3 and M0 processors
<> 133:99b5ccf27215 783 */
<> 133:99b5ccf27215 784 static __INLINE q31_t __SHADD16(
<> 133:99b5ccf27215 785 q31_t x,
<> 133:99b5ccf27215 786 q31_t y)
<> 133:99b5ccf27215 787 {
<> 133:99b5ccf27215 788
<> 133:99b5ccf27215 789 q31_t sum;
<> 133:99b5ccf27215 790 q31_t r, s;
<> 133:99b5ccf27215 791
<> 133:99b5ccf27215 792 r = (q15_t) x;
<> 133:99b5ccf27215 793 s = (q15_t) y;
<> 133:99b5ccf27215 794
<> 133:99b5ccf27215 795 r = ((r >> 1) + (s >> 1));
<> 133:99b5ccf27215 796 s = ((q31_t) ((x >> 17) + (y >> 17))) << 16;
<> 133:99b5ccf27215 797
<> 133:99b5ccf27215 798 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 799
<> 133:99b5ccf27215 800 return sum;
<> 133:99b5ccf27215 801
<> 133:99b5ccf27215 802 }
<> 133:99b5ccf27215 803
<> 133:99b5ccf27215 804 /*
<> 133:99b5ccf27215 805 * @brief C custom defined QSUB16 for M3 and M0 processors
<> 133:99b5ccf27215 806 */
<> 133:99b5ccf27215 807 static __INLINE q31_t __QSUB16(
<> 133:99b5ccf27215 808 q31_t x,
<> 133:99b5ccf27215 809 q31_t y)
<> 133:99b5ccf27215 810 {
<> 133:99b5ccf27215 811
<> 133:99b5ccf27215 812 q31_t sum;
<> 133:99b5ccf27215 813 q31_t r, s;
<> 133:99b5ccf27215 814
<> 133:99b5ccf27215 815 r = (q15_t) x;
<> 133:99b5ccf27215 816 s = (q15_t) y;
<> 133:99b5ccf27215 817
<> 133:99b5ccf27215 818 r = __SSAT(r - s, 16);
<> 133:99b5ccf27215 819 s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16;
<> 133:99b5ccf27215 820
<> 133:99b5ccf27215 821 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 822
<> 133:99b5ccf27215 823 return sum;
<> 133:99b5ccf27215 824 }
<> 133:99b5ccf27215 825
<> 133:99b5ccf27215 826 /*
<> 133:99b5ccf27215 827 * @brief C custom defined SHSUB16 for M3 and M0 processors
<> 133:99b5ccf27215 828 */
<> 133:99b5ccf27215 829 static __INLINE q31_t __SHSUB16(
<> 133:99b5ccf27215 830 q31_t x,
<> 133:99b5ccf27215 831 q31_t y)
<> 133:99b5ccf27215 832 {
<> 133:99b5ccf27215 833
<> 133:99b5ccf27215 834 q31_t diff;
<> 133:99b5ccf27215 835 q31_t r, s;
<> 133:99b5ccf27215 836
<> 133:99b5ccf27215 837 r = (q15_t) x;
<> 133:99b5ccf27215 838 s = (q15_t) y;
<> 133:99b5ccf27215 839
<> 133:99b5ccf27215 840 r = ((r >> 1) - (s >> 1));
<> 133:99b5ccf27215 841 s = (((x >> 17) - (y >> 17)) << 16);
<> 133:99b5ccf27215 842
<> 133:99b5ccf27215 843 diff = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 844
<> 133:99b5ccf27215 845 return diff;
<> 133:99b5ccf27215 846 }
<> 133:99b5ccf27215 847
<> 133:99b5ccf27215 848 /*
<> 133:99b5ccf27215 849 * @brief C custom defined QASX for M3 and M0 processors
<> 133:99b5ccf27215 850 */
<> 133:99b5ccf27215 851 static __INLINE q31_t __QASX(
<> 133:99b5ccf27215 852 q31_t x,
<> 133:99b5ccf27215 853 q31_t y)
<> 133:99b5ccf27215 854 {
<> 133:99b5ccf27215 855
<> 133:99b5ccf27215 856 q31_t sum = 0;
<> 133:99b5ccf27215 857
<> 133:99b5ccf27215 858 sum =
<> 133:99b5ccf27215 859 ((sum +
<> 133:99b5ccf27215 860 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) +
<> 133:99b5ccf27215 861 clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16)));
<> 133:99b5ccf27215 862
<> 133:99b5ccf27215 863 return sum;
<> 133:99b5ccf27215 864 }
<> 133:99b5ccf27215 865
<> 133:99b5ccf27215 866 /*
<> 133:99b5ccf27215 867 * @brief C custom defined SHASX for M3 and M0 processors
<> 133:99b5ccf27215 868 */
<> 133:99b5ccf27215 869 static __INLINE q31_t __SHASX(
<> 133:99b5ccf27215 870 q31_t x,
<> 133:99b5ccf27215 871 q31_t y)
<> 133:99b5ccf27215 872 {
<> 133:99b5ccf27215 873
<> 133:99b5ccf27215 874 q31_t sum;
<> 133:99b5ccf27215 875 q31_t r, s;
<> 133:99b5ccf27215 876
<> 133:99b5ccf27215 877 r = (q15_t) x;
<> 133:99b5ccf27215 878 s = (q15_t) y;
<> 133:99b5ccf27215 879
<> 133:99b5ccf27215 880 r = ((r >> 1) - (y >> 17));
<> 133:99b5ccf27215 881 s = (((x >> 17) + (s >> 1)) << 16);
<> 133:99b5ccf27215 882
<> 133:99b5ccf27215 883 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 884
<> 133:99b5ccf27215 885 return sum;
<> 133:99b5ccf27215 886 }
<> 133:99b5ccf27215 887
<> 133:99b5ccf27215 888
<> 133:99b5ccf27215 889 /*
<> 133:99b5ccf27215 890 * @brief C custom defined QSAX for M3 and M0 processors
<> 133:99b5ccf27215 891 */
<> 133:99b5ccf27215 892 static __INLINE q31_t __QSAX(
<> 133:99b5ccf27215 893 q31_t x,
<> 133:99b5ccf27215 894 q31_t y)
<> 133:99b5ccf27215 895 {
<> 133:99b5ccf27215 896
<> 133:99b5ccf27215 897 q31_t sum = 0;
<> 133:99b5ccf27215 898
<> 133:99b5ccf27215 899 sum =
<> 133:99b5ccf27215 900 ((sum +
<> 133:99b5ccf27215 901 clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) +
<> 133:99b5ccf27215 902 clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16)));
<> 133:99b5ccf27215 903
<> 133:99b5ccf27215 904 return sum;
<> 133:99b5ccf27215 905 }
<> 133:99b5ccf27215 906
<> 133:99b5ccf27215 907 /*
<> 133:99b5ccf27215 908 * @brief C custom defined SHSAX for M3 and M0 processors
<> 133:99b5ccf27215 909 */
<> 133:99b5ccf27215 910 static __INLINE q31_t __SHSAX(
<> 133:99b5ccf27215 911 q31_t x,
<> 133:99b5ccf27215 912 q31_t y)
<> 133:99b5ccf27215 913 {
<> 133:99b5ccf27215 914
<> 133:99b5ccf27215 915 q31_t sum;
<> 133:99b5ccf27215 916 q31_t r, s;
<> 133:99b5ccf27215 917
<> 133:99b5ccf27215 918 r = (q15_t) x;
<> 133:99b5ccf27215 919 s = (q15_t) y;
<> 133:99b5ccf27215 920
<> 133:99b5ccf27215 921 r = ((r >> 1) + (y >> 17));
<> 133:99b5ccf27215 922 s = (((x >> 17) - (s >> 1)) << 16);
<> 133:99b5ccf27215 923
<> 133:99b5ccf27215 924 sum = (s & 0xFFFF0000) | (r & 0x0000FFFF);
<> 133:99b5ccf27215 925
<> 133:99b5ccf27215 926 return sum;
<> 133:99b5ccf27215 927 }
<> 133:99b5ccf27215 928
<> 133:99b5ccf27215 929 /*
<> 133:99b5ccf27215 930 * @brief C custom defined SMUSDX for M3 and M0 processors
<> 133:99b5ccf27215 931 */
<> 133:99b5ccf27215 932 static __INLINE q31_t __SMUSDX(
<> 133:99b5ccf27215 933 q31_t x,
<> 133:99b5ccf27215 934 q31_t y)
<> 133:99b5ccf27215 935 {
<> 133:99b5ccf27215 936
<> 133:99b5ccf27215 937 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) -
<> 133:99b5ccf27215 938 ((q15_t) (x >> 16) * (q15_t) y)));
<> 133:99b5ccf27215 939 }
<> 133:99b5ccf27215 940
<> 133:99b5ccf27215 941 /*
<> 133:99b5ccf27215 942 * @brief C custom defined SMUADX for M3 and M0 processors
<> 133:99b5ccf27215 943 */
<> 133:99b5ccf27215 944 static __INLINE q31_t __SMUADX(
<> 133:99b5ccf27215 945 q31_t x,
<> 133:99b5ccf27215 946 q31_t y)
<> 133:99b5ccf27215 947 {
<> 133:99b5ccf27215 948
<> 133:99b5ccf27215 949 return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) +
<> 133:99b5ccf27215 950 ((q15_t) (x >> 16) * (q15_t) y)));
<> 133:99b5ccf27215 951 }
<> 133:99b5ccf27215 952
<> 133:99b5ccf27215 953 /*
<> 133:99b5ccf27215 954 * @brief C custom defined QADD for M3 and M0 processors
<> 133:99b5ccf27215 955 */
<> 133:99b5ccf27215 956 static __INLINE q31_t __QADD(
<> 133:99b5ccf27215 957 q31_t x,
<> 133:99b5ccf27215 958 q31_t y)
<> 133:99b5ccf27215 959 {
<> 133:99b5ccf27215 960 return clip_q63_to_q31((q63_t) x + y);
<> 133:99b5ccf27215 961 }
<> 133:99b5ccf27215 962
<> 133:99b5ccf27215 963 /*
<> 133:99b5ccf27215 964 * @brief C custom defined QSUB for M3 and M0 processors
<> 133:99b5ccf27215 965 */
<> 133:99b5ccf27215 966 static __INLINE q31_t __QSUB(
<> 133:99b5ccf27215 967 q31_t x,
<> 133:99b5ccf27215 968 q31_t y)
<> 133:99b5ccf27215 969 {
<> 133:99b5ccf27215 970 return clip_q63_to_q31((q63_t) x - y);
<> 133:99b5ccf27215 971 }
<> 133:99b5ccf27215 972
<> 133:99b5ccf27215 973 /*
<> 133:99b5ccf27215 974 * @brief C custom defined SMLAD for M3 and M0 processors
<> 133:99b5ccf27215 975 */
<> 133:99b5ccf27215 976 static __INLINE q31_t __SMLAD(
<> 133:99b5ccf27215 977 q31_t x,
<> 133:99b5ccf27215 978 q31_t y,
<> 133:99b5ccf27215 979 q31_t sum)
<> 133:99b5ccf27215 980 {
<> 133:99b5ccf27215 981
<> 133:99b5ccf27215 982 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 133:99b5ccf27215 983 ((q15_t) x * (q15_t) y));
<> 133:99b5ccf27215 984 }
<> 133:99b5ccf27215 985
<> 133:99b5ccf27215 986 /*
<> 133:99b5ccf27215 987 * @brief C custom defined SMLADX for M3 and M0 processors
<> 133:99b5ccf27215 988 */
<> 133:99b5ccf27215 989 static __INLINE q31_t __SMLADX(
<> 133:99b5ccf27215 990 q31_t x,
<> 133:99b5ccf27215 991 q31_t y,
<> 133:99b5ccf27215 992 q31_t sum)
<> 133:99b5ccf27215 993 {
<> 133:99b5ccf27215 994
<> 133:99b5ccf27215 995 return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 133:99b5ccf27215 996 ((q15_t) x * (q15_t) (y >> 16)));
<> 133:99b5ccf27215 997 }
<> 133:99b5ccf27215 998
<> 133:99b5ccf27215 999 /*
<> 133:99b5ccf27215 1000 * @brief C custom defined SMLSDX for M3 and M0 processors
<> 133:99b5ccf27215 1001 */
<> 133:99b5ccf27215 1002 static __INLINE q31_t __SMLSDX(
<> 133:99b5ccf27215 1003 q31_t x,
<> 133:99b5ccf27215 1004 q31_t y,
<> 133:99b5ccf27215 1005 q31_t sum)
<> 133:99b5ccf27215 1006 {
<> 133:99b5ccf27215 1007
<> 133:99b5ccf27215 1008 return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) +
<> 133:99b5ccf27215 1009 ((q15_t) x * (q15_t) (y >> 16)));
<> 133:99b5ccf27215 1010 }
<> 133:99b5ccf27215 1011
<> 133:99b5ccf27215 1012 /*
<> 133:99b5ccf27215 1013 * @brief C custom defined SMLALD for M3 and M0 processors
<> 133:99b5ccf27215 1014 */
<> 133:99b5ccf27215 1015 static __INLINE q63_t __SMLALD(
<> 133:99b5ccf27215 1016 q31_t x,
<> 133:99b5ccf27215 1017 q31_t y,
<> 133:99b5ccf27215 1018 q63_t sum)
<> 133:99b5ccf27215 1019 {
<> 133:99b5ccf27215 1020
<> 133:99b5ccf27215 1021 return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) +
<> 133:99b5ccf27215 1022 ((q15_t) x * (q15_t) y));
<> 133:99b5ccf27215 1023 }
<> 133:99b5ccf27215 1024
<> 133:99b5ccf27215 1025 /*
<> 133:99b5ccf27215 1026 * @brief C custom defined SMLALDX for M3 and M0 processors
<> 133:99b5ccf27215 1027 */
<> 133:99b5ccf27215 1028 static __INLINE q63_t __SMLALDX(
<> 133:99b5ccf27215 1029 q31_t x,
<> 133:99b5ccf27215 1030 q31_t y,
<> 133:99b5ccf27215 1031 q63_t sum)
<> 133:99b5ccf27215 1032 {
<> 133:99b5ccf27215 1033
<> 133:99b5ccf27215 1034 return (sum + ((q15_t) (x >> 16) * (q15_t) y)) +
<> 133:99b5ccf27215 1035 ((q15_t) x * (q15_t) (y >> 16));
<> 133:99b5ccf27215 1036 }
<> 133:99b5ccf27215 1037
<> 133:99b5ccf27215 1038 /*
<> 133:99b5ccf27215 1039 * @brief C custom defined SMUAD for M3 and M0 processors
<> 133:99b5ccf27215 1040 */
<> 133:99b5ccf27215 1041 static __INLINE q31_t __SMUAD(
<> 133:99b5ccf27215 1042 q31_t x,
<> 133:99b5ccf27215 1043 q31_t y)
<> 133:99b5ccf27215 1044 {
<> 133:99b5ccf27215 1045
<> 133:99b5ccf27215 1046 return (((x >> 16) * (y >> 16)) +
<> 133:99b5ccf27215 1047 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 133:99b5ccf27215 1048 }
<> 133:99b5ccf27215 1049
<> 133:99b5ccf27215 1050 /*
<> 133:99b5ccf27215 1051 * @brief C custom defined SMUSD for M3 and M0 processors
<> 133:99b5ccf27215 1052 */
<> 133:99b5ccf27215 1053 static __INLINE q31_t __SMUSD(
<> 133:99b5ccf27215 1054 q31_t x,
<> 133:99b5ccf27215 1055 q31_t y)
<> 133:99b5ccf27215 1056 {
<> 133:99b5ccf27215 1057
<> 133:99b5ccf27215 1058 return (-((x >> 16) * (y >> 16)) +
<> 133:99b5ccf27215 1059 (((x << 16) >> 16) * ((y << 16) >> 16)));
<> 133:99b5ccf27215 1060 }
<> 133:99b5ccf27215 1061
<> 133:99b5ccf27215 1062
<> 133:99b5ccf27215 1063 /*
<> 133:99b5ccf27215 1064 * @brief C custom defined SXTB16 for M3 and M0 processors
<> 133:99b5ccf27215 1065 */
<> 133:99b5ccf27215 1066 static __INLINE q31_t __SXTB16(
<> 133:99b5ccf27215 1067 q31_t x)
<> 133:99b5ccf27215 1068 {
<> 133:99b5ccf27215 1069
<> 133:99b5ccf27215 1070 return ((((x << 24) >> 24) & 0x0000FFFF) |
<> 133:99b5ccf27215 1071 (((x << 8) >> 8) & 0xFFFF0000));
<> 133:99b5ccf27215 1072 }
<> 133:99b5ccf27215 1073
<> 133:99b5ccf27215 1074
<> 133:99b5ccf27215 1075 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
<> 133:99b5ccf27215 1076
<> 133:99b5ccf27215 1077
<> 133:99b5ccf27215 1078 /**
<> 133:99b5ccf27215 1079 * @brief Instance structure for the Q7 FIR filter.
<> 133:99b5ccf27215 1080 */
<> 133:99b5ccf27215 1081 typedef struct
<> 133:99b5ccf27215 1082 {
<> 133:99b5ccf27215 1083 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 133:99b5ccf27215 1084 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 1085 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 1086 } arm_fir_instance_q7;
<> 133:99b5ccf27215 1087
<> 133:99b5ccf27215 1088 /**
<> 133:99b5ccf27215 1089 * @brief Instance structure for the Q15 FIR filter.
<> 133:99b5ccf27215 1090 */
<> 133:99b5ccf27215 1091 typedef struct
<> 133:99b5ccf27215 1092 {
<> 133:99b5ccf27215 1093 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 133:99b5ccf27215 1094 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 1095 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 1096 } arm_fir_instance_q15;
<> 133:99b5ccf27215 1097
<> 133:99b5ccf27215 1098 /**
<> 133:99b5ccf27215 1099 * @brief Instance structure for the Q31 FIR filter.
<> 133:99b5ccf27215 1100 */
<> 133:99b5ccf27215 1101 typedef struct
<> 133:99b5ccf27215 1102 {
<> 133:99b5ccf27215 1103 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 133:99b5ccf27215 1104 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 1105 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 1106 } arm_fir_instance_q31;
<> 133:99b5ccf27215 1107
<> 133:99b5ccf27215 1108 /**
<> 133:99b5ccf27215 1109 * @brief Instance structure for the floating-point FIR filter.
<> 133:99b5ccf27215 1110 */
<> 133:99b5ccf27215 1111 typedef struct
<> 133:99b5ccf27215 1112 {
<> 133:99b5ccf27215 1113 uint16_t numTaps; /**< number of filter coefficients in the filter. */
<> 133:99b5ccf27215 1114 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 1115 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 1116 } arm_fir_instance_f32;
<> 133:99b5ccf27215 1117
<> 133:99b5ccf27215 1118
<> 133:99b5ccf27215 1119 /**
<> 133:99b5ccf27215 1120 * @brief Processing function for the Q7 FIR filter.
<> 133:99b5ccf27215 1121 * @param[in] *S points to an instance of the Q7 FIR filter structure.
<> 133:99b5ccf27215 1122 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1123 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1124 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1125 * @return none.
<> 133:99b5ccf27215 1126 */
<> 133:99b5ccf27215 1127 void arm_fir_q7(
<> 133:99b5ccf27215 1128 const arm_fir_instance_q7 * S,
<> 133:99b5ccf27215 1129 q7_t * pSrc,
<> 133:99b5ccf27215 1130 q7_t * pDst,
<> 133:99b5ccf27215 1131 uint32_t blockSize);
<> 133:99b5ccf27215 1132
<> 133:99b5ccf27215 1133
<> 133:99b5ccf27215 1134 /**
<> 133:99b5ccf27215 1135 * @brief Initialization function for the Q7 FIR filter.
<> 133:99b5ccf27215 1136 * @param[in,out] *S points to an instance of the Q7 FIR structure.
<> 133:99b5ccf27215 1137 * @param[in] numTaps Number of filter coefficients in the filter.
<> 133:99b5ccf27215 1138 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1139 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1140 * @param[in] blockSize number of samples that are processed.
<> 133:99b5ccf27215 1141 * @return none
<> 133:99b5ccf27215 1142 */
<> 133:99b5ccf27215 1143 void arm_fir_init_q7(
<> 133:99b5ccf27215 1144 arm_fir_instance_q7 * S,
<> 133:99b5ccf27215 1145 uint16_t numTaps,
<> 133:99b5ccf27215 1146 q7_t * pCoeffs,
<> 133:99b5ccf27215 1147 q7_t * pState,
<> 133:99b5ccf27215 1148 uint32_t blockSize);
<> 133:99b5ccf27215 1149
<> 133:99b5ccf27215 1150
<> 133:99b5ccf27215 1151 /**
<> 133:99b5ccf27215 1152 * @brief Processing function for the Q15 FIR filter.
<> 133:99b5ccf27215 1153 * @param[in] *S points to an instance of the Q15 FIR structure.
<> 133:99b5ccf27215 1154 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1155 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1156 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1157 * @return none.
<> 133:99b5ccf27215 1158 */
<> 133:99b5ccf27215 1159 void arm_fir_q15(
<> 133:99b5ccf27215 1160 const arm_fir_instance_q15 * S,
<> 133:99b5ccf27215 1161 q15_t * pSrc,
<> 133:99b5ccf27215 1162 q15_t * pDst,
<> 133:99b5ccf27215 1163 uint32_t blockSize);
<> 133:99b5ccf27215 1164
<> 133:99b5ccf27215 1165 /**
<> 133:99b5ccf27215 1166 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 1167 * @param[in] *S points to an instance of the Q15 FIR filter structure.
<> 133:99b5ccf27215 1168 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1169 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1170 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1171 * @return none.
<> 133:99b5ccf27215 1172 */
<> 133:99b5ccf27215 1173 void arm_fir_fast_q15(
<> 133:99b5ccf27215 1174 const arm_fir_instance_q15 * S,
<> 133:99b5ccf27215 1175 q15_t * pSrc,
<> 133:99b5ccf27215 1176 q15_t * pDst,
<> 133:99b5ccf27215 1177 uint32_t blockSize);
<> 133:99b5ccf27215 1178
<> 133:99b5ccf27215 1179 /**
<> 133:99b5ccf27215 1180 * @brief Initialization function for the Q15 FIR filter.
<> 133:99b5ccf27215 1181 * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
<> 133:99b5ccf27215 1182 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
<> 133:99b5ccf27215 1183 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1184 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1185 * @param[in] blockSize number of samples that are processed at a time.
<> 133:99b5ccf27215 1186 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
<> 133:99b5ccf27215 1187 * <code>numTaps</code> is not a supported value.
<> 133:99b5ccf27215 1188 */
<> 133:99b5ccf27215 1189
<> 133:99b5ccf27215 1190 arm_status arm_fir_init_q15(
<> 133:99b5ccf27215 1191 arm_fir_instance_q15 * S,
<> 133:99b5ccf27215 1192 uint16_t numTaps,
<> 133:99b5ccf27215 1193 q15_t * pCoeffs,
<> 133:99b5ccf27215 1194 q15_t * pState,
<> 133:99b5ccf27215 1195 uint32_t blockSize);
<> 133:99b5ccf27215 1196
<> 133:99b5ccf27215 1197 /**
<> 133:99b5ccf27215 1198 * @brief Processing function for the Q31 FIR filter.
<> 133:99b5ccf27215 1199 * @param[in] *S points to an instance of the Q31 FIR filter structure.
<> 133:99b5ccf27215 1200 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1201 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1202 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1203 * @return none.
<> 133:99b5ccf27215 1204 */
<> 133:99b5ccf27215 1205 void arm_fir_q31(
<> 133:99b5ccf27215 1206 const arm_fir_instance_q31 * S,
<> 133:99b5ccf27215 1207 q31_t * pSrc,
<> 133:99b5ccf27215 1208 q31_t * pDst,
<> 133:99b5ccf27215 1209 uint32_t blockSize);
<> 133:99b5ccf27215 1210
<> 133:99b5ccf27215 1211 /**
<> 133:99b5ccf27215 1212 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 1213 * @param[in] *S points to an instance of the Q31 FIR structure.
<> 133:99b5ccf27215 1214 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1215 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1216 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1217 * @return none.
<> 133:99b5ccf27215 1218 */
<> 133:99b5ccf27215 1219 void arm_fir_fast_q31(
<> 133:99b5ccf27215 1220 const arm_fir_instance_q31 * S,
<> 133:99b5ccf27215 1221 q31_t * pSrc,
<> 133:99b5ccf27215 1222 q31_t * pDst,
<> 133:99b5ccf27215 1223 uint32_t blockSize);
<> 133:99b5ccf27215 1224
<> 133:99b5ccf27215 1225 /**
<> 133:99b5ccf27215 1226 * @brief Initialization function for the Q31 FIR filter.
<> 133:99b5ccf27215 1227 * @param[in,out] *S points to an instance of the Q31 FIR structure.
<> 133:99b5ccf27215 1228 * @param[in] numTaps Number of filter coefficients in the filter.
<> 133:99b5ccf27215 1229 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1230 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1231 * @param[in] blockSize number of samples that are processed at a time.
<> 133:99b5ccf27215 1232 * @return none.
<> 133:99b5ccf27215 1233 */
<> 133:99b5ccf27215 1234 void arm_fir_init_q31(
<> 133:99b5ccf27215 1235 arm_fir_instance_q31 * S,
<> 133:99b5ccf27215 1236 uint16_t numTaps,
<> 133:99b5ccf27215 1237 q31_t * pCoeffs,
<> 133:99b5ccf27215 1238 q31_t * pState,
<> 133:99b5ccf27215 1239 uint32_t blockSize);
<> 133:99b5ccf27215 1240
<> 133:99b5ccf27215 1241 /**
<> 133:99b5ccf27215 1242 * @brief Processing function for the floating-point FIR filter.
<> 133:99b5ccf27215 1243 * @param[in] *S points to an instance of the floating-point FIR structure.
<> 133:99b5ccf27215 1244 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1245 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1246 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1247 * @return none.
<> 133:99b5ccf27215 1248 */
<> 133:99b5ccf27215 1249 void arm_fir_f32(
<> 133:99b5ccf27215 1250 const arm_fir_instance_f32 * S,
<> 133:99b5ccf27215 1251 float32_t * pSrc,
<> 133:99b5ccf27215 1252 float32_t * pDst,
<> 133:99b5ccf27215 1253 uint32_t blockSize);
<> 133:99b5ccf27215 1254
<> 133:99b5ccf27215 1255 /**
<> 133:99b5ccf27215 1256 * @brief Initialization function for the floating-point FIR filter.
<> 133:99b5ccf27215 1257 * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
<> 133:99b5ccf27215 1258 * @param[in] numTaps Number of filter coefficients in the filter.
<> 133:99b5ccf27215 1259 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1260 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1261 * @param[in] blockSize number of samples that are processed at a time.
<> 133:99b5ccf27215 1262 * @return none.
<> 133:99b5ccf27215 1263 */
<> 133:99b5ccf27215 1264 void arm_fir_init_f32(
<> 133:99b5ccf27215 1265 arm_fir_instance_f32 * S,
<> 133:99b5ccf27215 1266 uint16_t numTaps,
<> 133:99b5ccf27215 1267 float32_t * pCoeffs,
<> 133:99b5ccf27215 1268 float32_t * pState,
<> 133:99b5ccf27215 1269 uint32_t blockSize);
<> 133:99b5ccf27215 1270
<> 133:99b5ccf27215 1271
<> 133:99b5ccf27215 1272 /**
<> 133:99b5ccf27215 1273 * @brief Instance structure for the Q15 Biquad cascade filter.
<> 133:99b5ccf27215 1274 */
<> 133:99b5ccf27215 1275 typedef struct
<> 133:99b5ccf27215 1276 {
<> 133:99b5ccf27215 1277 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 1278 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 133:99b5ccf27215 1279 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 1280 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 133:99b5ccf27215 1281
<> 133:99b5ccf27215 1282 } arm_biquad_casd_df1_inst_q15;
<> 133:99b5ccf27215 1283
<> 133:99b5ccf27215 1284
<> 133:99b5ccf27215 1285 /**
<> 133:99b5ccf27215 1286 * @brief Instance structure for the Q31 Biquad cascade filter.
<> 133:99b5ccf27215 1287 */
<> 133:99b5ccf27215 1288 typedef struct
<> 133:99b5ccf27215 1289 {
<> 133:99b5ccf27215 1290 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 1291 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 133:99b5ccf27215 1292 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 1293 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
<> 133:99b5ccf27215 1294
<> 133:99b5ccf27215 1295 } arm_biquad_casd_df1_inst_q31;
<> 133:99b5ccf27215 1296
<> 133:99b5ccf27215 1297 /**
<> 133:99b5ccf27215 1298 * @brief Instance structure for the floating-point Biquad cascade filter.
<> 133:99b5ccf27215 1299 */
<> 133:99b5ccf27215 1300 typedef struct
<> 133:99b5ccf27215 1301 {
<> 133:99b5ccf27215 1302 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 1303 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
<> 133:99b5ccf27215 1304 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 1305
<> 133:99b5ccf27215 1306
<> 133:99b5ccf27215 1307 } arm_biquad_casd_df1_inst_f32;
<> 133:99b5ccf27215 1308
<> 133:99b5ccf27215 1309
<> 133:99b5ccf27215 1310
<> 133:99b5ccf27215 1311 /**
<> 133:99b5ccf27215 1312 * @brief Processing function for the Q15 Biquad cascade filter.
<> 133:99b5ccf27215 1313 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 133:99b5ccf27215 1314 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1315 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1316 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1317 * @return none.
<> 133:99b5ccf27215 1318 */
<> 133:99b5ccf27215 1319
<> 133:99b5ccf27215 1320 void arm_biquad_cascade_df1_q15(
<> 133:99b5ccf27215 1321 const arm_biquad_casd_df1_inst_q15 * S,
<> 133:99b5ccf27215 1322 q15_t * pSrc,
<> 133:99b5ccf27215 1323 q15_t * pDst,
<> 133:99b5ccf27215 1324 uint32_t blockSize);
<> 133:99b5ccf27215 1325
<> 133:99b5ccf27215 1326 /**
<> 133:99b5ccf27215 1327 * @brief Initialization function for the Q15 Biquad cascade filter.
<> 133:99b5ccf27215 1328 * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure.
<> 133:99b5ccf27215 1329 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 1330 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1331 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1332 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 133:99b5ccf27215 1333 * @return none
<> 133:99b5ccf27215 1334 */
<> 133:99b5ccf27215 1335
<> 133:99b5ccf27215 1336 void arm_biquad_cascade_df1_init_q15(
<> 133:99b5ccf27215 1337 arm_biquad_casd_df1_inst_q15 * S,
<> 133:99b5ccf27215 1338 uint8_t numStages,
<> 133:99b5ccf27215 1339 q15_t * pCoeffs,
<> 133:99b5ccf27215 1340 q15_t * pState,
<> 133:99b5ccf27215 1341 int8_t postShift);
<> 133:99b5ccf27215 1342
<> 133:99b5ccf27215 1343
<> 133:99b5ccf27215 1344 /**
<> 133:99b5ccf27215 1345 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 1346 * @param[in] *S points to an instance of the Q15 Biquad cascade structure.
<> 133:99b5ccf27215 1347 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1348 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1349 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1350 * @return none.
<> 133:99b5ccf27215 1351 */
<> 133:99b5ccf27215 1352
<> 133:99b5ccf27215 1353 void arm_biquad_cascade_df1_fast_q15(
<> 133:99b5ccf27215 1354 const arm_biquad_casd_df1_inst_q15 * S,
<> 133:99b5ccf27215 1355 q15_t * pSrc,
<> 133:99b5ccf27215 1356 q15_t * pDst,
<> 133:99b5ccf27215 1357 uint32_t blockSize);
<> 133:99b5ccf27215 1358
<> 133:99b5ccf27215 1359
<> 133:99b5ccf27215 1360 /**
<> 133:99b5ccf27215 1361 * @brief Processing function for the Q31 Biquad cascade filter
<> 133:99b5ccf27215 1362 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 133:99b5ccf27215 1363 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1364 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1365 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1366 * @return none.
<> 133:99b5ccf27215 1367 */
<> 133:99b5ccf27215 1368
<> 133:99b5ccf27215 1369 void arm_biquad_cascade_df1_q31(
<> 133:99b5ccf27215 1370 const arm_biquad_casd_df1_inst_q31 * S,
<> 133:99b5ccf27215 1371 q31_t * pSrc,
<> 133:99b5ccf27215 1372 q31_t * pDst,
<> 133:99b5ccf27215 1373 uint32_t blockSize);
<> 133:99b5ccf27215 1374
<> 133:99b5ccf27215 1375 /**
<> 133:99b5ccf27215 1376 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 1377 * @param[in] *S points to an instance of the Q31 Biquad cascade structure.
<> 133:99b5ccf27215 1378 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1379 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1380 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1381 * @return none.
<> 133:99b5ccf27215 1382 */
<> 133:99b5ccf27215 1383
<> 133:99b5ccf27215 1384 void arm_biquad_cascade_df1_fast_q31(
<> 133:99b5ccf27215 1385 const arm_biquad_casd_df1_inst_q31 * S,
<> 133:99b5ccf27215 1386 q31_t * pSrc,
<> 133:99b5ccf27215 1387 q31_t * pDst,
<> 133:99b5ccf27215 1388 uint32_t blockSize);
<> 133:99b5ccf27215 1389
<> 133:99b5ccf27215 1390 /**
<> 133:99b5ccf27215 1391 * @brief Initialization function for the Q31 Biquad cascade filter.
<> 133:99b5ccf27215 1392 * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure.
<> 133:99b5ccf27215 1393 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 1394 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1395 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1396 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format
<> 133:99b5ccf27215 1397 * @return none
<> 133:99b5ccf27215 1398 */
<> 133:99b5ccf27215 1399
<> 133:99b5ccf27215 1400 void arm_biquad_cascade_df1_init_q31(
<> 133:99b5ccf27215 1401 arm_biquad_casd_df1_inst_q31 * S,
<> 133:99b5ccf27215 1402 uint8_t numStages,
<> 133:99b5ccf27215 1403 q31_t * pCoeffs,
<> 133:99b5ccf27215 1404 q31_t * pState,
<> 133:99b5ccf27215 1405 int8_t postShift);
<> 133:99b5ccf27215 1406
<> 133:99b5ccf27215 1407 /**
<> 133:99b5ccf27215 1408 * @brief Processing function for the floating-point Biquad cascade filter.
<> 133:99b5ccf27215 1409 * @param[in] *S points to an instance of the floating-point Biquad cascade structure.
<> 133:99b5ccf27215 1410 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 1411 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 1412 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 1413 * @return none.
<> 133:99b5ccf27215 1414 */
<> 133:99b5ccf27215 1415
<> 133:99b5ccf27215 1416 void arm_biquad_cascade_df1_f32(
<> 133:99b5ccf27215 1417 const arm_biquad_casd_df1_inst_f32 * S,
<> 133:99b5ccf27215 1418 float32_t * pSrc,
<> 133:99b5ccf27215 1419 float32_t * pDst,
<> 133:99b5ccf27215 1420 uint32_t blockSize);
<> 133:99b5ccf27215 1421
<> 133:99b5ccf27215 1422 /**
<> 133:99b5ccf27215 1423 * @brief Initialization function for the floating-point Biquad cascade filter.
<> 133:99b5ccf27215 1424 * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure.
<> 133:99b5ccf27215 1425 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 1426 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 1427 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 1428 * @return none
<> 133:99b5ccf27215 1429 */
<> 133:99b5ccf27215 1430
<> 133:99b5ccf27215 1431 void arm_biquad_cascade_df1_init_f32(
<> 133:99b5ccf27215 1432 arm_biquad_casd_df1_inst_f32 * S,
<> 133:99b5ccf27215 1433 uint8_t numStages,
<> 133:99b5ccf27215 1434 float32_t * pCoeffs,
<> 133:99b5ccf27215 1435 float32_t * pState);
<> 133:99b5ccf27215 1436
<> 133:99b5ccf27215 1437
<> 133:99b5ccf27215 1438 /**
<> 133:99b5ccf27215 1439 * @brief Instance structure for the floating-point matrix structure.
<> 133:99b5ccf27215 1440 */
<> 133:99b5ccf27215 1441
<> 133:99b5ccf27215 1442 typedef struct
<> 133:99b5ccf27215 1443 {
<> 133:99b5ccf27215 1444 uint16_t numRows; /**< number of rows of the matrix. */
<> 133:99b5ccf27215 1445 uint16_t numCols; /**< number of columns of the matrix. */
<> 133:99b5ccf27215 1446 float32_t *pData; /**< points to the data of the matrix. */
<> 133:99b5ccf27215 1447 } arm_matrix_instance_f32;
<> 133:99b5ccf27215 1448
<> 133:99b5ccf27215 1449
<> 133:99b5ccf27215 1450 /**
<> 133:99b5ccf27215 1451 * @brief Instance structure for the floating-point matrix structure.
<> 133:99b5ccf27215 1452 */
<> 133:99b5ccf27215 1453
<> 133:99b5ccf27215 1454 typedef struct
<> 133:99b5ccf27215 1455 {
<> 133:99b5ccf27215 1456 uint16_t numRows; /**< number of rows of the matrix. */
<> 133:99b5ccf27215 1457 uint16_t numCols; /**< number of columns of the matrix. */
<> 133:99b5ccf27215 1458 float64_t *pData; /**< points to the data of the matrix. */
<> 133:99b5ccf27215 1459 } arm_matrix_instance_f64;
<> 133:99b5ccf27215 1460
<> 133:99b5ccf27215 1461 /**
<> 133:99b5ccf27215 1462 * @brief Instance structure for the Q15 matrix structure.
<> 133:99b5ccf27215 1463 */
<> 133:99b5ccf27215 1464
<> 133:99b5ccf27215 1465 typedef struct
<> 133:99b5ccf27215 1466 {
<> 133:99b5ccf27215 1467 uint16_t numRows; /**< number of rows of the matrix. */
<> 133:99b5ccf27215 1468 uint16_t numCols; /**< number of columns of the matrix. */
<> 133:99b5ccf27215 1469 q15_t *pData; /**< points to the data of the matrix. */
<> 133:99b5ccf27215 1470
<> 133:99b5ccf27215 1471 } arm_matrix_instance_q15;
<> 133:99b5ccf27215 1472
<> 133:99b5ccf27215 1473 /**
<> 133:99b5ccf27215 1474 * @brief Instance structure for the Q31 matrix structure.
<> 133:99b5ccf27215 1475 */
<> 133:99b5ccf27215 1476
<> 133:99b5ccf27215 1477 typedef struct
<> 133:99b5ccf27215 1478 {
<> 133:99b5ccf27215 1479 uint16_t numRows; /**< number of rows of the matrix. */
<> 133:99b5ccf27215 1480 uint16_t numCols; /**< number of columns of the matrix. */
<> 133:99b5ccf27215 1481 q31_t *pData; /**< points to the data of the matrix. */
<> 133:99b5ccf27215 1482
<> 133:99b5ccf27215 1483 } arm_matrix_instance_q31;
<> 133:99b5ccf27215 1484
<> 133:99b5ccf27215 1485
<> 133:99b5ccf27215 1486
<> 133:99b5ccf27215 1487 /**
<> 133:99b5ccf27215 1488 * @brief Floating-point matrix addition.
<> 133:99b5ccf27215 1489 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1490 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1491 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1492 * @return The function returns either
<> 133:99b5ccf27215 1493 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1494 */
<> 133:99b5ccf27215 1495
<> 133:99b5ccf27215 1496 arm_status arm_mat_add_f32(
<> 133:99b5ccf27215 1497 const arm_matrix_instance_f32 * pSrcA,
<> 133:99b5ccf27215 1498 const arm_matrix_instance_f32 * pSrcB,
<> 133:99b5ccf27215 1499 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1500
<> 133:99b5ccf27215 1501 /**
<> 133:99b5ccf27215 1502 * @brief Q15 matrix addition.
<> 133:99b5ccf27215 1503 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1504 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1505 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1506 * @return The function returns either
<> 133:99b5ccf27215 1507 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1508 */
<> 133:99b5ccf27215 1509
<> 133:99b5ccf27215 1510 arm_status arm_mat_add_q15(
<> 133:99b5ccf27215 1511 const arm_matrix_instance_q15 * pSrcA,
<> 133:99b5ccf27215 1512 const arm_matrix_instance_q15 * pSrcB,
<> 133:99b5ccf27215 1513 arm_matrix_instance_q15 * pDst);
<> 133:99b5ccf27215 1514
<> 133:99b5ccf27215 1515 /**
<> 133:99b5ccf27215 1516 * @brief Q31 matrix addition.
<> 133:99b5ccf27215 1517 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1518 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1519 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1520 * @return The function returns either
<> 133:99b5ccf27215 1521 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1522 */
<> 133:99b5ccf27215 1523
<> 133:99b5ccf27215 1524 arm_status arm_mat_add_q31(
<> 133:99b5ccf27215 1525 const arm_matrix_instance_q31 * pSrcA,
<> 133:99b5ccf27215 1526 const arm_matrix_instance_q31 * pSrcB,
<> 133:99b5ccf27215 1527 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1528
<> 133:99b5ccf27215 1529 /**
<> 133:99b5ccf27215 1530 * @brief Floating-point, complex, matrix multiplication.
<> 133:99b5ccf27215 1531 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1532 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1533 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1534 * @return The function returns either
<> 133:99b5ccf27215 1535 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1536 */
<> 133:99b5ccf27215 1537
<> 133:99b5ccf27215 1538 arm_status arm_mat_cmplx_mult_f32(
<> 133:99b5ccf27215 1539 const arm_matrix_instance_f32 * pSrcA,
<> 133:99b5ccf27215 1540 const arm_matrix_instance_f32 * pSrcB,
<> 133:99b5ccf27215 1541 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1542
<> 133:99b5ccf27215 1543 /**
<> 133:99b5ccf27215 1544 * @brief Q15, complex, matrix multiplication.
<> 133:99b5ccf27215 1545 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1546 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1547 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1548 * @return The function returns either
<> 133:99b5ccf27215 1549 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1550 */
<> 133:99b5ccf27215 1551
<> 133:99b5ccf27215 1552 arm_status arm_mat_cmplx_mult_q15(
<> 133:99b5ccf27215 1553 const arm_matrix_instance_q15 * pSrcA,
<> 133:99b5ccf27215 1554 const arm_matrix_instance_q15 * pSrcB,
<> 133:99b5ccf27215 1555 arm_matrix_instance_q15 * pDst,
<> 133:99b5ccf27215 1556 q15_t * pScratch);
<> 133:99b5ccf27215 1557
<> 133:99b5ccf27215 1558 /**
<> 133:99b5ccf27215 1559 * @brief Q31, complex, matrix multiplication.
<> 133:99b5ccf27215 1560 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1561 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1562 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1563 * @return The function returns either
<> 133:99b5ccf27215 1564 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1565 */
<> 133:99b5ccf27215 1566
<> 133:99b5ccf27215 1567 arm_status arm_mat_cmplx_mult_q31(
<> 133:99b5ccf27215 1568 const arm_matrix_instance_q31 * pSrcA,
<> 133:99b5ccf27215 1569 const arm_matrix_instance_q31 * pSrcB,
<> 133:99b5ccf27215 1570 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1571
<> 133:99b5ccf27215 1572
<> 133:99b5ccf27215 1573 /**
<> 133:99b5ccf27215 1574 * @brief Floating-point matrix transpose.
<> 133:99b5ccf27215 1575 * @param[in] *pSrc points to the input matrix
<> 133:99b5ccf27215 1576 * @param[out] *pDst points to the output matrix
<> 133:99b5ccf27215 1577 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 133:99b5ccf27215 1578 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1579 */
<> 133:99b5ccf27215 1580
<> 133:99b5ccf27215 1581 arm_status arm_mat_trans_f32(
<> 133:99b5ccf27215 1582 const arm_matrix_instance_f32 * pSrc,
<> 133:99b5ccf27215 1583 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1584
<> 133:99b5ccf27215 1585
<> 133:99b5ccf27215 1586 /**
<> 133:99b5ccf27215 1587 * @brief Q15 matrix transpose.
<> 133:99b5ccf27215 1588 * @param[in] *pSrc points to the input matrix
<> 133:99b5ccf27215 1589 * @param[out] *pDst points to the output matrix
<> 133:99b5ccf27215 1590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 133:99b5ccf27215 1591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1592 */
<> 133:99b5ccf27215 1593
<> 133:99b5ccf27215 1594 arm_status arm_mat_trans_q15(
<> 133:99b5ccf27215 1595 const arm_matrix_instance_q15 * pSrc,
<> 133:99b5ccf27215 1596 arm_matrix_instance_q15 * pDst);
<> 133:99b5ccf27215 1597
<> 133:99b5ccf27215 1598 /**
<> 133:99b5ccf27215 1599 * @brief Q31 matrix transpose.
<> 133:99b5ccf27215 1600 * @param[in] *pSrc points to the input matrix
<> 133:99b5ccf27215 1601 * @param[out] *pDst points to the output matrix
<> 133:99b5ccf27215 1602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code>
<> 133:99b5ccf27215 1603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1604 */
<> 133:99b5ccf27215 1605
<> 133:99b5ccf27215 1606 arm_status arm_mat_trans_q31(
<> 133:99b5ccf27215 1607 const arm_matrix_instance_q31 * pSrc,
<> 133:99b5ccf27215 1608 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1609
<> 133:99b5ccf27215 1610
<> 133:99b5ccf27215 1611 /**
<> 133:99b5ccf27215 1612 * @brief Floating-point matrix multiplication
<> 133:99b5ccf27215 1613 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1614 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1615 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1616 * @return The function returns either
<> 133:99b5ccf27215 1617 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1618 */
<> 133:99b5ccf27215 1619
<> 133:99b5ccf27215 1620 arm_status arm_mat_mult_f32(
<> 133:99b5ccf27215 1621 const arm_matrix_instance_f32 * pSrcA,
<> 133:99b5ccf27215 1622 const arm_matrix_instance_f32 * pSrcB,
<> 133:99b5ccf27215 1623 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1624
<> 133:99b5ccf27215 1625 /**
<> 133:99b5ccf27215 1626 * @brief Q15 matrix multiplication
<> 133:99b5ccf27215 1627 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1628 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1629 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1630 * @param[in] *pState points to the array for storing intermediate results
<> 133:99b5ccf27215 1631 * @return The function returns either
<> 133:99b5ccf27215 1632 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1633 */
<> 133:99b5ccf27215 1634
<> 133:99b5ccf27215 1635 arm_status arm_mat_mult_q15(
<> 133:99b5ccf27215 1636 const arm_matrix_instance_q15 * pSrcA,
<> 133:99b5ccf27215 1637 const arm_matrix_instance_q15 * pSrcB,
<> 133:99b5ccf27215 1638 arm_matrix_instance_q15 * pDst,
<> 133:99b5ccf27215 1639 q15_t * pState);
<> 133:99b5ccf27215 1640
<> 133:99b5ccf27215 1641 /**
<> 133:99b5ccf27215 1642 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 1643 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1644 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1645 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1646 * @param[in] *pState points to the array for storing intermediate results
<> 133:99b5ccf27215 1647 * @return The function returns either
<> 133:99b5ccf27215 1648 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1649 */
<> 133:99b5ccf27215 1650
<> 133:99b5ccf27215 1651 arm_status arm_mat_mult_fast_q15(
<> 133:99b5ccf27215 1652 const arm_matrix_instance_q15 * pSrcA,
<> 133:99b5ccf27215 1653 const arm_matrix_instance_q15 * pSrcB,
<> 133:99b5ccf27215 1654 arm_matrix_instance_q15 * pDst,
<> 133:99b5ccf27215 1655 q15_t * pState);
<> 133:99b5ccf27215 1656
<> 133:99b5ccf27215 1657 /**
<> 133:99b5ccf27215 1658 * @brief Q31 matrix multiplication
<> 133:99b5ccf27215 1659 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1660 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1661 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1662 * @return The function returns either
<> 133:99b5ccf27215 1663 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1664 */
<> 133:99b5ccf27215 1665
<> 133:99b5ccf27215 1666 arm_status arm_mat_mult_q31(
<> 133:99b5ccf27215 1667 const arm_matrix_instance_q31 * pSrcA,
<> 133:99b5ccf27215 1668 const arm_matrix_instance_q31 * pSrcB,
<> 133:99b5ccf27215 1669 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1670
<> 133:99b5ccf27215 1671 /**
<> 133:99b5ccf27215 1672 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 1673 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1674 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1675 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1676 * @return The function returns either
<> 133:99b5ccf27215 1677 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1678 */
<> 133:99b5ccf27215 1679
<> 133:99b5ccf27215 1680 arm_status arm_mat_mult_fast_q31(
<> 133:99b5ccf27215 1681 const arm_matrix_instance_q31 * pSrcA,
<> 133:99b5ccf27215 1682 const arm_matrix_instance_q31 * pSrcB,
<> 133:99b5ccf27215 1683 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1684
<> 133:99b5ccf27215 1685
<> 133:99b5ccf27215 1686 /**
<> 133:99b5ccf27215 1687 * @brief Floating-point matrix subtraction
<> 133:99b5ccf27215 1688 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1689 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1690 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1691 * @return The function returns either
<> 133:99b5ccf27215 1692 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1693 */
<> 133:99b5ccf27215 1694
<> 133:99b5ccf27215 1695 arm_status arm_mat_sub_f32(
<> 133:99b5ccf27215 1696 const arm_matrix_instance_f32 * pSrcA,
<> 133:99b5ccf27215 1697 const arm_matrix_instance_f32 * pSrcB,
<> 133:99b5ccf27215 1698 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1699
<> 133:99b5ccf27215 1700 /**
<> 133:99b5ccf27215 1701 * @brief Q15 matrix subtraction
<> 133:99b5ccf27215 1702 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1703 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1704 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1705 * @return The function returns either
<> 133:99b5ccf27215 1706 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1707 */
<> 133:99b5ccf27215 1708
<> 133:99b5ccf27215 1709 arm_status arm_mat_sub_q15(
<> 133:99b5ccf27215 1710 const arm_matrix_instance_q15 * pSrcA,
<> 133:99b5ccf27215 1711 const arm_matrix_instance_q15 * pSrcB,
<> 133:99b5ccf27215 1712 arm_matrix_instance_q15 * pDst);
<> 133:99b5ccf27215 1713
<> 133:99b5ccf27215 1714 /**
<> 133:99b5ccf27215 1715 * @brief Q31 matrix subtraction
<> 133:99b5ccf27215 1716 * @param[in] *pSrcA points to the first input matrix structure
<> 133:99b5ccf27215 1717 * @param[in] *pSrcB points to the second input matrix structure
<> 133:99b5ccf27215 1718 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1719 * @return The function returns either
<> 133:99b5ccf27215 1720 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1721 */
<> 133:99b5ccf27215 1722
<> 133:99b5ccf27215 1723 arm_status arm_mat_sub_q31(
<> 133:99b5ccf27215 1724 const arm_matrix_instance_q31 * pSrcA,
<> 133:99b5ccf27215 1725 const arm_matrix_instance_q31 * pSrcB,
<> 133:99b5ccf27215 1726 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1727
<> 133:99b5ccf27215 1728 /**
<> 133:99b5ccf27215 1729 * @brief Floating-point matrix scaling.
<> 133:99b5ccf27215 1730 * @param[in] *pSrc points to the input matrix
<> 133:99b5ccf27215 1731 * @param[in] scale scale factor
<> 133:99b5ccf27215 1732 * @param[out] *pDst points to the output matrix
<> 133:99b5ccf27215 1733 * @return The function returns either
<> 133:99b5ccf27215 1734 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1735 */
<> 133:99b5ccf27215 1736
<> 133:99b5ccf27215 1737 arm_status arm_mat_scale_f32(
<> 133:99b5ccf27215 1738 const arm_matrix_instance_f32 * pSrc,
<> 133:99b5ccf27215 1739 float32_t scale,
<> 133:99b5ccf27215 1740 arm_matrix_instance_f32 * pDst);
<> 133:99b5ccf27215 1741
<> 133:99b5ccf27215 1742 /**
<> 133:99b5ccf27215 1743 * @brief Q15 matrix scaling.
<> 133:99b5ccf27215 1744 * @param[in] *pSrc points to input matrix
<> 133:99b5ccf27215 1745 * @param[in] scaleFract fractional portion of the scale factor
<> 133:99b5ccf27215 1746 * @param[in] shift number of bits to shift the result by
<> 133:99b5ccf27215 1747 * @param[out] *pDst points to output matrix
<> 133:99b5ccf27215 1748 * @return The function returns either
<> 133:99b5ccf27215 1749 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1750 */
<> 133:99b5ccf27215 1751
<> 133:99b5ccf27215 1752 arm_status arm_mat_scale_q15(
<> 133:99b5ccf27215 1753 const arm_matrix_instance_q15 * pSrc,
<> 133:99b5ccf27215 1754 q15_t scaleFract,
<> 133:99b5ccf27215 1755 int32_t shift,
<> 133:99b5ccf27215 1756 arm_matrix_instance_q15 * pDst);
<> 133:99b5ccf27215 1757
<> 133:99b5ccf27215 1758 /**
<> 133:99b5ccf27215 1759 * @brief Q31 matrix scaling.
<> 133:99b5ccf27215 1760 * @param[in] *pSrc points to input matrix
<> 133:99b5ccf27215 1761 * @param[in] scaleFract fractional portion of the scale factor
<> 133:99b5ccf27215 1762 * @param[in] shift number of bits to shift the result by
<> 133:99b5ccf27215 1763 * @param[out] *pDst points to output matrix structure
<> 133:99b5ccf27215 1764 * @return The function returns either
<> 133:99b5ccf27215 1765 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
<> 133:99b5ccf27215 1766 */
<> 133:99b5ccf27215 1767
<> 133:99b5ccf27215 1768 arm_status arm_mat_scale_q31(
<> 133:99b5ccf27215 1769 const arm_matrix_instance_q31 * pSrc,
<> 133:99b5ccf27215 1770 q31_t scaleFract,
<> 133:99b5ccf27215 1771 int32_t shift,
<> 133:99b5ccf27215 1772 arm_matrix_instance_q31 * pDst);
<> 133:99b5ccf27215 1773
<> 133:99b5ccf27215 1774
<> 133:99b5ccf27215 1775 /**
<> 133:99b5ccf27215 1776 * @brief Q31 matrix initialization.
<> 133:99b5ccf27215 1777 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 133:99b5ccf27215 1778 * @param[in] nRows number of rows in the matrix.
<> 133:99b5ccf27215 1779 * @param[in] nColumns number of columns in the matrix.
<> 133:99b5ccf27215 1780 * @param[in] *pData points to the matrix data array.
<> 133:99b5ccf27215 1781 * @return none
<> 133:99b5ccf27215 1782 */
<> 133:99b5ccf27215 1783
<> 133:99b5ccf27215 1784 void arm_mat_init_q31(
<> 133:99b5ccf27215 1785 arm_matrix_instance_q31 * S,
<> 133:99b5ccf27215 1786 uint16_t nRows,
<> 133:99b5ccf27215 1787 uint16_t nColumns,
<> 133:99b5ccf27215 1788 q31_t * pData);
<> 133:99b5ccf27215 1789
<> 133:99b5ccf27215 1790 /**
<> 133:99b5ccf27215 1791 * @brief Q15 matrix initialization.
<> 133:99b5ccf27215 1792 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 133:99b5ccf27215 1793 * @param[in] nRows number of rows in the matrix.
<> 133:99b5ccf27215 1794 * @param[in] nColumns number of columns in the matrix.
<> 133:99b5ccf27215 1795 * @param[in] *pData points to the matrix data array.
<> 133:99b5ccf27215 1796 * @return none
<> 133:99b5ccf27215 1797 */
<> 133:99b5ccf27215 1798
<> 133:99b5ccf27215 1799 void arm_mat_init_q15(
<> 133:99b5ccf27215 1800 arm_matrix_instance_q15 * S,
<> 133:99b5ccf27215 1801 uint16_t nRows,
<> 133:99b5ccf27215 1802 uint16_t nColumns,
<> 133:99b5ccf27215 1803 q15_t * pData);
<> 133:99b5ccf27215 1804
<> 133:99b5ccf27215 1805 /**
<> 133:99b5ccf27215 1806 * @brief Floating-point matrix initialization.
<> 133:99b5ccf27215 1807 * @param[in,out] *S points to an instance of the floating-point matrix structure.
<> 133:99b5ccf27215 1808 * @param[in] nRows number of rows in the matrix.
<> 133:99b5ccf27215 1809 * @param[in] nColumns number of columns in the matrix.
<> 133:99b5ccf27215 1810 * @param[in] *pData points to the matrix data array.
<> 133:99b5ccf27215 1811 * @return none
<> 133:99b5ccf27215 1812 */
<> 133:99b5ccf27215 1813
<> 133:99b5ccf27215 1814 void arm_mat_init_f32(
<> 133:99b5ccf27215 1815 arm_matrix_instance_f32 * S,
<> 133:99b5ccf27215 1816 uint16_t nRows,
<> 133:99b5ccf27215 1817 uint16_t nColumns,
<> 133:99b5ccf27215 1818 float32_t * pData);
<> 133:99b5ccf27215 1819
<> 133:99b5ccf27215 1820
<> 133:99b5ccf27215 1821
<> 133:99b5ccf27215 1822 /**
<> 133:99b5ccf27215 1823 * @brief Instance structure for the Q15 PID Control.
<> 133:99b5ccf27215 1824 */
<> 133:99b5ccf27215 1825 typedef struct
<> 133:99b5ccf27215 1826 {
<> 133:99b5ccf27215 1827 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 133:99b5ccf27215 1828 #ifdef ARM_MATH_CM0_FAMILY
<> 133:99b5ccf27215 1829 q15_t A1;
<> 133:99b5ccf27215 1830 q15_t A2;
<> 133:99b5ccf27215 1831 #else
<> 133:99b5ccf27215 1832 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
<> 133:99b5ccf27215 1833 #endif
<> 133:99b5ccf27215 1834 q15_t state[3]; /**< The state array of length 3. */
<> 133:99b5ccf27215 1835 q15_t Kp; /**< The proportional gain. */
<> 133:99b5ccf27215 1836 q15_t Ki; /**< The integral gain. */
<> 133:99b5ccf27215 1837 q15_t Kd; /**< The derivative gain. */
<> 133:99b5ccf27215 1838 } arm_pid_instance_q15;
<> 133:99b5ccf27215 1839
<> 133:99b5ccf27215 1840 /**
<> 133:99b5ccf27215 1841 * @brief Instance structure for the Q31 PID Control.
<> 133:99b5ccf27215 1842 */
<> 133:99b5ccf27215 1843 typedef struct
<> 133:99b5ccf27215 1844 {
<> 133:99b5ccf27215 1845 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 133:99b5ccf27215 1846 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 133:99b5ccf27215 1847 q31_t A2; /**< The derived gain, A2 = Kd . */
<> 133:99b5ccf27215 1848 q31_t state[3]; /**< The state array of length 3. */
<> 133:99b5ccf27215 1849 q31_t Kp; /**< The proportional gain. */
<> 133:99b5ccf27215 1850 q31_t Ki; /**< The integral gain. */
<> 133:99b5ccf27215 1851 q31_t Kd; /**< The derivative gain. */
<> 133:99b5ccf27215 1852
<> 133:99b5ccf27215 1853 } arm_pid_instance_q31;
<> 133:99b5ccf27215 1854
<> 133:99b5ccf27215 1855 /**
<> 133:99b5ccf27215 1856 * @brief Instance structure for the floating-point PID Control.
<> 133:99b5ccf27215 1857 */
<> 133:99b5ccf27215 1858 typedef struct
<> 133:99b5ccf27215 1859 {
<> 133:99b5ccf27215 1860 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */
<> 133:99b5ccf27215 1861 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */
<> 133:99b5ccf27215 1862 float32_t A2; /**< The derived gain, A2 = Kd . */
<> 133:99b5ccf27215 1863 float32_t state[3]; /**< The state array of length 3. */
<> 133:99b5ccf27215 1864 float32_t Kp; /**< The proportional gain. */
<> 133:99b5ccf27215 1865 float32_t Ki; /**< The integral gain. */
<> 133:99b5ccf27215 1866 float32_t Kd; /**< The derivative gain. */
<> 133:99b5ccf27215 1867 } arm_pid_instance_f32;
<> 133:99b5ccf27215 1868
<> 133:99b5ccf27215 1869
<> 133:99b5ccf27215 1870
<> 133:99b5ccf27215 1871 /**
<> 133:99b5ccf27215 1872 * @brief Initialization function for the floating-point PID Control.
<> 133:99b5ccf27215 1873 * @param[in,out] *S points to an instance of the PID structure.
<> 133:99b5ccf27215 1874 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 133:99b5ccf27215 1875 * @return none.
<> 133:99b5ccf27215 1876 */
<> 133:99b5ccf27215 1877 void arm_pid_init_f32(
<> 133:99b5ccf27215 1878 arm_pid_instance_f32 * S,
<> 133:99b5ccf27215 1879 int32_t resetStateFlag);
<> 133:99b5ccf27215 1880
<> 133:99b5ccf27215 1881 /**
<> 133:99b5ccf27215 1882 * @brief Reset function for the floating-point PID Control.
<> 133:99b5ccf27215 1883 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 133:99b5ccf27215 1884 * @return none
<> 133:99b5ccf27215 1885 */
<> 133:99b5ccf27215 1886 void arm_pid_reset_f32(
<> 133:99b5ccf27215 1887 arm_pid_instance_f32 * S);
<> 133:99b5ccf27215 1888
<> 133:99b5ccf27215 1889
<> 133:99b5ccf27215 1890 /**
<> 133:99b5ccf27215 1891 * @brief Initialization function for the Q31 PID Control.
<> 133:99b5ccf27215 1892 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 133:99b5ccf27215 1893 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 133:99b5ccf27215 1894 * @return none.
<> 133:99b5ccf27215 1895 */
<> 133:99b5ccf27215 1896 void arm_pid_init_q31(
<> 133:99b5ccf27215 1897 arm_pid_instance_q31 * S,
<> 133:99b5ccf27215 1898 int32_t resetStateFlag);
<> 133:99b5ccf27215 1899
<> 133:99b5ccf27215 1900
<> 133:99b5ccf27215 1901 /**
<> 133:99b5ccf27215 1902 * @brief Reset function for the Q31 PID Control.
<> 133:99b5ccf27215 1903 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 133:99b5ccf27215 1904 * @return none
<> 133:99b5ccf27215 1905 */
<> 133:99b5ccf27215 1906
<> 133:99b5ccf27215 1907 void arm_pid_reset_q31(
<> 133:99b5ccf27215 1908 arm_pid_instance_q31 * S);
<> 133:99b5ccf27215 1909
<> 133:99b5ccf27215 1910 /**
<> 133:99b5ccf27215 1911 * @brief Initialization function for the Q15 PID Control.
<> 133:99b5ccf27215 1912 * @param[in,out] *S points to an instance of the Q15 PID structure.
<> 133:99b5ccf27215 1913 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
<> 133:99b5ccf27215 1914 * @return none.
<> 133:99b5ccf27215 1915 */
<> 133:99b5ccf27215 1916 void arm_pid_init_q15(
<> 133:99b5ccf27215 1917 arm_pid_instance_q15 * S,
<> 133:99b5ccf27215 1918 int32_t resetStateFlag);
<> 133:99b5ccf27215 1919
<> 133:99b5ccf27215 1920 /**
<> 133:99b5ccf27215 1921 * @brief Reset function for the Q15 PID Control.
<> 133:99b5ccf27215 1922 * @param[in,out] *S points to an instance of the q15 PID Control structure
<> 133:99b5ccf27215 1923 * @return none
<> 133:99b5ccf27215 1924 */
<> 133:99b5ccf27215 1925 void arm_pid_reset_q15(
<> 133:99b5ccf27215 1926 arm_pid_instance_q15 * S);
<> 133:99b5ccf27215 1927
<> 133:99b5ccf27215 1928
<> 133:99b5ccf27215 1929 /**
<> 133:99b5ccf27215 1930 * @brief Instance structure for the floating-point Linear Interpolate function.
<> 133:99b5ccf27215 1931 */
<> 133:99b5ccf27215 1932 typedef struct
<> 133:99b5ccf27215 1933 {
<> 133:99b5ccf27215 1934 uint32_t nValues; /**< nValues */
<> 133:99b5ccf27215 1935 float32_t x1; /**< x1 */
<> 133:99b5ccf27215 1936 float32_t xSpacing; /**< xSpacing */
<> 133:99b5ccf27215 1937 float32_t *pYData; /**< pointer to the table of Y values */
<> 133:99b5ccf27215 1938 } arm_linear_interp_instance_f32;
<> 133:99b5ccf27215 1939
<> 133:99b5ccf27215 1940 /**
<> 133:99b5ccf27215 1941 * @brief Instance structure for the floating-point bilinear interpolation function.
<> 133:99b5ccf27215 1942 */
<> 133:99b5ccf27215 1943
<> 133:99b5ccf27215 1944 typedef struct
<> 133:99b5ccf27215 1945 {
<> 133:99b5ccf27215 1946 uint16_t numRows; /**< number of rows in the data table. */
<> 133:99b5ccf27215 1947 uint16_t numCols; /**< number of columns in the data table. */
<> 133:99b5ccf27215 1948 float32_t *pData; /**< points to the data table. */
<> 133:99b5ccf27215 1949 } arm_bilinear_interp_instance_f32;
<> 133:99b5ccf27215 1950
<> 133:99b5ccf27215 1951 /**
<> 133:99b5ccf27215 1952 * @brief Instance structure for the Q31 bilinear interpolation function.
<> 133:99b5ccf27215 1953 */
<> 133:99b5ccf27215 1954
<> 133:99b5ccf27215 1955 typedef struct
<> 133:99b5ccf27215 1956 {
<> 133:99b5ccf27215 1957 uint16_t numRows; /**< number of rows in the data table. */
<> 133:99b5ccf27215 1958 uint16_t numCols; /**< number of columns in the data table. */
<> 133:99b5ccf27215 1959 q31_t *pData; /**< points to the data table. */
<> 133:99b5ccf27215 1960 } arm_bilinear_interp_instance_q31;
<> 133:99b5ccf27215 1961
<> 133:99b5ccf27215 1962 /**
<> 133:99b5ccf27215 1963 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 133:99b5ccf27215 1964 */
<> 133:99b5ccf27215 1965
<> 133:99b5ccf27215 1966 typedef struct
<> 133:99b5ccf27215 1967 {
<> 133:99b5ccf27215 1968 uint16_t numRows; /**< number of rows in the data table. */
<> 133:99b5ccf27215 1969 uint16_t numCols; /**< number of columns in the data table. */
<> 133:99b5ccf27215 1970 q15_t *pData; /**< points to the data table. */
<> 133:99b5ccf27215 1971 } arm_bilinear_interp_instance_q15;
<> 133:99b5ccf27215 1972
<> 133:99b5ccf27215 1973 /**
<> 133:99b5ccf27215 1974 * @brief Instance structure for the Q15 bilinear interpolation function.
<> 133:99b5ccf27215 1975 */
<> 133:99b5ccf27215 1976
<> 133:99b5ccf27215 1977 typedef struct
<> 133:99b5ccf27215 1978 {
<> 133:99b5ccf27215 1979 uint16_t numRows; /**< number of rows in the data table. */
<> 133:99b5ccf27215 1980 uint16_t numCols; /**< number of columns in the data table. */
<> 133:99b5ccf27215 1981 q7_t *pData; /**< points to the data table. */
<> 133:99b5ccf27215 1982 } arm_bilinear_interp_instance_q7;
<> 133:99b5ccf27215 1983
<> 133:99b5ccf27215 1984
<> 133:99b5ccf27215 1985 /**
<> 133:99b5ccf27215 1986 * @brief Q7 vector multiplication.
<> 133:99b5ccf27215 1987 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 1988 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 1989 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 1990 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 1991 * @return none.
<> 133:99b5ccf27215 1992 */
<> 133:99b5ccf27215 1993
<> 133:99b5ccf27215 1994 void arm_mult_q7(
<> 133:99b5ccf27215 1995 q7_t * pSrcA,
<> 133:99b5ccf27215 1996 q7_t * pSrcB,
<> 133:99b5ccf27215 1997 q7_t * pDst,
<> 133:99b5ccf27215 1998 uint32_t blockSize);
<> 133:99b5ccf27215 1999
<> 133:99b5ccf27215 2000 /**
<> 133:99b5ccf27215 2001 * @brief Q15 vector multiplication.
<> 133:99b5ccf27215 2002 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2003 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2004 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2005 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2006 * @return none.
<> 133:99b5ccf27215 2007 */
<> 133:99b5ccf27215 2008
<> 133:99b5ccf27215 2009 void arm_mult_q15(
<> 133:99b5ccf27215 2010 q15_t * pSrcA,
<> 133:99b5ccf27215 2011 q15_t * pSrcB,
<> 133:99b5ccf27215 2012 q15_t * pDst,
<> 133:99b5ccf27215 2013 uint32_t blockSize);
<> 133:99b5ccf27215 2014
<> 133:99b5ccf27215 2015 /**
<> 133:99b5ccf27215 2016 * @brief Q31 vector multiplication.
<> 133:99b5ccf27215 2017 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2018 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2019 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2020 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2021 * @return none.
<> 133:99b5ccf27215 2022 */
<> 133:99b5ccf27215 2023
<> 133:99b5ccf27215 2024 void arm_mult_q31(
<> 133:99b5ccf27215 2025 q31_t * pSrcA,
<> 133:99b5ccf27215 2026 q31_t * pSrcB,
<> 133:99b5ccf27215 2027 q31_t * pDst,
<> 133:99b5ccf27215 2028 uint32_t blockSize);
<> 133:99b5ccf27215 2029
<> 133:99b5ccf27215 2030 /**
<> 133:99b5ccf27215 2031 * @brief Floating-point vector multiplication.
<> 133:99b5ccf27215 2032 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2033 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2034 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2035 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2036 * @return none.
<> 133:99b5ccf27215 2037 */
<> 133:99b5ccf27215 2038
<> 133:99b5ccf27215 2039 void arm_mult_f32(
<> 133:99b5ccf27215 2040 float32_t * pSrcA,
<> 133:99b5ccf27215 2041 float32_t * pSrcB,
<> 133:99b5ccf27215 2042 float32_t * pDst,
<> 133:99b5ccf27215 2043 uint32_t blockSize);
<> 133:99b5ccf27215 2044
<> 133:99b5ccf27215 2045
<> 133:99b5ccf27215 2046
<> 133:99b5ccf27215 2047
<> 133:99b5ccf27215 2048
<> 133:99b5ccf27215 2049
<> 133:99b5ccf27215 2050 /**
<> 133:99b5ccf27215 2051 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 133:99b5ccf27215 2052 */
<> 133:99b5ccf27215 2053
<> 133:99b5ccf27215 2054 typedef struct
<> 133:99b5ccf27215 2055 {
<> 133:99b5ccf27215 2056 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2057 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2058 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2059 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
<> 133:99b5ccf27215 2060 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2061 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2062 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2063 } arm_cfft_radix2_instance_q15;
<> 133:99b5ccf27215 2064
<> 133:99b5ccf27215 2065 /* Deprecated */
<> 133:99b5ccf27215 2066 arm_status arm_cfft_radix2_init_q15(
<> 133:99b5ccf27215 2067 arm_cfft_radix2_instance_q15 * S,
<> 133:99b5ccf27215 2068 uint16_t fftLen,
<> 133:99b5ccf27215 2069 uint8_t ifftFlag,
<> 133:99b5ccf27215 2070 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2071
<> 133:99b5ccf27215 2072 /* Deprecated */
<> 133:99b5ccf27215 2073 void arm_cfft_radix2_q15(
<> 133:99b5ccf27215 2074 const arm_cfft_radix2_instance_q15 * S,
<> 133:99b5ccf27215 2075 q15_t * pSrc);
<> 133:99b5ccf27215 2076
<> 133:99b5ccf27215 2077
<> 133:99b5ccf27215 2078
<> 133:99b5ccf27215 2079 /**
<> 133:99b5ccf27215 2080 * @brief Instance structure for the Q15 CFFT/CIFFT function.
<> 133:99b5ccf27215 2081 */
<> 133:99b5ccf27215 2082
<> 133:99b5ccf27215 2083 typedef struct
<> 133:99b5ccf27215 2084 {
<> 133:99b5ccf27215 2085 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2086 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2087 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2088 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 133:99b5ccf27215 2089 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2090 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2091 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2092 } arm_cfft_radix4_instance_q15;
<> 133:99b5ccf27215 2093
<> 133:99b5ccf27215 2094 /* Deprecated */
<> 133:99b5ccf27215 2095 arm_status arm_cfft_radix4_init_q15(
<> 133:99b5ccf27215 2096 arm_cfft_radix4_instance_q15 * S,
<> 133:99b5ccf27215 2097 uint16_t fftLen,
<> 133:99b5ccf27215 2098 uint8_t ifftFlag,
<> 133:99b5ccf27215 2099 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2100
<> 133:99b5ccf27215 2101 /* Deprecated */
<> 133:99b5ccf27215 2102 void arm_cfft_radix4_q15(
<> 133:99b5ccf27215 2103 const arm_cfft_radix4_instance_q15 * S,
<> 133:99b5ccf27215 2104 q15_t * pSrc);
<> 133:99b5ccf27215 2105
<> 133:99b5ccf27215 2106 /**
<> 133:99b5ccf27215 2107 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
<> 133:99b5ccf27215 2108 */
<> 133:99b5ccf27215 2109
<> 133:99b5ccf27215 2110 typedef struct
<> 133:99b5ccf27215 2111 {
<> 133:99b5ccf27215 2112 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2113 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2114 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2115 q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2116 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2117 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2118 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2119 } arm_cfft_radix2_instance_q31;
<> 133:99b5ccf27215 2120
<> 133:99b5ccf27215 2121 /* Deprecated */
<> 133:99b5ccf27215 2122 arm_status arm_cfft_radix2_init_q31(
<> 133:99b5ccf27215 2123 arm_cfft_radix2_instance_q31 * S,
<> 133:99b5ccf27215 2124 uint16_t fftLen,
<> 133:99b5ccf27215 2125 uint8_t ifftFlag,
<> 133:99b5ccf27215 2126 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2127
<> 133:99b5ccf27215 2128 /* Deprecated */
<> 133:99b5ccf27215 2129 void arm_cfft_radix2_q31(
<> 133:99b5ccf27215 2130 const arm_cfft_radix2_instance_q31 * S,
<> 133:99b5ccf27215 2131 q31_t * pSrc);
<> 133:99b5ccf27215 2132
<> 133:99b5ccf27215 2133 /**
<> 133:99b5ccf27215 2134 * @brief Instance structure for the Q31 CFFT/CIFFT function.
<> 133:99b5ccf27215 2135 */
<> 133:99b5ccf27215 2136
<> 133:99b5ccf27215 2137 typedef struct
<> 133:99b5ccf27215 2138 {
<> 133:99b5ccf27215 2139 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2140 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2141 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2142 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 133:99b5ccf27215 2143 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2144 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2145 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2146 } arm_cfft_radix4_instance_q31;
<> 133:99b5ccf27215 2147
<> 133:99b5ccf27215 2148 /* Deprecated */
<> 133:99b5ccf27215 2149 void arm_cfft_radix4_q31(
<> 133:99b5ccf27215 2150 const arm_cfft_radix4_instance_q31 * S,
<> 133:99b5ccf27215 2151 q31_t * pSrc);
<> 133:99b5ccf27215 2152
<> 133:99b5ccf27215 2153 /* Deprecated */
<> 133:99b5ccf27215 2154 arm_status arm_cfft_radix4_init_q31(
<> 133:99b5ccf27215 2155 arm_cfft_radix4_instance_q31 * S,
<> 133:99b5ccf27215 2156 uint16_t fftLen,
<> 133:99b5ccf27215 2157 uint8_t ifftFlag,
<> 133:99b5ccf27215 2158 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2159
<> 133:99b5ccf27215 2160 /**
<> 133:99b5ccf27215 2161 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 133:99b5ccf27215 2162 */
<> 133:99b5ccf27215 2163
<> 133:99b5ccf27215 2164 typedef struct
<> 133:99b5ccf27215 2165 {
<> 133:99b5ccf27215 2166 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2167 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2168 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2169 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2170 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2171 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2172 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2173 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 133:99b5ccf27215 2174 } arm_cfft_radix2_instance_f32;
<> 133:99b5ccf27215 2175
<> 133:99b5ccf27215 2176 /* Deprecated */
<> 133:99b5ccf27215 2177 arm_status arm_cfft_radix2_init_f32(
<> 133:99b5ccf27215 2178 arm_cfft_radix2_instance_f32 * S,
<> 133:99b5ccf27215 2179 uint16_t fftLen,
<> 133:99b5ccf27215 2180 uint8_t ifftFlag,
<> 133:99b5ccf27215 2181 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2182
<> 133:99b5ccf27215 2183 /* Deprecated */
<> 133:99b5ccf27215 2184 void arm_cfft_radix2_f32(
<> 133:99b5ccf27215 2185 const arm_cfft_radix2_instance_f32 * S,
<> 133:99b5ccf27215 2186 float32_t * pSrc);
<> 133:99b5ccf27215 2187
<> 133:99b5ccf27215 2188 /**
<> 133:99b5ccf27215 2189 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 133:99b5ccf27215 2190 */
<> 133:99b5ccf27215 2191
<> 133:99b5ccf27215 2192 typedef struct
<> 133:99b5ccf27215 2193 {
<> 133:99b5ccf27215 2194 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2195 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
<> 133:99b5ccf27215 2196 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
<> 133:99b5ccf27215 2197 float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2198 uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2199 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2200 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
<> 133:99b5ccf27215 2201 float32_t onebyfftLen; /**< value of 1/fftLen. */
<> 133:99b5ccf27215 2202 } arm_cfft_radix4_instance_f32;
<> 133:99b5ccf27215 2203
<> 133:99b5ccf27215 2204 /* Deprecated */
<> 133:99b5ccf27215 2205 arm_status arm_cfft_radix4_init_f32(
<> 133:99b5ccf27215 2206 arm_cfft_radix4_instance_f32 * S,
<> 133:99b5ccf27215 2207 uint16_t fftLen,
<> 133:99b5ccf27215 2208 uint8_t ifftFlag,
<> 133:99b5ccf27215 2209 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2210
<> 133:99b5ccf27215 2211 /* Deprecated */
<> 133:99b5ccf27215 2212 void arm_cfft_radix4_f32(
<> 133:99b5ccf27215 2213 const arm_cfft_radix4_instance_f32 * S,
<> 133:99b5ccf27215 2214 float32_t * pSrc);
<> 133:99b5ccf27215 2215
<> 133:99b5ccf27215 2216 /**
<> 133:99b5ccf27215 2217 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 133:99b5ccf27215 2218 */
<> 133:99b5ccf27215 2219
<> 133:99b5ccf27215 2220 typedef struct
<> 133:99b5ccf27215 2221 {
<> 133:99b5ccf27215 2222 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2223 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2224 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2225 uint16_t bitRevLength; /**< bit reversal table length. */
<> 133:99b5ccf27215 2226 } arm_cfft_instance_q15;
<> 133:99b5ccf27215 2227
<> 133:99b5ccf27215 2228 void arm_cfft_q15(
<> 133:99b5ccf27215 2229 const arm_cfft_instance_q15 * S,
<> 133:99b5ccf27215 2230 q15_t * p1,
<> 133:99b5ccf27215 2231 uint8_t ifftFlag,
<> 133:99b5ccf27215 2232 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2233
<> 133:99b5ccf27215 2234 /**
<> 133:99b5ccf27215 2235 * @brief Instance structure for the fixed-point CFFT/CIFFT function.
<> 133:99b5ccf27215 2236 */
<> 133:99b5ccf27215 2237
<> 133:99b5ccf27215 2238 typedef struct
<> 133:99b5ccf27215 2239 {
<> 133:99b5ccf27215 2240 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2241 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2242 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2243 uint16_t bitRevLength; /**< bit reversal table length. */
<> 133:99b5ccf27215 2244 } arm_cfft_instance_q31;
<> 133:99b5ccf27215 2245
<> 133:99b5ccf27215 2246 void arm_cfft_q31(
<> 133:99b5ccf27215 2247 const arm_cfft_instance_q31 * S,
<> 133:99b5ccf27215 2248 q31_t * p1,
<> 133:99b5ccf27215 2249 uint8_t ifftFlag,
<> 133:99b5ccf27215 2250 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2251
<> 133:99b5ccf27215 2252 /**
<> 133:99b5ccf27215 2253 * @brief Instance structure for the floating-point CFFT/CIFFT function.
<> 133:99b5ccf27215 2254 */
<> 133:99b5ccf27215 2255
<> 133:99b5ccf27215 2256 typedef struct
<> 133:99b5ccf27215 2257 {
<> 133:99b5ccf27215 2258 uint16_t fftLen; /**< length of the FFT. */
<> 133:99b5ccf27215 2259 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
<> 133:99b5ccf27215 2260 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
<> 133:99b5ccf27215 2261 uint16_t bitRevLength; /**< bit reversal table length. */
<> 133:99b5ccf27215 2262 } arm_cfft_instance_f32;
<> 133:99b5ccf27215 2263
<> 133:99b5ccf27215 2264 void arm_cfft_f32(
<> 133:99b5ccf27215 2265 const arm_cfft_instance_f32 * S,
<> 133:99b5ccf27215 2266 float32_t * p1,
<> 133:99b5ccf27215 2267 uint8_t ifftFlag,
<> 133:99b5ccf27215 2268 uint8_t bitReverseFlag);
<> 133:99b5ccf27215 2269
<> 133:99b5ccf27215 2270 /**
<> 133:99b5ccf27215 2271 * @brief Instance structure for the Q15 RFFT/RIFFT function.
<> 133:99b5ccf27215 2272 */
<> 133:99b5ccf27215 2273
<> 133:99b5ccf27215 2274 typedef struct
<> 133:99b5ccf27215 2275 {
<> 133:99b5ccf27215 2276 uint32_t fftLenReal; /**< length of the real FFT. */
<> 133:99b5ccf27215 2277 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 133:99b5ccf27215 2278 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 133:99b5ccf27215 2279 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2280 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 133:99b5ccf27215 2281 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 133:99b5ccf27215 2282 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2283 } arm_rfft_instance_q15;
<> 133:99b5ccf27215 2284
<> 133:99b5ccf27215 2285 arm_status arm_rfft_init_q15(
<> 133:99b5ccf27215 2286 arm_rfft_instance_q15 * S,
<> 133:99b5ccf27215 2287 uint32_t fftLenReal,
<> 133:99b5ccf27215 2288 uint32_t ifftFlagR,
<> 133:99b5ccf27215 2289 uint32_t bitReverseFlag);
<> 133:99b5ccf27215 2290
<> 133:99b5ccf27215 2291 void arm_rfft_q15(
<> 133:99b5ccf27215 2292 const arm_rfft_instance_q15 * S,
<> 133:99b5ccf27215 2293 q15_t * pSrc,
<> 133:99b5ccf27215 2294 q15_t * pDst);
<> 133:99b5ccf27215 2295
<> 133:99b5ccf27215 2296 /**
<> 133:99b5ccf27215 2297 * @brief Instance structure for the Q31 RFFT/RIFFT function.
<> 133:99b5ccf27215 2298 */
<> 133:99b5ccf27215 2299
<> 133:99b5ccf27215 2300 typedef struct
<> 133:99b5ccf27215 2301 {
<> 133:99b5ccf27215 2302 uint32_t fftLenReal; /**< length of the real FFT. */
<> 133:99b5ccf27215 2303 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 133:99b5ccf27215 2304 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 133:99b5ccf27215 2305 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2306 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 133:99b5ccf27215 2307 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 133:99b5ccf27215 2308 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2309 } arm_rfft_instance_q31;
<> 133:99b5ccf27215 2310
<> 133:99b5ccf27215 2311 arm_status arm_rfft_init_q31(
<> 133:99b5ccf27215 2312 arm_rfft_instance_q31 * S,
<> 133:99b5ccf27215 2313 uint32_t fftLenReal,
<> 133:99b5ccf27215 2314 uint32_t ifftFlagR,
<> 133:99b5ccf27215 2315 uint32_t bitReverseFlag);
<> 133:99b5ccf27215 2316
<> 133:99b5ccf27215 2317 void arm_rfft_q31(
<> 133:99b5ccf27215 2318 const arm_rfft_instance_q31 * S,
<> 133:99b5ccf27215 2319 q31_t * pSrc,
<> 133:99b5ccf27215 2320 q31_t * pDst);
<> 133:99b5ccf27215 2321
<> 133:99b5ccf27215 2322 /**
<> 133:99b5ccf27215 2323 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 133:99b5ccf27215 2324 */
<> 133:99b5ccf27215 2325
<> 133:99b5ccf27215 2326 typedef struct
<> 133:99b5ccf27215 2327 {
<> 133:99b5ccf27215 2328 uint32_t fftLenReal; /**< length of the real FFT. */
<> 133:99b5ccf27215 2329 uint16_t fftLenBy2; /**< length of the complex FFT. */
<> 133:99b5ccf27215 2330 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
<> 133:99b5ccf27215 2331 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
<> 133:99b5ccf27215 2332 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
<> 133:99b5ccf27215 2333 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
<> 133:99b5ccf27215 2334 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
<> 133:99b5ccf27215 2335 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2336 } arm_rfft_instance_f32;
<> 133:99b5ccf27215 2337
<> 133:99b5ccf27215 2338 arm_status arm_rfft_init_f32(
<> 133:99b5ccf27215 2339 arm_rfft_instance_f32 * S,
<> 133:99b5ccf27215 2340 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 133:99b5ccf27215 2341 uint32_t fftLenReal,
<> 133:99b5ccf27215 2342 uint32_t ifftFlagR,
<> 133:99b5ccf27215 2343 uint32_t bitReverseFlag);
<> 133:99b5ccf27215 2344
<> 133:99b5ccf27215 2345 void arm_rfft_f32(
<> 133:99b5ccf27215 2346 const arm_rfft_instance_f32 * S,
<> 133:99b5ccf27215 2347 float32_t * pSrc,
<> 133:99b5ccf27215 2348 float32_t * pDst);
<> 133:99b5ccf27215 2349
<> 133:99b5ccf27215 2350 /**
<> 133:99b5ccf27215 2351 * @brief Instance structure for the floating-point RFFT/RIFFT function.
<> 133:99b5ccf27215 2352 */
<> 133:99b5ccf27215 2353
<> 133:99b5ccf27215 2354 typedef struct
<> 133:99b5ccf27215 2355 {
<> 133:99b5ccf27215 2356 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
<> 133:99b5ccf27215 2357 uint16_t fftLenRFFT; /**< length of the real sequence */
<> 133:99b5ccf27215 2358 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
<> 133:99b5ccf27215 2359 } arm_rfft_fast_instance_f32 ;
<> 133:99b5ccf27215 2360
<> 133:99b5ccf27215 2361 arm_status arm_rfft_fast_init_f32 (
<> 133:99b5ccf27215 2362 arm_rfft_fast_instance_f32 * S,
<> 133:99b5ccf27215 2363 uint16_t fftLen);
<> 133:99b5ccf27215 2364
<> 133:99b5ccf27215 2365 void arm_rfft_fast_f32(
<> 133:99b5ccf27215 2366 arm_rfft_fast_instance_f32 * S,
<> 133:99b5ccf27215 2367 float32_t * p, float32_t * pOut,
<> 133:99b5ccf27215 2368 uint8_t ifftFlag);
<> 133:99b5ccf27215 2369
<> 133:99b5ccf27215 2370 /**
<> 133:99b5ccf27215 2371 * @brief Instance structure for the floating-point DCT4/IDCT4 function.
<> 133:99b5ccf27215 2372 */
<> 133:99b5ccf27215 2373
<> 133:99b5ccf27215 2374 typedef struct
<> 133:99b5ccf27215 2375 {
<> 133:99b5ccf27215 2376 uint16_t N; /**< length of the DCT4. */
<> 133:99b5ccf27215 2377 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 133:99b5ccf27215 2378 float32_t normalize; /**< normalizing factor. */
<> 133:99b5ccf27215 2379 float32_t *pTwiddle; /**< points to the twiddle factor table. */
<> 133:99b5ccf27215 2380 float32_t *pCosFactor; /**< points to the cosFactor table. */
<> 133:99b5ccf27215 2381 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */
<> 133:99b5ccf27215 2382 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2383 } arm_dct4_instance_f32;
<> 133:99b5ccf27215 2384
<> 133:99b5ccf27215 2385 /**
<> 133:99b5ccf27215 2386 * @brief Initialization function for the floating-point DCT4/IDCT4.
<> 133:99b5ccf27215 2387 * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure.
<> 133:99b5ccf27215 2388 * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure.
<> 133:99b5ccf27215 2389 * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure.
<> 133:99b5ccf27215 2390 * @param[in] N length of the DCT4.
<> 133:99b5ccf27215 2391 * @param[in] Nby2 half of the length of the DCT4.
<> 133:99b5ccf27215 2392 * @param[in] normalize normalizing factor.
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 2394 */
<> 133:99b5ccf27215 2395
<> 133:99b5ccf27215 2396 arm_status arm_dct4_init_f32(
<> 133:99b5ccf27215 2397 arm_dct4_instance_f32 * S,
<> 133:99b5ccf27215 2398 arm_rfft_instance_f32 * S_RFFT,
<> 133:99b5ccf27215 2399 arm_cfft_radix4_instance_f32 * S_CFFT,
<> 133:99b5ccf27215 2400 uint16_t N,
<> 133:99b5ccf27215 2401 uint16_t Nby2,
<> 133:99b5ccf27215 2402 float32_t normalize);
<> 133:99b5ccf27215 2403
<> 133:99b5ccf27215 2404 /**
<> 133:99b5ccf27215 2405 * @brief Processing function for the floating-point DCT4/IDCT4.
<> 133:99b5ccf27215 2406 * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure.
<> 133:99b5ccf27215 2407 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 2408 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 133:99b5ccf27215 2409 * @return none.
<> 133:99b5ccf27215 2410 */
<> 133:99b5ccf27215 2411
<> 133:99b5ccf27215 2412 void arm_dct4_f32(
<> 133:99b5ccf27215 2413 const arm_dct4_instance_f32 * S,
<> 133:99b5ccf27215 2414 float32_t * pState,
<> 133:99b5ccf27215 2415 float32_t * pInlineBuffer);
<> 133:99b5ccf27215 2416
<> 133:99b5ccf27215 2417 /**
<> 133:99b5ccf27215 2418 * @brief Instance structure for the Q31 DCT4/IDCT4 function.
<> 133:99b5ccf27215 2419 */
<> 133:99b5ccf27215 2420
<> 133:99b5ccf27215 2421 typedef struct
<> 133:99b5ccf27215 2422 {
<> 133:99b5ccf27215 2423 uint16_t N; /**< length of the DCT4. */
<> 133:99b5ccf27215 2424 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 133:99b5ccf27215 2425 q31_t normalize; /**< normalizing factor. */
<> 133:99b5ccf27215 2426 q31_t *pTwiddle; /**< points to the twiddle factor table. */
<> 133:99b5ccf27215 2427 q31_t *pCosFactor; /**< points to the cosFactor table. */
<> 133:99b5ccf27215 2428 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
<> 133:99b5ccf27215 2429 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2430 } arm_dct4_instance_q31;
<> 133:99b5ccf27215 2431
<> 133:99b5ccf27215 2432 /**
<> 133:99b5ccf27215 2433 * @brief Initialization function for the Q31 DCT4/IDCT4.
<> 133:99b5ccf27215 2434 * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure.
<> 133:99b5ccf27215 2435 * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure
<> 133:99b5ccf27215 2436 * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure
<> 133:99b5ccf27215 2437 * @param[in] N length of the DCT4.
<> 133:99b5ccf27215 2438 * @param[in] Nby2 half of the length of the DCT4.
<> 133:99b5ccf27215 2439 * @param[in] normalize normalizing factor.
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 2441 */
<> 133:99b5ccf27215 2442
<> 133:99b5ccf27215 2443 arm_status arm_dct4_init_q31(
<> 133:99b5ccf27215 2444 arm_dct4_instance_q31 * S,
<> 133:99b5ccf27215 2445 arm_rfft_instance_q31 * S_RFFT,
<> 133:99b5ccf27215 2446 arm_cfft_radix4_instance_q31 * S_CFFT,
<> 133:99b5ccf27215 2447 uint16_t N,
<> 133:99b5ccf27215 2448 uint16_t Nby2,
<> 133:99b5ccf27215 2449 q31_t normalize);
<> 133:99b5ccf27215 2450
<> 133:99b5ccf27215 2451 /**
<> 133:99b5ccf27215 2452 * @brief Processing function for the Q31 DCT4/IDCT4.
<> 133:99b5ccf27215 2453 * @param[in] *S points to an instance of the Q31 DCT4 structure.
<> 133:99b5ccf27215 2454 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 2455 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 133:99b5ccf27215 2456 * @return none.
<> 133:99b5ccf27215 2457 */
<> 133:99b5ccf27215 2458
<> 133:99b5ccf27215 2459 void arm_dct4_q31(
<> 133:99b5ccf27215 2460 const arm_dct4_instance_q31 * S,
<> 133:99b5ccf27215 2461 q31_t * pState,
<> 133:99b5ccf27215 2462 q31_t * pInlineBuffer);
<> 133:99b5ccf27215 2463
<> 133:99b5ccf27215 2464 /**
<> 133:99b5ccf27215 2465 * @brief Instance structure for the Q15 DCT4/IDCT4 function.
<> 133:99b5ccf27215 2466 */
<> 133:99b5ccf27215 2467
<> 133:99b5ccf27215 2468 typedef struct
<> 133:99b5ccf27215 2469 {
<> 133:99b5ccf27215 2470 uint16_t N; /**< length of the DCT4. */
<> 133:99b5ccf27215 2471 uint16_t Nby2; /**< half of the length of the DCT4. */
<> 133:99b5ccf27215 2472 q15_t normalize; /**< normalizing factor. */
<> 133:99b5ccf27215 2473 q15_t *pTwiddle; /**< points to the twiddle factor table. */
<> 133:99b5ccf27215 2474 q15_t *pCosFactor; /**< points to the cosFactor table. */
<> 133:99b5ccf27215 2475 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
<> 133:99b5ccf27215 2476 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
<> 133:99b5ccf27215 2477 } arm_dct4_instance_q15;
<> 133:99b5ccf27215 2478
<> 133:99b5ccf27215 2479 /**
<> 133:99b5ccf27215 2480 * @brief Initialization function for the Q15 DCT4/IDCT4.
<> 133:99b5ccf27215 2481 * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure.
<> 133:99b5ccf27215 2482 * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure.
<> 133:99b5ccf27215 2483 * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure.
<> 133:99b5ccf27215 2484 * @param[in] N length of the DCT4.
<> 133:99b5ccf27215 2485 * @param[in] Nby2 half of the length of the DCT4.
<> 133:99b5ccf27215 2486 * @param[in] normalize normalizing factor.
<> 133:99b5ccf27215 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.
<> 133:99b5ccf27215 2488 */
<> 133:99b5ccf27215 2489
<> 133:99b5ccf27215 2490 arm_status arm_dct4_init_q15(
<> 133:99b5ccf27215 2491 arm_dct4_instance_q15 * S,
<> 133:99b5ccf27215 2492 arm_rfft_instance_q15 * S_RFFT,
<> 133:99b5ccf27215 2493 arm_cfft_radix4_instance_q15 * S_CFFT,
<> 133:99b5ccf27215 2494 uint16_t N,
<> 133:99b5ccf27215 2495 uint16_t Nby2,
<> 133:99b5ccf27215 2496 q15_t normalize);
<> 133:99b5ccf27215 2497
<> 133:99b5ccf27215 2498 /**
<> 133:99b5ccf27215 2499 * @brief Processing function for the Q15 DCT4/IDCT4.
<> 133:99b5ccf27215 2500 * @param[in] *S points to an instance of the Q15 DCT4 structure.
<> 133:99b5ccf27215 2501 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 2502 * @param[in,out] *pInlineBuffer points to the in-place input and output buffer.
<> 133:99b5ccf27215 2503 * @return none.
<> 133:99b5ccf27215 2504 */
<> 133:99b5ccf27215 2505
<> 133:99b5ccf27215 2506 void arm_dct4_q15(
<> 133:99b5ccf27215 2507 const arm_dct4_instance_q15 * S,
<> 133:99b5ccf27215 2508 q15_t * pState,
<> 133:99b5ccf27215 2509 q15_t * pInlineBuffer);
<> 133:99b5ccf27215 2510
<> 133:99b5ccf27215 2511 /**
<> 133:99b5ccf27215 2512 * @brief Floating-point vector addition.
<> 133:99b5ccf27215 2513 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2514 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2515 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2516 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2517 * @return none.
<> 133:99b5ccf27215 2518 */
<> 133:99b5ccf27215 2519
<> 133:99b5ccf27215 2520 void arm_add_f32(
<> 133:99b5ccf27215 2521 float32_t * pSrcA,
<> 133:99b5ccf27215 2522 float32_t * pSrcB,
<> 133:99b5ccf27215 2523 float32_t * pDst,
<> 133:99b5ccf27215 2524 uint32_t blockSize);
<> 133:99b5ccf27215 2525
<> 133:99b5ccf27215 2526 /**
<> 133:99b5ccf27215 2527 * @brief Q7 vector addition.
<> 133:99b5ccf27215 2528 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2529 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2530 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2531 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2532 * @return none.
<> 133:99b5ccf27215 2533 */
<> 133:99b5ccf27215 2534
<> 133:99b5ccf27215 2535 void arm_add_q7(
<> 133:99b5ccf27215 2536 q7_t * pSrcA,
<> 133:99b5ccf27215 2537 q7_t * pSrcB,
<> 133:99b5ccf27215 2538 q7_t * pDst,
<> 133:99b5ccf27215 2539 uint32_t blockSize);
<> 133:99b5ccf27215 2540
<> 133:99b5ccf27215 2541 /**
<> 133:99b5ccf27215 2542 * @brief Q15 vector addition.
<> 133:99b5ccf27215 2543 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2544 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2545 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2546 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2547 * @return none.
<> 133:99b5ccf27215 2548 */
<> 133:99b5ccf27215 2549
<> 133:99b5ccf27215 2550 void arm_add_q15(
<> 133:99b5ccf27215 2551 q15_t * pSrcA,
<> 133:99b5ccf27215 2552 q15_t * pSrcB,
<> 133:99b5ccf27215 2553 q15_t * pDst,
<> 133:99b5ccf27215 2554 uint32_t blockSize);
<> 133:99b5ccf27215 2555
<> 133:99b5ccf27215 2556 /**
<> 133:99b5ccf27215 2557 * @brief Q31 vector addition.
<> 133:99b5ccf27215 2558 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2559 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2560 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2561 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2562 * @return none.
<> 133:99b5ccf27215 2563 */
<> 133:99b5ccf27215 2564
<> 133:99b5ccf27215 2565 void arm_add_q31(
<> 133:99b5ccf27215 2566 q31_t * pSrcA,
<> 133:99b5ccf27215 2567 q31_t * pSrcB,
<> 133:99b5ccf27215 2568 q31_t * pDst,
<> 133:99b5ccf27215 2569 uint32_t blockSize);
<> 133:99b5ccf27215 2570
<> 133:99b5ccf27215 2571 /**
<> 133:99b5ccf27215 2572 * @brief Floating-point vector subtraction.
<> 133:99b5ccf27215 2573 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2574 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2575 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2576 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2577 * @return none.
<> 133:99b5ccf27215 2578 */
<> 133:99b5ccf27215 2579
<> 133:99b5ccf27215 2580 void arm_sub_f32(
<> 133:99b5ccf27215 2581 float32_t * pSrcA,
<> 133:99b5ccf27215 2582 float32_t * pSrcB,
<> 133:99b5ccf27215 2583 float32_t * pDst,
<> 133:99b5ccf27215 2584 uint32_t blockSize);
<> 133:99b5ccf27215 2585
<> 133:99b5ccf27215 2586 /**
<> 133:99b5ccf27215 2587 * @brief Q7 vector subtraction.
<> 133:99b5ccf27215 2588 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2589 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2590 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2591 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2592 * @return none.
<> 133:99b5ccf27215 2593 */
<> 133:99b5ccf27215 2594
<> 133:99b5ccf27215 2595 void arm_sub_q7(
<> 133:99b5ccf27215 2596 q7_t * pSrcA,
<> 133:99b5ccf27215 2597 q7_t * pSrcB,
<> 133:99b5ccf27215 2598 q7_t * pDst,
<> 133:99b5ccf27215 2599 uint32_t blockSize);
<> 133:99b5ccf27215 2600
<> 133:99b5ccf27215 2601 /**
<> 133:99b5ccf27215 2602 * @brief Q15 vector subtraction.
<> 133:99b5ccf27215 2603 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2604 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2605 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2606 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2607 * @return none.
<> 133:99b5ccf27215 2608 */
<> 133:99b5ccf27215 2609
<> 133:99b5ccf27215 2610 void arm_sub_q15(
<> 133:99b5ccf27215 2611 q15_t * pSrcA,
<> 133:99b5ccf27215 2612 q15_t * pSrcB,
<> 133:99b5ccf27215 2613 q15_t * pDst,
<> 133:99b5ccf27215 2614 uint32_t blockSize);
<> 133:99b5ccf27215 2615
<> 133:99b5ccf27215 2616 /**
<> 133:99b5ccf27215 2617 * @brief Q31 vector subtraction.
<> 133:99b5ccf27215 2618 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2619 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2620 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2621 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2622 * @return none.
<> 133:99b5ccf27215 2623 */
<> 133:99b5ccf27215 2624
<> 133:99b5ccf27215 2625 void arm_sub_q31(
<> 133:99b5ccf27215 2626 q31_t * pSrcA,
<> 133:99b5ccf27215 2627 q31_t * pSrcB,
<> 133:99b5ccf27215 2628 q31_t * pDst,
<> 133:99b5ccf27215 2629 uint32_t blockSize);
<> 133:99b5ccf27215 2630
<> 133:99b5ccf27215 2631 /**
<> 133:99b5ccf27215 2632 * @brief Multiplies a floating-point vector by a scalar.
<> 133:99b5ccf27215 2633 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2634 * @param[in] scale scale factor to be applied
<> 133:99b5ccf27215 2635 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2636 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2637 * @return none.
<> 133:99b5ccf27215 2638 */
<> 133:99b5ccf27215 2639
<> 133:99b5ccf27215 2640 void arm_scale_f32(
<> 133:99b5ccf27215 2641 float32_t * pSrc,
<> 133:99b5ccf27215 2642 float32_t scale,
<> 133:99b5ccf27215 2643 float32_t * pDst,
<> 133:99b5ccf27215 2644 uint32_t blockSize);
<> 133:99b5ccf27215 2645
<> 133:99b5ccf27215 2646 /**
<> 133:99b5ccf27215 2647 * @brief Multiplies a Q7 vector by a scalar.
<> 133:99b5ccf27215 2648 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2649 * @param[in] scaleFract fractional portion of the scale value
<> 133:99b5ccf27215 2650 * @param[in] shift number of bits to shift the result by
<> 133:99b5ccf27215 2651 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2652 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2653 * @return none.
<> 133:99b5ccf27215 2654 */
<> 133:99b5ccf27215 2655
<> 133:99b5ccf27215 2656 void arm_scale_q7(
<> 133:99b5ccf27215 2657 q7_t * pSrc,
<> 133:99b5ccf27215 2658 q7_t scaleFract,
<> 133:99b5ccf27215 2659 int8_t shift,
<> 133:99b5ccf27215 2660 q7_t * pDst,
<> 133:99b5ccf27215 2661 uint32_t blockSize);
<> 133:99b5ccf27215 2662
<> 133:99b5ccf27215 2663 /**
<> 133:99b5ccf27215 2664 * @brief Multiplies a Q15 vector by a scalar.
<> 133:99b5ccf27215 2665 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2666 * @param[in] scaleFract fractional portion of the scale value
<> 133:99b5ccf27215 2667 * @param[in] shift number of bits to shift the result by
<> 133:99b5ccf27215 2668 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2669 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2670 * @return none.
<> 133:99b5ccf27215 2671 */
<> 133:99b5ccf27215 2672
<> 133:99b5ccf27215 2673 void arm_scale_q15(
<> 133:99b5ccf27215 2674 q15_t * pSrc,
<> 133:99b5ccf27215 2675 q15_t scaleFract,
<> 133:99b5ccf27215 2676 int8_t shift,
<> 133:99b5ccf27215 2677 q15_t * pDst,
<> 133:99b5ccf27215 2678 uint32_t blockSize);
<> 133:99b5ccf27215 2679
<> 133:99b5ccf27215 2680 /**
<> 133:99b5ccf27215 2681 * @brief Multiplies a Q31 vector by a scalar.
<> 133:99b5ccf27215 2682 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2683 * @param[in] scaleFract fractional portion of the scale value
<> 133:99b5ccf27215 2684 * @param[in] shift number of bits to shift the result by
<> 133:99b5ccf27215 2685 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2686 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2687 * @return none.
<> 133:99b5ccf27215 2688 */
<> 133:99b5ccf27215 2689
<> 133:99b5ccf27215 2690 void arm_scale_q31(
<> 133:99b5ccf27215 2691 q31_t * pSrc,
<> 133:99b5ccf27215 2692 q31_t scaleFract,
<> 133:99b5ccf27215 2693 int8_t shift,
<> 133:99b5ccf27215 2694 q31_t * pDst,
<> 133:99b5ccf27215 2695 uint32_t blockSize);
<> 133:99b5ccf27215 2696
<> 133:99b5ccf27215 2697 /**
<> 133:99b5ccf27215 2698 * @brief Q7 vector absolute value.
<> 133:99b5ccf27215 2699 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 2700 * @param[out] *pDst points to the output buffer
<> 133:99b5ccf27215 2701 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2702 * @return none.
<> 133:99b5ccf27215 2703 */
<> 133:99b5ccf27215 2704
<> 133:99b5ccf27215 2705 void arm_abs_q7(
<> 133:99b5ccf27215 2706 q7_t * pSrc,
<> 133:99b5ccf27215 2707 q7_t * pDst,
<> 133:99b5ccf27215 2708 uint32_t blockSize);
<> 133:99b5ccf27215 2709
<> 133:99b5ccf27215 2710 /**
<> 133:99b5ccf27215 2711 * @brief Floating-point vector absolute value.
<> 133:99b5ccf27215 2712 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 2713 * @param[out] *pDst points to the output buffer
<> 133:99b5ccf27215 2714 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2715 * @return none.
<> 133:99b5ccf27215 2716 */
<> 133:99b5ccf27215 2717
<> 133:99b5ccf27215 2718 void arm_abs_f32(
<> 133:99b5ccf27215 2719 float32_t * pSrc,
<> 133:99b5ccf27215 2720 float32_t * pDst,
<> 133:99b5ccf27215 2721 uint32_t blockSize);
<> 133:99b5ccf27215 2722
<> 133:99b5ccf27215 2723 /**
<> 133:99b5ccf27215 2724 * @brief Q15 vector absolute value.
<> 133:99b5ccf27215 2725 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 2726 * @param[out] *pDst points to the output buffer
<> 133:99b5ccf27215 2727 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2728 * @return none.
<> 133:99b5ccf27215 2729 */
<> 133:99b5ccf27215 2730
<> 133:99b5ccf27215 2731 void arm_abs_q15(
<> 133:99b5ccf27215 2732 q15_t * pSrc,
<> 133:99b5ccf27215 2733 q15_t * pDst,
<> 133:99b5ccf27215 2734 uint32_t blockSize);
<> 133:99b5ccf27215 2735
<> 133:99b5ccf27215 2736 /**
<> 133:99b5ccf27215 2737 * @brief Q31 vector absolute value.
<> 133:99b5ccf27215 2738 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 2739 * @param[out] *pDst points to the output buffer
<> 133:99b5ccf27215 2740 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2741 * @return none.
<> 133:99b5ccf27215 2742 */
<> 133:99b5ccf27215 2743
<> 133:99b5ccf27215 2744 void arm_abs_q31(
<> 133:99b5ccf27215 2745 q31_t * pSrc,
<> 133:99b5ccf27215 2746 q31_t * pDst,
<> 133:99b5ccf27215 2747 uint32_t blockSize);
<> 133:99b5ccf27215 2748
<> 133:99b5ccf27215 2749 /**
<> 133:99b5ccf27215 2750 * @brief Dot product of floating-point vectors.
<> 133:99b5ccf27215 2751 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2752 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2753 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2754 * @param[out] *result output result returned here
<> 133:99b5ccf27215 2755 * @return none.
<> 133:99b5ccf27215 2756 */
<> 133:99b5ccf27215 2757
<> 133:99b5ccf27215 2758 void arm_dot_prod_f32(
<> 133:99b5ccf27215 2759 float32_t * pSrcA,
<> 133:99b5ccf27215 2760 float32_t * pSrcB,
<> 133:99b5ccf27215 2761 uint32_t blockSize,
<> 133:99b5ccf27215 2762 float32_t * result);
<> 133:99b5ccf27215 2763
<> 133:99b5ccf27215 2764 /**
<> 133:99b5ccf27215 2765 * @brief Dot product of Q7 vectors.
<> 133:99b5ccf27215 2766 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2767 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2768 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2769 * @param[out] *result output result returned here
<> 133:99b5ccf27215 2770 * @return none.
<> 133:99b5ccf27215 2771 */
<> 133:99b5ccf27215 2772
<> 133:99b5ccf27215 2773 void arm_dot_prod_q7(
<> 133:99b5ccf27215 2774 q7_t * pSrcA,
<> 133:99b5ccf27215 2775 q7_t * pSrcB,
<> 133:99b5ccf27215 2776 uint32_t blockSize,
<> 133:99b5ccf27215 2777 q31_t * result);
<> 133:99b5ccf27215 2778
<> 133:99b5ccf27215 2779 /**
<> 133:99b5ccf27215 2780 * @brief Dot product of Q15 vectors.
<> 133:99b5ccf27215 2781 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2782 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2783 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2784 * @param[out] *result output result returned here
<> 133:99b5ccf27215 2785 * @return none.
<> 133:99b5ccf27215 2786 */
<> 133:99b5ccf27215 2787
<> 133:99b5ccf27215 2788 void arm_dot_prod_q15(
<> 133:99b5ccf27215 2789 q15_t * pSrcA,
<> 133:99b5ccf27215 2790 q15_t * pSrcB,
<> 133:99b5ccf27215 2791 uint32_t blockSize,
<> 133:99b5ccf27215 2792 q63_t * result);
<> 133:99b5ccf27215 2793
<> 133:99b5ccf27215 2794 /**
<> 133:99b5ccf27215 2795 * @brief Dot product of Q31 vectors.
<> 133:99b5ccf27215 2796 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 2797 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 2798 * @param[in] blockSize number of samples in each vector
<> 133:99b5ccf27215 2799 * @param[out] *result output result returned here
<> 133:99b5ccf27215 2800 * @return none.
<> 133:99b5ccf27215 2801 */
<> 133:99b5ccf27215 2802
<> 133:99b5ccf27215 2803 void arm_dot_prod_q31(
<> 133:99b5ccf27215 2804 q31_t * pSrcA,
<> 133:99b5ccf27215 2805 q31_t * pSrcB,
<> 133:99b5ccf27215 2806 uint32_t blockSize,
<> 133:99b5ccf27215 2807 q63_t * result);
<> 133:99b5ccf27215 2808
<> 133:99b5ccf27215 2809 /**
<> 133:99b5ccf27215 2810 * @brief Shifts the elements of a Q7 vector a specified number of bits.
<> 133:99b5ccf27215 2811 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2812 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 133:99b5ccf27215 2813 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2814 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2815 * @return none.
<> 133:99b5ccf27215 2816 */
<> 133:99b5ccf27215 2817
<> 133:99b5ccf27215 2818 void arm_shift_q7(
<> 133:99b5ccf27215 2819 q7_t * pSrc,
<> 133:99b5ccf27215 2820 int8_t shiftBits,
<> 133:99b5ccf27215 2821 q7_t * pDst,
<> 133:99b5ccf27215 2822 uint32_t blockSize);
<> 133:99b5ccf27215 2823
<> 133:99b5ccf27215 2824 /**
<> 133:99b5ccf27215 2825 * @brief Shifts the elements of a Q15 vector a specified number of bits.
<> 133:99b5ccf27215 2826 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2827 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 133:99b5ccf27215 2828 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2829 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2830 * @return none.
<> 133:99b5ccf27215 2831 */
<> 133:99b5ccf27215 2832
<> 133:99b5ccf27215 2833 void arm_shift_q15(
<> 133:99b5ccf27215 2834 q15_t * pSrc,
<> 133:99b5ccf27215 2835 int8_t shiftBits,
<> 133:99b5ccf27215 2836 q15_t * pDst,
<> 133:99b5ccf27215 2837 uint32_t blockSize);
<> 133:99b5ccf27215 2838
<> 133:99b5ccf27215 2839 /**
<> 133:99b5ccf27215 2840 * @brief Shifts the elements of a Q31 vector a specified number of bits.
<> 133:99b5ccf27215 2841 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2842 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
<> 133:99b5ccf27215 2843 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2844 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2845 * @return none.
<> 133:99b5ccf27215 2846 */
<> 133:99b5ccf27215 2847
<> 133:99b5ccf27215 2848 void arm_shift_q31(
<> 133:99b5ccf27215 2849 q31_t * pSrc,
<> 133:99b5ccf27215 2850 int8_t shiftBits,
<> 133:99b5ccf27215 2851 q31_t * pDst,
<> 133:99b5ccf27215 2852 uint32_t blockSize);
<> 133:99b5ccf27215 2853
<> 133:99b5ccf27215 2854 /**
<> 133:99b5ccf27215 2855 * @brief Adds a constant offset to a floating-point vector.
<> 133:99b5ccf27215 2856 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2857 * @param[in] offset is the offset to be added
<> 133:99b5ccf27215 2858 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2859 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2860 * @return none.
<> 133:99b5ccf27215 2861 */
<> 133:99b5ccf27215 2862
<> 133:99b5ccf27215 2863 void arm_offset_f32(
<> 133:99b5ccf27215 2864 float32_t * pSrc,
<> 133:99b5ccf27215 2865 float32_t offset,
<> 133:99b5ccf27215 2866 float32_t * pDst,
<> 133:99b5ccf27215 2867 uint32_t blockSize);
<> 133:99b5ccf27215 2868
<> 133:99b5ccf27215 2869 /**
<> 133:99b5ccf27215 2870 * @brief Adds a constant offset to a Q7 vector.
<> 133:99b5ccf27215 2871 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2872 * @param[in] offset is the offset to be added
<> 133:99b5ccf27215 2873 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2874 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2875 * @return none.
<> 133:99b5ccf27215 2876 */
<> 133:99b5ccf27215 2877
<> 133:99b5ccf27215 2878 void arm_offset_q7(
<> 133:99b5ccf27215 2879 q7_t * pSrc,
<> 133:99b5ccf27215 2880 q7_t offset,
<> 133:99b5ccf27215 2881 q7_t * pDst,
<> 133:99b5ccf27215 2882 uint32_t blockSize);
<> 133:99b5ccf27215 2883
<> 133:99b5ccf27215 2884 /**
<> 133:99b5ccf27215 2885 * @brief Adds a constant offset to a Q15 vector.
<> 133:99b5ccf27215 2886 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2887 * @param[in] offset is the offset to be added
<> 133:99b5ccf27215 2888 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2889 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2890 * @return none.
<> 133:99b5ccf27215 2891 */
<> 133:99b5ccf27215 2892
<> 133:99b5ccf27215 2893 void arm_offset_q15(
<> 133:99b5ccf27215 2894 q15_t * pSrc,
<> 133:99b5ccf27215 2895 q15_t offset,
<> 133:99b5ccf27215 2896 q15_t * pDst,
<> 133:99b5ccf27215 2897 uint32_t blockSize);
<> 133:99b5ccf27215 2898
<> 133:99b5ccf27215 2899 /**
<> 133:99b5ccf27215 2900 * @brief Adds a constant offset to a Q31 vector.
<> 133:99b5ccf27215 2901 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2902 * @param[in] offset is the offset to be added
<> 133:99b5ccf27215 2903 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2904 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2905 * @return none.
<> 133:99b5ccf27215 2906 */
<> 133:99b5ccf27215 2907
<> 133:99b5ccf27215 2908 void arm_offset_q31(
<> 133:99b5ccf27215 2909 q31_t * pSrc,
<> 133:99b5ccf27215 2910 q31_t offset,
<> 133:99b5ccf27215 2911 q31_t * pDst,
<> 133:99b5ccf27215 2912 uint32_t blockSize);
<> 133:99b5ccf27215 2913
<> 133:99b5ccf27215 2914 /**
<> 133:99b5ccf27215 2915 * @brief Negates the elements of a floating-point vector.
<> 133:99b5ccf27215 2916 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2917 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2918 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2919 * @return none.
<> 133:99b5ccf27215 2920 */
<> 133:99b5ccf27215 2921
<> 133:99b5ccf27215 2922 void arm_negate_f32(
<> 133:99b5ccf27215 2923 float32_t * pSrc,
<> 133:99b5ccf27215 2924 float32_t * pDst,
<> 133:99b5ccf27215 2925 uint32_t blockSize);
<> 133:99b5ccf27215 2926
<> 133:99b5ccf27215 2927 /**
<> 133:99b5ccf27215 2928 * @brief Negates the elements of a Q7 vector.
<> 133:99b5ccf27215 2929 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2930 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2931 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2932 * @return none.
<> 133:99b5ccf27215 2933 */
<> 133:99b5ccf27215 2934
<> 133:99b5ccf27215 2935 void arm_negate_q7(
<> 133:99b5ccf27215 2936 q7_t * pSrc,
<> 133:99b5ccf27215 2937 q7_t * pDst,
<> 133:99b5ccf27215 2938 uint32_t blockSize);
<> 133:99b5ccf27215 2939
<> 133:99b5ccf27215 2940 /**
<> 133:99b5ccf27215 2941 * @brief Negates the elements of a Q15 vector.
<> 133:99b5ccf27215 2942 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2943 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2944 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2945 * @return none.
<> 133:99b5ccf27215 2946 */
<> 133:99b5ccf27215 2947
<> 133:99b5ccf27215 2948 void arm_negate_q15(
<> 133:99b5ccf27215 2949 q15_t * pSrc,
<> 133:99b5ccf27215 2950 q15_t * pDst,
<> 133:99b5ccf27215 2951 uint32_t blockSize);
<> 133:99b5ccf27215 2952
<> 133:99b5ccf27215 2953 /**
<> 133:99b5ccf27215 2954 * @brief Negates the elements of a Q31 vector.
<> 133:99b5ccf27215 2955 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 2956 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 2957 * @param[in] blockSize number of samples in the vector
<> 133:99b5ccf27215 2958 * @return none.
<> 133:99b5ccf27215 2959 */
<> 133:99b5ccf27215 2960
<> 133:99b5ccf27215 2961 void arm_negate_q31(
<> 133:99b5ccf27215 2962 q31_t * pSrc,
<> 133:99b5ccf27215 2963 q31_t * pDst,
<> 133:99b5ccf27215 2964 uint32_t blockSize);
<> 133:99b5ccf27215 2965 /**
<> 133:99b5ccf27215 2966 * @brief Copies the elements of a floating-point vector.
<> 133:99b5ccf27215 2967 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 2968 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 2969 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 2970 * @return none.
<> 133:99b5ccf27215 2971 */
<> 133:99b5ccf27215 2972 void arm_copy_f32(
<> 133:99b5ccf27215 2973 float32_t * pSrc,
<> 133:99b5ccf27215 2974 float32_t * pDst,
<> 133:99b5ccf27215 2975 uint32_t blockSize);
<> 133:99b5ccf27215 2976
<> 133:99b5ccf27215 2977 /**
<> 133:99b5ccf27215 2978 * @brief Copies the elements of a Q7 vector.
<> 133:99b5ccf27215 2979 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 2980 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 2981 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 2982 * @return none.
<> 133:99b5ccf27215 2983 */
<> 133:99b5ccf27215 2984 void arm_copy_q7(
<> 133:99b5ccf27215 2985 q7_t * pSrc,
<> 133:99b5ccf27215 2986 q7_t * pDst,
<> 133:99b5ccf27215 2987 uint32_t blockSize);
<> 133:99b5ccf27215 2988
<> 133:99b5ccf27215 2989 /**
<> 133:99b5ccf27215 2990 * @brief Copies the elements of a Q15 vector.
<> 133:99b5ccf27215 2991 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 2992 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 2993 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 2994 * @return none.
<> 133:99b5ccf27215 2995 */
<> 133:99b5ccf27215 2996 void arm_copy_q15(
<> 133:99b5ccf27215 2997 q15_t * pSrc,
<> 133:99b5ccf27215 2998 q15_t * pDst,
<> 133:99b5ccf27215 2999 uint32_t blockSize);
<> 133:99b5ccf27215 3000
<> 133:99b5ccf27215 3001 /**
<> 133:99b5ccf27215 3002 * @brief Copies the elements of a Q31 vector.
<> 133:99b5ccf27215 3003 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 3004 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 3005 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 3006 * @return none.
<> 133:99b5ccf27215 3007 */
<> 133:99b5ccf27215 3008 void arm_copy_q31(
<> 133:99b5ccf27215 3009 q31_t * pSrc,
<> 133:99b5ccf27215 3010 q31_t * pDst,
<> 133:99b5ccf27215 3011 uint32_t blockSize);
<> 133:99b5ccf27215 3012 /**
<> 133:99b5ccf27215 3013 * @brief Fills a constant value into a floating-point vector.
<> 133:99b5ccf27215 3014 * @param[in] value input value to be filled
<> 133:99b5ccf27215 3015 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 3016 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 3017 * @return none.
<> 133:99b5ccf27215 3018 */
<> 133:99b5ccf27215 3019 void arm_fill_f32(
<> 133:99b5ccf27215 3020 float32_t value,
<> 133:99b5ccf27215 3021 float32_t * pDst,
<> 133:99b5ccf27215 3022 uint32_t blockSize);
<> 133:99b5ccf27215 3023
<> 133:99b5ccf27215 3024 /**
<> 133:99b5ccf27215 3025 * @brief Fills a constant value into a Q7 vector.
<> 133:99b5ccf27215 3026 * @param[in] value input value to be filled
<> 133:99b5ccf27215 3027 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 3028 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 3029 * @return none.
<> 133:99b5ccf27215 3030 */
<> 133:99b5ccf27215 3031 void arm_fill_q7(
<> 133:99b5ccf27215 3032 q7_t value,
<> 133:99b5ccf27215 3033 q7_t * pDst,
<> 133:99b5ccf27215 3034 uint32_t blockSize);
<> 133:99b5ccf27215 3035
<> 133:99b5ccf27215 3036 /**
<> 133:99b5ccf27215 3037 * @brief Fills a constant value into a Q15 vector.
<> 133:99b5ccf27215 3038 * @param[in] value input value to be filled
<> 133:99b5ccf27215 3039 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 3040 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 3041 * @return none.
<> 133:99b5ccf27215 3042 */
<> 133:99b5ccf27215 3043 void arm_fill_q15(
<> 133:99b5ccf27215 3044 q15_t value,
<> 133:99b5ccf27215 3045 q15_t * pDst,
<> 133:99b5ccf27215 3046 uint32_t blockSize);
<> 133:99b5ccf27215 3047
<> 133:99b5ccf27215 3048 /**
<> 133:99b5ccf27215 3049 * @brief Fills a constant value into a Q31 vector.
<> 133:99b5ccf27215 3050 * @param[in] value input value to be filled
<> 133:99b5ccf27215 3051 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 3052 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 3053 * @return none.
<> 133:99b5ccf27215 3054 */
<> 133:99b5ccf27215 3055 void arm_fill_q31(
<> 133:99b5ccf27215 3056 q31_t value,
<> 133:99b5ccf27215 3057 q31_t * pDst,
<> 133:99b5ccf27215 3058 uint32_t blockSize);
<> 133:99b5ccf27215 3059
<> 133:99b5ccf27215 3060 /**
<> 133:99b5ccf27215 3061 * @brief Convolution of floating-point sequences.
<> 133:99b5ccf27215 3062 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3063 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3064 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3065 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3066 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3067 * @return none.
<> 133:99b5ccf27215 3068 */
<> 133:99b5ccf27215 3069
<> 133:99b5ccf27215 3070 void arm_conv_f32(
<> 133:99b5ccf27215 3071 float32_t * pSrcA,
<> 133:99b5ccf27215 3072 uint32_t srcALen,
<> 133:99b5ccf27215 3073 float32_t * pSrcB,
<> 133:99b5ccf27215 3074 uint32_t srcBLen,
<> 133:99b5ccf27215 3075 float32_t * pDst);
<> 133:99b5ccf27215 3076
<> 133:99b5ccf27215 3077
<> 133:99b5ccf27215 3078 /**
<> 133:99b5ccf27215 3079 * @brief Convolution of Q15 sequences.
<> 133:99b5ccf27215 3080 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3081 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3082 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3083 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3084 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3085 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3086 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 3087 * @return none.
<> 133:99b5ccf27215 3088 */
<> 133:99b5ccf27215 3089
<> 133:99b5ccf27215 3090
<> 133:99b5ccf27215 3091 void arm_conv_opt_q15(
<> 133:99b5ccf27215 3092 q15_t * pSrcA,
<> 133:99b5ccf27215 3093 uint32_t srcALen,
<> 133:99b5ccf27215 3094 q15_t * pSrcB,
<> 133:99b5ccf27215 3095 uint32_t srcBLen,
<> 133:99b5ccf27215 3096 q15_t * pDst,
<> 133:99b5ccf27215 3097 q15_t * pScratch1,
<> 133:99b5ccf27215 3098 q15_t * pScratch2);
<> 133:99b5ccf27215 3099
<> 133:99b5ccf27215 3100
<> 133:99b5ccf27215 3101 /**
<> 133:99b5ccf27215 3102 * @brief Convolution of Q15 sequences.
<> 133:99b5ccf27215 3103 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3104 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3105 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3106 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3107 * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3108 * @return none.
<> 133:99b5ccf27215 3109 */
<> 133:99b5ccf27215 3110
<> 133:99b5ccf27215 3111 void arm_conv_q15(
<> 133:99b5ccf27215 3112 q15_t * pSrcA,
<> 133:99b5ccf27215 3113 uint32_t srcALen,
<> 133:99b5ccf27215 3114 q15_t * pSrcB,
<> 133:99b5ccf27215 3115 uint32_t srcBLen,
<> 133:99b5ccf27215 3116 q15_t * pDst);
<> 133:99b5ccf27215 3117
<> 133:99b5ccf27215 3118 /**
<> 133:99b5ccf27215 3119 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3120 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3121 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3122 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3123 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3124 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3125 * @return none.
<> 133:99b5ccf27215 3126 */
<> 133:99b5ccf27215 3127
<> 133:99b5ccf27215 3128 void arm_conv_fast_q15(
<> 133:99b5ccf27215 3129 q15_t * pSrcA,
<> 133:99b5ccf27215 3130 uint32_t srcALen,
<> 133:99b5ccf27215 3131 q15_t * pSrcB,
<> 133:99b5ccf27215 3132 uint32_t srcBLen,
<> 133:99b5ccf27215 3133 q15_t * pDst);
<> 133:99b5ccf27215 3134
<> 133:99b5ccf27215 3135 /**
<> 133:99b5ccf27215 3136 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3137 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3138 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3139 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3140 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3141 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3142 * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3143 * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 3144 * @return none.
<> 133:99b5ccf27215 3145 */
<> 133:99b5ccf27215 3146
<> 133:99b5ccf27215 3147 void arm_conv_fast_opt_q15(
<> 133:99b5ccf27215 3148 q15_t * pSrcA,
<> 133:99b5ccf27215 3149 uint32_t srcALen,
<> 133:99b5ccf27215 3150 q15_t * pSrcB,
<> 133:99b5ccf27215 3151 uint32_t srcBLen,
<> 133:99b5ccf27215 3152 q15_t * pDst,
<> 133:99b5ccf27215 3153 q15_t * pScratch1,
<> 133:99b5ccf27215 3154 q15_t * pScratch2);
<> 133:99b5ccf27215 3155
<> 133:99b5ccf27215 3156
<> 133:99b5ccf27215 3157
<> 133:99b5ccf27215 3158 /**
<> 133:99b5ccf27215 3159 * @brief Convolution of Q31 sequences.
<> 133:99b5ccf27215 3160 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3161 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3162 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3163 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3164 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3165 * @return none.
<> 133:99b5ccf27215 3166 */
<> 133:99b5ccf27215 3167
<> 133:99b5ccf27215 3168 void arm_conv_q31(
<> 133:99b5ccf27215 3169 q31_t * pSrcA,
<> 133:99b5ccf27215 3170 uint32_t srcALen,
<> 133:99b5ccf27215 3171 q31_t * pSrcB,
<> 133:99b5ccf27215 3172 uint32_t srcBLen,
<> 133:99b5ccf27215 3173 q31_t * pDst);
<> 133:99b5ccf27215 3174
<> 133:99b5ccf27215 3175 /**
<> 133:99b5ccf27215 3176 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3177 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3178 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3179 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3180 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3181 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3182 * @return none.
<> 133:99b5ccf27215 3183 */
<> 133:99b5ccf27215 3184
<> 133:99b5ccf27215 3185 void arm_conv_fast_q31(
<> 133:99b5ccf27215 3186 q31_t * pSrcA,
<> 133:99b5ccf27215 3187 uint32_t srcALen,
<> 133:99b5ccf27215 3188 q31_t * pSrcB,
<> 133:99b5ccf27215 3189 uint32_t srcBLen,
<> 133:99b5ccf27215 3190 q31_t * pDst);
<> 133:99b5ccf27215 3191
<> 133:99b5ccf27215 3192
<> 133:99b5ccf27215 3193 /**
<> 133:99b5ccf27215 3194 * @brief Convolution of Q7 sequences.
<> 133:99b5ccf27215 3195 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3196 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3197 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3198 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3199 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3200 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3201 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 3202 * @return none.
<> 133:99b5ccf27215 3203 */
<> 133:99b5ccf27215 3204
<> 133:99b5ccf27215 3205 void arm_conv_opt_q7(
<> 133:99b5ccf27215 3206 q7_t * pSrcA,
<> 133:99b5ccf27215 3207 uint32_t srcALen,
<> 133:99b5ccf27215 3208 q7_t * pSrcB,
<> 133:99b5ccf27215 3209 uint32_t srcBLen,
<> 133:99b5ccf27215 3210 q7_t * pDst,
<> 133:99b5ccf27215 3211 q15_t * pScratch1,
<> 133:99b5ccf27215 3212 q15_t * pScratch2);
<> 133:99b5ccf27215 3213
<> 133:99b5ccf27215 3214
<> 133:99b5ccf27215 3215
<> 133:99b5ccf27215 3216 /**
<> 133:99b5ccf27215 3217 * @brief Convolution of Q7 sequences.
<> 133:99b5ccf27215 3218 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3219 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3220 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3221 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3222 * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1.
<> 133:99b5ccf27215 3223 * @return none.
<> 133:99b5ccf27215 3224 */
<> 133:99b5ccf27215 3225
<> 133:99b5ccf27215 3226 void arm_conv_q7(
<> 133:99b5ccf27215 3227 q7_t * pSrcA,
<> 133:99b5ccf27215 3228 uint32_t srcALen,
<> 133:99b5ccf27215 3229 q7_t * pSrcB,
<> 133:99b5ccf27215 3230 uint32_t srcBLen,
<> 133:99b5ccf27215 3231 q7_t * pDst);
<> 133:99b5ccf27215 3232
<> 133:99b5ccf27215 3233
<> 133:99b5ccf27215 3234 /**
<> 133:99b5ccf27215 3235 * @brief Partial convolution of floating-point sequences.
<> 133:99b5ccf27215 3236 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3237 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3238 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3239 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3240 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3241 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3242 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3244 */
<> 133:99b5ccf27215 3245
<> 133:99b5ccf27215 3246 arm_status arm_conv_partial_f32(
<> 133:99b5ccf27215 3247 float32_t * pSrcA,
<> 133:99b5ccf27215 3248 uint32_t srcALen,
<> 133:99b5ccf27215 3249 float32_t * pSrcB,
<> 133:99b5ccf27215 3250 uint32_t srcBLen,
<> 133:99b5ccf27215 3251 float32_t * pDst,
<> 133:99b5ccf27215 3252 uint32_t firstIndex,
<> 133:99b5ccf27215 3253 uint32_t numPoints);
<> 133:99b5ccf27215 3254
<> 133:99b5ccf27215 3255 /**
<> 133:99b5ccf27215 3256 * @brief Partial convolution of Q15 sequences.
<> 133:99b5ccf27215 3257 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3258 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3259 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3260 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3261 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3262 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3263 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 3264 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3265 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3267 */
<> 133:99b5ccf27215 3268
<> 133:99b5ccf27215 3269 arm_status arm_conv_partial_opt_q15(
<> 133:99b5ccf27215 3270 q15_t * pSrcA,
<> 133:99b5ccf27215 3271 uint32_t srcALen,
<> 133:99b5ccf27215 3272 q15_t * pSrcB,
<> 133:99b5ccf27215 3273 uint32_t srcBLen,
<> 133:99b5ccf27215 3274 q15_t * pDst,
<> 133:99b5ccf27215 3275 uint32_t firstIndex,
<> 133:99b5ccf27215 3276 uint32_t numPoints,
<> 133:99b5ccf27215 3277 q15_t * pScratch1,
<> 133:99b5ccf27215 3278 q15_t * pScratch2);
<> 133:99b5ccf27215 3279
<> 133:99b5ccf27215 3280
<> 133:99b5ccf27215 3281 /**
<> 133:99b5ccf27215 3282 * @brief Partial convolution of Q15 sequences.
<> 133:99b5ccf27215 3283 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3284 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3285 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3286 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3287 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3288 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3289 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3291 */
<> 133:99b5ccf27215 3292
<> 133:99b5ccf27215 3293 arm_status arm_conv_partial_q15(
<> 133:99b5ccf27215 3294 q15_t * pSrcA,
<> 133:99b5ccf27215 3295 uint32_t srcALen,
<> 133:99b5ccf27215 3296 q15_t * pSrcB,
<> 133:99b5ccf27215 3297 uint32_t srcBLen,
<> 133:99b5ccf27215 3298 q15_t * pDst,
<> 133:99b5ccf27215 3299 uint32_t firstIndex,
<> 133:99b5ccf27215 3300 uint32_t numPoints);
<> 133:99b5ccf27215 3301
<> 133:99b5ccf27215 3302 /**
<> 133:99b5ccf27215 3303 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3304 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3305 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3306 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3307 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3308 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3309 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3310 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3312 */
<> 133:99b5ccf27215 3313
<> 133:99b5ccf27215 3314 arm_status arm_conv_partial_fast_q15(
<> 133:99b5ccf27215 3315 q15_t * pSrcA,
<> 133:99b5ccf27215 3316 uint32_t srcALen,
<> 133:99b5ccf27215 3317 q15_t * pSrcB,
<> 133:99b5ccf27215 3318 uint32_t srcBLen,
<> 133:99b5ccf27215 3319 q15_t * pDst,
<> 133:99b5ccf27215 3320 uint32_t firstIndex,
<> 133:99b5ccf27215 3321 uint32_t numPoints);
<> 133:99b5ccf27215 3322
<> 133:99b5ccf27215 3323
<> 133:99b5ccf27215 3324 /**
<> 133:99b5ccf27215 3325 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3326 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3327 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3328 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3329 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3330 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3331 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3332 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 3333 * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3334 * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3336 */
<> 133:99b5ccf27215 3337
<> 133:99b5ccf27215 3338 arm_status arm_conv_partial_fast_opt_q15(
<> 133:99b5ccf27215 3339 q15_t * pSrcA,
<> 133:99b5ccf27215 3340 uint32_t srcALen,
<> 133:99b5ccf27215 3341 q15_t * pSrcB,
<> 133:99b5ccf27215 3342 uint32_t srcBLen,
<> 133:99b5ccf27215 3343 q15_t * pDst,
<> 133:99b5ccf27215 3344 uint32_t firstIndex,
<> 133:99b5ccf27215 3345 uint32_t numPoints,
<> 133:99b5ccf27215 3346 q15_t * pScratch1,
<> 133:99b5ccf27215 3347 q15_t * pScratch2);
<> 133:99b5ccf27215 3348
<> 133:99b5ccf27215 3349
<> 133:99b5ccf27215 3350 /**
<> 133:99b5ccf27215 3351 * @brief Partial convolution of Q31 sequences.
<> 133:99b5ccf27215 3352 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3353 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3354 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3355 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3356 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3357 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3358 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3360 */
<> 133:99b5ccf27215 3361
<> 133:99b5ccf27215 3362 arm_status arm_conv_partial_q31(
<> 133:99b5ccf27215 3363 q31_t * pSrcA,
<> 133:99b5ccf27215 3364 uint32_t srcALen,
<> 133:99b5ccf27215 3365 q31_t * pSrcB,
<> 133:99b5ccf27215 3366 uint32_t srcBLen,
<> 133:99b5ccf27215 3367 q31_t * pDst,
<> 133:99b5ccf27215 3368 uint32_t firstIndex,
<> 133:99b5ccf27215 3369 uint32_t numPoints);
<> 133:99b5ccf27215 3370
<> 133:99b5ccf27215 3371
<> 133:99b5ccf27215 3372 /**
<> 133:99b5ccf27215 3373 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 3374 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3375 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3376 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3377 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3378 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3379 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3380 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3382 */
<> 133:99b5ccf27215 3383
<> 133:99b5ccf27215 3384 arm_status arm_conv_partial_fast_q31(
<> 133:99b5ccf27215 3385 q31_t * pSrcA,
<> 133:99b5ccf27215 3386 uint32_t srcALen,
<> 133:99b5ccf27215 3387 q31_t * pSrcB,
<> 133:99b5ccf27215 3388 uint32_t srcBLen,
<> 133:99b5ccf27215 3389 q31_t * pDst,
<> 133:99b5ccf27215 3390 uint32_t firstIndex,
<> 133:99b5ccf27215 3391 uint32_t numPoints);
<> 133:99b5ccf27215 3392
<> 133:99b5ccf27215 3393
<> 133:99b5ccf27215 3394 /**
<> 133:99b5ccf27215 3395 * @brief Partial convolution of Q7 sequences
<> 133:99b5ccf27215 3396 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3397 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3398 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3399 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3400 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3401 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3402 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 3403 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 3404 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3406 */
<> 133:99b5ccf27215 3407
<> 133:99b5ccf27215 3408 arm_status arm_conv_partial_opt_q7(
<> 133:99b5ccf27215 3409 q7_t * pSrcA,
<> 133:99b5ccf27215 3410 uint32_t srcALen,
<> 133:99b5ccf27215 3411 q7_t * pSrcB,
<> 133:99b5ccf27215 3412 uint32_t srcBLen,
<> 133:99b5ccf27215 3413 q7_t * pDst,
<> 133:99b5ccf27215 3414 uint32_t firstIndex,
<> 133:99b5ccf27215 3415 uint32_t numPoints,
<> 133:99b5ccf27215 3416 q15_t * pScratch1,
<> 133:99b5ccf27215 3417 q15_t * pScratch2);
<> 133:99b5ccf27215 3418
<> 133:99b5ccf27215 3419
<> 133:99b5ccf27215 3420 /**
<> 133:99b5ccf27215 3421 * @brief Partial convolution of Q7 sequences.
<> 133:99b5ccf27215 3422 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 3423 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 3424 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 3425 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 3426 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3427 * @param[in] firstIndex is the first output sample to start with.
<> 133:99b5ccf27215 3428 * @param[in] numPoints is the number of output points to be computed.
<> 133:99b5ccf27215 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].
<> 133:99b5ccf27215 3430 */
<> 133:99b5ccf27215 3431
<> 133:99b5ccf27215 3432 arm_status arm_conv_partial_q7(
<> 133:99b5ccf27215 3433 q7_t * pSrcA,
<> 133:99b5ccf27215 3434 uint32_t srcALen,
<> 133:99b5ccf27215 3435 q7_t * pSrcB,
<> 133:99b5ccf27215 3436 uint32_t srcBLen,
<> 133:99b5ccf27215 3437 q7_t * pDst,
<> 133:99b5ccf27215 3438 uint32_t firstIndex,
<> 133:99b5ccf27215 3439 uint32_t numPoints);
<> 133:99b5ccf27215 3440
<> 133:99b5ccf27215 3441
<> 133:99b5ccf27215 3442
<> 133:99b5ccf27215 3443 /**
<> 133:99b5ccf27215 3444 * @brief Instance structure for the Q15 FIR decimator.
<> 133:99b5ccf27215 3445 */
<> 133:99b5ccf27215 3446
<> 133:99b5ccf27215 3447 typedef struct
<> 133:99b5ccf27215 3448 {
<> 133:99b5ccf27215 3449 uint8_t M; /**< decimation factor. */
<> 133:99b5ccf27215 3450 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 3451 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 3452 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 3453 } arm_fir_decimate_instance_q15;
<> 133:99b5ccf27215 3454
<> 133:99b5ccf27215 3455 /**
<> 133:99b5ccf27215 3456 * @brief Instance structure for the Q31 FIR decimator.
<> 133:99b5ccf27215 3457 */
<> 133:99b5ccf27215 3458
<> 133:99b5ccf27215 3459 typedef struct
<> 133:99b5ccf27215 3460 {
<> 133:99b5ccf27215 3461 uint8_t M; /**< decimation factor. */
<> 133:99b5ccf27215 3462 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 3463 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 3464 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 3465
<> 133:99b5ccf27215 3466 } arm_fir_decimate_instance_q31;
<> 133:99b5ccf27215 3467
<> 133:99b5ccf27215 3468 /**
<> 133:99b5ccf27215 3469 * @brief Instance structure for the floating-point FIR decimator.
<> 133:99b5ccf27215 3470 */
<> 133:99b5ccf27215 3471
<> 133:99b5ccf27215 3472 typedef struct
<> 133:99b5ccf27215 3473 {
<> 133:99b5ccf27215 3474 uint8_t M; /**< decimation factor. */
<> 133:99b5ccf27215 3475 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 3476 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 3477 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 3478
<> 133:99b5ccf27215 3479 } arm_fir_decimate_instance_f32;
<> 133:99b5ccf27215 3480
<> 133:99b5ccf27215 3481
<> 133:99b5ccf27215 3482
<> 133:99b5ccf27215 3483 /**
<> 133:99b5ccf27215 3484 * @brief Processing function for the floating-point FIR decimator.
<> 133:99b5ccf27215 3485 * @param[in] *S points to an instance of the floating-point FIR decimator structure.
<> 133:99b5ccf27215 3486 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3487 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3488 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3489 * @return none
<> 133:99b5ccf27215 3490 */
<> 133:99b5ccf27215 3491
<> 133:99b5ccf27215 3492 void arm_fir_decimate_f32(
<> 133:99b5ccf27215 3493 const arm_fir_decimate_instance_f32 * S,
<> 133:99b5ccf27215 3494 float32_t * pSrc,
<> 133:99b5ccf27215 3495 float32_t * pDst,
<> 133:99b5ccf27215 3496 uint32_t blockSize);
<> 133:99b5ccf27215 3497
<> 133:99b5ccf27215 3498
<> 133:99b5ccf27215 3499 /**
<> 133:99b5ccf27215 3500 * @brief Initialization function for the floating-point FIR decimator.
<> 133:99b5ccf27215 3501 * @param[in,out] *S points to an instance of the floating-point FIR decimator structure.
<> 133:99b5ccf27215 3502 * @param[in] numTaps number of coefficients in the filter.
<> 133:99b5ccf27215 3503 * @param[in] M decimation factor.
<> 133:99b5ccf27215 3504 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3505 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3506 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3507 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3508 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 133:99b5ccf27215 3509 */
<> 133:99b5ccf27215 3510
<> 133:99b5ccf27215 3511 arm_status arm_fir_decimate_init_f32(
<> 133:99b5ccf27215 3512 arm_fir_decimate_instance_f32 * S,
<> 133:99b5ccf27215 3513 uint16_t numTaps,
<> 133:99b5ccf27215 3514 uint8_t M,
<> 133:99b5ccf27215 3515 float32_t * pCoeffs,
<> 133:99b5ccf27215 3516 float32_t * pState,
<> 133:99b5ccf27215 3517 uint32_t blockSize);
<> 133:99b5ccf27215 3518
<> 133:99b5ccf27215 3519 /**
<> 133:99b5ccf27215 3520 * @brief Processing function for the Q15 FIR decimator.
<> 133:99b5ccf27215 3521 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 133:99b5ccf27215 3522 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3523 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3524 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3525 * @return none
<> 133:99b5ccf27215 3526 */
<> 133:99b5ccf27215 3527
<> 133:99b5ccf27215 3528 void arm_fir_decimate_q15(
<> 133:99b5ccf27215 3529 const arm_fir_decimate_instance_q15 * S,
<> 133:99b5ccf27215 3530 q15_t * pSrc,
<> 133:99b5ccf27215 3531 q15_t * pDst,
<> 133:99b5ccf27215 3532 uint32_t blockSize);
<> 133:99b5ccf27215 3533
<> 133:99b5ccf27215 3534 /**
<> 133:99b5ccf27215 3535 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 3536 * @param[in] *S points to an instance of the Q15 FIR decimator structure.
<> 133:99b5ccf27215 3537 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3538 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3539 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3540 * @return none
<> 133:99b5ccf27215 3541 */
<> 133:99b5ccf27215 3542
<> 133:99b5ccf27215 3543 void arm_fir_decimate_fast_q15(
<> 133:99b5ccf27215 3544 const arm_fir_decimate_instance_q15 * S,
<> 133:99b5ccf27215 3545 q15_t * pSrc,
<> 133:99b5ccf27215 3546 q15_t * pDst,
<> 133:99b5ccf27215 3547 uint32_t blockSize);
<> 133:99b5ccf27215 3548
<> 133:99b5ccf27215 3549
<> 133:99b5ccf27215 3550
<> 133:99b5ccf27215 3551 /**
<> 133:99b5ccf27215 3552 * @brief Initialization function for the Q15 FIR decimator.
<> 133:99b5ccf27215 3553 * @param[in,out] *S points to an instance of the Q15 FIR decimator structure.
<> 133:99b5ccf27215 3554 * @param[in] numTaps number of coefficients in the filter.
<> 133:99b5ccf27215 3555 * @param[in] M decimation factor.
<> 133:99b5ccf27215 3556 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3557 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3558 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3559 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3560 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 133:99b5ccf27215 3561 */
<> 133:99b5ccf27215 3562
<> 133:99b5ccf27215 3563 arm_status arm_fir_decimate_init_q15(
<> 133:99b5ccf27215 3564 arm_fir_decimate_instance_q15 * S,
<> 133:99b5ccf27215 3565 uint16_t numTaps,
<> 133:99b5ccf27215 3566 uint8_t M,
<> 133:99b5ccf27215 3567 q15_t * pCoeffs,
<> 133:99b5ccf27215 3568 q15_t * pState,
<> 133:99b5ccf27215 3569 uint32_t blockSize);
<> 133:99b5ccf27215 3570
<> 133:99b5ccf27215 3571 /**
<> 133:99b5ccf27215 3572 * @brief Processing function for the Q31 FIR decimator.
<> 133:99b5ccf27215 3573 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 133:99b5ccf27215 3574 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3575 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3576 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3577 * @return none
<> 133:99b5ccf27215 3578 */
<> 133:99b5ccf27215 3579
<> 133:99b5ccf27215 3580 void arm_fir_decimate_q31(
<> 133:99b5ccf27215 3581 const arm_fir_decimate_instance_q31 * S,
<> 133:99b5ccf27215 3582 q31_t * pSrc,
<> 133:99b5ccf27215 3583 q31_t * pDst,
<> 133:99b5ccf27215 3584 uint32_t blockSize);
<> 133:99b5ccf27215 3585
<> 133:99b5ccf27215 3586 /**
<> 133:99b5ccf27215 3587 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 3588 * @param[in] *S points to an instance of the Q31 FIR decimator structure.
<> 133:99b5ccf27215 3589 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3590 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3591 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3592 * @return none
<> 133:99b5ccf27215 3593 */
<> 133:99b5ccf27215 3594
<> 133:99b5ccf27215 3595 void arm_fir_decimate_fast_q31(
<> 133:99b5ccf27215 3596 arm_fir_decimate_instance_q31 * S,
<> 133:99b5ccf27215 3597 q31_t * pSrc,
<> 133:99b5ccf27215 3598 q31_t * pDst,
<> 133:99b5ccf27215 3599 uint32_t blockSize);
<> 133:99b5ccf27215 3600
<> 133:99b5ccf27215 3601
<> 133:99b5ccf27215 3602 /**
<> 133:99b5ccf27215 3603 * @brief Initialization function for the Q31 FIR decimator.
<> 133:99b5ccf27215 3604 * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
<> 133:99b5ccf27215 3605 * @param[in] numTaps number of coefficients in the filter.
<> 133:99b5ccf27215 3606 * @param[in] M decimation factor.
<> 133:99b5ccf27215 3607 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3608 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3609 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3610 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3611 * <code>blockSize</code> is not a multiple of <code>M</code>.
<> 133:99b5ccf27215 3612 */
<> 133:99b5ccf27215 3613
<> 133:99b5ccf27215 3614 arm_status arm_fir_decimate_init_q31(
<> 133:99b5ccf27215 3615 arm_fir_decimate_instance_q31 * S,
<> 133:99b5ccf27215 3616 uint16_t numTaps,
<> 133:99b5ccf27215 3617 uint8_t M,
<> 133:99b5ccf27215 3618 q31_t * pCoeffs,
<> 133:99b5ccf27215 3619 q31_t * pState,
<> 133:99b5ccf27215 3620 uint32_t blockSize);
<> 133:99b5ccf27215 3621
<> 133:99b5ccf27215 3622
<> 133:99b5ccf27215 3623
<> 133:99b5ccf27215 3624 /**
<> 133:99b5ccf27215 3625 * @brief Instance structure for the Q15 FIR interpolator.
<> 133:99b5ccf27215 3626 */
<> 133:99b5ccf27215 3627
<> 133:99b5ccf27215 3628 typedef struct
<> 133:99b5ccf27215 3629 {
<> 133:99b5ccf27215 3630 uint8_t L; /**< upsample factor. */
<> 133:99b5ccf27215 3631 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 133:99b5ccf27215 3632 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 133:99b5ccf27215 3633 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 133:99b5ccf27215 3634 } arm_fir_interpolate_instance_q15;
<> 133:99b5ccf27215 3635
<> 133:99b5ccf27215 3636 /**
<> 133:99b5ccf27215 3637 * @brief Instance structure for the Q31 FIR interpolator.
<> 133:99b5ccf27215 3638 */
<> 133:99b5ccf27215 3639
<> 133:99b5ccf27215 3640 typedef struct
<> 133:99b5ccf27215 3641 {
<> 133:99b5ccf27215 3642 uint8_t L; /**< upsample factor. */
<> 133:99b5ccf27215 3643 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 133:99b5ccf27215 3644 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 133:99b5ccf27215 3645 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
<> 133:99b5ccf27215 3646 } arm_fir_interpolate_instance_q31;
<> 133:99b5ccf27215 3647
<> 133:99b5ccf27215 3648 /**
<> 133:99b5ccf27215 3649 * @brief Instance structure for the floating-point FIR interpolator.
<> 133:99b5ccf27215 3650 */
<> 133:99b5ccf27215 3651
<> 133:99b5ccf27215 3652 typedef struct
<> 133:99b5ccf27215 3653 {
<> 133:99b5ccf27215 3654 uint8_t L; /**< upsample factor. */
<> 133:99b5ccf27215 3655 uint16_t phaseLength; /**< length of each polyphase filter component. */
<> 133:99b5ccf27215 3656 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
<> 133:99b5ccf27215 3657 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
<> 133:99b5ccf27215 3658 } arm_fir_interpolate_instance_f32;
<> 133:99b5ccf27215 3659
<> 133:99b5ccf27215 3660
<> 133:99b5ccf27215 3661 /**
<> 133:99b5ccf27215 3662 * @brief Processing function for the Q15 FIR interpolator.
<> 133:99b5ccf27215 3663 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 133:99b5ccf27215 3664 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3665 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 3666 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3667 * @return none.
<> 133:99b5ccf27215 3668 */
<> 133:99b5ccf27215 3669
<> 133:99b5ccf27215 3670 void arm_fir_interpolate_q15(
<> 133:99b5ccf27215 3671 const arm_fir_interpolate_instance_q15 * S,
<> 133:99b5ccf27215 3672 q15_t * pSrc,
<> 133:99b5ccf27215 3673 q15_t * pDst,
<> 133:99b5ccf27215 3674 uint32_t blockSize);
<> 133:99b5ccf27215 3675
<> 133:99b5ccf27215 3676
<> 133:99b5ccf27215 3677 /**
<> 133:99b5ccf27215 3678 * @brief Initialization function for the Q15 FIR interpolator.
<> 133:99b5ccf27215 3679 * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure.
<> 133:99b5ccf27215 3680 * @param[in] L upsample factor.
<> 133:99b5ccf27215 3681 * @param[in] numTaps number of filter coefficients in the filter.
<> 133:99b5ccf27215 3682 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 133:99b5ccf27215 3683 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3684 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3685 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3686 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 133:99b5ccf27215 3687 */
<> 133:99b5ccf27215 3688
<> 133:99b5ccf27215 3689 arm_status arm_fir_interpolate_init_q15(
<> 133:99b5ccf27215 3690 arm_fir_interpolate_instance_q15 * S,
<> 133:99b5ccf27215 3691 uint8_t L,
<> 133:99b5ccf27215 3692 uint16_t numTaps,
<> 133:99b5ccf27215 3693 q15_t * pCoeffs,
<> 133:99b5ccf27215 3694 q15_t * pState,
<> 133:99b5ccf27215 3695 uint32_t blockSize);
<> 133:99b5ccf27215 3696
<> 133:99b5ccf27215 3697 /**
<> 133:99b5ccf27215 3698 * @brief Processing function for the Q31 FIR interpolator.
<> 133:99b5ccf27215 3699 * @param[in] *S points to an instance of the Q15 FIR interpolator structure.
<> 133:99b5ccf27215 3700 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3701 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 3702 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3703 * @return none.
<> 133:99b5ccf27215 3704 */
<> 133:99b5ccf27215 3705
<> 133:99b5ccf27215 3706 void arm_fir_interpolate_q31(
<> 133:99b5ccf27215 3707 const arm_fir_interpolate_instance_q31 * S,
<> 133:99b5ccf27215 3708 q31_t * pSrc,
<> 133:99b5ccf27215 3709 q31_t * pDst,
<> 133:99b5ccf27215 3710 uint32_t blockSize);
<> 133:99b5ccf27215 3711
<> 133:99b5ccf27215 3712 /**
<> 133:99b5ccf27215 3713 * @brief Initialization function for the Q31 FIR interpolator.
<> 133:99b5ccf27215 3714 * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure.
<> 133:99b5ccf27215 3715 * @param[in] L upsample factor.
<> 133:99b5ccf27215 3716 * @param[in] numTaps number of filter coefficients in the filter.
<> 133:99b5ccf27215 3717 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 133:99b5ccf27215 3718 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3719 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3720 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3721 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 133:99b5ccf27215 3722 */
<> 133:99b5ccf27215 3723
<> 133:99b5ccf27215 3724 arm_status arm_fir_interpolate_init_q31(
<> 133:99b5ccf27215 3725 arm_fir_interpolate_instance_q31 * S,
<> 133:99b5ccf27215 3726 uint8_t L,
<> 133:99b5ccf27215 3727 uint16_t numTaps,
<> 133:99b5ccf27215 3728 q31_t * pCoeffs,
<> 133:99b5ccf27215 3729 q31_t * pState,
<> 133:99b5ccf27215 3730 uint32_t blockSize);
<> 133:99b5ccf27215 3731
<> 133:99b5ccf27215 3732
<> 133:99b5ccf27215 3733 /**
<> 133:99b5ccf27215 3734 * @brief Processing function for the floating-point FIR interpolator.
<> 133:99b5ccf27215 3735 * @param[in] *S points to an instance of the floating-point FIR interpolator structure.
<> 133:99b5ccf27215 3736 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3737 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 3738 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3739 * @return none.
<> 133:99b5ccf27215 3740 */
<> 133:99b5ccf27215 3741
<> 133:99b5ccf27215 3742 void arm_fir_interpolate_f32(
<> 133:99b5ccf27215 3743 const arm_fir_interpolate_instance_f32 * S,
<> 133:99b5ccf27215 3744 float32_t * pSrc,
<> 133:99b5ccf27215 3745 float32_t * pDst,
<> 133:99b5ccf27215 3746 uint32_t blockSize);
<> 133:99b5ccf27215 3747
<> 133:99b5ccf27215 3748 /**
<> 133:99b5ccf27215 3749 * @brief Initialization function for the floating-point FIR interpolator.
<> 133:99b5ccf27215 3750 * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure.
<> 133:99b5ccf27215 3751 * @param[in] L upsample factor.
<> 133:99b5ccf27215 3752 * @param[in] numTaps number of filter coefficients in the filter.
<> 133:99b5ccf27215 3753 * @param[in] *pCoeffs points to the filter coefficient buffer.
<> 133:99b5ccf27215 3754 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3755 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 3756 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if
<> 133:99b5ccf27215 3757 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>.
<> 133:99b5ccf27215 3758 */
<> 133:99b5ccf27215 3759
<> 133:99b5ccf27215 3760 arm_status arm_fir_interpolate_init_f32(
<> 133:99b5ccf27215 3761 arm_fir_interpolate_instance_f32 * S,
<> 133:99b5ccf27215 3762 uint8_t L,
<> 133:99b5ccf27215 3763 uint16_t numTaps,
<> 133:99b5ccf27215 3764 float32_t * pCoeffs,
<> 133:99b5ccf27215 3765 float32_t * pState,
<> 133:99b5ccf27215 3766 uint32_t blockSize);
<> 133:99b5ccf27215 3767
<> 133:99b5ccf27215 3768 /**
<> 133:99b5ccf27215 3769 * @brief Instance structure for the high precision Q31 Biquad cascade filter.
<> 133:99b5ccf27215 3770 */
<> 133:99b5ccf27215 3771
<> 133:99b5ccf27215 3772 typedef struct
<> 133:99b5ccf27215 3773 {
<> 133:99b5ccf27215 3774 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 3775 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 133:99b5ccf27215 3776 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 3777 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
<> 133:99b5ccf27215 3778
<> 133:99b5ccf27215 3779 } arm_biquad_cas_df1_32x64_ins_q31;
<> 133:99b5ccf27215 3780
<> 133:99b5ccf27215 3781
<> 133:99b5ccf27215 3782 /**
<> 133:99b5ccf27215 3783 * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 133:99b5ccf27215 3784 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3785 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3786 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 3787 * @return none.
<> 133:99b5ccf27215 3788 */
<> 133:99b5ccf27215 3789
<> 133:99b5ccf27215 3790 void arm_biquad_cas_df1_32x64_q31(
<> 133:99b5ccf27215 3791 const arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 133:99b5ccf27215 3792 q31_t * pSrc,
<> 133:99b5ccf27215 3793 q31_t * pDst,
<> 133:99b5ccf27215 3794 uint32_t blockSize);
<> 133:99b5ccf27215 3795
<> 133:99b5ccf27215 3796
<> 133:99b5ccf27215 3797 /**
<> 133:99b5ccf27215 3798 * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure.
<> 133:99b5ccf27215 3799 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 3800 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3801 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3802 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format
<> 133:99b5ccf27215 3803 * @return none
<> 133:99b5ccf27215 3804 */
<> 133:99b5ccf27215 3805
<> 133:99b5ccf27215 3806 void arm_biquad_cas_df1_32x64_init_q31(
<> 133:99b5ccf27215 3807 arm_biquad_cas_df1_32x64_ins_q31 * S,
<> 133:99b5ccf27215 3808 uint8_t numStages,
<> 133:99b5ccf27215 3809 q31_t * pCoeffs,
<> 133:99b5ccf27215 3810 q63_t * pState,
<> 133:99b5ccf27215 3811 uint8_t postShift);
<> 133:99b5ccf27215 3812
<> 133:99b5ccf27215 3813
<> 133:99b5ccf27215 3814
<> 133:99b5ccf27215 3815 /**
<> 133:99b5ccf27215 3816 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3817 */
<> 133:99b5ccf27215 3818
<> 133:99b5ccf27215 3819 typedef struct
<> 133:99b5ccf27215 3820 {
<> 133:99b5ccf27215 3821 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 3822 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 133:99b5ccf27215 3823 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 3824 } arm_biquad_cascade_df2T_instance_f32;
<> 133:99b5ccf27215 3825
<> 133:99b5ccf27215 3826
<> 133:99b5ccf27215 3827
<> 133:99b5ccf27215 3828 /**
<> 133:99b5ccf27215 3829 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3830 */
<> 133:99b5ccf27215 3831
<> 133:99b5ccf27215 3832 typedef struct
<> 133:99b5ccf27215 3833 {
<> 133:99b5ccf27215 3834 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 3835 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
<> 133:99b5ccf27215 3836 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 3837 } arm_biquad_cascade_stereo_df2T_instance_f32;
<> 133:99b5ccf27215 3838
<> 133:99b5ccf27215 3839
<> 133:99b5ccf27215 3840
<> 133:99b5ccf27215 3841 /**
<> 133:99b5ccf27215 3842 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3843 */
<> 133:99b5ccf27215 3844
<> 133:99b5ccf27215 3845 typedef struct
<> 133:99b5ccf27215 3846 {
<> 133:99b5ccf27215 3847 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
<> 133:99b5ccf27215 3848 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
<> 133:99b5ccf27215 3849 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
<> 133:99b5ccf27215 3850 } arm_biquad_cascade_df2T_instance_f64;
<> 133:99b5ccf27215 3851
<> 133:99b5ccf27215 3852
<> 133:99b5ccf27215 3853 /**
<> 133:99b5ccf27215 3854 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3855 * @param[in] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3856 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3857 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3858 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 3859 * @return none.
<> 133:99b5ccf27215 3860 */
<> 133:99b5ccf27215 3861
<> 133:99b5ccf27215 3862 void arm_biquad_cascade_df2T_f32(
<> 133:99b5ccf27215 3863 const arm_biquad_cascade_df2T_instance_f32 * S,
<> 133:99b5ccf27215 3864 float32_t * pSrc,
<> 133:99b5ccf27215 3865 float32_t * pDst,
<> 133:99b5ccf27215 3866 uint32_t blockSize);
<> 133:99b5ccf27215 3867
<> 133:99b5ccf27215 3868
<> 133:99b5ccf27215 3869 /**
<> 133:99b5ccf27215 3870 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels
<> 133:99b5ccf27215 3871 * @param[in] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3872 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3873 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3874 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 3875 * @return none.
<> 133:99b5ccf27215 3876 */
<> 133:99b5ccf27215 3877
<> 133:99b5ccf27215 3878 void arm_biquad_cascade_stereo_df2T_f32(
<> 133:99b5ccf27215 3879 const arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 133:99b5ccf27215 3880 float32_t * pSrc,
<> 133:99b5ccf27215 3881 float32_t * pDst,
<> 133:99b5ccf27215 3882 uint32_t blockSize);
<> 133:99b5ccf27215 3883
<> 133:99b5ccf27215 3884 /**
<> 133:99b5ccf27215 3885 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3886 * @param[in] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3887 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 3888 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 3889 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 3890 * @return none.
<> 133:99b5ccf27215 3891 */
<> 133:99b5ccf27215 3892
<> 133:99b5ccf27215 3893 void arm_biquad_cascade_df2T_f64(
<> 133:99b5ccf27215 3894 const arm_biquad_cascade_df2T_instance_f64 * S,
<> 133:99b5ccf27215 3895 float64_t * pSrc,
<> 133:99b5ccf27215 3896 float64_t * pDst,
<> 133:99b5ccf27215 3897 uint32_t blockSize);
<> 133:99b5ccf27215 3898
<> 133:99b5ccf27215 3899
<> 133:99b5ccf27215 3900 /**
<> 133:99b5ccf27215 3901 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3902 * @param[in,out] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3903 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 3904 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3905 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3906 * @return none
<> 133:99b5ccf27215 3907 */
<> 133:99b5ccf27215 3908
<> 133:99b5ccf27215 3909 void arm_biquad_cascade_df2T_init_f32(
<> 133:99b5ccf27215 3910 arm_biquad_cascade_df2T_instance_f32 * S,
<> 133:99b5ccf27215 3911 uint8_t numStages,
<> 133:99b5ccf27215 3912 float32_t * pCoeffs,
<> 133:99b5ccf27215 3913 float32_t * pState);
<> 133:99b5ccf27215 3914
<> 133:99b5ccf27215 3915
<> 133:99b5ccf27215 3916 /**
<> 133:99b5ccf27215 3917 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3918 * @param[in,out] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3919 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 3920 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3921 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3922 * @return none
<> 133:99b5ccf27215 3923 */
<> 133:99b5ccf27215 3924
<> 133:99b5ccf27215 3925 void arm_biquad_cascade_stereo_df2T_init_f32(
<> 133:99b5ccf27215 3926 arm_biquad_cascade_stereo_df2T_instance_f32 * S,
<> 133:99b5ccf27215 3927 uint8_t numStages,
<> 133:99b5ccf27215 3928 float32_t * pCoeffs,
<> 133:99b5ccf27215 3929 float32_t * pState);
<> 133:99b5ccf27215 3930
<> 133:99b5ccf27215 3931
<> 133:99b5ccf27215 3932 /**
<> 133:99b5ccf27215 3933 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
<> 133:99b5ccf27215 3934 * @param[in,out] *S points to an instance of the filter data structure.
<> 133:99b5ccf27215 3935 * @param[in] numStages number of 2nd order stages in the filter.
<> 133:99b5ccf27215 3936 * @param[in] *pCoeffs points to the filter coefficients.
<> 133:99b5ccf27215 3937 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 3938 * @return none
<> 133:99b5ccf27215 3939 */
<> 133:99b5ccf27215 3940
<> 133:99b5ccf27215 3941 void arm_biquad_cascade_df2T_init_f64(
<> 133:99b5ccf27215 3942 arm_biquad_cascade_df2T_instance_f64 * S,
<> 133:99b5ccf27215 3943 uint8_t numStages,
<> 133:99b5ccf27215 3944 float64_t * pCoeffs,
<> 133:99b5ccf27215 3945 float64_t * pState);
<> 133:99b5ccf27215 3946
<> 133:99b5ccf27215 3947
<> 133:99b5ccf27215 3948
<> 133:99b5ccf27215 3949 /**
<> 133:99b5ccf27215 3950 * @brief Instance structure for the Q15 FIR lattice filter.
<> 133:99b5ccf27215 3951 */
<> 133:99b5ccf27215 3952
<> 133:99b5ccf27215 3953 typedef struct
<> 133:99b5ccf27215 3954 {
<> 133:99b5ccf27215 3955 uint16_t numStages; /**< number of filter stages. */
<> 133:99b5ccf27215 3956 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 133:99b5ccf27215 3957 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 3958 } arm_fir_lattice_instance_q15;
<> 133:99b5ccf27215 3959
<> 133:99b5ccf27215 3960 /**
<> 133:99b5ccf27215 3961 * @brief Instance structure for the Q31 FIR lattice filter.
<> 133:99b5ccf27215 3962 */
<> 133:99b5ccf27215 3963
<> 133:99b5ccf27215 3964 typedef struct
<> 133:99b5ccf27215 3965 {
<> 133:99b5ccf27215 3966 uint16_t numStages; /**< number of filter stages. */
<> 133:99b5ccf27215 3967 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 133:99b5ccf27215 3968 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 3969 } arm_fir_lattice_instance_q31;
<> 133:99b5ccf27215 3970
<> 133:99b5ccf27215 3971 /**
<> 133:99b5ccf27215 3972 * @brief Instance structure for the floating-point FIR lattice filter.
<> 133:99b5ccf27215 3973 */
<> 133:99b5ccf27215 3974
<> 133:99b5ccf27215 3975 typedef struct
<> 133:99b5ccf27215 3976 {
<> 133:99b5ccf27215 3977 uint16_t numStages; /**< number of filter stages. */
<> 133:99b5ccf27215 3978 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
<> 133:99b5ccf27215 3979 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 3980 } arm_fir_lattice_instance_f32;
<> 133:99b5ccf27215 3981
<> 133:99b5ccf27215 3982 /**
<> 133:99b5ccf27215 3983 * @brief Initialization function for the Q15 FIR lattice filter.
<> 133:99b5ccf27215 3984 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 133:99b5ccf27215 3985 * @param[in] numStages number of filter stages.
<> 133:99b5ccf27215 3986 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 3987 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 133:99b5ccf27215 3988 * @return none.
<> 133:99b5ccf27215 3989 */
<> 133:99b5ccf27215 3990
<> 133:99b5ccf27215 3991 void arm_fir_lattice_init_q15(
<> 133:99b5ccf27215 3992 arm_fir_lattice_instance_q15 * S,
<> 133:99b5ccf27215 3993 uint16_t numStages,
<> 133:99b5ccf27215 3994 q15_t * pCoeffs,
<> 133:99b5ccf27215 3995 q15_t * pState);
<> 133:99b5ccf27215 3996
<> 133:99b5ccf27215 3997
<> 133:99b5ccf27215 3998 /**
<> 133:99b5ccf27215 3999 * @brief Processing function for the Q15 FIR lattice filter.
<> 133:99b5ccf27215 4000 * @param[in] *S points to an instance of the Q15 FIR lattice structure.
<> 133:99b5ccf27215 4001 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4002 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 4003 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4004 * @return none.
<> 133:99b5ccf27215 4005 */
<> 133:99b5ccf27215 4006 void arm_fir_lattice_q15(
<> 133:99b5ccf27215 4007 const arm_fir_lattice_instance_q15 * S,
<> 133:99b5ccf27215 4008 q15_t * pSrc,
<> 133:99b5ccf27215 4009 q15_t * pDst,
<> 133:99b5ccf27215 4010 uint32_t blockSize);
<> 133:99b5ccf27215 4011
<> 133:99b5ccf27215 4012 /**
<> 133:99b5ccf27215 4013 * @brief Initialization function for the Q31 FIR lattice filter.
<> 133:99b5ccf27215 4014 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 133:99b5ccf27215 4015 * @param[in] numStages number of filter stages.
<> 133:99b5ccf27215 4016 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 4017 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 133:99b5ccf27215 4018 * @return none.
<> 133:99b5ccf27215 4019 */
<> 133:99b5ccf27215 4020
<> 133:99b5ccf27215 4021 void arm_fir_lattice_init_q31(
<> 133:99b5ccf27215 4022 arm_fir_lattice_instance_q31 * S,
<> 133:99b5ccf27215 4023 uint16_t numStages,
<> 133:99b5ccf27215 4024 q31_t * pCoeffs,
<> 133:99b5ccf27215 4025 q31_t * pState);
<> 133:99b5ccf27215 4026
<> 133:99b5ccf27215 4027
<> 133:99b5ccf27215 4028 /**
<> 133:99b5ccf27215 4029 * @brief Processing function for the Q31 FIR lattice filter.
<> 133:99b5ccf27215 4030 * @param[in] *S points to an instance of the Q31 FIR lattice structure.
<> 133:99b5ccf27215 4031 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4032 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4033 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4034 * @return none.
<> 133:99b5ccf27215 4035 */
<> 133:99b5ccf27215 4036
<> 133:99b5ccf27215 4037 void arm_fir_lattice_q31(
<> 133:99b5ccf27215 4038 const arm_fir_lattice_instance_q31 * S,
<> 133:99b5ccf27215 4039 q31_t * pSrc,
<> 133:99b5ccf27215 4040 q31_t * pDst,
<> 133:99b5ccf27215 4041 uint32_t blockSize);
<> 133:99b5ccf27215 4042
<> 133:99b5ccf27215 4043 /**
<> 133:99b5ccf27215 4044 * @brief Initialization function for the floating-point FIR lattice filter.
<> 133:99b5ccf27215 4045 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 133:99b5ccf27215 4046 * @param[in] numStages number of filter stages.
<> 133:99b5ccf27215 4047 * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 4048 * @param[in] *pState points to the state buffer. The array is of length numStages.
<> 133:99b5ccf27215 4049 * @return none.
<> 133:99b5ccf27215 4050 */
<> 133:99b5ccf27215 4051
<> 133:99b5ccf27215 4052 void arm_fir_lattice_init_f32(
<> 133:99b5ccf27215 4053 arm_fir_lattice_instance_f32 * S,
<> 133:99b5ccf27215 4054 uint16_t numStages,
<> 133:99b5ccf27215 4055 float32_t * pCoeffs,
<> 133:99b5ccf27215 4056 float32_t * pState);
<> 133:99b5ccf27215 4057
<> 133:99b5ccf27215 4058 /**
<> 133:99b5ccf27215 4059 * @brief Processing function for the floating-point FIR lattice filter.
<> 133:99b5ccf27215 4060 * @param[in] *S points to an instance of the floating-point FIR lattice structure.
<> 133:99b5ccf27215 4061 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4062 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4063 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4064 * @return none.
<> 133:99b5ccf27215 4065 */
<> 133:99b5ccf27215 4066
<> 133:99b5ccf27215 4067 void arm_fir_lattice_f32(
<> 133:99b5ccf27215 4068 const arm_fir_lattice_instance_f32 * S,
<> 133:99b5ccf27215 4069 float32_t * pSrc,
<> 133:99b5ccf27215 4070 float32_t * pDst,
<> 133:99b5ccf27215 4071 uint32_t blockSize);
<> 133:99b5ccf27215 4072
<> 133:99b5ccf27215 4073 /**
<> 133:99b5ccf27215 4074 * @brief Instance structure for the Q15 IIR lattice filter.
<> 133:99b5ccf27215 4075 */
<> 133:99b5ccf27215 4076 typedef struct
<> 133:99b5ccf27215 4077 {
<> 133:99b5ccf27215 4078 uint16_t numStages; /**< number of stages in the filter. */
<> 133:99b5ccf27215 4079 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 133:99b5ccf27215 4080 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 4081 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 133:99b5ccf27215 4082 } arm_iir_lattice_instance_q15;
<> 133:99b5ccf27215 4083
<> 133:99b5ccf27215 4084 /**
<> 133:99b5ccf27215 4085 * @brief Instance structure for the Q31 IIR lattice filter.
<> 133:99b5ccf27215 4086 */
<> 133:99b5ccf27215 4087 typedef struct
<> 133:99b5ccf27215 4088 {
<> 133:99b5ccf27215 4089 uint16_t numStages; /**< number of stages in the filter. */
<> 133:99b5ccf27215 4090 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 133:99b5ccf27215 4091 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 4092 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 133:99b5ccf27215 4093 } arm_iir_lattice_instance_q31;
<> 133:99b5ccf27215 4094
<> 133:99b5ccf27215 4095 /**
<> 133:99b5ccf27215 4096 * @brief Instance structure for the floating-point IIR lattice filter.
<> 133:99b5ccf27215 4097 */
<> 133:99b5ccf27215 4098 typedef struct
<> 133:99b5ccf27215 4099 {
<> 133:99b5ccf27215 4100 uint16_t numStages; /**< number of stages in the filter. */
<> 133:99b5ccf27215 4101 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
<> 133:99b5ccf27215 4102 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
<> 133:99b5ccf27215 4103 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
<> 133:99b5ccf27215 4104 } arm_iir_lattice_instance_f32;
<> 133:99b5ccf27215 4105
<> 133:99b5ccf27215 4106 /**
<> 133:99b5ccf27215 4107 * @brief Processing function for the floating-point IIR lattice filter.
<> 133:99b5ccf27215 4108 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 133:99b5ccf27215 4109 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4110 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 4111 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4112 * @return none.
<> 133:99b5ccf27215 4113 */
<> 133:99b5ccf27215 4114
<> 133:99b5ccf27215 4115 void arm_iir_lattice_f32(
<> 133:99b5ccf27215 4116 const arm_iir_lattice_instance_f32 * S,
<> 133:99b5ccf27215 4117 float32_t * pSrc,
<> 133:99b5ccf27215 4118 float32_t * pDst,
<> 133:99b5ccf27215 4119 uint32_t blockSize);
<> 133:99b5ccf27215 4120
<> 133:99b5ccf27215 4121 /**
<> 133:99b5ccf27215 4122 * @brief Initialization function for the floating-point IIR lattice filter.
<> 133:99b5ccf27215 4123 * @param[in] *S points to an instance of the floating-point IIR lattice structure.
<> 133:99b5ccf27215 4124 * @param[in] numStages number of stages in the filter.
<> 133:99b5ccf27215 4125 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 4126 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 133:99b5ccf27215 4127 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1.
<> 133:99b5ccf27215 4128 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4129 * @return none.
<> 133:99b5ccf27215 4130 */
<> 133:99b5ccf27215 4131
<> 133:99b5ccf27215 4132 void arm_iir_lattice_init_f32(
<> 133:99b5ccf27215 4133 arm_iir_lattice_instance_f32 * S,
<> 133:99b5ccf27215 4134 uint16_t numStages,
<> 133:99b5ccf27215 4135 float32_t * pkCoeffs,
<> 133:99b5ccf27215 4136 float32_t * pvCoeffs,
<> 133:99b5ccf27215 4137 float32_t * pState,
<> 133:99b5ccf27215 4138 uint32_t blockSize);
<> 133:99b5ccf27215 4139
<> 133:99b5ccf27215 4140
<> 133:99b5ccf27215 4141 /**
<> 133:99b5ccf27215 4142 * @brief Processing function for the Q31 IIR lattice filter.
<> 133:99b5ccf27215 4143 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 133:99b5ccf27215 4144 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4145 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 4146 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4147 * @return none.
<> 133:99b5ccf27215 4148 */
<> 133:99b5ccf27215 4149
<> 133:99b5ccf27215 4150 void arm_iir_lattice_q31(
<> 133:99b5ccf27215 4151 const arm_iir_lattice_instance_q31 * S,
<> 133:99b5ccf27215 4152 q31_t * pSrc,
<> 133:99b5ccf27215 4153 q31_t * pDst,
<> 133:99b5ccf27215 4154 uint32_t blockSize);
<> 133:99b5ccf27215 4155
<> 133:99b5ccf27215 4156
<> 133:99b5ccf27215 4157 /**
<> 133:99b5ccf27215 4158 * @brief Initialization function for the Q31 IIR lattice filter.
<> 133:99b5ccf27215 4159 * @param[in] *S points to an instance of the Q31 IIR lattice structure.
<> 133:99b5ccf27215 4160 * @param[in] numStages number of stages in the filter.
<> 133:99b5ccf27215 4161 * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 4162 * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
<> 133:99b5ccf27215 4163 * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
<> 133:99b5ccf27215 4164 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4165 * @return none.
<> 133:99b5ccf27215 4166 */
<> 133:99b5ccf27215 4167
<> 133:99b5ccf27215 4168 void arm_iir_lattice_init_q31(
<> 133:99b5ccf27215 4169 arm_iir_lattice_instance_q31 * S,
<> 133:99b5ccf27215 4170 uint16_t numStages,
<> 133:99b5ccf27215 4171 q31_t * pkCoeffs,
<> 133:99b5ccf27215 4172 q31_t * pvCoeffs,
<> 133:99b5ccf27215 4173 q31_t * pState,
<> 133:99b5ccf27215 4174 uint32_t blockSize);
<> 133:99b5ccf27215 4175
<> 133:99b5ccf27215 4176
<> 133:99b5ccf27215 4177 /**
<> 133:99b5ccf27215 4178 * @brief Processing function for the Q15 IIR lattice filter.
<> 133:99b5ccf27215 4179 * @param[in] *S points to an instance of the Q15 IIR lattice structure.
<> 133:99b5ccf27215 4180 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4181 * @param[out] *pDst points to the block of output data.
<> 133:99b5ccf27215 4182 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4183 * @return none.
<> 133:99b5ccf27215 4184 */
<> 133:99b5ccf27215 4185
<> 133:99b5ccf27215 4186 void arm_iir_lattice_q15(
<> 133:99b5ccf27215 4187 const arm_iir_lattice_instance_q15 * S,
<> 133:99b5ccf27215 4188 q15_t * pSrc,
<> 133:99b5ccf27215 4189 q15_t * pDst,
<> 133:99b5ccf27215 4190 uint32_t blockSize);
<> 133:99b5ccf27215 4191
<> 133:99b5ccf27215 4192
<> 133:99b5ccf27215 4193 /**
<> 133:99b5ccf27215 4194 * @brief Initialization function for the Q15 IIR lattice filter.
<> 133:99b5ccf27215 4195 * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
<> 133:99b5ccf27215 4196 * @param[in] numStages number of stages in the filter.
<> 133:99b5ccf27215 4197 * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
<> 133:99b5ccf27215 4198 * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
<> 133:99b5ccf27215 4199 * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
<> 133:99b5ccf27215 4200 * @param[in] blockSize number of samples to process per call.
<> 133:99b5ccf27215 4201 * @return none.
<> 133:99b5ccf27215 4202 */
<> 133:99b5ccf27215 4203
<> 133:99b5ccf27215 4204 void arm_iir_lattice_init_q15(
<> 133:99b5ccf27215 4205 arm_iir_lattice_instance_q15 * S,
<> 133:99b5ccf27215 4206 uint16_t numStages,
<> 133:99b5ccf27215 4207 q15_t * pkCoeffs,
<> 133:99b5ccf27215 4208 q15_t * pvCoeffs,
<> 133:99b5ccf27215 4209 q15_t * pState,
<> 133:99b5ccf27215 4210 uint32_t blockSize);
<> 133:99b5ccf27215 4211
<> 133:99b5ccf27215 4212 /**
<> 133:99b5ccf27215 4213 * @brief Instance structure for the floating-point LMS filter.
<> 133:99b5ccf27215 4214 */
<> 133:99b5ccf27215 4215
<> 133:99b5ccf27215 4216 typedef struct
<> 133:99b5ccf27215 4217 {
<> 133:99b5ccf27215 4218 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4219 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4220 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4221 float32_t mu; /**< step size that controls filter coefficient updates. */
<> 133:99b5ccf27215 4222 } arm_lms_instance_f32;
<> 133:99b5ccf27215 4223
<> 133:99b5ccf27215 4224 /**
<> 133:99b5ccf27215 4225 * @brief Processing function for floating-point LMS filter.
<> 133:99b5ccf27215 4226 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 133:99b5ccf27215 4227 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4228 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4229 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4230 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4231 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4232 * @return none.
<> 133:99b5ccf27215 4233 */
<> 133:99b5ccf27215 4234
<> 133:99b5ccf27215 4235 void arm_lms_f32(
<> 133:99b5ccf27215 4236 const arm_lms_instance_f32 * S,
<> 133:99b5ccf27215 4237 float32_t * pSrc,
<> 133:99b5ccf27215 4238 float32_t * pRef,
<> 133:99b5ccf27215 4239 float32_t * pOut,
<> 133:99b5ccf27215 4240 float32_t * pErr,
<> 133:99b5ccf27215 4241 uint32_t blockSize);
<> 133:99b5ccf27215 4242
<> 133:99b5ccf27215 4243 /**
<> 133:99b5ccf27215 4244 * @brief Initialization function for floating-point LMS filter.
<> 133:99b5ccf27215 4245 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 133:99b5ccf27215 4246 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4247 * @param[in] *pCoeffs points to the coefficient buffer.
<> 133:99b5ccf27215 4248 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 4249 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4250 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4251 * @return none.
<> 133:99b5ccf27215 4252 */
<> 133:99b5ccf27215 4253
<> 133:99b5ccf27215 4254 void arm_lms_init_f32(
<> 133:99b5ccf27215 4255 arm_lms_instance_f32 * S,
<> 133:99b5ccf27215 4256 uint16_t numTaps,
<> 133:99b5ccf27215 4257 float32_t * pCoeffs,
<> 133:99b5ccf27215 4258 float32_t * pState,
<> 133:99b5ccf27215 4259 float32_t mu,
<> 133:99b5ccf27215 4260 uint32_t blockSize);
<> 133:99b5ccf27215 4261
<> 133:99b5ccf27215 4262 /**
<> 133:99b5ccf27215 4263 * @brief Instance structure for the Q15 LMS filter.
<> 133:99b5ccf27215 4264 */
<> 133:99b5ccf27215 4265
<> 133:99b5ccf27215 4266 typedef struct
<> 133:99b5ccf27215 4267 {
<> 133:99b5ccf27215 4268 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4269 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4270 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4271 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 133:99b5ccf27215 4272 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 133:99b5ccf27215 4273 } arm_lms_instance_q15;
<> 133:99b5ccf27215 4274
<> 133:99b5ccf27215 4275
<> 133:99b5ccf27215 4276 /**
<> 133:99b5ccf27215 4277 * @brief Initialization function for the Q15 LMS filter.
<> 133:99b5ccf27215 4278 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 133:99b5ccf27215 4279 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4280 * @param[in] *pCoeffs points to the coefficient buffer.
<> 133:99b5ccf27215 4281 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 4282 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4283 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4284 * @param[in] postShift bit shift applied to coefficients.
<> 133:99b5ccf27215 4285 * @return none.
<> 133:99b5ccf27215 4286 */
<> 133:99b5ccf27215 4287
<> 133:99b5ccf27215 4288 void arm_lms_init_q15(
<> 133:99b5ccf27215 4289 arm_lms_instance_q15 * S,
<> 133:99b5ccf27215 4290 uint16_t numTaps,
<> 133:99b5ccf27215 4291 q15_t * pCoeffs,
<> 133:99b5ccf27215 4292 q15_t * pState,
<> 133:99b5ccf27215 4293 q15_t mu,
<> 133:99b5ccf27215 4294 uint32_t blockSize,
<> 133:99b5ccf27215 4295 uint32_t postShift);
<> 133:99b5ccf27215 4296
<> 133:99b5ccf27215 4297 /**
<> 133:99b5ccf27215 4298 * @brief Processing function for Q15 LMS filter.
<> 133:99b5ccf27215 4299 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 133:99b5ccf27215 4300 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4301 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4302 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4303 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4304 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4305 * @return none.
<> 133:99b5ccf27215 4306 */
<> 133:99b5ccf27215 4307
<> 133:99b5ccf27215 4308 void arm_lms_q15(
<> 133:99b5ccf27215 4309 const arm_lms_instance_q15 * S,
<> 133:99b5ccf27215 4310 q15_t * pSrc,
<> 133:99b5ccf27215 4311 q15_t * pRef,
<> 133:99b5ccf27215 4312 q15_t * pOut,
<> 133:99b5ccf27215 4313 q15_t * pErr,
<> 133:99b5ccf27215 4314 uint32_t blockSize);
<> 133:99b5ccf27215 4315
<> 133:99b5ccf27215 4316
<> 133:99b5ccf27215 4317 /**
<> 133:99b5ccf27215 4318 * @brief Instance structure for the Q31 LMS filter.
<> 133:99b5ccf27215 4319 */
<> 133:99b5ccf27215 4320
<> 133:99b5ccf27215 4321 typedef struct
<> 133:99b5ccf27215 4322 {
<> 133:99b5ccf27215 4323 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4324 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4325 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4326 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 133:99b5ccf27215 4327 uint32_t postShift; /**< bit shift applied to coefficients. */
<> 133:99b5ccf27215 4328
<> 133:99b5ccf27215 4329 } arm_lms_instance_q31;
<> 133:99b5ccf27215 4330
<> 133:99b5ccf27215 4331 /**
<> 133:99b5ccf27215 4332 * @brief Processing function for Q31 LMS filter.
<> 133:99b5ccf27215 4333 * @param[in] *S points to an instance of the Q15 LMS filter structure.
<> 133:99b5ccf27215 4334 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4335 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4336 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4337 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4338 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4339 * @return none.
<> 133:99b5ccf27215 4340 */
<> 133:99b5ccf27215 4341
<> 133:99b5ccf27215 4342 void arm_lms_q31(
<> 133:99b5ccf27215 4343 const arm_lms_instance_q31 * S,
<> 133:99b5ccf27215 4344 q31_t * pSrc,
<> 133:99b5ccf27215 4345 q31_t * pRef,
<> 133:99b5ccf27215 4346 q31_t * pOut,
<> 133:99b5ccf27215 4347 q31_t * pErr,
<> 133:99b5ccf27215 4348 uint32_t blockSize);
<> 133:99b5ccf27215 4349
<> 133:99b5ccf27215 4350 /**
<> 133:99b5ccf27215 4351 * @brief Initialization function for Q31 LMS filter.
<> 133:99b5ccf27215 4352 * @param[in] *S points to an instance of the Q31 LMS filter structure.
<> 133:99b5ccf27215 4353 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4354 * @param[in] *pCoeffs points to coefficient buffer.
<> 133:99b5ccf27215 4355 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 4356 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4357 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4358 * @param[in] postShift bit shift applied to coefficients.
<> 133:99b5ccf27215 4359 * @return none.
<> 133:99b5ccf27215 4360 */
<> 133:99b5ccf27215 4361
<> 133:99b5ccf27215 4362 void arm_lms_init_q31(
<> 133:99b5ccf27215 4363 arm_lms_instance_q31 * S,
<> 133:99b5ccf27215 4364 uint16_t numTaps,
<> 133:99b5ccf27215 4365 q31_t * pCoeffs,
<> 133:99b5ccf27215 4366 q31_t * pState,
<> 133:99b5ccf27215 4367 q31_t mu,
<> 133:99b5ccf27215 4368 uint32_t blockSize,
<> 133:99b5ccf27215 4369 uint32_t postShift);
<> 133:99b5ccf27215 4370
<> 133:99b5ccf27215 4371 /**
<> 133:99b5ccf27215 4372 * @brief Instance structure for the floating-point normalized LMS filter.
<> 133:99b5ccf27215 4373 */
<> 133:99b5ccf27215 4374
<> 133:99b5ccf27215 4375 typedef struct
<> 133:99b5ccf27215 4376 {
<> 133:99b5ccf27215 4377 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4378 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4379 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4380 float32_t mu; /**< step size that control filter coefficient updates. */
<> 133:99b5ccf27215 4381 float32_t energy; /**< saves previous frame energy. */
<> 133:99b5ccf27215 4382 float32_t x0; /**< saves previous input sample. */
<> 133:99b5ccf27215 4383 } arm_lms_norm_instance_f32;
<> 133:99b5ccf27215 4384
<> 133:99b5ccf27215 4385 /**
<> 133:99b5ccf27215 4386 * @brief Processing function for floating-point normalized LMS filter.
<> 133:99b5ccf27215 4387 * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
<> 133:99b5ccf27215 4388 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4389 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4390 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4391 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4392 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4393 * @return none.
<> 133:99b5ccf27215 4394 */
<> 133:99b5ccf27215 4395
<> 133:99b5ccf27215 4396 void arm_lms_norm_f32(
<> 133:99b5ccf27215 4397 arm_lms_norm_instance_f32 * S,
<> 133:99b5ccf27215 4398 float32_t * pSrc,
<> 133:99b5ccf27215 4399 float32_t * pRef,
<> 133:99b5ccf27215 4400 float32_t * pOut,
<> 133:99b5ccf27215 4401 float32_t * pErr,
<> 133:99b5ccf27215 4402 uint32_t blockSize);
<> 133:99b5ccf27215 4403
<> 133:99b5ccf27215 4404 /**
<> 133:99b5ccf27215 4405 * @brief Initialization function for floating-point normalized LMS filter.
<> 133:99b5ccf27215 4406 * @param[in] *S points to an instance of the floating-point LMS filter structure.
<> 133:99b5ccf27215 4407 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4408 * @param[in] *pCoeffs points to coefficient buffer.
<> 133:99b5ccf27215 4409 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 4410 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4411 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4412 * @return none.
<> 133:99b5ccf27215 4413 */
<> 133:99b5ccf27215 4414
<> 133:99b5ccf27215 4415 void arm_lms_norm_init_f32(
<> 133:99b5ccf27215 4416 arm_lms_norm_instance_f32 * S,
<> 133:99b5ccf27215 4417 uint16_t numTaps,
<> 133:99b5ccf27215 4418 float32_t * pCoeffs,
<> 133:99b5ccf27215 4419 float32_t * pState,
<> 133:99b5ccf27215 4420 float32_t mu,
<> 133:99b5ccf27215 4421 uint32_t blockSize);
<> 133:99b5ccf27215 4422
<> 133:99b5ccf27215 4423
<> 133:99b5ccf27215 4424 /**
<> 133:99b5ccf27215 4425 * @brief Instance structure for the Q31 normalized LMS filter.
<> 133:99b5ccf27215 4426 */
<> 133:99b5ccf27215 4427 typedef struct
<> 133:99b5ccf27215 4428 {
<> 133:99b5ccf27215 4429 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4430 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4431 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4432 q31_t mu; /**< step size that controls filter coefficient updates. */
<> 133:99b5ccf27215 4433 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 133:99b5ccf27215 4434 q31_t *recipTable; /**< points to the reciprocal initial value table. */
<> 133:99b5ccf27215 4435 q31_t energy; /**< saves previous frame energy. */
<> 133:99b5ccf27215 4436 q31_t x0; /**< saves previous input sample. */
<> 133:99b5ccf27215 4437 } arm_lms_norm_instance_q31;
<> 133:99b5ccf27215 4438
<> 133:99b5ccf27215 4439 /**
<> 133:99b5ccf27215 4440 * @brief Processing function for Q31 normalized LMS filter.
<> 133:99b5ccf27215 4441 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 133:99b5ccf27215 4442 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4443 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4444 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4445 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4446 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4447 * @return none.
<> 133:99b5ccf27215 4448 */
<> 133:99b5ccf27215 4449
<> 133:99b5ccf27215 4450 void arm_lms_norm_q31(
<> 133:99b5ccf27215 4451 arm_lms_norm_instance_q31 * S,
<> 133:99b5ccf27215 4452 q31_t * pSrc,
<> 133:99b5ccf27215 4453 q31_t * pRef,
<> 133:99b5ccf27215 4454 q31_t * pOut,
<> 133:99b5ccf27215 4455 q31_t * pErr,
<> 133:99b5ccf27215 4456 uint32_t blockSize);
<> 133:99b5ccf27215 4457
<> 133:99b5ccf27215 4458 /**
<> 133:99b5ccf27215 4459 * @brief Initialization function for Q31 normalized LMS filter.
<> 133:99b5ccf27215 4460 * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
<> 133:99b5ccf27215 4461 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4462 * @param[in] *pCoeffs points to coefficient buffer.
<> 133:99b5ccf27215 4463 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 4464 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4465 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4466 * @param[in] postShift bit shift applied to coefficients.
<> 133:99b5ccf27215 4467 * @return none.
<> 133:99b5ccf27215 4468 */
<> 133:99b5ccf27215 4469
<> 133:99b5ccf27215 4470 void arm_lms_norm_init_q31(
<> 133:99b5ccf27215 4471 arm_lms_norm_instance_q31 * S,
<> 133:99b5ccf27215 4472 uint16_t numTaps,
<> 133:99b5ccf27215 4473 q31_t * pCoeffs,
<> 133:99b5ccf27215 4474 q31_t * pState,
<> 133:99b5ccf27215 4475 q31_t mu,
<> 133:99b5ccf27215 4476 uint32_t blockSize,
<> 133:99b5ccf27215 4477 uint8_t postShift);
<> 133:99b5ccf27215 4478
<> 133:99b5ccf27215 4479 /**
<> 133:99b5ccf27215 4480 * @brief Instance structure for the Q15 normalized LMS filter.
<> 133:99b5ccf27215 4481 */
<> 133:99b5ccf27215 4482
<> 133:99b5ccf27215 4483 typedef struct
<> 133:99b5ccf27215 4484 {
<> 133:99b5ccf27215 4485 uint16_t numTaps; /**< Number of coefficients in the filter. */
<> 133:99b5ccf27215 4486 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
<> 133:99b5ccf27215 4487 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
<> 133:99b5ccf27215 4488 q15_t mu; /**< step size that controls filter coefficient updates. */
<> 133:99b5ccf27215 4489 uint8_t postShift; /**< bit shift applied to coefficients. */
<> 133:99b5ccf27215 4490 q15_t *recipTable; /**< Points to the reciprocal initial value table. */
<> 133:99b5ccf27215 4491 q15_t energy; /**< saves previous frame energy. */
<> 133:99b5ccf27215 4492 q15_t x0; /**< saves previous input sample. */
<> 133:99b5ccf27215 4493 } arm_lms_norm_instance_q15;
<> 133:99b5ccf27215 4494
<> 133:99b5ccf27215 4495 /**
<> 133:99b5ccf27215 4496 * @brief Processing function for Q15 normalized LMS filter.
<> 133:99b5ccf27215 4497 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 133:99b5ccf27215 4498 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4499 * @param[in] *pRef points to the block of reference data.
<> 133:99b5ccf27215 4500 * @param[out] *pOut points to the block of output data.
<> 133:99b5ccf27215 4501 * @param[out] *pErr points to the block of error data.
<> 133:99b5ccf27215 4502 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4503 * @return none.
<> 133:99b5ccf27215 4504 */
<> 133:99b5ccf27215 4505
<> 133:99b5ccf27215 4506 void arm_lms_norm_q15(
<> 133:99b5ccf27215 4507 arm_lms_norm_instance_q15 * S,
<> 133:99b5ccf27215 4508 q15_t * pSrc,
<> 133:99b5ccf27215 4509 q15_t * pRef,
<> 133:99b5ccf27215 4510 q15_t * pOut,
<> 133:99b5ccf27215 4511 q15_t * pErr,
<> 133:99b5ccf27215 4512 uint32_t blockSize);
<> 133:99b5ccf27215 4513
<> 133:99b5ccf27215 4514
<> 133:99b5ccf27215 4515 /**
<> 133:99b5ccf27215 4516 * @brief Initialization function for Q15 normalized LMS filter.
<> 133:99b5ccf27215 4517 * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
<> 133:99b5ccf27215 4518 * @param[in] numTaps number of filter coefficients.
<> 133:99b5ccf27215 4519 * @param[in] *pCoeffs points to coefficient buffer.
<> 133:99b5ccf27215 4520 * @param[in] *pState points to state buffer.
<> 133:99b5ccf27215 4521 * @param[in] mu step size that controls filter coefficient updates.
<> 133:99b5ccf27215 4522 * @param[in] blockSize number of samples to process.
<> 133:99b5ccf27215 4523 * @param[in] postShift bit shift applied to coefficients.
<> 133:99b5ccf27215 4524 * @return none.
<> 133:99b5ccf27215 4525 */
<> 133:99b5ccf27215 4526
<> 133:99b5ccf27215 4527 void arm_lms_norm_init_q15(
<> 133:99b5ccf27215 4528 arm_lms_norm_instance_q15 * S,
<> 133:99b5ccf27215 4529 uint16_t numTaps,
<> 133:99b5ccf27215 4530 q15_t * pCoeffs,
<> 133:99b5ccf27215 4531 q15_t * pState,
<> 133:99b5ccf27215 4532 q15_t mu,
<> 133:99b5ccf27215 4533 uint32_t blockSize,
<> 133:99b5ccf27215 4534 uint8_t postShift);
<> 133:99b5ccf27215 4535
<> 133:99b5ccf27215 4536 /**
<> 133:99b5ccf27215 4537 * @brief Correlation of floating-point sequences.
<> 133:99b5ccf27215 4538 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4539 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4540 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4541 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4542 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4543 * @return none.
<> 133:99b5ccf27215 4544 */
<> 133:99b5ccf27215 4545
<> 133:99b5ccf27215 4546 void arm_correlate_f32(
<> 133:99b5ccf27215 4547 float32_t * pSrcA,
<> 133:99b5ccf27215 4548 uint32_t srcALen,
<> 133:99b5ccf27215 4549 float32_t * pSrcB,
<> 133:99b5ccf27215 4550 uint32_t srcBLen,
<> 133:99b5ccf27215 4551 float32_t * pDst);
<> 133:99b5ccf27215 4552
<> 133:99b5ccf27215 4553
<> 133:99b5ccf27215 4554 /**
<> 133:99b5ccf27215 4555 * @brief Correlation of Q15 sequences
<> 133:99b5ccf27215 4556 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4557 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4558 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4559 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4560 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4561 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 4562 * @return none.
<> 133:99b5ccf27215 4563 */
<> 133:99b5ccf27215 4564 void arm_correlate_opt_q15(
<> 133:99b5ccf27215 4565 q15_t * pSrcA,
<> 133:99b5ccf27215 4566 uint32_t srcALen,
<> 133:99b5ccf27215 4567 q15_t * pSrcB,
<> 133:99b5ccf27215 4568 uint32_t srcBLen,
<> 133:99b5ccf27215 4569 q15_t * pDst,
<> 133:99b5ccf27215 4570 q15_t * pScratch);
<> 133:99b5ccf27215 4571
<> 133:99b5ccf27215 4572
<> 133:99b5ccf27215 4573 /**
<> 133:99b5ccf27215 4574 * @brief Correlation of Q15 sequences.
<> 133:99b5ccf27215 4575 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4576 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4577 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4578 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4579 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4580 * @return none.
<> 133:99b5ccf27215 4581 */
<> 133:99b5ccf27215 4582
<> 133:99b5ccf27215 4583 void arm_correlate_q15(
<> 133:99b5ccf27215 4584 q15_t * pSrcA,
<> 133:99b5ccf27215 4585 uint32_t srcALen,
<> 133:99b5ccf27215 4586 q15_t * pSrcB,
<> 133:99b5ccf27215 4587 uint32_t srcBLen,
<> 133:99b5ccf27215 4588 q15_t * pDst);
<> 133:99b5ccf27215 4589
<> 133:99b5ccf27215 4590 /**
<> 133:99b5ccf27215 4591 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 4592 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4593 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4594 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4595 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4596 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4597 * @return none.
<> 133:99b5ccf27215 4598 */
<> 133:99b5ccf27215 4599
<> 133:99b5ccf27215 4600 void arm_correlate_fast_q15(
<> 133:99b5ccf27215 4601 q15_t * pSrcA,
<> 133:99b5ccf27215 4602 uint32_t srcALen,
<> 133:99b5ccf27215 4603 q15_t * pSrcB,
<> 133:99b5ccf27215 4604 uint32_t srcBLen,
<> 133:99b5ccf27215 4605 q15_t * pDst);
<> 133:99b5ccf27215 4606
<> 133:99b5ccf27215 4607
<> 133:99b5ccf27215 4608
<> 133:99b5ccf27215 4609 /**
<> 133:99b5ccf27215 4610 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
<> 133:99b5ccf27215 4611 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4612 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4613 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4614 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4615 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4616 * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 4617 * @return none.
<> 133:99b5ccf27215 4618 */
<> 133:99b5ccf27215 4619
<> 133:99b5ccf27215 4620 void arm_correlate_fast_opt_q15(
<> 133:99b5ccf27215 4621 q15_t * pSrcA,
<> 133:99b5ccf27215 4622 uint32_t srcALen,
<> 133:99b5ccf27215 4623 q15_t * pSrcB,
<> 133:99b5ccf27215 4624 uint32_t srcBLen,
<> 133:99b5ccf27215 4625 q15_t * pDst,
<> 133:99b5ccf27215 4626 q15_t * pScratch);
<> 133:99b5ccf27215 4627
<> 133:99b5ccf27215 4628 /**
<> 133:99b5ccf27215 4629 * @brief Correlation of Q31 sequences.
<> 133:99b5ccf27215 4630 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4631 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4632 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4633 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4634 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4635 * @return none.
<> 133:99b5ccf27215 4636 */
<> 133:99b5ccf27215 4637
<> 133:99b5ccf27215 4638 void arm_correlate_q31(
<> 133:99b5ccf27215 4639 q31_t * pSrcA,
<> 133:99b5ccf27215 4640 uint32_t srcALen,
<> 133:99b5ccf27215 4641 q31_t * pSrcB,
<> 133:99b5ccf27215 4642 uint32_t srcBLen,
<> 133:99b5ccf27215 4643 q31_t * pDst);
<> 133:99b5ccf27215 4644
<> 133:99b5ccf27215 4645 /**
<> 133:99b5ccf27215 4646 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
<> 133:99b5ccf27215 4647 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4648 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4649 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4650 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4651 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4652 * @return none.
<> 133:99b5ccf27215 4653 */
<> 133:99b5ccf27215 4654
<> 133:99b5ccf27215 4655 void arm_correlate_fast_q31(
<> 133:99b5ccf27215 4656 q31_t * pSrcA,
<> 133:99b5ccf27215 4657 uint32_t srcALen,
<> 133:99b5ccf27215 4658 q31_t * pSrcB,
<> 133:99b5ccf27215 4659 uint32_t srcBLen,
<> 133:99b5ccf27215 4660 q31_t * pDst);
<> 133:99b5ccf27215 4661
<> 133:99b5ccf27215 4662
<> 133:99b5ccf27215 4663
<> 133:99b5ccf27215 4664 /**
<> 133:99b5ccf27215 4665 * @brief Correlation of Q7 sequences.
<> 133:99b5ccf27215 4666 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4667 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4668 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4669 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4670 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4671 * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
<> 133:99b5ccf27215 4672 * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
<> 133:99b5ccf27215 4673 * @return none.
<> 133:99b5ccf27215 4674 */
<> 133:99b5ccf27215 4675
<> 133:99b5ccf27215 4676 void arm_correlate_opt_q7(
<> 133:99b5ccf27215 4677 q7_t * pSrcA,
<> 133:99b5ccf27215 4678 uint32_t srcALen,
<> 133:99b5ccf27215 4679 q7_t * pSrcB,
<> 133:99b5ccf27215 4680 uint32_t srcBLen,
<> 133:99b5ccf27215 4681 q7_t * pDst,
<> 133:99b5ccf27215 4682 q15_t * pScratch1,
<> 133:99b5ccf27215 4683 q15_t * pScratch2);
<> 133:99b5ccf27215 4684
<> 133:99b5ccf27215 4685
<> 133:99b5ccf27215 4686 /**
<> 133:99b5ccf27215 4687 * @brief Correlation of Q7 sequences.
<> 133:99b5ccf27215 4688 * @param[in] *pSrcA points to the first input sequence.
<> 133:99b5ccf27215 4689 * @param[in] srcALen length of the first input sequence.
<> 133:99b5ccf27215 4690 * @param[in] *pSrcB points to the second input sequence.
<> 133:99b5ccf27215 4691 * @param[in] srcBLen length of the second input sequence.
<> 133:99b5ccf27215 4692 * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
<> 133:99b5ccf27215 4693 * @return none.
<> 133:99b5ccf27215 4694 */
<> 133:99b5ccf27215 4695
<> 133:99b5ccf27215 4696 void arm_correlate_q7(
<> 133:99b5ccf27215 4697 q7_t * pSrcA,
<> 133:99b5ccf27215 4698 uint32_t srcALen,
<> 133:99b5ccf27215 4699 q7_t * pSrcB,
<> 133:99b5ccf27215 4700 uint32_t srcBLen,
<> 133:99b5ccf27215 4701 q7_t * pDst);
<> 133:99b5ccf27215 4702
<> 133:99b5ccf27215 4703
<> 133:99b5ccf27215 4704 /**
<> 133:99b5ccf27215 4705 * @brief Instance structure for the floating-point sparse FIR filter.
<> 133:99b5ccf27215 4706 */
<> 133:99b5ccf27215 4707 typedef struct
<> 133:99b5ccf27215 4708 {
<> 133:99b5ccf27215 4709 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4710 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 133:99b5ccf27215 4711 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 133:99b5ccf27215 4712 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 4713 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 133:99b5ccf27215 4714 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 133:99b5ccf27215 4715 } arm_fir_sparse_instance_f32;
<> 133:99b5ccf27215 4716
<> 133:99b5ccf27215 4717 /**
<> 133:99b5ccf27215 4718 * @brief Instance structure for the Q31 sparse FIR filter.
<> 133:99b5ccf27215 4719 */
<> 133:99b5ccf27215 4720
<> 133:99b5ccf27215 4721 typedef struct
<> 133:99b5ccf27215 4722 {
<> 133:99b5ccf27215 4723 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4724 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 133:99b5ccf27215 4725 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 133:99b5ccf27215 4726 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 4727 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 133:99b5ccf27215 4728 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 133:99b5ccf27215 4729 } arm_fir_sparse_instance_q31;
<> 133:99b5ccf27215 4730
<> 133:99b5ccf27215 4731 /**
<> 133:99b5ccf27215 4732 * @brief Instance structure for the Q15 sparse FIR filter.
<> 133:99b5ccf27215 4733 */
<> 133:99b5ccf27215 4734
<> 133:99b5ccf27215 4735 typedef struct
<> 133:99b5ccf27215 4736 {
<> 133:99b5ccf27215 4737 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4738 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 133:99b5ccf27215 4739 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 133:99b5ccf27215 4740 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 4741 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 133:99b5ccf27215 4742 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 133:99b5ccf27215 4743 } arm_fir_sparse_instance_q15;
<> 133:99b5ccf27215 4744
<> 133:99b5ccf27215 4745 /**
<> 133:99b5ccf27215 4746 * @brief Instance structure for the Q7 sparse FIR filter.
<> 133:99b5ccf27215 4747 */
<> 133:99b5ccf27215 4748
<> 133:99b5ccf27215 4749 typedef struct
<> 133:99b5ccf27215 4750 {
<> 133:99b5ccf27215 4751 uint16_t numTaps; /**< number of coefficients in the filter. */
<> 133:99b5ccf27215 4752 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
<> 133:99b5ccf27215 4753 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
<> 133:99b5ccf27215 4754 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
<> 133:99b5ccf27215 4755 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
<> 133:99b5ccf27215 4756 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
<> 133:99b5ccf27215 4757 } arm_fir_sparse_instance_q7;
<> 133:99b5ccf27215 4758
<> 133:99b5ccf27215 4759 /**
<> 133:99b5ccf27215 4760 * @brief Processing function for the floating-point sparse FIR filter.
<> 133:99b5ccf27215 4761 * @param[in] *S points to an instance of the floating-point sparse FIR structure.
<> 133:99b5ccf27215 4762 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4763 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4764 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4765 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 4766 * @return none.
<> 133:99b5ccf27215 4767 */
<> 133:99b5ccf27215 4768
<> 133:99b5ccf27215 4769 void arm_fir_sparse_f32(
<> 133:99b5ccf27215 4770 arm_fir_sparse_instance_f32 * S,
<> 133:99b5ccf27215 4771 float32_t * pSrc,
<> 133:99b5ccf27215 4772 float32_t * pDst,
<> 133:99b5ccf27215 4773 float32_t * pScratchIn,
<> 133:99b5ccf27215 4774 uint32_t blockSize);
<> 133:99b5ccf27215 4775
<> 133:99b5ccf27215 4776 /**
<> 133:99b5ccf27215 4777 * @brief Initialization function for the floating-point sparse FIR filter.
<> 133:99b5ccf27215 4778 * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
<> 133:99b5ccf27215 4779 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 133:99b5ccf27215 4780 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 133:99b5ccf27215 4781 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 4782 * @param[in] *pTapDelay points to the array of offset times.
<> 133:99b5ccf27215 4783 * @param[in] maxDelay maximum offset time supported.
<> 133:99b5ccf27215 4784 * @param[in] blockSize number of samples that will be processed per block.
<> 133:99b5ccf27215 4785 * @return none
<> 133:99b5ccf27215 4786 */
<> 133:99b5ccf27215 4787
<> 133:99b5ccf27215 4788 void arm_fir_sparse_init_f32(
<> 133:99b5ccf27215 4789 arm_fir_sparse_instance_f32 * S,
<> 133:99b5ccf27215 4790 uint16_t numTaps,
<> 133:99b5ccf27215 4791 float32_t * pCoeffs,
<> 133:99b5ccf27215 4792 float32_t * pState,
<> 133:99b5ccf27215 4793 int32_t * pTapDelay,
<> 133:99b5ccf27215 4794 uint16_t maxDelay,
<> 133:99b5ccf27215 4795 uint32_t blockSize);
<> 133:99b5ccf27215 4796
<> 133:99b5ccf27215 4797 /**
<> 133:99b5ccf27215 4798 * @brief Processing function for the Q31 sparse FIR filter.
<> 133:99b5ccf27215 4799 * @param[in] *S points to an instance of the Q31 sparse FIR structure.
<> 133:99b5ccf27215 4800 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4801 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4802 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4803 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 4804 * @return none.
<> 133:99b5ccf27215 4805 */
<> 133:99b5ccf27215 4806
<> 133:99b5ccf27215 4807 void arm_fir_sparse_q31(
<> 133:99b5ccf27215 4808 arm_fir_sparse_instance_q31 * S,
<> 133:99b5ccf27215 4809 q31_t * pSrc,
<> 133:99b5ccf27215 4810 q31_t * pDst,
<> 133:99b5ccf27215 4811 q31_t * pScratchIn,
<> 133:99b5ccf27215 4812 uint32_t blockSize);
<> 133:99b5ccf27215 4813
<> 133:99b5ccf27215 4814 /**
<> 133:99b5ccf27215 4815 * @brief Initialization function for the Q31 sparse FIR filter.
<> 133:99b5ccf27215 4816 * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
<> 133:99b5ccf27215 4817 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 133:99b5ccf27215 4818 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 133:99b5ccf27215 4819 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 4820 * @param[in] *pTapDelay points to the array of offset times.
<> 133:99b5ccf27215 4821 * @param[in] maxDelay maximum offset time supported.
<> 133:99b5ccf27215 4822 * @param[in] blockSize number of samples that will be processed per block.
<> 133:99b5ccf27215 4823 * @return none
<> 133:99b5ccf27215 4824 */
<> 133:99b5ccf27215 4825
<> 133:99b5ccf27215 4826 void arm_fir_sparse_init_q31(
<> 133:99b5ccf27215 4827 arm_fir_sparse_instance_q31 * S,
<> 133:99b5ccf27215 4828 uint16_t numTaps,
<> 133:99b5ccf27215 4829 q31_t * pCoeffs,
<> 133:99b5ccf27215 4830 q31_t * pState,
<> 133:99b5ccf27215 4831 int32_t * pTapDelay,
<> 133:99b5ccf27215 4832 uint16_t maxDelay,
<> 133:99b5ccf27215 4833 uint32_t blockSize);
<> 133:99b5ccf27215 4834
<> 133:99b5ccf27215 4835 /**
<> 133:99b5ccf27215 4836 * @brief Processing function for the Q15 sparse FIR filter.
<> 133:99b5ccf27215 4837 * @param[in] *S points to an instance of the Q15 sparse FIR structure.
<> 133:99b5ccf27215 4838 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4839 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4840 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4841 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4842 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 4843 * @return none.
<> 133:99b5ccf27215 4844 */
<> 133:99b5ccf27215 4845
<> 133:99b5ccf27215 4846 void arm_fir_sparse_q15(
<> 133:99b5ccf27215 4847 arm_fir_sparse_instance_q15 * S,
<> 133:99b5ccf27215 4848 q15_t * pSrc,
<> 133:99b5ccf27215 4849 q15_t * pDst,
<> 133:99b5ccf27215 4850 q15_t * pScratchIn,
<> 133:99b5ccf27215 4851 q31_t * pScratchOut,
<> 133:99b5ccf27215 4852 uint32_t blockSize);
<> 133:99b5ccf27215 4853
<> 133:99b5ccf27215 4854
<> 133:99b5ccf27215 4855 /**
<> 133:99b5ccf27215 4856 * @brief Initialization function for the Q15 sparse FIR filter.
<> 133:99b5ccf27215 4857 * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
<> 133:99b5ccf27215 4858 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 133:99b5ccf27215 4859 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 133:99b5ccf27215 4860 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 4861 * @param[in] *pTapDelay points to the array of offset times.
<> 133:99b5ccf27215 4862 * @param[in] maxDelay maximum offset time supported.
<> 133:99b5ccf27215 4863 * @param[in] blockSize number of samples that will be processed per block.
<> 133:99b5ccf27215 4864 * @return none
<> 133:99b5ccf27215 4865 */
<> 133:99b5ccf27215 4866
<> 133:99b5ccf27215 4867 void arm_fir_sparse_init_q15(
<> 133:99b5ccf27215 4868 arm_fir_sparse_instance_q15 * S,
<> 133:99b5ccf27215 4869 uint16_t numTaps,
<> 133:99b5ccf27215 4870 q15_t * pCoeffs,
<> 133:99b5ccf27215 4871 q15_t * pState,
<> 133:99b5ccf27215 4872 int32_t * pTapDelay,
<> 133:99b5ccf27215 4873 uint16_t maxDelay,
<> 133:99b5ccf27215 4874 uint32_t blockSize);
<> 133:99b5ccf27215 4875
<> 133:99b5ccf27215 4876 /**
<> 133:99b5ccf27215 4877 * @brief Processing function for the Q7 sparse FIR filter.
<> 133:99b5ccf27215 4878 * @param[in] *S points to an instance of the Q7 sparse FIR structure.
<> 133:99b5ccf27215 4879 * @param[in] *pSrc points to the block of input data.
<> 133:99b5ccf27215 4880 * @param[out] *pDst points to the block of output data
<> 133:99b5ccf27215 4881 * @param[in] *pScratchIn points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4882 * @param[in] *pScratchOut points to a temporary buffer of size blockSize.
<> 133:99b5ccf27215 4883 * @param[in] blockSize number of input samples to process per call.
<> 133:99b5ccf27215 4884 * @return none.
<> 133:99b5ccf27215 4885 */
<> 133:99b5ccf27215 4886
<> 133:99b5ccf27215 4887 void arm_fir_sparse_q7(
<> 133:99b5ccf27215 4888 arm_fir_sparse_instance_q7 * S,
<> 133:99b5ccf27215 4889 q7_t * pSrc,
<> 133:99b5ccf27215 4890 q7_t * pDst,
<> 133:99b5ccf27215 4891 q7_t * pScratchIn,
<> 133:99b5ccf27215 4892 q31_t * pScratchOut,
<> 133:99b5ccf27215 4893 uint32_t blockSize);
<> 133:99b5ccf27215 4894
<> 133:99b5ccf27215 4895 /**
<> 133:99b5ccf27215 4896 * @brief Initialization function for the Q7 sparse FIR filter.
<> 133:99b5ccf27215 4897 * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
<> 133:99b5ccf27215 4898 * @param[in] numTaps number of nonzero coefficients in the filter.
<> 133:99b5ccf27215 4899 * @param[in] *pCoeffs points to the array of filter coefficients.
<> 133:99b5ccf27215 4900 * @param[in] *pState points to the state buffer.
<> 133:99b5ccf27215 4901 * @param[in] *pTapDelay points to the array of offset times.
<> 133:99b5ccf27215 4902 * @param[in] maxDelay maximum offset time supported.
<> 133:99b5ccf27215 4903 * @param[in] blockSize number of samples that will be processed per block.
<> 133:99b5ccf27215 4904 * @return none
<> 133:99b5ccf27215 4905 */
<> 133:99b5ccf27215 4906
<> 133:99b5ccf27215 4907 void arm_fir_sparse_init_q7(
<> 133:99b5ccf27215 4908 arm_fir_sparse_instance_q7 * S,
<> 133:99b5ccf27215 4909 uint16_t numTaps,
<> 133:99b5ccf27215 4910 q7_t * pCoeffs,
<> 133:99b5ccf27215 4911 q7_t * pState,
<> 133:99b5ccf27215 4912 int32_t * pTapDelay,
<> 133:99b5ccf27215 4913 uint16_t maxDelay,
<> 133:99b5ccf27215 4914 uint32_t blockSize);
<> 133:99b5ccf27215 4915
<> 133:99b5ccf27215 4916
<> 133:99b5ccf27215 4917 /*
<> 133:99b5ccf27215 4918 * @brief Floating-point sin_cos function.
<> 133:99b5ccf27215 4919 * @param[in] theta input value in degrees
<> 133:99b5ccf27215 4920 * @param[out] *pSinVal points to the processed sine output.
<> 133:99b5ccf27215 4921 * @param[out] *pCosVal points to the processed cos output.
<> 133:99b5ccf27215 4922 * @return none.
<> 133:99b5ccf27215 4923 */
<> 133:99b5ccf27215 4924
<> 133:99b5ccf27215 4925 void arm_sin_cos_f32(
<> 133:99b5ccf27215 4926 float32_t theta,
<> 133:99b5ccf27215 4927 float32_t * pSinVal,
<> 133:99b5ccf27215 4928 float32_t * pCcosVal);
<> 133:99b5ccf27215 4929
<> 133:99b5ccf27215 4930 /*
<> 133:99b5ccf27215 4931 * @brief Q31 sin_cos function.
<> 133:99b5ccf27215 4932 * @param[in] theta scaled input value in degrees
<> 133:99b5ccf27215 4933 * @param[out] *pSinVal points to the processed sine output.
<> 133:99b5ccf27215 4934 * @param[out] *pCosVal points to the processed cosine output.
<> 133:99b5ccf27215 4935 * @return none.
<> 133:99b5ccf27215 4936 */
<> 133:99b5ccf27215 4937
<> 133:99b5ccf27215 4938 void arm_sin_cos_q31(
<> 133:99b5ccf27215 4939 q31_t theta,
<> 133:99b5ccf27215 4940 q31_t * pSinVal,
<> 133:99b5ccf27215 4941 q31_t * pCosVal);
<> 133:99b5ccf27215 4942
<> 133:99b5ccf27215 4943
<> 133:99b5ccf27215 4944 /**
<> 133:99b5ccf27215 4945 * @brief Floating-point complex conjugate.
<> 133:99b5ccf27215 4946 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 4947 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 4948 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 4949 * @return none.
<> 133:99b5ccf27215 4950 */
<> 133:99b5ccf27215 4951
<> 133:99b5ccf27215 4952 void arm_cmplx_conj_f32(
<> 133:99b5ccf27215 4953 float32_t * pSrc,
<> 133:99b5ccf27215 4954 float32_t * pDst,
<> 133:99b5ccf27215 4955 uint32_t numSamples);
<> 133:99b5ccf27215 4956
<> 133:99b5ccf27215 4957 /**
<> 133:99b5ccf27215 4958 * @brief Q31 complex conjugate.
<> 133:99b5ccf27215 4959 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 4960 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 4961 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 4962 * @return none.
<> 133:99b5ccf27215 4963 */
<> 133:99b5ccf27215 4964
<> 133:99b5ccf27215 4965 void arm_cmplx_conj_q31(
<> 133:99b5ccf27215 4966 q31_t * pSrc,
<> 133:99b5ccf27215 4967 q31_t * pDst,
<> 133:99b5ccf27215 4968 uint32_t numSamples);
<> 133:99b5ccf27215 4969
<> 133:99b5ccf27215 4970 /**
<> 133:99b5ccf27215 4971 * @brief Q15 complex conjugate.
<> 133:99b5ccf27215 4972 * @param[in] *pSrc points to the input vector
<> 133:99b5ccf27215 4973 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 4974 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 4975 * @return none.
<> 133:99b5ccf27215 4976 */
<> 133:99b5ccf27215 4977
<> 133:99b5ccf27215 4978 void arm_cmplx_conj_q15(
<> 133:99b5ccf27215 4979 q15_t * pSrc,
<> 133:99b5ccf27215 4980 q15_t * pDst,
<> 133:99b5ccf27215 4981 uint32_t numSamples);
<> 133:99b5ccf27215 4982
<> 133:99b5ccf27215 4983
<> 133:99b5ccf27215 4984
<> 133:99b5ccf27215 4985 /**
<> 133:99b5ccf27215 4986 * @brief Floating-point complex magnitude squared
<> 133:99b5ccf27215 4987 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 4988 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 4989 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 4990 * @return none.
<> 133:99b5ccf27215 4991 */
<> 133:99b5ccf27215 4992
<> 133:99b5ccf27215 4993 void arm_cmplx_mag_squared_f32(
<> 133:99b5ccf27215 4994 float32_t * pSrc,
<> 133:99b5ccf27215 4995 float32_t * pDst,
<> 133:99b5ccf27215 4996 uint32_t numSamples);
<> 133:99b5ccf27215 4997
<> 133:99b5ccf27215 4998 /**
<> 133:99b5ccf27215 4999 * @brief Q31 complex magnitude squared
<> 133:99b5ccf27215 5000 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 5001 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 5002 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 5003 * @return none.
<> 133:99b5ccf27215 5004 */
<> 133:99b5ccf27215 5005
<> 133:99b5ccf27215 5006 void arm_cmplx_mag_squared_q31(
<> 133:99b5ccf27215 5007 q31_t * pSrc,
<> 133:99b5ccf27215 5008 q31_t * pDst,
<> 133:99b5ccf27215 5009 uint32_t numSamples);
<> 133:99b5ccf27215 5010
<> 133:99b5ccf27215 5011 /**
<> 133:99b5ccf27215 5012 * @brief Q15 complex magnitude squared
<> 133:99b5ccf27215 5013 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 5014 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 5015 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 5016 * @return none.
<> 133:99b5ccf27215 5017 */
<> 133:99b5ccf27215 5018
<> 133:99b5ccf27215 5019 void arm_cmplx_mag_squared_q15(
<> 133:99b5ccf27215 5020 q15_t * pSrc,
<> 133:99b5ccf27215 5021 q15_t * pDst,
<> 133:99b5ccf27215 5022 uint32_t numSamples);
<> 133:99b5ccf27215 5023
<> 133:99b5ccf27215 5024
<> 133:99b5ccf27215 5025 /**
<> 133:99b5ccf27215 5026 * @ingroup groupController
<> 133:99b5ccf27215 5027 */
<> 133:99b5ccf27215 5028
<> 133:99b5ccf27215 5029 /**
<> 133:99b5ccf27215 5030 * @defgroup PID PID Motor Control
<> 133:99b5ccf27215 5031 *
<> 133:99b5ccf27215 5032 * A Proportional Integral Derivative (PID) controller is a generic feedback control
<> 133:99b5ccf27215 5033 * loop mechanism widely used in industrial control systems.
<> 133:99b5ccf27215 5034 * A PID controller is the most commonly used type of feedback controller.
<> 133:99b5ccf27215 5035 *
<> 133:99b5ccf27215 5036 * This set of functions implements (PID) controllers
<> 133:99b5ccf27215 5037 * for Q15, Q31, and floating-point data types. The functions operate on a single sample
<> 133:99b5ccf27215 5038 * of data and each call to the function returns a single processed value.
<> 133:99b5ccf27215 5039 * <code>S</code> points to an instance of the PID control data structure. <code>in</code>
<> 133:99b5ccf27215 5040 * is the input sample value. The functions return the output value.
<> 133:99b5ccf27215 5041 *
<> 133:99b5ccf27215 5042 * \par Algorithm:
<> 133:99b5ccf27215 5043 * <pre>
<> 133:99b5ccf27215 5044 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
<> 133:99b5ccf27215 5045 * A0 = Kp + Ki + Kd
<> 133:99b5ccf27215 5046 * A1 = (-Kp ) - (2 * Kd )
<> 133:99b5ccf27215 5047 * A2 = Kd </pre>
<> 133:99b5ccf27215 5048 *
<> 133:99b5ccf27215 5049 * \par
<> 133:99b5ccf27215 5050 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant
<> 133:99b5ccf27215 5051 *
<> 133:99b5ccf27215 5052 * \par
<> 133:99b5ccf27215 5053 * \image html PID.gif "Proportional Integral Derivative Controller"
<> 133:99b5ccf27215 5054 *
<> 133:99b5ccf27215 5055 * \par
<> 133:99b5ccf27215 5056 * The PID controller calculates an "error" value as the difference between
<> 133:99b5ccf27215 5057 * the measured output and the reference input.
<> 133:99b5ccf27215 5058 * The controller attempts to minimize the error by adjusting the process control inputs.
<> 133:99b5ccf27215 5059 * The proportional value determines the reaction to the current error,
<> 133:99b5ccf27215 5060 * the integral value determines the reaction based on the sum of recent errors,
<> 133:99b5ccf27215 5061 * and the derivative value determines the reaction based on the rate at which the error has been changing.
<> 133:99b5ccf27215 5062 *
<> 133:99b5ccf27215 5063 * \par Instance Structure
<> 133:99b5ccf27215 5064 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure.
<> 133:99b5ccf27215 5065 * A separate instance structure must be defined for each PID Controller.
<> 133:99b5ccf27215 5066 * There are separate instance structure declarations for each of the 3 supported data types.
<> 133:99b5ccf27215 5067 *
<> 133:99b5ccf27215 5068 * \par Reset Functions
<> 133:99b5ccf27215 5069 * There is also an associated reset function for each data type which clears the state array.
<> 133:99b5ccf27215 5070 *
<> 133:99b5ccf27215 5071 * \par Initialization Functions
<> 133:99b5ccf27215 5072 * There is also an associated initialization function for each data type.
<> 133:99b5ccf27215 5073 * The initialization function performs the following operations:
<> 133:99b5ccf27215 5074 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains.
<> 133:99b5ccf27215 5075 * - Zeros out the values in the state buffer.
<> 133:99b5ccf27215 5076 *
<> 133:99b5ccf27215 5077 * \par
<> 133:99b5ccf27215 5078 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function.
<> 133:99b5ccf27215 5079 *
<> 133:99b5ccf27215 5080 * \par Fixed-Point Behavior
<> 133:99b5ccf27215 5081 * Care must be taken when using the fixed-point versions of the PID Controller functions.
<> 133:99b5ccf27215 5082 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
<> 133:99b5ccf27215 5083 * Refer to the function specific documentation below for usage guidelines.
<> 133:99b5ccf27215 5084 */
<> 133:99b5ccf27215 5085
<> 133:99b5ccf27215 5086 /**
<> 133:99b5ccf27215 5087 * @addtogroup PID
<> 133:99b5ccf27215 5088 * @{
<> 133:99b5ccf27215 5089 */
<> 133:99b5ccf27215 5090
<> 133:99b5ccf27215 5091 /**
<> 133:99b5ccf27215 5092 * @brief Process function for the floating-point PID Control.
<> 133:99b5ccf27215 5093 * @param[in,out] *S is an instance of the floating-point PID Control structure
<> 133:99b5ccf27215 5094 * @param[in] in input sample to process
<> 133:99b5ccf27215 5095 * @return out processed output sample.
<> 133:99b5ccf27215 5096 */
<> 133:99b5ccf27215 5097
<> 133:99b5ccf27215 5098
<> 133:99b5ccf27215 5099 static __INLINE float32_t arm_pid_f32(
<> 133:99b5ccf27215 5100 arm_pid_instance_f32 * S,
<> 133:99b5ccf27215 5101 float32_t in)
<> 133:99b5ccf27215 5102 {
<> 133:99b5ccf27215 5103 float32_t out;
<> 133:99b5ccf27215 5104
<> 133:99b5ccf27215 5105 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
<> 133:99b5ccf27215 5106 out = (S->A0 * in) +
<> 133:99b5ccf27215 5107 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
<> 133:99b5ccf27215 5108
<> 133:99b5ccf27215 5109 /* Update state */
<> 133:99b5ccf27215 5110 S->state[1] = S->state[0];
<> 133:99b5ccf27215 5111 S->state[0] = in;
<> 133:99b5ccf27215 5112 S->state[2] = out;
<> 133:99b5ccf27215 5113
<> 133:99b5ccf27215 5114 /* return to application */
<> 133:99b5ccf27215 5115 return (out);
<> 133:99b5ccf27215 5116
<> 133:99b5ccf27215 5117 }
<> 133:99b5ccf27215 5118
<> 133:99b5ccf27215 5119 /**
<> 133:99b5ccf27215 5120 * @brief Process function for the Q31 PID Control.
<> 133:99b5ccf27215 5121 * @param[in,out] *S points to an instance of the Q31 PID Control structure
<> 133:99b5ccf27215 5122 * @param[in] in input sample to process
<> 133:99b5ccf27215 5123 * @return out processed output sample.
<> 133:99b5ccf27215 5124 *
<> 133:99b5ccf27215 5125 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5126 * \par
<> 133:99b5ccf27215 5127 * The function is implemented using an internal 64-bit accumulator.
<> 133:99b5ccf27215 5128 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit.
<> 133:99b5ccf27215 5129 * Thus, if the accumulator result overflows it wraps around rather than clip.
<> 133:99b5ccf27215 5130 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions.
<> 133:99b5ccf27215 5131 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
<> 133:99b5ccf27215 5132 */
<> 133:99b5ccf27215 5133
<> 133:99b5ccf27215 5134 static __INLINE q31_t arm_pid_q31(
<> 133:99b5ccf27215 5135 arm_pid_instance_q31 * S,
<> 133:99b5ccf27215 5136 q31_t in)
<> 133:99b5ccf27215 5137 {
<> 133:99b5ccf27215 5138 q63_t acc;
<> 133:99b5ccf27215 5139 q31_t out;
<> 133:99b5ccf27215 5140
<> 133:99b5ccf27215 5141 /* acc = A0 * x[n] */
<> 133:99b5ccf27215 5142 acc = (q63_t) S->A0 * in;
<> 133:99b5ccf27215 5143
<> 133:99b5ccf27215 5144 /* acc += A1 * x[n-1] */
<> 133:99b5ccf27215 5145 acc += (q63_t) S->A1 * S->state[0];
<> 133:99b5ccf27215 5146
<> 133:99b5ccf27215 5147 /* acc += A2 * x[n-2] */
<> 133:99b5ccf27215 5148 acc += (q63_t) S->A2 * S->state[1];
<> 133:99b5ccf27215 5149
<> 133:99b5ccf27215 5150 /* convert output to 1.31 format to add y[n-1] */
<> 133:99b5ccf27215 5151 out = (q31_t) (acc >> 31u);
<> 133:99b5ccf27215 5152
<> 133:99b5ccf27215 5153 /* out += y[n-1] */
<> 133:99b5ccf27215 5154 out += S->state[2];
<> 133:99b5ccf27215 5155
<> 133:99b5ccf27215 5156 /* Update state */
<> 133:99b5ccf27215 5157 S->state[1] = S->state[0];
<> 133:99b5ccf27215 5158 S->state[0] = in;
<> 133:99b5ccf27215 5159 S->state[2] = out;
<> 133:99b5ccf27215 5160
<> 133:99b5ccf27215 5161 /* return to application */
<> 133:99b5ccf27215 5162 return (out);
<> 133:99b5ccf27215 5163
<> 133:99b5ccf27215 5164 }
<> 133:99b5ccf27215 5165
<> 133:99b5ccf27215 5166 /**
<> 133:99b5ccf27215 5167 * @brief Process function for the Q15 PID Control.
<> 133:99b5ccf27215 5168 * @param[in,out] *S points to an instance of the Q15 PID Control structure
<> 133:99b5ccf27215 5169 * @param[in] in input sample to process
<> 133:99b5ccf27215 5170 * @return out processed output sample.
<> 133:99b5ccf27215 5171 *
<> 133:99b5ccf27215 5172 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5173 * \par
<> 133:99b5ccf27215 5174 * The function is implemented using a 64-bit internal accumulator.
<> 133:99b5ccf27215 5175 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result.
<> 133:99b5ccf27215 5176 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format.
<> 133:99b5ccf27215 5177 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved.
<> 133:99b5ccf27215 5178 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits.
<> 133:99b5ccf27215 5179 * Lastly, the accumulator is saturated to yield a result in 1.15 format.
<> 133:99b5ccf27215 5180 */
<> 133:99b5ccf27215 5181
<> 133:99b5ccf27215 5182 static __INLINE q15_t arm_pid_q15(
<> 133:99b5ccf27215 5183 arm_pid_instance_q15 * S,
<> 133:99b5ccf27215 5184 q15_t in)
<> 133:99b5ccf27215 5185 {
<> 133:99b5ccf27215 5186 q63_t acc;
<> 133:99b5ccf27215 5187 q15_t out;
<> 133:99b5ccf27215 5188
<> 133:99b5ccf27215 5189 #ifndef ARM_MATH_CM0_FAMILY
<> 133:99b5ccf27215 5190 __SIMD32_TYPE *vstate;
<> 133:99b5ccf27215 5191
<> 133:99b5ccf27215 5192 /* Implementation of PID controller */
<> 133:99b5ccf27215 5193
<> 133:99b5ccf27215 5194 /* acc = A0 * x[n] */
<> 133:99b5ccf27215 5195 acc = (q31_t) __SMUAD(S->A0, in);
<> 133:99b5ccf27215 5196
<> 133:99b5ccf27215 5197 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 133:99b5ccf27215 5198 vstate = __SIMD32_CONST(S->state);
<> 133:99b5ccf27215 5199 acc = __SMLALD(S->A1, (q31_t) *vstate, acc);
<> 133:99b5ccf27215 5200
<> 133:99b5ccf27215 5201 #else
<> 133:99b5ccf27215 5202 /* acc = A0 * x[n] */
<> 133:99b5ccf27215 5203 acc = ((q31_t) S->A0) * in;
<> 133:99b5ccf27215 5204
<> 133:99b5ccf27215 5205 /* acc += A1 * x[n-1] + A2 * x[n-2] */
<> 133:99b5ccf27215 5206 acc += (q31_t) S->A1 * S->state[0];
<> 133:99b5ccf27215 5207 acc += (q31_t) S->A2 * S->state[1];
<> 133:99b5ccf27215 5208
<> 133:99b5ccf27215 5209 #endif
<> 133:99b5ccf27215 5210
<> 133:99b5ccf27215 5211 /* acc += y[n-1] */
<> 133:99b5ccf27215 5212 acc += (q31_t) S->state[2] << 15;
<> 133:99b5ccf27215 5213
<> 133:99b5ccf27215 5214 /* saturate the output */
<> 133:99b5ccf27215 5215 out = (q15_t) (__SSAT((acc >> 15), 16));
<> 133:99b5ccf27215 5216
<> 133:99b5ccf27215 5217 /* Update state */
<> 133:99b5ccf27215 5218 S->state[1] = S->state[0];
<> 133:99b5ccf27215 5219 S->state[0] = in;
<> 133:99b5ccf27215 5220 S->state[2] = out;
<> 133:99b5ccf27215 5221
<> 133:99b5ccf27215 5222 /* return to application */
<> 133:99b5ccf27215 5223 return (out);
<> 133:99b5ccf27215 5224
<> 133:99b5ccf27215 5225 }
<> 133:99b5ccf27215 5226
<> 133:99b5ccf27215 5227 /**
<> 133:99b5ccf27215 5228 * @} end of PID group
<> 133:99b5ccf27215 5229 */
<> 133:99b5ccf27215 5230
<> 133:99b5ccf27215 5231
<> 133:99b5ccf27215 5232 /**
<> 133:99b5ccf27215 5233 * @brief Floating-point matrix inverse.
<> 133:99b5ccf27215 5234 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 133:99b5ccf27215 5235 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 133:99b5ccf27215 5236 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 133:99b5ccf27215 5237 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 133:99b5ccf27215 5238 */
<> 133:99b5ccf27215 5239
<> 133:99b5ccf27215 5240 arm_status arm_mat_inverse_f32(
<> 133:99b5ccf27215 5241 const arm_matrix_instance_f32 * src,
<> 133:99b5ccf27215 5242 arm_matrix_instance_f32 * dst);
<> 133:99b5ccf27215 5243
<> 133:99b5ccf27215 5244
<> 133:99b5ccf27215 5245 /**
<> 133:99b5ccf27215 5246 * @brief Floating-point matrix inverse.
<> 133:99b5ccf27215 5247 * @param[in] *src points to the instance of the input floating-point matrix structure.
<> 133:99b5ccf27215 5248 * @param[out] *dst points to the instance of the output floating-point matrix structure.
<> 133:99b5ccf27215 5249 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match.
<> 133:99b5ccf27215 5250 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR.
<> 133:99b5ccf27215 5251 */
<> 133:99b5ccf27215 5252
<> 133:99b5ccf27215 5253 arm_status arm_mat_inverse_f64(
<> 133:99b5ccf27215 5254 const arm_matrix_instance_f64 * src,
<> 133:99b5ccf27215 5255 arm_matrix_instance_f64 * dst);
<> 133:99b5ccf27215 5256
<> 133:99b5ccf27215 5257
<> 133:99b5ccf27215 5258
<> 133:99b5ccf27215 5259 /**
<> 133:99b5ccf27215 5260 * @ingroup groupController
<> 133:99b5ccf27215 5261 */
<> 133:99b5ccf27215 5262
<> 133:99b5ccf27215 5263
<> 133:99b5ccf27215 5264 /**
<> 133:99b5ccf27215 5265 * @defgroup clarke Vector Clarke Transform
<> 133:99b5ccf27215 5266 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector.
<> 133:99b5ccf27215 5267 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents
<> 133:99b5ccf27215 5268 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>.
<> 133:99b5ccf27215 5269 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below
<> 133:99b5ccf27215 5270 * \image html clarke.gif Stator current space vector and its components in (a,b).
<> 133:99b5ccf27215 5271 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code>
<> 133:99b5ccf27215 5272 * can be calculated using only <code>Ia</code> and <code>Ib</code>.
<> 133:99b5ccf27215 5273 *
<> 133:99b5ccf27215 5274 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 133:99b5ccf27215 5275 * The library provides separate functions for Q31 and floating-point data types.
<> 133:99b5ccf27215 5276 * \par Algorithm
<> 133:99b5ccf27215 5277 * \image html clarkeFormula.gif
<> 133:99b5ccf27215 5278 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and
<> 133:99b5ccf27215 5279 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector.
<> 133:99b5ccf27215 5280 * \par Fixed-Point Behavior
<> 133:99b5ccf27215 5281 * Care must be taken when using the Q31 version of the Clarke transform.
<> 133:99b5ccf27215 5282 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 133:99b5ccf27215 5283 * Refer to the function specific documentation below for usage guidelines.
<> 133:99b5ccf27215 5284 */
<> 133:99b5ccf27215 5285
<> 133:99b5ccf27215 5286 /**
<> 133:99b5ccf27215 5287 * @addtogroup clarke
<> 133:99b5ccf27215 5288 * @{
<> 133:99b5ccf27215 5289 */
<> 133:99b5ccf27215 5290
<> 133:99b5ccf27215 5291 /**
<> 133:99b5ccf27215 5292 *
<> 133:99b5ccf27215 5293 * @brief Floating-point Clarke transform
<> 133:99b5ccf27215 5294 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 133:99b5ccf27215 5295 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 133:99b5ccf27215 5296 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5297 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5298 * @return none.
<> 133:99b5ccf27215 5299 */
<> 133:99b5ccf27215 5300
<> 133:99b5ccf27215 5301 static __INLINE void arm_clarke_f32(
<> 133:99b5ccf27215 5302 float32_t Ia,
<> 133:99b5ccf27215 5303 float32_t Ib,
<> 133:99b5ccf27215 5304 float32_t * pIalpha,
<> 133:99b5ccf27215 5305 float32_t * pIbeta)
<> 133:99b5ccf27215 5306 {
<> 133:99b5ccf27215 5307 /* Calculate pIalpha using the equation, pIalpha = Ia */
<> 133:99b5ccf27215 5308 *pIalpha = Ia;
<> 133:99b5ccf27215 5309
<> 133:99b5ccf27215 5310 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
<> 133:99b5ccf27215 5311 *pIbeta =
<> 133:99b5ccf27215 5312 ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
<> 133:99b5ccf27215 5313
<> 133:99b5ccf27215 5314 }
<> 133:99b5ccf27215 5315
<> 133:99b5ccf27215 5316 /**
<> 133:99b5ccf27215 5317 * @brief Clarke transform for Q31 version
<> 133:99b5ccf27215 5318 * @param[in] Ia input three-phase coordinate <code>a</code>
<> 133:99b5ccf27215 5319 * @param[in] Ib input three-phase coordinate <code>b</code>
<> 133:99b5ccf27215 5320 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5321 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5322 * @return none.
<> 133:99b5ccf27215 5323 *
<> 133:99b5ccf27215 5324 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5325 * \par
<> 133:99b5ccf27215 5326 * The function is implemented using an internal 32-bit accumulator.
<> 133:99b5ccf27215 5327 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 133:99b5ccf27215 5328 * There is saturation on the addition, hence there is no risk of overflow.
<> 133:99b5ccf27215 5329 */
<> 133:99b5ccf27215 5330
<> 133:99b5ccf27215 5331 static __INLINE void arm_clarke_q31(
<> 133:99b5ccf27215 5332 q31_t Ia,
<> 133:99b5ccf27215 5333 q31_t Ib,
<> 133:99b5ccf27215 5334 q31_t * pIalpha,
<> 133:99b5ccf27215 5335 q31_t * pIbeta)
<> 133:99b5ccf27215 5336 {
<> 133:99b5ccf27215 5337 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5338
<> 133:99b5ccf27215 5339 /* Calculating pIalpha from Ia by equation pIalpha = Ia */
<> 133:99b5ccf27215 5340 *pIalpha = Ia;
<> 133:99b5ccf27215 5341
<> 133:99b5ccf27215 5342 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
<> 133:99b5ccf27215 5343 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
<> 133:99b5ccf27215 5344
<> 133:99b5ccf27215 5345 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
<> 133:99b5ccf27215 5346 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
<> 133:99b5ccf27215 5347
<> 133:99b5ccf27215 5348 /* pIbeta is calculated by adding the intermediate products */
<> 133:99b5ccf27215 5349 *pIbeta = __QADD(product1, product2);
<> 133:99b5ccf27215 5350 }
<> 133:99b5ccf27215 5351
<> 133:99b5ccf27215 5352 /**
<> 133:99b5ccf27215 5353 * @} end of clarke group
<> 133:99b5ccf27215 5354 */
<> 133:99b5ccf27215 5355
<> 133:99b5ccf27215 5356 /**
<> 133:99b5ccf27215 5357 * @brief Converts the elements of the Q7 vector to Q31 vector.
<> 133:99b5ccf27215 5358 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 5359 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 5360 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 5361 * @return none.
<> 133:99b5ccf27215 5362 */
<> 133:99b5ccf27215 5363 void arm_q7_to_q31(
<> 133:99b5ccf27215 5364 q7_t * pSrc,
<> 133:99b5ccf27215 5365 q31_t * pDst,
<> 133:99b5ccf27215 5366 uint32_t blockSize);
<> 133:99b5ccf27215 5367
<> 133:99b5ccf27215 5368
<> 133:99b5ccf27215 5369
<> 133:99b5ccf27215 5370
<> 133:99b5ccf27215 5371 /**
<> 133:99b5ccf27215 5372 * @ingroup groupController
<> 133:99b5ccf27215 5373 */
<> 133:99b5ccf27215 5374
<> 133:99b5ccf27215 5375 /**
<> 133:99b5ccf27215 5376 * @defgroup inv_clarke Vector Inverse Clarke Transform
<> 133:99b5ccf27215 5377 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases.
<> 133:99b5ccf27215 5378 *
<> 133:99b5ccf27215 5379 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 133:99b5ccf27215 5380 * The library provides separate functions for Q31 and floating-point data types.
<> 133:99b5ccf27215 5381 * \par Algorithm
<> 133:99b5ccf27215 5382 * \image html clarkeInvFormula.gif
<> 133:99b5ccf27215 5383 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and
<> 133:99b5ccf27215 5384 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector.
<> 133:99b5ccf27215 5385 * \par Fixed-Point Behavior
<> 133:99b5ccf27215 5386 * Care must be taken when using the Q31 version of the Clarke transform.
<> 133:99b5ccf27215 5387 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 133:99b5ccf27215 5388 * Refer to the function specific documentation below for usage guidelines.
<> 133:99b5ccf27215 5389 */
<> 133:99b5ccf27215 5390
<> 133:99b5ccf27215 5391 /**
<> 133:99b5ccf27215 5392 * @addtogroup inv_clarke
<> 133:99b5ccf27215 5393 * @{
<> 133:99b5ccf27215 5394 */
<> 133:99b5ccf27215 5395
<> 133:99b5ccf27215 5396 /**
<> 133:99b5ccf27215 5397 * @brief Floating-point Inverse Clarke transform
<> 133:99b5ccf27215 5398 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5399 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5400 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 133:99b5ccf27215 5401 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 133:99b5ccf27215 5402 * @return none.
<> 133:99b5ccf27215 5403 */
<> 133:99b5ccf27215 5404
<> 133:99b5ccf27215 5405
<> 133:99b5ccf27215 5406 static __INLINE void arm_inv_clarke_f32(
<> 133:99b5ccf27215 5407 float32_t Ialpha,
<> 133:99b5ccf27215 5408 float32_t Ibeta,
<> 133:99b5ccf27215 5409 float32_t * pIa,
<> 133:99b5ccf27215 5410 float32_t * pIb)
<> 133:99b5ccf27215 5411 {
<> 133:99b5ccf27215 5412 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 133:99b5ccf27215 5413 *pIa = Ialpha;
<> 133:99b5ccf27215 5414
<> 133:99b5ccf27215 5415 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
<> 133:99b5ccf27215 5416 *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
<> 133:99b5ccf27215 5417
<> 133:99b5ccf27215 5418 }
<> 133:99b5ccf27215 5419
<> 133:99b5ccf27215 5420 /**
<> 133:99b5ccf27215 5421 * @brief Inverse Clarke transform for Q31 version
<> 133:99b5ccf27215 5422 * @param[in] Ialpha input two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5423 * @param[in] Ibeta input two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5424 * @param[out] *pIa points to output three-phase coordinate <code>a</code>
<> 133:99b5ccf27215 5425 * @param[out] *pIb points to output three-phase coordinate <code>b</code>
<> 133:99b5ccf27215 5426 * @return none.
<> 133:99b5ccf27215 5427 *
<> 133:99b5ccf27215 5428 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5429 * \par
<> 133:99b5ccf27215 5430 * The function is implemented using an internal 32-bit accumulator.
<> 133:99b5ccf27215 5431 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 133:99b5ccf27215 5432 * There is saturation on the subtraction, hence there is no risk of overflow.
<> 133:99b5ccf27215 5433 */
<> 133:99b5ccf27215 5434
<> 133:99b5ccf27215 5435 static __INLINE void arm_inv_clarke_q31(
<> 133:99b5ccf27215 5436 q31_t Ialpha,
<> 133:99b5ccf27215 5437 q31_t Ibeta,
<> 133:99b5ccf27215 5438 q31_t * pIa,
<> 133:99b5ccf27215 5439 q31_t * pIb)
<> 133:99b5ccf27215 5440 {
<> 133:99b5ccf27215 5441 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5442
<> 133:99b5ccf27215 5443 /* Calculating pIa from Ialpha by equation pIa = Ialpha */
<> 133:99b5ccf27215 5444 *pIa = Ialpha;
<> 133:99b5ccf27215 5445
<> 133:99b5ccf27215 5446 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
<> 133:99b5ccf27215 5447 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
<> 133:99b5ccf27215 5448
<> 133:99b5ccf27215 5449 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
<> 133:99b5ccf27215 5450 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
<> 133:99b5ccf27215 5451
<> 133:99b5ccf27215 5452 /* pIb is calculated by subtracting the products */
<> 133:99b5ccf27215 5453 *pIb = __QSUB(product2, product1);
<> 133:99b5ccf27215 5454
<> 133:99b5ccf27215 5455 }
<> 133:99b5ccf27215 5456
<> 133:99b5ccf27215 5457 /**
<> 133:99b5ccf27215 5458 * @} end of inv_clarke group
<> 133:99b5ccf27215 5459 */
<> 133:99b5ccf27215 5460
<> 133:99b5ccf27215 5461 /**
<> 133:99b5ccf27215 5462 * @brief Converts the elements of the Q7 vector to Q15 vector.
<> 133:99b5ccf27215 5463 * @param[in] *pSrc input pointer
<> 133:99b5ccf27215 5464 * @param[out] *pDst output pointer
<> 133:99b5ccf27215 5465 * @param[in] blockSize number of samples to process
<> 133:99b5ccf27215 5466 * @return none.
<> 133:99b5ccf27215 5467 */
<> 133:99b5ccf27215 5468 void arm_q7_to_q15(
<> 133:99b5ccf27215 5469 q7_t * pSrc,
<> 133:99b5ccf27215 5470 q15_t * pDst,
<> 133:99b5ccf27215 5471 uint32_t blockSize);
<> 133:99b5ccf27215 5472
<> 133:99b5ccf27215 5473
<> 133:99b5ccf27215 5474
<> 133:99b5ccf27215 5475 /**
<> 133:99b5ccf27215 5476 * @ingroup groupController
<> 133:99b5ccf27215 5477 */
<> 133:99b5ccf27215 5478
<> 133:99b5ccf27215 5479 /**
<> 133:99b5ccf27215 5480 * @defgroup park Vector Park Transform
<> 133:99b5ccf27215 5481 *
<> 133:99b5ccf27215 5482 * Forward Park transform converts the input two-coordinate vector to flux and torque components.
<> 133:99b5ccf27215 5483 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents
<> 133:99b5ccf27215 5484 * from the stationary to the moving reference frame and control the spatial relationship between
<> 133:99b5ccf27215 5485 * the stator vector current and rotor flux vector.
<> 133:99b5ccf27215 5486 * If we consider the d axis aligned with the rotor flux, the diagram below shows the
<> 133:99b5ccf27215 5487 * current vector and the relationship from the two reference frames:
<> 133:99b5ccf27215 5488 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame"
<> 133:99b5ccf27215 5489 *
<> 133:99b5ccf27215 5490 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 133:99b5ccf27215 5491 * The library provides separate functions for Q31 and floating-point data types.
<> 133:99b5ccf27215 5492 * \par Algorithm
<> 133:99b5ccf27215 5493 * \image html parkFormula.gif
<> 133:99b5ccf27215 5494 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components,
<> 133:99b5ccf27215 5495 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 133:99b5ccf27215 5496 * cosine and sine values of theta (rotor flux position).
<> 133:99b5ccf27215 5497 * \par Fixed-Point Behavior
<> 133:99b5ccf27215 5498 * Care must be taken when using the Q31 version of the Park transform.
<> 133:99b5ccf27215 5499 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 133:99b5ccf27215 5500 * Refer to the function specific documentation below for usage guidelines.
<> 133:99b5ccf27215 5501 */
<> 133:99b5ccf27215 5502
<> 133:99b5ccf27215 5503 /**
<> 133:99b5ccf27215 5504 * @addtogroup park
<> 133:99b5ccf27215 5505 * @{
<> 133:99b5ccf27215 5506 */
<> 133:99b5ccf27215 5507
<> 133:99b5ccf27215 5508 /**
<> 133:99b5ccf27215 5509 * @brief Floating-point Park transform
<> 133:99b5ccf27215 5510 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 133:99b5ccf27215 5511 * @param[in] Ibeta input two-phase vector coordinate beta
<> 133:99b5ccf27215 5512 * @param[out] *pId points to output rotor reference frame d
<> 133:99b5ccf27215 5513 * @param[out] *pIq points to output rotor reference frame q
<> 133:99b5ccf27215 5514 * @param[in] sinVal sine value of rotation angle theta
<> 133:99b5ccf27215 5515 * @param[in] cosVal cosine value of rotation angle theta
<> 133:99b5ccf27215 5516 * @return none.
<> 133:99b5ccf27215 5517 *
<> 133:99b5ccf27215 5518 * The function implements the forward Park transform.
<> 133:99b5ccf27215 5519 *
<> 133:99b5ccf27215 5520 */
<> 133:99b5ccf27215 5521
<> 133:99b5ccf27215 5522 static __INLINE void arm_park_f32(
<> 133:99b5ccf27215 5523 float32_t Ialpha,
<> 133:99b5ccf27215 5524 float32_t Ibeta,
<> 133:99b5ccf27215 5525 float32_t * pId,
<> 133:99b5ccf27215 5526 float32_t * pIq,
<> 133:99b5ccf27215 5527 float32_t sinVal,
<> 133:99b5ccf27215 5528 float32_t cosVal)
<> 133:99b5ccf27215 5529 {
<> 133:99b5ccf27215 5530 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
<> 133:99b5ccf27215 5531 *pId = Ialpha * cosVal + Ibeta * sinVal;
<> 133:99b5ccf27215 5532
<> 133:99b5ccf27215 5533 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
<> 133:99b5ccf27215 5534 *pIq = -Ialpha * sinVal + Ibeta * cosVal;
<> 133:99b5ccf27215 5535
<> 133:99b5ccf27215 5536 }
<> 133:99b5ccf27215 5537
<> 133:99b5ccf27215 5538 /**
<> 133:99b5ccf27215 5539 * @brief Park transform for Q31 version
<> 133:99b5ccf27215 5540 * @param[in] Ialpha input two-phase vector coordinate alpha
<> 133:99b5ccf27215 5541 * @param[in] Ibeta input two-phase vector coordinate beta
<> 133:99b5ccf27215 5542 * @param[out] *pId points to output rotor reference frame d
<> 133:99b5ccf27215 5543 * @param[out] *pIq points to output rotor reference frame q
<> 133:99b5ccf27215 5544 * @param[in] sinVal sine value of rotation angle theta
<> 133:99b5ccf27215 5545 * @param[in] cosVal cosine value of rotation angle theta
<> 133:99b5ccf27215 5546 * @return none.
<> 133:99b5ccf27215 5547 *
<> 133:99b5ccf27215 5548 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5549 * \par
<> 133:99b5ccf27215 5550 * The function is implemented using an internal 32-bit accumulator.
<> 133:99b5ccf27215 5551 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 133:99b5ccf27215 5552 * There is saturation on the addition and subtraction, hence there is no risk of overflow.
<> 133:99b5ccf27215 5553 */
<> 133:99b5ccf27215 5554
<> 133:99b5ccf27215 5555
<> 133:99b5ccf27215 5556 static __INLINE void arm_park_q31(
<> 133:99b5ccf27215 5557 q31_t Ialpha,
<> 133:99b5ccf27215 5558 q31_t Ibeta,
<> 133:99b5ccf27215 5559 q31_t * pId,
<> 133:99b5ccf27215 5560 q31_t * pIq,
<> 133:99b5ccf27215 5561 q31_t sinVal,
<> 133:99b5ccf27215 5562 q31_t cosVal)
<> 133:99b5ccf27215 5563 {
<> 133:99b5ccf27215 5564 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5565 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5566
<> 133:99b5ccf27215 5567 /* Intermediate product is calculated by (Ialpha * cosVal) */
<> 133:99b5ccf27215 5568 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
<> 133:99b5ccf27215 5569
<> 133:99b5ccf27215 5570 /* Intermediate product is calculated by (Ibeta * sinVal) */
<> 133:99b5ccf27215 5571 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
<> 133:99b5ccf27215 5572
<> 133:99b5ccf27215 5573
<> 133:99b5ccf27215 5574 /* Intermediate product is calculated by (Ialpha * sinVal) */
<> 133:99b5ccf27215 5575 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
<> 133:99b5ccf27215 5576
<> 133:99b5ccf27215 5577 /* Intermediate product is calculated by (Ibeta * cosVal) */
<> 133:99b5ccf27215 5578 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
<> 133:99b5ccf27215 5579
<> 133:99b5ccf27215 5580 /* Calculate pId by adding the two intermediate products 1 and 2 */
<> 133:99b5ccf27215 5581 *pId = __QADD(product1, product2);
<> 133:99b5ccf27215 5582
<> 133:99b5ccf27215 5583 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
<> 133:99b5ccf27215 5584 *pIq = __QSUB(product4, product3);
<> 133:99b5ccf27215 5585 }
<> 133:99b5ccf27215 5586
<> 133:99b5ccf27215 5587 /**
<> 133:99b5ccf27215 5588 * @} end of park group
<> 133:99b5ccf27215 5589 */
<> 133:99b5ccf27215 5590
<> 133:99b5ccf27215 5591 /**
<> 133:99b5ccf27215 5592 * @brief Converts the elements of the Q7 vector to floating-point vector.
<> 133:99b5ccf27215 5593 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 5594 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 5595 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 5596 * @return none.
<> 133:99b5ccf27215 5597 */
<> 133:99b5ccf27215 5598 void arm_q7_to_float(
<> 133:99b5ccf27215 5599 q7_t * pSrc,
<> 133:99b5ccf27215 5600 float32_t * pDst,
<> 133:99b5ccf27215 5601 uint32_t blockSize);
<> 133:99b5ccf27215 5602
<> 133:99b5ccf27215 5603
<> 133:99b5ccf27215 5604 /**
<> 133:99b5ccf27215 5605 * @ingroup groupController
<> 133:99b5ccf27215 5606 */
<> 133:99b5ccf27215 5607
<> 133:99b5ccf27215 5608 /**
<> 133:99b5ccf27215 5609 * @defgroup inv_park Vector Inverse Park transform
<> 133:99b5ccf27215 5610 * Inverse Park transform converts the input flux and torque components to two-coordinate vector.
<> 133:99b5ccf27215 5611 *
<> 133:99b5ccf27215 5612 * The function operates on a single sample of data and each call to the function returns the processed output.
<> 133:99b5ccf27215 5613 * The library provides separate functions for Q31 and floating-point data types.
<> 133:99b5ccf27215 5614 * \par Algorithm
<> 133:99b5ccf27215 5615 * \image html parkInvFormula.gif
<> 133:99b5ccf27215 5616 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components,
<> 133:99b5ccf27215 5617 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the
<> 133:99b5ccf27215 5618 * cosine and sine values of theta (rotor flux position).
<> 133:99b5ccf27215 5619 * \par Fixed-Point Behavior
<> 133:99b5ccf27215 5620 * Care must be taken when using the Q31 version of the Park transform.
<> 133:99b5ccf27215 5621 * In particular, the overflow and saturation behavior of the accumulator used must be considered.
<> 133:99b5ccf27215 5622 * Refer to the function specific documentation below for usage guidelines.
<> 133:99b5ccf27215 5623 */
<> 133:99b5ccf27215 5624
<> 133:99b5ccf27215 5625 /**
<> 133:99b5ccf27215 5626 * @addtogroup inv_park
<> 133:99b5ccf27215 5627 * @{
<> 133:99b5ccf27215 5628 */
<> 133:99b5ccf27215 5629
<> 133:99b5ccf27215 5630 /**
<> 133:99b5ccf27215 5631 * @brief Floating-point Inverse Park transform
<> 133:99b5ccf27215 5632 * @param[in] Id input coordinate of rotor reference frame d
<> 133:99b5ccf27215 5633 * @param[in] Iq input coordinate of rotor reference frame q
<> 133:99b5ccf27215 5634 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5635 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5636 * @param[in] sinVal sine value of rotation angle theta
<> 133:99b5ccf27215 5637 * @param[in] cosVal cosine value of rotation angle theta
<> 133:99b5ccf27215 5638 * @return none.
<> 133:99b5ccf27215 5639 */
<> 133:99b5ccf27215 5640
<> 133:99b5ccf27215 5641 static __INLINE void arm_inv_park_f32(
<> 133:99b5ccf27215 5642 float32_t Id,
<> 133:99b5ccf27215 5643 float32_t Iq,
<> 133:99b5ccf27215 5644 float32_t * pIalpha,
<> 133:99b5ccf27215 5645 float32_t * pIbeta,
<> 133:99b5ccf27215 5646 float32_t sinVal,
<> 133:99b5ccf27215 5647 float32_t cosVal)
<> 133:99b5ccf27215 5648 {
<> 133:99b5ccf27215 5649 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
<> 133:99b5ccf27215 5650 *pIalpha = Id * cosVal - Iq * sinVal;
<> 133:99b5ccf27215 5651
<> 133:99b5ccf27215 5652 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
<> 133:99b5ccf27215 5653 *pIbeta = Id * sinVal + Iq * cosVal;
<> 133:99b5ccf27215 5654
<> 133:99b5ccf27215 5655 }
<> 133:99b5ccf27215 5656
<> 133:99b5ccf27215 5657
<> 133:99b5ccf27215 5658 /**
<> 133:99b5ccf27215 5659 * @brief Inverse Park transform for Q31 version
<> 133:99b5ccf27215 5660 * @param[in] Id input coordinate of rotor reference frame d
<> 133:99b5ccf27215 5661 * @param[in] Iq input coordinate of rotor reference frame q
<> 133:99b5ccf27215 5662 * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha
<> 133:99b5ccf27215 5663 * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta
<> 133:99b5ccf27215 5664 * @param[in] sinVal sine value of rotation angle theta
<> 133:99b5ccf27215 5665 * @param[in] cosVal cosine value of rotation angle theta
<> 133:99b5ccf27215 5666 * @return none.
<> 133:99b5ccf27215 5667 *
<> 133:99b5ccf27215 5668 * <b>Scaling and Overflow Behavior:</b>
<> 133:99b5ccf27215 5669 * \par
<> 133:99b5ccf27215 5670 * The function is implemented using an internal 32-bit accumulator.
<> 133:99b5ccf27215 5671 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.
<> 133:99b5ccf27215 5672 * There is saturation on the addition, hence there is no risk of overflow.
<> 133:99b5ccf27215 5673 */
<> 133:99b5ccf27215 5674
<> 133:99b5ccf27215 5675
<> 133:99b5ccf27215 5676 static __INLINE void arm_inv_park_q31(
<> 133:99b5ccf27215 5677 q31_t Id,
<> 133:99b5ccf27215 5678 q31_t Iq,
<> 133:99b5ccf27215 5679 q31_t * pIalpha,
<> 133:99b5ccf27215 5680 q31_t * pIbeta,
<> 133:99b5ccf27215 5681 q31_t sinVal,
<> 133:99b5ccf27215 5682 q31_t cosVal)
<> 133:99b5ccf27215 5683 {
<> 133:99b5ccf27215 5684 q31_t product1, product2; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5685 q31_t product3, product4; /* Temporary variables used to store intermediate results */
<> 133:99b5ccf27215 5686
<> 133:99b5ccf27215 5687 /* Intermediate product is calculated by (Id * cosVal) */
<> 133:99b5ccf27215 5688 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
<> 133:99b5ccf27215 5689
<> 133:99b5ccf27215 5690 /* Intermediate product is calculated by (Iq * sinVal) */
<> 133:99b5ccf27215 5691 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
<> 133:99b5ccf27215 5692
<> 133:99b5ccf27215 5693
<> 133:99b5ccf27215 5694 /* Intermediate product is calculated by (Id * sinVal) */
<> 133:99b5ccf27215 5695 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
<> 133:99b5ccf27215 5696
<> 133:99b5ccf27215 5697 /* Intermediate product is calculated by (Iq * cosVal) */
<> 133:99b5ccf27215 5698 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
<> 133:99b5ccf27215 5699
<> 133:99b5ccf27215 5700 /* Calculate pIalpha by using the two intermediate products 1 and 2 */
<> 133:99b5ccf27215 5701 *pIalpha = __QSUB(product1, product2);
<> 133:99b5ccf27215 5702
<> 133:99b5ccf27215 5703 /* Calculate pIbeta by using the two intermediate products 3 and 4 */
<> 133:99b5ccf27215 5704 *pIbeta = __QADD(product4, product3);
<> 133:99b5ccf27215 5705
<> 133:99b5ccf27215 5706 }
<> 133:99b5ccf27215 5707
<> 133:99b5ccf27215 5708 /**
<> 133:99b5ccf27215 5709 * @} end of Inverse park group
<> 133:99b5ccf27215 5710 */
<> 133:99b5ccf27215 5711
<> 133:99b5ccf27215 5712
<> 133:99b5ccf27215 5713 /**
<> 133:99b5ccf27215 5714 * @brief Converts the elements of the Q31 vector to floating-point vector.
<> 133:99b5ccf27215 5715 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 5716 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 5717 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 5718 * @return none.
<> 133:99b5ccf27215 5719 */
<> 133:99b5ccf27215 5720 void arm_q31_to_float(
<> 133:99b5ccf27215 5721 q31_t * pSrc,
<> 133:99b5ccf27215 5722 float32_t * pDst,
<> 133:99b5ccf27215 5723 uint32_t blockSize);
<> 133:99b5ccf27215 5724
<> 133:99b5ccf27215 5725 /**
<> 133:99b5ccf27215 5726 * @ingroup groupInterpolation
<> 133:99b5ccf27215 5727 */
<> 133:99b5ccf27215 5728
<> 133:99b5ccf27215 5729 /**
<> 133:99b5ccf27215 5730 * @defgroup LinearInterpolate Linear Interpolation
<> 133:99b5ccf27215 5731 *
<> 133:99b5ccf27215 5732 * Linear interpolation is a method of curve fitting using linear polynomials.
<> 133:99b5ccf27215 5733 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line
<> 133:99b5ccf27215 5734 *
<> 133:99b5ccf27215 5735 * \par
<> 133:99b5ccf27215 5736 * \image html LinearInterp.gif "Linear interpolation"
<> 133:99b5ccf27215 5737 *
<> 133:99b5ccf27215 5738 * \par
<> 133:99b5ccf27215 5739 * A Linear Interpolate function calculates an output value(y), for the input(x)
<> 133:99b5ccf27215 5740 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
<> 133:99b5ccf27215 5741 *
<> 133:99b5ccf27215 5742 * \par Algorithm:
<> 133:99b5ccf27215 5743 * <pre>
<> 133:99b5ccf27215 5744 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
<> 133:99b5ccf27215 5745 * where x0, x1 are nearest values of input x
<> 133:99b5ccf27215 5746 * y0, y1 are nearest values to output y
<> 133:99b5ccf27215 5747 * </pre>
<> 133:99b5ccf27215 5748 *
<> 133:99b5ccf27215 5749 * \par
<> 133:99b5ccf27215 5750 * This set of functions implements Linear interpolation process
<> 133:99b5ccf27215 5751 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single
<> 133:99b5ccf27215 5752 * sample of data and each call to the function returns a single processed value.
<> 133:99b5ccf27215 5753 * <code>S</code> points to an instance of the Linear Interpolate function data structure.
<> 133:99b5ccf27215 5754 * <code>x</code> is the input sample value. The functions returns the output value.
<> 133:99b5ccf27215 5755 *
<> 133:99b5ccf27215 5756 * \par
<> 133:99b5ccf27215 5757 * if x is outside of the table boundary, Linear interpolation returns first value of the table
<> 133:99b5ccf27215 5758 * if x is below input range and returns last value of table if x is above range.
<> 133:99b5ccf27215 5759 */
<> 133:99b5ccf27215 5760
<> 133:99b5ccf27215 5761 /**
<> 133:99b5ccf27215 5762 * @addtogroup LinearInterpolate
<> 133:99b5ccf27215 5763 * @{
<> 133:99b5ccf27215 5764 */
<> 133:99b5ccf27215 5765
<> 133:99b5ccf27215 5766 /**
<> 133:99b5ccf27215 5767 * @brief Process function for the floating-point Linear Interpolation Function.
<> 133:99b5ccf27215 5768 * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure
<> 133:99b5ccf27215 5769 * @param[in] x input sample to process
<> 133:99b5ccf27215 5770 * @return y processed output sample.
<> 133:99b5ccf27215 5771 *
<> 133:99b5ccf27215 5772 */
<> 133:99b5ccf27215 5773
<> 133:99b5ccf27215 5774 static __INLINE float32_t arm_linear_interp_f32(
<> 133:99b5ccf27215 5775 arm_linear_interp_instance_f32 * S,
<> 133:99b5ccf27215 5776 float32_t x)
<> 133:99b5ccf27215 5777 {
<> 133:99b5ccf27215 5778
<> 133:99b5ccf27215 5779 float32_t y;
<> 133:99b5ccf27215 5780 float32_t x0, x1; /* Nearest input values */
<> 133:99b5ccf27215 5781 float32_t y0, y1; /* Nearest output values */
<> 133:99b5ccf27215 5782 float32_t xSpacing = S->xSpacing; /* spacing between input values */
<> 133:99b5ccf27215 5783 int32_t i; /* Index variable */
<> 133:99b5ccf27215 5784 float32_t *pYData = S->pYData; /* pointer to output table */
<> 133:99b5ccf27215 5785
<> 133:99b5ccf27215 5786 /* Calculation of index */
<> 133:99b5ccf27215 5787 i = (int32_t) ((x - S->x1) / xSpacing);
<> 133:99b5ccf27215 5788
<> 133:99b5ccf27215 5789 if(i < 0)
<> 133:99b5ccf27215 5790 {
<> 133:99b5ccf27215 5791 /* Iniatilize output for below specified range as least output value of table */
<> 133:99b5ccf27215 5792 y = pYData[0];
<> 133:99b5ccf27215 5793 }
<> 133:99b5ccf27215 5794 else if((uint32_t)i >= S->nValues)
<> 133:99b5ccf27215 5795 {
<> 133:99b5ccf27215 5796 /* Iniatilize output for above specified range as last output value of table */
<> 133:99b5ccf27215 5797 y = pYData[S->nValues - 1];
<> 133:99b5ccf27215 5798 }
<> 133:99b5ccf27215 5799 else
<> 133:99b5ccf27215 5800 {
<> 133:99b5ccf27215 5801 /* Calculation of nearest input values */
<> 133:99b5ccf27215 5802 x0 = S->x1 + i * xSpacing;
<> 133:99b5ccf27215 5803 x1 = S->x1 + (i + 1) * xSpacing;
<> 133:99b5ccf27215 5804
<> 133:99b5ccf27215 5805 /* Read of nearest output values */
<> 133:99b5ccf27215 5806 y0 = pYData[i];
<> 133:99b5ccf27215 5807 y1 = pYData[i + 1];
<> 133:99b5ccf27215 5808
<> 133:99b5ccf27215 5809 /* Calculation of output */
<> 133:99b5ccf27215 5810 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
<> 133:99b5ccf27215 5811
<> 133:99b5ccf27215 5812 }
<> 133:99b5ccf27215 5813
<> 133:99b5ccf27215 5814 /* returns output value */
<> 133:99b5ccf27215 5815 return (y);
<> 133:99b5ccf27215 5816 }
<> 133:99b5ccf27215 5817
<> 133:99b5ccf27215 5818 /**
<> 133:99b5ccf27215 5819 *
<> 133:99b5ccf27215 5820 * @brief Process function for the Q31 Linear Interpolation Function.
<> 133:99b5ccf27215 5821 * @param[in] *pYData pointer to Q31 Linear Interpolation table
<> 133:99b5ccf27215 5822 * @param[in] x input sample to process
<> 133:99b5ccf27215 5823 * @param[in] nValues number of table values
<> 133:99b5ccf27215 5824 * @return y processed output sample.
<> 133:99b5ccf27215 5825 *
<> 133:99b5ccf27215 5826 * \par
<> 133:99b5ccf27215 5827 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 133:99b5ccf27215 5828 * This function can support maximum of table size 2^12.
<> 133:99b5ccf27215 5829 *
<> 133:99b5ccf27215 5830 */
<> 133:99b5ccf27215 5831
<> 133:99b5ccf27215 5832
<> 133:99b5ccf27215 5833 static __INLINE q31_t arm_linear_interp_q31(
<> 133:99b5ccf27215 5834 q31_t * pYData,
<> 133:99b5ccf27215 5835 q31_t x,
<> 133:99b5ccf27215 5836 uint32_t nValues)
<> 133:99b5ccf27215 5837 {
<> 133:99b5ccf27215 5838 q31_t y; /* output */
<> 133:99b5ccf27215 5839 q31_t y0, y1; /* Nearest output values */
<> 133:99b5ccf27215 5840 q31_t fract; /* fractional part */
<> 133:99b5ccf27215 5841 int32_t index; /* Index to read nearest output values */
<> 133:99b5ccf27215 5842
<> 133:99b5ccf27215 5843 /* Input is in 12.20 format */
<> 133:99b5ccf27215 5844 /* 12 bits for the table index */
<> 133:99b5ccf27215 5845 /* Index value calculation */
<> 133:99b5ccf27215 5846 index = ((x & 0xFFF00000) >> 20);
<> 133:99b5ccf27215 5847
<> 133:99b5ccf27215 5848 if(index >= (int32_t)(nValues - 1))
<> 133:99b5ccf27215 5849 {
<> 133:99b5ccf27215 5850 return (pYData[nValues - 1]);
<> 133:99b5ccf27215 5851 }
<> 133:99b5ccf27215 5852 else if(index < 0)
<> 133:99b5ccf27215 5853 {
<> 133:99b5ccf27215 5854 return (pYData[0]);
<> 133:99b5ccf27215 5855 }
<> 133:99b5ccf27215 5856 else
<> 133:99b5ccf27215 5857 {
<> 133:99b5ccf27215 5858
<> 133:99b5ccf27215 5859 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 5860 /* shift left by 11 to keep fract in 1.31 format */
<> 133:99b5ccf27215 5861 fract = (x & 0x000FFFFF) << 11;
<> 133:99b5ccf27215 5862
<> 133:99b5ccf27215 5863 /* Read two nearest output values from the index in 1.31(q31) format */
<> 133:99b5ccf27215 5864 y0 = pYData[index];
<> 133:99b5ccf27215 5865 y1 = pYData[index + 1u];
<> 133:99b5ccf27215 5866
<> 133:99b5ccf27215 5867 /* Calculation of y0 * (1-fract) and y is in 2.30 format */
<> 133:99b5ccf27215 5868 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
<> 133:99b5ccf27215 5869
<> 133:99b5ccf27215 5870 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
<> 133:99b5ccf27215 5871 y += ((q31_t) (((q63_t) y1 * fract) >> 32));
<> 133:99b5ccf27215 5872
<> 133:99b5ccf27215 5873 /* Convert y to 1.31 format */
<> 133:99b5ccf27215 5874 return (y << 1u);
<> 133:99b5ccf27215 5875
<> 133:99b5ccf27215 5876 }
<> 133:99b5ccf27215 5877
<> 133:99b5ccf27215 5878 }
<> 133:99b5ccf27215 5879
<> 133:99b5ccf27215 5880 /**
<> 133:99b5ccf27215 5881 *
<> 133:99b5ccf27215 5882 * @brief Process function for the Q15 Linear Interpolation Function.
<> 133:99b5ccf27215 5883 * @param[in] *pYData pointer to Q15 Linear Interpolation table
<> 133:99b5ccf27215 5884 * @param[in] x input sample to process
<> 133:99b5ccf27215 5885 * @param[in] nValues number of table values
<> 133:99b5ccf27215 5886 * @return y processed output sample.
<> 133:99b5ccf27215 5887 *
<> 133:99b5ccf27215 5888 * \par
<> 133:99b5ccf27215 5889 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 133:99b5ccf27215 5890 * This function can support maximum of table size 2^12.
<> 133:99b5ccf27215 5891 *
<> 133:99b5ccf27215 5892 */
<> 133:99b5ccf27215 5893
<> 133:99b5ccf27215 5894
<> 133:99b5ccf27215 5895 static __INLINE q15_t arm_linear_interp_q15(
<> 133:99b5ccf27215 5896 q15_t * pYData,
<> 133:99b5ccf27215 5897 q31_t x,
<> 133:99b5ccf27215 5898 uint32_t nValues)
<> 133:99b5ccf27215 5899 {
<> 133:99b5ccf27215 5900 q63_t y; /* output */
<> 133:99b5ccf27215 5901 q15_t y0, y1; /* Nearest output values */
<> 133:99b5ccf27215 5902 q31_t fract; /* fractional part */
<> 133:99b5ccf27215 5903 int32_t index; /* Index to read nearest output values */
<> 133:99b5ccf27215 5904
<> 133:99b5ccf27215 5905 /* Input is in 12.20 format */
<> 133:99b5ccf27215 5906 /* 12 bits for the table index */
<> 133:99b5ccf27215 5907 /* Index value calculation */
<> 133:99b5ccf27215 5908 index = ((x & 0xFFF00000) >> 20u);
<> 133:99b5ccf27215 5909
<> 133:99b5ccf27215 5910 if(index >= (int32_t)(nValues - 1))
<> 133:99b5ccf27215 5911 {
<> 133:99b5ccf27215 5912 return (pYData[nValues - 1]);
<> 133:99b5ccf27215 5913 }
<> 133:99b5ccf27215 5914 else if(index < 0)
<> 133:99b5ccf27215 5915 {
<> 133:99b5ccf27215 5916 return (pYData[0]);
<> 133:99b5ccf27215 5917 }
<> 133:99b5ccf27215 5918 else
<> 133:99b5ccf27215 5919 {
<> 133:99b5ccf27215 5920 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 5921 /* fract is in 12.20 format */
<> 133:99b5ccf27215 5922 fract = (x & 0x000FFFFF);
<> 133:99b5ccf27215 5923
<> 133:99b5ccf27215 5924 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 5925 y0 = pYData[index];
<> 133:99b5ccf27215 5926 y1 = pYData[index + 1u];
<> 133:99b5ccf27215 5927
<> 133:99b5ccf27215 5928 /* Calculation of y0 * (1-fract) and y is in 13.35 format */
<> 133:99b5ccf27215 5929 y = ((q63_t) y0 * (0xFFFFF - fract));
<> 133:99b5ccf27215 5930
<> 133:99b5ccf27215 5931 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
<> 133:99b5ccf27215 5932 y += ((q63_t) y1 * (fract));
<> 133:99b5ccf27215 5933
<> 133:99b5ccf27215 5934 /* convert y to 1.15 format */
<> 133:99b5ccf27215 5935 return (y >> 20);
<> 133:99b5ccf27215 5936 }
<> 133:99b5ccf27215 5937
<> 133:99b5ccf27215 5938
<> 133:99b5ccf27215 5939 }
<> 133:99b5ccf27215 5940
<> 133:99b5ccf27215 5941 /**
<> 133:99b5ccf27215 5942 *
<> 133:99b5ccf27215 5943 * @brief Process function for the Q7 Linear Interpolation Function.
<> 133:99b5ccf27215 5944 * @param[in] *pYData pointer to Q7 Linear Interpolation table
<> 133:99b5ccf27215 5945 * @param[in] x input sample to process
<> 133:99b5ccf27215 5946 * @param[in] nValues number of table values
<> 133:99b5ccf27215 5947 * @return y processed output sample.
<> 133:99b5ccf27215 5948 *
<> 133:99b5ccf27215 5949 * \par
<> 133:99b5ccf27215 5950 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part.
<> 133:99b5ccf27215 5951 * This function can support maximum of table size 2^12.
<> 133:99b5ccf27215 5952 */
<> 133:99b5ccf27215 5953
<> 133:99b5ccf27215 5954
<> 133:99b5ccf27215 5955 static __INLINE q7_t arm_linear_interp_q7(
<> 133:99b5ccf27215 5956 q7_t * pYData,
<> 133:99b5ccf27215 5957 q31_t x,
<> 133:99b5ccf27215 5958 uint32_t nValues)
<> 133:99b5ccf27215 5959 {
<> 133:99b5ccf27215 5960 q31_t y; /* output */
<> 133:99b5ccf27215 5961 q7_t y0, y1; /* Nearest output values */
<> 133:99b5ccf27215 5962 q31_t fract; /* fractional part */
<> 133:99b5ccf27215 5963 uint32_t index; /* Index to read nearest output values */
<> 133:99b5ccf27215 5964
<> 133:99b5ccf27215 5965 /* Input is in 12.20 format */
<> 133:99b5ccf27215 5966 /* 12 bits for the table index */
<> 133:99b5ccf27215 5967 /* Index value calculation */
<> 133:99b5ccf27215 5968 if (x < 0)
<> 133:99b5ccf27215 5969 {
<> 133:99b5ccf27215 5970 return (pYData[0]);
<> 133:99b5ccf27215 5971 }
<> 133:99b5ccf27215 5972 index = (x >> 20) & 0xfff;
<> 133:99b5ccf27215 5973
<> 133:99b5ccf27215 5974
<> 133:99b5ccf27215 5975 if(index >= (nValues - 1))
<> 133:99b5ccf27215 5976 {
<> 133:99b5ccf27215 5977 return (pYData[nValues - 1]);
<> 133:99b5ccf27215 5978 }
<> 133:99b5ccf27215 5979 else
<> 133:99b5ccf27215 5980 {
<> 133:99b5ccf27215 5981
<> 133:99b5ccf27215 5982 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 5983 /* fract is in 12.20 format */
<> 133:99b5ccf27215 5984 fract = (x & 0x000FFFFF);
<> 133:99b5ccf27215 5985
<> 133:99b5ccf27215 5986 /* Read two nearest output values from the index and are in 1.7(q7) format */
<> 133:99b5ccf27215 5987 y0 = pYData[index];
<> 133:99b5ccf27215 5988 y1 = pYData[index + 1u];
<> 133:99b5ccf27215 5989
<> 133:99b5ccf27215 5990 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
<> 133:99b5ccf27215 5991 y = ((y0 * (0xFFFFF - fract)));
<> 133:99b5ccf27215 5992
<> 133:99b5ccf27215 5993 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
<> 133:99b5ccf27215 5994 y += (y1 * fract);
<> 133:99b5ccf27215 5995
<> 133:99b5ccf27215 5996 /* convert y to 1.7(q7) format */
<> 133:99b5ccf27215 5997 return (y >> 20u);
<> 133:99b5ccf27215 5998
<> 133:99b5ccf27215 5999 }
<> 133:99b5ccf27215 6000
<> 133:99b5ccf27215 6001 }
<> 133:99b5ccf27215 6002 /**
<> 133:99b5ccf27215 6003 * @} end of LinearInterpolate group
<> 133:99b5ccf27215 6004 */
<> 133:99b5ccf27215 6005
<> 133:99b5ccf27215 6006 /**
<> 133:99b5ccf27215 6007 * @brief Fast approximation to the trigonometric sine function for floating-point data.
<> 133:99b5ccf27215 6008 * @param[in] x input value in radians.
<> 133:99b5ccf27215 6009 * @return sin(x).
<> 133:99b5ccf27215 6010 */
<> 133:99b5ccf27215 6011
<> 133:99b5ccf27215 6012 float32_t arm_sin_f32(
<> 133:99b5ccf27215 6013 float32_t x);
<> 133:99b5ccf27215 6014
<> 133:99b5ccf27215 6015 /**
<> 133:99b5ccf27215 6016 * @brief Fast approximation to the trigonometric sine function for Q31 data.
<> 133:99b5ccf27215 6017 * @param[in] x Scaled input value in radians.
<> 133:99b5ccf27215 6018 * @return sin(x).
<> 133:99b5ccf27215 6019 */
<> 133:99b5ccf27215 6020
<> 133:99b5ccf27215 6021 q31_t arm_sin_q31(
<> 133:99b5ccf27215 6022 q31_t x);
<> 133:99b5ccf27215 6023
<> 133:99b5ccf27215 6024 /**
<> 133:99b5ccf27215 6025 * @brief Fast approximation to the trigonometric sine function for Q15 data.
<> 133:99b5ccf27215 6026 * @param[in] x Scaled input value in radians.
<> 133:99b5ccf27215 6027 * @return sin(x).
<> 133:99b5ccf27215 6028 */
<> 133:99b5ccf27215 6029
<> 133:99b5ccf27215 6030 q15_t arm_sin_q15(
<> 133:99b5ccf27215 6031 q15_t x);
<> 133:99b5ccf27215 6032
<> 133:99b5ccf27215 6033 /**
<> 133:99b5ccf27215 6034 * @brief Fast approximation to the trigonometric cosine function for floating-point data.
<> 133:99b5ccf27215 6035 * @param[in] x input value in radians.
<> 133:99b5ccf27215 6036 * @return cos(x).
<> 133:99b5ccf27215 6037 */
<> 133:99b5ccf27215 6038
<> 133:99b5ccf27215 6039 float32_t arm_cos_f32(
<> 133:99b5ccf27215 6040 float32_t x);
<> 133:99b5ccf27215 6041
<> 133:99b5ccf27215 6042 /**
<> 133:99b5ccf27215 6043 * @brief Fast approximation to the trigonometric cosine function for Q31 data.
<> 133:99b5ccf27215 6044 * @param[in] x Scaled input value in radians.
<> 133:99b5ccf27215 6045 * @return cos(x).
<> 133:99b5ccf27215 6046 */
<> 133:99b5ccf27215 6047
<> 133:99b5ccf27215 6048 q31_t arm_cos_q31(
<> 133:99b5ccf27215 6049 q31_t x);
<> 133:99b5ccf27215 6050
<> 133:99b5ccf27215 6051 /**
<> 133:99b5ccf27215 6052 * @brief Fast approximation to the trigonometric cosine function for Q15 data.
<> 133:99b5ccf27215 6053 * @param[in] x Scaled input value in radians.
<> 133:99b5ccf27215 6054 * @return cos(x).
<> 133:99b5ccf27215 6055 */
<> 133:99b5ccf27215 6056
<> 133:99b5ccf27215 6057 q15_t arm_cos_q15(
<> 133:99b5ccf27215 6058 q15_t x);
<> 133:99b5ccf27215 6059
<> 133:99b5ccf27215 6060
<> 133:99b5ccf27215 6061 /**
<> 133:99b5ccf27215 6062 * @ingroup groupFastMath
<> 133:99b5ccf27215 6063 */
<> 133:99b5ccf27215 6064
<> 133:99b5ccf27215 6065
<> 133:99b5ccf27215 6066 /**
<> 133:99b5ccf27215 6067 * @defgroup SQRT Square Root
<> 133:99b5ccf27215 6068 *
<> 133:99b5ccf27215 6069 * Computes the square root of a number.
<> 133:99b5ccf27215 6070 * There are separate functions for Q15, Q31, and floating-point data types.
<> 133:99b5ccf27215 6071 * The square root function is computed using the Newton-Raphson algorithm.
<> 133:99b5ccf27215 6072 * This is an iterative algorithm of the form:
<> 133:99b5ccf27215 6073 * <pre>
<> 133:99b5ccf27215 6074 * x1 = x0 - f(x0)/f'(x0)
<> 133:99b5ccf27215 6075 * </pre>
<> 133:99b5ccf27215 6076 * where <code>x1</code> is the current estimate,
<> 133:99b5ccf27215 6077 * <code>x0</code> is the previous estimate, and
<> 133:99b5ccf27215 6078 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>.
<> 133:99b5ccf27215 6079 * For the square root function, the algorithm reduces to:
<> 133:99b5ccf27215 6080 * <pre>
<> 133:99b5ccf27215 6081 * x0 = in/2 [initial guess]
<> 133:99b5ccf27215 6082 * x1 = 1/2 * ( x0 + in / x0) [each iteration]
<> 133:99b5ccf27215 6083 * </pre>
<> 133:99b5ccf27215 6084 */
<> 133:99b5ccf27215 6085
<> 133:99b5ccf27215 6086
<> 133:99b5ccf27215 6087 /**
<> 133:99b5ccf27215 6088 * @addtogroup SQRT
<> 133:99b5ccf27215 6089 * @{
<> 133:99b5ccf27215 6090 */
<> 133:99b5ccf27215 6091
<> 133:99b5ccf27215 6092 /**
<> 133:99b5ccf27215 6093 * @brief Floating-point square root function.
<> 133:99b5ccf27215 6094 * @param[in] in input value.
<> 133:99b5ccf27215 6095 * @param[out] *pOut square root of input value.
<> 133:99b5ccf27215 6096 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 133:99b5ccf27215 6097 * <code>in</code> is negative value and returns zero output for negative values.
<> 133:99b5ccf27215 6098 */
<> 133:99b5ccf27215 6099
<> 133:99b5ccf27215 6100 static __INLINE arm_status arm_sqrt_f32(
<> 133:99b5ccf27215 6101 float32_t in,
<> 133:99b5ccf27215 6102 float32_t * pOut)
<> 133:99b5ccf27215 6103 {
<> 133:99b5ccf27215 6104 if(in >= 0.0f)
<> 133:99b5ccf27215 6105 {
<> 133:99b5ccf27215 6106
<> 133:99b5ccf27215 6107 // #if __FPU_USED
<> 133:99b5ccf27215 6108 #if (__FPU_USED == 1) && defined ( __CC_ARM )
<> 133:99b5ccf27215 6109 *pOut = __sqrtf(in);
<> 133:99b5ccf27215 6110 #else
<> 133:99b5ccf27215 6111 *pOut = sqrtf(in);
<> 133:99b5ccf27215 6112 #endif
<> 133:99b5ccf27215 6113
<> 133:99b5ccf27215 6114 return (ARM_MATH_SUCCESS);
<> 133:99b5ccf27215 6115 }
<> 133:99b5ccf27215 6116 else
<> 133:99b5ccf27215 6117 {
<> 133:99b5ccf27215 6118 *pOut = 0.0f;
<> 133:99b5ccf27215 6119 return (ARM_MATH_ARGUMENT_ERROR);
<> 133:99b5ccf27215 6120 }
<> 133:99b5ccf27215 6121
<> 133:99b5ccf27215 6122 }
<> 133:99b5ccf27215 6123
<> 133:99b5ccf27215 6124
<> 133:99b5ccf27215 6125 /**
<> 133:99b5ccf27215 6126 * @brief Q31 square root function.
<> 133:99b5ccf27215 6127 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
<> 133:99b5ccf27215 6128 * @param[out] *pOut square root of input value.
<> 133:99b5ccf27215 6129 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 133:99b5ccf27215 6130 * <code>in</code> is negative value and returns zero output for negative values.
<> 133:99b5ccf27215 6131 */
<> 133:99b5ccf27215 6132 arm_status arm_sqrt_q31(
<> 133:99b5ccf27215 6133 q31_t in,
<> 133:99b5ccf27215 6134 q31_t * pOut);
<> 133:99b5ccf27215 6135
<> 133:99b5ccf27215 6136 /**
<> 133:99b5ccf27215 6137 * @brief Q15 square root function.
<> 133:99b5ccf27215 6138 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF.
<> 133:99b5ccf27215 6139 * @param[out] *pOut square root of input value.
<> 133:99b5ccf27215 6140 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if
<> 133:99b5ccf27215 6141 * <code>in</code> is negative value and returns zero output for negative values.
<> 133:99b5ccf27215 6142 */
<> 133:99b5ccf27215 6143 arm_status arm_sqrt_q15(
<> 133:99b5ccf27215 6144 q15_t in,
<> 133:99b5ccf27215 6145 q15_t * pOut);
<> 133:99b5ccf27215 6146
<> 133:99b5ccf27215 6147 /**
<> 133:99b5ccf27215 6148 * @} end of SQRT group
<> 133:99b5ccf27215 6149 */
<> 133:99b5ccf27215 6150
<> 133:99b5ccf27215 6151
<> 133:99b5ccf27215 6152
<> 133:99b5ccf27215 6153
<> 133:99b5ccf27215 6154
<> 133:99b5ccf27215 6155
<> 133:99b5ccf27215 6156 /**
<> 133:99b5ccf27215 6157 * @brief floating-point Circular write function.
<> 133:99b5ccf27215 6158 */
<> 133:99b5ccf27215 6159
<> 133:99b5ccf27215 6160 static __INLINE void arm_circularWrite_f32(
<> 133:99b5ccf27215 6161 int32_t * circBuffer,
<> 133:99b5ccf27215 6162 int32_t L,
<> 133:99b5ccf27215 6163 uint16_t * writeOffset,
<> 133:99b5ccf27215 6164 int32_t bufferInc,
<> 133:99b5ccf27215 6165 const int32_t * src,
<> 133:99b5ccf27215 6166 int32_t srcInc,
<> 133:99b5ccf27215 6167 uint32_t blockSize)
<> 133:99b5ccf27215 6168 {
<> 133:99b5ccf27215 6169 uint32_t i = 0u;
<> 133:99b5ccf27215 6170 int32_t wOffset;
<> 133:99b5ccf27215 6171
<> 133:99b5ccf27215 6172 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6173 * to the current location where the input samples to be copied */
<> 133:99b5ccf27215 6174 wOffset = *writeOffset;
<> 133:99b5ccf27215 6175
<> 133:99b5ccf27215 6176 /* Loop over the blockSize */
<> 133:99b5ccf27215 6177 i = blockSize;
<> 133:99b5ccf27215 6178
<> 133:99b5ccf27215 6179 while(i > 0u)
<> 133:99b5ccf27215 6180 {
<> 133:99b5ccf27215 6181 /* copy the input sample to the circular buffer */
<> 133:99b5ccf27215 6182 circBuffer[wOffset] = *src;
<> 133:99b5ccf27215 6183
<> 133:99b5ccf27215 6184 /* Update the input pointer */
<> 133:99b5ccf27215 6185 src += srcInc;
<> 133:99b5ccf27215 6186
<> 133:99b5ccf27215 6187 /* Circularly update wOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6188 wOffset += bufferInc;
<> 133:99b5ccf27215 6189 if(wOffset >= L)
<> 133:99b5ccf27215 6190 wOffset -= L;
<> 133:99b5ccf27215 6191
<> 133:99b5ccf27215 6192 /* Decrement the loop counter */
<> 133:99b5ccf27215 6193 i--;
<> 133:99b5ccf27215 6194 }
<> 133:99b5ccf27215 6195
<> 133:99b5ccf27215 6196 /* Update the index pointer */
<> 133:99b5ccf27215 6197 *writeOffset = wOffset;
<> 133:99b5ccf27215 6198 }
<> 133:99b5ccf27215 6199
<> 133:99b5ccf27215 6200
<> 133:99b5ccf27215 6201
<> 133:99b5ccf27215 6202 /**
<> 133:99b5ccf27215 6203 * @brief floating-point Circular Read function.
<> 133:99b5ccf27215 6204 */
<> 133:99b5ccf27215 6205 static __INLINE void arm_circularRead_f32(
<> 133:99b5ccf27215 6206 int32_t * circBuffer,
<> 133:99b5ccf27215 6207 int32_t L,
<> 133:99b5ccf27215 6208 int32_t * readOffset,
<> 133:99b5ccf27215 6209 int32_t bufferInc,
<> 133:99b5ccf27215 6210 int32_t * dst,
<> 133:99b5ccf27215 6211 int32_t * dst_base,
<> 133:99b5ccf27215 6212 int32_t dst_length,
<> 133:99b5ccf27215 6213 int32_t dstInc,
<> 133:99b5ccf27215 6214 uint32_t blockSize)
<> 133:99b5ccf27215 6215 {
<> 133:99b5ccf27215 6216 uint32_t i = 0u;
<> 133:99b5ccf27215 6217 int32_t rOffset, dst_end;
<> 133:99b5ccf27215 6218
<> 133:99b5ccf27215 6219 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6220 * to the current location from where the input samples to be read */
<> 133:99b5ccf27215 6221 rOffset = *readOffset;
<> 133:99b5ccf27215 6222 dst_end = (int32_t) (dst_base + dst_length);
<> 133:99b5ccf27215 6223
<> 133:99b5ccf27215 6224 /* Loop over the blockSize */
<> 133:99b5ccf27215 6225 i = blockSize;
<> 133:99b5ccf27215 6226
<> 133:99b5ccf27215 6227 while(i > 0u)
<> 133:99b5ccf27215 6228 {
<> 133:99b5ccf27215 6229 /* copy the sample from the circular buffer to the destination buffer */
<> 133:99b5ccf27215 6230 *dst = circBuffer[rOffset];
<> 133:99b5ccf27215 6231
<> 133:99b5ccf27215 6232 /* Update the input pointer */
<> 133:99b5ccf27215 6233 dst += dstInc;
<> 133:99b5ccf27215 6234
<> 133:99b5ccf27215 6235 if(dst == (int32_t *) dst_end)
<> 133:99b5ccf27215 6236 {
<> 133:99b5ccf27215 6237 dst = dst_base;
<> 133:99b5ccf27215 6238 }
<> 133:99b5ccf27215 6239
<> 133:99b5ccf27215 6240 /* Circularly update rOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6241 rOffset += bufferInc;
<> 133:99b5ccf27215 6242
<> 133:99b5ccf27215 6243 if(rOffset >= L)
<> 133:99b5ccf27215 6244 {
<> 133:99b5ccf27215 6245 rOffset -= L;
<> 133:99b5ccf27215 6246 }
<> 133:99b5ccf27215 6247
<> 133:99b5ccf27215 6248 /* Decrement the loop counter */
<> 133:99b5ccf27215 6249 i--;
<> 133:99b5ccf27215 6250 }
<> 133:99b5ccf27215 6251
<> 133:99b5ccf27215 6252 /* Update the index pointer */
<> 133:99b5ccf27215 6253 *readOffset = rOffset;
<> 133:99b5ccf27215 6254 }
<> 133:99b5ccf27215 6255
<> 133:99b5ccf27215 6256 /**
<> 133:99b5ccf27215 6257 * @brief Q15 Circular write function.
<> 133:99b5ccf27215 6258 */
<> 133:99b5ccf27215 6259
<> 133:99b5ccf27215 6260 static __INLINE void arm_circularWrite_q15(
<> 133:99b5ccf27215 6261 q15_t * circBuffer,
<> 133:99b5ccf27215 6262 int32_t L,
<> 133:99b5ccf27215 6263 uint16_t * writeOffset,
<> 133:99b5ccf27215 6264 int32_t bufferInc,
<> 133:99b5ccf27215 6265 const q15_t * src,
<> 133:99b5ccf27215 6266 int32_t srcInc,
<> 133:99b5ccf27215 6267 uint32_t blockSize)
<> 133:99b5ccf27215 6268 {
<> 133:99b5ccf27215 6269 uint32_t i = 0u;
<> 133:99b5ccf27215 6270 int32_t wOffset;
<> 133:99b5ccf27215 6271
<> 133:99b5ccf27215 6272 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6273 * to the current location where the input samples to be copied */
<> 133:99b5ccf27215 6274 wOffset = *writeOffset;
<> 133:99b5ccf27215 6275
<> 133:99b5ccf27215 6276 /* Loop over the blockSize */
<> 133:99b5ccf27215 6277 i = blockSize;
<> 133:99b5ccf27215 6278
<> 133:99b5ccf27215 6279 while(i > 0u)
<> 133:99b5ccf27215 6280 {
<> 133:99b5ccf27215 6281 /* copy the input sample to the circular buffer */
<> 133:99b5ccf27215 6282 circBuffer[wOffset] = *src;
<> 133:99b5ccf27215 6283
<> 133:99b5ccf27215 6284 /* Update the input pointer */
<> 133:99b5ccf27215 6285 src += srcInc;
<> 133:99b5ccf27215 6286
<> 133:99b5ccf27215 6287 /* Circularly update wOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6288 wOffset += bufferInc;
<> 133:99b5ccf27215 6289 if(wOffset >= L)
<> 133:99b5ccf27215 6290 wOffset -= L;
<> 133:99b5ccf27215 6291
<> 133:99b5ccf27215 6292 /* Decrement the loop counter */
<> 133:99b5ccf27215 6293 i--;
<> 133:99b5ccf27215 6294 }
<> 133:99b5ccf27215 6295
<> 133:99b5ccf27215 6296 /* Update the index pointer */
<> 133:99b5ccf27215 6297 *writeOffset = wOffset;
<> 133:99b5ccf27215 6298 }
<> 133:99b5ccf27215 6299
<> 133:99b5ccf27215 6300
<> 133:99b5ccf27215 6301
<> 133:99b5ccf27215 6302 /**
<> 133:99b5ccf27215 6303 * @brief Q15 Circular Read function.
<> 133:99b5ccf27215 6304 */
<> 133:99b5ccf27215 6305 static __INLINE void arm_circularRead_q15(
<> 133:99b5ccf27215 6306 q15_t * circBuffer,
<> 133:99b5ccf27215 6307 int32_t L,
<> 133:99b5ccf27215 6308 int32_t * readOffset,
<> 133:99b5ccf27215 6309 int32_t bufferInc,
<> 133:99b5ccf27215 6310 q15_t * dst,
<> 133:99b5ccf27215 6311 q15_t * dst_base,
<> 133:99b5ccf27215 6312 int32_t dst_length,
<> 133:99b5ccf27215 6313 int32_t dstInc,
<> 133:99b5ccf27215 6314 uint32_t blockSize)
<> 133:99b5ccf27215 6315 {
<> 133:99b5ccf27215 6316 uint32_t i = 0;
<> 133:99b5ccf27215 6317 int32_t rOffset, dst_end;
<> 133:99b5ccf27215 6318
<> 133:99b5ccf27215 6319 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6320 * to the current location from where the input samples to be read */
<> 133:99b5ccf27215 6321 rOffset = *readOffset;
<> 133:99b5ccf27215 6322
<> 133:99b5ccf27215 6323 dst_end = (int32_t) (dst_base + dst_length);
<> 133:99b5ccf27215 6324
<> 133:99b5ccf27215 6325 /* Loop over the blockSize */
<> 133:99b5ccf27215 6326 i = blockSize;
<> 133:99b5ccf27215 6327
<> 133:99b5ccf27215 6328 while(i > 0u)
<> 133:99b5ccf27215 6329 {
<> 133:99b5ccf27215 6330 /* copy the sample from the circular buffer to the destination buffer */
<> 133:99b5ccf27215 6331 *dst = circBuffer[rOffset];
<> 133:99b5ccf27215 6332
<> 133:99b5ccf27215 6333 /* Update the input pointer */
<> 133:99b5ccf27215 6334 dst += dstInc;
<> 133:99b5ccf27215 6335
<> 133:99b5ccf27215 6336 if(dst == (q15_t *) dst_end)
<> 133:99b5ccf27215 6337 {
<> 133:99b5ccf27215 6338 dst = dst_base;
<> 133:99b5ccf27215 6339 }
<> 133:99b5ccf27215 6340
<> 133:99b5ccf27215 6341 /* Circularly update wOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6342 rOffset += bufferInc;
<> 133:99b5ccf27215 6343
<> 133:99b5ccf27215 6344 if(rOffset >= L)
<> 133:99b5ccf27215 6345 {
<> 133:99b5ccf27215 6346 rOffset -= L;
<> 133:99b5ccf27215 6347 }
<> 133:99b5ccf27215 6348
<> 133:99b5ccf27215 6349 /* Decrement the loop counter */
<> 133:99b5ccf27215 6350 i--;
<> 133:99b5ccf27215 6351 }
<> 133:99b5ccf27215 6352
<> 133:99b5ccf27215 6353 /* Update the index pointer */
<> 133:99b5ccf27215 6354 *readOffset = rOffset;
<> 133:99b5ccf27215 6355 }
<> 133:99b5ccf27215 6356
<> 133:99b5ccf27215 6357
<> 133:99b5ccf27215 6358 /**
<> 133:99b5ccf27215 6359 * @brief Q7 Circular write function.
<> 133:99b5ccf27215 6360 */
<> 133:99b5ccf27215 6361
<> 133:99b5ccf27215 6362 static __INLINE void arm_circularWrite_q7(
<> 133:99b5ccf27215 6363 q7_t * circBuffer,
<> 133:99b5ccf27215 6364 int32_t L,
<> 133:99b5ccf27215 6365 uint16_t * writeOffset,
<> 133:99b5ccf27215 6366 int32_t bufferInc,
<> 133:99b5ccf27215 6367 const q7_t * src,
<> 133:99b5ccf27215 6368 int32_t srcInc,
<> 133:99b5ccf27215 6369 uint32_t blockSize)
<> 133:99b5ccf27215 6370 {
<> 133:99b5ccf27215 6371 uint32_t i = 0u;
<> 133:99b5ccf27215 6372 int32_t wOffset;
<> 133:99b5ccf27215 6373
<> 133:99b5ccf27215 6374 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6375 * to the current location where the input samples to be copied */
<> 133:99b5ccf27215 6376 wOffset = *writeOffset;
<> 133:99b5ccf27215 6377
<> 133:99b5ccf27215 6378 /* Loop over the blockSize */
<> 133:99b5ccf27215 6379 i = blockSize;
<> 133:99b5ccf27215 6380
<> 133:99b5ccf27215 6381 while(i > 0u)
<> 133:99b5ccf27215 6382 {
<> 133:99b5ccf27215 6383 /* copy the input sample to the circular buffer */
<> 133:99b5ccf27215 6384 circBuffer[wOffset] = *src;
<> 133:99b5ccf27215 6385
<> 133:99b5ccf27215 6386 /* Update the input pointer */
<> 133:99b5ccf27215 6387 src += srcInc;
<> 133:99b5ccf27215 6388
<> 133:99b5ccf27215 6389 /* Circularly update wOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6390 wOffset += bufferInc;
<> 133:99b5ccf27215 6391 if(wOffset >= L)
<> 133:99b5ccf27215 6392 wOffset -= L;
<> 133:99b5ccf27215 6393
<> 133:99b5ccf27215 6394 /* Decrement the loop counter */
<> 133:99b5ccf27215 6395 i--;
<> 133:99b5ccf27215 6396 }
<> 133:99b5ccf27215 6397
<> 133:99b5ccf27215 6398 /* Update the index pointer */
<> 133:99b5ccf27215 6399 *writeOffset = wOffset;
<> 133:99b5ccf27215 6400 }
<> 133:99b5ccf27215 6401
<> 133:99b5ccf27215 6402
<> 133:99b5ccf27215 6403
<> 133:99b5ccf27215 6404 /**
<> 133:99b5ccf27215 6405 * @brief Q7 Circular Read function.
<> 133:99b5ccf27215 6406 */
<> 133:99b5ccf27215 6407 static __INLINE void arm_circularRead_q7(
<> 133:99b5ccf27215 6408 q7_t * circBuffer,
<> 133:99b5ccf27215 6409 int32_t L,
<> 133:99b5ccf27215 6410 int32_t * readOffset,
<> 133:99b5ccf27215 6411 int32_t bufferInc,
<> 133:99b5ccf27215 6412 q7_t * dst,
<> 133:99b5ccf27215 6413 q7_t * dst_base,
<> 133:99b5ccf27215 6414 int32_t dst_length,
<> 133:99b5ccf27215 6415 int32_t dstInc,
<> 133:99b5ccf27215 6416 uint32_t blockSize)
<> 133:99b5ccf27215 6417 {
<> 133:99b5ccf27215 6418 uint32_t i = 0;
<> 133:99b5ccf27215 6419 int32_t rOffset, dst_end;
<> 133:99b5ccf27215 6420
<> 133:99b5ccf27215 6421 /* Copy the value of Index pointer that points
<> 133:99b5ccf27215 6422 * to the current location from where the input samples to be read */
<> 133:99b5ccf27215 6423 rOffset = *readOffset;
<> 133:99b5ccf27215 6424
<> 133:99b5ccf27215 6425 dst_end = (int32_t) (dst_base + dst_length);
<> 133:99b5ccf27215 6426
<> 133:99b5ccf27215 6427 /* Loop over the blockSize */
<> 133:99b5ccf27215 6428 i = blockSize;
<> 133:99b5ccf27215 6429
<> 133:99b5ccf27215 6430 while(i > 0u)
<> 133:99b5ccf27215 6431 {
<> 133:99b5ccf27215 6432 /* copy the sample from the circular buffer to the destination buffer */
<> 133:99b5ccf27215 6433 *dst = circBuffer[rOffset];
<> 133:99b5ccf27215 6434
<> 133:99b5ccf27215 6435 /* Update the input pointer */
<> 133:99b5ccf27215 6436 dst += dstInc;
<> 133:99b5ccf27215 6437
<> 133:99b5ccf27215 6438 if(dst == (q7_t *) dst_end)
<> 133:99b5ccf27215 6439 {
<> 133:99b5ccf27215 6440 dst = dst_base;
<> 133:99b5ccf27215 6441 }
<> 133:99b5ccf27215 6442
<> 133:99b5ccf27215 6443 /* Circularly update rOffset. Watch out for positive and negative value */
<> 133:99b5ccf27215 6444 rOffset += bufferInc;
<> 133:99b5ccf27215 6445
<> 133:99b5ccf27215 6446 if(rOffset >= L)
<> 133:99b5ccf27215 6447 {
<> 133:99b5ccf27215 6448 rOffset -= L;
<> 133:99b5ccf27215 6449 }
<> 133:99b5ccf27215 6450
<> 133:99b5ccf27215 6451 /* Decrement the loop counter */
<> 133:99b5ccf27215 6452 i--;
<> 133:99b5ccf27215 6453 }
<> 133:99b5ccf27215 6454
<> 133:99b5ccf27215 6455 /* Update the index pointer */
<> 133:99b5ccf27215 6456 *readOffset = rOffset;
<> 133:99b5ccf27215 6457 }
<> 133:99b5ccf27215 6458
<> 133:99b5ccf27215 6459
<> 133:99b5ccf27215 6460 /**
<> 133:99b5ccf27215 6461 * @brief Sum of the squares of the elements of a Q31 vector.
<> 133:99b5ccf27215 6462 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6463 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6464 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6465 * @return none.
<> 133:99b5ccf27215 6466 */
<> 133:99b5ccf27215 6467
<> 133:99b5ccf27215 6468 void arm_power_q31(
<> 133:99b5ccf27215 6469 q31_t * pSrc,
<> 133:99b5ccf27215 6470 uint32_t blockSize,
<> 133:99b5ccf27215 6471 q63_t * pResult);
<> 133:99b5ccf27215 6472
<> 133:99b5ccf27215 6473 /**
<> 133:99b5ccf27215 6474 * @brief Sum of the squares of the elements of a floating-point vector.
<> 133:99b5ccf27215 6475 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6476 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6477 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6478 * @return none.
<> 133:99b5ccf27215 6479 */
<> 133:99b5ccf27215 6480
<> 133:99b5ccf27215 6481 void arm_power_f32(
<> 133:99b5ccf27215 6482 float32_t * pSrc,
<> 133:99b5ccf27215 6483 uint32_t blockSize,
<> 133:99b5ccf27215 6484 float32_t * pResult);
<> 133:99b5ccf27215 6485
<> 133:99b5ccf27215 6486 /**
<> 133:99b5ccf27215 6487 * @brief Sum of the squares of the elements of a Q15 vector.
<> 133:99b5ccf27215 6488 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6489 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6490 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6491 * @return none.
<> 133:99b5ccf27215 6492 */
<> 133:99b5ccf27215 6493
<> 133:99b5ccf27215 6494 void arm_power_q15(
<> 133:99b5ccf27215 6495 q15_t * pSrc,
<> 133:99b5ccf27215 6496 uint32_t blockSize,
<> 133:99b5ccf27215 6497 q63_t * pResult);
<> 133:99b5ccf27215 6498
<> 133:99b5ccf27215 6499 /**
<> 133:99b5ccf27215 6500 * @brief Sum of the squares of the elements of a Q7 vector.
<> 133:99b5ccf27215 6501 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6502 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6503 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6504 * @return none.
<> 133:99b5ccf27215 6505 */
<> 133:99b5ccf27215 6506
<> 133:99b5ccf27215 6507 void arm_power_q7(
<> 133:99b5ccf27215 6508 q7_t * pSrc,
<> 133:99b5ccf27215 6509 uint32_t blockSize,
<> 133:99b5ccf27215 6510 q31_t * pResult);
<> 133:99b5ccf27215 6511
<> 133:99b5ccf27215 6512 /**
<> 133:99b5ccf27215 6513 * @brief Mean value of a Q7 vector.
<> 133:99b5ccf27215 6514 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6515 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6516 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6517 * @return none.
<> 133:99b5ccf27215 6518 */
<> 133:99b5ccf27215 6519
<> 133:99b5ccf27215 6520 void arm_mean_q7(
<> 133:99b5ccf27215 6521 q7_t * pSrc,
<> 133:99b5ccf27215 6522 uint32_t blockSize,
<> 133:99b5ccf27215 6523 q7_t * pResult);
<> 133:99b5ccf27215 6524
<> 133:99b5ccf27215 6525 /**
<> 133:99b5ccf27215 6526 * @brief Mean value of a Q15 vector.
<> 133:99b5ccf27215 6527 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6528 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6529 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6530 * @return none.
<> 133:99b5ccf27215 6531 */
<> 133:99b5ccf27215 6532 void arm_mean_q15(
<> 133:99b5ccf27215 6533 q15_t * pSrc,
<> 133:99b5ccf27215 6534 uint32_t blockSize,
<> 133:99b5ccf27215 6535 q15_t * pResult);
<> 133:99b5ccf27215 6536
<> 133:99b5ccf27215 6537 /**
<> 133:99b5ccf27215 6538 * @brief Mean value of a Q31 vector.
<> 133:99b5ccf27215 6539 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6540 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6541 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6542 * @return none.
<> 133:99b5ccf27215 6543 */
<> 133:99b5ccf27215 6544 void arm_mean_q31(
<> 133:99b5ccf27215 6545 q31_t * pSrc,
<> 133:99b5ccf27215 6546 uint32_t blockSize,
<> 133:99b5ccf27215 6547 q31_t * pResult);
<> 133:99b5ccf27215 6548
<> 133:99b5ccf27215 6549 /**
<> 133:99b5ccf27215 6550 * @brief Mean value of a floating-point vector.
<> 133:99b5ccf27215 6551 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6552 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6553 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6554 * @return none.
<> 133:99b5ccf27215 6555 */
<> 133:99b5ccf27215 6556 void arm_mean_f32(
<> 133:99b5ccf27215 6557 float32_t * pSrc,
<> 133:99b5ccf27215 6558 uint32_t blockSize,
<> 133:99b5ccf27215 6559 float32_t * pResult);
<> 133:99b5ccf27215 6560
<> 133:99b5ccf27215 6561 /**
<> 133:99b5ccf27215 6562 * @brief Variance of the elements of a floating-point vector.
<> 133:99b5ccf27215 6563 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6564 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6565 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6566 * @return none.
<> 133:99b5ccf27215 6567 */
<> 133:99b5ccf27215 6568
<> 133:99b5ccf27215 6569 void arm_var_f32(
<> 133:99b5ccf27215 6570 float32_t * pSrc,
<> 133:99b5ccf27215 6571 uint32_t blockSize,
<> 133:99b5ccf27215 6572 float32_t * pResult);
<> 133:99b5ccf27215 6573
<> 133:99b5ccf27215 6574 /**
<> 133:99b5ccf27215 6575 * @brief Variance of the elements of a Q31 vector.
<> 133:99b5ccf27215 6576 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6577 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6578 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6579 * @return none.
<> 133:99b5ccf27215 6580 */
<> 133:99b5ccf27215 6581
<> 133:99b5ccf27215 6582 void arm_var_q31(
<> 133:99b5ccf27215 6583 q31_t * pSrc,
<> 133:99b5ccf27215 6584 uint32_t blockSize,
<> 133:99b5ccf27215 6585 q31_t * pResult);
<> 133:99b5ccf27215 6586
<> 133:99b5ccf27215 6587 /**
<> 133:99b5ccf27215 6588 * @brief Variance of the elements of a Q15 vector.
<> 133:99b5ccf27215 6589 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6590 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6591 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6592 * @return none.
<> 133:99b5ccf27215 6593 */
<> 133:99b5ccf27215 6594
<> 133:99b5ccf27215 6595 void arm_var_q15(
<> 133:99b5ccf27215 6596 q15_t * pSrc,
<> 133:99b5ccf27215 6597 uint32_t blockSize,
<> 133:99b5ccf27215 6598 q15_t * pResult);
<> 133:99b5ccf27215 6599
<> 133:99b5ccf27215 6600 /**
<> 133:99b5ccf27215 6601 * @brief Root Mean Square of the elements of a floating-point vector.
<> 133:99b5ccf27215 6602 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6603 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6604 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6605 * @return none.
<> 133:99b5ccf27215 6606 */
<> 133:99b5ccf27215 6607
<> 133:99b5ccf27215 6608 void arm_rms_f32(
<> 133:99b5ccf27215 6609 float32_t * pSrc,
<> 133:99b5ccf27215 6610 uint32_t blockSize,
<> 133:99b5ccf27215 6611 float32_t * pResult);
<> 133:99b5ccf27215 6612
<> 133:99b5ccf27215 6613 /**
<> 133:99b5ccf27215 6614 * @brief Root Mean Square of the elements of a Q31 vector.
<> 133:99b5ccf27215 6615 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6616 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6617 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6618 * @return none.
<> 133:99b5ccf27215 6619 */
<> 133:99b5ccf27215 6620
<> 133:99b5ccf27215 6621 void arm_rms_q31(
<> 133:99b5ccf27215 6622 q31_t * pSrc,
<> 133:99b5ccf27215 6623 uint32_t blockSize,
<> 133:99b5ccf27215 6624 q31_t * pResult);
<> 133:99b5ccf27215 6625
<> 133:99b5ccf27215 6626 /**
<> 133:99b5ccf27215 6627 * @brief Root Mean Square of the elements of a Q15 vector.
<> 133:99b5ccf27215 6628 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6629 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6630 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6631 * @return none.
<> 133:99b5ccf27215 6632 */
<> 133:99b5ccf27215 6633
<> 133:99b5ccf27215 6634 void arm_rms_q15(
<> 133:99b5ccf27215 6635 q15_t * pSrc,
<> 133:99b5ccf27215 6636 uint32_t blockSize,
<> 133:99b5ccf27215 6637 q15_t * pResult);
<> 133:99b5ccf27215 6638
<> 133:99b5ccf27215 6639 /**
<> 133:99b5ccf27215 6640 * @brief Standard deviation of the elements of a floating-point vector.
<> 133:99b5ccf27215 6641 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6642 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6643 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6644 * @return none.
<> 133:99b5ccf27215 6645 */
<> 133:99b5ccf27215 6646
<> 133:99b5ccf27215 6647 void arm_std_f32(
<> 133:99b5ccf27215 6648 float32_t * pSrc,
<> 133:99b5ccf27215 6649 uint32_t blockSize,
<> 133:99b5ccf27215 6650 float32_t * pResult);
<> 133:99b5ccf27215 6651
<> 133:99b5ccf27215 6652 /**
<> 133:99b5ccf27215 6653 * @brief Standard deviation of the elements of a Q31 vector.
<> 133:99b5ccf27215 6654 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6655 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6656 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6657 * @return none.
<> 133:99b5ccf27215 6658 */
<> 133:99b5ccf27215 6659
<> 133:99b5ccf27215 6660 void arm_std_q31(
<> 133:99b5ccf27215 6661 q31_t * pSrc,
<> 133:99b5ccf27215 6662 uint32_t blockSize,
<> 133:99b5ccf27215 6663 q31_t * pResult);
<> 133:99b5ccf27215 6664
<> 133:99b5ccf27215 6665 /**
<> 133:99b5ccf27215 6666 * @brief Standard deviation of the elements of a Q15 vector.
<> 133:99b5ccf27215 6667 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6668 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6669 * @param[out] *pResult is output value.
<> 133:99b5ccf27215 6670 * @return none.
<> 133:99b5ccf27215 6671 */
<> 133:99b5ccf27215 6672
<> 133:99b5ccf27215 6673 void arm_std_q15(
<> 133:99b5ccf27215 6674 q15_t * pSrc,
<> 133:99b5ccf27215 6675 uint32_t blockSize,
<> 133:99b5ccf27215 6676 q15_t * pResult);
<> 133:99b5ccf27215 6677
<> 133:99b5ccf27215 6678 /**
<> 133:99b5ccf27215 6679 * @brief Floating-point complex magnitude
<> 133:99b5ccf27215 6680 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 6681 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 6682 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 6683 * @return none.
<> 133:99b5ccf27215 6684 */
<> 133:99b5ccf27215 6685
<> 133:99b5ccf27215 6686 void arm_cmplx_mag_f32(
<> 133:99b5ccf27215 6687 float32_t * pSrc,
<> 133:99b5ccf27215 6688 float32_t * pDst,
<> 133:99b5ccf27215 6689 uint32_t numSamples);
<> 133:99b5ccf27215 6690
<> 133:99b5ccf27215 6691 /**
<> 133:99b5ccf27215 6692 * @brief Q31 complex magnitude
<> 133:99b5ccf27215 6693 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 6694 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 6695 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 6696 * @return none.
<> 133:99b5ccf27215 6697 */
<> 133:99b5ccf27215 6698
<> 133:99b5ccf27215 6699 void arm_cmplx_mag_q31(
<> 133:99b5ccf27215 6700 q31_t * pSrc,
<> 133:99b5ccf27215 6701 q31_t * pDst,
<> 133:99b5ccf27215 6702 uint32_t numSamples);
<> 133:99b5ccf27215 6703
<> 133:99b5ccf27215 6704 /**
<> 133:99b5ccf27215 6705 * @brief Q15 complex magnitude
<> 133:99b5ccf27215 6706 * @param[in] *pSrc points to the complex input vector
<> 133:99b5ccf27215 6707 * @param[out] *pDst points to the real output vector
<> 133:99b5ccf27215 6708 * @param[in] numSamples number of complex samples in the input vector
<> 133:99b5ccf27215 6709 * @return none.
<> 133:99b5ccf27215 6710 */
<> 133:99b5ccf27215 6711
<> 133:99b5ccf27215 6712 void arm_cmplx_mag_q15(
<> 133:99b5ccf27215 6713 q15_t * pSrc,
<> 133:99b5ccf27215 6714 q15_t * pDst,
<> 133:99b5ccf27215 6715 uint32_t numSamples);
<> 133:99b5ccf27215 6716
<> 133:99b5ccf27215 6717 /**
<> 133:99b5ccf27215 6718 * @brief Q15 complex dot product
<> 133:99b5ccf27215 6719 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6720 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6721 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6722 * @param[out] *realResult real part of the result returned here
<> 133:99b5ccf27215 6723 * @param[out] *imagResult imaginary part of the result returned here
<> 133:99b5ccf27215 6724 * @return none.
<> 133:99b5ccf27215 6725 */
<> 133:99b5ccf27215 6726
<> 133:99b5ccf27215 6727 void arm_cmplx_dot_prod_q15(
<> 133:99b5ccf27215 6728 q15_t * pSrcA,
<> 133:99b5ccf27215 6729 q15_t * pSrcB,
<> 133:99b5ccf27215 6730 uint32_t numSamples,
<> 133:99b5ccf27215 6731 q31_t * realResult,
<> 133:99b5ccf27215 6732 q31_t * imagResult);
<> 133:99b5ccf27215 6733
<> 133:99b5ccf27215 6734 /**
<> 133:99b5ccf27215 6735 * @brief Q31 complex dot product
<> 133:99b5ccf27215 6736 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6737 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6738 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6739 * @param[out] *realResult real part of the result returned here
<> 133:99b5ccf27215 6740 * @param[out] *imagResult imaginary part of the result returned here
<> 133:99b5ccf27215 6741 * @return none.
<> 133:99b5ccf27215 6742 */
<> 133:99b5ccf27215 6743
<> 133:99b5ccf27215 6744 void arm_cmplx_dot_prod_q31(
<> 133:99b5ccf27215 6745 q31_t * pSrcA,
<> 133:99b5ccf27215 6746 q31_t * pSrcB,
<> 133:99b5ccf27215 6747 uint32_t numSamples,
<> 133:99b5ccf27215 6748 q63_t * realResult,
<> 133:99b5ccf27215 6749 q63_t * imagResult);
<> 133:99b5ccf27215 6750
<> 133:99b5ccf27215 6751 /**
<> 133:99b5ccf27215 6752 * @brief Floating-point complex dot product
<> 133:99b5ccf27215 6753 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6754 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6755 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6756 * @param[out] *realResult real part of the result returned here
<> 133:99b5ccf27215 6757 * @param[out] *imagResult imaginary part of the result returned here
<> 133:99b5ccf27215 6758 * @return none.
<> 133:99b5ccf27215 6759 */
<> 133:99b5ccf27215 6760
<> 133:99b5ccf27215 6761 void arm_cmplx_dot_prod_f32(
<> 133:99b5ccf27215 6762 float32_t * pSrcA,
<> 133:99b5ccf27215 6763 float32_t * pSrcB,
<> 133:99b5ccf27215 6764 uint32_t numSamples,
<> 133:99b5ccf27215 6765 float32_t * realResult,
<> 133:99b5ccf27215 6766 float32_t * imagResult);
<> 133:99b5ccf27215 6767
<> 133:99b5ccf27215 6768 /**
<> 133:99b5ccf27215 6769 * @brief Q15 complex-by-real multiplication
<> 133:99b5ccf27215 6770 * @param[in] *pSrcCmplx points to the complex input vector
<> 133:99b5ccf27215 6771 * @param[in] *pSrcReal points to the real input vector
<> 133:99b5ccf27215 6772 * @param[out] *pCmplxDst points to the complex output vector
<> 133:99b5ccf27215 6773 * @param[in] numSamples number of samples in each vector
<> 133:99b5ccf27215 6774 * @return none.
<> 133:99b5ccf27215 6775 */
<> 133:99b5ccf27215 6776
<> 133:99b5ccf27215 6777 void arm_cmplx_mult_real_q15(
<> 133:99b5ccf27215 6778 q15_t * pSrcCmplx,
<> 133:99b5ccf27215 6779 q15_t * pSrcReal,
<> 133:99b5ccf27215 6780 q15_t * pCmplxDst,
<> 133:99b5ccf27215 6781 uint32_t numSamples);
<> 133:99b5ccf27215 6782
<> 133:99b5ccf27215 6783 /**
<> 133:99b5ccf27215 6784 * @brief Q31 complex-by-real multiplication
<> 133:99b5ccf27215 6785 * @param[in] *pSrcCmplx points to the complex input vector
<> 133:99b5ccf27215 6786 * @param[in] *pSrcReal points to the real input vector
<> 133:99b5ccf27215 6787 * @param[out] *pCmplxDst points to the complex output vector
<> 133:99b5ccf27215 6788 * @param[in] numSamples number of samples in each vector
<> 133:99b5ccf27215 6789 * @return none.
<> 133:99b5ccf27215 6790 */
<> 133:99b5ccf27215 6791
<> 133:99b5ccf27215 6792 void arm_cmplx_mult_real_q31(
<> 133:99b5ccf27215 6793 q31_t * pSrcCmplx,
<> 133:99b5ccf27215 6794 q31_t * pSrcReal,
<> 133:99b5ccf27215 6795 q31_t * pCmplxDst,
<> 133:99b5ccf27215 6796 uint32_t numSamples);
<> 133:99b5ccf27215 6797
<> 133:99b5ccf27215 6798 /**
<> 133:99b5ccf27215 6799 * @brief Floating-point complex-by-real multiplication
<> 133:99b5ccf27215 6800 * @param[in] *pSrcCmplx points to the complex input vector
<> 133:99b5ccf27215 6801 * @param[in] *pSrcReal points to the real input vector
<> 133:99b5ccf27215 6802 * @param[out] *pCmplxDst points to the complex output vector
<> 133:99b5ccf27215 6803 * @param[in] numSamples number of samples in each vector
<> 133:99b5ccf27215 6804 * @return none.
<> 133:99b5ccf27215 6805 */
<> 133:99b5ccf27215 6806
<> 133:99b5ccf27215 6807 void arm_cmplx_mult_real_f32(
<> 133:99b5ccf27215 6808 float32_t * pSrcCmplx,
<> 133:99b5ccf27215 6809 float32_t * pSrcReal,
<> 133:99b5ccf27215 6810 float32_t * pCmplxDst,
<> 133:99b5ccf27215 6811 uint32_t numSamples);
<> 133:99b5ccf27215 6812
<> 133:99b5ccf27215 6813 /**
<> 133:99b5ccf27215 6814 * @brief Minimum value of a Q7 vector.
<> 133:99b5ccf27215 6815 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6816 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6817 * @param[out] *result is output pointer
<> 133:99b5ccf27215 6818 * @param[in] index is the array index of the minimum value in the input buffer.
<> 133:99b5ccf27215 6819 * @return none.
<> 133:99b5ccf27215 6820 */
<> 133:99b5ccf27215 6821
<> 133:99b5ccf27215 6822 void arm_min_q7(
<> 133:99b5ccf27215 6823 q7_t * pSrc,
<> 133:99b5ccf27215 6824 uint32_t blockSize,
<> 133:99b5ccf27215 6825 q7_t * result,
<> 133:99b5ccf27215 6826 uint32_t * index);
<> 133:99b5ccf27215 6827
<> 133:99b5ccf27215 6828 /**
<> 133:99b5ccf27215 6829 * @brief Minimum value of a Q15 vector.
<> 133:99b5ccf27215 6830 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6831 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6832 * @param[out] *pResult is output pointer
<> 133:99b5ccf27215 6833 * @param[in] *pIndex is the array index of the minimum value in the input buffer.
<> 133:99b5ccf27215 6834 * @return none.
<> 133:99b5ccf27215 6835 */
<> 133:99b5ccf27215 6836
<> 133:99b5ccf27215 6837 void arm_min_q15(
<> 133:99b5ccf27215 6838 q15_t * pSrc,
<> 133:99b5ccf27215 6839 uint32_t blockSize,
<> 133:99b5ccf27215 6840 q15_t * pResult,
<> 133:99b5ccf27215 6841 uint32_t * pIndex);
<> 133:99b5ccf27215 6842
<> 133:99b5ccf27215 6843 /**
<> 133:99b5ccf27215 6844 * @brief Minimum value of a Q31 vector.
<> 133:99b5ccf27215 6845 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6846 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6847 * @param[out] *pResult is output pointer
<> 133:99b5ccf27215 6848 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 133:99b5ccf27215 6849 * @return none.
<> 133:99b5ccf27215 6850 */
<> 133:99b5ccf27215 6851 void arm_min_q31(
<> 133:99b5ccf27215 6852 q31_t * pSrc,
<> 133:99b5ccf27215 6853 uint32_t blockSize,
<> 133:99b5ccf27215 6854 q31_t * pResult,
<> 133:99b5ccf27215 6855 uint32_t * pIndex);
<> 133:99b5ccf27215 6856
<> 133:99b5ccf27215 6857 /**
<> 133:99b5ccf27215 6858 * @brief Minimum value of a floating-point vector.
<> 133:99b5ccf27215 6859 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 6860 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 6861 * @param[out] *pResult is output pointer
<> 133:99b5ccf27215 6862 * @param[out] *pIndex is the array index of the minimum value in the input buffer.
<> 133:99b5ccf27215 6863 * @return none.
<> 133:99b5ccf27215 6864 */
<> 133:99b5ccf27215 6865
<> 133:99b5ccf27215 6866 void arm_min_f32(
<> 133:99b5ccf27215 6867 float32_t * pSrc,
<> 133:99b5ccf27215 6868 uint32_t blockSize,
<> 133:99b5ccf27215 6869 float32_t * pResult,
<> 133:99b5ccf27215 6870 uint32_t * pIndex);
<> 133:99b5ccf27215 6871
<> 133:99b5ccf27215 6872 /**
<> 133:99b5ccf27215 6873 * @brief Maximum value of a Q7 vector.
<> 133:99b5ccf27215 6874 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 6875 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6876 * @param[out] *pResult maximum value returned here
<> 133:99b5ccf27215 6877 * @param[out] *pIndex index of maximum value returned here
<> 133:99b5ccf27215 6878 * @return none.
<> 133:99b5ccf27215 6879 */
<> 133:99b5ccf27215 6880
<> 133:99b5ccf27215 6881 void arm_max_q7(
<> 133:99b5ccf27215 6882 q7_t * pSrc,
<> 133:99b5ccf27215 6883 uint32_t blockSize,
<> 133:99b5ccf27215 6884 q7_t * pResult,
<> 133:99b5ccf27215 6885 uint32_t * pIndex);
<> 133:99b5ccf27215 6886
<> 133:99b5ccf27215 6887 /**
<> 133:99b5ccf27215 6888 * @brief Maximum value of a Q15 vector.
<> 133:99b5ccf27215 6889 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 6890 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6891 * @param[out] *pResult maximum value returned here
<> 133:99b5ccf27215 6892 * @param[out] *pIndex index of maximum value returned here
<> 133:99b5ccf27215 6893 * @return none.
<> 133:99b5ccf27215 6894 */
<> 133:99b5ccf27215 6895
<> 133:99b5ccf27215 6896 void arm_max_q15(
<> 133:99b5ccf27215 6897 q15_t * pSrc,
<> 133:99b5ccf27215 6898 uint32_t blockSize,
<> 133:99b5ccf27215 6899 q15_t * pResult,
<> 133:99b5ccf27215 6900 uint32_t * pIndex);
<> 133:99b5ccf27215 6901
<> 133:99b5ccf27215 6902 /**
<> 133:99b5ccf27215 6903 * @brief Maximum value of a Q31 vector.
<> 133:99b5ccf27215 6904 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 6905 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6906 * @param[out] *pResult maximum value returned here
<> 133:99b5ccf27215 6907 * @param[out] *pIndex index of maximum value returned here
<> 133:99b5ccf27215 6908 * @return none.
<> 133:99b5ccf27215 6909 */
<> 133:99b5ccf27215 6910
<> 133:99b5ccf27215 6911 void arm_max_q31(
<> 133:99b5ccf27215 6912 q31_t * pSrc,
<> 133:99b5ccf27215 6913 uint32_t blockSize,
<> 133:99b5ccf27215 6914 q31_t * pResult,
<> 133:99b5ccf27215 6915 uint32_t * pIndex);
<> 133:99b5ccf27215 6916
<> 133:99b5ccf27215 6917 /**
<> 133:99b5ccf27215 6918 * @brief Maximum value of a floating-point vector.
<> 133:99b5ccf27215 6919 * @param[in] *pSrc points to the input buffer
<> 133:99b5ccf27215 6920 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6921 * @param[out] *pResult maximum value returned here
<> 133:99b5ccf27215 6922 * @param[out] *pIndex index of maximum value returned here
<> 133:99b5ccf27215 6923 * @return none.
<> 133:99b5ccf27215 6924 */
<> 133:99b5ccf27215 6925
<> 133:99b5ccf27215 6926 void arm_max_f32(
<> 133:99b5ccf27215 6927 float32_t * pSrc,
<> 133:99b5ccf27215 6928 uint32_t blockSize,
<> 133:99b5ccf27215 6929 float32_t * pResult,
<> 133:99b5ccf27215 6930 uint32_t * pIndex);
<> 133:99b5ccf27215 6931
<> 133:99b5ccf27215 6932 /**
<> 133:99b5ccf27215 6933 * @brief Q15 complex-by-complex multiplication
<> 133:99b5ccf27215 6934 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6935 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6936 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 6937 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6938 * @return none.
<> 133:99b5ccf27215 6939 */
<> 133:99b5ccf27215 6940
<> 133:99b5ccf27215 6941 void arm_cmplx_mult_cmplx_q15(
<> 133:99b5ccf27215 6942 q15_t * pSrcA,
<> 133:99b5ccf27215 6943 q15_t * pSrcB,
<> 133:99b5ccf27215 6944 q15_t * pDst,
<> 133:99b5ccf27215 6945 uint32_t numSamples);
<> 133:99b5ccf27215 6946
<> 133:99b5ccf27215 6947 /**
<> 133:99b5ccf27215 6948 * @brief Q31 complex-by-complex multiplication
<> 133:99b5ccf27215 6949 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6950 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6951 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 6952 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6953 * @return none.
<> 133:99b5ccf27215 6954 */
<> 133:99b5ccf27215 6955
<> 133:99b5ccf27215 6956 void arm_cmplx_mult_cmplx_q31(
<> 133:99b5ccf27215 6957 q31_t * pSrcA,
<> 133:99b5ccf27215 6958 q31_t * pSrcB,
<> 133:99b5ccf27215 6959 q31_t * pDst,
<> 133:99b5ccf27215 6960 uint32_t numSamples);
<> 133:99b5ccf27215 6961
<> 133:99b5ccf27215 6962 /**
<> 133:99b5ccf27215 6963 * @brief Floating-point complex-by-complex multiplication
<> 133:99b5ccf27215 6964 * @param[in] *pSrcA points to the first input vector
<> 133:99b5ccf27215 6965 * @param[in] *pSrcB points to the second input vector
<> 133:99b5ccf27215 6966 * @param[out] *pDst points to the output vector
<> 133:99b5ccf27215 6967 * @param[in] numSamples number of complex samples in each vector
<> 133:99b5ccf27215 6968 * @return none.
<> 133:99b5ccf27215 6969 */
<> 133:99b5ccf27215 6970
<> 133:99b5ccf27215 6971 void arm_cmplx_mult_cmplx_f32(
<> 133:99b5ccf27215 6972 float32_t * pSrcA,
<> 133:99b5ccf27215 6973 float32_t * pSrcB,
<> 133:99b5ccf27215 6974 float32_t * pDst,
<> 133:99b5ccf27215 6975 uint32_t numSamples);
<> 133:99b5ccf27215 6976
<> 133:99b5ccf27215 6977 /**
<> 133:99b5ccf27215 6978 * @brief Converts the elements of the floating-point vector to Q31 vector.
<> 133:99b5ccf27215 6979 * @param[in] *pSrc points to the floating-point input vector
<> 133:99b5ccf27215 6980 * @param[out] *pDst points to the Q31 output vector
<> 133:99b5ccf27215 6981 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6982 * @return none.
<> 133:99b5ccf27215 6983 */
<> 133:99b5ccf27215 6984 void arm_float_to_q31(
<> 133:99b5ccf27215 6985 float32_t * pSrc,
<> 133:99b5ccf27215 6986 q31_t * pDst,
<> 133:99b5ccf27215 6987 uint32_t blockSize);
<> 133:99b5ccf27215 6988
<> 133:99b5ccf27215 6989 /**
<> 133:99b5ccf27215 6990 * @brief Converts the elements of the floating-point vector to Q15 vector.
<> 133:99b5ccf27215 6991 * @param[in] *pSrc points to the floating-point input vector
<> 133:99b5ccf27215 6992 * @param[out] *pDst points to the Q15 output vector
<> 133:99b5ccf27215 6993 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 6994 * @return none
<> 133:99b5ccf27215 6995 */
<> 133:99b5ccf27215 6996 void arm_float_to_q15(
<> 133:99b5ccf27215 6997 float32_t * pSrc,
<> 133:99b5ccf27215 6998 q15_t * pDst,
<> 133:99b5ccf27215 6999 uint32_t blockSize);
<> 133:99b5ccf27215 7000
<> 133:99b5ccf27215 7001 /**
<> 133:99b5ccf27215 7002 * @brief Converts the elements of the floating-point vector to Q7 vector.
<> 133:99b5ccf27215 7003 * @param[in] *pSrc points to the floating-point input vector
<> 133:99b5ccf27215 7004 * @param[out] *pDst points to the Q7 output vector
<> 133:99b5ccf27215 7005 * @param[in] blockSize length of the input vector
<> 133:99b5ccf27215 7006 * @return none
<> 133:99b5ccf27215 7007 */
<> 133:99b5ccf27215 7008 void arm_float_to_q7(
<> 133:99b5ccf27215 7009 float32_t * pSrc,
<> 133:99b5ccf27215 7010 q7_t * pDst,
<> 133:99b5ccf27215 7011 uint32_t blockSize);
<> 133:99b5ccf27215 7012
<> 133:99b5ccf27215 7013
<> 133:99b5ccf27215 7014 /**
<> 133:99b5ccf27215 7015 * @brief Converts the elements of the Q31 vector to Q15 vector.
<> 133:99b5ccf27215 7016 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 7017 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 7018 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 7019 * @return none.
<> 133:99b5ccf27215 7020 */
<> 133:99b5ccf27215 7021 void arm_q31_to_q15(
<> 133:99b5ccf27215 7022 q31_t * pSrc,
<> 133:99b5ccf27215 7023 q15_t * pDst,
<> 133:99b5ccf27215 7024 uint32_t blockSize);
<> 133:99b5ccf27215 7025
<> 133:99b5ccf27215 7026 /**
<> 133:99b5ccf27215 7027 * @brief Converts the elements of the Q31 vector to Q7 vector.
<> 133:99b5ccf27215 7028 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 7029 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 7030 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 7031 * @return none.
<> 133:99b5ccf27215 7032 */
<> 133:99b5ccf27215 7033 void arm_q31_to_q7(
<> 133:99b5ccf27215 7034 q31_t * pSrc,
<> 133:99b5ccf27215 7035 q7_t * pDst,
<> 133:99b5ccf27215 7036 uint32_t blockSize);
<> 133:99b5ccf27215 7037
<> 133:99b5ccf27215 7038 /**
<> 133:99b5ccf27215 7039 * @brief Converts the elements of the Q15 vector to floating-point vector.
<> 133:99b5ccf27215 7040 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 7041 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 7042 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 7043 * @return none.
<> 133:99b5ccf27215 7044 */
<> 133:99b5ccf27215 7045 void arm_q15_to_float(
<> 133:99b5ccf27215 7046 q15_t * pSrc,
<> 133:99b5ccf27215 7047 float32_t * pDst,
<> 133:99b5ccf27215 7048 uint32_t blockSize);
<> 133:99b5ccf27215 7049
<> 133:99b5ccf27215 7050
<> 133:99b5ccf27215 7051 /**
<> 133:99b5ccf27215 7052 * @brief Converts the elements of the Q15 vector to Q31 vector.
<> 133:99b5ccf27215 7053 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 7054 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 7055 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 7056 * @return none.
<> 133:99b5ccf27215 7057 */
<> 133:99b5ccf27215 7058 void arm_q15_to_q31(
<> 133:99b5ccf27215 7059 q15_t * pSrc,
<> 133:99b5ccf27215 7060 q31_t * pDst,
<> 133:99b5ccf27215 7061 uint32_t blockSize);
<> 133:99b5ccf27215 7062
<> 133:99b5ccf27215 7063
<> 133:99b5ccf27215 7064 /**
<> 133:99b5ccf27215 7065 * @brief Converts the elements of the Q15 vector to Q7 vector.
<> 133:99b5ccf27215 7066 * @param[in] *pSrc is input pointer
<> 133:99b5ccf27215 7067 * @param[out] *pDst is output pointer
<> 133:99b5ccf27215 7068 * @param[in] blockSize is the number of samples to process
<> 133:99b5ccf27215 7069 * @return none.
<> 133:99b5ccf27215 7070 */
<> 133:99b5ccf27215 7071 void arm_q15_to_q7(
<> 133:99b5ccf27215 7072 q15_t * pSrc,
<> 133:99b5ccf27215 7073 q7_t * pDst,
<> 133:99b5ccf27215 7074 uint32_t blockSize);
<> 133:99b5ccf27215 7075
<> 133:99b5ccf27215 7076
<> 133:99b5ccf27215 7077 /**
<> 133:99b5ccf27215 7078 * @ingroup groupInterpolation
<> 133:99b5ccf27215 7079 */
<> 133:99b5ccf27215 7080
<> 133:99b5ccf27215 7081 /**
<> 133:99b5ccf27215 7082 * @defgroup BilinearInterpolate Bilinear Interpolation
<> 133:99b5ccf27215 7083 *
<> 133:99b5ccf27215 7084 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
<> 133:99b5ccf27215 7085 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process
<> 133:99b5ccf27215 7086 * determines values between the grid points.
<> 133:99b5ccf27215 7087 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension.
<> 133:99b5ccf27215 7088 * Bilinear interpolation is often used in image processing to rescale images.
<> 133:99b5ccf27215 7089 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
<> 133:99b5ccf27215 7090 *
<> 133:99b5ccf27215 7091 * <b>Algorithm</b>
<> 133:99b5ccf27215 7092 * \par
<> 133:99b5ccf27215 7093 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table.
<> 133:99b5ccf27215 7094 * For floating-point, the instance structure is defined as:
<> 133:99b5ccf27215 7095 * <pre>
<> 133:99b5ccf27215 7096 * typedef struct
<> 133:99b5ccf27215 7097 * {
<> 133:99b5ccf27215 7098 * uint16_t numRows;
<> 133:99b5ccf27215 7099 * uint16_t numCols;
<> 133:99b5ccf27215 7100 * float32_t *pData;
<> 133:99b5ccf27215 7101 * } arm_bilinear_interp_instance_f32;
<> 133:99b5ccf27215 7102 * </pre>
<> 133:99b5ccf27215 7103 *
<> 133:99b5ccf27215 7104 * \par
<> 133:99b5ccf27215 7105 * where <code>numRows</code> specifies the number of rows in the table;
<> 133:99b5ccf27215 7106 * <code>numCols</code> specifies the number of columns in the table;
<> 133:99b5ccf27215 7107 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values.
<> 133:99b5ccf27215 7108 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes.
<> 133:99b5ccf27215 7109 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers.
<> 133:99b5ccf27215 7110 *
<> 133:99b5ccf27215 7111 * \par
<> 133:99b5ccf27215 7112 * Let <code>(x, y)</code> specify the desired interpolation point. Then define:
<> 133:99b5ccf27215 7113 * <pre>
<> 133:99b5ccf27215 7114 * XF = floor(x)
<> 133:99b5ccf27215 7115 * YF = floor(y)
<> 133:99b5ccf27215 7116 * </pre>
<> 133:99b5ccf27215 7117 * \par
<> 133:99b5ccf27215 7118 * The interpolated output point is computed as:
<> 133:99b5ccf27215 7119 * <pre>
<> 133:99b5ccf27215 7120 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
<> 133:99b5ccf27215 7121 * + f(XF+1, YF) * (x-XF)*(1-(y-YF))
<> 133:99b5ccf27215 7122 * + f(XF, YF+1) * (1-(x-XF))*(y-YF)
<> 133:99b5ccf27215 7123 * + f(XF+1, YF+1) * (x-XF)*(y-YF)
<> 133:99b5ccf27215 7124 * </pre>
<> 133:99b5ccf27215 7125 * Note that the coordinates (x, y) contain integer and fractional components.
<> 133:99b5ccf27215 7126 * The integer components specify which portion of the table to use while the
<> 133:99b5ccf27215 7127 * fractional components control the interpolation processor.
<> 133:99b5ccf27215 7128 *
<> 133:99b5ccf27215 7129 * \par
<> 133:99b5ccf27215 7130 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
<> 133:99b5ccf27215 7131 */
<> 133:99b5ccf27215 7132
<> 133:99b5ccf27215 7133 /**
<> 133:99b5ccf27215 7134 * @addtogroup BilinearInterpolate
<> 133:99b5ccf27215 7135 * @{
<> 133:99b5ccf27215 7136 */
<> 133:99b5ccf27215 7137
<> 133:99b5ccf27215 7138 /**
<> 133:99b5ccf27215 7139 *
<> 133:99b5ccf27215 7140 * @brief Floating-point bilinear interpolation.
<> 133:99b5ccf27215 7141 * @param[in,out] *S points to an instance of the interpolation structure.
<> 133:99b5ccf27215 7142 * @param[in] X interpolation coordinate.
<> 133:99b5ccf27215 7143 * @param[in] Y interpolation coordinate.
<> 133:99b5ccf27215 7144 * @return out interpolated value.
<> 133:99b5ccf27215 7145 */
<> 133:99b5ccf27215 7146
<> 133:99b5ccf27215 7147
<> 133:99b5ccf27215 7148 static __INLINE float32_t arm_bilinear_interp_f32(
<> 133:99b5ccf27215 7149 const arm_bilinear_interp_instance_f32 * S,
<> 133:99b5ccf27215 7150 float32_t X,
<> 133:99b5ccf27215 7151 float32_t Y)
<> 133:99b5ccf27215 7152 {
<> 133:99b5ccf27215 7153 float32_t out;
<> 133:99b5ccf27215 7154 float32_t f00, f01, f10, f11;
<> 133:99b5ccf27215 7155 float32_t *pData = S->pData;
<> 133:99b5ccf27215 7156 int32_t xIndex, yIndex, index;
<> 133:99b5ccf27215 7157 float32_t xdiff, ydiff;
<> 133:99b5ccf27215 7158 float32_t b1, b2, b3, b4;
<> 133:99b5ccf27215 7159
<> 133:99b5ccf27215 7160 xIndex = (int32_t) X;
<> 133:99b5ccf27215 7161 yIndex = (int32_t) Y;
<> 133:99b5ccf27215 7162
<> 133:99b5ccf27215 7163 /* Care taken for table outside boundary */
<> 133:99b5ccf27215 7164 /* Returns zero output when values are outside table boundary */
<> 133:99b5ccf27215 7165 if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0
<> 133:99b5ccf27215 7166 || yIndex > (S->numCols - 1))
<> 133:99b5ccf27215 7167 {
<> 133:99b5ccf27215 7168 return (0);
<> 133:99b5ccf27215 7169 }
<> 133:99b5ccf27215 7170
<> 133:99b5ccf27215 7171 /* Calculation of index for two nearest points in X-direction */
<> 133:99b5ccf27215 7172 index = (xIndex - 1) + (yIndex - 1) * S->numCols;
<> 133:99b5ccf27215 7173
<> 133:99b5ccf27215 7174
<> 133:99b5ccf27215 7175 /* Read two nearest points in X-direction */
<> 133:99b5ccf27215 7176 f00 = pData[index];
<> 133:99b5ccf27215 7177 f01 = pData[index + 1];
<> 133:99b5ccf27215 7178
<> 133:99b5ccf27215 7179 /* Calculation of index for two nearest points in Y-direction */
<> 133:99b5ccf27215 7180 index = (xIndex - 1) + (yIndex) * S->numCols;
<> 133:99b5ccf27215 7181
<> 133:99b5ccf27215 7182
<> 133:99b5ccf27215 7183 /* Read two nearest points in Y-direction */
<> 133:99b5ccf27215 7184 f10 = pData[index];
<> 133:99b5ccf27215 7185 f11 = pData[index + 1];
<> 133:99b5ccf27215 7186
<> 133:99b5ccf27215 7187 /* Calculation of intermediate values */
<> 133:99b5ccf27215 7188 b1 = f00;
<> 133:99b5ccf27215 7189 b2 = f01 - f00;
<> 133:99b5ccf27215 7190 b3 = f10 - f00;
<> 133:99b5ccf27215 7191 b4 = f00 - f01 - f10 + f11;
<> 133:99b5ccf27215 7192
<> 133:99b5ccf27215 7193 /* Calculation of fractional part in X */
<> 133:99b5ccf27215 7194 xdiff = X - xIndex;
<> 133:99b5ccf27215 7195
<> 133:99b5ccf27215 7196 /* Calculation of fractional part in Y */
<> 133:99b5ccf27215 7197 ydiff = Y - yIndex;
<> 133:99b5ccf27215 7198
<> 133:99b5ccf27215 7199 /* Calculation of bi-linear interpolated output */
<> 133:99b5ccf27215 7200 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
<> 133:99b5ccf27215 7201
<> 133:99b5ccf27215 7202 /* return to application */
<> 133:99b5ccf27215 7203 return (out);
<> 133:99b5ccf27215 7204
<> 133:99b5ccf27215 7205 }
<> 133:99b5ccf27215 7206
<> 133:99b5ccf27215 7207 /**
<> 133:99b5ccf27215 7208 *
<> 133:99b5ccf27215 7209 * @brief Q31 bilinear interpolation.
<> 133:99b5ccf27215 7210 * @param[in,out] *S points to an instance of the interpolation structure.
<> 133:99b5ccf27215 7211 * @param[in] X interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7212 * @param[in] Y interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7213 * @return out interpolated value.
<> 133:99b5ccf27215 7214 */
<> 133:99b5ccf27215 7215
<> 133:99b5ccf27215 7216 static __INLINE q31_t arm_bilinear_interp_q31(
<> 133:99b5ccf27215 7217 arm_bilinear_interp_instance_q31 * S,
<> 133:99b5ccf27215 7218 q31_t X,
<> 133:99b5ccf27215 7219 q31_t Y)
<> 133:99b5ccf27215 7220 {
<> 133:99b5ccf27215 7221 q31_t out; /* Temporary output */
<> 133:99b5ccf27215 7222 q31_t acc = 0; /* output */
<> 133:99b5ccf27215 7223 q31_t xfract, yfract; /* X, Y fractional parts */
<> 133:99b5ccf27215 7224 q31_t x1, x2, y1, y2; /* Nearest output values */
<> 133:99b5ccf27215 7225 int32_t rI, cI; /* Row and column indices */
<> 133:99b5ccf27215 7226 q31_t *pYData = S->pData; /* pointer to output table values */
<> 133:99b5ccf27215 7227 uint32_t nCols = S->numCols; /* num of rows */
<> 133:99b5ccf27215 7228
<> 133:99b5ccf27215 7229
<> 133:99b5ccf27215 7230 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7231 /* 12 bits for the table index */
<> 133:99b5ccf27215 7232 /* Index value calculation */
<> 133:99b5ccf27215 7233 rI = ((X & 0xFFF00000) >> 20u);
<> 133:99b5ccf27215 7234
<> 133:99b5ccf27215 7235 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7236 /* 12 bits for the table index */
<> 133:99b5ccf27215 7237 /* Index value calculation */
<> 133:99b5ccf27215 7238 cI = ((Y & 0xFFF00000) >> 20u);
<> 133:99b5ccf27215 7239
<> 133:99b5ccf27215 7240 /* Care taken for table outside boundary */
<> 133:99b5ccf27215 7241 /* Returns zero output when values are outside table boundary */
<> 133:99b5ccf27215 7242 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 133:99b5ccf27215 7243 {
<> 133:99b5ccf27215 7244 return (0);
<> 133:99b5ccf27215 7245 }
<> 133:99b5ccf27215 7246
<> 133:99b5ccf27215 7247 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7248 /* shift left xfract by 11 to keep 1.31 format */
<> 133:99b5ccf27215 7249 xfract = (X & 0x000FFFFF) << 11u;
<> 133:99b5ccf27215 7250
<> 133:99b5ccf27215 7251 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7252 x1 = pYData[(rI) + nCols * (cI)];
<> 133:99b5ccf27215 7253 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 133:99b5ccf27215 7254
<> 133:99b5ccf27215 7255 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7256 /* shift left yfract by 11 to keep 1.31 format */
<> 133:99b5ccf27215 7257 yfract = (Y & 0x000FFFFF) << 11u;
<> 133:99b5ccf27215 7258
<> 133:99b5ccf27215 7259 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7260 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 133:99b5ccf27215 7261 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 133:99b5ccf27215 7262
<> 133:99b5ccf27215 7263 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
<> 133:99b5ccf27215 7264 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
<> 133:99b5ccf27215 7265 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
<> 133:99b5ccf27215 7266
<> 133:99b5ccf27215 7267 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
<> 133:99b5ccf27215 7268 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
<> 133:99b5ccf27215 7269 acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
<> 133:99b5ccf27215 7270
<> 133:99b5ccf27215 7271 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 133:99b5ccf27215 7272 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
<> 133:99b5ccf27215 7273 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 133:99b5ccf27215 7274
<> 133:99b5ccf27215 7275 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
<> 133:99b5ccf27215 7276 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
<> 133:99b5ccf27215 7277 acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
<> 133:99b5ccf27215 7278
<> 133:99b5ccf27215 7279 /* Convert acc to 1.31(q31) format */
<> 133:99b5ccf27215 7280 return (acc << 2u);
<> 133:99b5ccf27215 7281
<> 133:99b5ccf27215 7282 }
<> 133:99b5ccf27215 7283
<> 133:99b5ccf27215 7284 /**
<> 133:99b5ccf27215 7285 * @brief Q15 bilinear interpolation.
<> 133:99b5ccf27215 7286 * @param[in,out] *S points to an instance of the interpolation structure.
<> 133:99b5ccf27215 7287 * @param[in] X interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7288 * @param[in] Y interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7289 * @return out interpolated value.
<> 133:99b5ccf27215 7290 */
<> 133:99b5ccf27215 7291
<> 133:99b5ccf27215 7292 static __INLINE q15_t arm_bilinear_interp_q15(
<> 133:99b5ccf27215 7293 arm_bilinear_interp_instance_q15 * S,
<> 133:99b5ccf27215 7294 q31_t X,
<> 133:99b5ccf27215 7295 q31_t Y)
<> 133:99b5ccf27215 7296 {
<> 133:99b5ccf27215 7297 q63_t acc = 0; /* output */
<> 133:99b5ccf27215 7298 q31_t out; /* Temporary output */
<> 133:99b5ccf27215 7299 q15_t x1, x2, y1, y2; /* Nearest output values */
<> 133:99b5ccf27215 7300 q31_t xfract, yfract; /* X, Y fractional parts */
<> 133:99b5ccf27215 7301 int32_t rI, cI; /* Row and column indices */
<> 133:99b5ccf27215 7302 q15_t *pYData = S->pData; /* pointer to output table values */
<> 133:99b5ccf27215 7303 uint32_t nCols = S->numCols; /* num of rows */
<> 133:99b5ccf27215 7304
<> 133:99b5ccf27215 7305 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7306 /* 12 bits for the table index */
<> 133:99b5ccf27215 7307 /* Index value calculation */
<> 133:99b5ccf27215 7308 rI = ((X & 0xFFF00000) >> 20);
<> 133:99b5ccf27215 7309
<> 133:99b5ccf27215 7310 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7311 /* 12 bits for the table index */
<> 133:99b5ccf27215 7312 /* Index value calculation */
<> 133:99b5ccf27215 7313 cI = ((Y & 0xFFF00000) >> 20);
<> 133:99b5ccf27215 7314
<> 133:99b5ccf27215 7315 /* Care taken for table outside boundary */
<> 133:99b5ccf27215 7316 /* Returns zero output when values are outside table boundary */
<> 133:99b5ccf27215 7317 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 133:99b5ccf27215 7318 {
<> 133:99b5ccf27215 7319 return (0);
<> 133:99b5ccf27215 7320 }
<> 133:99b5ccf27215 7321
<> 133:99b5ccf27215 7322 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7323 /* xfract should be in 12.20 format */
<> 133:99b5ccf27215 7324 xfract = (X & 0x000FFFFF);
<> 133:99b5ccf27215 7325
<> 133:99b5ccf27215 7326 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7327 x1 = pYData[(rI) + nCols * (cI)];
<> 133:99b5ccf27215 7328 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 133:99b5ccf27215 7329
<> 133:99b5ccf27215 7330
<> 133:99b5ccf27215 7331 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7332 /* yfract should be in 12.20 format */
<> 133:99b5ccf27215 7333 yfract = (Y & 0x000FFFFF);
<> 133:99b5ccf27215 7334
<> 133:99b5ccf27215 7335 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7336 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 133:99b5ccf27215 7337 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 133:99b5ccf27215 7338
<> 133:99b5ccf27215 7339 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
<> 133:99b5ccf27215 7340
<> 133:99b5ccf27215 7341 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
<> 133:99b5ccf27215 7342 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
<> 133:99b5ccf27215 7343 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
<> 133:99b5ccf27215 7344 acc = ((q63_t) out * (0xFFFFF - yfract));
<> 133:99b5ccf27215 7345
<> 133:99b5ccf27215 7346 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
<> 133:99b5ccf27215 7347 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
<> 133:99b5ccf27215 7348 acc += ((q63_t) out * (xfract));
<> 133:99b5ccf27215 7349
<> 133:99b5ccf27215 7350 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
<> 133:99b5ccf27215 7351 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
<> 133:99b5ccf27215 7352 acc += ((q63_t) out * (yfract));
<> 133:99b5ccf27215 7353
<> 133:99b5ccf27215 7354 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
<> 133:99b5ccf27215 7355 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
<> 133:99b5ccf27215 7356 acc += ((q63_t) out * (yfract));
<> 133:99b5ccf27215 7357
<> 133:99b5ccf27215 7358 /* acc is in 13.51 format and down shift acc by 36 times */
<> 133:99b5ccf27215 7359 /* Convert out to 1.15 format */
<> 133:99b5ccf27215 7360 return (acc >> 36);
<> 133:99b5ccf27215 7361
<> 133:99b5ccf27215 7362 }
<> 133:99b5ccf27215 7363
<> 133:99b5ccf27215 7364 /**
<> 133:99b5ccf27215 7365 * @brief Q7 bilinear interpolation.
<> 133:99b5ccf27215 7366 * @param[in,out] *S points to an instance of the interpolation structure.
<> 133:99b5ccf27215 7367 * @param[in] X interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7368 * @param[in] Y interpolation coordinate in 12.20 format.
<> 133:99b5ccf27215 7369 * @return out interpolated value.
<> 133:99b5ccf27215 7370 */
<> 133:99b5ccf27215 7371
<> 133:99b5ccf27215 7372 static __INLINE q7_t arm_bilinear_interp_q7(
<> 133:99b5ccf27215 7373 arm_bilinear_interp_instance_q7 * S,
<> 133:99b5ccf27215 7374 q31_t X,
<> 133:99b5ccf27215 7375 q31_t Y)
<> 133:99b5ccf27215 7376 {
<> 133:99b5ccf27215 7377 q63_t acc = 0; /* output */
<> 133:99b5ccf27215 7378 q31_t out; /* Temporary output */
<> 133:99b5ccf27215 7379 q31_t xfract, yfract; /* X, Y fractional parts */
<> 133:99b5ccf27215 7380 q7_t x1, x2, y1, y2; /* Nearest output values */
<> 133:99b5ccf27215 7381 int32_t rI, cI; /* Row and column indices */
<> 133:99b5ccf27215 7382 q7_t *pYData = S->pData; /* pointer to output table values */
<> 133:99b5ccf27215 7383 uint32_t nCols = S->numCols; /* num of rows */
<> 133:99b5ccf27215 7384
<> 133:99b5ccf27215 7385 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7386 /* 12 bits for the table index */
<> 133:99b5ccf27215 7387 /* Index value calculation */
<> 133:99b5ccf27215 7388 rI = ((X & 0xFFF00000) >> 20);
<> 133:99b5ccf27215 7389
<> 133:99b5ccf27215 7390 /* Input is in 12.20 format */
<> 133:99b5ccf27215 7391 /* 12 bits for the table index */
<> 133:99b5ccf27215 7392 /* Index value calculation */
<> 133:99b5ccf27215 7393 cI = ((Y & 0xFFF00000) >> 20);
<> 133:99b5ccf27215 7394
<> 133:99b5ccf27215 7395 /* Care taken for table outside boundary */
<> 133:99b5ccf27215 7396 /* Returns zero output when values are outside table boundary */
<> 133:99b5ccf27215 7397 if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
<> 133:99b5ccf27215 7398 {
<> 133:99b5ccf27215 7399 return (0);
<> 133:99b5ccf27215 7400 }
<> 133:99b5ccf27215 7401
<> 133:99b5ccf27215 7402 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7403 /* xfract should be in 12.20 format */
<> 133:99b5ccf27215 7404 xfract = (X & 0x000FFFFF);
<> 133:99b5ccf27215 7405
<> 133:99b5ccf27215 7406 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7407 x1 = pYData[(rI) + nCols * (cI)];
<> 133:99b5ccf27215 7408 x2 = pYData[(rI) + nCols * (cI) + 1u];
<> 133:99b5ccf27215 7409
<> 133:99b5ccf27215 7410
<> 133:99b5ccf27215 7411 /* 20 bits for the fractional part */
<> 133:99b5ccf27215 7412 /* yfract should be in 12.20 format */
<> 133:99b5ccf27215 7413 yfract = (Y & 0x000FFFFF);
<> 133:99b5ccf27215 7414
<> 133:99b5ccf27215 7415 /* Read two nearest output values from the index */
<> 133:99b5ccf27215 7416 y1 = pYData[(rI) + nCols * (cI + 1)];
<> 133:99b5ccf27215 7417 y2 = pYData[(rI) + nCols * (cI + 1) + 1u];
<> 133:99b5ccf27215 7418
<> 133:99b5ccf27215 7419 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
<> 133:99b5ccf27215 7420 out = ((x1 * (0xFFFFF - xfract)));
<> 133:99b5ccf27215 7421 acc = (((q63_t) out * (0xFFFFF - yfract)));
<> 133:99b5ccf27215 7422
<> 133:99b5ccf27215 7423 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
<> 133:99b5ccf27215 7424 out = ((x2 * (0xFFFFF - yfract)));
<> 133:99b5ccf27215 7425 acc += (((q63_t) out * (xfract)));
<> 133:99b5ccf27215 7426
<> 133:99b5ccf27215 7427 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
<> 133:99b5ccf27215 7428 out = ((y1 * (0xFFFFF - xfract)));
<> 133:99b5ccf27215 7429 acc += (((q63_t) out * (yfract)));
<> 133:99b5ccf27215 7430
<> 133:99b5ccf27215 7431 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
<> 133:99b5ccf27215 7432 out = ((y2 * (yfract)));
<> 133:99b5ccf27215 7433 acc += (((q63_t) out * (xfract)));
<> 133:99b5ccf27215 7434
<> 133:99b5ccf27215 7435 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
<> 133:99b5ccf27215 7436 return (acc >> 40);
<> 133:99b5ccf27215 7437
<> 133:99b5ccf27215 7438 }
<> 133:99b5ccf27215 7439
<> 133:99b5ccf27215 7440 /**
<> 133:99b5ccf27215 7441 * @} end of BilinearInterpolate group
<> 133:99b5ccf27215 7442 */
<> 133:99b5ccf27215 7443
<> 133:99b5ccf27215 7444
<> 133:99b5ccf27215 7445 //SMMLAR
<> 133:99b5ccf27215 7446 #define multAcc_32x32_keep32_R(a, x, y) \
<> 133:99b5ccf27215 7447 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 133:99b5ccf27215 7448
<> 133:99b5ccf27215 7449 //SMMLSR
<> 133:99b5ccf27215 7450 #define multSub_32x32_keep32_R(a, x, y) \
<> 133:99b5ccf27215 7451 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
<> 133:99b5ccf27215 7452
<> 133:99b5ccf27215 7453 //SMMULR
<> 133:99b5ccf27215 7454 #define mult_32x32_keep32_R(a, x, y) \
<> 133:99b5ccf27215 7455 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
<> 133:99b5ccf27215 7456
<> 133:99b5ccf27215 7457 //SMMLA
<> 133:99b5ccf27215 7458 #define multAcc_32x32_keep32(a, x, y) \
<> 133:99b5ccf27215 7459 a += (q31_t) (((q63_t) x * y) >> 32)
<> 133:99b5ccf27215 7460
<> 133:99b5ccf27215 7461 //SMMLS
<> 133:99b5ccf27215 7462 #define multSub_32x32_keep32(a, x, y) \
<> 133:99b5ccf27215 7463 a -= (q31_t) (((q63_t) x * y) >> 32)
<> 133:99b5ccf27215 7464
<> 133:99b5ccf27215 7465 //SMMUL
<> 133:99b5ccf27215 7466 #define mult_32x32_keep32(a, x, y) \
<> 133:99b5ccf27215 7467 a = (q31_t) (((q63_t) x * y ) >> 32)
<> 133:99b5ccf27215 7468
<> 133:99b5ccf27215 7469
<> 133:99b5ccf27215 7470 #if defined ( __CC_ARM ) //Keil
<> 133:99b5ccf27215 7471
<> 133:99b5ccf27215 7472 //Enter low optimization region - place directly above function definition
<> 133:99b5ccf27215 7473 #ifdef ARM_MATH_CM4
<> 133:99b5ccf27215 7474 #define LOW_OPTIMIZATION_ENTER \
<> 133:99b5ccf27215 7475 _Pragma ("push") \
<> 133:99b5ccf27215 7476 _Pragma ("O1")
<> 133:99b5ccf27215 7477 #else
<> 133:99b5ccf27215 7478 #define LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7479 #endif
<> 133:99b5ccf27215 7480
<> 133:99b5ccf27215 7481 //Exit low optimization region - place directly after end of function definition
<> 133:99b5ccf27215 7482 #ifdef ARM_MATH_CM4
<> 133:99b5ccf27215 7483 #define LOW_OPTIMIZATION_EXIT \
<> 133:99b5ccf27215 7484 _Pragma ("pop")
<> 133:99b5ccf27215 7485 #else
<> 133:99b5ccf27215 7486 #define LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7487 #endif
<> 133:99b5ccf27215 7488
<> 133:99b5ccf27215 7489 //Enter low optimization region - place directly above function definition
<> 133:99b5ccf27215 7490 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7491
<> 133:99b5ccf27215 7492 //Exit low optimization region - place directly after end of function definition
<> 133:99b5ccf27215 7493 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7494
<> 133:99b5ccf27215 7495 #elif defined(__ICCARM__) //IAR
<> 133:99b5ccf27215 7496
<> 133:99b5ccf27215 7497 //Enter low optimization region - place directly above function definition
<> 133:99b5ccf27215 7498 #ifdef ARM_MATH_CM4
<> 133:99b5ccf27215 7499 #define LOW_OPTIMIZATION_ENTER \
<> 133:99b5ccf27215 7500 _Pragma ("optimize=low")
<> 133:99b5ccf27215 7501 #else
<> 133:99b5ccf27215 7502 #define LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7503 #endif
<> 133:99b5ccf27215 7504
<> 133:99b5ccf27215 7505 //Exit low optimization region - place directly after end of function definition
<> 133:99b5ccf27215 7506 #define LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7507
<> 133:99b5ccf27215 7508 //Enter low optimization region - place directly above function definition
<> 133:99b5ccf27215 7509 #ifdef ARM_MATH_CM4
<> 133:99b5ccf27215 7510 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
<> 133:99b5ccf27215 7511 _Pragma ("optimize=low")
<> 133:99b5ccf27215 7512 #else
<> 133:99b5ccf27215 7513 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7514 #endif
<> 133:99b5ccf27215 7515
<> 133:99b5ccf27215 7516 //Exit low optimization region - place directly after end of function definition
<> 133:99b5ccf27215 7517 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7518
<> 133:99b5ccf27215 7519 #elif defined(__GNUC__)
<> 133:99b5ccf27215 7520
<> 133:99b5ccf27215 7521 #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
<> 133:99b5ccf27215 7522
<> 133:99b5ccf27215 7523 #define LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7524
<> 133:99b5ccf27215 7525 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7526
<> 133:99b5ccf27215 7527 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7528
<> 133:99b5ccf27215 7529 #elif defined(__CSMC__) // Cosmic
<> 133:99b5ccf27215 7530
<> 133:99b5ccf27215 7531 #define LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7532 #define LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7533 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7534 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7535
<> 133:99b5ccf27215 7536 #elif defined(__TASKING__) // TASKING
<> 133:99b5ccf27215 7537
<> 133:99b5ccf27215 7538 #define LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7539 #define LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7540 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
<> 133:99b5ccf27215 7541 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
<> 133:99b5ccf27215 7542
<> 133:99b5ccf27215 7543 #endif
<> 133:99b5ccf27215 7544
<> 133:99b5ccf27215 7545
<> 133:99b5ccf27215 7546 #ifdef __cplusplus
<> 133:99b5ccf27215 7547 }
<> 133:99b5ccf27215 7548 #endif
<> 133:99b5ccf27215 7549
<> 133:99b5ccf27215 7550
<> 133:99b5ccf27215 7551 #endif /* _ARM_MATH_H */
<> 133:99b5ccf27215 7552
<> 133:99b5ccf27215 7553 /**
<> 133:99b5ccf27215 7554 *
<> 133:99b5ccf27215 7555 * End of file.
<> 133:99b5ccf27215 7556 */