Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_F746ZG/arm_math.h@115:87f2f5183dfb, 2016-03-02 (annotated)
- Committer:
- Kojto
- Date:
- Wed Mar 02 09:58:28 2016 +0100
- Revision:
- 115:87f2f5183dfb
Release 115 of the mbed library
Changes:
- new targets - NUCLEO_F746ZG
- Bugfix - STM32F7 + STM32L4 - RTC init fix
- Bugfix - STM32L4 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000
- B96B_F446VE - CAN addition
- Changed target name from NZ32SC151 to NZ32_SC151
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 115:87f2f5183dfb | 1 | /* ---------------------------------------------------------------------- |
Kojto | 115:87f2f5183dfb | 2 | * Copyright (C) 2010-2015 ARM Limited. All rights reserved. |
Kojto | 115:87f2f5183dfb | 3 | * |
Kojto | 115:87f2f5183dfb | 4 | * $Date: 19. March 2015 |
Kojto | 115:87f2f5183dfb | 5 | * $Revision: V.1.4.5 |
Kojto | 115:87f2f5183dfb | 6 | * |
Kojto | 115:87f2f5183dfb | 7 | * Project: CMSIS DSP Library |
Kojto | 115:87f2f5183dfb | 8 | * Title: arm_math.h |
Kojto | 115:87f2f5183dfb | 9 | * |
Kojto | 115:87f2f5183dfb | 10 | * Description: Public header file for CMSIS DSP Library |
Kojto | 115:87f2f5183dfb | 11 | * |
Kojto | 115:87f2f5183dfb | 12 | * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 |
Kojto | 115:87f2f5183dfb | 13 | * |
Kojto | 115:87f2f5183dfb | 14 | * Redistribution and use in source and binary forms, with or without |
Kojto | 115:87f2f5183dfb | 15 | * modification, are permitted provided that the following conditions |
Kojto | 115:87f2f5183dfb | 16 | * are met: |
Kojto | 115:87f2f5183dfb | 17 | * - Redistributions of source code must retain the above copyright |
Kojto | 115:87f2f5183dfb | 18 | * notice, this list of conditions and the following disclaimer. |
Kojto | 115:87f2f5183dfb | 19 | * - Redistributions in binary form must reproduce the above copyright |
Kojto | 115:87f2f5183dfb | 20 | * notice, this list of conditions and the following disclaimer in |
Kojto | 115:87f2f5183dfb | 21 | * the documentation and/or other materials provided with the |
Kojto | 115:87f2f5183dfb | 22 | * distribution. |
Kojto | 115:87f2f5183dfb | 23 | * - Neither the name of ARM LIMITED nor the names of its contributors |
Kojto | 115:87f2f5183dfb | 24 | * may be used to endorse or promote products derived from this |
Kojto | 115:87f2f5183dfb | 25 | * software without specific prior written permission. |
Kojto | 115:87f2f5183dfb | 26 | * |
Kojto | 115:87f2f5183dfb | 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
Kojto | 115:87f2f5183dfb | 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
Kojto | 115:87f2f5183dfb | 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
Kojto | 115:87f2f5183dfb | 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
Kojto | 115:87f2f5183dfb | 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
Kojto | 115:87f2f5183dfb | 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
Kojto | 115:87f2f5183dfb | 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Kojto | 115:87f2f5183dfb | 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 115:87f2f5183dfb | 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
Kojto | 115:87f2f5183dfb | 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
Kojto | 115:87f2f5183dfb | 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
Kojto | 115:87f2f5183dfb | 38 | * POSSIBILITY OF SUCH DAMAGE. |
Kojto | 115:87f2f5183dfb | 39 | * -------------------------------------------------------------------- */ |
Kojto | 115:87f2f5183dfb | 40 | |
Kojto | 115:87f2f5183dfb | 41 | /** |
Kojto | 115:87f2f5183dfb | 42 | \mainpage CMSIS DSP Software Library |
Kojto | 115:87f2f5183dfb | 43 | * |
Kojto | 115:87f2f5183dfb | 44 | * Introduction |
Kojto | 115:87f2f5183dfb | 45 | * ------------ |
Kojto | 115:87f2f5183dfb | 46 | * |
Kojto | 115:87f2f5183dfb | 47 | * This user manual describes the CMSIS DSP software library, |
Kojto | 115:87f2f5183dfb | 48 | * a suite of common signal processing functions for use on Cortex-M processor based devices. |
Kojto | 115:87f2f5183dfb | 49 | * |
Kojto | 115:87f2f5183dfb | 50 | * The library is divided into a number of functions each covering a specific category: |
Kojto | 115:87f2f5183dfb | 51 | * - Basic math functions |
Kojto | 115:87f2f5183dfb | 52 | * - Fast math functions |
Kojto | 115:87f2f5183dfb | 53 | * - Complex math functions |
Kojto | 115:87f2f5183dfb | 54 | * - Filters |
Kojto | 115:87f2f5183dfb | 55 | * - Matrix functions |
Kojto | 115:87f2f5183dfb | 56 | * - Transforms |
Kojto | 115:87f2f5183dfb | 57 | * - Motor control functions |
Kojto | 115:87f2f5183dfb | 58 | * - Statistical functions |
Kojto | 115:87f2f5183dfb | 59 | * - Support functions |
Kojto | 115:87f2f5183dfb | 60 | * - Interpolation functions |
Kojto | 115:87f2f5183dfb | 61 | * |
Kojto | 115:87f2f5183dfb | 62 | * The library has separate functions for operating on 8-bit integers, 16-bit integers, |
Kojto | 115:87f2f5183dfb | 63 | * 32-bit integer and 32-bit floating-point values. |
Kojto | 115:87f2f5183dfb | 64 | * |
Kojto | 115:87f2f5183dfb | 65 | * Using the Library |
Kojto | 115:87f2f5183dfb | 66 | * ------------ |
Kojto | 115:87f2f5183dfb | 67 | * |
Kojto | 115:87f2f5183dfb | 68 | * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder. |
Kojto | 115:87f2f5183dfb | 69 | * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 70 | * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 71 | * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 72 | * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 73 | * - arm_cortexM7l_math.lib (Little endian on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 74 | * - arm_cortexM7b_math.lib (Big endian on Cortex-M7) |
Kojto | 115:87f2f5183dfb | 75 | * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) |
Kojto | 115:87f2f5183dfb | 76 | * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) |
Kojto | 115:87f2f5183dfb | 77 | * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) |
Kojto | 115:87f2f5183dfb | 78 | * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) |
Kojto | 115:87f2f5183dfb | 79 | * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) |
Kojto | 115:87f2f5183dfb | 80 | * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) |
Kojto | 115:87f2f5183dfb | 81 | * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+) |
Kojto | 115:87f2f5183dfb | 82 | * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+) |
Kojto | 115:87f2f5183dfb | 83 | * |
Kojto | 115:87f2f5183dfb | 84 | * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder. |
Kojto | 115:87f2f5183dfb | 85 | * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 87 | * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or |
Kojto | 115:87f2f5183dfb | 88 | * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. |
Kojto | 115:87f2f5183dfb | 89 | * |
Kojto | 115:87f2f5183dfb | 90 | * Examples |
Kojto | 115:87f2f5183dfb | 91 | * -------- |
Kojto | 115:87f2f5183dfb | 92 | * |
Kojto | 115:87f2f5183dfb | 93 | * The library ships with a number of examples which demonstrate how to use the library functions. |
Kojto | 115:87f2f5183dfb | 94 | * |
Kojto | 115:87f2f5183dfb | 95 | * Toolchain Support |
Kojto | 115:87f2f5183dfb | 96 | * ------------ |
Kojto | 115:87f2f5183dfb | 97 | * |
Kojto | 115:87f2f5183dfb | 98 | * The library has been developed and tested with MDK-ARM version 5.14.0.0 |
Kojto | 115:87f2f5183dfb | 99 | * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. |
Kojto | 115:87f2f5183dfb | 100 | * |
Kojto | 115:87f2f5183dfb | 101 | * Building the Library |
Kojto | 115:87f2f5183dfb | 102 | * ------------ |
Kojto | 115:87f2f5183dfb | 103 | * |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 105 | * - arm_cortexM_math.uvprojx |
Kojto | 115:87f2f5183dfb | 106 | * |
Kojto | 115:87f2f5183dfb | 107 | * |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 109 | * |
Kojto | 115:87f2f5183dfb | 110 | * Pre-processor Macros |
Kojto | 115:87f2f5183dfb | 111 | * ------------ |
Kojto | 115:87f2f5183dfb | 112 | * |
Kojto | 115:87f2f5183dfb | 113 | * Each library project have differant pre-processor macros. |
Kojto | 115:87f2f5183dfb | 114 | * |
Kojto | 115:87f2f5183dfb | 115 | * - UNALIGNED_SUPPORT_DISABLE: |
Kojto | 115:87f2f5183dfb | 116 | * |
Kojto | 115:87f2f5183dfb | 117 | * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access |
Kojto | 115:87f2f5183dfb | 118 | * |
Kojto | 115:87f2f5183dfb | 119 | * - ARM_MATH_BIG_ENDIAN: |
Kojto | 115:87f2f5183dfb | 120 | * |
Kojto | 115:87f2f5183dfb | 121 | * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. |
Kojto | 115:87f2f5183dfb | 122 | * |
Kojto | 115:87f2f5183dfb | 123 | * - ARM_MATH_MATRIX_CHECK: |
Kojto | 115:87f2f5183dfb | 124 | * |
Kojto | 115:87f2f5183dfb | 125 | * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices |
Kojto | 115:87f2f5183dfb | 126 | * |
Kojto | 115:87f2f5183dfb | 127 | * - ARM_MATH_ROUNDING: |
Kojto | 115:87f2f5183dfb | 128 | * |
Kojto | 115:87f2f5183dfb | 129 | * Define macro ARM_MATH_ROUNDING for rounding on support functions |
Kojto | 115:87f2f5183dfb | 130 | * |
Kojto | 115:87f2f5183dfb | 131 | * - ARM_MATH_CMx: |
Kojto | 115:87f2f5183dfb | 132 | * |
Kojto | 115:87f2f5183dfb | 133 | * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target |
Kojto | 115:87f2f5183dfb | 134 | * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and |
Kojto | 115:87f2f5183dfb | 135 | * ARM_MATH_CM7 for building the library on cortex-M7. |
Kojto | 115:87f2f5183dfb | 136 | * |
Kojto | 115:87f2f5183dfb | 137 | * - __FPU_PRESENT: |
Kojto | 115:87f2f5183dfb | 138 | * |
Kojto | 115:87f2f5183dfb | 139 | * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries |
Kojto | 115:87f2f5183dfb | 140 | * |
Kojto | 115:87f2f5183dfb | 141 | * <hr> |
Kojto | 115:87f2f5183dfb | 142 | * CMSIS-DSP in ARM::CMSIS Pack |
Kojto | 115:87f2f5183dfb | 143 | * ----------------------------- |
Kojto | 115:87f2f5183dfb | 144 | * |
Kojto | 115:87f2f5183dfb | 145 | * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories: |
Kojto | 115:87f2f5183dfb | 146 | * |File/Folder |Content | |
Kojto | 115:87f2f5183dfb | 147 | * |------------------------------|------------------------------------------------------------------------| |
Kojto | 115:87f2f5183dfb | 148 | * |\b CMSIS\\Documentation\\DSP | This documentation | |
Kojto | 115:87f2f5183dfb | 149 | * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | |
Kojto | 115:87f2f5183dfb | 150 | * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | |
Kojto | 115:87f2f5183dfb | 151 | * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | |
Kojto | 115:87f2f5183dfb | 152 | * |
Kojto | 115:87f2f5183dfb | 153 | * <hr> |
Kojto | 115:87f2f5183dfb | 154 | * Revision History of CMSIS-DSP |
Kojto | 115:87f2f5183dfb | 155 | * ------------ |
Kojto | 115:87f2f5183dfb | 156 | * Please refer to \ref ChangeLog_pg. |
Kojto | 115:87f2f5183dfb | 157 | * |
Kojto | 115:87f2f5183dfb | 158 | * Copyright Notice |
Kojto | 115:87f2f5183dfb | 159 | * ------------ |
Kojto | 115:87f2f5183dfb | 160 | * |
Kojto | 115:87f2f5183dfb | 161 | * Copyright (C) 2010-2015 ARM Limited. All rights reserved. |
Kojto | 115:87f2f5183dfb | 162 | */ |
Kojto | 115:87f2f5183dfb | 163 | |
Kojto | 115:87f2f5183dfb | 164 | |
Kojto | 115:87f2f5183dfb | 165 | /** |
Kojto | 115:87f2f5183dfb | 166 | * @defgroup groupMath Basic Math Functions |
Kojto | 115:87f2f5183dfb | 167 | */ |
Kojto | 115:87f2f5183dfb | 168 | |
Kojto | 115:87f2f5183dfb | 169 | /** |
Kojto | 115:87f2f5183dfb | 170 | * @defgroup groupFastMath Fast Math Functions |
Kojto | 115:87f2f5183dfb | 171 | * This set of functions provides a fast approximation to sine, cosine, and square root. |
Kojto | 115:87f2f5183dfb | 172 | * As compared to most of the other functions in the CMSIS math library, the fast math functions |
Kojto | 115:87f2f5183dfb | 173 | * operate on individual values and not arrays. |
Kojto | 115:87f2f5183dfb | 174 | * There are separate functions for Q15, Q31, and floating-point data. |
Kojto | 115:87f2f5183dfb | 175 | * |
Kojto | 115:87f2f5183dfb | 176 | */ |
Kojto | 115:87f2f5183dfb | 177 | |
Kojto | 115:87f2f5183dfb | 178 | /** |
Kojto | 115:87f2f5183dfb | 179 | * @defgroup groupCmplxMath Complex Math Functions |
Kojto | 115:87f2f5183dfb | 180 | * This set of functions operates on complex data vectors. |
Kojto | 115:87f2f5183dfb | 181 | * The data in the complex arrays is stored in an interleaved fashion |
Kojto | 115:87f2f5183dfb | 182 | * (real, imag, real, imag, ...). |
Kojto | 115:87f2f5183dfb | 183 | * In the API functions, the number of samples in a complex array refers |
Kojto | 115:87f2f5183dfb | 184 | * to the number of complex values; the array contains twice this number of |
Kojto | 115:87f2f5183dfb | 185 | * real values. |
Kojto | 115:87f2f5183dfb | 186 | */ |
Kojto | 115:87f2f5183dfb | 187 | |
Kojto | 115:87f2f5183dfb | 188 | /** |
Kojto | 115:87f2f5183dfb | 189 | * @defgroup groupFilters Filtering Functions |
Kojto | 115:87f2f5183dfb | 190 | */ |
Kojto | 115:87f2f5183dfb | 191 | |
Kojto | 115:87f2f5183dfb | 192 | /** |
Kojto | 115:87f2f5183dfb | 193 | * @defgroup groupMatrix Matrix Functions |
Kojto | 115:87f2f5183dfb | 194 | * |
Kojto | 115:87f2f5183dfb | 195 | * This set of functions provides basic matrix math operations. |
Kojto | 115:87f2f5183dfb | 196 | * The functions operate on matrix data structures. For example, |
Kojto | 115:87f2f5183dfb | 197 | * the type |
Kojto | 115:87f2f5183dfb | 198 | * definition for the floating-point matrix structure is shown |
Kojto | 115:87f2f5183dfb | 199 | * below: |
Kojto | 115:87f2f5183dfb | 200 | * <pre> |
Kojto | 115:87f2f5183dfb | 201 | * typedef struct |
Kojto | 115:87f2f5183dfb | 202 | * { |
Kojto | 115:87f2f5183dfb | 203 | * uint16_t numRows; // number of rows of the matrix. |
Kojto | 115:87f2f5183dfb | 204 | * uint16_t numCols; // number of columns of the matrix. |
Kojto | 115:87f2f5183dfb | 205 | * float32_t *pData; // points to the data of the matrix. |
Kojto | 115:87f2f5183dfb | 206 | * } arm_matrix_instance_f32; |
Kojto | 115:87f2f5183dfb | 207 | * </pre> |
Kojto | 115:87f2f5183dfb | 208 | * There are similar definitions for Q15 and Q31 data types. |
Kojto | 115:87f2f5183dfb | 209 | * |
Kojto | 115:87f2f5183dfb | 210 | * The structure specifies the size of the matrix and then points to |
Kojto | 115:87f2f5183dfb | 211 | * an array of data. The array is of size <code>numRows X numCols</code> |
Kojto | 115:87f2f5183dfb | 212 | * and the values are arranged in row order. That is, the |
Kojto | 115:87f2f5183dfb | 213 | * matrix element (i, j) is stored at: |
Kojto | 115:87f2f5183dfb | 214 | * <pre> |
Kojto | 115:87f2f5183dfb | 215 | * pData[i*numCols + j] |
Kojto | 115:87f2f5183dfb | 216 | * </pre> |
Kojto | 115:87f2f5183dfb | 217 | * |
Kojto | 115:87f2f5183dfb | 218 | * \par Init Functions |
Kojto | 115:87f2f5183dfb | 219 | * There is an associated initialization function for each type of matrix |
Kojto | 115:87f2f5183dfb | 220 | * data structure. |
Kojto | 115:87f2f5183dfb | 221 | * The initialization function sets the values of the internal structure fields. |
Kojto | 115:87f2f5183dfb | 222 | * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code> |
Kojto | 115:87f2f5183dfb | 223 | * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively. |
Kojto | 115:87f2f5183dfb | 224 | * |
Kojto | 115:87f2f5183dfb | 225 | * \par |
Kojto | 115:87f2f5183dfb | 226 | * Use of the initialization function is optional. However, if initialization function is used |
Kojto | 115:87f2f5183dfb | 227 | * then the instance structure cannot be placed into a const data section. |
Kojto | 115:87f2f5183dfb | 228 | * To place the instance structure in a const data |
Kojto | 115:87f2f5183dfb | 229 | * section, manually initialize the data structure. For example: |
Kojto | 115:87f2f5183dfb | 230 | * <pre> |
Kojto | 115:87f2f5183dfb | 231 | * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code> |
Kojto | 115:87f2f5183dfb | 232 | * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code> |
Kojto | 115:87f2f5183dfb | 233 | * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code> |
Kojto | 115:87f2f5183dfb | 234 | * </pre> |
Kojto | 115:87f2f5183dfb | 235 | * where <code>nRows</code> specifies the number of rows, <code>nColumns</code> |
Kojto | 115:87f2f5183dfb | 236 | * specifies the number of columns, and <code>pData</code> points to the |
Kojto | 115:87f2f5183dfb | 237 | * data array. |
Kojto | 115:87f2f5183dfb | 238 | * |
Kojto | 115:87f2f5183dfb | 239 | * \par Size Checking |
Kojto | 115:87f2f5183dfb | 240 | * By default all of the matrix functions perform size checking on the input and |
Kojto | 115:87f2f5183dfb | 241 | * output matrices. For example, the matrix addition function verifies that the |
Kojto | 115:87f2f5183dfb | 242 | * two input matrices and the output matrix all have the same number of rows and |
Kojto | 115:87f2f5183dfb | 243 | * columns. If the size check fails the functions return: |
Kojto | 115:87f2f5183dfb | 244 | * <pre> |
Kojto | 115:87f2f5183dfb | 245 | * ARM_MATH_SIZE_MISMATCH |
Kojto | 115:87f2f5183dfb | 246 | * </pre> |
Kojto | 115:87f2f5183dfb | 247 | * Otherwise the functions return |
Kojto | 115:87f2f5183dfb | 248 | * <pre> |
Kojto | 115:87f2f5183dfb | 249 | * ARM_MATH_SUCCESS |
Kojto | 115:87f2f5183dfb | 250 | * </pre> |
Kojto | 115:87f2f5183dfb | 251 | * There is some overhead associated with this matrix size checking. |
Kojto | 115:87f2f5183dfb | 252 | * The matrix size checking is enabled via the \#define |
Kojto | 115:87f2f5183dfb | 253 | * <pre> |
Kojto | 115:87f2f5183dfb | 254 | * ARM_MATH_MATRIX_CHECK |
Kojto | 115:87f2f5183dfb | 255 | * </pre> |
Kojto | 115:87f2f5183dfb | 256 | * within the library project settings. By default this macro is defined |
Kojto | 115:87f2f5183dfb | 257 | * and size checking is enabled. By changing the project settings and |
Kojto | 115:87f2f5183dfb | 258 | * undefining this macro size checking is eliminated and the functions |
Kojto | 115:87f2f5183dfb | 259 | * run a bit faster. With size checking disabled the functions always |
Kojto | 115:87f2f5183dfb | 260 | * return <code>ARM_MATH_SUCCESS</code>. |
Kojto | 115:87f2f5183dfb | 261 | */ |
Kojto | 115:87f2f5183dfb | 262 | |
Kojto | 115:87f2f5183dfb | 263 | /** |
Kojto | 115:87f2f5183dfb | 264 | * @defgroup groupTransforms Transform Functions |
Kojto | 115:87f2f5183dfb | 265 | */ |
Kojto | 115:87f2f5183dfb | 266 | |
Kojto | 115:87f2f5183dfb | 267 | /** |
Kojto | 115:87f2f5183dfb | 268 | * @defgroup groupController Controller Functions |
Kojto | 115:87f2f5183dfb | 269 | */ |
Kojto | 115:87f2f5183dfb | 270 | |
Kojto | 115:87f2f5183dfb | 271 | /** |
Kojto | 115:87f2f5183dfb | 272 | * @defgroup groupStats Statistics Functions |
Kojto | 115:87f2f5183dfb | 273 | */ |
Kojto | 115:87f2f5183dfb | 274 | /** |
Kojto | 115:87f2f5183dfb | 275 | * @defgroup groupSupport Support Functions |
Kojto | 115:87f2f5183dfb | 276 | */ |
Kojto | 115:87f2f5183dfb | 277 | |
Kojto | 115:87f2f5183dfb | 278 | /** |
Kojto | 115:87f2f5183dfb | 279 | * @defgroup groupInterpolation Interpolation Functions |
Kojto | 115:87f2f5183dfb | 280 | * These functions perform 1- and 2-dimensional interpolation of data. |
Kojto | 115:87f2f5183dfb | 281 | * Linear interpolation is used for 1-dimensional data and |
Kojto | 115:87f2f5183dfb | 282 | * bilinear interpolation is used for 2-dimensional data. |
Kojto | 115:87f2f5183dfb | 283 | */ |
Kojto | 115:87f2f5183dfb | 284 | |
Kojto | 115:87f2f5183dfb | 285 | /** |
Kojto | 115:87f2f5183dfb | 286 | * @defgroup groupExamples Examples |
Kojto | 115:87f2f5183dfb | 287 | */ |
Kojto | 115:87f2f5183dfb | 288 | #ifndef _ARM_MATH_H |
Kojto | 115:87f2f5183dfb | 289 | #define _ARM_MATH_H |
Kojto | 115:87f2f5183dfb | 290 | |
Kojto | 115:87f2f5183dfb | 291 | #define __CMSIS_GENERIC /* disable NVIC and Systick functions */ |
Kojto | 115:87f2f5183dfb | 292 | |
Kojto | 115:87f2f5183dfb | 293 | #if defined(ARM_MATH_CM7) |
Kojto | 115:87f2f5183dfb | 294 | #include "core_cm7.h" |
Kojto | 115:87f2f5183dfb | 295 | #elif defined (ARM_MATH_CM4) |
Kojto | 115:87f2f5183dfb | 296 | #include "core_cm4.h" |
Kojto | 115:87f2f5183dfb | 297 | #elif defined (ARM_MATH_CM3) |
Kojto | 115:87f2f5183dfb | 298 | #include "core_cm3.h" |
Kojto | 115:87f2f5183dfb | 299 | #elif defined (ARM_MATH_CM0) |
Kojto | 115:87f2f5183dfb | 300 | #include "core_cm0.h" |
Kojto | 115:87f2f5183dfb | 301 | #define ARM_MATH_CM0_FAMILY |
Kojto | 115:87f2f5183dfb | 302 | #elif defined (ARM_MATH_CM0PLUS) |
Kojto | 115:87f2f5183dfb | 303 | #include "core_cm0plus.h" |
Kojto | 115:87f2f5183dfb | 304 | #define ARM_MATH_CM0_FAMILY |
Kojto | 115:87f2f5183dfb | 305 | #else |
Kojto | 115:87f2f5183dfb | 306 | #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" |
Kojto | 115:87f2f5183dfb | 307 | #endif |
Kojto | 115:87f2f5183dfb | 308 | |
Kojto | 115:87f2f5183dfb | 309 | #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ |
Kojto | 115:87f2f5183dfb | 310 | #include "string.h" |
Kojto | 115:87f2f5183dfb | 311 | #include "math.h" |
Kojto | 115:87f2f5183dfb | 312 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 313 | extern "C" |
Kojto | 115:87f2f5183dfb | 314 | { |
Kojto | 115:87f2f5183dfb | 315 | #endif |
Kojto | 115:87f2f5183dfb | 316 | |
Kojto | 115:87f2f5183dfb | 317 | |
Kojto | 115:87f2f5183dfb | 318 | /** |
Kojto | 115:87f2f5183dfb | 319 | * @brief Macros required for reciprocal calculation in Normalized LMS |
Kojto | 115:87f2f5183dfb | 320 | */ |
Kojto | 115:87f2f5183dfb | 321 | |
Kojto | 115:87f2f5183dfb | 322 | #define DELTA_Q31 (0x100) |
Kojto | 115:87f2f5183dfb | 323 | #define DELTA_Q15 0x5 |
Kojto | 115:87f2f5183dfb | 324 | #define INDEX_MASK 0x0000003F |
Kojto | 115:87f2f5183dfb | 325 | #ifndef PI |
Kojto | 115:87f2f5183dfb | 326 | #define PI 3.14159265358979f |
Kojto | 115:87f2f5183dfb | 327 | #endif |
Kojto | 115:87f2f5183dfb | 328 | |
Kojto | 115:87f2f5183dfb | 329 | /** |
Kojto | 115:87f2f5183dfb | 330 | * @brief Macros required for SINE and COSINE Fast math approximations |
Kojto | 115:87f2f5183dfb | 331 | */ |
Kojto | 115:87f2f5183dfb | 332 | |
Kojto | 115:87f2f5183dfb | 333 | #define FAST_MATH_TABLE_SIZE 512 |
Kojto | 115:87f2f5183dfb | 334 | #define FAST_MATH_Q31_SHIFT (32 - 10) |
Kojto | 115:87f2f5183dfb | 335 | #define FAST_MATH_Q15_SHIFT (16 - 10) |
Kojto | 115:87f2f5183dfb | 336 | #define CONTROLLER_Q31_SHIFT (32 - 9) |
Kojto | 115:87f2f5183dfb | 337 | #define TABLE_SIZE 256 |
Kojto | 115:87f2f5183dfb | 338 | #define TABLE_SPACING_Q31 0x400000 |
Kojto | 115:87f2f5183dfb | 339 | #define TABLE_SPACING_Q15 0x80 |
Kojto | 115:87f2f5183dfb | 340 | |
Kojto | 115:87f2f5183dfb | 341 | /** |
Kojto | 115:87f2f5183dfb | 342 | * @brief Macros required for SINE and COSINE Controller functions |
Kojto | 115:87f2f5183dfb | 343 | */ |
Kojto | 115:87f2f5183dfb | 344 | /* 1.31(q31) Fixed value of 2/360 */ |
Kojto | 115:87f2f5183dfb | 345 | /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ |
Kojto | 115:87f2f5183dfb | 346 | #define INPUT_SPACING 0xB60B61 |
Kojto | 115:87f2f5183dfb | 347 | |
Kojto | 115:87f2f5183dfb | 348 | /** |
Kojto | 115:87f2f5183dfb | 349 | * @brief Macro for Unaligned Support |
Kojto | 115:87f2f5183dfb | 350 | */ |
Kojto | 115:87f2f5183dfb | 351 | #ifndef UNALIGNED_SUPPORT_DISABLE |
Kojto | 115:87f2f5183dfb | 352 | #define ALIGN4 |
Kojto | 115:87f2f5183dfb | 353 | #else |
Kojto | 115:87f2f5183dfb | 354 | #if defined (__GNUC__) |
Kojto | 115:87f2f5183dfb | 355 | #define ALIGN4 __attribute__((aligned(4))) |
Kojto | 115:87f2f5183dfb | 356 | #else |
Kojto | 115:87f2f5183dfb | 357 | #define ALIGN4 __align(4) |
Kojto | 115:87f2f5183dfb | 358 | #endif |
Kojto | 115:87f2f5183dfb | 359 | #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ |
Kojto | 115:87f2f5183dfb | 360 | |
Kojto | 115:87f2f5183dfb | 361 | /** |
Kojto | 115:87f2f5183dfb | 362 | * @brief Error status returned by some functions in the library. |
Kojto | 115:87f2f5183dfb | 363 | */ |
Kojto | 115:87f2f5183dfb | 364 | |
Kojto | 115:87f2f5183dfb | 365 | typedef enum |
Kojto | 115:87f2f5183dfb | 366 | { |
Kojto | 115:87f2f5183dfb | 367 | ARM_MATH_SUCCESS = 0, /**< No error */ |
Kojto | 115:87f2f5183dfb | 368 | ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ |
Kojto | 115:87f2f5183dfb | 369 | ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ |
Kojto | 115:87f2f5183dfb | 370 | ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ |
Kojto | 115:87f2f5183dfb | 371 | ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ |
Kojto | 115:87f2f5183dfb | 372 | ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ |
Kojto | 115:87f2f5183dfb | 373 | ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ |
Kojto | 115:87f2f5183dfb | 374 | } arm_status; |
Kojto | 115:87f2f5183dfb | 375 | |
Kojto | 115:87f2f5183dfb | 376 | /** |
Kojto | 115:87f2f5183dfb | 377 | * @brief 8-bit fractional data type in 1.7 format. |
Kojto | 115:87f2f5183dfb | 378 | */ |
Kojto | 115:87f2f5183dfb | 379 | typedef int8_t q7_t; |
Kojto | 115:87f2f5183dfb | 380 | |
Kojto | 115:87f2f5183dfb | 381 | /** |
Kojto | 115:87f2f5183dfb | 382 | * @brief 16-bit fractional data type in 1.15 format. |
Kojto | 115:87f2f5183dfb | 383 | */ |
Kojto | 115:87f2f5183dfb | 384 | typedef int16_t q15_t; |
Kojto | 115:87f2f5183dfb | 385 | |
Kojto | 115:87f2f5183dfb | 386 | /** |
Kojto | 115:87f2f5183dfb | 387 | * @brief 32-bit fractional data type in 1.31 format. |
Kojto | 115:87f2f5183dfb | 388 | */ |
Kojto | 115:87f2f5183dfb | 389 | typedef int32_t q31_t; |
Kojto | 115:87f2f5183dfb | 390 | |
Kojto | 115:87f2f5183dfb | 391 | /** |
Kojto | 115:87f2f5183dfb | 392 | * @brief 64-bit fractional data type in 1.63 format. |
Kojto | 115:87f2f5183dfb | 393 | */ |
Kojto | 115:87f2f5183dfb | 394 | typedef int64_t q63_t; |
Kojto | 115:87f2f5183dfb | 395 | |
Kojto | 115:87f2f5183dfb | 396 | /** |
Kojto | 115:87f2f5183dfb | 397 | * @brief 32-bit floating-point type definition. |
Kojto | 115:87f2f5183dfb | 398 | */ |
Kojto | 115:87f2f5183dfb | 399 | typedef float float32_t; |
Kojto | 115:87f2f5183dfb | 400 | |
Kojto | 115:87f2f5183dfb | 401 | /** |
Kojto | 115:87f2f5183dfb | 402 | * @brief 64-bit floating-point type definition. |
Kojto | 115:87f2f5183dfb | 403 | */ |
Kojto | 115:87f2f5183dfb | 404 | typedef double float64_t; |
Kojto | 115:87f2f5183dfb | 405 | |
Kojto | 115:87f2f5183dfb | 406 | /** |
Kojto | 115:87f2f5183dfb | 407 | * @brief definition to read/write two 16 bit values. |
Kojto | 115:87f2f5183dfb | 408 | */ |
Kojto | 115:87f2f5183dfb | 409 | #if defined __CC_ARM |
Kojto | 115:87f2f5183dfb | 410 | #define __SIMD32_TYPE int32_t __packed |
Kojto | 115:87f2f5183dfb | 411 | #define CMSIS_UNUSED __attribute__((unused)) |
Kojto | 115:87f2f5183dfb | 412 | #elif defined __ICCARM__ |
Kojto | 115:87f2f5183dfb | 413 | #define __SIMD32_TYPE int32_t __packed |
Kojto | 115:87f2f5183dfb | 414 | #define CMSIS_UNUSED |
Kojto | 115:87f2f5183dfb | 415 | #elif defined __GNUC__ |
Kojto | 115:87f2f5183dfb | 416 | #define __SIMD32_TYPE int32_t |
Kojto | 115:87f2f5183dfb | 417 | #define CMSIS_UNUSED __attribute__((unused)) |
Kojto | 115:87f2f5183dfb | 418 | #elif defined __CSMC__ /* Cosmic */ |
Kojto | 115:87f2f5183dfb | 419 | #define __SIMD32_TYPE int32_t |
Kojto | 115:87f2f5183dfb | 420 | #define CMSIS_UNUSED |
Kojto | 115:87f2f5183dfb | 421 | #elif defined __TASKING__ |
Kojto | 115:87f2f5183dfb | 422 | #define __SIMD32_TYPE __unaligned int32_t |
Kojto | 115:87f2f5183dfb | 423 | #define CMSIS_UNUSED |
Kojto | 115:87f2f5183dfb | 424 | #else |
Kojto | 115:87f2f5183dfb | 425 | #error Unknown compiler |
Kojto | 115:87f2f5183dfb | 426 | #endif |
Kojto | 115:87f2f5183dfb | 427 | |
Kojto | 115:87f2f5183dfb | 428 | #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) |
Kojto | 115:87f2f5183dfb | 429 | #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) |
Kojto | 115:87f2f5183dfb | 430 | |
Kojto | 115:87f2f5183dfb | 431 | #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) |
Kojto | 115:87f2f5183dfb | 432 | |
Kojto | 115:87f2f5183dfb | 433 | #define __SIMD64(addr) (*(int64_t **) & (addr)) |
Kojto | 115:87f2f5183dfb | 434 | |
Kojto | 115:87f2f5183dfb | 435 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
Kojto | 115:87f2f5183dfb | 436 | /** |
Kojto | 115:87f2f5183dfb | 437 | * @brief definition to pack two 16 bit values. |
Kojto | 115:87f2f5183dfb | 438 | */ |
Kojto | 115:87f2f5183dfb | 439 | #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ |
Kojto | 115:87f2f5183dfb | 440 | (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) |
Kojto | 115:87f2f5183dfb | 441 | #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ |
Kojto | 115:87f2f5183dfb | 442 | (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) |
Kojto | 115:87f2f5183dfb | 443 | |
Kojto | 115:87f2f5183dfb | 444 | #endif |
Kojto | 115:87f2f5183dfb | 445 | |
Kojto | 115:87f2f5183dfb | 446 | |
Kojto | 115:87f2f5183dfb | 447 | /** |
Kojto | 115:87f2f5183dfb | 448 | * @brief definition to pack four 8 bit values. |
Kojto | 115:87f2f5183dfb | 449 | */ |
Kojto | 115:87f2f5183dfb | 450 | #ifndef ARM_MATH_BIG_ENDIAN |
Kojto | 115:87f2f5183dfb | 451 | |
Kojto | 115:87f2f5183dfb | 452 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ |
Kojto | 115:87f2f5183dfb | 453 | (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ |
Kojto | 115:87f2f5183dfb | 454 | (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ |
Kojto | 115:87f2f5183dfb | 455 | (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) |
Kojto | 115:87f2f5183dfb | 456 | #else |
Kojto | 115:87f2f5183dfb | 457 | |
Kojto | 115:87f2f5183dfb | 458 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ |
Kojto | 115:87f2f5183dfb | 459 | (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ |
Kojto | 115:87f2f5183dfb | 460 | (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ |
Kojto | 115:87f2f5183dfb | 461 | (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) |
Kojto | 115:87f2f5183dfb | 462 | |
Kojto | 115:87f2f5183dfb | 463 | #endif |
Kojto | 115:87f2f5183dfb | 464 | |
Kojto | 115:87f2f5183dfb | 465 | |
Kojto | 115:87f2f5183dfb | 466 | /** |
Kojto | 115:87f2f5183dfb | 467 | * @brief Clips Q63 to Q31 values. |
Kojto | 115:87f2f5183dfb | 468 | */ |
Kojto | 115:87f2f5183dfb | 469 | static __INLINE q31_t clip_q63_to_q31( |
Kojto | 115:87f2f5183dfb | 470 | q63_t x) |
Kojto | 115:87f2f5183dfb | 471 | { |
Kojto | 115:87f2f5183dfb | 472 | return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? |
Kojto | 115:87f2f5183dfb | 473 | ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; |
Kojto | 115:87f2f5183dfb | 474 | } |
Kojto | 115:87f2f5183dfb | 475 | |
Kojto | 115:87f2f5183dfb | 476 | /** |
Kojto | 115:87f2f5183dfb | 477 | * @brief Clips Q63 to Q15 values. |
Kojto | 115:87f2f5183dfb | 478 | */ |
Kojto | 115:87f2f5183dfb | 479 | static __INLINE q15_t clip_q63_to_q15( |
Kojto | 115:87f2f5183dfb | 480 | q63_t x) |
Kojto | 115:87f2f5183dfb | 481 | { |
Kojto | 115:87f2f5183dfb | 482 | return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? |
Kojto | 115:87f2f5183dfb | 483 | ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); |
Kojto | 115:87f2f5183dfb | 484 | } |
Kojto | 115:87f2f5183dfb | 485 | |
Kojto | 115:87f2f5183dfb | 486 | /** |
Kojto | 115:87f2f5183dfb | 487 | * @brief Clips Q31 to Q7 values. |
Kojto | 115:87f2f5183dfb | 488 | */ |
Kojto | 115:87f2f5183dfb | 489 | static __INLINE q7_t clip_q31_to_q7( |
Kojto | 115:87f2f5183dfb | 490 | q31_t x) |
Kojto | 115:87f2f5183dfb | 491 | { |
Kojto | 115:87f2f5183dfb | 492 | return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? |
Kojto | 115:87f2f5183dfb | 493 | ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; |
Kojto | 115:87f2f5183dfb | 494 | } |
Kojto | 115:87f2f5183dfb | 495 | |
Kojto | 115:87f2f5183dfb | 496 | /** |
Kojto | 115:87f2f5183dfb | 497 | * @brief Clips Q31 to Q15 values. |
Kojto | 115:87f2f5183dfb | 498 | */ |
Kojto | 115:87f2f5183dfb | 499 | static __INLINE q15_t clip_q31_to_q15( |
Kojto | 115:87f2f5183dfb | 500 | q31_t x) |
Kojto | 115:87f2f5183dfb | 501 | { |
Kojto | 115:87f2f5183dfb | 502 | return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? |
Kojto | 115:87f2f5183dfb | 503 | ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; |
Kojto | 115:87f2f5183dfb | 504 | } |
Kojto | 115:87f2f5183dfb | 505 | |
Kojto | 115:87f2f5183dfb | 506 | /** |
Kojto | 115:87f2f5183dfb | 507 | * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. |
Kojto | 115:87f2f5183dfb | 508 | */ |
Kojto | 115:87f2f5183dfb | 509 | |
Kojto | 115:87f2f5183dfb | 510 | static __INLINE q63_t mult32x64( |
Kojto | 115:87f2f5183dfb | 511 | q63_t x, |
Kojto | 115:87f2f5183dfb | 512 | q31_t y) |
Kojto | 115:87f2f5183dfb | 513 | { |
Kojto | 115:87f2f5183dfb | 514 | return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + |
Kojto | 115:87f2f5183dfb | 515 | (((q63_t) (x >> 32) * y))); |
Kojto | 115:87f2f5183dfb | 516 | } |
Kojto | 115:87f2f5183dfb | 517 | |
Kojto | 115:87f2f5183dfb | 518 | |
Kojto | 115:87f2f5183dfb | 519 | //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) |
Kojto | 115:87f2f5183dfb | 520 | //#define __CLZ __clz |
Kojto | 115:87f2f5183dfb | 521 | //#endif |
Kojto | 115:87f2f5183dfb | 522 | |
Kojto | 115:87f2f5183dfb | 523 | //note: function can be removed when all toolchain support __CLZ for Cortex-M0 |
Kojto | 115:87f2f5183dfb | 524 | #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) |
Kojto | 115:87f2f5183dfb | 525 | |
Kojto | 115:87f2f5183dfb | 526 | static __INLINE uint32_t __CLZ( |
Kojto | 115:87f2f5183dfb | 527 | q31_t data); |
Kojto | 115:87f2f5183dfb | 528 | |
Kojto | 115:87f2f5183dfb | 529 | |
Kojto | 115:87f2f5183dfb | 530 | static __INLINE uint32_t __CLZ( |
Kojto | 115:87f2f5183dfb | 531 | q31_t data) |
Kojto | 115:87f2f5183dfb | 532 | { |
Kojto | 115:87f2f5183dfb | 533 | uint32_t count = 0; |
Kojto | 115:87f2f5183dfb | 534 | uint32_t mask = 0x80000000; |
Kojto | 115:87f2f5183dfb | 535 | |
Kojto | 115:87f2f5183dfb | 536 | while((data & mask) == 0) |
Kojto | 115:87f2f5183dfb | 537 | { |
Kojto | 115:87f2f5183dfb | 538 | count += 1u; |
Kojto | 115:87f2f5183dfb | 539 | mask = mask >> 1u; |
Kojto | 115:87f2f5183dfb | 540 | } |
Kojto | 115:87f2f5183dfb | 541 | |
Kojto | 115:87f2f5183dfb | 542 | return (count); |
Kojto | 115:87f2f5183dfb | 543 | |
Kojto | 115:87f2f5183dfb | 544 | } |
Kojto | 115:87f2f5183dfb | 545 | |
Kojto | 115:87f2f5183dfb | 546 | #endif |
Kojto | 115:87f2f5183dfb | 547 | |
Kojto | 115:87f2f5183dfb | 548 | /** |
Kojto | 115:87f2f5183dfb | 549 | * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. |
Kojto | 115:87f2f5183dfb | 550 | */ |
Kojto | 115:87f2f5183dfb | 551 | |
Kojto | 115:87f2f5183dfb | 552 | static __INLINE uint32_t arm_recip_q31( |
Kojto | 115:87f2f5183dfb | 553 | q31_t in, |
Kojto | 115:87f2f5183dfb | 554 | q31_t * dst, |
Kojto | 115:87f2f5183dfb | 555 | q31_t * pRecipTable) |
Kojto | 115:87f2f5183dfb | 556 | { |
Kojto | 115:87f2f5183dfb | 557 | |
Kojto | 115:87f2f5183dfb | 558 | uint32_t out, tempVal; |
Kojto | 115:87f2f5183dfb | 559 | uint32_t index, i; |
Kojto | 115:87f2f5183dfb | 560 | uint32_t signBits; |
Kojto | 115:87f2f5183dfb | 561 | |
Kojto | 115:87f2f5183dfb | 562 | if(in > 0) |
Kojto | 115:87f2f5183dfb | 563 | { |
Kojto | 115:87f2f5183dfb | 564 | signBits = __CLZ(in) - 1; |
Kojto | 115:87f2f5183dfb | 565 | } |
Kojto | 115:87f2f5183dfb | 566 | else |
Kojto | 115:87f2f5183dfb | 567 | { |
Kojto | 115:87f2f5183dfb | 568 | signBits = __CLZ(-in) - 1; |
Kojto | 115:87f2f5183dfb | 569 | } |
Kojto | 115:87f2f5183dfb | 570 | |
Kojto | 115:87f2f5183dfb | 571 | /* Convert input sample to 1.31 format */ |
Kojto | 115:87f2f5183dfb | 572 | in = in << signBits; |
Kojto | 115:87f2f5183dfb | 573 | |
Kojto | 115:87f2f5183dfb | 574 | /* calculation of index for initial approximated Val */ |
Kojto | 115:87f2f5183dfb | 575 | index = (uint32_t) (in >> 24u); |
Kojto | 115:87f2f5183dfb | 576 | index = (index & INDEX_MASK); |
Kojto | 115:87f2f5183dfb | 577 | |
Kojto | 115:87f2f5183dfb | 578 | /* 1.31 with exp 1 */ |
Kojto | 115:87f2f5183dfb | 579 | out = pRecipTable[index]; |
Kojto | 115:87f2f5183dfb | 580 | |
Kojto | 115:87f2f5183dfb | 581 | /* calculation of reciprocal value */ |
Kojto | 115:87f2f5183dfb | 582 | /* running approximation for two iterations */ |
Kojto | 115:87f2f5183dfb | 583 | for (i = 0u; i < 2u; i++) |
Kojto | 115:87f2f5183dfb | 584 | { |
Kojto | 115:87f2f5183dfb | 585 | tempVal = (q31_t) (((q63_t) in * out) >> 31u); |
Kojto | 115:87f2f5183dfb | 586 | tempVal = 0x7FFFFFFF - tempVal; |
Kojto | 115:87f2f5183dfb | 587 | /* 1.31 with exp 1 */ |
Kojto | 115:87f2f5183dfb | 588 | //out = (q31_t) (((q63_t) out * tempVal) >> 30u); |
Kojto | 115:87f2f5183dfb | 589 | out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u); |
Kojto | 115:87f2f5183dfb | 590 | } |
Kojto | 115:87f2f5183dfb | 591 | |
Kojto | 115:87f2f5183dfb | 592 | /* write output */ |
Kojto | 115:87f2f5183dfb | 593 | *dst = out; |
Kojto | 115:87f2f5183dfb | 594 | |
Kojto | 115:87f2f5183dfb | 595 | /* return num of signbits of out = 1/in value */ |
Kojto | 115:87f2f5183dfb | 596 | return (signBits + 1u); |
Kojto | 115:87f2f5183dfb | 597 | |
Kojto | 115:87f2f5183dfb | 598 | } |
Kojto | 115:87f2f5183dfb | 599 | |
Kojto | 115:87f2f5183dfb | 600 | /** |
Kojto | 115:87f2f5183dfb | 601 | * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. |
Kojto | 115:87f2f5183dfb | 602 | */ |
Kojto | 115:87f2f5183dfb | 603 | static __INLINE uint32_t arm_recip_q15( |
Kojto | 115:87f2f5183dfb | 604 | q15_t in, |
Kojto | 115:87f2f5183dfb | 605 | q15_t * dst, |
Kojto | 115:87f2f5183dfb | 606 | q15_t * pRecipTable) |
Kojto | 115:87f2f5183dfb | 607 | { |
Kojto | 115:87f2f5183dfb | 608 | |
Kojto | 115:87f2f5183dfb | 609 | uint32_t out = 0, tempVal = 0; |
Kojto | 115:87f2f5183dfb | 610 | uint32_t index = 0, i = 0; |
Kojto | 115:87f2f5183dfb | 611 | uint32_t signBits = 0; |
Kojto | 115:87f2f5183dfb | 612 | |
Kojto | 115:87f2f5183dfb | 613 | if(in > 0) |
Kojto | 115:87f2f5183dfb | 614 | { |
Kojto | 115:87f2f5183dfb | 615 | signBits = __CLZ(in) - 17; |
Kojto | 115:87f2f5183dfb | 616 | } |
Kojto | 115:87f2f5183dfb | 617 | else |
Kojto | 115:87f2f5183dfb | 618 | { |
Kojto | 115:87f2f5183dfb | 619 | signBits = __CLZ(-in) - 17; |
Kojto | 115:87f2f5183dfb | 620 | } |
Kojto | 115:87f2f5183dfb | 621 | |
Kojto | 115:87f2f5183dfb | 622 | /* Convert input sample to 1.15 format */ |
Kojto | 115:87f2f5183dfb | 623 | in = in << signBits; |
Kojto | 115:87f2f5183dfb | 624 | |
Kojto | 115:87f2f5183dfb | 625 | /* calculation of index for initial approximated Val */ |
Kojto | 115:87f2f5183dfb | 626 | index = in >> 8; |
Kojto | 115:87f2f5183dfb | 627 | index = (index & INDEX_MASK); |
Kojto | 115:87f2f5183dfb | 628 | |
Kojto | 115:87f2f5183dfb | 629 | /* 1.15 with exp 1 */ |
Kojto | 115:87f2f5183dfb | 630 | out = pRecipTable[index]; |
Kojto | 115:87f2f5183dfb | 631 | |
Kojto | 115:87f2f5183dfb | 632 | /* calculation of reciprocal value */ |
Kojto | 115:87f2f5183dfb | 633 | /* running approximation for two iterations */ |
Kojto | 115:87f2f5183dfb | 634 | for (i = 0; i < 2; i++) |
Kojto | 115:87f2f5183dfb | 635 | { |
Kojto | 115:87f2f5183dfb | 636 | tempVal = (q15_t) (((q31_t) in * out) >> 15); |
Kojto | 115:87f2f5183dfb | 637 | tempVal = 0x7FFF - tempVal; |
Kojto | 115:87f2f5183dfb | 638 | /* 1.15 with exp 1 */ |
Kojto | 115:87f2f5183dfb | 639 | out = (q15_t) (((q31_t) out * tempVal) >> 14); |
Kojto | 115:87f2f5183dfb | 640 | } |
Kojto | 115:87f2f5183dfb | 641 | |
Kojto | 115:87f2f5183dfb | 642 | /* write output */ |
Kojto | 115:87f2f5183dfb | 643 | *dst = out; |
Kojto | 115:87f2f5183dfb | 644 | |
Kojto | 115:87f2f5183dfb | 645 | /* return num of signbits of out = 1/in value */ |
Kojto | 115:87f2f5183dfb | 646 | return (signBits + 1); |
Kojto | 115:87f2f5183dfb | 647 | |
Kojto | 115:87f2f5183dfb | 648 | } |
Kojto | 115:87f2f5183dfb | 649 | |
Kojto | 115:87f2f5183dfb | 650 | |
Kojto | 115:87f2f5183dfb | 651 | /* |
Kojto | 115:87f2f5183dfb | 652 | * @brief C custom defined intrinisic function for only M0 processors |
Kojto | 115:87f2f5183dfb | 653 | */ |
Kojto | 115:87f2f5183dfb | 654 | #if defined(ARM_MATH_CM0_FAMILY) |
Kojto | 115:87f2f5183dfb | 655 | |
Kojto | 115:87f2f5183dfb | 656 | static __INLINE q31_t __SSAT( |
Kojto | 115:87f2f5183dfb | 657 | q31_t x, |
Kojto | 115:87f2f5183dfb | 658 | uint32_t y) |
Kojto | 115:87f2f5183dfb | 659 | { |
Kojto | 115:87f2f5183dfb | 660 | int32_t posMax, negMin; |
Kojto | 115:87f2f5183dfb | 661 | uint32_t i; |
Kojto | 115:87f2f5183dfb | 662 | |
Kojto | 115:87f2f5183dfb | 663 | posMax = 1; |
Kojto | 115:87f2f5183dfb | 664 | for (i = 0; i < (y - 1); i++) |
Kojto | 115:87f2f5183dfb | 665 | { |
Kojto | 115:87f2f5183dfb | 666 | posMax = posMax * 2; |
Kojto | 115:87f2f5183dfb | 667 | } |
Kojto | 115:87f2f5183dfb | 668 | |
Kojto | 115:87f2f5183dfb | 669 | if(x > 0) |
Kojto | 115:87f2f5183dfb | 670 | { |
Kojto | 115:87f2f5183dfb | 671 | posMax = (posMax - 1); |
Kojto | 115:87f2f5183dfb | 672 | |
Kojto | 115:87f2f5183dfb | 673 | if(x > posMax) |
Kojto | 115:87f2f5183dfb | 674 | { |
Kojto | 115:87f2f5183dfb | 675 | x = posMax; |
Kojto | 115:87f2f5183dfb | 676 | } |
Kojto | 115:87f2f5183dfb | 677 | } |
Kojto | 115:87f2f5183dfb | 678 | else |
Kojto | 115:87f2f5183dfb | 679 | { |
Kojto | 115:87f2f5183dfb | 680 | negMin = -posMax; |
Kojto | 115:87f2f5183dfb | 681 | |
Kojto | 115:87f2f5183dfb | 682 | if(x < negMin) |
Kojto | 115:87f2f5183dfb | 683 | { |
Kojto | 115:87f2f5183dfb | 684 | x = negMin; |
Kojto | 115:87f2f5183dfb | 685 | } |
Kojto | 115:87f2f5183dfb | 686 | } |
Kojto | 115:87f2f5183dfb | 687 | return (x); |
Kojto | 115:87f2f5183dfb | 688 | |
Kojto | 115:87f2f5183dfb | 689 | |
Kojto | 115:87f2f5183dfb | 690 | } |
Kojto | 115:87f2f5183dfb | 691 | |
Kojto | 115:87f2f5183dfb | 692 | #endif /* end of ARM_MATH_CM0_FAMILY */ |
Kojto | 115:87f2f5183dfb | 693 | |
Kojto | 115:87f2f5183dfb | 694 | |
Kojto | 115:87f2f5183dfb | 695 | |
Kojto | 115:87f2f5183dfb | 696 | /* |
Kojto | 115:87f2f5183dfb | 697 | * @brief C custom defined intrinsic function for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 698 | */ |
Kojto | 115:87f2f5183dfb | 699 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
Kojto | 115:87f2f5183dfb | 700 | |
Kojto | 115:87f2f5183dfb | 701 | /* |
Kojto | 115:87f2f5183dfb | 702 | * @brief C custom defined QADD8 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 703 | */ |
Kojto | 115:87f2f5183dfb | 704 | static __INLINE q31_t __QADD8( |
Kojto | 115:87f2f5183dfb | 705 | q31_t x, |
Kojto | 115:87f2f5183dfb | 706 | q31_t y) |
Kojto | 115:87f2f5183dfb | 707 | { |
Kojto | 115:87f2f5183dfb | 708 | |
Kojto | 115:87f2f5183dfb | 709 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 710 | q7_t r, s, t, u; |
Kojto | 115:87f2f5183dfb | 711 | |
Kojto | 115:87f2f5183dfb | 712 | r = (q7_t) x; |
Kojto | 115:87f2f5183dfb | 713 | s = (q7_t) y; |
Kojto | 115:87f2f5183dfb | 714 | |
Kojto | 115:87f2f5183dfb | 715 | r = __SSAT((q31_t) (r + s), 8); |
Kojto | 115:87f2f5183dfb | 716 | s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8); |
Kojto | 115:87f2f5183dfb | 717 | t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8); |
Kojto | 115:87f2f5183dfb | 718 | u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8); |
Kojto | 115:87f2f5183dfb | 719 | |
Kojto | 115:87f2f5183dfb | 720 | sum = |
Kojto | 115:87f2f5183dfb | 721 | (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) | |
Kojto | 115:87f2f5183dfb | 722 | (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF); |
Kojto | 115:87f2f5183dfb | 723 | |
Kojto | 115:87f2f5183dfb | 724 | return sum; |
Kojto | 115:87f2f5183dfb | 725 | |
Kojto | 115:87f2f5183dfb | 726 | } |
Kojto | 115:87f2f5183dfb | 727 | |
Kojto | 115:87f2f5183dfb | 728 | /* |
Kojto | 115:87f2f5183dfb | 729 | * @brief C custom defined QSUB8 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 730 | */ |
Kojto | 115:87f2f5183dfb | 731 | static __INLINE q31_t __QSUB8( |
Kojto | 115:87f2f5183dfb | 732 | q31_t x, |
Kojto | 115:87f2f5183dfb | 733 | q31_t y) |
Kojto | 115:87f2f5183dfb | 734 | { |
Kojto | 115:87f2f5183dfb | 735 | |
Kojto | 115:87f2f5183dfb | 736 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 737 | q31_t r, s, t, u; |
Kojto | 115:87f2f5183dfb | 738 | |
Kojto | 115:87f2f5183dfb | 739 | r = (q7_t) x; |
Kojto | 115:87f2f5183dfb | 740 | s = (q7_t) y; |
Kojto | 115:87f2f5183dfb | 741 | |
Kojto | 115:87f2f5183dfb | 742 | r = __SSAT((r - s), 8); |
Kojto | 115:87f2f5183dfb | 743 | s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8; |
Kojto | 115:87f2f5183dfb | 744 | t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16; |
Kojto | 115:87f2f5183dfb | 745 | u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24; |
Kojto | 115:87f2f5183dfb | 746 | |
Kojto | 115:87f2f5183dfb | 747 | sum = |
Kojto | 115:87f2f5183dfb | 748 | (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r & |
Kojto | 115:87f2f5183dfb | 749 | 0x000000FF); |
Kojto | 115:87f2f5183dfb | 750 | |
Kojto | 115:87f2f5183dfb | 751 | return sum; |
Kojto | 115:87f2f5183dfb | 752 | } |
Kojto | 115:87f2f5183dfb | 753 | |
Kojto | 115:87f2f5183dfb | 754 | /* |
Kojto | 115:87f2f5183dfb | 755 | * @brief C custom defined QADD16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 756 | */ |
Kojto | 115:87f2f5183dfb | 757 | |
Kojto | 115:87f2f5183dfb | 758 | /* |
Kojto | 115:87f2f5183dfb | 759 | * @brief C custom defined QADD16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 760 | */ |
Kojto | 115:87f2f5183dfb | 761 | static __INLINE q31_t __QADD16( |
Kojto | 115:87f2f5183dfb | 762 | q31_t x, |
Kojto | 115:87f2f5183dfb | 763 | q31_t y) |
Kojto | 115:87f2f5183dfb | 764 | { |
Kojto | 115:87f2f5183dfb | 765 | |
Kojto | 115:87f2f5183dfb | 766 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 767 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 768 | |
Kojto | 115:87f2f5183dfb | 769 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 770 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 771 | |
Kojto | 115:87f2f5183dfb | 772 | r = __SSAT(r + s, 16); |
Kojto | 115:87f2f5183dfb | 773 | s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16; |
Kojto | 115:87f2f5183dfb | 774 | |
Kojto | 115:87f2f5183dfb | 775 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 776 | |
Kojto | 115:87f2f5183dfb | 777 | return sum; |
Kojto | 115:87f2f5183dfb | 778 | |
Kojto | 115:87f2f5183dfb | 779 | } |
Kojto | 115:87f2f5183dfb | 780 | |
Kojto | 115:87f2f5183dfb | 781 | /* |
Kojto | 115:87f2f5183dfb | 782 | * @brief C custom defined SHADD16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 783 | */ |
Kojto | 115:87f2f5183dfb | 784 | static __INLINE q31_t __SHADD16( |
Kojto | 115:87f2f5183dfb | 785 | q31_t x, |
Kojto | 115:87f2f5183dfb | 786 | q31_t y) |
Kojto | 115:87f2f5183dfb | 787 | { |
Kojto | 115:87f2f5183dfb | 788 | |
Kojto | 115:87f2f5183dfb | 789 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 790 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 791 | |
Kojto | 115:87f2f5183dfb | 792 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 793 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 794 | |
Kojto | 115:87f2f5183dfb | 795 | r = ((r >> 1) + (s >> 1)); |
Kojto | 115:87f2f5183dfb | 796 | s = ((q31_t) ((x >> 17) + (y >> 17))) << 16; |
Kojto | 115:87f2f5183dfb | 797 | |
Kojto | 115:87f2f5183dfb | 798 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 799 | |
Kojto | 115:87f2f5183dfb | 800 | return sum; |
Kojto | 115:87f2f5183dfb | 801 | |
Kojto | 115:87f2f5183dfb | 802 | } |
Kojto | 115:87f2f5183dfb | 803 | |
Kojto | 115:87f2f5183dfb | 804 | /* |
Kojto | 115:87f2f5183dfb | 805 | * @brief C custom defined QSUB16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 806 | */ |
Kojto | 115:87f2f5183dfb | 807 | static __INLINE q31_t __QSUB16( |
Kojto | 115:87f2f5183dfb | 808 | q31_t x, |
Kojto | 115:87f2f5183dfb | 809 | q31_t y) |
Kojto | 115:87f2f5183dfb | 810 | { |
Kojto | 115:87f2f5183dfb | 811 | |
Kojto | 115:87f2f5183dfb | 812 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 813 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 814 | |
Kojto | 115:87f2f5183dfb | 815 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 816 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 817 | |
Kojto | 115:87f2f5183dfb | 818 | r = __SSAT(r - s, 16); |
Kojto | 115:87f2f5183dfb | 819 | s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16; |
Kojto | 115:87f2f5183dfb | 820 | |
Kojto | 115:87f2f5183dfb | 821 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 822 | |
Kojto | 115:87f2f5183dfb | 823 | return sum; |
Kojto | 115:87f2f5183dfb | 824 | } |
Kojto | 115:87f2f5183dfb | 825 | |
Kojto | 115:87f2f5183dfb | 826 | /* |
Kojto | 115:87f2f5183dfb | 827 | * @brief C custom defined SHSUB16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 828 | */ |
Kojto | 115:87f2f5183dfb | 829 | static __INLINE q31_t __SHSUB16( |
Kojto | 115:87f2f5183dfb | 830 | q31_t x, |
Kojto | 115:87f2f5183dfb | 831 | q31_t y) |
Kojto | 115:87f2f5183dfb | 832 | { |
Kojto | 115:87f2f5183dfb | 833 | |
Kojto | 115:87f2f5183dfb | 834 | q31_t diff; |
Kojto | 115:87f2f5183dfb | 835 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 836 | |
Kojto | 115:87f2f5183dfb | 837 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 838 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 839 | |
Kojto | 115:87f2f5183dfb | 840 | r = ((r >> 1) - (s >> 1)); |
Kojto | 115:87f2f5183dfb | 841 | s = (((x >> 17) - (y >> 17)) << 16); |
Kojto | 115:87f2f5183dfb | 842 | |
Kojto | 115:87f2f5183dfb | 843 | diff = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 844 | |
Kojto | 115:87f2f5183dfb | 845 | return diff; |
Kojto | 115:87f2f5183dfb | 846 | } |
Kojto | 115:87f2f5183dfb | 847 | |
Kojto | 115:87f2f5183dfb | 848 | /* |
Kojto | 115:87f2f5183dfb | 849 | * @brief C custom defined QASX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 850 | */ |
Kojto | 115:87f2f5183dfb | 851 | static __INLINE q31_t __QASX( |
Kojto | 115:87f2f5183dfb | 852 | q31_t x, |
Kojto | 115:87f2f5183dfb | 853 | q31_t y) |
Kojto | 115:87f2f5183dfb | 854 | { |
Kojto | 115:87f2f5183dfb | 855 | |
Kojto | 115:87f2f5183dfb | 856 | q31_t sum = 0; |
Kojto | 115:87f2f5183dfb | 857 | |
Kojto | 115:87f2f5183dfb | 858 | sum = |
Kojto | 115:87f2f5183dfb | 859 | ((sum + |
Kojto | 115:87f2f5183dfb | 860 | clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) + |
Kojto | 115:87f2f5183dfb | 861 | clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16))); |
Kojto | 115:87f2f5183dfb | 862 | |
Kojto | 115:87f2f5183dfb | 863 | return sum; |
Kojto | 115:87f2f5183dfb | 864 | } |
Kojto | 115:87f2f5183dfb | 865 | |
Kojto | 115:87f2f5183dfb | 866 | /* |
Kojto | 115:87f2f5183dfb | 867 | * @brief C custom defined SHASX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 868 | */ |
Kojto | 115:87f2f5183dfb | 869 | static __INLINE q31_t __SHASX( |
Kojto | 115:87f2f5183dfb | 870 | q31_t x, |
Kojto | 115:87f2f5183dfb | 871 | q31_t y) |
Kojto | 115:87f2f5183dfb | 872 | { |
Kojto | 115:87f2f5183dfb | 873 | |
Kojto | 115:87f2f5183dfb | 874 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 875 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 876 | |
Kojto | 115:87f2f5183dfb | 877 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 878 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 879 | |
Kojto | 115:87f2f5183dfb | 880 | r = ((r >> 1) - (y >> 17)); |
Kojto | 115:87f2f5183dfb | 881 | s = (((x >> 17) + (s >> 1)) << 16); |
Kojto | 115:87f2f5183dfb | 882 | |
Kojto | 115:87f2f5183dfb | 883 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 884 | |
Kojto | 115:87f2f5183dfb | 885 | return sum; |
Kojto | 115:87f2f5183dfb | 886 | } |
Kojto | 115:87f2f5183dfb | 887 | |
Kojto | 115:87f2f5183dfb | 888 | |
Kojto | 115:87f2f5183dfb | 889 | /* |
Kojto | 115:87f2f5183dfb | 890 | * @brief C custom defined QSAX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 891 | */ |
Kojto | 115:87f2f5183dfb | 892 | static __INLINE q31_t __QSAX( |
Kojto | 115:87f2f5183dfb | 893 | q31_t x, |
Kojto | 115:87f2f5183dfb | 894 | q31_t y) |
Kojto | 115:87f2f5183dfb | 895 | { |
Kojto | 115:87f2f5183dfb | 896 | |
Kojto | 115:87f2f5183dfb | 897 | q31_t sum = 0; |
Kojto | 115:87f2f5183dfb | 898 | |
Kojto | 115:87f2f5183dfb | 899 | sum = |
Kojto | 115:87f2f5183dfb | 900 | ((sum + |
Kojto | 115:87f2f5183dfb | 901 | clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) + |
Kojto | 115:87f2f5183dfb | 902 | clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16))); |
Kojto | 115:87f2f5183dfb | 903 | |
Kojto | 115:87f2f5183dfb | 904 | return sum; |
Kojto | 115:87f2f5183dfb | 905 | } |
Kojto | 115:87f2f5183dfb | 906 | |
Kojto | 115:87f2f5183dfb | 907 | /* |
Kojto | 115:87f2f5183dfb | 908 | * @brief C custom defined SHSAX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 909 | */ |
Kojto | 115:87f2f5183dfb | 910 | static __INLINE q31_t __SHSAX( |
Kojto | 115:87f2f5183dfb | 911 | q31_t x, |
Kojto | 115:87f2f5183dfb | 912 | q31_t y) |
Kojto | 115:87f2f5183dfb | 913 | { |
Kojto | 115:87f2f5183dfb | 914 | |
Kojto | 115:87f2f5183dfb | 915 | q31_t sum; |
Kojto | 115:87f2f5183dfb | 916 | q31_t r, s; |
Kojto | 115:87f2f5183dfb | 917 | |
Kojto | 115:87f2f5183dfb | 918 | r = (q15_t) x; |
Kojto | 115:87f2f5183dfb | 919 | s = (q15_t) y; |
Kojto | 115:87f2f5183dfb | 920 | |
Kojto | 115:87f2f5183dfb | 921 | r = ((r >> 1) + (y >> 17)); |
Kojto | 115:87f2f5183dfb | 922 | s = (((x >> 17) - (s >> 1)) << 16); |
Kojto | 115:87f2f5183dfb | 923 | |
Kojto | 115:87f2f5183dfb | 924 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
Kojto | 115:87f2f5183dfb | 925 | |
Kojto | 115:87f2f5183dfb | 926 | return sum; |
Kojto | 115:87f2f5183dfb | 927 | } |
Kojto | 115:87f2f5183dfb | 928 | |
Kojto | 115:87f2f5183dfb | 929 | /* |
Kojto | 115:87f2f5183dfb | 930 | * @brief C custom defined SMUSDX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 931 | */ |
Kojto | 115:87f2f5183dfb | 932 | static __INLINE q31_t __SMUSDX( |
Kojto | 115:87f2f5183dfb | 933 | q31_t x, |
Kojto | 115:87f2f5183dfb | 934 | q31_t y) |
Kojto | 115:87f2f5183dfb | 935 | { |
Kojto | 115:87f2f5183dfb | 936 | |
Kojto | 115:87f2f5183dfb | 937 | return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) - |
Kojto | 115:87f2f5183dfb | 938 | ((q15_t) (x >> 16) * (q15_t) y))); |
Kojto | 115:87f2f5183dfb | 939 | } |
Kojto | 115:87f2f5183dfb | 940 | |
Kojto | 115:87f2f5183dfb | 941 | /* |
Kojto | 115:87f2f5183dfb | 942 | * @brief C custom defined SMUADX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 943 | */ |
Kojto | 115:87f2f5183dfb | 944 | static __INLINE q31_t __SMUADX( |
Kojto | 115:87f2f5183dfb | 945 | q31_t x, |
Kojto | 115:87f2f5183dfb | 946 | q31_t y) |
Kojto | 115:87f2f5183dfb | 947 | { |
Kojto | 115:87f2f5183dfb | 948 | |
Kojto | 115:87f2f5183dfb | 949 | return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) + |
Kojto | 115:87f2f5183dfb | 950 | ((q15_t) (x >> 16) * (q15_t) y))); |
Kojto | 115:87f2f5183dfb | 951 | } |
Kojto | 115:87f2f5183dfb | 952 | |
Kojto | 115:87f2f5183dfb | 953 | /* |
Kojto | 115:87f2f5183dfb | 954 | * @brief C custom defined QADD for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 955 | */ |
Kojto | 115:87f2f5183dfb | 956 | static __INLINE q31_t __QADD( |
Kojto | 115:87f2f5183dfb | 957 | q31_t x, |
Kojto | 115:87f2f5183dfb | 958 | q31_t y) |
Kojto | 115:87f2f5183dfb | 959 | { |
Kojto | 115:87f2f5183dfb | 960 | return clip_q63_to_q31((q63_t) x + y); |
Kojto | 115:87f2f5183dfb | 961 | } |
Kojto | 115:87f2f5183dfb | 962 | |
Kojto | 115:87f2f5183dfb | 963 | /* |
Kojto | 115:87f2f5183dfb | 964 | * @brief C custom defined QSUB for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 965 | */ |
Kojto | 115:87f2f5183dfb | 966 | static __INLINE q31_t __QSUB( |
Kojto | 115:87f2f5183dfb | 967 | q31_t x, |
Kojto | 115:87f2f5183dfb | 968 | q31_t y) |
Kojto | 115:87f2f5183dfb | 969 | { |
Kojto | 115:87f2f5183dfb | 970 | return clip_q63_to_q31((q63_t) x - y); |
Kojto | 115:87f2f5183dfb | 971 | } |
Kojto | 115:87f2f5183dfb | 972 | |
Kojto | 115:87f2f5183dfb | 973 | /* |
Kojto | 115:87f2f5183dfb | 974 | * @brief C custom defined SMLAD for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 975 | */ |
Kojto | 115:87f2f5183dfb | 976 | static __INLINE q31_t __SMLAD( |
Kojto | 115:87f2f5183dfb | 977 | q31_t x, |
Kojto | 115:87f2f5183dfb | 978 | q31_t y, |
Kojto | 115:87f2f5183dfb | 979 | q31_t sum) |
Kojto | 115:87f2f5183dfb | 980 | { |
Kojto | 115:87f2f5183dfb | 981 | |
Kojto | 115:87f2f5183dfb | 982 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + |
Kojto | 115:87f2f5183dfb | 983 | ((q15_t) x * (q15_t) y)); |
Kojto | 115:87f2f5183dfb | 984 | } |
Kojto | 115:87f2f5183dfb | 985 | |
Kojto | 115:87f2f5183dfb | 986 | /* |
Kojto | 115:87f2f5183dfb | 987 | * @brief C custom defined SMLADX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 988 | */ |
Kojto | 115:87f2f5183dfb | 989 | static __INLINE q31_t __SMLADX( |
Kojto | 115:87f2f5183dfb | 990 | q31_t x, |
Kojto | 115:87f2f5183dfb | 991 | q31_t y, |
Kojto | 115:87f2f5183dfb | 992 | q31_t sum) |
Kojto | 115:87f2f5183dfb | 993 | { |
Kojto | 115:87f2f5183dfb | 994 | |
Kojto | 115:87f2f5183dfb | 995 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) + |
Kojto | 115:87f2f5183dfb | 996 | ((q15_t) x * (q15_t) (y >> 16))); |
Kojto | 115:87f2f5183dfb | 997 | } |
Kojto | 115:87f2f5183dfb | 998 | |
Kojto | 115:87f2f5183dfb | 999 | /* |
Kojto | 115:87f2f5183dfb | 1000 | * @brief C custom defined SMLSDX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1001 | */ |
Kojto | 115:87f2f5183dfb | 1002 | static __INLINE q31_t __SMLSDX( |
Kojto | 115:87f2f5183dfb | 1003 | q31_t x, |
Kojto | 115:87f2f5183dfb | 1004 | q31_t y, |
Kojto | 115:87f2f5183dfb | 1005 | q31_t sum) |
Kojto | 115:87f2f5183dfb | 1006 | { |
Kojto | 115:87f2f5183dfb | 1007 | |
Kojto | 115:87f2f5183dfb | 1008 | return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) + |
Kojto | 115:87f2f5183dfb | 1009 | ((q15_t) x * (q15_t) (y >> 16))); |
Kojto | 115:87f2f5183dfb | 1010 | } |
Kojto | 115:87f2f5183dfb | 1011 | |
Kojto | 115:87f2f5183dfb | 1012 | /* |
Kojto | 115:87f2f5183dfb | 1013 | * @brief C custom defined SMLALD for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1014 | */ |
Kojto | 115:87f2f5183dfb | 1015 | static __INLINE q63_t __SMLALD( |
Kojto | 115:87f2f5183dfb | 1016 | q31_t x, |
Kojto | 115:87f2f5183dfb | 1017 | q31_t y, |
Kojto | 115:87f2f5183dfb | 1018 | q63_t sum) |
Kojto | 115:87f2f5183dfb | 1019 | { |
Kojto | 115:87f2f5183dfb | 1020 | |
Kojto | 115:87f2f5183dfb | 1021 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + |
Kojto | 115:87f2f5183dfb | 1022 | ((q15_t) x * (q15_t) y)); |
Kojto | 115:87f2f5183dfb | 1023 | } |
Kojto | 115:87f2f5183dfb | 1024 | |
Kojto | 115:87f2f5183dfb | 1025 | /* |
Kojto | 115:87f2f5183dfb | 1026 | * @brief C custom defined SMLALDX for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1027 | */ |
Kojto | 115:87f2f5183dfb | 1028 | static __INLINE q63_t __SMLALDX( |
Kojto | 115:87f2f5183dfb | 1029 | q31_t x, |
Kojto | 115:87f2f5183dfb | 1030 | q31_t y, |
Kojto | 115:87f2f5183dfb | 1031 | q63_t sum) |
Kojto | 115:87f2f5183dfb | 1032 | { |
Kojto | 115:87f2f5183dfb | 1033 | |
Kojto | 115:87f2f5183dfb | 1034 | return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + |
Kojto | 115:87f2f5183dfb | 1035 | ((q15_t) x * (q15_t) (y >> 16)); |
Kojto | 115:87f2f5183dfb | 1036 | } |
Kojto | 115:87f2f5183dfb | 1037 | |
Kojto | 115:87f2f5183dfb | 1038 | /* |
Kojto | 115:87f2f5183dfb | 1039 | * @brief C custom defined SMUAD for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1040 | */ |
Kojto | 115:87f2f5183dfb | 1041 | static __INLINE q31_t __SMUAD( |
Kojto | 115:87f2f5183dfb | 1042 | q31_t x, |
Kojto | 115:87f2f5183dfb | 1043 | q31_t y) |
Kojto | 115:87f2f5183dfb | 1044 | { |
Kojto | 115:87f2f5183dfb | 1045 | |
Kojto | 115:87f2f5183dfb | 1046 | return (((x >> 16) * (y >> 16)) + |
Kojto | 115:87f2f5183dfb | 1047 | (((x << 16) >> 16) * ((y << 16) >> 16))); |
Kojto | 115:87f2f5183dfb | 1048 | } |
Kojto | 115:87f2f5183dfb | 1049 | |
Kojto | 115:87f2f5183dfb | 1050 | /* |
Kojto | 115:87f2f5183dfb | 1051 | * @brief C custom defined SMUSD for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1052 | */ |
Kojto | 115:87f2f5183dfb | 1053 | static __INLINE q31_t __SMUSD( |
Kojto | 115:87f2f5183dfb | 1054 | q31_t x, |
Kojto | 115:87f2f5183dfb | 1055 | q31_t y) |
Kojto | 115:87f2f5183dfb | 1056 | { |
Kojto | 115:87f2f5183dfb | 1057 | |
Kojto | 115:87f2f5183dfb | 1058 | return (-((x >> 16) * (y >> 16)) + |
Kojto | 115:87f2f5183dfb | 1059 | (((x << 16) >> 16) * ((y << 16) >> 16))); |
Kojto | 115:87f2f5183dfb | 1060 | } |
Kojto | 115:87f2f5183dfb | 1061 | |
Kojto | 115:87f2f5183dfb | 1062 | |
Kojto | 115:87f2f5183dfb | 1063 | /* |
Kojto | 115:87f2f5183dfb | 1064 | * @brief C custom defined SXTB16 for M3 and M0 processors |
Kojto | 115:87f2f5183dfb | 1065 | */ |
Kojto | 115:87f2f5183dfb | 1066 | static __INLINE q31_t __SXTB16( |
Kojto | 115:87f2f5183dfb | 1067 | q31_t x) |
Kojto | 115:87f2f5183dfb | 1068 | { |
Kojto | 115:87f2f5183dfb | 1069 | |
Kojto | 115:87f2f5183dfb | 1070 | return ((((x << 24) >> 24) & 0x0000FFFF) | |
Kojto | 115:87f2f5183dfb | 1071 | (((x << 8) >> 8) & 0xFFFF0000)); |
Kojto | 115:87f2f5183dfb | 1072 | } |
Kojto | 115:87f2f5183dfb | 1073 | |
Kojto | 115:87f2f5183dfb | 1074 | |
Kojto | 115:87f2f5183dfb | 1075 | #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ |
Kojto | 115:87f2f5183dfb | 1076 | |
Kojto | 115:87f2f5183dfb | 1077 | |
Kojto | 115:87f2f5183dfb | 1078 | /** |
Kojto | 115:87f2f5183dfb | 1079 | * @brief Instance structure for the Q7 FIR filter. |
Kojto | 115:87f2f5183dfb | 1080 | */ |
Kojto | 115:87f2f5183dfb | 1081 | typedef struct |
Kojto | 115:87f2f5183dfb | 1082 | { |
Kojto | 115:87f2f5183dfb | 1083 | uint16_t numTaps; /**< number of filter coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 1084 | q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 1085 | q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 1086 | } arm_fir_instance_q7; |
Kojto | 115:87f2f5183dfb | 1087 | |
Kojto | 115:87f2f5183dfb | 1088 | /** |
Kojto | 115:87f2f5183dfb | 1089 | * @brief Instance structure for the Q15 FIR filter. |
Kojto | 115:87f2f5183dfb | 1090 | */ |
Kojto | 115:87f2f5183dfb | 1091 | typedef struct |
Kojto | 115:87f2f5183dfb | 1092 | { |
Kojto | 115:87f2f5183dfb | 1093 | uint16_t numTaps; /**< number of filter coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 1094 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 1095 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 1096 | } arm_fir_instance_q15; |
Kojto | 115:87f2f5183dfb | 1097 | |
Kojto | 115:87f2f5183dfb | 1098 | /** |
Kojto | 115:87f2f5183dfb | 1099 | * @brief Instance structure for the Q31 FIR filter. |
Kojto | 115:87f2f5183dfb | 1100 | */ |
Kojto | 115:87f2f5183dfb | 1101 | typedef struct |
Kojto | 115:87f2f5183dfb | 1102 | { |
Kojto | 115:87f2f5183dfb | 1103 | uint16_t numTaps; /**< number of filter coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 1104 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 1105 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 1106 | } arm_fir_instance_q31; |
Kojto | 115:87f2f5183dfb | 1107 | |
Kojto | 115:87f2f5183dfb | 1108 | /** |
Kojto | 115:87f2f5183dfb | 1109 | * @brief Instance structure for the floating-point FIR filter. |
Kojto | 115:87f2f5183dfb | 1110 | */ |
Kojto | 115:87f2f5183dfb | 1111 | typedef struct |
Kojto | 115:87f2f5183dfb | 1112 | { |
Kojto | 115:87f2f5183dfb | 1113 | uint16_t numTaps; /**< number of filter coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 1114 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 1115 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 1116 | } arm_fir_instance_f32; |
Kojto | 115:87f2f5183dfb | 1117 | |
Kojto | 115:87f2f5183dfb | 1118 | |
Kojto | 115:87f2f5183dfb | 1119 | /** |
Kojto | 115:87f2f5183dfb | 1120 | * @brief Processing function for the Q7 FIR filter. |
Kojto | 115:87f2f5183dfb | 1121 | * @param[in] *S points to an instance of the Q7 FIR filter structure. |
Kojto | 115:87f2f5183dfb | 1122 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1123 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1124 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1125 | * @return none. |
Kojto | 115:87f2f5183dfb | 1126 | */ |
Kojto | 115:87f2f5183dfb | 1127 | void arm_fir_q7( |
Kojto | 115:87f2f5183dfb | 1128 | const arm_fir_instance_q7 * S, |
Kojto | 115:87f2f5183dfb | 1129 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1130 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 1131 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1132 | |
Kojto | 115:87f2f5183dfb | 1133 | |
Kojto | 115:87f2f5183dfb | 1134 | /** |
Kojto | 115:87f2f5183dfb | 1135 | * @brief Initialization function for the Q7 FIR filter. |
Kojto | 115:87f2f5183dfb | 1136 | * @param[in,out] *S points to an instance of the Q7 FIR structure. |
Kojto | 115:87f2f5183dfb | 1137 | * @param[in] numTaps Number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 1138 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1139 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1140 | * @param[in] blockSize number of samples that are processed. |
Kojto | 115:87f2f5183dfb | 1141 | * @return none |
Kojto | 115:87f2f5183dfb | 1142 | */ |
Kojto | 115:87f2f5183dfb | 1143 | void arm_fir_init_q7( |
Kojto | 115:87f2f5183dfb | 1144 | arm_fir_instance_q7 * S, |
Kojto | 115:87f2f5183dfb | 1145 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 1146 | q7_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1147 | q7_t * pState, |
Kojto | 115:87f2f5183dfb | 1148 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1149 | |
Kojto | 115:87f2f5183dfb | 1150 | |
Kojto | 115:87f2f5183dfb | 1151 | /** |
Kojto | 115:87f2f5183dfb | 1152 | * @brief Processing function for the Q15 FIR filter. |
Kojto | 115:87f2f5183dfb | 1153 | * @param[in] *S points to an instance of the Q15 FIR structure. |
Kojto | 115:87f2f5183dfb | 1154 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1155 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1156 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1157 | * @return none. |
Kojto | 115:87f2f5183dfb | 1158 | */ |
Kojto | 115:87f2f5183dfb | 1159 | void arm_fir_q15( |
Kojto | 115:87f2f5183dfb | 1160 | const arm_fir_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 1161 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1162 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 1163 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1164 | |
Kojto | 115:87f2f5183dfb | 1165 | /** |
Kojto | 115:87f2f5183dfb | 1166 | * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 1167 | * @param[in] *S points to an instance of the Q15 FIR filter structure. |
Kojto | 115:87f2f5183dfb | 1168 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1169 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1170 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1171 | * @return none. |
Kojto | 115:87f2f5183dfb | 1172 | */ |
Kojto | 115:87f2f5183dfb | 1173 | void arm_fir_fast_q15( |
Kojto | 115:87f2f5183dfb | 1174 | const arm_fir_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 1175 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1176 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 1177 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1178 | |
Kojto | 115:87f2f5183dfb | 1179 | /** |
Kojto | 115:87f2f5183dfb | 1180 | * @brief Initialization function for the Q15 FIR filter. |
Kojto | 115:87f2f5183dfb | 1181 | * @param[in,out] *S points to an instance of the Q15 FIR filter structure. |
Kojto | 115:87f2f5183dfb | 1182 | * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. |
Kojto | 115:87f2f5183dfb | 1183 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1184 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1185 | * @param[in] blockSize number of samples that are processed at a time. |
Kojto | 115:87f2f5183dfb | 1186 | * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if |
Kojto | 115:87f2f5183dfb | 1187 | * <code>numTaps</code> is not a supported value. |
Kojto | 115:87f2f5183dfb | 1188 | */ |
Kojto | 115:87f2f5183dfb | 1189 | |
Kojto | 115:87f2f5183dfb | 1190 | arm_status arm_fir_init_q15( |
Kojto | 115:87f2f5183dfb | 1191 | arm_fir_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 1192 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 1193 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1194 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 1195 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1196 | |
Kojto | 115:87f2f5183dfb | 1197 | /** |
Kojto | 115:87f2f5183dfb | 1198 | * @brief Processing function for the Q31 FIR filter. |
Kojto | 115:87f2f5183dfb | 1199 | * @param[in] *S points to an instance of the Q31 FIR filter structure. |
Kojto | 115:87f2f5183dfb | 1200 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1201 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1202 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1203 | * @return none. |
Kojto | 115:87f2f5183dfb | 1204 | */ |
Kojto | 115:87f2f5183dfb | 1205 | void arm_fir_q31( |
Kojto | 115:87f2f5183dfb | 1206 | const arm_fir_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 1207 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1208 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 1209 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1210 | |
Kojto | 115:87f2f5183dfb | 1211 | /** |
Kojto | 115:87f2f5183dfb | 1212 | * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 1213 | * @param[in] *S points to an instance of the Q31 FIR structure. |
Kojto | 115:87f2f5183dfb | 1214 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1215 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1216 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1217 | * @return none. |
Kojto | 115:87f2f5183dfb | 1218 | */ |
Kojto | 115:87f2f5183dfb | 1219 | void arm_fir_fast_q31( |
Kojto | 115:87f2f5183dfb | 1220 | const arm_fir_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 1221 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1222 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 1223 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1224 | |
Kojto | 115:87f2f5183dfb | 1225 | /** |
Kojto | 115:87f2f5183dfb | 1226 | * @brief Initialization function for the Q31 FIR filter. |
Kojto | 115:87f2f5183dfb | 1227 | * @param[in,out] *S points to an instance of the Q31 FIR structure. |
Kojto | 115:87f2f5183dfb | 1228 | * @param[in] numTaps Number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 1229 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1230 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1231 | * @param[in] blockSize number of samples that are processed at a time. |
Kojto | 115:87f2f5183dfb | 1232 | * @return none. |
Kojto | 115:87f2f5183dfb | 1233 | */ |
Kojto | 115:87f2f5183dfb | 1234 | void arm_fir_init_q31( |
Kojto | 115:87f2f5183dfb | 1235 | arm_fir_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 1236 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 1237 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1238 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 1239 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1240 | |
Kojto | 115:87f2f5183dfb | 1241 | /** |
Kojto | 115:87f2f5183dfb | 1242 | * @brief Processing function for the floating-point FIR filter. |
Kojto | 115:87f2f5183dfb | 1243 | * @param[in] *S points to an instance of the floating-point FIR structure. |
Kojto | 115:87f2f5183dfb | 1244 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1245 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1246 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1247 | * @return none. |
Kojto | 115:87f2f5183dfb | 1248 | */ |
Kojto | 115:87f2f5183dfb | 1249 | void arm_fir_f32( |
Kojto | 115:87f2f5183dfb | 1250 | const arm_fir_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 1251 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1252 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 1253 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1254 | |
Kojto | 115:87f2f5183dfb | 1255 | /** |
Kojto | 115:87f2f5183dfb | 1256 | * @brief Initialization function for the floating-point FIR filter. |
Kojto | 115:87f2f5183dfb | 1257 | * @param[in,out] *S points to an instance of the floating-point FIR filter structure. |
Kojto | 115:87f2f5183dfb | 1258 | * @param[in] numTaps Number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 1259 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1260 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1261 | * @param[in] blockSize number of samples that are processed at a time. |
Kojto | 115:87f2f5183dfb | 1262 | * @return none. |
Kojto | 115:87f2f5183dfb | 1263 | */ |
Kojto | 115:87f2f5183dfb | 1264 | void arm_fir_init_f32( |
Kojto | 115:87f2f5183dfb | 1265 | arm_fir_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 1266 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 1267 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1268 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 1269 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1270 | |
Kojto | 115:87f2f5183dfb | 1271 | |
Kojto | 115:87f2f5183dfb | 1272 | /** |
Kojto | 115:87f2f5183dfb | 1273 | * @brief Instance structure for the Q15 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1274 | */ |
Kojto | 115:87f2f5183dfb | 1275 | typedef struct |
Kojto | 115:87f2f5183dfb | 1276 | { |
Kojto | 115:87f2f5183dfb | 1277 | int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 1278 | q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
Kojto | 115:87f2f5183dfb | 1279 | q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 1280 | int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
Kojto | 115:87f2f5183dfb | 1281 | |
Kojto | 115:87f2f5183dfb | 1282 | } arm_biquad_casd_df1_inst_q15; |
Kojto | 115:87f2f5183dfb | 1283 | |
Kojto | 115:87f2f5183dfb | 1284 | |
Kojto | 115:87f2f5183dfb | 1285 | /** |
Kojto | 115:87f2f5183dfb | 1286 | * @brief Instance structure for the Q31 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1287 | */ |
Kojto | 115:87f2f5183dfb | 1288 | typedef struct |
Kojto | 115:87f2f5183dfb | 1289 | { |
Kojto | 115:87f2f5183dfb | 1290 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 1291 | q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
Kojto | 115:87f2f5183dfb | 1292 | q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 1293 | uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
Kojto | 115:87f2f5183dfb | 1294 | |
Kojto | 115:87f2f5183dfb | 1295 | } arm_biquad_casd_df1_inst_q31; |
Kojto | 115:87f2f5183dfb | 1296 | |
Kojto | 115:87f2f5183dfb | 1297 | /** |
Kojto | 115:87f2f5183dfb | 1298 | * @brief Instance structure for the floating-point Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1299 | */ |
Kojto | 115:87f2f5183dfb | 1300 | typedef struct |
Kojto | 115:87f2f5183dfb | 1301 | { |
Kojto | 115:87f2f5183dfb | 1302 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 1303 | float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
Kojto | 115:87f2f5183dfb | 1304 | float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 1305 | |
Kojto | 115:87f2f5183dfb | 1306 | |
Kojto | 115:87f2f5183dfb | 1307 | } arm_biquad_casd_df1_inst_f32; |
Kojto | 115:87f2f5183dfb | 1308 | |
Kojto | 115:87f2f5183dfb | 1309 | |
Kojto | 115:87f2f5183dfb | 1310 | |
Kojto | 115:87f2f5183dfb | 1311 | /** |
Kojto | 115:87f2f5183dfb | 1312 | * @brief Processing function for the Q15 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1313 | * @param[in] *S points to an instance of the Q15 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1314 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1315 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1316 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1317 | * @return none. |
Kojto | 115:87f2f5183dfb | 1318 | */ |
Kojto | 115:87f2f5183dfb | 1319 | |
Kojto | 115:87f2f5183dfb | 1320 | void arm_biquad_cascade_df1_q15( |
Kojto | 115:87f2f5183dfb | 1321 | const arm_biquad_casd_df1_inst_q15 * S, |
Kojto | 115:87f2f5183dfb | 1322 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1323 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 1324 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1325 | |
Kojto | 115:87f2f5183dfb | 1326 | /** |
Kojto | 115:87f2f5183dfb | 1327 | * @brief Initialization function for the Q15 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1328 | * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1329 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 1330 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1331 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1332 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
Kojto | 115:87f2f5183dfb | 1333 | * @return none |
Kojto | 115:87f2f5183dfb | 1334 | */ |
Kojto | 115:87f2f5183dfb | 1335 | |
Kojto | 115:87f2f5183dfb | 1336 | void arm_biquad_cascade_df1_init_q15( |
Kojto | 115:87f2f5183dfb | 1337 | arm_biquad_casd_df1_inst_q15 * S, |
Kojto | 115:87f2f5183dfb | 1338 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 1339 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1340 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 1341 | int8_t postShift); |
Kojto | 115:87f2f5183dfb | 1342 | |
Kojto | 115:87f2f5183dfb | 1343 | |
Kojto | 115:87f2f5183dfb | 1344 | /** |
Kojto | 115:87f2f5183dfb | 1345 | * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 1346 | * @param[in] *S points to an instance of the Q15 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1347 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1348 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1349 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1350 | * @return none. |
Kojto | 115:87f2f5183dfb | 1351 | */ |
Kojto | 115:87f2f5183dfb | 1352 | |
Kojto | 115:87f2f5183dfb | 1353 | void arm_biquad_cascade_df1_fast_q15( |
Kojto | 115:87f2f5183dfb | 1354 | const arm_biquad_casd_df1_inst_q15 * S, |
Kojto | 115:87f2f5183dfb | 1355 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1356 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 1357 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1358 | |
Kojto | 115:87f2f5183dfb | 1359 | |
Kojto | 115:87f2f5183dfb | 1360 | /** |
Kojto | 115:87f2f5183dfb | 1361 | * @brief Processing function for the Q31 Biquad cascade filter |
Kojto | 115:87f2f5183dfb | 1362 | * @param[in] *S points to an instance of the Q31 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1363 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1364 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1365 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1366 | * @return none. |
Kojto | 115:87f2f5183dfb | 1367 | */ |
Kojto | 115:87f2f5183dfb | 1368 | |
Kojto | 115:87f2f5183dfb | 1369 | void arm_biquad_cascade_df1_q31( |
Kojto | 115:87f2f5183dfb | 1370 | const arm_biquad_casd_df1_inst_q31 * S, |
Kojto | 115:87f2f5183dfb | 1371 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1372 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 1373 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1374 | |
Kojto | 115:87f2f5183dfb | 1375 | /** |
Kojto | 115:87f2f5183dfb | 1376 | * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 1377 | * @param[in] *S points to an instance of the Q31 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1378 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1379 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1380 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1381 | * @return none. |
Kojto | 115:87f2f5183dfb | 1382 | */ |
Kojto | 115:87f2f5183dfb | 1383 | |
Kojto | 115:87f2f5183dfb | 1384 | void arm_biquad_cascade_df1_fast_q31( |
Kojto | 115:87f2f5183dfb | 1385 | const arm_biquad_casd_df1_inst_q31 * S, |
Kojto | 115:87f2f5183dfb | 1386 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1387 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 1388 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1389 | |
Kojto | 115:87f2f5183dfb | 1390 | /** |
Kojto | 115:87f2f5183dfb | 1391 | * @brief Initialization function for the Q31 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1392 | * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1393 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 1394 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1395 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1396 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
Kojto | 115:87f2f5183dfb | 1397 | * @return none |
Kojto | 115:87f2f5183dfb | 1398 | */ |
Kojto | 115:87f2f5183dfb | 1399 | |
Kojto | 115:87f2f5183dfb | 1400 | void arm_biquad_cascade_df1_init_q31( |
Kojto | 115:87f2f5183dfb | 1401 | arm_biquad_casd_df1_inst_q31 * S, |
Kojto | 115:87f2f5183dfb | 1402 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 1403 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1404 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 1405 | int8_t postShift); |
Kojto | 115:87f2f5183dfb | 1406 | |
Kojto | 115:87f2f5183dfb | 1407 | /** |
Kojto | 115:87f2f5183dfb | 1408 | * @brief Processing function for the floating-point Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1409 | * @param[in] *S points to an instance of the floating-point Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1410 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 1411 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 1412 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 1413 | * @return none. |
Kojto | 115:87f2f5183dfb | 1414 | */ |
Kojto | 115:87f2f5183dfb | 1415 | |
Kojto | 115:87f2f5183dfb | 1416 | void arm_biquad_cascade_df1_f32( |
Kojto | 115:87f2f5183dfb | 1417 | const arm_biquad_casd_df1_inst_f32 * S, |
Kojto | 115:87f2f5183dfb | 1418 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 1419 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 1420 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1421 | |
Kojto | 115:87f2f5183dfb | 1422 | /** |
Kojto | 115:87f2f5183dfb | 1423 | * @brief Initialization function for the floating-point Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 1424 | * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure. |
Kojto | 115:87f2f5183dfb | 1425 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 1426 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 1427 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 1428 | * @return none |
Kojto | 115:87f2f5183dfb | 1429 | */ |
Kojto | 115:87f2f5183dfb | 1430 | |
Kojto | 115:87f2f5183dfb | 1431 | void arm_biquad_cascade_df1_init_f32( |
Kojto | 115:87f2f5183dfb | 1432 | arm_biquad_casd_df1_inst_f32 * S, |
Kojto | 115:87f2f5183dfb | 1433 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 1434 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 1435 | float32_t * pState); |
Kojto | 115:87f2f5183dfb | 1436 | |
Kojto | 115:87f2f5183dfb | 1437 | |
Kojto | 115:87f2f5183dfb | 1438 | /** |
Kojto | 115:87f2f5183dfb | 1439 | * @brief Instance structure for the floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 1440 | */ |
Kojto | 115:87f2f5183dfb | 1441 | |
Kojto | 115:87f2f5183dfb | 1442 | typedef struct |
Kojto | 115:87f2f5183dfb | 1443 | { |
Kojto | 115:87f2f5183dfb | 1444 | uint16_t numRows; /**< number of rows of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1445 | uint16_t numCols; /**< number of columns of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1446 | float32_t *pData; /**< points to the data of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1447 | } arm_matrix_instance_f32; |
Kojto | 115:87f2f5183dfb | 1448 | |
Kojto | 115:87f2f5183dfb | 1449 | |
Kojto | 115:87f2f5183dfb | 1450 | /** |
Kojto | 115:87f2f5183dfb | 1451 | * @brief Instance structure for the floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 1452 | */ |
Kojto | 115:87f2f5183dfb | 1453 | |
Kojto | 115:87f2f5183dfb | 1454 | typedef struct |
Kojto | 115:87f2f5183dfb | 1455 | { |
Kojto | 115:87f2f5183dfb | 1456 | uint16_t numRows; /**< number of rows of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1457 | uint16_t numCols; /**< number of columns of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1458 | float64_t *pData; /**< points to the data of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1459 | } arm_matrix_instance_f64; |
Kojto | 115:87f2f5183dfb | 1460 | |
Kojto | 115:87f2f5183dfb | 1461 | /** |
Kojto | 115:87f2f5183dfb | 1462 | * @brief Instance structure for the Q15 matrix structure. |
Kojto | 115:87f2f5183dfb | 1463 | */ |
Kojto | 115:87f2f5183dfb | 1464 | |
Kojto | 115:87f2f5183dfb | 1465 | typedef struct |
Kojto | 115:87f2f5183dfb | 1466 | { |
Kojto | 115:87f2f5183dfb | 1467 | uint16_t numRows; /**< number of rows of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1468 | uint16_t numCols; /**< number of columns of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1469 | q15_t *pData; /**< points to the data of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1470 | |
Kojto | 115:87f2f5183dfb | 1471 | } arm_matrix_instance_q15; |
Kojto | 115:87f2f5183dfb | 1472 | |
Kojto | 115:87f2f5183dfb | 1473 | /** |
Kojto | 115:87f2f5183dfb | 1474 | * @brief Instance structure for the Q31 matrix structure. |
Kojto | 115:87f2f5183dfb | 1475 | */ |
Kojto | 115:87f2f5183dfb | 1476 | |
Kojto | 115:87f2f5183dfb | 1477 | typedef struct |
Kojto | 115:87f2f5183dfb | 1478 | { |
Kojto | 115:87f2f5183dfb | 1479 | uint16_t numRows; /**< number of rows of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1480 | uint16_t numCols; /**< number of columns of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1481 | q31_t *pData; /**< points to the data of the matrix. */ |
Kojto | 115:87f2f5183dfb | 1482 | |
Kojto | 115:87f2f5183dfb | 1483 | } arm_matrix_instance_q31; |
Kojto | 115:87f2f5183dfb | 1484 | |
Kojto | 115:87f2f5183dfb | 1485 | |
Kojto | 115:87f2f5183dfb | 1486 | |
Kojto | 115:87f2f5183dfb | 1487 | /** |
Kojto | 115:87f2f5183dfb | 1488 | * @brief Floating-point matrix addition. |
Kojto | 115:87f2f5183dfb | 1489 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1490 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1491 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1492 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1493 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1494 | */ |
Kojto | 115:87f2f5183dfb | 1495 | |
Kojto | 115:87f2f5183dfb | 1496 | arm_status arm_mat_add_f32( |
Kojto | 115:87f2f5183dfb | 1497 | const arm_matrix_instance_f32 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1498 | const arm_matrix_instance_f32 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1499 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1500 | |
Kojto | 115:87f2f5183dfb | 1501 | /** |
Kojto | 115:87f2f5183dfb | 1502 | * @brief Q15 matrix addition. |
Kojto | 115:87f2f5183dfb | 1503 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1504 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1505 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1506 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1507 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1508 | */ |
Kojto | 115:87f2f5183dfb | 1509 | |
Kojto | 115:87f2f5183dfb | 1510 | arm_status arm_mat_add_q15( |
Kojto | 115:87f2f5183dfb | 1511 | const arm_matrix_instance_q15 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1512 | const arm_matrix_instance_q15 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1513 | arm_matrix_instance_q15 * pDst); |
Kojto | 115:87f2f5183dfb | 1514 | |
Kojto | 115:87f2f5183dfb | 1515 | /** |
Kojto | 115:87f2f5183dfb | 1516 | * @brief Q31 matrix addition. |
Kojto | 115:87f2f5183dfb | 1517 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1518 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1519 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1520 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1521 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1522 | */ |
Kojto | 115:87f2f5183dfb | 1523 | |
Kojto | 115:87f2f5183dfb | 1524 | arm_status arm_mat_add_q31( |
Kojto | 115:87f2f5183dfb | 1525 | const arm_matrix_instance_q31 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1526 | const arm_matrix_instance_q31 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1527 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1528 | |
Kojto | 115:87f2f5183dfb | 1529 | /** |
Kojto | 115:87f2f5183dfb | 1530 | * @brief Floating-point, complex, matrix multiplication. |
Kojto | 115:87f2f5183dfb | 1531 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1532 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1533 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1534 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1535 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1536 | */ |
Kojto | 115:87f2f5183dfb | 1537 | |
Kojto | 115:87f2f5183dfb | 1538 | arm_status arm_mat_cmplx_mult_f32( |
Kojto | 115:87f2f5183dfb | 1539 | const arm_matrix_instance_f32 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1540 | const arm_matrix_instance_f32 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1541 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1542 | |
Kojto | 115:87f2f5183dfb | 1543 | /** |
Kojto | 115:87f2f5183dfb | 1544 | * @brief Q15, complex, matrix multiplication. |
Kojto | 115:87f2f5183dfb | 1545 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1546 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1547 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1548 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1549 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1550 | */ |
Kojto | 115:87f2f5183dfb | 1551 | |
Kojto | 115:87f2f5183dfb | 1552 | arm_status arm_mat_cmplx_mult_q15( |
Kojto | 115:87f2f5183dfb | 1553 | const arm_matrix_instance_q15 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1554 | const arm_matrix_instance_q15 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1555 | arm_matrix_instance_q15 * pDst, |
Kojto | 115:87f2f5183dfb | 1556 | q15_t * pScratch); |
Kojto | 115:87f2f5183dfb | 1557 | |
Kojto | 115:87f2f5183dfb | 1558 | /** |
Kojto | 115:87f2f5183dfb | 1559 | * @brief Q31, complex, matrix multiplication. |
Kojto | 115:87f2f5183dfb | 1560 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1561 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1562 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1563 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1564 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1565 | */ |
Kojto | 115:87f2f5183dfb | 1566 | |
Kojto | 115:87f2f5183dfb | 1567 | arm_status arm_mat_cmplx_mult_q31( |
Kojto | 115:87f2f5183dfb | 1568 | const arm_matrix_instance_q31 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1569 | const arm_matrix_instance_q31 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1570 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1571 | |
Kojto | 115:87f2f5183dfb | 1572 | |
Kojto | 115:87f2f5183dfb | 1573 | /** |
Kojto | 115:87f2f5183dfb | 1574 | * @brief Floating-point matrix transpose. |
Kojto | 115:87f2f5183dfb | 1575 | * @param[in] *pSrc points to the input matrix |
Kojto | 115:87f2f5183dfb | 1576 | * @param[out] *pDst points to the output matrix |
Kojto | 115:87f2f5183dfb | 1577 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
Kojto | 115:87f2f5183dfb | 1578 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1579 | */ |
Kojto | 115:87f2f5183dfb | 1580 | |
Kojto | 115:87f2f5183dfb | 1581 | arm_status arm_mat_trans_f32( |
Kojto | 115:87f2f5183dfb | 1582 | const arm_matrix_instance_f32 * pSrc, |
Kojto | 115:87f2f5183dfb | 1583 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1584 | |
Kojto | 115:87f2f5183dfb | 1585 | |
Kojto | 115:87f2f5183dfb | 1586 | /** |
Kojto | 115:87f2f5183dfb | 1587 | * @brief Q15 matrix transpose. |
Kojto | 115:87f2f5183dfb | 1588 | * @param[in] *pSrc points to the input matrix |
Kojto | 115:87f2f5183dfb | 1589 | * @param[out] *pDst points to the output matrix |
Kojto | 115:87f2f5183dfb | 1590 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
Kojto | 115:87f2f5183dfb | 1591 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1592 | */ |
Kojto | 115:87f2f5183dfb | 1593 | |
Kojto | 115:87f2f5183dfb | 1594 | arm_status arm_mat_trans_q15( |
Kojto | 115:87f2f5183dfb | 1595 | const arm_matrix_instance_q15 * pSrc, |
Kojto | 115:87f2f5183dfb | 1596 | arm_matrix_instance_q15 * pDst); |
Kojto | 115:87f2f5183dfb | 1597 | |
Kojto | 115:87f2f5183dfb | 1598 | /** |
Kojto | 115:87f2f5183dfb | 1599 | * @brief Q31 matrix transpose. |
Kojto | 115:87f2f5183dfb | 1600 | * @param[in] *pSrc points to the input matrix |
Kojto | 115:87f2f5183dfb | 1601 | * @param[out] *pDst points to the output matrix |
Kojto | 115:87f2f5183dfb | 1602 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
Kojto | 115:87f2f5183dfb | 1603 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1604 | */ |
Kojto | 115:87f2f5183dfb | 1605 | |
Kojto | 115:87f2f5183dfb | 1606 | arm_status arm_mat_trans_q31( |
Kojto | 115:87f2f5183dfb | 1607 | const arm_matrix_instance_q31 * pSrc, |
Kojto | 115:87f2f5183dfb | 1608 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1609 | |
Kojto | 115:87f2f5183dfb | 1610 | |
Kojto | 115:87f2f5183dfb | 1611 | /** |
Kojto | 115:87f2f5183dfb | 1612 | * @brief Floating-point matrix multiplication |
Kojto | 115:87f2f5183dfb | 1613 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1614 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1615 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1616 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1617 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1618 | */ |
Kojto | 115:87f2f5183dfb | 1619 | |
Kojto | 115:87f2f5183dfb | 1620 | arm_status arm_mat_mult_f32( |
Kojto | 115:87f2f5183dfb | 1621 | const arm_matrix_instance_f32 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1622 | const arm_matrix_instance_f32 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1623 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1624 | |
Kojto | 115:87f2f5183dfb | 1625 | /** |
Kojto | 115:87f2f5183dfb | 1626 | * @brief Q15 matrix multiplication |
Kojto | 115:87f2f5183dfb | 1627 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1628 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1629 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1630 | * @param[in] *pState points to the array for storing intermediate results |
Kojto | 115:87f2f5183dfb | 1631 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1632 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1633 | */ |
Kojto | 115:87f2f5183dfb | 1634 | |
Kojto | 115:87f2f5183dfb | 1635 | arm_status arm_mat_mult_q15( |
Kojto | 115:87f2f5183dfb | 1636 | const arm_matrix_instance_q15 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1637 | const arm_matrix_instance_q15 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1638 | arm_matrix_instance_q15 * pDst, |
Kojto | 115:87f2f5183dfb | 1639 | q15_t * pState); |
Kojto | 115:87f2f5183dfb | 1640 | |
Kojto | 115:87f2f5183dfb | 1641 | /** |
Kojto | 115:87f2f5183dfb | 1642 | * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 1643 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1644 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1645 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1646 | * @param[in] *pState points to the array for storing intermediate results |
Kojto | 115:87f2f5183dfb | 1647 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1648 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1649 | */ |
Kojto | 115:87f2f5183dfb | 1650 | |
Kojto | 115:87f2f5183dfb | 1651 | arm_status arm_mat_mult_fast_q15( |
Kojto | 115:87f2f5183dfb | 1652 | const arm_matrix_instance_q15 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1653 | const arm_matrix_instance_q15 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1654 | arm_matrix_instance_q15 * pDst, |
Kojto | 115:87f2f5183dfb | 1655 | q15_t * pState); |
Kojto | 115:87f2f5183dfb | 1656 | |
Kojto | 115:87f2f5183dfb | 1657 | /** |
Kojto | 115:87f2f5183dfb | 1658 | * @brief Q31 matrix multiplication |
Kojto | 115:87f2f5183dfb | 1659 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1660 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1661 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1662 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1663 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1664 | */ |
Kojto | 115:87f2f5183dfb | 1665 | |
Kojto | 115:87f2f5183dfb | 1666 | arm_status arm_mat_mult_q31( |
Kojto | 115:87f2f5183dfb | 1667 | const arm_matrix_instance_q31 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1668 | const arm_matrix_instance_q31 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1669 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1670 | |
Kojto | 115:87f2f5183dfb | 1671 | /** |
Kojto | 115:87f2f5183dfb | 1672 | * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 1673 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1674 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1675 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1676 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1677 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1678 | */ |
Kojto | 115:87f2f5183dfb | 1679 | |
Kojto | 115:87f2f5183dfb | 1680 | arm_status arm_mat_mult_fast_q31( |
Kojto | 115:87f2f5183dfb | 1681 | const arm_matrix_instance_q31 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1682 | const arm_matrix_instance_q31 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1683 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1684 | |
Kojto | 115:87f2f5183dfb | 1685 | |
Kojto | 115:87f2f5183dfb | 1686 | /** |
Kojto | 115:87f2f5183dfb | 1687 | * @brief Floating-point matrix subtraction |
Kojto | 115:87f2f5183dfb | 1688 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1689 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1690 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1691 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1692 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1693 | */ |
Kojto | 115:87f2f5183dfb | 1694 | |
Kojto | 115:87f2f5183dfb | 1695 | arm_status arm_mat_sub_f32( |
Kojto | 115:87f2f5183dfb | 1696 | const arm_matrix_instance_f32 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1697 | const arm_matrix_instance_f32 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1698 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1699 | |
Kojto | 115:87f2f5183dfb | 1700 | /** |
Kojto | 115:87f2f5183dfb | 1701 | * @brief Q15 matrix subtraction |
Kojto | 115:87f2f5183dfb | 1702 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1703 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1704 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1705 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1706 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1707 | */ |
Kojto | 115:87f2f5183dfb | 1708 | |
Kojto | 115:87f2f5183dfb | 1709 | arm_status arm_mat_sub_q15( |
Kojto | 115:87f2f5183dfb | 1710 | const arm_matrix_instance_q15 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1711 | const arm_matrix_instance_q15 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1712 | arm_matrix_instance_q15 * pDst); |
Kojto | 115:87f2f5183dfb | 1713 | |
Kojto | 115:87f2f5183dfb | 1714 | /** |
Kojto | 115:87f2f5183dfb | 1715 | * @brief Q31 matrix subtraction |
Kojto | 115:87f2f5183dfb | 1716 | * @param[in] *pSrcA points to the first input matrix structure |
Kojto | 115:87f2f5183dfb | 1717 | * @param[in] *pSrcB points to the second input matrix structure |
Kojto | 115:87f2f5183dfb | 1718 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1719 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1720 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1721 | */ |
Kojto | 115:87f2f5183dfb | 1722 | |
Kojto | 115:87f2f5183dfb | 1723 | arm_status arm_mat_sub_q31( |
Kojto | 115:87f2f5183dfb | 1724 | const arm_matrix_instance_q31 * pSrcA, |
Kojto | 115:87f2f5183dfb | 1725 | const arm_matrix_instance_q31 * pSrcB, |
Kojto | 115:87f2f5183dfb | 1726 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1727 | |
Kojto | 115:87f2f5183dfb | 1728 | /** |
Kojto | 115:87f2f5183dfb | 1729 | * @brief Floating-point matrix scaling. |
Kojto | 115:87f2f5183dfb | 1730 | * @param[in] *pSrc points to the input matrix |
Kojto | 115:87f2f5183dfb | 1731 | * @param[in] scale scale factor |
Kojto | 115:87f2f5183dfb | 1732 | * @param[out] *pDst points to the output matrix |
Kojto | 115:87f2f5183dfb | 1733 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1734 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1735 | */ |
Kojto | 115:87f2f5183dfb | 1736 | |
Kojto | 115:87f2f5183dfb | 1737 | arm_status arm_mat_scale_f32( |
Kojto | 115:87f2f5183dfb | 1738 | const arm_matrix_instance_f32 * pSrc, |
Kojto | 115:87f2f5183dfb | 1739 | float32_t scale, |
Kojto | 115:87f2f5183dfb | 1740 | arm_matrix_instance_f32 * pDst); |
Kojto | 115:87f2f5183dfb | 1741 | |
Kojto | 115:87f2f5183dfb | 1742 | /** |
Kojto | 115:87f2f5183dfb | 1743 | * @brief Q15 matrix scaling. |
Kojto | 115:87f2f5183dfb | 1744 | * @param[in] *pSrc points to input matrix |
Kojto | 115:87f2f5183dfb | 1745 | * @param[in] scaleFract fractional portion of the scale factor |
Kojto | 115:87f2f5183dfb | 1746 | * @param[in] shift number of bits to shift the result by |
Kojto | 115:87f2f5183dfb | 1747 | * @param[out] *pDst points to output matrix |
Kojto | 115:87f2f5183dfb | 1748 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1749 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1750 | */ |
Kojto | 115:87f2f5183dfb | 1751 | |
Kojto | 115:87f2f5183dfb | 1752 | arm_status arm_mat_scale_q15( |
Kojto | 115:87f2f5183dfb | 1753 | const arm_matrix_instance_q15 * pSrc, |
Kojto | 115:87f2f5183dfb | 1754 | q15_t scaleFract, |
Kojto | 115:87f2f5183dfb | 1755 | int32_t shift, |
Kojto | 115:87f2f5183dfb | 1756 | arm_matrix_instance_q15 * pDst); |
Kojto | 115:87f2f5183dfb | 1757 | |
Kojto | 115:87f2f5183dfb | 1758 | /** |
Kojto | 115:87f2f5183dfb | 1759 | * @brief Q31 matrix scaling. |
Kojto | 115:87f2f5183dfb | 1760 | * @param[in] *pSrc points to input matrix |
Kojto | 115:87f2f5183dfb | 1761 | * @param[in] scaleFract fractional portion of the scale factor |
Kojto | 115:87f2f5183dfb | 1762 | * @param[in] shift number of bits to shift the result by |
Kojto | 115:87f2f5183dfb | 1763 | * @param[out] *pDst points to output matrix structure |
Kojto | 115:87f2f5183dfb | 1764 | * @return The function returns either |
Kojto | 115:87f2f5183dfb | 1765 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
Kojto | 115:87f2f5183dfb | 1766 | */ |
Kojto | 115:87f2f5183dfb | 1767 | |
Kojto | 115:87f2f5183dfb | 1768 | arm_status arm_mat_scale_q31( |
Kojto | 115:87f2f5183dfb | 1769 | const arm_matrix_instance_q31 * pSrc, |
Kojto | 115:87f2f5183dfb | 1770 | q31_t scaleFract, |
Kojto | 115:87f2f5183dfb | 1771 | int32_t shift, |
Kojto | 115:87f2f5183dfb | 1772 | arm_matrix_instance_q31 * pDst); |
Kojto | 115:87f2f5183dfb | 1773 | |
Kojto | 115:87f2f5183dfb | 1774 | |
Kojto | 115:87f2f5183dfb | 1775 | /** |
Kojto | 115:87f2f5183dfb | 1776 | * @brief Q31 matrix initialization. |
Kojto | 115:87f2f5183dfb | 1777 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 1778 | * @param[in] nRows number of rows in the matrix. |
Kojto | 115:87f2f5183dfb | 1779 | * @param[in] nColumns number of columns in the matrix. |
Kojto | 115:87f2f5183dfb | 1780 | * @param[in] *pData points to the matrix data array. |
Kojto | 115:87f2f5183dfb | 1781 | * @return none |
Kojto | 115:87f2f5183dfb | 1782 | */ |
Kojto | 115:87f2f5183dfb | 1783 | |
Kojto | 115:87f2f5183dfb | 1784 | void arm_mat_init_q31( |
Kojto | 115:87f2f5183dfb | 1785 | arm_matrix_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 1786 | uint16_t nRows, |
Kojto | 115:87f2f5183dfb | 1787 | uint16_t nColumns, |
Kojto | 115:87f2f5183dfb | 1788 | q31_t * pData); |
Kojto | 115:87f2f5183dfb | 1789 | |
Kojto | 115:87f2f5183dfb | 1790 | /** |
Kojto | 115:87f2f5183dfb | 1791 | * @brief Q15 matrix initialization. |
Kojto | 115:87f2f5183dfb | 1792 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 1793 | * @param[in] nRows number of rows in the matrix. |
Kojto | 115:87f2f5183dfb | 1794 | * @param[in] nColumns number of columns in the matrix. |
Kojto | 115:87f2f5183dfb | 1795 | * @param[in] *pData points to the matrix data array. |
Kojto | 115:87f2f5183dfb | 1796 | * @return none |
Kojto | 115:87f2f5183dfb | 1797 | */ |
Kojto | 115:87f2f5183dfb | 1798 | |
Kojto | 115:87f2f5183dfb | 1799 | void arm_mat_init_q15( |
Kojto | 115:87f2f5183dfb | 1800 | arm_matrix_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 1801 | uint16_t nRows, |
Kojto | 115:87f2f5183dfb | 1802 | uint16_t nColumns, |
Kojto | 115:87f2f5183dfb | 1803 | q15_t * pData); |
Kojto | 115:87f2f5183dfb | 1804 | |
Kojto | 115:87f2f5183dfb | 1805 | /** |
Kojto | 115:87f2f5183dfb | 1806 | * @brief Floating-point matrix initialization. |
Kojto | 115:87f2f5183dfb | 1807 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 1808 | * @param[in] nRows number of rows in the matrix. |
Kojto | 115:87f2f5183dfb | 1809 | * @param[in] nColumns number of columns in the matrix. |
Kojto | 115:87f2f5183dfb | 1810 | * @param[in] *pData points to the matrix data array. |
Kojto | 115:87f2f5183dfb | 1811 | * @return none |
Kojto | 115:87f2f5183dfb | 1812 | */ |
Kojto | 115:87f2f5183dfb | 1813 | |
Kojto | 115:87f2f5183dfb | 1814 | void arm_mat_init_f32( |
Kojto | 115:87f2f5183dfb | 1815 | arm_matrix_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 1816 | uint16_t nRows, |
Kojto | 115:87f2f5183dfb | 1817 | uint16_t nColumns, |
Kojto | 115:87f2f5183dfb | 1818 | float32_t * pData); |
Kojto | 115:87f2f5183dfb | 1819 | |
Kojto | 115:87f2f5183dfb | 1820 | |
Kojto | 115:87f2f5183dfb | 1821 | |
Kojto | 115:87f2f5183dfb | 1822 | /** |
Kojto | 115:87f2f5183dfb | 1823 | * @brief Instance structure for the Q15 PID Control. |
Kojto | 115:87f2f5183dfb | 1824 | */ |
Kojto | 115:87f2f5183dfb | 1825 | typedef struct |
Kojto | 115:87f2f5183dfb | 1826 | { |
Kojto | 115:87f2f5183dfb | 1827 | q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
Kojto | 115:87f2f5183dfb | 1828 | #ifdef ARM_MATH_CM0_FAMILY |
Kojto | 115:87f2f5183dfb | 1829 | q15_t A1; |
Kojto | 115:87f2f5183dfb | 1830 | q15_t A2; |
Kojto | 115:87f2f5183dfb | 1831 | #else |
Kojto | 115:87f2f5183dfb | 1832 | q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ |
Kojto | 115:87f2f5183dfb | 1833 | #endif |
Kojto | 115:87f2f5183dfb | 1834 | q15_t state[3]; /**< The state array of length 3. */ |
Kojto | 115:87f2f5183dfb | 1835 | q15_t Kp; /**< The proportional gain. */ |
Kojto | 115:87f2f5183dfb | 1836 | q15_t Ki; /**< The integral gain. */ |
Kojto | 115:87f2f5183dfb | 1837 | q15_t Kd; /**< The derivative gain. */ |
Kojto | 115:87f2f5183dfb | 1838 | } arm_pid_instance_q15; |
Kojto | 115:87f2f5183dfb | 1839 | |
Kojto | 115:87f2f5183dfb | 1840 | /** |
Kojto | 115:87f2f5183dfb | 1841 | * @brief Instance structure for the Q31 PID Control. |
Kojto | 115:87f2f5183dfb | 1842 | */ |
Kojto | 115:87f2f5183dfb | 1843 | typedef struct |
Kojto | 115:87f2f5183dfb | 1844 | { |
Kojto | 115:87f2f5183dfb | 1845 | q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
Kojto | 115:87f2f5183dfb | 1846 | q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ |
Kojto | 115:87f2f5183dfb | 1847 | q31_t A2; /**< The derived gain, A2 = Kd . */ |
Kojto | 115:87f2f5183dfb | 1848 | q31_t state[3]; /**< The state array of length 3. */ |
Kojto | 115:87f2f5183dfb | 1849 | q31_t Kp; /**< The proportional gain. */ |
Kojto | 115:87f2f5183dfb | 1850 | q31_t Ki; /**< The integral gain. */ |
Kojto | 115:87f2f5183dfb | 1851 | q31_t Kd; /**< The derivative gain. */ |
Kojto | 115:87f2f5183dfb | 1852 | |
Kojto | 115:87f2f5183dfb | 1853 | } arm_pid_instance_q31; |
Kojto | 115:87f2f5183dfb | 1854 | |
Kojto | 115:87f2f5183dfb | 1855 | /** |
Kojto | 115:87f2f5183dfb | 1856 | * @brief Instance structure for the floating-point PID Control. |
Kojto | 115:87f2f5183dfb | 1857 | */ |
Kojto | 115:87f2f5183dfb | 1858 | typedef struct |
Kojto | 115:87f2f5183dfb | 1859 | { |
Kojto | 115:87f2f5183dfb | 1860 | float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
Kojto | 115:87f2f5183dfb | 1861 | float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ |
Kojto | 115:87f2f5183dfb | 1862 | float32_t A2; /**< The derived gain, A2 = Kd . */ |
Kojto | 115:87f2f5183dfb | 1863 | float32_t state[3]; /**< The state array of length 3. */ |
Kojto | 115:87f2f5183dfb | 1864 | float32_t Kp; /**< The proportional gain. */ |
Kojto | 115:87f2f5183dfb | 1865 | float32_t Ki; /**< The integral gain. */ |
Kojto | 115:87f2f5183dfb | 1866 | float32_t Kd; /**< The derivative gain. */ |
Kojto | 115:87f2f5183dfb | 1867 | } arm_pid_instance_f32; |
Kojto | 115:87f2f5183dfb | 1868 | |
Kojto | 115:87f2f5183dfb | 1869 | |
Kojto | 115:87f2f5183dfb | 1870 | |
Kojto | 115:87f2f5183dfb | 1871 | /** |
Kojto | 115:87f2f5183dfb | 1872 | * @brief Initialization function for the floating-point PID Control. |
Kojto | 115:87f2f5183dfb | 1873 | * @param[in,out] *S points to an instance of the PID structure. |
Kojto | 115:87f2f5183dfb | 1874 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
Kojto | 115:87f2f5183dfb | 1875 | * @return none. |
Kojto | 115:87f2f5183dfb | 1876 | */ |
Kojto | 115:87f2f5183dfb | 1877 | void arm_pid_init_f32( |
Kojto | 115:87f2f5183dfb | 1878 | arm_pid_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 1879 | int32_t resetStateFlag); |
Kojto | 115:87f2f5183dfb | 1880 | |
Kojto | 115:87f2f5183dfb | 1881 | /** |
Kojto | 115:87f2f5183dfb | 1882 | * @brief Reset function for the floating-point PID Control. |
Kojto | 115:87f2f5183dfb | 1883 | * @param[in,out] *S is an instance of the floating-point PID Control structure |
Kojto | 115:87f2f5183dfb | 1884 | * @return none |
Kojto | 115:87f2f5183dfb | 1885 | */ |
Kojto | 115:87f2f5183dfb | 1886 | void arm_pid_reset_f32( |
Kojto | 115:87f2f5183dfb | 1887 | arm_pid_instance_f32 * S); |
Kojto | 115:87f2f5183dfb | 1888 | |
Kojto | 115:87f2f5183dfb | 1889 | |
Kojto | 115:87f2f5183dfb | 1890 | /** |
Kojto | 115:87f2f5183dfb | 1891 | * @brief Initialization function for the Q31 PID Control. |
Kojto | 115:87f2f5183dfb | 1892 | * @param[in,out] *S points to an instance of the Q15 PID structure. |
Kojto | 115:87f2f5183dfb | 1893 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
Kojto | 115:87f2f5183dfb | 1894 | * @return none. |
Kojto | 115:87f2f5183dfb | 1895 | */ |
Kojto | 115:87f2f5183dfb | 1896 | void arm_pid_init_q31( |
Kojto | 115:87f2f5183dfb | 1897 | arm_pid_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 1898 | int32_t resetStateFlag); |
Kojto | 115:87f2f5183dfb | 1899 | |
Kojto | 115:87f2f5183dfb | 1900 | |
Kojto | 115:87f2f5183dfb | 1901 | /** |
Kojto | 115:87f2f5183dfb | 1902 | * @brief Reset function for the Q31 PID Control. |
Kojto | 115:87f2f5183dfb | 1903 | * @param[in,out] *S points to an instance of the Q31 PID Control structure |
Kojto | 115:87f2f5183dfb | 1904 | * @return none |
Kojto | 115:87f2f5183dfb | 1905 | */ |
Kojto | 115:87f2f5183dfb | 1906 | |
Kojto | 115:87f2f5183dfb | 1907 | void arm_pid_reset_q31( |
Kojto | 115:87f2f5183dfb | 1908 | arm_pid_instance_q31 * S); |
Kojto | 115:87f2f5183dfb | 1909 | |
Kojto | 115:87f2f5183dfb | 1910 | /** |
Kojto | 115:87f2f5183dfb | 1911 | * @brief Initialization function for the Q15 PID Control. |
Kojto | 115:87f2f5183dfb | 1912 | * @param[in,out] *S points to an instance of the Q15 PID structure. |
Kojto | 115:87f2f5183dfb | 1913 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
Kojto | 115:87f2f5183dfb | 1914 | * @return none. |
Kojto | 115:87f2f5183dfb | 1915 | */ |
Kojto | 115:87f2f5183dfb | 1916 | void arm_pid_init_q15( |
Kojto | 115:87f2f5183dfb | 1917 | arm_pid_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 1918 | int32_t resetStateFlag); |
Kojto | 115:87f2f5183dfb | 1919 | |
Kojto | 115:87f2f5183dfb | 1920 | /** |
Kojto | 115:87f2f5183dfb | 1921 | * @brief Reset function for the Q15 PID Control. |
Kojto | 115:87f2f5183dfb | 1922 | * @param[in,out] *S points to an instance of the q15 PID Control structure |
Kojto | 115:87f2f5183dfb | 1923 | * @return none |
Kojto | 115:87f2f5183dfb | 1924 | */ |
Kojto | 115:87f2f5183dfb | 1925 | void arm_pid_reset_q15( |
Kojto | 115:87f2f5183dfb | 1926 | arm_pid_instance_q15 * S); |
Kojto | 115:87f2f5183dfb | 1927 | |
Kojto | 115:87f2f5183dfb | 1928 | |
Kojto | 115:87f2f5183dfb | 1929 | /** |
Kojto | 115:87f2f5183dfb | 1930 | * @brief Instance structure for the floating-point Linear Interpolate function. |
Kojto | 115:87f2f5183dfb | 1931 | */ |
Kojto | 115:87f2f5183dfb | 1932 | typedef struct |
Kojto | 115:87f2f5183dfb | 1933 | { |
Kojto | 115:87f2f5183dfb | 1934 | uint32_t nValues; /**< nValues */ |
Kojto | 115:87f2f5183dfb | 1935 | float32_t x1; /**< x1 */ |
Kojto | 115:87f2f5183dfb | 1936 | float32_t xSpacing; /**< xSpacing */ |
Kojto | 115:87f2f5183dfb | 1937 | float32_t *pYData; /**< pointer to the table of Y values */ |
Kojto | 115:87f2f5183dfb | 1938 | } arm_linear_interp_instance_f32; |
Kojto | 115:87f2f5183dfb | 1939 | |
Kojto | 115:87f2f5183dfb | 1940 | /** |
Kojto | 115:87f2f5183dfb | 1941 | * @brief Instance structure for the floating-point bilinear interpolation function. |
Kojto | 115:87f2f5183dfb | 1942 | */ |
Kojto | 115:87f2f5183dfb | 1943 | |
Kojto | 115:87f2f5183dfb | 1944 | typedef struct |
Kojto | 115:87f2f5183dfb | 1945 | { |
Kojto | 115:87f2f5183dfb | 1946 | uint16_t numRows; /**< number of rows in the data table. */ |
Kojto | 115:87f2f5183dfb | 1947 | uint16_t numCols; /**< number of columns in the data table. */ |
Kojto | 115:87f2f5183dfb | 1948 | float32_t *pData; /**< points to the data table. */ |
Kojto | 115:87f2f5183dfb | 1949 | } arm_bilinear_interp_instance_f32; |
Kojto | 115:87f2f5183dfb | 1950 | |
Kojto | 115:87f2f5183dfb | 1951 | /** |
Kojto | 115:87f2f5183dfb | 1952 | * @brief Instance structure for the Q31 bilinear interpolation function. |
Kojto | 115:87f2f5183dfb | 1953 | */ |
Kojto | 115:87f2f5183dfb | 1954 | |
Kojto | 115:87f2f5183dfb | 1955 | typedef struct |
Kojto | 115:87f2f5183dfb | 1956 | { |
Kojto | 115:87f2f5183dfb | 1957 | uint16_t numRows; /**< number of rows in the data table. */ |
Kojto | 115:87f2f5183dfb | 1958 | uint16_t numCols; /**< number of columns in the data table. */ |
Kojto | 115:87f2f5183dfb | 1959 | q31_t *pData; /**< points to the data table. */ |
Kojto | 115:87f2f5183dfb | 1960 | } arm_bilinear_interp_instance_q31; |
Kojto | 115:87f2f5183dfb | 1961 | |
Kojto | 115:87f2f5183dfb | 1962 | /** |
Kojto | 115:87f2f5183dfb | 1963 | * @brief Instance structure for the Q15 bilinear interpolation function. |
Kojto | 115:87f2f5183dfb | 1964 | */ |
Kojto | 115:87f2f5183dfb | 1965 | |
Kojto | 115:87f2f5183dfb | 1966 | typedef struct |
Kojto | 115:87f2f5183dfb | 1967 | { |
Kojto | 115:87f2f5183dfb | 1968 | uint16_t numRows; /**< number of rows in the data table. */ |
Kojto | 115:87f2f5183dfb | 1969 | uint16_t numCols; /**< number of columns in the data table. */ |
Kojto | 115:87f2f5183dfb | 1970 | q15_t *pData; /**< points to the data table. */ |
Kojto | 115:87f2f5183dfb | 1971 | } arm_bilinear_interp_instance_q15; |
Kojto | 115:87f2f5183dfb | 1972 | |
Kojto | 115:87f2f5183dfb | 1973 | /** |
Kojto | 115:87f2f5183dfb | 1974 | * @brief Instance structure for the Q15 bilinear interpolation function. |
Kojto | 115:87f2f5183dfb | 1975 | */ |
Kojto | 115:87f2f5183dfb | 1976 | |
Kojto | 115:87f2f5183dfb | 1977 | typedef struct |
Kojto | 115:87f2f5183dfb | 1978 | { |
Kojto | 115:87f2f5183dfb | 1979 | uint16_t numRows; /**< number of rows in the data table. */ |
Kojto | 115:87f2f5183dfb | 1980 | uint16_t numCols; /**< number of columns in the data table. */ |
Kojto | 115:87f2f5183dfb | 1981 | q7_t *pData; /**< points to the data table. */ |
Kojto | 115:87f2f5183dfb | 1982 | } arm_bilinear_interp_instance_q7; |
Kojto | 115:87f2f5183dfb | 1983 | |
Kojto | 115:87f2f5183dfb | 1984 | |
Kojto | 115:87f2f5183dfb | 1985 | /** |
Kojto | 115:87f2f5183dfb | 1986 | * @brief Q7 vector multiplication. |
Kojto | 115:87f2f5183dfb | 1987 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 1988 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 1989 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 1990 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 1991 | * @return none. |
Kojto | 115:87f2f5183dfb | 1992 | */ |
Kojto | 115:87f2f5183dfb | 1993 | |
Kojto | 115:87f2f5183dfb | 1994 | void arm_mult_q7( |
Kojto | 115:87f2f5183dfb | 1995 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 1996 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 1997 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 1998 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 1999 | |
Kojto | 115:87f2f5183dfb | 2000 | /** |
Kojto | 115:87f2f5183dfb | 2001 | * @brief Q15 vector multiplication. |
Kojto | 115:87f2f5183dfb | 2002 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2003 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2004 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2005 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2006 | * @return none. |
Kojto | 115:87f2f5183dfb | 2007 | */ |
Kojto | 115:87f2f5183dfb | 2008 | |
Kojto | 115:87f2f5183dfb | 2009 | void arm_mult_q15( |
Kojto | 115:87f2f5183dfb | 2010 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2011 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2012 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2013 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2014 | |
Kojto | 115:87f2f5183dfb | 2015 | /** |
Kojto | 115:87f2f5183dfb | 2016 | * @brief Q31 vector multiplication. |
Kojto | 115:87f2f5183dfb | 2017 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2018 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2019 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2020 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2021 | * @return none. |
Kojto | 115:87f2f5183dfb | 2022 | */ |
Kojto | 115:87f2f5183dfb | 2023 | |
Kojto | 115:87f2f5183dfb | 2024 | void arm_mult_q31( |
Kojto | 115:87f2f5183dfb | 2025 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2026 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2027 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2028 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2029 | |
Kojto | 115:87f2f5183dfb | 2030 | /** |
Kojto | 115:87f2f5183dfb | 2031 | * @brief Floating-point vector multiplication. |
Kojto | 115:87f2f5183dfb | 2032 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2033 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2034 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2035 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2036 | * @return none. |
Kojto | 115:87f2f5183dfb | 2037 | */ |
Kojto | 115:87f2f5183dfb | 2038 | |
Kojto | 115:87f2f5183dfb | 2039 | void arm_mult_f32( |
Kojto | 115:87f2f5183dfb | 2040 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2041 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2042 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2043 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2044 | |
Kojto | 115:87f2f5183dfb | 2045 | |
Kojto | 115:87f2f5183dfb | 2046 | |
Kojto | 115:87f2f5183dfb | 2047 | |
Kojto | 115:87f2f5183dfb | 2048 | |
Kojto | 115:87f2f5183dfb | 2049 | |
Kojto | 115:87f2f5183dfb | 2050 | /** |
Kojto | 115:87f2f5183dfb | 2051 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2052 | */ |
Kojto | 115:87f2f5183dfb | 2053 | |
Kojto | 115:87f2f5183dfb | 2054 | typedef struct |
Kojto | 115:87f2f5183dfb | 2055 | { |
Kojto | 115:87f2f5183dfb | 2056 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2057 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2058 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2059 | q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2060 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2061 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2062 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2063 | } arm_cfft_radix2_instance_q15; |
Kojto | 115:87f2f5183dfb | 2064 | |
Kojto | 115:87f2f5183dfb | 2065 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2066 | arm_status arm_cfft_radix2_init_q15( |
Kojto | 115:87f2f5183dfb | 2067 | arm_cfft_radix2_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2068 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2069 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2070 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2071 | |
Kojto | 115:87f2f5183dfb | 2072 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2073 | void arm_cfft_radix2_q15( |
Kojto | 115:87f2f5183dfb | 2074 | const arm_cfft_radix2_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2075 | q15_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2076 | |
Kojto | 115:87f2f5183dfb | 2077 | |
Kojto | 115:87f2f5183dfb | 2078 | |
Kojto | 115:87f2f5183dfb | 2079 | /** |
Kojto | 115:87f2f5183dfb | 2080 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2081 | */ |
Kojto | 115:87f2f5183dfb | 2082 | |
Kojto | 115:87f2f5183dfb | 2083 | typedef struct |
Kojto | 115:87f2f5183dfb | 2084 | { |
Kojto | 115:87f2f5183dfb | 2085 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2086 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2087 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2088 | q15_t *pTwiddle; /**< points to the twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2089 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2090 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2091 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2092 | } arm_cfft_radix4_instance_q15; |
Kojto | 115:87f2f5183dfb | 2093 | |
Kojto | 115:87f2f5183dfb | 2094 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2095 | arm_status arm_cfft_radix4_init_q15( |
Kojto | 115:87f2f5183dfb | 2096 | arm_cfft_radix4_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2097 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2098 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2099 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2100 | |
Kojto | 115:87f2f5183dfb | 2101 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2102 | void arm_cfft_radix4_q15( |
Kojto | 115:87f2f5183dfb | 2103 | const arm_cfft_radix4_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2104 | q15_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2105 | |
Kojto | 115:87f2f5183dfb | 2106 | /** |
Kojto | 115:87f2f5183dfb | 2107 | * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2108 | */ |
Kojto | 115:87f2f5183dfb | 2109 | |
Kojto | 115:87f2f5183dfb | 2110 | typedef struct |
Kojto | 115:87f2f5183dfb | 2111 | { |
Kojto | 115:87f2f5183dfb | 2112 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2113 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2114 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2115 | q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2116 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2117 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2118 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2119 | } arm_cfft_radix2_instance_q31; |
Kojto | 115:87f2f5183dfb | 2120 | |
Kojto | 115:87f2f5183dfb | 2121 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2122 | arm_status arm_cfft_radix2_init_q31( |
Kojto | 115:87f2f5183dfb | 2123 | arm_cfft_radix2_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2124 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2125 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2126 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2127 | |
Kojto | 115:87f2f5183dfb | 2128 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2129 | void arm_cfft_radix2_q31( |
Kojto | 115:87f2f5183dfb | 2130 | const arm_cfft_radix2_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2131 | q31_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2132 | |
Kojto | 115:87f2f5183dfb | 2133 | /** |
Kojto | 115:87f2f5183dfb | 2134 | * @brief Instance structure for the Q31 CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2135 | */ |
Kojto | 115:87f2f5183dfb | 2136 | |
Kojto | 115:87f2f5183dfb | 2137 | typedef struct |
Kojto | 115:87f2f5183dfb | 2138 | { |
Kojto | 115:87f2f5183dfb | 2139 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2140 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2141 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2142 | q31_t *pTwiddle; /**< points to the twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2143 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2144 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2145 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2146 | } arm_cfft_radix4_instance_q31; |
Kojto | 115:87f2f5183dfb | 2147 | |
Kojto | 115:87f2f5183dfb | 2148 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2149 | void arm_cfft_radix4_q31( |
Kojto | 115:87f2f5183dfb | 2150 | const arm_cfft_radix4_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2151 | q31_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2152 | |
Kojto | 115:87f2f5183dfb | 2153 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2154 | arm_status arm_cfft_radix4_init_q31( |
Kojto | 115:87f2f5183dfb | 2155 | arm_cfft_radix4_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2156 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2157 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2158 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2159 | |
Kojto | 115:87f2f5183dfb | 2160 | /** |
Kojto | 115:87f2f5183dfb | 2161 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2162 | */ |
Kojto | 115:87f2f5183dfb | 2163 | |
Kojto | 115:87f2f5183dfb | 2164 | typedef struct |
Kojto | 115:87f2f5183dfb | 2165 | { |
Kojto | 115:87f2f5183dfb | 2166 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2167 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2168 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2169 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2170 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2171 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2172 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2173 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
Kojto | 115:87f2f5183dfb | 2174 | } arm_cfft_radix2_instance_f32; |
Kojto | 115:87f2f5183dfb | 2175 | |
Kojto | 115:87f2f5183dfb | 2176 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2177 | arm_status arm_cfft_radix2_init_f32( |
Kojto | 115:87f2f5183dfb | 2178 | arm_cfft_radix2_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2179 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2180 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2181 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2182 | |
Kojto | 115:87f2f5183dfb | 2183 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2184 | void arm_cfft_radix2_f32( |
Kojto | 115:87f2f5183dfb | 2185 | const arm_cfft_radix2_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2186 | float32_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2187 | |
Kojto | 115:87f2f5183dfb | 2188 | /** |
Kojto | 115:87f2f5183dfb | 2189 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2190 | */ |
Kojto | 115:87f2f5183dfb | 2191 | |
Kojto | 115:87f2f5183dfb | 2192 | typedef struct |
Kojto | 115:87f2f5183dfb | 2193 | { |
Kojto | 115:87f2f5183dfb | 2194 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2195 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2196 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2197 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2198 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2199 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2200 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2201 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
Kojto | 115:87f2f5183dfb | 2202 | } arm_cfft_radix4_instance_f32; |
Kojto | 115:87f2f5183dfb | 2203 | |
Kojto | 115:87f2f5183dfb | 2204 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2205 | arm_status arm_cfft_radix4_init_f32( |
Kojto | 115:87f2f5183dfb | 2206 | arm_cfft_radix4_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2207 | uint16_t fftLen, |
Kojto | 115:87f2f5183dfb | 2208 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2209 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2210 | |
Kojto | 115:87f2f5183dfb | 2211 | /* Deprecated */ |
Kojto | 115:87f2f5183dfb | 2212 | void arm_cfft_radix4_f32( |
Kojto | 115:87f2f5183dfb | 2213 | const arm_cfft_radix4_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2214 | float32_t * pSrc); |
Kojto | 115:87f2f5183dfb | 2215 | |
Kojto | 115:87f2f5183dfb | 2216 | /** |
Kojto | 115:87f2f5183dfb | 2217 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2218 | */ |
Kojto | 115:87f2f5183dfb | 2219 | |
Kojto | 115:87f2f5183dfb | 2220 | typedef struct |
Kojto | 115:87f2f5183dfb | 2221 | { |
Kojto | 115:87f2f5183dfb | 2222 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2223 | const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2224 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2225 | uint16_t bitRevLength; /**< bit reversal table length. */ |
Kojto | 115:87f2f5183dfb | 2226 | } arm_cfft_instance_q15; |
Kojto | 115:87f2f5183dfb | 2227 | |
Kojto | 115:87f2f5183dfb | 2228 | void arm_cfft_q15( |
Kojto | 115:87f2f5183dfb | 2229 | const arm_cfft_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2230 | q15_t * p1, |
Kojto | 115:87f2f5183dfb | 2231 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2232 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2233 | |
Kojto | 115:87f2f5183dfb | 2234 | /** |
Kojto | 115:87f2f5183dfb | 2235 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2236 | */ |
Kojto | 115:87f2f5183dfb | 2237 | |
Kojto | 115:87f2f5183dfb | 2238 | typedef struct |
Kojto | 115:87f2f5183dfb | 2239 | { |
Kojto | 115:87f2f5183dfb | 2240 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2241 | const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2242 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2243 | uint16_t bitRevLength; /**< bit reversal table length. */ |
Kojto | 115:87f2f5183dfb | 2244 | } arm_cfft_instance_q31; |
Kojto | 115:87f2f5183dfb | 2245 | |
Kojto | 115:87f2f5183dfb | 2246 | void arm_cfft_q31( |
Kojto | 115:87f2f5183dfb | 2247 | const arm_cfft_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2248 | q31_t * p1, |
Kojto | 115:87f2f5183dfb | 2249 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2250 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2251 | |
Kojto | 115:87f2f5183dfb | 2252 | /** |
Kojto | 115:87f2f5183dfb | 2253 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
Kojto | 115:87f2f5183dfb | 2254 | */ |
Kojto | 115:87f2f5183dfb | 2255 | |
Kojto | 115:87f2f5183dfb | 2256 | typedef struct |
Kojto | 115:87f2f5183dfb | 2257 | { |
Kojto | 115:87f2f5183dfb | 2258 | uint16_t fftLen; /**< length of the FFT. */ |
Kojto | 115:87f2f5183dfb | 2259 | const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2260 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Kojto | 115:87f2f5183dfb | 2261 | uint16_t bitRevLength; /**< bit reversal table length. */ |
Kojto | 115:87f2f5183dfb | 2262 | } arm_cfft_instance_f32; |
Kojto | 115:87f2f5183dfb | 2263 | |
Kojto | 115:87f2f5183dfb | 2264 | void arm_cfft_f32( |
Kojto | 115:87f2f5183dfb | 2265 | const arm_cfft_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2266 | float32_t * p1, |
Kojto | 115:87f2f5183dfb | 2267 | uint8_t ifftFlag, |
Kojto | 115:87f2f5183dfb | 2268 | uint8_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2269 | |
Kojto | 115:87f2f5183dfb | 2270 | /** |
Kojto | 115:87f2f5183dfb | 2271 | * @brief Instance structure for the Q15 RFFT/RIFFT function. |
Kojto | 115:87f2f5183dfb | 2272 | */ |
Kojto | 115:87f2f5183dfb | 2273 | |
Kojto | 115:87f2f5183dfb | 2274 | typedef struct |
Kojto | 115:87f2f5183dfb | 2275 | { |
Kojto | 115:87f2f5183dfb | 2276 | uint32_t fftLenReal; /**< length of the real FFT. */ |
Kojto | 115:87f2f5183dfb | 2277 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2278 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2279 | uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2280 | q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2281 | q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2282 | const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2283 | } arm_rfft_instance_q15; |
Kojto | 115:87f2f5183dfb | 2284 | |
Kojto | 115:87f2f5183dfb | 2285 | arm_status arm_rfft_init_q15( |
Kojto | 115:87f2f5183dfb | 2286 | arm_rfft_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2287 | uint32_t fftLenReal, |
Kojto | 115:87f2f5183dfb | 2288 | uint32_t ifftFlagR, |
Kojto | 115:87f2f5183dfb | 2289 | uint32_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2290 | |
Kojto | 115:87f2f5183dfb | 2291 | void arm_rfft_q15( |
Kojto | 115:87f2f5183dfb | 2292 | const arm_rfft_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2293 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2294 | q15_t * pDst); |
Kojto | 115:87f2f5183dfb | 2295 | |
Kojto | 115:87f2f5183dfb | 2296 | /** |
Kojto | 115:87f2f5183dfb | 2297 | * @brief Instance structure for the Q31 RFFT/RIFFT function. |
Kojto | 115:87f2f5183dfb | 2298 | */ |
Kojto | 115:87f2f5183dfb | 2299 | |
Kojto | 115:87f2f5183dfb | 2300 | typedef struct |
Kojto | 115:87f2f5183dfb | 2301 | { |
Kojto | 115:87f2f5183dfb | 2302 | uint32_t fftLenReal; /**< length of the real FFT. */ |
Kojto | 115:87f2f5183dfb | 2303 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2304 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2305 | uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2306 | q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2307 | q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2308 | const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2309 | } arm_rfft_instance_q31; |
Kojto | 115:87f2f5183dfb | 2310 | |
Kojto | 115:87f2f5183dfb | 2311 | arm_status arm_rfft_init_q31( |
Kojto | 115:87f2f5183dfb | 2312 | arm_rfft_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2313 | uint32_t fftLenReal, |
Kojto | 115:87f2f5183dfb | 2314 | uint32_t ifftFlagR, |
Kojto | 115:87f2f5183dfb | 2315 | uint32_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2316 | |
Kojto | 115:87f2f5183dfb | 2317 | void arm_rfft_q31( |
Kojto | 115:87f2f5183dfb | 2318 | const arm_rfft_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2319 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2320 | q31_t * pDst); |
Kojto | 115:87f2f5183dfb | 2321 | |
Kojto | 115:87f2f5183dfb | 2322 | /** |
Kojto | 115:87f2f5183dfb | 2323 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
Kojto | 115:87f2f5183dfb | 2324 | */ |
Kojto | 115:87f2f5183dfb | 2325 | |
Kojto | 115:87f2f5183dfb | 2326 | typedef struct |
Kojto | 115:87f2f5183dfb | 2327 | { |
Kojto | 115:87f2f5183dfb | 2328 | uint32_t fftLenReal; /**< length of the real FFT. */ |
Kojto | 115:87f2f5183dfb | 2329 | uint16_t fftLenBy2; /**< length of the complex FFT. */ |
Kojto | 115:87f2f5183dfb | 2330 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
Kojto | 115:87f2f5183dfb | 2331 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
Kojto | 115:87f2f5183dfb | 2332 | uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2333 | float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2334 | float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2335 | arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2336 | } arm_rfft_instance_f32; |
Kojto | 115:87f2f5183dfb | 2337 | |
Kojto | 115:87f2f5183dfb | 2338 | arm_status arm_rfft_init_f32( |
Kojto | 115:87f2f5183dfb | 2339 | arm_rfft_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2340 | arm_cfft_radix4_instance_f32 * S_CFFT, |
Kojto | 115:87f2f5183dfb | 2341 | uint32_t fftLenReal, |
Kojto | 115:87f2f5183dfb | 2342 | uint32_t ifftFlagR, |
Kojto | 115:87f2f5183dfb | 2343 | uint32_t bitReverseFlag); |
Kojto | 115:87f2f5183dfb | 2344 | |
Kojto | 115:87f2f5183dfb | 2345 | void arm_rfft_f32( |
Kojto | 115:87f2f5183dfb | 2346 | const arm_rfft_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2347 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2348 | float32_t * pDst); |
Kojto | 115:87f2f5183dfb | 2349 | |
Kojto | 115:87f2f5183dfb | 2350 | /** |
Kojto | 115:87f2f5183dfb | 2351 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
Kojto | 115:87f2f5183dfb | 2352 | */ |
Kojto | 115:87f2f5183dfb | 2353 | |
Kojto | 115:87f2f5183dfb | 2354 | typedef struct |
Kojto | 115:87f2f5183dfb | 2355 | { |
Kojto | 115:87f2f5183dfb | 2356 | arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ |
Kojto | 115:87f2f5183dfb | 2357 | uint16_t fftLenRFFT; /**< length of the real sequence */ |
Kojto | 115:87f2f5183dfb | 2358 | float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ |
Kojto | 115:87f2f5183dfb | 2359 | } arm_rfft_fast_instance_f32 ; |
Kojto | 115:87f2f5183dfb | 2360 | |
Kojto | 115:87f2f5183dfb | 2361 | arm_status arm_rfft_fast_init_f32 ( |
Kojto | 115:87f2f5183dfb | 2362 | arm_rfft_fast_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2363 | uint16_t fftLen); |
Kojto | 115:87f2f5183dfb | 2364 | |
Kojto | 115:87f2f5183dfb | 2365 | void arm_rfft_fast_f32( |
Kojto | 115:87f2f5183dfb | 2366 | arm_rfft_fast_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2367 | float32_t * p, float32_t * pOut, |
Kojto | 115:87f2f5183dfb | 2368 | uint8_t ifftFlag); |
Kojto | 115:87f2f5183dfb | 2369 | |
Kojto | 115:87f2f5183dfb | 2370 | /** |
Kojto | 115:87f2f5183dfb | 2371 | * @brief Instance structure for the floating-point DCT4/IDCT4 function. |
Kojto | 115:87f2f5183dfb | 2372 | */ |
Kojto | 115:87f2f5183dfb | 2373 | |
Kojto | 115:87f2f5183dfb | 2374 | typedef struct |
Kojto | 115:87f2f5183dfb | 2375 | { |
Kojto | 115:87f2f5183dfb | 2376 | uint16_t N; /**< length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2377 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2378 | float32_t normalize; /**< normalizing factor. */ |
Kojto | 115:87f2f5183dfb | 2379 | float32_t *pTwiddle; /**< points to the twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2380 | float32_t *pCosFactor; /**< points to the cosFactor table. */ |
Kojto | 115:87f2f5183dfb | 2381 | arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2382 | arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2383 | } arm_dct4_instance_f32; |
Kojto | 115:87f2f5183dfb | 2384 | |
Kojto | 115:87f2f5183dfb | 2385 | /** |
Kojto | 115:87f2f5183dfb | 2386 | * @brief Initialization function for the floating-point DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2387 | * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure. |
Kojto | 115:87f2f5183dfb | 2388 | * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure. |
Kojto | 115:87f2f5183dfb | 2389 | * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure. |
Kojto | 115:87f2f5183dfb | 2390 | * @param[in] N length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2391 | * @param[in] Nby2 half of the length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2392 | * @param[in] normalize normalizing factor. |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 2394 | */ |
Kojto | 115:87f2f5183dfb | 2395 | |
Kojto | 115:87f2f5183dfb | 2396 | arm_status arm_dct4_init_f32( |
Kojto | 115:87f2f5183dfb | 2397 | arm_dct4_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2398 | arm_rfft_instance_f32 * S_RFFT, |
Kojto | 115:87f2f5183dfb | 2399 | arm_cfft_radix4_instance_f32 * S_CFFT, |
Kojto | 115:87f2f5183dfb | 2400 | uint16_t N, |
Kojto | 115:87f2f5183dfb | 2401 | uint16_t Nby2, |
Kojto | 115:87f2f5183dfb | 2402 | float32_t normalize); |
Kojto | 115:87f2f5183dfb | 2403 | |
Kojto | 115:87f2f5183dfb | 2404 | /** |
Kojto | 115:87f2f5183dfb | 2405 | * @brief Processing function for the floating-point DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2406 | * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure. |
Kojto | 115:87f2f5183dfb | 2407 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 2408 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
Kojto | 115:87f2f5183dfb | 2409 | * @return none. |
Kojto | 115:87f2f5183dfb | 2410 | */ |
Kojto | 115:87f2f5183dfb | 2411 | |
Kojto | 115:87f2f5183dfb | 2412 | void arm_dct4_f32( |
Kojto | 115:87f2f5183dfb | 2413 | const arm_dct4_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 2414 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 2415 | float32_t * pInlineBuffer); |
Kojto | 115:87f2f5183dfb | 2416 | |
Kojto | 115:87f2f5183dfb | 2417 | /** |
Kojto | 115:87f2f5183dfb | 2418 | * @brief Instance structure for the Q31 DCT4/IDCT4 function. |
Kojto | 115:87f2f5183dfb | 2419 | */ |
Kojto | 115:87f2f5183dfb | 2420 | |
Kojto | 115:87f2f5183dfb | 2421 | typedef struct |
Kojto | 115:87f2f5183dfb | 2422 | { |
Kojto | 115:87f2f5183dfb | 2423 | uint16_t N; /**< length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2424 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2425 | q31_t normalize; /**< normalizing factor. */ |
Kojto | 115:87f2f5183dfb | 2426 | q31_t *pTwiddle; /**< points to the twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2427 | q31_t *pCosFactor; /**< points to the cosFactor table. */ |
Kojto | 115:87f2f5183dfb | 2428 | arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2429 | arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2430 | } arm_dct4_instance_q31; |
Kojto | 115:87f2f5183dfb | 2431 | |
Kojto | 115:87f2f5183dfb | 2432 | /** |
Kojto | 115:87f2f5183dfb | 2433 | * @brief Initialization function for the Q31 DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2434 | * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure. |
Kojto | 115:87f2f5183dfb | 2435 | * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure |
Kojto | 115:87f2f5183dfb | 2436 | * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure |
Kojto | 115:87f2f5183dfb | 2437 | * @param[in] N length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2438 | * @param[in] Nby2 half of the length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2439 | * @param[in] normalize normalizing factor. |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 2441 | */ |
Kojto | 115:87f2f5183dfb | 2442 | |
Kojto | 115:87f2f5183dfb | 2443 | arm_status arm_dct4_init_q31( |
Kojto | 115:87f2f5183dfb | 2444 | arm_dct4_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2445 | arm_rfft_instance_q31 * S_RFFT, |
Kojto | 115:87f2f5183dfb | 2446 | arm_cfft_radix4_instance_q31 * S_CFFT, |
Kojto | 115:87f2f5183dfb | 2447 | uint16_t N, |
Kojto | 115:87f2f5183dfb | 2448 | uint16_t Nby2, |
Kojto | 115:87f2f5183dfb | 2449 | q31_t normalize); |
Kojto | 115:87f2f5183dfb | 2450 | |
Kojto | 115:87f2f5183dfb | 2451 | /** |
Kojto | 115:87f2f5183dfb | 2452 | * @brief Processing function for the Q31 DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2453 | * @param[in] *S points to an instance of the Q31 DCT4 structure. |
Kojto | 115:87f2f5183dfb | 2454 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 2455 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
Kojto | 115:87f2f5183dfb | 2456 | * @return none. |
Kojto | 115:87f2f5183dfb | 2457 | */ |
Kojto | 115:87f2f5183dfb | 2458 | |
Kojto | 115:87f2f5183dfb | 2459 | void arm_dct4_q31( |
Kojto | 115:87f2f5183dfb | 2460 | const arm_dct4_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 2461 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 2462 | q31_t * pInlineBuffer); |
Kojto | 115:87f2f5183dfb | 2463 | |
Kojto | 115:87f2f5183dfb | 2464 | /** |
Kojto | 115:87f2f5183dfb | 2465 | * @brief Instance structure for the Q15 DCT4/IDCT4 function. |
Kojto | 115:87f2f5183dfb | 2466 | */ |
Kojto | 115:87f2f5183dfb | 2467 | |
Kojto | 115:87f2f5183dfb | 2468 | typedef struct |
Kojto | 115:87f2f5183dfb | 2469 | { |
Kojto | 115:87f2f5183dfb | 2470 | uint16_t N; /**< length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2471 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
Kojto | 115:87f2f5183dfb | 2472 | q15_t normalize; /**< normalizing factor. */ |
Kojto | 115:87f2f5183dfb | 2473 | q15_t *pTwiddle; /**< points to the twiddle factor table. */ |
Kojto | 115:87f2f5183dfb | 2474 | q15_t *pCosFactor; /**< points to the cosFactor table. */ |
Kojto | 115:87f2f5183dfb | 2475 | arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2476 | arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ |
Kojto | 115:87f2f5183dfb | 2477 | } arm_dct4_instance_q15; |
Kojto | 115:87f2f5183dfb | 2478 | |
Kojto | 115:87f2f5183dfb | 2479 | /** |
Kojto | 115:87f2f5183dfb | 2480 | * @brief Initialization function for the Q15 DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2481 | * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure. |
Kojto | 115:87f2f5183dfb | 2482 | * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure. |
Kojto | 115:87f2f5183dfb | 2483 | * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure. |
Kojto | 115:87f2f5183dfb | 2484 | * @param[in] N length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2485 | * @param[in] Nby2 half of the length of the DCT4. |
Kojto | 115:87f2f5183dfb | 2486 | * @param[in] normalize normalizing factor. |
Kojto | 115:87f2f5183dfb | 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. |
Kojto | 115:87f2f5183dfb | 2488 | */ |
Kojto | 115:87f2f5183dfb | 2489 | |
Kojto | 115:87f2f5183dfb | 2490 | arm_status arm_dct4_init_q15( |
Kojto | 115:87f2f5183dfb | 2491 | arm_dct4_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2492 | arm_rfft_instance_q15 * S_RFFT, |
Kojto | 115:87f2f5183dfb | 2493 | arm_cfft_radix4_instance_q15 * S_CFFT, |
Kojto | 115:87f2f5183dfb | 2494 | uint16_t N, |
Kojto | 115:87f2f5183dfb | 2495 | uint16_t Nby2, |
Kojto | 115:87f2f5183dfb | 2496 | q15_t normalize); |
Kojto | 115:87f2f5183dfb | 2497 | |
Kojto | 115:87f2f5183dfb | 2498 | /** |
Kojto | 115:87f2f5183dfb | 2499 | * @brief Processing function for the Q15 DCT4/IDCT4. |
Kojto | 115:87f2f5183dfb | 2500 | * @param[in] *S points to an instance of the Q15 DCT4 structure. |
Kojto | 115:87f2f5183dfb | 2501 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 2502 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
Kojto | 115:87f2f5183dfb | 2503 | * @return none. |
Kojto | 115:87f2f5183dfb | 2504 | */ |
Kojto | 115:87f2f5183dfb | 2505 | |
Kojto | 115:87f2f5183dfb | 2506 | void arm_dct4_q15( |
Kojto | 115:87f2f5183dfb | 2507 | const arm_dct4_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 2508 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 2509 | q15_t * pInlineBuffer); |
Kojto | 115:87f2f5183dfb | 2510 | |
Kojto | 115:87f2f5183dfb | 2511 | /** |
Kojto | 115:87f2f5183dfb | 2512 | * @brief Floating-point vector addition. |
Kojto | 115:87f2f5183dfb | 2513 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2514 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2515 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2516 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2517 | * @return none. |
Kojto | 115:87f2f5183dfb | 2518 | */ |
Kojto | 115:87f2f5183dfb | 2519 | |
Kojto | 115:87f2f5183dfb | 2520 | void arm_add_f32( |
Kojto | 115:87f2f5183dfb | 2521 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2522 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2523 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2524 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2525 | |
Kojto | 115:87f2f5183dfb | 2526 | /** |
Kojto | 115:87f2f5183dfb | 2527 | * @brief Q7 vector addition. |
Kojto | 115:87f2f5183dfb | 2528 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2529 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2530 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2531 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2532 | * @return none. |
Kojto | 115:87f2f5183dfb | 2533 | */ |
Kojto | 115:87f2f5183dfb | 2534 | |
Kojto | 115:87f2f5183dfb | 2535 | void arm_add_q7( |
Kojto | 115:87f2f5183dfb | 2536 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2537 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2538 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2539 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2540 | |
Kojto | 115:87f2f5183dfb | 2541 | /** |
Kojto | 115:87f2f5183dfb | 2542 | * @brief Q15 vector addition. |
Kojto | 115:87f2f5183dfb | 2543 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2544 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2545 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2546 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2547 | * @return none. |
Kojto | 115:87f2f5183dfb | 2548 | */ |
Kojto | 115:87f2f5183dfb | 2549 | |
Kojto | 115:87f2f5183dfb | 2550 | void arm_add_q15( |
Kojto | 115:87f2f5183dfb | 2551 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2552 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2553 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2554 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2555 | |
Kojto | 115:87f2f5183dfb | 2556 | /** |
Kojto | 115:87f2f5183dfb | 2557 | * @brief Q31 vector addition. |
Kojto | 115:87f2f5183dfb | 2558 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2559 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2560 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2561 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2562 | * @return none. |
Kojto | 115:87f2f5183dfb | 2563 | */ |
Kojto | 115:87f2f5183dfb | 2564 | |
Kojto | 115:87f2f5183dfb | 2565 | void arm_add_q31( |
Kojto | 115:87f2f5183dfb | 2566 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2567 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2568 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2569 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2570 | |
Kojto | 115:87f2f5183dfb | 2571 | /** |
Kojto | 115:87f2f5183dfb | 2572 | * @brief Floating-point vector subtraction. |
Kojto | 115:87f2f5183dfb | 2573 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2574 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2575 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2576 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2577 | * @return none. |
Kojto | 115:87f2f5183dfb | 2578 | */ |
Kojto | 115:87f2f5183dfb | 2579 | |
Kojto | 115:87f2f5183dfb | 2580 | void arm_sub_f32( |
Kojto | 115:87f2f5183dfb | 2581 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2582 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2583 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2584 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2585 | |
Kojto | 115:87f2f5183dfb | 2586 | /** |
Kojto | 115:87f2f5183dfb | 2587 | * @brief Q7 vector subtraction. |
Kojto | 115:87f2f5183dfb | 2588 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2589 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2590 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2591 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2592 | * @return none. |
Kojto | 115:87f2f5183dfb | 2593 | */ |
Kojto | 115:87f2f5183dfb | 2594 | |
Kojto | 115:87f2f5183dfb | 2595 | void arm_sub_q7( |
Kojto | 115:87f2f5183dfb | 2596 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2597 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2598 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2599 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2600 | |
Kojto | 115:87f2f5183dfb | 2601 | /** |
Kojto | 115:87f2f5183dfb | 2602 | * @brief Q15 vector subtraction. |
Kojto | 115:87f2f5183dfb | 2603 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2604 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2605 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2606 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2607 | * @return none. |
Kojto | 115:87f2f5183dfb | 2608 | */ |
Kojto | 115:87f2f5183dfb | 2609 | |
Kojto | 115:87f2f5183dfb | 2610 | void arm_sub_q15( |
Kojto | 115:87f2f5183dfb | 2611 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2612 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2613 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2614 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2615 | |
Kojto | 115:87f2f5183dfb | 2616 | /** |
Kojto | 115:87f2f5183dfb | 2617 | * @brief Q31 vector subtraction. |
Kojto | 115:87f2f5183dfb | 2618 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2619 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2620 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2621 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2622 | * @return none. |
Kojto | 115:87f2f5183dfb | 2623 | */ |
Kojto | 115:87f2f5183dfb | 2624 | |
Kojto | 115:87f2f5183dfb | 2625 | void arm_sub_q31( |
Kojto | 115:87f2f5183dfb | 2626 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2627 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2628 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2629 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2630 | |
Kojto | 115:87f2f5183dfb | 2631 | /** |
Kojto | 115:87f2f5183dfb | 2632 | * @brief Multiplies a floating-point vector by a scalar. |
Kojto | 115:87f2f5183dfb | 2633 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2634 | * @param[in] scale scale factor to be applied |
Kojto | 115:87f2f5183dfb | 2635 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2636 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2637 | * @return none. |
Kojto | 115:87f2f5183dfb | 2638 | */ |
Kojto | 115:87f2f5183dfb | 2639 | |
Kojto | 115:87f2f5183dfb | 2640 | void arm_scale_f32( |
Kojto | 115:87f2f5183dfb | 2641 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2642 | float32_t scale, |
Kojto | 115:87f2f5183dfb | 2643 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2644 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2645 | |
Kojto | 115:87f2f5183dfb | 2646 | /** |
Kojto | 115:87f2f5183dfb | 2647 | * @brief Multiplies a Q7 vector by a scalar. |
Kojto | 115:87f2f5183dfb | 2648 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2649 | * @param[in] scaleFract fractional portion of the scale value |
Kojto | 115:87f2f5183dfb | 2650 | * @param[in] shift number of bits to shift the result by |
Kojto | 115:87f2f5183dfb | 2651 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2652 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2653 | * @return none. |
Kojto | 115:87f2f5183dfb | 2654 | */ |
Kojto | 115:87f2f5183dfb | 2655 | |
Kojto | 115:87f2f5183dfb | 2656 | void arm_scale_q7( |
Kojto | 115:87f2f5183dfb | 2657 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2658 | q7_t scaleFract, |
Kojto | 115:87f2f5183dfb | 2659 | int8_t shift, |
Kojto | 115:87f2f5183dfb | 2660 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2661 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2662 | |
Kojto | 115:87f2f5183dfb | 2663 | /** |
Kojto | 115:87f2f5183dfb | 2664 | * @brief Multiplies a Q15 vector by a scalar. |
Kojto | 115:87f2f5183dfb | 2665 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2666 | * @param[in] scaleFract fractional portion of the scale value |
Kojto | 115:87f2f5183dfb | 2667 | * @param[in] shift number of bits to shift the result by |
Kojto | 115:87f2f5183dfb | 2668 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2669 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2670 | * @return none. |
Kojto | 115:87f2f5183dfb | 2671 | */ |
Kojto | 115:87f2f5183dfb | 2672 | |
Kojto | 115:87f2f5183dfb | 2673 | void arm_scale_q15( |
Kojto | 115:87f2f5183dfb | 2674 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2675 | q15_t scaleFract, |
Kojto | 115:87f2f5183dfb | 2676 | int8_t shift, |
Kojto | 115:87f2f5183dfb | 2677 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2678 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2679 | |
Kojto | 115:87f2f5183dfb | 2680 | /** |
Kojto | 115:87f2f5183dfb | 2681 | * @brief Multiplies a Q31 vector by a scalar. |
Kojto | 115:87f2f5183dfb | 2682 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2683 | * @param[in] scaleFract fractional portion of the scale value |
Kojto | 115:87f2f5183dfb | 2684 | * @param[in] shift number of bits to shift the result by |
Kojto | 115:87f2f5183dfb | 2685 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2686 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2687 | * @return none. |
Kojto | 115:87f2f5183dfb | 2688 | */ |
Kojto | 115:87f2f5183dfb | 2689 | |
Kojto | 115:87f2f5183dfb | 2690 | void arm_scale_q31( |
Kojto | 115:87f2f5183dfb | 2691 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2692 | q31_t scaleFract, |
Kojto | 115:87f2f5183dfb | 2693 | int8_t shift, |
Kojto | 115:87f2f5183dfb | 2694 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2695 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2696 | |
Kojto | 115:87f2f5183dfb | 2697 | /** |
Kojto | 115:87f2f5183dfb | 2698 | * @brief Q7 vector absolute value. |
Kojto | 115:87f2f5183dfb | 2699 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 2700 | * @param[out] *pDst points to the output buffer |
Kojto | 115:87f2f5183dfb | 2701 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2702 | * @return none. |
Kojto | 115:87f2f5183dfb | 2703 | */ |
Kojto | 115:87f2f5183dfb | 2704 | |
Kojto | 115:87f2f5183dfb | 2705 | void arm_abs_q7( |
Kojto | 115:87f2f5183dfb | 2706 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2707 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2708 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2709 | |
Kojto | 115:87f2f5183dfb | 2710 | /** |
Kojto | 115:87f2f5183dfb | 2711 | * @brief Floating-point vector absolute value. |
Kojto | 115:87f2f5183dfb | 2712 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 2713 | * @param[out] *pDst points to the output buffer |
Kojto | 115:87f2f5183dfb | 2714 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2715 | * @return none. |
Kojto | 115:87f2f5183dfb | 2716 | */ |
Kojto | 115:87f2f5183dfb | 2717 | |
Kojto | 115:87f2f5183dfb | 2718 | void arm_abs_f32( |
Kojto | 115:87f2f5183dfb | 2719 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2720 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2721 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2722 | |
Kojto | 115:87f2f5183dfb | 2723 | /** |
Kojto | 115:87f2f5183dfb | 2724 | * @brief Q15 vector absolute value. |
Kojto | 115:87f2f5183dfb | 2725 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 2726 | * @param[out] *pDst points to the output buffer |
Kojto | 115:87f2f5183dfb | 2727 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2728 | * @return none. |
Kojto | 115:87f2f5183dfb | 2729 | */ |
Kojto | 115:87f2f5183dfb | 2730 | |
Kojto | 115:87f2f5183dfb | 2731 | void arm_abs_q15( |
Kojto | 115:87f2f5183dfb | 2732 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2733 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2734 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2735 | |
Kojto | 115:87f2f5183dfb | 2736 | /** |
Kojto | 115:87f2f5183dfb | 2737 | * @brief Q31 vector absolute value. |
Kojto | 115:87f2f5183dfb | 2738 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 2739 | * @param[out] *pDst points to the output buffer |
Kojto | 115:87f2f5183dfb | 2740 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2741 | * @return none. |
Kojto | 115:87f2f5183dfb | 2742 | */ |
Kojto | 115:87f2f5183dfb | 2743 | |
Kojto | 115:87f2f5183dfb | 2744 | void arm_abs_q31( |
Kojto | 115:87f2f5183dfb | 2745 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2746 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2747 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2748 | |
Kojto | 115:87f2f5183dfb | 2749 | /** |
Kojto | 115:87f2f5183dfb | 2750 | * @brief Dot product of floating-point vectors. |
Kojto | 115:87f2f5183dfb | 2751 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2752 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2753 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2754 | * @param[out] *result output result returned here |
Kojto | 115:87f2f5183dfb | 2755 | * @return none. |
Kojto | 115:87f2f5183dfb | 2756 | */ |
Kojto | 115:87f2f5183dfb | 2757 | |
Kojto | 115:87f2f5183dfb | 2758 | void arm_dot_prod_f32( |
Kojto | 115:87f2f5183dfb | 2759 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2760 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2761 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 2762 | float32_t * result); |
Kojto | 115:87f2f5183dfb | 2763 | |
Kojto | 115:87f2f5183dfb | 2764 | /** |
Kojto | 115:87f2f5183dfb | 2765 | * @brief Dot product of Q7 vectors. |
Kojto | 115:87f2f5183dfb | 2766 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2767 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2768 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2769 | * @param[out] *result output result returned here |
Kojto | 115:87f2f5183dfb | 2770 | * @return none. |
Kojto | 115:87f2f5183dfb | 2771 | */ |
Kojto | 115:87f2f5183dfb | 2772 | |
Kojto | 115:87f2f5183dfb | 2773 | void arm_dot_prod_q7( |
Kojto | 115:87f2f5183dfb | 2774 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2775 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2776 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 2777 | q31_t * result); |
Kojto | 115:87f2f5183dfb | 2778 | |
Kojto | 115:87f2f5183dfb | 2779 | /** |
Kojto | 115:87f2f5183dfb | 2780 | * @brief Dot product of Q15 vectors. |
Kojto | 115:87f2f5183dfb | 2781 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2782 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2783 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2784 | * @param[out] *result output result returned here |
Kojto | 115:87f2f5183dfb | 2785 | * @return none. |
Kojto | 115:87f2f5183dfb | 2786 | */ |
Kojto | 115:87f2f5183dfb | 2787 | |
Kojto | 115:87f2f5183dfb | 2788 | void arm_dot_prod_q15( |
Kojto | 115:87f2f5183dfb | 2789 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2790 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2791 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 2792 | q63_t * result); |
Kojto | 115:87f2f5183dfb | 2793 | |
Kojto | 115:87f2f5183dfb | 2794 | /** |
Kojto | 115:87f2f5183dfb | 2795 | * @brief Dot product of Q31 vectors. |
Kojto | 115:87f2f5183dfb | 2796 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 2797 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 2798 | * @param[in] blockSize number of samples in each vector |
Kojto | 115:87f2f5183dfb | 2799 | * @param[out] *result output result returned here |
Kojto | 115:87f2f5183dfb | 2800 | * @return none. |
Kojto | 115:87f2f5183dfb | 2801 | */ |
Kojto | 115:87f2f5183dfb | 2802 | |
Kojto | 115:87f2f5183dfb | 2803 | void arm_dot_prod_q31( |
Kojto | 115:87f2f5183dfb | 2804 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 2805 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 2806 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 2807 | q63_t * result); |
Kojto | 115:87f2f5183dfb | 2808 | |
Kojto | 115:87f2f5183dfb | 2809 | /** |
Kojto | 115:87f2f5183dfb | 2810 | * @brief Shifts the elements of a Q7 vector a specified number of bits. |
Kojto | 115:87f2f5183dfb | 2811 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2812 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
Kojto | 115:87f2f5183dfb | 2813 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2814 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2815 | * @return none. |
Kojto | 115:87f2f5183dfb | 2816 | */ |
Kojto | 115:87f2f5183dfb | 2817 | |
Kojto | 115:87f2f5183dfb | 2818 | void arm_shift_q7( |
Kojto | 115:87f2f5183dfb | 2819 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2820 | int8_t shiftBits, |
Kojto | 115:87f2f5183dfb | 2821 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2822 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2823 | |
Kojto | 115:87f2f5183dfb | 2824 | /** |
Kojto | 115:87f2f5183dfb | 2825 | * @brief Shifts the elements of a Q15 vector a specified number of bits. |
Kojto | 115:87f2f5183dfb | 2826 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2827 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
Kojto | 115:87f2f5183dfb | 2828 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2829 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2830 | * @return none. |
Kojto | 115:87f2f5183dfb | 2831 | */ |
Kojto | 115:87f2f5183dfb | 2832 | |
Kojto | 115:87f2f5183dfb | 2833 | void arm_shift_q15( |
Kojto | 115:87f2f5183dfb | 2834 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2835 | int8_t shiftBits, |
Kojto | 115:87f2f5183dfb | 2836 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2837 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2838 | |
Kojto | 115:87f2f5183dfb | 2839 | /** |
Kojto | 115:87f2f5183dfb | 2840 | * @brief Shifts the elements of a Q31 vector a specified number of bits. |
Kojto | 115:87f2f5183dfb | 2841 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2842 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
Kojto | 115:87f2f5183dfb | 2843 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2844 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2845 | * @return none. |
Kojto | 115:87f2f5183dfb | 2846 | */ |
Kojto | 115:87f2f5183dfb | 2847 | |
Kojto | 115:87f2f5183dfb | 2848 | void arm_shift_q31( |
Kojto | 115:87f2f5183dfb | 2849 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2850 | int8_t shiftBits, |
Kojto | 115:87f2f5183dfb | 2851 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2852 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2853 | |
Kojto | 115:87f2f5183dfb | 2854 | /** |
Kojto | 115:87f2f5183dfb | 2855 | * @brief Adds a constant offset to a floating-point vector. |
Kojto | 115:87f2f5183dfb | 2856 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2857 | * @param[in] offset is the offset to be added |
Kojto | 115:87f2f5183dfb | 2858 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2859 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2860 | * @return none. |
Kojto | 115:87f2f5183dfb | 2861 | */ |
Kojto | 115:87f2f5183dfb | 2862 | |
Kojto | 115:87f2f5183dfb | 2863 | void arm_offset_f32( |
Kojto | 115:87f2f5183dfb | 2864 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2865 | float32_t offset, |
Kojto | 115:87f2f5183dfb | 2866 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2867 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2868 | |
Kojto | 115:87f2f5183dfb | 2869 | /** |
Kojto | 115:87f2f5183dfb | 2870 | * @brief Adds a constant offset to a Q7 vector. |
Kojto | 115:87f2f5183dfb | 2871 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2872 | * @param[in] offset is the offset to be added |
Kojto | 115:87f2f5183dfb | 2873 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2874 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2875 | * @return none. |
Kojto | 115:87f2f5183dfb | 2876 | */ |
Kojto | 115:87f2f5183dfb | 2877 | |
Kojto | 115:87f2f5183dfb | 2878 | void arm_offset_q7( |
Kojto | 115:87f2f5183dfb | 2879 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2880 | q7_t offset, |
Kojto | 115:87f2f5183dfb | 2881 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2882 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2883 | |
Kojto | 115:87f2f5183dfb | 2884 | /** |
Kojto | 115:87f2f5183dfb | 2885 | * @brief Adds a constant offset to a Q15 vector. |
Kojto | 115:87f2f5183dfb | 2886 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2887 | * @param[in] offset is the offset to be added |
Kojto | 115:87f2f5183dfb | 2888 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2889 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2890 | * @return none. |
Kojto | 115:87f2f5183dfb | 2891 | */ |
Kojto | 115:87f2f5183dfb | 2892 | |
Kojto | 115:87f2f5183dfb | 2893 | void arm_offset_q15( |
Kojto | 115:87f2f5183dfb | 2894 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2895 | q15_t offset, |
Kojto | 115:87f2f5183dfb | 2896 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2897 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2898 | |
Kojto | 115:87f2f5183dfb | 2899 | /** |
Kojto | 115:87f2f5183dfb | 2900 | * @brief Adds a constant offset to a Q31 vector. |
Kojto | 115:87f2f5183dfb | 2901 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2902 | * @param[in] offset is the offset to be added |
Kojto | 115:87f2f5183dfb | 2903 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2904 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2905 | * @return none. |
Kojto | 115:87f2f5183dfb | 2906 | */ |
Kojto | 115:87f2f5183dfb | 2907 | |
Kojto | 115:87f2f5183dfb | 2908 | void arm_offset_q31( |
Kojto | 115:87f2f5183dfb | 2909 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2910 | q31_t offset, |
Kojto | 115:87f2f5183dfb | 2911 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2912 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2913 | |
Kojto | 115:87f2f5183dfb | 2914 | /** |
Kojto | 115:87f2f5183dfb | 2915 | * @brief Negates the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 2916 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2917 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2918 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2919 | * @return none. |
Kojto | 115:87f2f5183dfb | 2920 | */ |
Kojto | 115:87f2f5183dfb | 2921 | |
Kojto | 115:87f2f5183dfb | 2922 | void arm_negate_f32( |
Kojto | 115:87f2f5183dfb | 2923 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2924 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2925 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2926 | |
Kojto | 115:87f2f5183dfb | 2927 | /** |
Kojto | 115:87f2f5183dfb | 2928 | * @brief Negates the elements of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 2929 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2930 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2931 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2932 | * @return none. |
Kojto | 115:87f2f5183dfb | 2933 | */ |
Kojto | 115:87f2f5183dfb | 2934 | |
Kojto | 115:87f2f5183dfb | 2935 | void arm_negate_q7( |
Kojto | 115:87f2f5183dfb | 2936 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2937 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2938 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2939 | |
Kojto | 115:87f2f5183dfb | 2940 | /** |
Kojto | 115:87f2f5183dfb | 2941 | * @brief Negates the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 2942 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2943 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2944 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2945 | * @return none. |
Kojto | 115:87f2f5183dfb | 2946 | */ |
Kojto | 115:87f2f5183dfb | 2947 | |
Kojto | 115:87f2f5183dfb | 2948 | void arm_negate_q15( |
Kojto | 115:87f2f5183dfb | 2949 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2950 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2951 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2952 | |
Kojto | 115:87f2f5183dfb | 2953 | /** |
Kojto | 115:87f2f5183dfb | 2954 | * @brief Negates the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 2955 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 2956 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 2957 | * @param[in] blockSize number of samples in the vector |
Kojto | 115:87f2f5183dfb | 2958 | * @return none. |
Kojto | 115:87f2f5183dfb | 2959 | */ |
Kojto | 115:87f2f5183dfb | 2960 | |
Kojto | 115:87f2f5183dfb | 2961 | void arm_negate_q31( |
Kojto | 115:87f2f5183dfb | 2962 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2963 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 2964 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2965 | /** |
Kojto | 115:87f2f5183dfb | 2966 | * @brief Copies the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 2967 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 2968 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 2969 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 2970 | * @return none. |
Kojto | 115:87f2f5183dfb | 2971 | */ |
Kojto | 115:87f2f5183dfb | 2972 | void arm_copy_f32( |
Kojto | 115:87f2f5183dfb | 2973 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2974 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 2975 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2976 | |
Kojto | 115:87f2f5183dfb | 2977 | /** |
Kojto | 115:87f2f5183dfb | 2978 | * @brief Copies the elements of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 2979 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 2980 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 2981 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 2982 | * @return none. |
Kojto | 115:87f2f5183dfb | 2983 | */ |
Kojto | 115:87f2f5183dfb | 2984 | void arm_copy_q7( |
Kojto | 115:87f2f5183dfb | 2985 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2986 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 2987 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 2988 | |
Kojto | 115:87f2f5183dfb | 2989 | /** |
Kojto | 115:87f2f5183dfb | 2990 | * @brief Copies the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 2991 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 2992 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 2993 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 2994 | * @return none. |
Kojto | 115:87f2f5183dfb | 2995 | */ |
Kojto | 115:87f2f5183dfb | 2996 | void arm_copy_q15( |
Kojto | 115:87f2f5183dfb | 2997 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 2998 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 2999 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3000 | |
Kojto | 115:87f2f5183dfb | 3001 | /** |
Kojto | 115:87f2f5183dfb | 3002 | * @brief Copies the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 3003 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 3004 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 3005 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 3006 | * @return none. |
Kojto | 115:87f2f5183dfb | 3007 | */ |
Kojto | 115:87f2f5183dfb | 3008 | void arm_copy_q31( |
Kojto | 115:87f2f5183dfb | 3009 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3010 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3011 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3012 | /** |
Kojto | 115:87f2f5183dfb | 3013 | * @brief Fills a constant value into a floating-point vector. |
Kojto | 115:87f2f5183dfb | 3014 | * @param[in] value input value to be filled |
Kojto | 115:87f2f5183dfb | 3015 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 3016 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 3017 | * @return none. |
Kojto | 115:87f2f5183dfb | 3018 | */ |
Kojto | 115:87f2f5183dfb | 3019 | void arm_fill_f32( |
Kojto | 115:87f2f5183dfb | 3020 | float32_t value, |
Kojto | 115:87f2f5183dfb | 3021 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3022 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3023 | |
Kojto | 115:87f2f5183dfb | 3024 | /** |
Kojto | 115:87f2f5183dfb | 3025 | * @brief Fills a constant value into a Q7 vector. |
Kojto | 115:87f2f5183dfb | 3026 | * @param[in] value input value to be filled |
Kojto | 115:87f2f5183dfb | 3027 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 3028 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 3029 | * @return none. |
Kojto | 115:87f2f5183dfb | 3030 | */ |
Kojto | 115:87f2f5183dfb | 3031 | void arm_fill_q7( |
Kojto | 115:87f2f5183dfb | 3032 | q7_t value, |
Kojto | 115:87f2f5183dfb | 3033 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 3034 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3035 | |
Kojto | 115:87f2f5183dfb | 3036 | /** |
Kojto | 115:87f2f5183dfb | 3037 | * @brief Fills a constant value into a Q15 vector. |
Kojto | 115:87f2f5183dfb | 3038 | * @param[in] value input value to be filled |
Kojto | 115:87f2f5183dfb | 3039 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 3040 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 3041 | * @return none. |
Kojto | 115:87f2f5183dfb | 3042 | */ |
Kojto | 115:87f2f5183dfb | 3043 | void arm_fill_q15( |
Kojto | 115:87f2f5183dfb | 3044 | q15_t value, |
Kojto | 115:87f2f5183dfb | 3045 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3046 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3047 | |
Kojto | 115:87f2f5183dfb | 3048 | /** |
Kojto | 115:87f2f5183dfb | 3049 | * @brief Fills a constant value into a Q31 vector. |
Kojto | 115:87f2f5183dfb | 3050 | * @param[in] value input value to be filled |
Kojto | 115:87f2f5183dfb | 3051 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 3052 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 3053 | * @return none. |
Kojto | 115:87f2f5183dfb | 3054 | */ |
Kojto | 115:87f2f5183dfb | 3055 | void arm_fill_q31( |
Kojto | 115:87f2f5183dfb | 3056 | q31_t value, |
Kojto | 115:87f2f5183dfb | 3057 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3058 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3059 | |
Kojto | 115:87f2f5183dfb | 3060 | /** |
Kojto | 115:87f2f5183dfb | 3061 | * @brief Convolution of floating-point sequences. |
Kojto | 115:87f2f5183dfb | 3062 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3063 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3064 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3065 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3066 | * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3067 | * @return none. |
Kojto | 115:87f2f5183dfb | 3068 | */ |
Kojto | 115:87f2f5183dfb | 3069 | |
Kojto | 115:87f2f5183dfb | 3070 | void arm_conv_f32( |
Kojto | 115:87f2f5183dfb | 3071 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3072 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3073 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3074 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3075 | float32_t * pDst); |
Kojto | 115:87f2f5183dfb | 3076 | |
Kojto | 115:87f2f5183dfb | 3077 | |
Kojto | 115:87f2f5183dfb | 3078 | /** |
Kojto | 115:87f2f5183dfb | 3079 | * @brief Convolution of Q15 sequences. |
Kojto | 115:87f2f5183dfb | 3080 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3081 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3082 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3083 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3084 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3085 | * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3086 | * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 3087 | * @return none. |
Kojto | 115:87f2f5183dfb | 3088 | */ |
Kojto | 115:87f2f5183dfb | 3089 | |
Kojto | 115:87f2f5183dfb | 3090 | |
Kojto | 115:87f2f5183dfb | 3091 | void arm_conv_opt_q15( |
Kojto | 115:87f2f5183dfb | 3092 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3093 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3094 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3095 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3096 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3097 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3098 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3099 | |
Kojto | 115:87f2f5183dfb | 3100 | |
Kojto | 115:87f2f5183dfb | 3101 | /** |
Kojto | 115:87f2f5183dfb | 3102 | * @brief Convolution of Q15 sequences. |
Kojto | 115:87f2f5183dfb | 3103 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3104 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3105 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3106 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3107 | * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3108 | * @return none. |
Kojto | 115:87f2f5183dfb | 3109 | */ |
Kojto | 115:87f2f5183dfb | 3110 | |
Kojto | 115:87f2f5183dfb | 3111 | void arm_conv_q15( |
Kojto | 115:87f2f5183dfb | 3112 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3113 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3114 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3115 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3116 | q15_t * pDst); |
Kojto | 115:87f2f5183dfb | 3117 | |
Kojto | 115:87f2f5183dfb | 3118 | /** |
Kojto | 115:87f2f5183dfb | 3119 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3120 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3121 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3122 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3123 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3124 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3125 | * @return none. |
Kojto | 115:87f2f5183dfb | 3126 | */ |
Kojto | 115:87f2f5183dfb | 3127 | |
Kojto | 115:87f2f5183dfb | 3128 | void arm_conv_fast_q15( |
Kojto | 115:87f2f5183dfb | 3129 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3130 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3131 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3132 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3133 | q15_t * pDst); |
Kojto | 115:87f2f5183dfb | 3134 | |
Kojto | 115:87f2f5183dfb | 3135 | /** |
Kojto | 115:87f2f5183dfb | 3136 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3137 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3138 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3139 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3140 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3141 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3142 | * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3143 | * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 3144 | * @return none. |
Kojto | 115:87f2f5183dfb | 3145 | */ |
Kojto | 115:87f2f5183dfb | 3146 | |
Kojto | 115:87f2f5183dfb | 3147 | void arm_conv_fast_opt_q15( |
Kojto | 115:87f2f5183dfb | 3148 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3149 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3150 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3151 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3152 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3153 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3154 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3155 | |
Kojto | 115:87f2f5183dfb | 3156 | |
Kojto | 115:87f2f5183dfb | 3157 | |
Kojto | 115:87f2f5183dfb | 3158 | /** |
Kojto | 115:87f2f5183dfb | 3159 | * @brief Convolution of Q31 sequences. |
Kojto | 115:87f2f5183dfb | 3160 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3161 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3162 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3163 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3164 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3165 | * @return none. |
Kojto | 115:87f2f5183dfb | 3166 | */ |
Kojto | 115:87f2f5183dfb | 3167 | |
Kojto | 115:87f2f5183dfb | 3168 | void arm_conv_q31( |
Kojto | 115:87f2f5183dfb | 3169 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3170 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3171 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3172 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3173 | q31_t * pDst); |
Kojto | 115:87f2f5183dfb | 3174 | |
Kojto | 115:87f2f5183dfb | 3175 | /** |
Kojto | 115:87f2f5183dfb | 3176 | * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3177 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3178 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3179 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3180 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3181 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3182 | * @return none. |
Kojto | 115:87f2f5183dfb | 3183 | */ |
Kojto | 115:87f2f5183dfb | 3184 | |
Kojto | 115:87f2f5183dfb | 3185 | void arm_conv_fast_q31( |
Kojto | 115:87f2f5183dfb | 3186 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3187 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3188 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3189 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3190 | q31_t * pDst); |
Kojto | 115:87f2f5183dfb | 3191 | |
Kojto | 115:87f2f5183dfb | 3192 | |
Kojto | 115:87f2f5183dfb | 3193 | /** |
Kojto | 115:87f2f5183dfb | 3194 | * @brief Convolution of Q7 sequences. |
Kojto | 115:87f2f5183dfb | 3195 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3196 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3197 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3198 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3199 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3200 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3201 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 3202 | * @return none. |
Kojto | 115:87f2f5183dfb | 3203 | */ |
Kojto | 115:87f2f5183dfb | 3204 | |
Kojto | 115:87f2f5183dfb | 3205 | void arm_conv_opt_q7( |
Kojto | 115:87f2f5183dfb | 3206 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3207 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3208 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3209 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3210 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 3211 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3212 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3213 | |
Kojto | 115:87f2f5183dfb | 3214 | |
Kojto | 115:87f2f5183dfb | 3215 | |
Kojto | 115:87f2f5183dfb | 3216 | /** |
Kojto | 115:87f2f5183dfb | 3217 | * @brief Convolution of Q7 sequences. |
Kojto | 115:87f2f5183dfb | 3218 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3219 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3220 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3221 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3222 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
Kojto | 115:87f2f5183dfb | 3223 | * @return none. |
Kojto | 115:87f2f5183dfb | 3224 | */ |
Kojto | 115:87f2f5183dfb | 3225 | |
Kojto | 115:87f2f5183dfb | 3226 | void arm_conv_q7( |
Kojto | 115:87f2f5183dfb | 3227 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3228 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3229 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3230 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3231 | q7_t * pDst); |
Kojto | 115:87f2f5183dfb | 3232 | |
Kojto | 115:87f2f5183dfb | 3233 | |
Kojto | 115:87f2f5183dfb | 3234 | /** |
Kojto | 115:87f2f5183dfb | 3235 | * @brief Partial convolution of floating-point sequences. |
Kojto | 115:87f2f5183dfb | 3236 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3237 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3238 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3239 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3240 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3241 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3242 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3244 | */ |
Kojto | 115:87f2f5183dfb | 3245 | |
Kojto | 115:87f2f5183dfb | 3246 | arm_status arm_conv_partial_f32( |
Kojto | 115:87f2f5183dfb | 3247 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3248 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3249 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3250 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3251 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3252 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3253 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3254 | |
Kojto | 115:87f2f5183dfb | 3255 | /** |
Kojto | 115:87f2f5183dfb | 3256 | * @brief Partial convolution of Q15 sequences. |
Kojto | 115:87f2f5183dfb | 3257 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3258 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3259 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3260 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3261 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3262 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3263 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 3264 | * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3265 | * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3267 | */ |
Kojto | 115:87f2f5183dfb | 3268 | |
Kojto | 115:87f2f5183dfb | 3269 | arm_status arm_conv_partial_opt_q15( |
Kojto | 115:87f2f5183dfb | 3270 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3271 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3272 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3273 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3274 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3275 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3276 | uint32_t numPoints, |
Kojto | 115:87f2f5183dfb | 3277 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3278 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3279 | |
Kojto | 115:87f2f5183dfb | 3280 | |
Kojto | 115:87f2f5183dfb | 3281 | /** |
Kojto | 115:87f2f5183dfb | 3282 | * @brief Partial convolution of Q15 sequences. |
Kojto | 115:87f2f5183dfb | 3283 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3284 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3285 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3286 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3287 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3288 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3289 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3291 | */ |
Kojto | 115:87f2f5183dfb | 3292 | |
Kojto | 115:87f2f5183dfb | 3293 | arm_status arm_conv_partial_q15( |
Kojto | 115:87f2f5183dfb | 3294 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3295 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3296 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3297 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3298 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3299 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3300 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3301 | |
Kojto | 115:87f2f5183dfb | 3302 | /** |
Kojto | 115:87f2f5183dfb | 3303 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3304 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3305 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3306 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3307 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3308 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3309 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3310 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3312 | */ |
Kojto | 115:87f2f5183dfb | 3313 | |
Kojto | 115:87f2f5183dfb | 3314 | arm_status arm_conv_partial_fast_q15( |
Kojto | 115:87f2f5183dfb | 3315 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3316 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3317 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3318 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3319 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3320 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3321 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3322 | |
Kojto | 115:87f2f5183dfb | 3323 | |
Kojto | 115:87f2f5183dfb | 3324 | /** |
Kojto | 115:87f2f5183dfb | 3325 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3326 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3327 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3328 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3329 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3330 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3331 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3332 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 3333 | * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3334 | * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3336 | */ |
Kojto | 115:87f2f5183dfb | 3337 | |
Kojto | 115:87f2f5183dfb | 3338 | arm_status arm_conv_partial_fast_opt_q15( |
Kojto | 115:87f2f5183dfb | 3339 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3340 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3341 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3342 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3343 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3344 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3345 | uint32_t numPoints, |
Kojto | 115:87f2f5183dfb | 3346 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3347 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3348 | |
Kojto | 115:87f2f5183dfb | 3349 | |
Kojto | 115:87f2f5183dfb | 3350 | /** |
Kojto | 115:87f2f5183dfb | 3351 | * @brief Partial convolution of Q31 sequences. |
Kojto | 115:87f2f5183dfb | 3352 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3353 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3354 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3355 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3356 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3357 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3358 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3360 | */ |
Kojto | 115:87f2f5183dfb | 3361 | |
Kojto | 115:87f2f5183dfb | 3362 | arm_status arm_conv_partial_q31( |
Kojto | 115:87f2f5183dfb | 3363 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3364 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3365 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3366 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3367 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3368 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3369 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3370 | |
Kojto | 115:87f2f5183dfb | 3371 | |
Kojto | 115:87f2f5183dfb | 3372 | /** |
Kojto | 115:87f2f5183dfb | 3373 | * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 3374 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3375 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3376 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3377 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3378 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3379 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3380 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3382 | */ |
Kojto | 115:87f2f5183dfb | 3383 | |
Kojto | 115:87f2f5183dfb | 3384 | arm_status arm_conv_partial_fast_q31( |
Kojto | 115:87f2f5183dfb | 3385 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3386 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3387 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3388 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3389 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3390 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3391 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3392 | |
Kojto | 115:87f2f5183dfb | 3393 | |
Kojto | 115:87f2f5183dfb | 3394 | /** |
Kojto | 115:87f2f5183dfb | 3395 | * @brief Partial convolution of Q7 sequences |
Kojto | 115:87f2f5183dfb | 3396 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3397 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3398 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3399 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3400 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3401 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3402 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 3403 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 3404 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3406 | */ |
Kojto | 115:87f2f5183dfb | 3407 | |
Kojto | 115:87f2f5183dfb | 3408 | arm_status arm_conv_partial_opt_q7( |
Kojto | 115:87f2f5183dfb | 3409 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3410 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3411 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3412 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3413 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 3414 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3415 | uint32_t numPoints, |
Kojto | 115:87f2f5183dfb | 3416 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 3417 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 3418 | |
Kojto | 115:87f2f5183dfb | 3419 | |
Kojto | 115:87f2f5183dfb | 3420 | /** |
Kojto | 115:87f2f5183dfb | 3421 | * @brief Partial convolution of Q7 sequences. |
Kojto | 115:87f2f5183dfb | 3422 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 3423 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 3424 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 3425 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 3426 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3427 | * @param[in] firstIndex is the first output sample to start with. |
Kojto | 115:87f2f5183dfb | 3428 | * @param[in] numPoints is the number of output points to be computed. |
Kojto | 115:87f2f5183dfb | 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]. |
Kojto | 115:87f2f5183dfb | 3430 | */ |
Kojto | 115:87f2f5183dfb | 3431 | |
Kojto | 115:87f2f5183dfb | 3432 | arm_status arm_conv_partial_q7( |
Kojto | 115:87f2f5183dfb | 3433 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 3434 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 3435 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 3436 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 3437 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 3438 | uint32_t firstIndex, |
Kojto | 115:87f2f5183dfb | 3439 | uint32_t numPoints); |
Kojto | 115:87f2f5183dfb | 3440 | |
Kojto | 115:87f2f5183dfb | 3441 | |
Kojto | 115:87f2f5183dfb | 3442 | |
Kojto | 115:87f2f5183dfb | 3443 | /** |
Kojto | 115:87f2f5183dfb | 3444 | * @brief Instance structure for the Q15 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3445 | */ |
Kojto | 115:87f2f5183dfb | 3446 | |
Kojto | 115:87f2f5183dfb | 3447 | typedef struct |
Kojto | 115:87f2f5183dfb | 3448 | { |
Kojto | 115:87f2f5183dfb | 3449 | uint8_t M; /**< decimation factor. */ |
Kojto | 115:87f2f5183dfb | 3450 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 3451 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 3452 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 3453 | } arm_fir_decimate_instance_q15; |
Kojto | 115:87f2f5183dfb | 3454 | |
Kojto | 115:87f2f5183dfb | 3455 | /** |
Kojto | 115:87f2f5183dfb | 3456 | * @brief Instance structure for the Q31 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3457 | */ |
Kojto | 115:87f2f5183dfb | 3458 | |
Kojto | 115:87f2f5183dfb | 3459 | typedef struct |
Kojto | 115:87f2f5183dfb | 3460 | { |
Kojto | 115:87f2f5183dfb | 3461 | uint8_t M; /**< decimation factor. */ |
Kojto | 115:87f2f5183dfb | 3462 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 3463 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 3464 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 3465 | |
Kojto | 115:87f2f5183dfb | 3466 | } arm_fir_decimate_instance_q31; |
Kojto | 115:87f2f5183dfb | 3467 | |
Kojto | 115:87f2f5183dfb | 3468 | /** |
Kojto | 115:87f2f5183dfb | 3469 | * @brief Instance structure for the floating-point FIR decimator. |
Kojto | 115:87f2f5183dfb | 3470 | */ |
Kojto | 115:87f2f5183dfb | 3471 | |
Kojto | 115:87f2f5183dfb | 3472 | typedef struct |
Kojto | 115:87f2f5183dfb | 3473 | { |
Kojto | 115:87f2f5183dfb | 3474 | uint8_t M; /**< decimation factor. */ |
Kojto | 115:87f2f5183dfb | 3475 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 3476 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 3477 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 3478 | |
Kojto | 115:87f2f5183dfb | 3479 | } arm_fir_decimate_instance_f32; |
Kojto | 115:87f2f5183dfb | 3480 | |
Kojto | 115:87f2f5183dfb | 3481 | |
Kojto | 115:87f2f5183dfb | 3482 | |
Kojto | 115:87f2f5183dfb | 3483 | /** |
Kojto | 115:87f2f5183dfb | 3484 | * @brief Processing function for the floating-point FIR decimator. |
Kojto | 115:87f2f5183dfb | 3485 | * @param[in] *S points to an instance of the floating-point FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3486 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3487 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3488 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3489 | * @return none |
Kojto | 115:87f2f5183dfb | 3490 | */ |
Kojto | 115:87f2f5183dfb | 3491 | |
Kojto | 115:87f2f5183dfb | 3492 | void arm_fir_decimate_f32( |
Kojto | 115:87f2f5183dfb | 3493 | const arm_fir_decimate_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3494 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3495 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3496 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3497 | |
Kojto | 115:87f2f5183dfb | 3498 | |
Kojto | 115:87f2f5183dfb | 3499 | /** |
Kojto | 115:87f2f5183dfb | 3500 | * @brief Initialization function for the floating-point FIR decimator. |
Kojto | 115:87f2f5183dfb | 3501 | * @param[in,out] *S points to an instance of the floating-point FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3502 | * @param[in] numTaps number of coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3503 | * @param[in] M decimation factor. |
Kojto | 115:87f2f5183dfb | 3504 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3505 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3506 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3507 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3508 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
Kojto | 115:87f2f5183dfb | 3509 | */ |
Kojto | 115:87f2f5183dfb | 3510 | |
Kojto | 115:87f2f5183dfb | 3511 | arm_status arm_fir_decimate_init_f32( |
Kojto | 115:87f2f5183dfb | 3512 | arm_fir_decimate_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3513 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3514 | uint8_t M, |
Kojto | 115:87f2f5183dfb | 3515 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3516 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 3517 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3518 | |
Kojto | 115:87f2f5183dfb | 3519 | /** |
Kojto | 115:87f2f5183dfb | 3520 | * @brief Processing function for the Q15 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3521 | * @param[in] *S points to an instance of the Q15 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3522 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3523 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3524 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3525 | * @return none |
Kojto | 115:87f2f5183dfb | 3526 | */ |
Kojto | 115:87f2f5183dfb | 3527 | |
Kojto | 115:87f2f5183dfb | 3528 | void arm_fir_decimate_q15( |
Kojto | 115:87f2f5183dfb | 3529 | const arm_fir_decimate_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3530 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3531 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3532 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3533 | |
Kojto | 115:87f2f5183dfb | 3534 | /** |
Kojto | 115:87f2f5183dfb | 3535 | * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 3536 | * @param[in] *S points to an instance of the Q15 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3537 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3538 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3539 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3540 | * @return none |
Kojto | 115:87f2f5183dfb | 3541 | */ |
Kojto | 115:87f2f5183dfb | 3542 | |
Kojto | 115:87f2f5183dfb | 3543 | void arm_fir_decimate_fast_q15( |
Kojto | 115:87f2f5183dfb | 3544 | const arm_fir_decimate_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3545 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3546 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3547 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3548 | |
Kojto | 115:87f2f5183dfb | 3549 | |
Kojto | 115:87f2f5183dfb | 3550 | |
Kojto | 115:87f2f5183dfb | 3551 | /** |
Kojto | 115:87f2f5183dfb | 3552 | * @brief Initialization function for the Q15 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3553 | * @param[in,out] *S points to an instance of the Q15 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3554 | * @param[in] numTaps number of coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3555 | * @param[in] M decimation factor. |
Kojto | 115:87f2f5183dfb | 3556 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3557 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3558 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3559 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3560 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
Kojto | 115:87f2f5183dfb | 3561 | */ |
Kojto | 115:87f2f5183dfb | 3562 | |
Kojto | 115:87f2f5183dfb | 3563 | arm_status arm_fir_decimate_init_q15( |
Kojto | 115:87f2f5183dfb | 3564 | arm_fir_decimate_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3565 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3566 | uint8_t M, |
Kojto | 115:87f2f5183dfb | 3567 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3568 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 3569 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3570 | |
Kojto | 115:87f2f5183dfb | 3571 | /** |
Kojto | 115:87f2f5183dfb | 3572 | * @brief Processing function for the Q31 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3573 | * @param[in] *S points to an instance of the Q31 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3574 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3575 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3576 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3577 | * @return none |
Kojto | 115:87f2f5183dfb | 3578 | */ |
Kojto | 115:87f2f5183dfb | 3579 | |
Kojto | 115:87f2f5183dfb | 3580 | void arm_fir_decimate_q31( |
Kojto | 115:87f2f5183dfb | 3581 | const arm_fir_decimate_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 3582 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3583 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3584 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3585 | |
Kojto | 115:87f2f5183dfb | 3586 | /** |
Kojto | 115:87f2f5183dfb | 3587 | * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 3588 | * @param[in] *S points to an instance of the Q31 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3589 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3590 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3591 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3592 | * @return none |
Kojto | 115:87f2f5183dfb | 3593 | */ |
Kojto | 115:87f2f5183dfb | 3594 | |
Kojto | 115:87f2f5183dfb | 3595 | void arm_fir_decimate_fast_q31( |
Kojto | 115:87f2f5183dfb | 3596 | arm_fir_decimate_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 3597 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3598 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3599 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3600 | |
Kojto | 115:87f2f5183dfb | 3601 | |
Kojto | 115:87f2f5183dfb | 3602 | /** |
Kojto | 115:87f2f5183dfb | 3603 | * @brief Initialization function for the Q31 FIR decimator. |
Kojto | 115:87f2f5183dfb | 3604 | * @param[in,out] *S points to an instance of the Q31 FIR decimator structure. |
Kojto | 115:87f2f5183dfb | 3605 | * @param[in] numTaps number of coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3606 | * @param[in] M decimation factor. |
Kojto | 115:87f2f5183dfb | 3607 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3608 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3609 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3610 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3611 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
Kojto | 115:87f2f5183dfb | 3612 | */ |
Kojto | 115:87f2f5183dfb | 3613 | |
Kojto | 115:87f2f5183dfb | 3614 | arm_status arm_fir_decimate_init_q31( |
Kojto | 115:87f2f5183dfb | 3615 | arm_fir_decimate_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 3616 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3617 | uint8_t M, |
Kojto | 115:87f2f5183dfb | 3618 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3619 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 3620 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3621 | |
Kojto | 115:87f2f5183dfb | 3622 | |
Kojto | 115:87f2f5183dfb | 3623 | |
Kojto | 115:87f2f5183dfb | 3624 | /** |
Kojto | 115:87f2f5183dfb | 3625 | * @brief Instance structure for the Q15 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3626 | */ |
Kojto | 115:87f2f5183dfb | 3627 | |
Kojto | 115:87f2f5183dfb | 3628 | typedef struct |
Kojto | 115:87f2f5183dfb | 3629 | { |
Kojto | 115:87f2f5183dfb | 3630 | uint8_t L; /**< upsample factor. */ |
Kojto | 115:87f2f5183dfb | 3631 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
Kojto | 115:87f2f5183dfb | 3632 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
Kojto | 115:87f2f5183dfb | 3633 | q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ |
Kojto | 115:87f2f5183dfb | 3634 | } arm_fir_interpolate_instance_q15; |
Kojto | 115:87f2f5183dfb | 3635 | |
Kojto | 115:87f2f5183dfb | 3636 | /** |
Kojto | 115:87f2f5183dfb | 3637 | * @brief Instance structure for the Q31 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3638 | */ |
Kojto | 115:87f2f5183dfb | 3639 | |
Kojto | 115:87f2f5183dfb | 3640 | typedef struct |
Kojto | 115:87f2f5183dfb | 3641 | { |
Kojto | 115:87f2f5183dfb | 3642 | uint8_t L; /**< upsample factor. */ |
Kojto | 115:87f2f5183dfb | 3643 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
Kojto | 115:87f2f5183dfb | 3644 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
Kojto | 115:87f2f5183dfb | 3645 | q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ |
Kojto | 115:87f2f5183dfb | 3646 | } arm_fir_interpolate_instance_q31; |
Kojto | 115:87f2f5183dfb | 3647 | |
Kojto | 115:87f2f5183dfb | 3648 | /** |
Kojto | 115:87f2f5183dfb | 3649 | * @brief Instance structure for the floating-point FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3650 | */ |
Kojto | 115:87f2f5183dfb | 3651 | |
Kojto | 115:87f2f5183dfb | 3652 | typedef struct |
Kojto | 115:87f2f5183dfb | 3653 | { |
Kojto | 115:87f2f5183dfb | 3654 | uint8_t L; /**< upsample factor. */ |
Kojto | 115:87f2f5183dfb | 3655 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
Kojto | 115:87f2f5183dfb | 3656 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
Kojto | 115:87f2f5183dfb | 3657 | float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ |
Kojto | 115:87f2f5183dfb | 3658 | } arm_fir_interpolate_instance_f32; |
Kojto | 115:87f2f5183dfb | 3659 | |
Kojto | 115:87f2f5183dfb | 3660 | |
Kojto | 115:87f2f5183dfb | 3661 | /** |
Kojto | 115:87f2f5183dfb | 3662 | * @brief Processing function for the Q15 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3663 | * @param[in] *S points to an instance of the Q15 FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3664 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3665 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 3666 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3667 | * @return none. |
Kojto | 115:87f2f5183dfb | 3668 | */ |
Kojto | 115:87f2f5183dfb | 3669 | |
Kojto | 115:87f2f5183dfb | 3670 | void arm_fir_interpolate_q15( |
Kojto | 115:87f2f5183dfb | 3671 | const arm_fir_interpolate_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3672 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3673 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 3674 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3675 | |
Kojto | 115:87f2f5183dfb | 3676 | |
Kojto | 115:87f2f5183dfb | 3677 | /** |
Kojto | 115:87f2f5183dfb | 3678 | * @brief Initialization function for the Q15 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3679 | * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3680 | * @param[in] L upsample factor. |
Kojto | 115:87f2f5183dfb | 3681 | * @param[in] numTaps number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3682 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
Kojto | 115:87f2f5183dfb | 3683 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3684 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3685 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3686 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
Kojto | 115:87f2f5183dfb | 3687 | */ |
Kojto | 115:87f2f5183dfb | 3688 | |
Kojto | 115:87f2f5183dfb | 3689 | arm_status arm_fir_interpolate_init_q15( |
Kojto | 115:87f2f5183dfb | 3690 | arm_fir_interpolate_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3691 | uint8_t L, |
Kojto | 115:87f2f5183dfb | 3692 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3693 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3694 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 3695 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3696 | |
Kojto | 115:87f2f5183dfb | 3697 | /** |
Kojto | 115:87f2f5183dfb | 3698 | * @brief Processing function for the Q31 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3699 | * @param[in] *S points to an instance of the Q15 FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3700 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3701 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 3702 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3703 | * @return none. |
Kojto | 115:87f2f5183dfb | 3704 | */ |
Kojto | 115:87f2f5183dfb | 3705 | |
Kojto | 115:87f2f5183dfb | 3706 | void arm_fir_interpolate_q31( |
Kojto | 115:87f2f5183dfb | 3707 | const arm_fir_interpolate_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 3708 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3709 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3710 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3711 | |
Kojto | 115:87f2f5183dfb | 3712 | /** |
Kojto | 115:87f2f5183dfb | 3713 | * @brief Initialization function for the Q31 FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3714 | * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3715 | * @param[in] L upsample factor. |
Kojto | 115:87f2f5183dfb | 3716 | * @param[in] numTaps number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3717 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
Kojto | 115:87f2f5183dfb | 3718 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3719 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3720 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3721 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
Kojto | 115:87f2f5183dfb | 3722 | */ |
Kojto | 115:87f2f5183dfb | 3723 | |
Kojto | 115:87f2f5183dfb | 3724 | arm_status arm_fir_interpolate_init_q31( |
Kojto | 115:87f2f5183dfb | 3725 | arm_fir_interpolate_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 3726 | uint8_t L, |
Kojto | 115:87f2f5183dfb | 3727 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3728 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3729 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 3730 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3731 | |
Kojto | 115:87f2f5183dfb | 3732 | |
Kojto | 115:87f2f5183dfb | 3733 | /** |
Kojto | 115:87f2f5183dfb | 3734 | * @brief Processing function for the floating-point FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3735 | * @param[in] *S points to an instance of the floating-point FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3736 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3737 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 3738 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3739 | * @return none. |
Kojto | 115:87f2f5183dfb | 3740 | */ |
Kojto | 115:87f2f5183dfb | 3741 | |
Kojto | 115:87f2f5183dfb | 3742 | void arm_fir_interpolate_f32( |
Kojto | 115:87f2f5183dfb | 3743 | const arm_fir_interpolate_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3744 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3745 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3746 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3747 | |
Kojto | 115:87f2f5183dfb | 3748 | /** |
Kojto | 115:87f2f5183dfb | 3749 | * @brief Initialization function for the floating-point FIR interpolator. |
Kojto | 115:87f2f5183dfb | 3750 | * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure. |
Kojto | 115:87f2f5183dfb | 3751 | * @param[in] L upsample factor. |
Kojto | 115:87f2f5183dfb | 3752 | * @param[in] numTaps number of filter coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 3753 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
Kojto | 115:87f2f5183dfb | 3754 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3755 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 3756 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
Kojto | 115:87f2f5183dfb | 3757 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
Kojto | 115:87f2f5183dfb | 3758 | */ |
Kojto | 115:87f2f5183dfb | 3759 | |
Kojto | 115:87f2f5183dfb | 3760 | arm_status arm_fir_interpolate_init_f32( |
Kojto | 115:87f2f5183dfb | 3761 | arm_fir_interpolate_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3762 | uint8_t L, |
Kojto | 115:87f2f5183dfb | 3763 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 3764 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3765 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 3766 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3767 | |
Kojto | 115:87f2f5183dfb | 3768 | /** |
Kojto | 115:87f2f5183dfb | 3769 | * @brief Instance structure for the high precision Q31 Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3770 | */ |
Kojto | 115:87f2f5183dfb | 3771 | |
Kojto | 115:87f2f5183dfb | 3772 | typedef struct |
Kojto | 115:87f2f5183dfb | 3773 | { |
Kojto | 115:87f2f5183dfb | 3774 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3775 | q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
Kojto | 115:87f2f5183dfb | 3776 | q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 3777 | uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ |
Kojto | 115:87f2f5183dfb | 3778 | |
Kojto | 115:87f2f5183dfb | 3779 | } arm_biquad_cas_df1_32x64_ins_q31; |
Kojto | 115:87f2f5183dfb | 3780 | |
Kojto | 115:87f2f5183dfb | 3781 | |
Kojto | 115:87f2f5183dfb | 3782 | /** |
Kojto | 115:87f2f5183dfb | 3783 | * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure. |
Kojto | 115:87f2f5183dfb | 3784 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3785 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3786 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 3787 | * @return none. |
Kojto | 115:87f2f5183dfb | 3788 | */ |
Kojto | 115:87f2f5183dfb | 3789 | |
Kojto | 115:87f2f5183dfb | 3790 | void arm_biquad_cas_df1_32x64_q31( |
Kojto | 115:87f2f5183dfb | 3791 | const arm_biquad_cas_df1_32x64_ins_q31 * S, |
Kojto | 115:87f2f5183dfb | 3792 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3793 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 3794 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3795 | |
Kojto | 115:87f2f5183dfb | 3796 | |
Kojto | 115:87f2f5183dfb | 3797 | /** |
Kojto | 115:87f2f5183dfb | 3798 | * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure. |
Kojto | 115:87f2f5183dfb | 3799 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 3800 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3801 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3802 | * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format |
Kojto | 115:87f2f5183dfb | 3803 | * @return none |
Kojto | 115:87f2f5183dfb | 3804 | */ |
Kojto | 115:87f2f5183dfb | 3805 | |
Kojto | 115:87f2f5183dfb | 3806 | void arm_biquad_cas_df1_32x64_init_q31( |
Kojto | 115:87f2f5183dfb | 3807 | arm_biquad_cas_df1_32x64_ins_q31 * S, |
Kojto | 115:87f2f5183dfb | 3808 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 3809 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3810 | q63_t * pState, |
Kojto | 115:87f2f5183dfb | 3811 | uint8_t postShift); |
Kojto | 115:87f2f5183dfb | 3812 | |
Kojto | 115:87f2f5183dfb | 3813 | |
Kojto | 115:87f2f5183dfb | 3814 | |
Kojto | 115:87f2f5183dfb | 3815 | /** |
Kojto | 115:87f2f5183dfb | 3816 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3817 | */ |
Kojto | 115:87f2f5183dfb | 3818 | |
Kojto | 115:87f2f5183dfb | 3819 | typedef struct |
Kojto | 115:87f2f5183dfb | 3820 | { |
Kojto | 115:87f2f5183dfb | 3821 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3822 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3823 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 3824 | } arm_biquad_cascade_df2T_instance_f32; |
Kojto | 115:87f2f5183dfb | 3825 | |
Kojto | 115:87f2f5183dfb | 3826 | |
Kojto | 115:87f2f5183dfb | 3827 | |
Kojto | 115:87f2f5183dfb | 3828 | /** |
Kojto | 115:87f2f5183dfb | 3829 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3830 | */ |
Kojto | 115:87f2f5183dfb | 3831 | |
Kojto | 115:87f2f5183dfb | 3832 | typedef struct |
Kojto | 115:87f2f5183dfb | 3833 | { |
Kojto | 115:87f2f5183dfb | 3834 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3835 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
Kojto | 115:87f2f5183dfb | 3836 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 3837 | } arm_biquad_cascade_stereo_df2T_instance_f32; |
Kojto | 115:87f2f5183dfb | 3838 | |
Kojto | 115:87f2f5183dfb | 3839 | |
Kojto | 115:87f2f5183dfb | 3840 | |
Kojto | 115:87f2f5183dfb | 3841 | /** |
Kojto | 115:87f2f5183dfb | 3842 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3843 | */ |
Kojto | 115:87f2f5183dfb | 3844 | |
Kojto | 115:87f2f5183dfb | 3845 | typedef struct |
Kojto | 115:87f2f5183dfb | 3846 | { |
Kojto | 115:87f2f5183dfb | 3847 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3848 | float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
Kojto | 115:87f2f5183dfb | 3849 | float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
Kojto | 115:87f2f5183dfb | 3850 | } arm_biquad_cascade_df2T_instance_f64; |
Kojto | 115:87f2f5183dfb | 3851 | |
Kojto | 115:87f2f5183dfb | 3852 | |
Kojto | 115:87f2f5183dfb | 3853 | /** |
Kojto | 115:87f2f5183dfb | 3854 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3855 | * @param[in] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3856 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3857 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3858 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 3859 | * @return none. |
Kojto | 115:87f2f5183dfb | 3860 | */ |
Kojto | 115:87f2f5183dfb | 3861 | |
Kojto | 115:87f2f5183dfb | 3862 | void arm_biquad_cascade_df2T_f32( |
Kojto | 115:87f2f5183dfb | 3863 | const arm_biquad_cascade_df2T_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3864 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3865 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3866 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3867 | |
Kojto | 115:87f2f5183dfb | 3868 | |
Kojto | 115:87f2f5183dfb | 3869 | /** |
Kojto | 115:87f2f5183dfb | 3870 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels |
Kojto | 115:87f2f5183dfb | 3871 | * @param[in] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3872 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3873 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3874 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 3875 | * @return none. |
Kojto | 115:87f2f5183dfb | 3876 | */ |
Kojto | 115:87f2f5183dfb | 3877 | |
Kojto | 115:87f2f5183dfb | 3878 | void arm_biquad_cascade_stereo_df2T_f32( |
Kojto | 115:87f2f5183dfb | 3879 | const arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3880 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3881 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 3882 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3883 | |
Kojto | 115:87f2f5183dfb | 3884 | /** |
Kojto | 115:87f2f5183dfb | 3885 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3886 | * @param[in] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3887 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 3888 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 3889 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 3890 | * @return none. |
Kojto | 115:87f2f5183dfb | 3891 | */ |
Kojto | 115:87f2f5183dfb | 3892 | |
Kojto | 115:87f2f5183dfb | 3893 | void arm_biquad_cascade_df2T_f64( |
Kojto | 115:87f2f5183dfb | 3894 | const arm_biquad_cascade_df2T_instance_f64 * S, |
Kojto | 115:87f2f5183dfb | 3895 | float64_t * pSrc, |
Kojto | 115:87f2f5183dfb | 3896 | float64_t * pDst, |
Kojto | 115:87f2f5183dfb | 3897 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 3898 | |
Kojto | 115:87f2f5183dfb | 3899 | |
Kojto | 115:87f2f5183dfb | 3900 | /** |
Kojto | 115:87f2f5183dfb | 3901 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3902 | * @param[in,out] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3903 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 3904 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3905 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3906 | * @return none |
Kojto | 115:87f2f5183dfb | 3907 | */ |
Kojto | 115:87f2f5183dfb | 3908 | |
Kojto | 115:87f2f5183dfb | 3909 | void arm_biquad_cascade_df2T_init_f32( |
Kojto | 115:87f2f5183dfb | 3910 | arm_biquad_cascade_df2T_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3911 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 3912 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3913 | float32_t * pState); |
Kojto | 115:87f2f5183dfb | 3914 | |
Kojto | 115:87f2f5183dfb | 3915 | |
Kojto | 115:87f2f5183dfb | 3916 | /** |
Kojto | 115:87f2f5183dfb | 3917 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3918 | * @param[in,out] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3919 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 3920 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3921 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3922 | * @return none |
Kojto | 115:87f2f5183dfb | 3923 | */ |
Kojto | 115:87f2f5183dfb | 3924 | |
Kojto | 115:87f2f5183dfb | 3925 | void arm_biquad_cascade_stereo_df2T_init_f32( |
Kojto | 115:87f2f5183dfb | 3926 | arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 3927 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 3928 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3929 | float32_t * pState); |
Kojto | 115:87f2f5183dfb | 3930 | |
Kojto | 115:87f2f5183dfb | 3931 | |
Kojto | 115:87f2f5183dfb | 3932 | /** |
Kojto | 115:87f2f5183dfb | 3933 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
Kojto | 115:87f2f5183dfb | 3934 | * @param[in,out] *S points to an instance of the filter data structure. |
Kojto | 115:87f2f5183dfb | 3935 | * @param[in] numStages number of 2nd order stages in the filter. |
Kojto | 115:87f2f5183dfb | 3936 | * @param[in] *pCoeffs points to the filter coefficients. |
Kojto | 115:87f2f5183dfb | 3937 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 3938 | * @return none |
Kojto | 115:87f2f5183dfb | 3939 | */ |
Kojto | 115:87f2f5183dfb | 3940 | |
Kojto | 115:87f2f5183dfb | 3941 | void arm_biquad_cascade_df2T_init_f64( |
Kojto | 115:87f2f5183dfb | 3942 | arm_biquad_cascade_df2T_instance_f64 * S, |
Kojto | 115:87f2f5183dfb | 3943 | uint8_t numStages, |
Kojto | 115:87f2f5183dfb | 3944 | float64_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3945 | float64_t * pState); |
Kojto | 115:87f2f5183dfb | 3946 | |
Kojto | 115:87f2f5183dfb | 3947 | |
Kojto | 115:87f2f5183dfb | 3948 | |
Kojto | 115:87f2f5183dfb | 3949 | /** |
Kojto | 115:87f2f5183dfb | 3950 | * @brief Instance structure for the Q15 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 3951 | */ |
Kojto | 115:87f2f5183dfb | 3952 | |
Kojto | 115:87f2f5183dfb | 3953 | typedef struct |
Kojto | 115:87f2f5183dfb | 3954 | { |
Kojto | 115:87f2f5183dfb | 3955 | uint16_t numStages; /**< number of filter stages. */ |
Kojto | 115:87f2f5183dfb | 3956 | q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3957 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3958 | } arm_fir_lattice_instance_q15; |
Kojto | 115:87f2f5183dfb | 3959 | |
Kojto | 115:87f2f5183dfb | 3960 | /** |
Kojto | 115:87f2f5183dfb | 3961 | * @brief Instance structure for the Q31 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 3962 | */ |
Kojto | 115:87f2f5183dfb | 3963 | |
Kojto | 115:87f2f5183dfb | 3964 | typedef struct |
Kojto | 115:87f2f5183dfb | 3965 | { |
Kojto | 115:87f2f5183dfb | 3966 | uint16_t numStages; /**< number of filter stages. */ |
Kojto | 115:87f2f5183dfb | 3967 | q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3968 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3969 | } arm_fir_lattice_instance_q31; |
Kojto | 115:87f2f5183dfb | 3970 | |
Kojto | 115:87f2f5183dfb | 3971 | /** |
Kojto | 115:87f2f5183dfb | 3972 | * @brief Instance structure for the floating-point FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 3973 | */ |
Kojto | 115:87f2f5183dfb | 3974 | |
Kojto | 115:87f2f5183dfb | 3975 | typedef struct |
Kojto | 115:87f2f5183dfb | 3976 | { |
Kojto | 115:87f2f5183dfb | 3977 | uint16_t numStages; /**< number of filter stages. */ |
Kojto | 115:87f2f5183dfb | 3978 | float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3979 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 3980 | } arm_fir_lattice_instance_f32; |
Kojto | 115:87f2f5183dfb | 3981 | |
Kojto | 115:87f2f5183dfb | 3982 | /** |
Kojto | 115:87f2f5183dfb | 3983 | * @brief Initialization function for the Q15 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 3984 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 3985 | * @param[in] numStages number of filter stages. |
Kojto | 115:87f2f5183dfb | 3986 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 3987 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 3988 | * @return none. |
Kojto | 115:87f2f5183dfb | 3989 | */ |
Kojto | 115:87f2f5183dfb | 3990 | |
Kojto | 115:87f2f5183dfb | 3991 | void arm_fir_lattice_init_q15( |
Kojto | 115:87f2f5183dfb | 3992 | arm_fir_lattice_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 3993 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 3994 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 3995 | q15_t * pState); |
Kojto | 115:87f2f5183dfb | 3996 | |
Kojto | 115:87f2f5183dfb | 3997 | |
Kojto | 115:87f2f5183dfb | 3998 | /** |
Kojto | 115:87f2f5183dfb | 3999 | * @brief Processing function for the Q15 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4000 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4001 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4002 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4003 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4004 | * @return none. |
Kojto | 115:87f2f5183dfb | 4005 | */ |
Kojto | 115:87f2f5183dfb | 4006 | void arm_fir_lattice_q15( |
Kojto | 115:87f2f5183dfb | 4007 | const arm_fir_lattice_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4008 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4009 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4010 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4011 | |
Kojto | 115:87f2f5183dfb | 4012 | /** |
Kojto | 115:87f2f5183dfb | 4013 | * @brief Initialization function for the Q31 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4014 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4015 | * @param[in] numStages number of filter stages. |
Kojto | 115:87f2f5183dfb | 4016 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4017 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4018 | * @return none. |
Kojto | 115:87f2f5183dfb | 4019 | */ |
Kojto | 115:87f2f5183dfb | 4020 | |
Kojto | 115:87f2f5183dfb | 4021 | void arm_fir_lattice_init_q31( |
Kojto | 115:87f2f5183dfb | 4022 | arm_fir_lattice_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4023 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 4024 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4025 | q31_t * pState); |
Kojto | 115:87f2f5183dfb | 4026 | |
Kojto | 115:87f2f5183dfb | 4027 | |
Kojto | 115:87f2f5183dfb | 4028 | /** |
Kojto | 115:87f2f5183dfb | 4029 | * @brief Processing function for the Q31 FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4030 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4031 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4032 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4033 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4034 | * @return none. |
Kojto | 115:87f2f5183dfb | 4035 | */ |
Kojto | 115:87f2f5183dfb | 4036 | |
Kojto | 115:87f2f5183dfb | 4037 | void arm_fir_lattice_q31( |
Kojto | 115:87f2f5183dfb | 4038 | const arm_fir_lattice_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4039 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4040 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 4041 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4042 | |
Kojto | 115:87f2f5183dfb | 4043 | /** |
Kojto | 115:87f2f5183dfb | 4044 | * @brief Initialization function for the floating-point FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4045 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4046 | * @param[in] numStages number of filter stages. |
Kojto | 115:87f2f5183dfb | 4047 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4048 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4049 | * @return none. |
Kojto | 115:87f2f5183dfb | 4050 | */ |
Kojto | 115:87f2f5183dfb | 4051 | |
Kojto | 115:87f2f5183dfb | 4052 | void arm_fir_lattice_init_f32( |
Kojto | 115:87f2f5183dfb | 4053 | arm_fir_lattice_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4054 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 4055 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4056 | float32_t * pState); |
Kojto | 115:87f2f5183dfb | 4057 | |
Kojto | 115:87f2f5183dfb | 4058 | /** |
Kojto | 115:87f2f5183dfb | 4059 | * @brief Processing function for the floating-point FIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4060 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4061 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4062 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4063 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4064 | * @return none. |
Kojto | 115:87f2f5183dfb | 4065 | */ |
Kojto | 115:87f2f5183dfb | 4066 | |
Kojto | 115:87f2f5183dfb | 4067 | void arm_fir_lattice_f32( |
Kojto | 115:87f2f5183dfb | 4068 | const arm_fir_lattice_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4069 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4070 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 4071 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4072 | |
Kojto | 115:87f2f5183dfb | 4073 | /** |
Kojto | 115:87f2f5183dfb | 4074 | * @brief Instance structure for the Q15 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4075 | */ |
Kojto | 115:87f2f5183dfb | 4076 | typedef struct |
Kojto | 115:87f2f5183dfb | 4077 | { |
Kojto | 115:87f2f5183dfb | 4078 | uint16_t numStages; /**< number of stages in the filter. */ |
Kojto | 115:87f2f5183dfb | 4079 | q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
Kojto | 115:87f2f5183dfb | 4080 | q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 4081 | q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
Kojto | 115:87f2f5183dfb | 4082 | } arm_iir_lattice_instance_q15; |
Kojto | 115:87f2f5183dfb | 4083 | |
Kojto | 115:87f2f5183dfb | 4084 | /** |
Kojto | 115:87f2f5183dfb | 4085 | * @brief Instance structure for the Q31 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4086 | */ |
Kojto | 115:87f2f5183dfb | 4087 | typedef struct |
Kojto | 115:87f2f5183dfb | 4088 | { |
Kojto | 115:87f2f5183dfb | 4089 | uint16_t numStages; /**< number of stages in the filter. */ |
Kojto | 115:87f2f5183dfb | 4090 | q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
Kojto | 115:87f2f5183dfb | 4091 | q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 4092 | q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
Kojto | 115:87f2f5183dfb | 4093 | } arm_iir_lattice_instance_q31; |
Kojto | 115:87f2f5183dfb | 4094 | |
Kojto | 115:87f2f5183dfb | 4095 | /** |
Kojto | 115:87f2f5183dfb | 4096 | * @brief Instance structure for the floating-point IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4097 | */ |
Kojto | 115:87f2f5183dfb | 4098 | typedef struct |
Kojto | 115:87f2f5183dfb | 4099 | { |
Kojto | 115:87f2f5183dfb | 4100 | uint16_t numStages; /**< number of stages in the filter. */ |
Kojto | 115:87f2f5183dfb | 4101 | float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
Kojto | 115:87f2f5183dfb | 4102 | float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
Kojto | 115:87f2f5183dfb | 4103 | float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
Kojto | 115:87f2f5183dfb | 4104 | } arm_iir_lattice_instance_f32; |
Kojto | 115:87f2f5183dfb | 4105 | |
Kojto | 115:87f2f5183dfb | 4106 | /** |
Kojto | 115:87f2f5183dfb | 4107 | * @brief Processing function for the floating-point IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4108 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4109 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4110 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4111 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4112 | * @return none. |
Kojto | 115:87f2f5183dfb | 4113 | */ |
Kojto | 115:87f2f5183dfb | 4114 | |
Kojto | 115:87f2f5183dfb | 4115 | void arm_iir_lattice_f32( |
Kojto | 115:87f2f5183dfb | 4116 | const arm_iir_lattice_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4117 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4118 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 4119 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4120 | |
Kojto | 115:87f2f5183dfb | 4121 | /** |
Kojto | 115:87f2f5183dfb | 4122 | * @brief Initialization function for the floating-point IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4123 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4124 | * @param[in] numStages number of stages in the filter. |
Kojto | 115:87f2f5183dfb | 4125 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4126 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
Kojto | 115:87f2f5183dfb | 4127 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1. |
Kojto | 115:87f2f5183dfb | 4128 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4129 | * @return none. |
Kojto | 115:87f2f5183dfb | 4130 | */ |
Kojto | 115:87f2f5183dfb | 4131 | |
Kojto | 115:87f2f5183dfb | 4132 | void arm_iir_lattice_init_f32( |
Kojto | 115:87f2f5183dfb | 4133 | arm_iir_lattice_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4134 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 4135 | float32_t * pkCoeffs, |
Kojto | 115:87f2f5183dfb | 4136 | float32_t * pvCoeffs, |
Kojto | 115:87f2f5183dfb | 4137 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 4138 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4139 | |
Kojto | 115:87f2f5183dfb | 4140 | |
Kojto | 115:87f2f5183dfb | 4141 | /** |
Kojto | 115:87f2f5183dfb | 4142 | * @brief Processing function for the Q31 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4143 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4144 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4145 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4146 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4147 | * @return none. |
Kojto | 115:87f2f5183dfb | 4148 | */ |
Kojto | 115:87f2f5183dfb | 4149 | |
Kojto | 115:87f2f5183dfb | 4150 | void arm_iir_lattice_q31( |
Kojto | 115:87f2f5183dfb | 4151 | const arm_iir_lattice_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4152 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4153 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 4154 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4155 | |
Kojto | 115:87f2f5183dfb | 4156 | |
Kojto | 115:87f2f5183dfb | 4157 | /** |
Kojto | 115:87f2f5183dfb | 4158 | * @brief Initialization function for the Q31 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4159 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4160 | * @param[in] numStages number of stages in the filter. |
Kojto | 115:87f2f5183dfb | 4161 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4162 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
Kojto | 115:87f2f5183dfb | 4163 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. |
Kojto | 115:87f2f5183dfb | 4164 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4165 | * @return none. |
Kojto | 115:87f2f5183dfb | 4166 | */ |
Kojto | 115:87f2f5183dfb | 4167 | |
Kojto | 115:87f2f5183dfb | 4168 | void arm_iir_lattice_init_q31( |
Kojto | 115:87f2f5183dfb | 4169 | arm_iir_lattice_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4170 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 4171 | q31_t * pkCoeffs, |
Kojto | 115:87f2f5183dfb | 4172 | q31_t * pvCoeffs, |
Kojto | 115:87f2f5183dfb | 4173 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 4174 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4175 | |
Kojto | 115:87f2f5183dfb | 4176 | |
Kojto | 115:87f2f5183dfb | 4177 | /** |
Kojto | 115:87f2f5183dfb | 4178 | * @brief Processing function for the Q15 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4179 | * @param[in] *S points to an instance of the Q15 IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4180 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4181 | * @param[out] *pDst points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4182 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4183 | * @return none. |
Kojto | 115:87f2f5183dfb | 4184 | */ |
Kojto | 115:87f2f5183dfb | 4185 | |
Kojto | 115:87f2f5183dfb | 4186 | void arm_iir_lattice_q15( |
Kojto | 115:87f2f5183dfb | 4187 | const arm_iir_lattice_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4188 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4189 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4190 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4191 | |
Kojto | 115:87f2f5183dfb | 4192 | |
Kojto | 115:87f2f5183dfb | 4193 | /** |
Kojto | 115:87f2f5183dfb | 4194 | * @brief Initialization function for the Q15 IIR lattice filter. |
Kojto | 115:87f2f5183dfb | 4195 | * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure. |
Kojto | 115:87f2f5183dfb | 4196 | * @param[in] numStages number of stages in the filter. |
Kojto | 115:87f2f5183dfb | 4197 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. |
Kojto | 115:87f2f5183dfb | 4198 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. |
Kojto | 115:87f2f5183dfb | 4199 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. |
Kojto | 115:87f2f5183dfb | 4200 | * @param[in] blockSize number of samples to process per call. |
Kojto | 115:87f2f5183dfb | 4201 | * @return none. |
Kojto | 115:87f2f5183dfb | 4202 | */ |
Kojto | 115:87f2f5183dfb | 4203 | |
Kojto | 115:87f2f5183dfb | 4204 | void arm_iir_lattice_init_q15( |
Kojto | 115:87f2f5183dfb | 4205 | arm_iir_lattice_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4206 | uint16_t numStages, |
Kojto | 115:87f2f5183dfb | 4207 | q15_t * pkCoeffs, |
Kojto | 115:87f2f5183dfb | 4208 | q15_t * pvCoeffs, |
Kojto | 115:87f2f5183dfb | 4209 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 4210 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4211 | |
Kojto | 115:87f2f5183dfb | 4212 | /** |
Kojto | 115:87f2f5183dfb | 4213 | * @brief Instance structure for the floating-point LMS filter. |
Kojto | 115:87f2f5183dfb | 4214 | */ |
Kojto | 115:87f2f5183dfb | 4215 | |
Kojto | 115:87f2f5183dfb | 4216 | typedef struct |
Kojto | 115:87f2f5183dfb | 4217 | { |
Kojto | 115:87f2f5183dfb | 4218 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4219 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4220 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4221 | float32_t mu; /**< step size that controls filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4222 | } arm_lms_instance_f32; |
Kojto | 115:87f2f5183dfb | 4223 | |
Kojto | 115:87f2f5183dfb | 4224 | /** |
Kojto | 115:87f2f5183dfb | 4225 | * @brief Processing function for floating-point LMS filter. |
Kojto | 115:87f2f5183dfb | 4226 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4227 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4228 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4229 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4230 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4231 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4232 | * @return none. |
Kojto | 115:87f2f5183dfb | 4233 | */ |
Kojto | 115:87f2f5183dfb | 4234 | |
Kojto | 115:87f2f5183dfb | 4235 | void arm_lms_f32( |
Kojto | 115:87f2f5183dfb | 4236 | const arm_lms_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4237 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4238 | float32_t * pRef, |
Kojto | 115:87f2f5183dfb | 4239 | float32_t * pOut, |
Kojto | 115:87f2f5183dfb | 4240 | float32_t * pErr, |
Kojto | 115:87f2f5183dfb | 4241 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4242 | |
Kojto | 115:87f2f5183dfb | 4243 | /** |
Kojto | 115:87f2f5183dfb | 4244 | * @brief Initialization function for floating-point LMS filter. |
Kojto | 115:87f2f5183dfb | 4245 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4246 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4247 | * @param[in] *pCoeffs points to the coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4248 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 4249 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4250 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4251 | * @return none. |
Kojto | 115:87f2f5183dfb | 4252 | */ |
Kojto | 115:87f2f5183dfb | 4253 | |
Kojto | 115:87f2f5183dfb | 4254 | void arm_lms_init_f32( |
Kojto | 115:87f2f5183dfb | 4255 | arm_lms_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4256 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4257 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4258 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 4259 | float32_t mu, |
Kojto | 115:87f2f5183dfb | 4260 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4261 | |
Kojto | 115:87f2f5183dfb | 4262 | /** |
Kojto | 115:87f2f5183dfb | 4263 | * @brief Instance structure for the Q15 LMS filter. |
Kojto | 115:87f2f5183dfb | 4264 | */ |
Kojto | 115:87f2f5183dfb | 4265 | |
Kojto | 115:87f2f5183dfb | 4266 | typedef struct |
Kojto | 115:87f2f5183dfb | 4267 | { |
Kojto | 115:87f2f5183dfb | 4268 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4269 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4270 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4271 | q15_t mu; /**< step size that controls filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4272 | uint32_t postShift; /**< bit shift applied to coefficients. */ |
Kojto | 115:87f2f5183dfb | 4273 | } arm_lms_instance_q15; |
Kojto | 115:87f2f5183dfb | 4274 | |
Kojto | 115:87f2f5183dfb | 4275 | |
Kojto | 115:87f2f5183dfb | 4276 | /** |
Kojto | 115:87f2f5183dfb | 4277 | * @brief Initialization function for the Q15 LMS filter. |
Kojto | 115:87f2f5183dfb | 4278 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4279 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4280 | * @param[in] *pCoeffs points to the coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4281 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 4282 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4283 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4284 | * @param[in] postShift bit shift applied to coefficients. |
Kojto | 115:87f2f5183dfb | 4285 | * @return none. |
Kojto | 115:87f2f5183dfb | 4286 | */ |
Kojto | 115:87f2f5183dfb | 4287 | |
Kojto | 115:87f2f5183dfb | 4288 | void arm_lms_init_q15( |
Kojto | 115:87f2f5183dfb | 4289 | arm_lms_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4290 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4291 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4292 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 4293 | q15_t mu, |
Kojto | 115:87f2f5183dfb | 4294 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 4295 | uint32_t postShift); |
Kojto | 115:87f2f5183dfb | 4296 | |
Kojto | 115:87f2f5183dfb | 4297 | /** |
Kojto | 115:87f2f5183dfb | 4298 | * @brief Processing function for Q15 LMS filter. |
Kojto | 115:87f2f5183dfb | 4299 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4300 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4301 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4302 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4303 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4304 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4305 | * @return none. |
Kojto | 115:87f2f5183dfb | 4306 | */ |
Kojto | 115:87f2f5183dfb | 4307 | |
Kojto | 115:87f2f5183dfb | 4308 | void arm_lms_q15( |
Kojto | 115:87f2f5183dfb | 4309 | const arm_lms_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4310 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4311 | q15_t * pRef, |
Kojto | 115:87f2f5183dfb | 4312 | q15_t * pOut, |
Kojto | 115:87f2f5183dfb | 4313 | q15_t * pErr, |
Kojto | 115:87f2f5183dfb | 4314 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4315 | |
Kojto | 115:87f2f5183dfb | 4316 | |
Kojto | 115:87f2f5183dfb | 4317 | /** |
Kojto | 115:87f2f5183dfb | 4318 | * @brief Instance structure for the Q31 LMS filter. |
Kojto | 115:87f2f5183dfb | 4319 | */ |
Kojto | 115:87f2f5183dfb | 4320 | |
Kojto | 115:87f2f5183dfb | 4321 | typedef struct |
Kojto | 115:87f2f5183dfb | 4322 | { |
Kojto | 115:87f2f5183dfb | 4323 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4324 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4325 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4326 | q31_t mu; /**< step size that controls filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4327 | uint32_t postShift; /**< bit shift applied to coefficients. */ |
Kojto | 115:87f2f5183dfb | 4328 | |
Kojto | 115:87f2f5183dfb | 4329 | } arm_lms_instance_q31; |
Kojto | 115:87f2f5183dfb | 4330 | |
Kojto | 115:87f2f5183dfb | 4331 | /** |
Kojto | 115:87f2f5183dfb | 4332 | * @brief Processing function for Q31 LMS filter. |
Kojto | 115:87f2f5183dfb | 4333 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4334 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4335 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4336 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4337 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4338 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4339 | * @return none. |
Kojto | 115:87f2f5183dfb | 4340 | */ |
Kojto | 115:87f2f5183dfb | 4341 | |
Kojto | 115:87f2f5183dfb | 4342 | void arm_lms_q31( |
Kojto | 115:87f2f5183dfb | 4343 | const arm_lms_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4344 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4345 | q31_t * pRef, |
Kojto | 115:87f2f5183dfb | 4346 | q31_t * pOut, |
Kojto | 115:87f2f5183dfb | 4347 | q31_t * pErr, |
Kojto | 115:87f2f5183dfb | 4348 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4349 | |
Kojto | 115:87f2f5183dfb | 4350 | /** |
Kojto | 115:87f2f5183dfb | 4351 | * @brief Initialization function for Q31 LMS filter. |
Kojto | 115:87f2f5183dfb | 4352 | * @param[in] *S points to an instance of the Q31 LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4353 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4354 | * @param[in] *pCoeffs points to coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4355 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 4356 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4357 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4358 | * @param[in] postShift bit shift applied to coefficients. |
Kojto | 115:87f2f5183dfb | 4359 | * @return none. |
Kojto | 115:87f2f5183dfb | 4360 | */ |
Kojto | 115:87f2f5183dfb | 4361 | |
Kojto | 115:87f2f5183dfb | 4362 | void arm_lms_init_q31( |
Kojto | 115:87f2f5183dfb | 4363 | arm_lms_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4364 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4365 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4366 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 4367 | q31_t mu, |
Kojto | 115:87f2f5183dfb | 4368 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 4369 | uint32_t postShift); |
Kojto | 115:87f2f5183dfb | 4370 | |
Kojto | 115:87f2f5183dfb | 4371 | /** |
Kojto | 115:87f2f5183dfb | 4372 | * @brief Instance structure for the floating-point normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4373 | */ |
Kojto | 115:87f2f5183dfb | 4374 | |
Kojto | 115:87f2f5183dfb | 4375 | typedef struct |
Kojto | 115:87f2f5183dfb | 4376 | { |
Kojto | 115:87f2f5183dfb | 4377 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4378 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4379 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4380 | float32_t mu; /**< step size that control filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4381 | float32_t energy; /**< saves previous frame energy. */ |
Kojto | 115:87f2f5183dfb | 4382 | float32_t x0; /**< saves previous input sample. */ |
Kojto | 115:87f2f5183dfb | 4383 | } arm_lms_norm_instance_f32; |
Kojto | 115:87f2f5183dfb | 4384 | |
Kojto | 115:87f2f5183dfb | 4385 | /** |
Kojto | 115:87f2f5183dfb | 4386 | * @brief Processing function for floating-point normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4387 | * @param[in] *S points to an instance of the floating-point normalized LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4388 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4389 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4390 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4391 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4392 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4393 | * @return none. |
Kojto | 115:87f2f5183dfb | 4394 | */ |
Kojto | 115:87f2f5183dfb | 4395 | |
Kojto | 115:87f2f5183dfb | 4396 | void arm_lms_norm_f32( |
Kojto | 115:87f2f5183dfb | 4397 | arm_lms_norm_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4398 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4399 | float32_t * pRef, |
Kojto | 115:87f2f5183dfb | 4400 | float32_t * pOut, |
Kojto | 115:87f2f5183dfb | 4401 | float32_t * pErr, |
Kojto | 115:87f2f5183dfb | 4402 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4403 | |
Kojto | 115:87f2f5183dfb | 4404 | /** |
Kojto | 115:87f2f5183dfb | 4405 | * @brief Initialization function for floating-point normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4406 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4407 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4408 | * @param[in] *pCoeffs points to coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4409 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 4410 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4411 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4412 | * @return none. |
Kojto | 115:87f2f5183dfb | 4413 | */ |
Kojto | 115:87f2f5183dfb | 4414 | |
Kojto | 115:87f2f5183dfb | 4415 | void arm_lms_norm_init_f32( |
Kojto | 115:87f2f5183dfb | 4416 | arm_lms_norm_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4417 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4418 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4419 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 4420 | float32_t mu, |
Kojto | 115:87f2f5183dfb | 4421 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4422 | |
Kojto | 115:87f2f5183dfb | 4423 | |
Kojto | 115:87f2f5183dfb | 4424 | /** |
Kojto | 115:87f2f5183dfb | 4425 | * @brief Instance structure for the Q31 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4426 | */ |
Kojto | 115:87f2f5183dfb | 4427 | typedef struct |
Kojto | 115:87f2f5183dfb | 4428 | { |
Kojto | 115:87f2f5183dfb | 4429 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4430 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4431 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4432 | q31_t mu; /**< step size that controls filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4433 | uint8_t postShift; /**< bit shift applied to coefficients. */ |
Kojto | 115:87f2f5183dfb | 4434 | q31_t *recipTable; /**< points to the reciprocal initial value table. */ |
Kojto | 115:87f2f5183dfb | 4435 | q31_t energy; /**< saves previous frame energy. */ |
Kojto | 115:87f2f5183dfb | 4436 | q31_t x0; /**< saves previous input sample. */ |
Kojto | 115:87f2f5183dfb | 4437 | } arm_lms_norm_instance_q31; |
Kojto | 115:87f2f5183dfb | 4438 | |
Kojto | 115:87f2f5183dfb | 4439 | /** |
Kojto | 115:87f2f5183dfb | 4440 | * @brief Processing function for Q31 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4441 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4442 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4443 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4444 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4445 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4446 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4447 | * @return none. |
Kojto | 115:87f2f5183dfb | 4448 | */ |
Kojto | 115:87f2f5183dfb | 4449 | |
Kojto | 115:87f2f5183dfb | 4450 | void arm_lms_norm_q31( |
Kojto | 115:87f2f5183dfb | 4451 | arm_lms_norm_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4452 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4453 | q31_t * pRef, |
Kojto | 115:87f2f5183dfb | 4454 | q31_t * pOut, |
Kojto | 115:87f2f5183dfb | 4455 | q31_t * pErr, |
Kojto | 115:87f2f5183dfb | 4456 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4457 | |
Kojto | 115:87f2f5183dfb | 4458 | /** |
Kojto | 115:87f2f5183dfb | 4459 | * @brief Initialization function for Q31 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4460 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4461 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4462 | * @param[in] *pCoeffs points to coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4463 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 4464 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4465 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4466 | * @param[in] postShift bit shift applied to coefficients. |
Kojto | 115:87f2f5183dfb | 4467 | * @return none. |
Kojto | 115:87f2f5183dfb | 4468 | */ |
Kojto | 115:87f2f5183dfb | 4469 | |
Kojto | 115:87f2f5183dfb | 4470 | void arm_lms_norm_init_q31( |
Kojto | 115:87f2f5183dfb | 4471 | arm_lms_norm_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4472 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4473 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4474 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 4475 | q31_t mu, |
Kojto | 115:87f2f5183dfb | 4476 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 4477 | uint8_t postShift); |
Kojto | 115:87f2f5183dfb | 4478 | |
Kojto | 115:87f2f5183dfb | 4479 | /** |
Kojto | 115:87f2f5183dfb | 4480 | * @brief Instance structure for the Q15 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4481 | */ |
Kojto | 115:87f2f5183dfb | 4482 | |
Kojto | 115:87f2f5183dfb | 4483 | typedef struct |
Kojto | 115:87f2f5183dfb | 4484 | { |
Kojto | 115:87f2f5183dfb | 4485 | uint16_t numTaps; /**< Number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4486 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4487 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4488 | q15_t mu; /**< step size that controls filter coefficient updates. */ |
Kojto | 115:87f2f5183dfb | 4489 | uint8_t postShift; /**< bit shift applied to coefficients. */ |
Kojto | 115:87f2f5183dfb | 4490 | q15_t *recipTable; /**< Points to the reciprocal initial value table. */ |
Kojto | 115:87f2f5183dfb | 4491 | q15_t energy; /**< saves previous frame energy. */ |
Kojto | 115:87f2f5183dfb | 4492 | q15_t x0; /**< saves previous input sample. */ |
Kojto | 115:87f2f5183dfb | 4493 | } arm_lms_norm_instance_q15; |
Kojto | 115:87f2f5183dfb | 4494 | |
Kojto | 115:87f2f5183dfb | 4495 | /** |
Kojto | 115:87f2f5183dfb | 4496 | * @brief Processing function for Q15 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4497 | * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4498 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4499 | * @param[in] *pRef points to the block of reference data. |
Kojto | 115:87f2f5183dfb | 4500 | * @param[out] *pOut points to the block of output data. |
Kojto | 115:87f2f5183dfb | 4501 | * @param[out] *pErr points to the block of error data. |
Kojto | 115:87f2f5183dfb | 4502 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4503 | * @return none. |
Kojto | 115:87f2f5183dfb | 4504 | */ |
Kojto | 115:87f2f5183dfb | 4505 | |
Kojto | 115:87f2f5183dfb | 4506 | void arm_lms_norm_q15( |
Kojto | 115:87f2f5183dfb | 4507 | arm_lms_norm_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4508 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4509 | q15_t * pRef, |
Kojto | 115:87f2f5183dfb | 4510 | q15_t * pOut, |
Kojto | 115:87f2f5183dfb | 4511 | q15_t * pErr, |
Kojto | 115:87f2f5183dfb | 4512 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4513 | |
Kojto | 115:87f2f5183dfb | 4514 | |
Kojto | 115:87f2f5183dfb | 4515 | /** |
Kojto | 115:87f2f5183dfb | 4516 | * @brief Initialization function for Q15 normalized LMS filter. |
Kojto | 115:87f2f5183dfb | 4517 | * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. |
Kojto | 115:87f2f5183dfb | 4518 | * @param[in] numTaps number of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4519 | * @param[in] *pCoeffs points to coefficient buffer. |
Kojto | 115:87f2f5183dfb | 4520 | * @param[in] *pState points to state buffer. |
Kojto | 115:87f2f5183dfb | 4521 | * @param[in] mu step size that controls filter coefficient updates. |
Kojto | 115:87f2f5183dfb | 4522 | * @param[in] blockSize number of samples to process. |
Kojto | 115:87f2f5183dfb | 4523 | * @param[in] postShift bit shift applied to coefficients. |
Kojto | 115:87f2f5183dfb | 4524 | * @return none. |
Kojto | 115:87f2f5183dfb | 4525 | */ |
Kojto | 115:87f2f5183dfb | 4526 | |
Kojto | 115:87f2f5183dfb | 4527 | void arm_lms_norm_init_q15( |
Kojto | 115:87f2f5183dfb | 4528 | arm_lms_norm_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4529 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4530 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4531 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 4532 | q15_t mu, |
Kojto | 115:87f2f5183dfb | 4533 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 4534 | uint8_t postShift); |
Kojto | 115:87f2f5183dfb | 4535 | |
Kojto | 115:87f2f5183dfb | 4536 | /** |
Kojto | 115:87f2f5183dfb | 4537 | * @brief Correlation of floating-point sequences. |
Kojto | 115:87f2f5183dfb | 4538 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4539 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4540 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4541 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4542 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4543 | * @return none. |
Kojto | 115:87f2f5183dfb | 4544 | */ |
Kojto | 115:87f2f5183dfb | 4545 | |
Kojto | 115:87f2f5183dfb | 4546 | void arm_correlate_f32( |
Kojto | 115:87f2f5183dfb | 4547 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4548 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4549 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4550 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4551 | float32_t * pDst); |
Kojto | 115:87f2f5183dfb | 4552 | |
Kojto | 115:87f2f5183dfb | 4553 | |
Kojto | 115:87f2f5183dfb | 4554 | /** |
Kojto | 115:87f2f5183dfb | 4555 | * @brief Correlation of Q15 sequences |
Kojto | 115:87f2f5183dfb | 4556 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4557 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4558 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4559 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4560 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4561 | * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 4562 | * @return none. |
Kojto | 115:87f2f5183dfb | 4563 | */ |
Kojto | 115:87f2f5183dfb | 4564 | void arm_correlate_opt_q15( |
Kojto | 115:87f2f5183dfb | 4565 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4566 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4567 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4568 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4569 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4570 | q15_t * pScratch); |
Kojto | 115:87f2f5183dfb | 4571 | |
Kojto | 115:87f2f5183dfb | 4572 | |
Kojto | 115:87f2f5183dfb | 4573 | /** |
Kojto | 115:87f2f5183dfb | 4574 | * @brief Correlation of Q15 sequences. |
Kojto | 115:87f2f5183dfb | 4575 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4576 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4577 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4578 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4579 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4580 | * @return none. |
Kojto | 115:87f2f5183dfb | 4581 | */ |
Kojto | 115:87f2f5183dfb | 4582 | |
Kojto | 115:87f2f5183dfb | 4583 | void arm_correlate_q15( |
Kojto | 115:87f2f5183dfb | 4584 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4585 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4586 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4587 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4588 | q15_t * pDst); |
Kojto | 115:87f2f5183dfb | 4589 | |
Kojto | 115:87f2f5183dfb | 4590 | /** |
Kojto | 115:87f2f5183dfb | 4591 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 4592 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4593 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4594 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4595 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4596 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4597 | * @return none. |
Kojto | 115:87f2f5183dfb | 4598 | */ |
Kojto | 115:87f2f5183dfb | 4599 | |
Kojto | 115:87f2f5183dfb | 4600 | void arm_correlate_fast_q15( |
Kojto | 115:87f2f5183dfb | 4601 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4602 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4603 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4604 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4605 | q15_t * pDst); |
Kojto | 115:87f2f5183dfb | 4606 | |
Kojto | 115:87f2f5183dfb | 4607 | |
Kojto | 115:87f2f5183dfb | 4608 | |
Kojto | 115:87f2f5183dfb | 4609 | /** |
Kojto | 115:87f2f5183dfb | 4610 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
Kojto | 115:87f2f5183dfb | 4611 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4612 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4613 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4614 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4615 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4616 | * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 4617 | * @return none. |
Kojto | 115:87f2f5183dfb | 4618 | */ |
Kojto | 115:87f2f5183dfb | 4619 | |
Kojto | 115:87f2f5183dfb | 4620 | void arm_correlate_fast_opt_q15( |
Kojto | 115:87f2f5183dfb | 4621 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4622 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4623 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4624 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4625 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4626 | q15_t * pScratch); |
Kojto | 115:87f2f5183dfb | 4627 | |
Kojto | 115:87f2f5183dfb | 4628 | /** |
Kojto | 115:87f2f5183dfb | 4629 | * @brief Correlation of Q31 sequences. |
Kojto | 115:87f2f5183dfb | 4630 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4631 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4632 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4633 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4634 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4635 | * @return none. |
Kojto | 115:87f2f5183dfb | 4636 | */ |
Kojto | 115:87f2f5183dfb | 4637 | |
Kojto | 115:87f2f5183dfb | 4638 | void arm_correlate_q31( |
Kojto | 115:87f2f5183dfb | 4639 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4640 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4641 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4642 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4643 | q31_t * pDst); |
Kojto | 115:87f2f5183dfb | 4644 | |
Kojto | 115:87f2f5183dfb | 4645 | /** |
Kojto | 115:87f2f5183dfb | 4646 | * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
Kojto | 115:87f2f5183dfb | 4647 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4648 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4649 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4650 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4651 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4652 | * @return none. |
Kojto | 115:87f2f5183dfb | 4653 | */ |
Kojto | 115:87f2f5183dfb | 4654 | |
Kojto | 115:87f2f5183dfb | 4655 | void arm_correlate_fast_q31( |
Kojto | 115:87f2f5183dfb | 4656 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4657 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4658 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4659 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4660 | q31_t * pDst); |
Kojto | 115:87f2f5183dfb | 4661 | |
Kojto | 115:87f2f5183dfb | 4662 | |
Kojto | 115:87f2f5183dfb | 4663 | |
Kojto | 115:87f2f5183dfb | 4664 | /** |
Kojto | 115:87f2f5183dfb | 4665 | * @brief Correlation of Q7 sequences. |
Kojto | 115:87f2f5183dfb | 4666 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4667 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4668 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4669 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4670 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4671 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
Kojto | 115:87f2f5183dfb | 4672 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
Kojto | 115:87f2f5183dfb | 4673 | * @return none. |
Kojto | 115:87f2f5183dfb | 4674 | */ |
Kojto | 115:87f2f5183dfb | 4675 | |
Kojto | 115:87f2f5183dfb | 4676 | void arm_correlate_opt_q7( |
Kojto | 115:87f2f5183dfb | 4677 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4678 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4679 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4680 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4681 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 4682 | q15_t * pScratch1, |
Kojto | 115:87f2f5183dfb | 4683 | q15_t * pScratch2); |
Kojto | 115:87f2f5183dfb | 4684 | |
Kojto | 115:87f2f5183dfb | 4685 | |
Kojto | 115:87f2f5183dfb | 4686 | /** |
Kojto | 115:87f2f5183dfb | 4687 | * @brief Correlation of Q7 sequences. |
Kojto | 115:87f2f5183dfb | 4688 | * @param[in] *pSrcA points to the first input sequence. |
Kojto | 115:87f2f5183dfb | 4689 | * @param[in] srcALen length of the first input sequence. |
Kojto | 115:87f2f5183dfb | 4690 | * @param[in] *pSrcB points to the second input sequence. |
Kojto | 115:87f2f5183dfb | 4691 | * @param[in] srcBLen length of the second input sequence. |
Kojto | 115:87f2f5183dfb | 4692 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
Kojto | 115:87f2f5183dfb | 4693 | * @return none. |
Kojto | 115:87f2f5183dfb | 4694 | */ |
Kojto | 115:87f2f5183dfb | 4695 | |
Kojto | 115:87f2f5183dfb | 4696 | void arm_correlate_q7( |
Kojto | 115:87f2f5183dfb | 4697 | q7_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 4698 | uint32_t srcALen, |
Kojto | 115:87f2f5183dfb | 4699 | q7_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 4700 | uint32_t srcBLen, |
Kojto | 115:87f2f5183dfb | 4701 | q7_t * pDst); |
Kojto | 115:87f2f5183dfb | 4702 | |
Kojto | 115:87f2f5183dfb | 4703 | |
Kojto | 115:87f2f5183dfb | 4704 | /** |
Kojto | 115:87f2f5183dfb | 4705 | * @brief Instance structure for the floating-point sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4706 | */ |
Kojto | 115:87f2f5183dfb | 4707 | typedef struct |
Kojto | 115:87f2f5183dfb | 4708 | { |
Kojto | 115:87f2f5183dfb | 4709 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4710 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
Kojto | 115:87f2f5183dfb | 4711 | float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4712 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 4713 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
Kojto | 115:87f2f5183dfb | 4714 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4715 | } arm_fir_sparse_instance_f32; |
Kojto | 115:87f2f5183dfb | 4716 | |
Kojto | 115:87f2f5183dfb | 4717 | /** |
Kojto | 115:87f2f5183dfb | 4718 | * @brief Instance structure for the Q31 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4719 | */ |
Kojto | 115:87f2f5183dfb | 4720 | |
Kojto | 115:87f2f5183dfb | 4721 | typedef struct |
Kojto | 115:87f2f5183dfb | 4722 | { |
Kojto | 115:87f2f5183dfb | 4723 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4724 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
Kojto | 115:87f2f5183dfb | 4725 | q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4726 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 4727 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
Kojto | 115:87f2f5183dfb | 4728 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4729 | } arm_fir_sparse_instance_q31; |
Kojto | 115:87f2f5183dfb | 4730 | |
Kojto | 115:87f2f5183dfb | 4731 | /** |
Kojto | 115:87f2f5183dfb | 4732 | * @brief Instance structure for the Q15 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4733 | */ |
Kojto | 115:87f2f5183dfb | 4734 | |
Kojto | 115:87f2f5183dfb | 4735 | typedef struct |
Kojto | 115:87f2f5183dfb | 4736 | { |
Kojto | 115:87f2f5183dfb | 4737 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4738 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
Kojto | 115:87f2f5183dfb | 4739 | q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4740 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 4741 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
Kojto | 115:87f2f5183dfb | 4742 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4743 | } arm_fir_sparse_instance_q15; |
Kojto | 115:87f2f5183dfb | 4744 | |
Kojto | 115:87f2f5183dfb | 4745 | /** |
Kojto | 115:87f2f5183dfb | 4746 | * @brief Instance structure for the Q7 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4747 | */ |
Kojto | 115:87f2f5183dfb | 4748 | |
Kojto | 115:87f2f5183dfb | 4749 | typedef struct |
Kojto | 115:87f2f5183dfb | 4750 | { |
Kojto | 115:87f2f5183dfb | 4751 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
Kojto | 115:87f2f5183dfb | 4752 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
Kojto | 115:87f2f5183dfb | 4753 | q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Kojto | 115:87f2f5183dfb | 4754 | q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
Kojto | 115:87f2f5183dfb | 4755 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
Kojto | 115:87f2f5183dfb | 4756 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
Kojto | 115:87f2f5183dfb | 4757 | } arm_fir_sparse_instance_q7; |
Kojto | 115:87f2f5183dfb | 4758 | |
Kojto | 115:87f2f5183dfb | 4759 | /** |
Kojto | 115:87f2f5183dfb | 4760 | * @brief Processing function for the floating-point sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4761 | * @param[in] *S points to an instance of the floating-point sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4762 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4763 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4764 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4765 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 4766 | * @return none. |
Kojto | 115:87f2f5183dfb | 4767 | */ |
Kojto | 115:87f2f5183dfb | 4768 | |
Kojto | 115:87f2f5183dfb | 4769 | void arm_fir_sparse_f32( |
Kojto | 115:87f2f5183dfb | 4770 | arm_fir_sparse_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4771 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4772 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 4773 | float32_t * pScratchIn, |
Kojto | 115:87f2f5183dfb | 4774 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4775 | |
Kojto | 115:87f2f5183dfb | 4776 | /** |
Kojto | 115:87f2f5183dfb | 4777 | * @brief Initialization function for the floating-point sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4778 | * @param[in,out] *S points to an instance of the floating-point sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4779 | * @param[in] numTaps number of nonzero coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 4780 | * @param[in] *pCoeffs points to the array of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4781 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 4782 | * @param[in] *pTapDelay points to the array of offset times. |
Kojto | 115:87f2f5183dfb | 4783 | * @param[in] maxDelay maximum offset time supported. |
Kojto | 115:87f2f5183dfb | 4784 | * @param[in] blockSize number of samples that will be processed per block. |
Kojto | 115:87f2f5183dfb | 4785 | * @return none |
Kojto | 115:87f2f5183dfb | 4786 | */ |
Kojto | 115:87f2f5183dfb | 4787 | |
Kojto | 115:87f2f5183dfb | 4788 | void arm_fir_sparse_init_f32( |
Kojto | 115:87f2f5183dfb | 4789 | arm_fir_sparse_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 4790 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4791 | float32_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4792 | float32_t * pState, |
Kojto | 115:87f2f5183dfb | 4793 | int32_t * pTapDelay, |
Kojto | 115:87f2f5183dfb | 4794 | uint16_t maxDelay, |
Kojto | 115:87f2f5183dfb | 4795 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4796 | |
Kojto | 115:87f2f5183dfb | 4797 | /** |
Kojto | 115:87f2f5183dfb | 4798 | * @brief Processing function for the Q31 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4799 | * @param[in] *S points to an instance of the Q31 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4800 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4801 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4802 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4803 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 4804 | * @return none. |
Kojto | 115:87f2f5183dfb | 4805 | */ |
Kojto | 115:87f2f5183dfb | 4806 | |
Kojto | 115:87f2f5183dfb | 4807 | void arm_fir_sparse_q31( |
Kojto | 115:87f2f5183dfb | 4808 | arm_fir_sparse_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4809 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4810 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 4811 | q31_t * pScratchIn, |
Kojto | 115:87f2f5183dfb | 4812 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4813 | |
Kojto | 115:87f2f5183dfb | 4814 | /** |
Kojto | 115:87f2f5183dfb | 4815 | * @brief Initialization function for the Q31 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4816 | * @param[in,out] *S points to an instance of the Q31 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4817 | * @param[in] numTaps number of nonzero coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 4818 | * @param[in] *pCoeffs points to the array of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4819 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 4820 | * @param[in] *pTapDelay points to the array of offset times. |
Kojto | 115:87f2f5183dfb | 4821 | * @param[in] maxDelay maximum offset time supported. |
Kojto | 115:87f2f5183dfb | 4822 | * @param[in] blockSize number of samples that will be processed per block. |
Kojto | 115:87f2f5183dfb | 4823 | * @return none |
Kojto | 115:87f2f5183dfb | 4824 | */ |
Kojto | 115:87f2f5183dfb | 4825 | |
Kojto | 115:87f2f5183dfb | 4826 | void arm_fir_sparse_init_q31( |
Kojto | 115:87f2f5183dfb | 4827 | arm_fir_sparse_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 4828 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4829 | q31_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4830 | q31_t * pState, |
Kojto | 115:87f2f5183dfb | 4831 | int32_t * pTapDelay, |
Kojto | 115:87f2f5183dfb | 4832 | uint16_t maxDelay, |
Kojto | 115:87f2f5183dfb | 4833 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4834 | |
Kojto | 115:87f2f5183dfb | 4835 | /** |
Kojto | 115:87f2f5183dfb | 4836 | * @brief Processing function for the Q15 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4837 | * @param[in] *S points to an instance of the Q15 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4838 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4839 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4840 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4841 | * @param[in] *pScratchOut points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4842 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 4843 | * @return none. |
Kojto | 115:87f2f5183dfb | 4844 | */ |
Kojto | 115:87f2f5183dfb | 4845 | |
Kojto | 115:87f2f5183dfb | 4846 | void arm_fir_sparse_q15( |
Kojto | 115:87f2f5183dfb | 4847 | arm_fir_sparse_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4848 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4849 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4850 | q15_t * pScratchIn, |
Kojto | 115:87f2f5183dfb | 4851 | q31_t * pScratchOut, |
Kojto | 115:87f2f5183dfb | 4852 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4853 | |
Kojto | 115:87f2f5183dfb | 4854 | |
Kojto | 115:87f2f5183dfb | 4855 | /** |
Kojto | 115:87f2f5183dfb | 4856 | * @brief Initialization function for the Q15 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4857 | * @param[in,out] *S points to an instance of the Q15 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4858 | * @param[in] numTaps number of nonzero coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 4859 | * @param[in] *pCoeffs points to the array of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4860 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 4861 | * @param[in] *pTapDelay points to the array of offset times. |
Kojto | 115:87f2f5183dfb | 4862 | * @param[in] maxDelay maximum offset time supported. |
Kojto | 115:87f2f5183dfb | 4863 | * @param[in] blockSize number of samples that will be processed per block. |
Kojto | 115:87f2f5183dfb | 4864 | * @return none |
Kojto | 115:87f2f5183dfb | 4865 | */ |
Kojto | 115:87f2f5183dfb | 4866 | |
Kojto | 115:87f2f5183dfb | 4867 | void arm_fir_sparse_init_q15( |
Kojto | 115:87f2f5183dfb | 4868 | arm_fir_sparse_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 4869 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4870 | q15_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4871 | q15_t * pState, |
Kojto | 115:87f2f5183dfb | 4872 | int32_t * pTapDelay, |
Kojto | 115:87f2f5183dfb | 4873 | uint16_t maxDelay, |
Kojto | 115:87f2f5183dfb | 4874 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4875 | |
Kojto | 115:87f2f5183dfb | 4876 | /** |
Kojto | 115:87f2f5183dfb | 4877 | * @brief Processing function for the Q7 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4878 | * @param[in] *S points to an instance of the Q7 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4879 | * @param[in] *pSrc points to the block of input data. |
Kojto | 115:87f2f5183dfb | 4880 | * @param[out] *pDst points to the block of output data |
Kojto | 115:87f2f5183dfb | 4881 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4882 | * @param[in] *pScratchOut points to a temporary buffer of size blockSize. |
Kojto | 115:87f2f5183dfb | 4883 | * @param[in] blockSize number of input samples to process per call. |
Kojto | 115:87f2f5183dfb | 4884 | * @return none. |
Kojto | 115:87f2f5183dfb | 4885 | */ |
Kojto | 115:87f2f5183dfb | 4886 | |
Kojto | 115:87f2f5183dfb | 4887 | void arm_fir_sparse_q7( |
Kojto | 115:87f2f5183dfb | 4888 | arm_fir_sparse_instance_q7 * S, |
Kojto | 115:87f2f5183dfb | 4889 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4890 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 4891 | q7_t * pScratchIn, |
Kojto | 115:87f2f5183dfb | 4892 | q31_t * pScratchOut, |
Kojto | 115:87f2f5183dfb | 4893 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4894 | |
Kojto | 115:87f2f5183dfb | 4895 | /** |
Kojto | 115:87f2f5183dfb | 4896 | * @brief Initialization function for the Q7 sparse FIR filter. |
Kojto | 115:87f2f5183dfb | 4897 | * @param[in,out] *S points to an instance of the Q7 sparse FIR structure. |
Kojto | 115:87f2f5183dfb | 4898 | * @param[in] numTaps number of nonzero coefficients in the filter. |
Kojto | 115:87f2f5183dfb | 4899 | * @param[in] *pCoeffs points to the array of filter coefficients. |
Kojto | 115:87f2f5183dfb | 4900 | * @param[in] *pState points to the state buffer. |
Kojto | 115:87f2f5183dfb | 4901 | * @param[in] *pTapDelay points to the array of offset times. |
Kojto | 115:87f2f5183dfb | 4902 | * @param[in] maxDelay maximum offset time supported. |
Kojto | 115:87f2f5183dfb | 4903 | * @param[in] blockSize number of samples that will be processed per block. |
Kojto | 115:87f2f5183dfb | 4904 | * @return none |
Kojto | 115:87f2f5183dfb | 4905 | */ |
Kojto | 115:87f2f5183dfb | 4906 | |
Kojto | 115:87f2f5183dfb | 4907 | void arm_fir_sparse_init_q7( |
Kojto | 115:87f2f5183dfb | 4908 | arm_fir_sparse_instance_q7 * S, |
Kojto | 115:87f2f5183dfb | 4909 | uint16_t numTaps, |
Kojto | 115:87f2f5183dfb | 4910 | q7_t * pCoeffs, |
Kojto | 115:87f2f5183dfb | 4911 | q7_t * pState, |
Kojto | 115:87f2f5183dfb | 4912 | int32_t * pTapDelay, |
Kojto | 115:87f2f5183dfb | 4913 | uint16_t maxDelay, |
Kojto | 115:87f2f5183dfb | 4914 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 4915 | |
Kojto | 115:87f2f5183dfb | 4916 | |
Kojto | 115:87f2f5183dfb | 4917 | /* |
Kojto | 115:87f2f5183dfb | 4918 | * @brief Floating-point sin_cos function. |
Kojto | 115:87f2f5183dfb | 4919 | * @param[in] theta input value in degrees |
Kojto | 115:87f2f5183dfb | 4920 | * @param[out] *pSinVal points to the processed sine output. |
Kojto | 115:87f2f5183dfb | 4921 | * @param[out] *pCosVal points to the processed cos output. |
Kojto | 115:87f2f5183dfb | 4922 | * @return none. |
Kojto | 115:87f2f5183dfb | 4923 | */ |
Kojto | 115:87f2f5183dfb | 4924 | |
Kojto | 115:87f2f5183dfb | 4925 | void arm_sin_cos_f32( |
Kojto | 115:87f2f5183dfb | 4926 | float32_t theta, |
Kojto | 115:87f2f5183dfb | 4927 | float32_t * pSinVal, |
Kojto | 115:87f2f5183dfb | 4928 | float32_t * pCcosVal); |
Kojto | 115:87f2f5183dfb | 4929 | |
Kojto | 115:87f2f5183dfb | 4930 | /* |
Kojto | 115:87f2f5183dfb | 4931 | * @brief Q31 sin_cos function. |
Kojto | 115:87f2f5183dfb | 4932 | * @param[in] theta scaled input value in degrees |
Kojto | 115:87f2f5183dfb | 4933 | * @param[out] *pSinVal points to the processed sine output. |
Kojto | 115:87f2f5183dfb | 4934 | * @param[out] *pCosVal points to the processed cosine output. |
Kojto | 115:87f2f5183dfb | 4935 | * @return none. |
Kojto | 115:87f2f5183dfb | 4936 | */ |
Kojto | 115:87f2f5183dfb | 4937 | |
Kojto | 115:87f2f5183dfb | 4938 | void arm_sin_cos_q31( |
Kojto | 115:87f2f5183dfb | 4939 | q31_t theta, |
Kojto | 115:87f2f5183dfb | 4940 | q31_t * pSinVal, |
Kojto | 115:87f2f5183dfb | 4941 | q31_t * pCosVal); |
Kojto | 115:87f2f5183dfb | 4942 | |
Kojto | 115:87f2f5183dfb | 4943 | |
Kojto | 115:87f2f5183dfb | 4944 | /** |
Kojto | 115:87f2f5183dfb | 4945 | * @brief Floating-point complex conjugate. |
Kojto | 115:87f2f5183dfb | 4946 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 4947 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 4948 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 4949 | * @return none. |
Kojto | 115:87f2f5183dfb | 4950 | */ |
Kojto | 115:87f2f5183dfb | 4951 | |
Kojto | 115:87f2f5183dfb | 4952 | void arm_cmplx_conj_f32( |
Kojto | 115:87f2f5183dfb | 4953 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4954 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 4955 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 4956 | |
Kojto | 115:87f2f5183dfb | 4957 | /** |
Kojto | 115:87f2f5183dfb | 4958 | * @brief Q31 complex conjugate. |
Kojto | 115:87f2f5183dfb | 4959 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 4960 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 4961 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 4962 | * @return none. |
Kojto | 115:87f2f5183dfb | 4963 | */ |
Kojto | 115:87f2f5183dfb | 4964 | |
Kojto | 115:87f2f5183dfb | 4965 | void arm_cmplx_conj_q31( |
Kojto | 115:87f2f5183dfb | 4966 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4967 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 4968 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 4969 | |
Kojto | 115:87f2f5183dfb | 4970 | /** |
Kojto | 115:87f2f5183dfb | 4971 | * @brief Q15 complex conjugate. |
Kojto | 115:87f2f5183dfb | 4972 | * @param[in] *pSrc points to the input vector |
Kojto | 115:87f2f5183dfb | 4973 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 4974 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 4975 | * @return none. |
Kojto | 115:87f2f5183dfb | 4976 | */ |
Kojto | 115:87f2f5183dfb | 4977 | |
Kojto | 115:87f2f5183dfb | 4978 | void arm_cmplx_conj_q15( |
Kojto | 115:87f2f5183dfb | 4979 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4980 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 4981 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 4982 | |
Kojto | 115:87f2f5183dfb | 4983 | |
Kojto | 115:87f2f5183dfb | 4984 | |
Kojto | 115:87f2f5183dfb | 4985 | /** |
Kojto | 115:87f2f5183dfb | 4986 | * @brief Floating-point complex magnitude squared |
Kojto | 115:87f2f5183dfb | 4987 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 4988 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 4989 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 4990 | * @return none. |
Kojto | 115:87f2f5183dfb | 4991 | */ |
Kojto | 115:87f2f5183dfb | 4992 | |
Kojto | 115:87f2f5183dfb | 4993 | void arm_cmplx_mag_squared_f32( |
Kojto | 115:87f2f5183dfb | 4994 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 4995 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 4996 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 4997 | |
Kojto | 115:87f2f5183dfb | 4998 | /** |
Kojto | 115:87f2f5183dfb | 4999 | * @brief Q31 complex magnitude squared |
Kojto | 115:87f2f5183dfb | 5000 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 5001 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 5002 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 5003 | * @return none. |
Kojto | 115:87f2f5183dfb | 5004 | */ |
Kojto | 115:87f2f5183dfb | 5005 | |
Kojto | 115:87f2f5183dfb | 5006 | void arm_cmplx_mag_squared_q31( |
Kojto | 115:87f2f5183dfb | 5007 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5008 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 5009 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 5010 | |
Kojto | 115:87f2f5183dfb | 5011 | /** |
Kojto | 115:87f2f5183dfb | 5012 | * @brief Q15 complex magnitude squared |
Kojto | 115:87f2f5183dfb | 5013 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 5014 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 5015 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 5016 | * @return none. |
Kojto | 115:87f2f5183dfb | 5017 | */ |
Kojto | 115:87f2f5183dfb | 5018 | |
Kojto | 115:87f2f5183dfb | 5019 | void arm_cmplx_mag_squared_q15( |
Kojto | 115:87f2f5183dfb | 5020 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5021 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 5022 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 5023 | |
Kojto | 115:87f2f5183dfb | 5024 | |
Kojto | 115:87f2f5183dfb | 5025 | /** |
Kojto | 115:87f2f5183dfb | 5026 | * @ingroup groupController |
Kojto | 115:87f2f5183dfb | 5027 | */ |
Kojto | 115:87f2f5183dfb | 5028 | |
Kojto | 115:87f2f5183dfb | 5029 | /** |
Kojto | 115:87f2f5183dfb | 5030 | * @defgroup PID PID Motor Control |
Kojto | 115:87f2f5183dfb | 5031 | * |
Kojto | 115:87f2f5183dfb | 5032 | * A Proportional Integral Derivative (PID) controller is a generic feedback control |
Kojto | 115:87f2f5183dfb | 5033 | * loop mechanism widely used in industrial control systems. |
Kojto | 115:87f2f5183dfb | 5034 | * A PID controller is the most commonly used type of feedback controller. |
Kojto | 115:87f2f5183dfb | 5035 | * |
Kojto | 115:87f2f5183dfb | 5036 | * This set of functions implements (PID) controllers |
Kojto | 115:87f2f5183dfb | 5037 | * for Q15, Q31, and floating-point data types. The functions operate on a single sample |
Kojto | 115:87f2f5183dfb | 5038 | * of data and each call to the function returns a single processed value. |
Kojto | 115:87f2f5183dfb | 5039 | * <code>S</code> points to an instance of the PID control data structure. <code>in</code> |
Kojto | 115:87f2f5183dfb | 5040 | * is the input sample value. The functions return the output value. |
Kojto | 115:87f2f5183dfb | 5041 | * |
Kojto | 115:87f2f5183dfb | 5042 | * \par Algorithm: |
Kojto | 115:87f2f5183dfb | 5043 | * <pre> |
Kojto | 115:87f2f5183dfb | 5044 | * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] |
Kojto | 115:87f2f5183dfb | 5045 | * A0 = Kp + Ki + Kd |
Kojto | 115:87f2f5183dfb | 5046 | * A1 = (-Kp ) - (2 * Kd ) |
Kojto | 115:87f2f5183dfb | 5047 | * A2 = Kd </pre> |
Kojto | 115:87f2f5183dfb | 5048 | * |
Kojto | 115:87f2f5183dfb | 5049 | * \par |
Kojto | 115:87f2f5183dfb | 5050 | * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant |
Kojto | 115:87f2f5183dfb | 5051 | * |
Kojto | 115:87f2f5183dfb | 5052 | * \par |
Kojto | 115:87f2f5183dfb | 5053 | * \image html PID.gif "Proportional Integral Derivative Controller" |
Kojto | 115:87f2f5183dfb | 5054 | * |
Kojto | 115:87f2f5183dfb | 5055 | * \par |
Kojto | 115:87f2f5183dfb | 5056 | * The PID controller calculates an "error" value as the difference between |
Kojto | 115:87f2f5183dfb | 5057 | * the measured output and the reference input. |
Kojto | 115:87f2f5183dfb | 5058 | * The controller attempts to minimize the error by adjusting the process control inputs. |
Kojto | 115:87f2f5183dfb | 5059 | * The proportional value determines the reaction to the current error, |
Kojto | 115:87f2f5183dfb | 5060 | * the integral value determines the reaction based on the sum of recent errors, |
Kojto | 115:87f2f5183dfb | 5061 | * and the derivative value determines the reaction based on the rate at which the error has been changing. |
Kojto | 115:87f2f5183dfb | 5062 | * |
Kojto | 115:87f2f5183dfb | 5063 | * \par Instance Structure |
Kojto | 115:87f2f5183dfb | 5064 | * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. |
Kojto | 115:87f2f5183dfb | 5065 | * A separate instance structure must be defined for each PID Controller. |
Kojto | 115:87f2f5183dfb | 5066 | * There are separate instance structure declarations for each of the 3 supported data types. |
Kojto | 115:87f2f5183dfb | 5067 | * |
Kojto | 115:87f2f5183dfb | 5068 | * \par Reset Functions |
Kojto | 115:87f2f5183dfb | 5069 | * There is also an associated reset function for each data type which clears the state array. |
Kojto | 115:87f2f5183dfb | 5070 | * |
Kojto | 115:87f2f5183dfb | 5071 | * \par Initialization Functions |
Kojto | 115:87f2f5183dfb | 5072 | * There is also an associated initialization function for each data type. |
Kojto | 115:87f2f5183dfb | 5073 | * The initialization function performs the following operations: |
Kojto | 115:87f2f5183dfb | 5074 | * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. |
Kojto | 115:87f2f5183dfb | 5075 | * - Zeros out the values in the state buffer. |
Kojto | 115:87f2f5183dfb | 5076 | * |
Kojto | 115:87f2f5183dfb | 5077 | * \par |
Kojto | 115:87f2f5183dfb | 5078 | * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. |
Kojto | 115:87f2f5183dfb | 5079 | * |
Kojto | 115:87f2f5183dfb | 5080 | * \par Fixed-Point Behavior |
Kojto | 115:87f2f5183dfb | 5081 | * Care must be taken when using the fixed-point versions of the PID Controller functions. |
Kojto | 115:87f2f5183dfb | 5082 | * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. |
Kojto | 115:87f2f5183dfb | 5083 | * Refer to the function specific documentation below for usage guidelines. |
Kojto | 115:87f2f5183dfb | 5084 | */ |
Kojto | 115:87f2f5183dfb | 5085 | |
Kojto | 115:87f2f5183dfb | 5086 | /** |
Kojto | 115:87f2f5183dfb | 5087 | * @addtogroup PID |
Kojto | 115:87f2f5183dfb | 5088 | * @{ |
Kojto | 115:87f2f5183dfb | 5089 | */ |
Kojto | 115:87f2f5183dfb | 5090 | |
Kojto | 115:87f2f5183dfb | 5091 | /** |
Kojto | 115:87f2f5183dfb | 5092 | * @brief Process function for the floating-point PID Control. |
Kojto | 115:87f2f5183dfb | 5093 | * @param[in,out] *S is an instance of the floating-point PID Control structure |
Kojto | 115:87f2f5183dfb | 5094 | * @param[in] in input sample to process |
Kojto | 115:87f2f5183dfb | 5095 | * @return out processed output sample. |
Kojto | 115:87f2f5183dfb | 5096 | */ |
Kojto | 115:87f2f5183dfb | 5097 | |
Kojto | 115:87f2f5183dfb | 5098 | |
Kojto | 115:87f2f5183dfb | 5099 | static __INLINE float32_t arm_pid_f32( |
Kojto | 115:87f2f5183dfb | 5100 | arm_pid_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 5101 | float32_t in) |
Kojto | 115:87f2f5183dfb | 5102 | { |
Kojto | 115:87f2f5183dfb | 5103 | float32_t out; |
Kojto | 115:87f2f5183dfb | 5104 | |
Kojto | 115:87f2f5183dfb | 5105 | /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ |
Kojto | 115:87f2f5183dfb | 5106 | out = (S->A0 * in) + |
Kojto | 115:87f2f5183dfb | 5107 | (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); |
Kojto | 115:87f2f5183dfb | 5108 | |
Kojto | 115:87f2f5183dfb | 5109 | /* Update state */ |
Kojto | 115:87f2f5183dfb | 5110 | S->state[1] = S->state[0]; |
Kojto | 115:87f2f5183dfb | 5111 | S->state[0] = in; |
Kojto | 115:87f2f5183dfb | 5112 | S->state[2] = out; |
Kojto | 115:87f2f5183dfb | 5113 | |
Kojto | 115:87f2f5183dfb | 5114 | /* return to application */ |
Kojto | 115:87f2f5183dfb | 5115 | return (out); |
Kojto | 115:87f2f5183dfb | 5116 | |
Kojto | 115:87f2f5183dfb | 5117 | } |
Kojto | 115:87f2f5183dfb | 5118 | |
Kojto | 115:87f2f5183dfb | 5119 | /** |
Kojto | 115:87f2f5183dfb | 5120 | * @brief Process function for the Q31 PID Control. |
Kojto | 115:87f2f5183dfb | 5121 | * @param[in,out] *S points to an instance of the Q31 PID Control structure |
Kojto | 115:87f2f5183dfb | 5122 | * @param[in] in input sample to process |
Kojto | 115:87f2f5183dfb | 5123 | * @return out processed output sample. |
Kojto | 115:87f2f5183dfb | 5124 | * |
Kojto | 115:87f2f5183dfb | 5125 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5126 | * \par |
Kojto | 115:87f2f5183dfb | 5127 | * The function is implemented using an internal 64-bit accumulator. |
Kojto | 115:87f2f5183dfb | 5128 | * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. |
Kojto | 115:87f2f5183dfb | 5129 | * Thus, if the accumulator result overflows it wraps around rather than clip. |
Kojto | 115:87f2f5183dfb | 5130 | * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. |
Kojto | 115:87f2f5183dfb | 5131 | * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. |
Kojto | 115:87f2f5183dfb | 5132 | */ |
Kojto | 115:87f2f5183dfb | 5133 | |
Kojto | 115:87f2f5183dfb | 5134 | static __INLINE q31_t arm_pid_q31( |
Kojto | 115:87f2f5183dfb | 5135 | arm_pid_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 5136 | q31_t in) |
Kojto | 115:87f2f5183dfb | 5137 | { |
Kojto | 115:87f2f5183dfb | 5138 | q63_t acc; |
Kojto | 115:87f2f5183dfb | 5139 | q31_t out; |
Kojto | 115:87f2f5183dfb | 5140 | |
Kojto | 115:87f2f5183dfb | 5141 | /* acc = A0 * x[n] */ |
Kojto | 115:87f2f5183dfb | 5142 | acc = (q63_t) S->A0 * in; |
Kojto | 115:87f2f5183dfb | 5143 | |
Kojto | 115:87f2f5183dfb | 5144 | /* acc += A1 * x[n-1] */ |
Kojto | 115:87f2f5183dfb | 5145 | acc += (q63_t) S->A1 * S->state[0]; |
Kojto | 115:87f2f5183dfb | 5146 | |
Kojto | 115:87f2f5183dfb | 5147 | /* acc += A2 * x[n-2] */ |
Kojto | 115:87f2f5183dfb | 5148 | acc += (q63_t) S->A2 * S->state[1]; |
Kojto | 115:87f2f5183dfb | 5149 | |
Kojto | 115:87f2f5183dfb | 5150 | /* convert output to 1.31 format to add y[n-1] */ |
Kojto | 115:87f2f5183dfb | 5151 | out = (q31_t) (acc >> 31u); |
Kojto | 115:87f2f5183dfb | 5152 | |
Kojto | 115:87f2f5183dfb | 5153 | /* out += y[n-1] */ |
Kojto | 115:87f2f5183dfb | 5154 | out += S->state[2]; |
Kojto | 115:87f2f5183dfb | 5155 | |
Kojto | 115:87f2f5183dfb | 5156 | /* Update state */ |
Kojto | 115:87f2f5183dfb | 5157 | S->state[1] = S->state[0]; |
Kojto | 115:87f2f5183dfb | 5158 | S->state[0] = in; |
Kojto | 115:87f2f5183dfb | 5159 | S->state[2] = out; |
Kojto | 115:87f2f5183dfb | 5160 | |
Kojto | 115:87f2f5183dfb | 5161 | /* return to application */ |
Kojto | 115:87f2f5183dfb | 5162 | return (out); |
Kojto | 115:87f2f5183dfb | 5163 | |
Kojto | 115:87f2f5183dfb | 5164 | } |
Kojto | 115:87f2f5183dfb | 5165 | |
Kojto | 115:87f2f5183dfb | 5166 | /** |
Kojto | 115:87f2f5183dfb | 5167 | * @brief Process function for the Q15 PID Control. |
Kojto | 115:87f2f5183dfb | 5168 | * @param[in,out] *S points to an instance of the Q15 PID Control structure |
Kojto | 115:87f2f5183dfb | 5169 | * @param[in] in input sample to process |
Kojto | 115:87f2f5183dfb | 5170 | * @return out processed output sample. |
Kojto | 115:87f2f5183dfb | 5171 | * |
Kojto | 115:87f2f5183dfb | 5172 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5173 | * \par |
Kojto | 115:87f2f5183dfb | 5174 | * The function is implemented using a 64-bit internal accumulator. |
Kojto | 115:87f2f5183dfb | 5175 | * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. |
Kojto | 115:87f2f5183dfb | 5176 | * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. |
Kojto | 115:87f2f5183dfb | 5177 | * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. |
Kojto | 115:87f2f5183dfb | 5178 | * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. |
Kojto | 115:87f2f5183dfb | 5179 | * Lastly, the accumulator is saturated to yield a result in 1.15 format. |
Kojto | 115:87f2f5183dfb | 5180 | */ |
Kojto | 115:87f2f5183dfb | 5181 | |
Kojto | 115:87f2f5183dfb | 5182 | static __INLINE q15_t arm_pid_q15( |
Kojto | 115:87f2f5183dfb | 5183 | arm_pid_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 5184 | q15_t in) |
Kojto | 115:87f2f5183dfb | 5185 | { |
Kojto | 115:87f2f5183dfb | 5186 | q63_t acc; |
Kojto | 115:87f2f5183dfb | 5187 | q15_t out; |
Kojto | 115:87f2f5183dfb | 5188 | |
Kojto | 115:87f2f5183dfb | 5189 | #ifndef ARM_MATH_CM0_FAMILY |
Kojto | 115:87f2f5183dfb | 5190 | __SIMD32_TYPE *vstate; |
Kojto | 115:87f2f5183dfb | 5191 | |
Kojto | 115:87f2f5183dfb | 5192 | /* Implementation of PID controller */ |
Kojto | 115:87f2f5183dfb | 5193 | |
Kojto | 115:87f2f5183dfb | 5194 | /* acc = A0 * x[n] */ |
Kojto | 115:87f2f5183dfb | 5195 | acc = (q31_t) __SMUAD(S->A0, in); |
Kojto | 115:87f2f5183dfb | 5196 | |
Kojto | 115:87f2f5183dfb | 5197 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
Kojto | 115:87f2f5183dfb | 5198 | vstate = __SIMD32_CONST(S->state); |
Kojto | 115:87f2f5183dfb | 5199 | acc = __SMLALD(S->A1, (q31_t) *vstate, acc); |
Kojto | 115:87f2f5183dfb | 5200 | |
Kojto | 115:87f2f5183dfb | 5201 | #else |
Kojto | 115:87f2f5183dfb | 5202 | /* acc = A0 * x[n] */ |
Kojto | 115:87f2f5183dfb | 5203 | acc = ((q31_t) S->A0) * in; |
Kojto | 115:87f2f5183dfb | 5204 | |
Kojto | 115:87f2f5183dfb | 5205 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
Kojto | 115:87f2f5183dfb | 5206 | acc += (q31_t) S->A1 * S->state[0]; |
Kojto | 115:87f2f5183dfb | 5207 | acc += (q31_t) S->A2 * S->state[1]; |
Kojto | 115:87f2f5183dfb | 5208 | |
Kojto | 115:87f2f5183dfb | 5209 | #endif |
Kojto | 115:87f2f5183dfb | 5210 | |
Kojto | 115:87f2f5183dfb | 5211 | /* acc += y[n-1] */ |
Kojto | 115:87f2f5183dfb | 5212 | acc += (q31_t) S->state[2] << 15; |
Kojto | 115:87f2f5183dfb | 5213 | |
Kojto | 115:87f2f5183dfb | 5214 | /* saturate the output */ |
Kojto | 115:87f2f5183dfb | 5215 | out = (q15_t) (__SSAT((acc >> 15), 16)); |
Kojto | 115:87f2f5183dfb | 5216 | |
Kojto | 115:87f2f5183dfb | 5217 | /* Update state */ |
Kojto | 115:87f2f5183dfb | 5218 | S->state[1] = S->state[0]; |
Kojto | 115:87f2f5183dfb | 5219 | S->state[0] = in; |
Kojto | 115:87f2f5183dfb | 5220 | S->state[2] = out; |
Kojto | 115:87f2f5183dfb | 5221 | |
Kojto | 115:87f2f5183dfb | 5222 | /* return to application */ |
Kojto | 115:87f2f5183dfb | 5223 | return (out); |
Kojto | 115:87f2f5183dfb | 5224 | |
Kojto | 115:87f2f5183dfb | 5225 | } |
Kojto | 115:87f2f5183dfb | 5226 | |
Kojto | 115:87f2f5183dfb | 5227 | /** |
Kojto | 115:87f2f5183dfb | 5228 | * @} end of PID group |
Kojto | 115:87f2f5183dfb | 5229 | */ |
Kojto | 115:87f2f5183dfb | 5230 | |
Kojto | 115:87f2f5183dfb | 5231 | |
Kojto | 115:87f2f5183dfb | 5232 | /** |
Kojto | 115:87f2f5183dfb | 5233 | * @brief Floating-point matrix inverse. |
Kojto | 115:87f2f5183dfb | 5234 | * @param[in] *src points to the instance of the input floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 5235 | * @param[out] *dst points to the instance of the output floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 5236 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
Kojto | 115:87f2f5183dfb | 5237 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
Kojto | 115:87f2f5183dfb | 5238 | */ |
Kojto | 115:87f2f5183dfb | 5239 | |
Kojto | 115:87f2f5183dfb | 5240 | arm_status arm_mat_inverse_f32( |
Kojto | 115:87f2f5183dfb | 5241 | const arm_matrix_instance_f32 * src, |
Kojto | 115:87f2f5183dfb | 5242 | arm_matrix_instance_f32 * dst); |
Kojto | 115:87f2f5183dfb | 5243 | |
Kojto | 115:87f2f5183dfb | 5244 | |
Kojto | 115:87f2f5183dfb | 5245 | /** |
Kojto | 115:87f2f5183dfb | 5246 | * @brief Floating-point matrix inverse. |
Kojto | 115:87f2f5183dfb | 5247 | * @param[in] *src points to the instance of the input floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 5248 | * @param[out] *dst points to the instance of the output floating-point matrix structure. |
Kojto | 115:87f2f5183dfb | 5249 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
Kojto | 115:87f2f5183dfb | 5250 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
Kojto | 115:87f2f5183dfb | 5251 | */ |
Kojto | 115:87f2f5183dfb | 5252 | |
Kojto | 115:87f2f5183dfb | 5253 | arm_status arm_mat_inverse_f64( |
Kojto | 115:87f2f5183dfb | 5254 | const arm_matrix_instance_f64 * src, |
Kojto | 115:87f2f5183dfb | 5255 | arm_matrix_instance_f64 * dst); |
Kojto | 115:87f2f5183dfb | 5256 | |
Kojto | 115:87f2f5183dfb | 5257 | |
Kojto | 115:87f2f5183dfb | 5258 | |
Kojto | 115:87f2f5183dfb | 5259 | /** |
Kojto | 115:87f2f5183dfb | 5260 | * @ingroup groupController |
Kojto | 115:87f2f5183dfb | 5261 | */ |
Kojto | 115:87f2f5183dfb | 5262 | |
Kojto | 115:87f2f5183dfb | 5263 | |
Kojto | 115:87f2f5183dfb | 5264 | /** |
Kojto | 115:87f2f5183dfb | 5265 | * @defgroup clarke Vector Clarke Transform |
Kojto | 115:87f2f5183dfb | 5266 | * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. |
Kojto | 115:87f2f5183dfb | 5267 | * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents |
Kojto | 115:87f2f5183dfb | 5268 | * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>. |
Kojto | 115:87f2f5183dfb | 5269 | * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below |
Kojto | 115:87f2f5183dfb | 5270 | * \image html clarke.gif Stator current space vector and its components in (a,b). |
Kojto | 115:87f2f5183dfb | 5271 | * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code> |
Kojto | 115:87f2f5183dfb | 5272 | * can be calculated using only <code>Ia</code> and <code>Ib</code>. |
Kojto | 115:87f2f5183dfb | 5273 | * |
Kojto | 115:87f2f5183dfb | 5274 | * The function operates on a single sample of data and each call to the function returns the processed output. |
Kojto | 115:87f2f5183dfb | 5275 | * The library provides separate functions for Q31 and floating-point data types. |
Kojto | 115:87f2f5183dfb | 5276 | * \par Algorithm |
Kojto | 115:87f2f5183dfb | 5277 | * \image html clarkeFormula.gif |
Kojto | 115:87f2f5183dfb | 5278 | * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and |
Kojto | 115:87f2f5183dfb | 5279 | * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector. |
Kojto | 115:87f2f5183dfb | 5280 | * \par Fixed-Point Behavior |
Kojto | 115:87f2f5183dfb | 5281 | * Care must be taken when using the Q31 version of the Clarke transform. |
Kojto | 115:87f2f5183dfb | 5282 | * In particular, the overflow and saturation behavior of the accumulator used must be considered. |
Kojto | 115:87f2f5183dfb | 5283 | * Refer to the function specific documentation below for usage guidelines. |
Kojto | 115:87f2f5183dfb | 5284 | */ |
Kojto | 115:87f2f5183dfb | 5285 | |
Kojto | 115:87f2f5183dfb | 5286 | /** |
Kojto | 115:87f2f5183dfb | 5287 | * @addtogroup clarke |
Kojto | 115:87f2f5183dfb | 5288 | * @{ |
Kojto | 115:87f2f5183dfb | 5289 | */ |
Kojto | 115:87f2f5183dfb | 5290 | |
Kojto | 115:87f2f5183dfb | 5291 | /** |
Kojto | 115:87f2f5183dfb | 5292 | * |
Kojto | 115:87f2f5183dfb | 5293 | * @brief Floating-point Clarke transform |
Kojto | 115:87f2f5183dfb | 5294 | * @param[in] Ia input three-phase coordinate <code>a</code> |
Kojto | 115:87f2f5183dfb | 5295 | * @param[in] Ib input three-phase coordinate <code>b</code> |
Kojto | 115:87f2f5183dfb | 5296 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5297 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5298 | * @return none. |
Kojto | 115:87f2f5183dfb | 5299 | */ |
Kojto | 115:87f2f5183dfb | 5300 | |
Kojto | 115:87f2f5183dfb | 5301 | static __INLINE void arm_clarke_f32( |
Kojto | 115:87f2f5183dfb | 5302 | float32_t Ia, |
Kojto | 115:87f2f5183dfb | 5303 | float32_t Ib, |
Kojto | 115:87f2f5183dfb | 5304 | float32_t * pIalpha, |
Kojto | 115:87f2f5183dfb | 5305 | float32_t * pIbeta) |
Kojto | 115:87f2f5183dfb | 5306 | { |
Kojto | 115:87f2f5183dfb | 5307 | /* Calculate pIalpha using the equation, pIalpha = Ia */ |
Kojto | 115:87f2f5183dfb | 5308 | *pIalpha = Ia; |
Kojto | 115:87f2f5183dfb | 5309 | |
Kojto | 115:87f2f5183dfb | 5310 | /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ |
Kojto | 115:87f2f5183dfb | 5311 | *pIbeta = |
Kojto | 115:87f2f5183dfb | 5312 | ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); |
Kojto | 115:87f2f5183dfb | 5313 | |
Kojto | 115:87f2f5183dfb | 5314 | } |
Kojto | 115:87f2f5183dfb | 5315 | |
Kojto | 115:87f2f5183dfb | 5316 | /** |
Kojto | 115:87f2f5183dfb | 5317 | * @brief Clarke transform for Q31 version |
Kojto | 115:87f2f5183dfb | 5318 | * @param[in] Ia input three-phase coordinate <code>a</code> |
Kojto | 115:87f2f5183dfb | 5319 | * @param[in] Ib input three-phase coordinate <code>b</code> |
Kojto | 115:87f2f5183dfb | 5320 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5321 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5322 | * @return none. |
Kojto | 115:87f2f5183dfb | 5323 | * |
Kojto | 115:87f2f5183dfb | 5324 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5325 | * \par |
Kojto | 115:87f2f5183dfb | 5326 | * The function is implemented using an internal 32-bit accumulator. |
Kojto | 115:87f2f5183dfb | 5327 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
Kojto | 115:87f2f5183dfb | 5328 | * There is saturation on the addition, hence there is no risk of overflow. |
Kojto | 115:87f2f5183dfb | 5329 | */ |
Kojto | 115:87f2f5183dfb | 5330 | |
Kojto | 115:87f2f5183dfb | 5331 | static __INLINE void arm_clarke_q31( |
Kojto | 115:87f2f5183dfb | 5332 | q31_t Ia, |
Kojto | 115:87f2f5183dfb | 5333 | q31_t Ib, |
Kojto | 115:87f2f5183dfb | 5334 | q31_t * pIalpha, |
Kojto | 115:87f2f5183dfb | 5335 | q31_t * pIbeta) |
Kojto | 115:87f2f5183dfb | 5336 | { |
Kojto | 115:87f2f5183dfb | 5337 | q31_t product1, product2; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5338 | |
Kojto | 115:87f2f5183dfb | 5339 | /* Calculating pIalpha from Ia by equation pIalpha = Ia */ |
Kojto | 115:87f2f5183dfb | 5340 | *pIalpha = Ia; |
Kojto | 115:87f2f5183dfb | 5341 | |
Kojto | 115:87f2f5183dfb | 5342 | /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ |
Kojto | 115:87f2f5183dfb | 5343 | product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); |
Kojto | 115:87f2f5183dfb | 5344 | |
Kojto | 115:87f2f5183dfb | 5345 | /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ |
Kojto | 115:87f2f5183dfb | 5346 | product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); |
Kojto | 115:87f2f5183dfb | 5347 | |
Kojto | 115:87f2f5183dfb | 5348 | /* pIbeta is calculated by adding the intermediate products */ |
Kojto | 115:87f2f5183dfb | 5349 | *pIbeta = __QADD(product1, product2); |
Kojto | 115:87f2f5183dfb | 5350 | } |
Kojto | 115:87f2f5183dfb | 5351 | |
Kojto | 115:87f2f5183dfb | 5352 | /** |
Kojto | 115:87f2f5183dfb | 5353 | * @} end of clarke group |
Kojto | 115:87f2f5183dfb | 5354 | */ |
Kojto | 115:87f2f5183dfb | 5355 | |
Kojto | 115:87f2f5183dfb | 5356 | /** |
Kojto | 115:87f2f5183dfb | 5357 | * @brief Converts the elements of the Q7 vector to Q31 vector. |
Kojto | 115:87f2f5183dfb | 5358 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 5359 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 5360 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 5361 | * @return none. |
Kojto | 115:87f2f5183dfb | 5362 | */ |
Kojto | 115:87f2f5183dfb | 5363 | void arm_q7_to_q31( |
Kojto | 115:87f2f5183dfb | 5364 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5365 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 5366 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 5367 | |
Kojto | 115:87f2f5183dfb | 5368 | |
Kojto | 115:87f2f5183dfb | 5369 | |
Kojto | 115:87f2f5183dfb | 5370 | |
Kojto | 115:87f2f5183dfb | 5371 | /** |
Kojto | 115:87f2f5183dfb | 5372 | * @ingroup groupController |
Kojto | 115:87f2f5183dfb | 5373 | */ |
Kojto | 115:87f2f5183dfb | 5374 | |
Kojto | 115:87f2f5183dfb | 5375 | /** |
Kojto | 115:87f2f5183dfb | 5376 | * @defgroup inv_clarke Vector Inverse Clarke Transform |
Kojto | 115:87f2f5183dfb | 5377 | * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. |
Kojto | 115:87f2f5183dfb | 5378 | * |
Kojto | 115:87f2f5183dfb | 5379 | * The function operates on a single sample of data and each call to the function returns the processed output. |
Kojto | 115:87f2f5183dfb | 5380 | * The library provides separate functions for Q31 and floating-point data types. |
Kojto | 115:87f2f5183dfb | 5381 | * \par Algorithm |
Kojto | 115:87f2f5183dfb | 5382 | * \image html clarkeInvFormula.gif |
Kojto | 115:87f2f5183dfb | 5383 | * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and |
Kojto | 115:87f2f5183dfb | 5384 | * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector. |
Kojto | 115:87f2f5183dfb | 5385 | * \par Fixed-Point Behavior |
Kojto | 115:87f2f5183dfb | 5386 | * Care must be taken when using the Q31 version of the Clarke transform. |
Kojto | 115:87f2f5183dfb | 5387 | * In particular, the overflow and saturation behavior of the accumulator used must be considered. |
Kojto | 115:87f2f5183dfb | 5388 | * Refer to the function specific documentation below for usage guidelines. |
Kojto | 115:87f2f5183dfb | 5389 | */ |
Kojto | 115:87f2f5183dfb | 5390 | |
Kojto | 115:87f2f5183dfb | 5391 | /** |
Kojto | 115:87f2f5183dfb | 5392 | * @addtogroup inv_clarke |
Kojto | 115:87f2f5183dfb | 5393 | * @{ |
Kojto | 115:87f2f5183dfb | 5394 | */ |
Kojto | 115:87f2f5183dfb | 5395 | |
Kojto | 115:87f2f5183dfb | 5396 | /** |
Kojto | 115:87f2f5183dfb | 5397 | * @brief Floating-point Inverse Clarke transform |
Kojto | 115:87f2f5183dfb | 5398 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5399 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5400 | * @param[out] *pIa points to output three-phase coordinate <code>a</code> |
Kojto | 115:87f2f5183dfb | 5401 | * @param[out] *pIb points to output three-phase coordinate <code>b</code> |
Kojto | 115:87f2f5183dfb | 5402 | * @return none. |
Kojto | 115:87f2f5183dfb | 5403 | */ |
Kojto | 115:87f2f5183dfb | 5404 | |
Kojto | 115:87f2f5183dfb | 5405 | |
Kojto | 115:87f2f5183dfb | 5406 | static __INLINE void arm_inv_clarke_f32( |
Kojto | 115:87f2f5183dfb | 5407 | float32_t Ialpha, |
Kojto | 115:87f2f5183dfb | 5408 | float32_t Ibeta, |
Kojto | 115:87f2f5183dfb | 5409 | float32_t * pIa, |
Kojto | 115:87f2f5183dfb | 5410 | float32_t * pIb) |
Kojto | 115:87f2f5183dfb | 5411 | { |
Kojto | 115:87f2f5183dfb | 5412 | /* Calculating pIa from Ialpha by equation pIa = Ialpha */ |
Kojto | 115:87f2f5183dfb | 5413 | *pIa = Ialpha; |
Kojto | 115:87f2f5183dfb | 5414 | |
Kojto | 115:87f2f5183dfb | 5415 | /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ |
Kojto | 115:87f2f5183dfb | 5416 | *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta; |
Kojto | 115:87f2f5183dfb | 5417 | |
Kojto | 115:87f2f5183dfb | 5418 | } |
Kojto | 115:87f2f5183dfb | 5419 | |
Kojto | 115:87f2f5183dfb | 5420 | /** |
Kojto | 115:87f2f5183dfb | 5421 | * @brief Inverse Clarke transform for Q31 version |
Kojto | 115:87f2f5183dfb | 5422 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5423 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5424 | * @param[out] *pIa points to output three-phase coordinate <code>a</code> |
Kojto | 115:87f2f5183dfb | 5425 | * @param[out] *pIb points to output three-phase coordinate <code>b</code> |
Kojto | 115:87f2f5183dfb | 5426 | * @return none. |
Kojto | 115:87f2f5183dfb | 5427 | * |
Kojto | 115:87f2f5183dfb | 5428 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5429 | * \par |
Kojto | 115:87f2f5183dfb | 5430 | * The function is implemented using an internal 32-bit accumulator. |
Kojto | 115:87f2f5183dfb | 5431 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
Kojto | 115:87f2f5183dfb | 5432 | * There is saturation on the subtraction, hence there is no risk of overflow. |
Kojto | 115:87f2f5183dfb | 5433 | */ |
Kojto | 115:87f2f5183dfb | 5434 | |
Kojto | 115:87f2f5183dfb | 5435 | static __INLINE void arm_inv_clarke_q31( |
Kojto | 115:87f2f5183dfb | 5436 | q31_t Ialpha, |
Kojto | 115:87f2f5183dfb | 5437 | q31_t Ibeta, |
Kojto | 115:87f2f5183dfb | 5438 | q31_t * pIa, |
Kojto | 115:87f2f5183dfb | 5439 | q31_t * pIb) |
Kojto | 115:87f2f5183dfb | 5440 | { |
Kojto | 115:87f2f5183dfb | 5441 | q31_t product1, product2; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5442 | |
Kojto | 115:87f2f5183dfb | 5443 | /* Calculating pIa from Ialpha by equation pIa = Ialpha */ |
Kojto | 115:87f2f5183dfb | 5444 | *pIa = Ialpha; |
Kojto | 115:87f2f5183dfb | 5445 | |
Kojto | 115:87f2f5183dfb | 5446 | /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ |
Kojto | 115:87f2f5183dfb | 5447 | product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); |
Kojto | 115:87f2f5183dfb | 5448 | |
Kojto | 115:87f2f5183dfb | 5449 | /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ |
Kojto | 115:87f2f5183dfb | 5450 | product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); |
Kojto | 115:87f2f5183dfb | 5451 | |
Kojto | 115:87f2f5183dfb | 5452 | /* pIb is calculated by subtracting the products */ |
Kojto | 115:87f2f5183dfb | 5453 | *pIb = __QSUB(product2, product1); |
Kojto | 115:87f2f5183dfb | 5454 | |
Kojto | 115:87f2f5183dfb | 5455 | } |
Kojto | 115:87f2f5183dfb | 5456 | |
Kojto | 115:87f2f5183dfb | 5457 | /** |
Kojto | 115:87f2f5183dfb | 5458 | * @} end of inv_clarke group |
Kojto | 115:87f2f5183dfb | 5459 | */ |
Kojto | 115:87f2f5183dfb | 5460 | |
Kojto | 115:87f2f5183dfb | 5461 | /** |
Kojto | 115:87f2f5183dfb | 5462 | * @brief Converts the elements of the Q7 vector to Q15 vector. |
Kojto | 115:87f2f5183dfb | 5463 | * @param[in] *pSrc input pointer |
Kojto | 115:87f2f5183dfb | 5464 | * @param[out] *pDst output pointer |
Kojto | 115:87f2f5183dfb | 5465 | * @param[in] blockSize number of samples to process |
Kojto | 115:87f2f5183dfb | 5466 | * @return none. |
Kojto | 115:87f2f5183dfb | 5467 | */ |
Kojto | 115:87f2f5183dfb | 5468 | void arm_q7_to_q15( |
Kojto | 115:87f2f5183dfb | 5469 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5470 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 5471 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 5472 | |
Kojto | 115:87f2f5183dfb | 5473 | |
Kojto | 115:87f2f5183dfb | 5474 | |
Kojto | 115:87f2f5183dfb | 5475 | /** |
Kojto | 115:87f2f5183dfb | 5476 | * @ingroup groupController |
Kojto | 115:87f2f5183dfb | 5477 | */ |
Kojto | 115:87f2f5183dfb | 5478 | |
Kojto | 115:87f2f5183dfb | 5479 | /** |
Kojto | 115:87f2f5183dfb | 5480 | * @defgroup park Vector Park Transform |
Kojto | 115:87f2f5183dfb | 5481 | * |
Kojto | 115:87f2f5183dfb | 5482 | * Forward Park transform converts the input two-coordinate vector to flux and torque components. |
Kojto | 115:87f2f5183dfb | 5483 | * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents |
Kojto | 115:87f2f5183dfb | 5484 | * from the stationary to the moving reference frame and control the spatial relationship between |
Kojto | 115:87f2f5183dfb | 5485 | * the stator vector current and rotor flux vector. |
Kojto | 115:87f2f5183dfb | 5486 | * If we consider the d axis aligned with the rotor flux, the diagram below shows the |
Kojto | 115:87f2f5183dfb | 5487 | * current vector and the relationship from the two reference frames: |
Kojto | 115:87f2f5183dfb | 5488 | * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" |
Kojto | 115:87f2f5183dfb | 5489 | * |
Kojto | 115:87f2f5183dfb | 5490 | * The function operates on a single sample of data and each call to the function returns the processed output. |
Kojto | 115:87f2f5183dfb | 5491 | * The library provides separate functions for Q31 and floating-point data types. |
Kojto | 115:87f2f5183dfb | 5492 | * \par Algorithm |
Kojto | 115:87f2f5183dfb | 5493 | * \image html parkFormula.gif |
Kojto | 115:87f2f5183dfb | 5494 | * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components, |
Kojto | 115:87f2f5183dfb | 5495 | * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the |
Kojto | 115:87f2f5183dfb | 5496 | * cosine and sine values of theta (rotor flux position). |
Kojto | 115:87f2f5183dfb | 5497 | * \par Fixed-Point Behavior |
Kojto | 115:87f2f5183dfb | 5498 | * Care must be taken when using the Q31 version of the Park transform. |
Kojto | 115:87f2f5183dfb | 5499 | * In particular, the overflow and saturation behavior of the accumulator used must be considered. |
Kojto | 115:87f2f5183dfb | 5500 | * Refer to the function specific documentation below for usage guidelines. |
Kojto | 115:87f2f5183dfb | 5501 | */ |
Kojto | 115:87f2f5183dfb | 5502 | |
Kojto | 115:87f2f5183dfb | 5503 | /** |
Kojto | 115:87f2f5183dfb | 5504 | * @addtogroup park |
Kojto | 115:87f2f5183dfb | 5505 | * @{ |
Kojto | 115:87f2f5183dfb | 5506 | */ |
Kojto | 115:87f2f5183dfb | 5507 | |
Kojto | 115:87f2f5183dfb | 5508 | /** |
Kojto | 115:87f2f5183dfb | 5509 | * @brief Floating-point Park transform |
Kojto | 115:87f2f5183dfb | 5510 | * @param[in] Ialpha input two-phase vector coordinate alpha |
Kojto | 115:87f2f5183dfb | 5511 | * @param[in] Ibeta input two-phase vector coordinate beta |
Kojto | 115:87f2f5183dfb | 5512 | * @param[out] *pId points to output rotor reference frame d |
Kojto | 115:87f2f5183dfb | 5513 | * @param[out] *pIq points to output rotor reference frame q |
Kojto | 115:87f2f5183dfb | 5514 | * @param[in] sinVal sine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5515 | * @param[in] cosVal cosine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5516 | * @return none. |
Kojto | 115:87f2f5183dfb | 5517 | * |
Kojto | 115:87f2f5183dfb | 5518 | * The function implements the forward Park transform. |
Kojto | 115:87f2f5183dfb | 5519 | * |
Kojto | 115:87f2f5183dfb | 5520 | */ |
Kojto | 115:87f2f5183dfb | 5521 | |
Kojto | 115:87f2f5183dfb | 5522 | static __INLINE void arm_park_f32( |
Kojto | 115:87f2f5183dfb | 5523 | float32_t Ialpha, |
Kojto | 115:87f2f5183dfb | 5524 | float32_t Ibeta, |
Kojto | 115:87f2f5183dfb | 5525 | float32_t * pId, |
Kojto | 115:87f2f5183dfb | 5526 | float32_t * pIq, |
Kojto | 115:87f2f5183dfb | 5527 | float32_t sinVal, |
Kojto | 115:87f2f5183dfb | 5528 | float32_t cosVal) |
Kojto | 115:87f2f5183dfb | 5529 | { |
Kojto | 115:87f2f5183dfb | 5530 | /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ |
Kojto | 115:87f2f5183dfb | 5531 | *pId = Ialpha * cosVal + Ibeta * sinVal; |
Kojto | 115:87f2f5183dfb | 5532 | |
Kojto | 115:87f2f5183dfb | 5533 | /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ |
Kojto | 115:87f2f5183dfb | 5534 | *pIq = -Ialpha * sinVal + Ibeta * cosVal; |
Kojto | 115:87f2f5183dfb | 5535 | |
Kojto | 115:87f2f5183dfb | 5536 | } |
Kojto | 115:87f2f5183dfb | 5537 | |
Kojto | 115:87f2f5183dfb | 5538 | /** |
Kojto | 115:87f2f5183dfb | 5539 | * @brief Park transform for Q31 version |
Kojto | 115:87f2f5183dfb | 5540 | * @param[in] Ialpha input two-phase vector coordinate alpha |
Kojto | 115:87f2f5183dfb | 5541 | * @param[in] Ibeta input two-phase vector coordinate beta |
Kojto | 115:87f2f5183dfb | 5542 | * @param[out] *pId points to output rotor reference frame d |
Kojto | 115:87f2f5183dfb | 5543 | * @param[out] *pIq points to output rotor reference frame q |
Kojto | 115:87f2f5183dfb | 5544 | * @param[in] sinVal sine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5545 | * @param[in] cosVal cosine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5546 | * @return none. |
Kojto | 115:87f2f5183dfb | 5547 | * |
Kojto | 115:87f2f5183dfb | 5548 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5549 | * \par |
Kojto | 115:87f2f5183dfb | 5550 | * The function is implemented using an internal 32-bit accumulator. |
Kojto | 115:87f2f5183dfb | 5551 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
Kojto | 115:87f2f5183dfb | 5552 | * There is saturation on the addition and subtraction, hence there is no risk of overflow. |
Kojto | 115:87f2f5183dfb | 5553 | */ |
Kojto | 115:87f2f5183dfb | 5554 | |
Kojto | 115:87f2f5183dfb | 5555 | |
Kojto | 115:87f2f5183dfb | 5556 | static __INLINE void arm_park_q31( |
Kojto | 115:87f2f5183dfb | 5557 | q31_t Ialpha, |
Kojto | 115:87f2f5183dfb | 5558 | q31_t Ibeta, |
Kojto | 115:87f2f5183dfb | 5559 | q31_t * pId, |
Kojto | 115:87f2f5183dfb | 5560 | q31_t * pIq, |
Kojto | 115:87f2f5183dfb | 5561 | q31_t sinVal, |
Kojto | 115:87f2f5183dfb | 5562 | q31_t cosVal) |
Kojto | 115:87f2f5183dfb | 5563 | { |
Kojto | 115:87f2f5183dfb | 5564 | q31_t product1, product2; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5565 | q31_t product3, product4; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5566 | |
Kojto | 115:87f2f5183dfb | 5567 | /* Intermediate product is calculated by (Ialpha * cosVal) */ |
Kojto | 115:87f2f5183dfb | 5568 | product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5569 | |
Kojto | 115:87f2f5183dfb | 5570 | /* Intermediate product is calculated by (Ibeta * sinVal) */ |
Kojto | 115:87f2f5183dfb | 5571 | product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5572 | |
Kojto | 115:87f2f5183dfb | 5573 | |
Kojto | 115:87f2f5183dfb | 5574 | /* Intermediate product is calculated by (Ialpha * sinVal) */ |
Kojto | 115:87f2f5183dfb | 5575 | product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5576 | |
Kojto | 115:87f2f5183dfb | 5577 | /* Intermediate product is calculated by (Ibeta * cosVal) */ |
Kojto | 115:87f2f5183dfb | 5578 | product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5579 | |
Kojto | 115:87f2f5183dfb | 5580 | /* Calculate pId by adding the two intermediate products 1 and 2 */ |
Kojto | 115:87f2f5183dfb | 5581 | *pId = __QADD(product1, product2); |
Kojto | 115:87f2f5183dfb | 5582 | |
Kojto | 115:87f2f5183dfb | 5583 | /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ |
Kojto | 115:87f2f5183dfb | 5584 | *pIq = __QSUB(product4, product3); |
Kojto | 115:87f2f5183dfb | 5585 | } |
Kojto | 115:87f2f5183dfb | 5586 | |
Kojto | 115:87f2f5183dfb | 5587 | /** |
Kojto | 115:87f2f5183dfb | 5588 | * @} end of park group |
Kojto | 115:87f2f5183dfb | 5589 | */ |
Kojto | 115:87f2f5183dfb | 5590 | |
Kojto | 115:87f2f5183dfb | 5591 | /** |
Kojto | 115:87f2f5183dfb | 5592 | * @brief Converts the elements of the Q7 vector to floating-point vector. |
Kojto | 115:87f2f5183dfb | 5593 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 5594 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 5595 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 5596 | * @return none. |
Kojto | 115:87f2f5183dfb | 5597 | */ |
Kojto | 115:87f2f5183dfb | 5598 | void arm_q7_to_float( |
Kojto | 115:87f2f5183dfb | 5599 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5600 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 5601 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 5602 | |
Kojto | 115:87f2f5183dfb | 5603 | |
Kojto | 115:87f2f5183dfb | 5604 | /** |
Kojto | 115:87f2f5183dfb | 5605 | * @ingroup groupController |
Kojto | 115:87f2f5183dfb | 5606 | */ |
Kojto | 115:87f2f5183dfb | 5607 | |
Kojto | 115:87f2f5183dfb | 5608 | /** |
Kojto | 115:87f2f5183dfb | 5609 | * @defgroup inv_park Vector Inverse Park transform |
Kojto | 115:87f2f5183dfb | 5610 | * Inverse Park transform converts the input flux and torque components to two-coordinate vector. |
Kojto | 115:87f2f5183dfb | 5611 | * |
Kojto | 115:87f2f5183dfb | 5612 | * The function operates on a single sample of data and each call to the function returns the processed output. |
Kojto | 115:87f2f5183dfb | 5613 | * The library provides separate functions for Q31 and floating-point data types. |
Kojto | 115:87f2f5183dfb | 5614 | * \par Algorithm |
Kojto | 115:87f2f5183dfb | 5615 | * \image html parkInvFormula.gif |
Kojto | 115:87f2f5183dfb | 5616 | * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components, |
Kojto | 115:87f2f5183dfb | 5617 | * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the |
Kojto | 115:87f2f5183dfb | 5618 | * cosine and sine values of theta (rotor flux position). |
Kojto | 115:87f2f5183dfb | 5619 | * \par Fixed-Point Behavior |
Kojto | 115:87f2f5183dfb | 5620 | * Care must be taken when using the Q31 version of the Park transform. |
Kojto | 115:87f2f5183dfb | 5621 | * In particular, the overflow and saturation behavior of the accumulator used must be considered. |
Kojto | 115:87f2f5183dfb | 5622 | * Refer to the function specific documentation below for usage guidelines. |
Kojto | 115:87f2f5183dfb | 5623 | */ |
Kojto | 115:87f2f5183dfb | 5624 | |
Kojto | 115:87f2f5183dfb | 5625 | /** |
Kojto | 115:87f2f5183dfb | 5626 | * @addtogroup inv_park |
Kojto | 115:87f2f5183dfb | 5627 | * @{ |
Kojto | 115:87f2f5183dfb | 5628 | */ |
Kojto | 115:87f2f5183dfb | 5629 | |
Kojto | 115:87f2f5183dfb | 5630 | /** |
Kojto | 115:87f2f5183dfb | 5631 | * @brief Floating-point Inverse Park transform |
Kojto | 115:87f2f5183dfb | 5632 | * @param[in] Id input coordinate of rotor reference frame d |
Kojto | 115:87f2f5183dfb | 5633 | * @param[in] Iq input coordinate of rotor reference frame q |
Kojto | 115:87f2f5183dfb | 5634 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5635 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5636 | * @param[in] sinVal sine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5637 | * @param[in] cosVal cosine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5638 | * @return none. |
Kojto | 115:87f2f5183dfb | 5639 | */ |
Kojto | 115:87f2f5183dfb | 5640 | |
Kojto | 115:87f2f5183dfb | 5641 | static __INLINE void arm_inv_park_f32( |
Kojto | 115:87f2f5183dfb | 5642 | float32_t Id, |
Kojto | 115:87f2f5183dfb | 5643 | float32_t Iq, |
Kojto | 115:87f2f5183dfb | 5644 | float32_t * pIalpha, |
Kojto | 115:87f2f5183dfb | 5645 | float32_t * pIbeta, |
Kojto | 115:87f2f5183dfb | 5646 | float32_t sinVal, |
Kojto | 115:87f2f5183dfb | 5647 | float32_t cosVal) |
Kojto | 115:87f2f5183dfb | 5648 | { |
Kojto | 115:87f2f5183dfb | 5649 | /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ |
Kojto | 115:87f2f5183dfb | 5650 | *pIalpha = Id * cosVal - Iq * sinVal; |
Kojto | 115:87f2f5183dfb | 5651 | |
Kojto | 115:87f2f5183dfb | 5652 | /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ |
Kojto | 115:87f2f5183dfb | 5653 | *pIbeta = Id * sinVal + Iq * cosVal; |
Kojto | 115:87f2f5183dfb | 5654 | |
Kojto | 115:87f2f5183dfb | 5655 | } |
Kojto | 115:87f2f5183dfb | 5656 | |
Kojto | 115:87f2f5183dfb | 5657 | |
Kojto | 115:87f2f5183dfb | 5658 | /** |
Kojto | 115:87f2f5183dfb | 5659 | * @brief Inverse Park transform for Q31 version |
Kojto | 115:87f2f5183dfb | 5660 | * @param[in] Id input coordinate of rotor reference frame d |
Kojto | 115:87f2f5183dfb | 5661 | * @param[in] Iq input coordinate of rotor reference frame q |
Kojto | 115:87f2f5183dfb | 5662 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
Kojto | 115:87f2f5183dfb | 5663 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
Kojto | 115:87f2f5183dfb | 5664 | * @param[in] sinVal sine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5665 | * @param[in] cosVal cosine value of rotation angle theta |
Kojto | 115:87f2f5183dfb | 5666 | * @return none. |
Kojto | 115:87f2f5183dfb | 5667 | * |
Kojto | 115:87f2f5183dfb | 5668 | * <b>Scaling and Overflow Behavior:</b> |
Kojto | 115:87f2f5183dfb | 5669 | * \par |
Kojto | 115:87f2f5183dfb | 5670 | * The function is implemented using an internal 32-bit accumulator. |
Kojto | 115:87f2f5183dfb | 5671 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
Kojto | 115:87f2f5183dfb | 5672 | * There is saturation on the addition, hence there is no risk of overflow. |
Kojto | 115:87f2f5183dfb | 5673 | */ |
Kojto | 115:87f2f5183dfb | 5674 | |
Kojto | 115:87f2f5183dfb | 5675 | |
Kojto | 115:87f2f5183dfb | 5676 | static __INLINE void arm_inv_park_q31( |
Kojto | 115:87f2f5183dfb | 5677 | q31_t Id, |
Kojto | 115:87f2f5183dfb | 5678 | q31_t Iq, |
Kojto | 115:87f2f5183dfb | 5679 | q31_t * pIalpha, |
Kojto | 115:87f2f5183dfb | 5680 | q31_t * pIbeta, |
Kojto | 115:87f2f5183dfb | 5681 | q31_t sinVal, |
Kojto | 115:87f2f5183dfb | 5682 | q31_t cosVal) |
Kojto | 115:87f2f5183dfb | 5683 | { |
Kojto | 115:87f2f5183dfb | 5684 | q31_t product1, product2; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5685 | q31_t product3, product4; /* Temporary variables used to store intermediate results */ |
Kojto | 115:87f2f5183dfb | 5686 | |
Kojto | 115:87f2f5183dfb | 5687 | /* Intermediate product is calculated by (Id * cosVal) */ |
Kojto | 115:87f2f5183dfb | 5688 | product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5689 | |
Kojto | 115:87f2f5183dfb | 5690 | /* Intermediate product is calculated by (Iq * sinVal) */ |
Kojto | 115:87f2f5183dfb | 5691 | product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5692 | |
Kojto | 115:87f2f5183dfb | 5693 | |
Kojto | 115:87f2f5183dfb | 5694 | /* Intermediate product is calculated by (Id * sinVal) */ |
Kojto | 115:87f2f5183dfb | 5695 | product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5696 | |
Kojto | 115:87f2f5183dfb | 5697 | /* Intermediate product is calculated by (Iq * cosVal) */ |
Kojto | 115:87f2f5183dfb | 5698 | product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); |
Kojto | 115:87f2f5183dfb | 5699 | |
Kojto | 115:87f2f5183dfb | 5700 | /* Calculate pIalpha by using the two intermediate products 1 and 2 */ |
Kojto | 115:87f2f5183dfb | 5701 | *pIalpha = __QSUB(product1, product2); |
Kojto | 115:87f2f5183dfb | 5702 | |
Kojto | 115:87f2f5183dfb | 5703 | /* Calculate pIbeta by using the two intermediate products 3 and 4 */ |
Kojto | 115:87f2f5183dfb | 5704 | *pIbeta = __QADD(product4, product3); |
Kojto | 115:87f2f5183dfb | 5705 | |
Kojto | 115:87f2f5183dfb | 5706 | } |
Kojto | 115:87f2f5183dfb | 5707 | |
Kojto | 115:87f2f5183dfb | 5708 | /** |
Kojto | 115:87f2f5183dfb | 5709 | * @} end of Inverse park group |
Kojto | 115:87f2f5183dfb | 5710 | */ |
Kojto | 115:87f2f5183dfb | 5711 | |
Kojto | 115:87f2f5183dfb | 5712 | |
Kojto | 115:87f2f5183dfb | 5713 | /** |
Kojto | 115:87f2f5183dfb | 5714 | * @brief Converts the elements of the Q31 vector to floating-point vector. |
Kojto | 115:87f2f5183dfb | 5715 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 5716 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 5717 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 5718 | * @return none. |
Kojto | 115:87f2f5183dfb | 5719 | */ |
Kojto | 115:87f2f5183dfb | 5720 | void arm_q31_to_float( |
Kojto | 115:87f2f5183dfb | 5721 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 5722 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 5723 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 5724 | |
Kojto | 115:87f2f5183dfb | 5725 | /** |
Kojto | 115:87f2f5183dfb | 5726 | * @ingroup groupInterpolation |
Kojto | 115:87f2f5183dfb | 5727 | */ |
Kojto | 115:87f2f5183dfb | 5728 | |
Kojto | 115:87f2f5183dfb | 5729 | /** |
Kojto | 115:87f2f5183dfb | 5730 | * @defgroup LinearInterpolate Linear Interpolation |
Kojto | 115:87f2f5183dfb | 5731 | * |
Kojto | 115:87f2f5183dfb | 5732 | * Linear interpolation is a method of curve fitting using linear polynomials. |
Kojto | 115:87f2f5183dfb | 5733 | * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line |
Kojto | 115:87f2f5183dfb | 5734 | * |
Kojto | 115:87f2f5183dfb | 5735 | * \par |
Kojto | 115:87f2f5183dfb | 5736 | * \image html LinearInterp.gif "Linear interpolation" |
Kojto | 115:87f2f5183dfb | 5737 | * |
Kojto | 115:87f2f5183dfb | 5738 | * \par |
Kojto | 115:87f2f5183dfb | 5739 | * A Linear Interpolate function calculates an output value(y), for the input(x) |
Kojto | 115:87f2f5183dfb | 5740 | * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) |
Kojto | 115:87f2f5183dfb | 5741 | * |
Kojto | 115:87f2f5183dfb | 5742 | * \par Algorithm: |
Kojto | 115:87f2f5183dfb | 5743 | * <pre> |
Kojto | 115:87f2f5183dfb | 5744 | * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0)) |
Kojto | 115:87f2f5183dfb | 5745 | * where x0, x1 are nearest values of input x |
Kojto | 115:87f2f5183dfb | 5746 | * y0, y1 are nearest values to output y |
Kojto | 115:87f2f5183dfb | 5747 | * </pre> |
Kojto | 115:87f2f5183dfb | 5748 | * |
Kojto | 115:87f2f5183dfb | 5749 | * \par |
Kojto | 115:87f2f5183dfb | 5750 | * This set of functions implements Linear interpolation process |
Kojto | 115:87f2f5183dfb | 5751 | * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single |
Kojto | 115:87f2f5183dfb | 5752 | * sample of data and each call to the function returns a single processed value. |
Kojto | 115:87f2f5183dfb | 5753 | * <code>S</code> points to an instance of the Linear Interpolate function data structure. |
Kojto | 115:87f2f5183dfb | 5754 | * <code>x</code> is the input sample value. The functions returns the output value. |
Kojto | 115:87f2f5183dfb | 5755 | * |
Kojto | 115:87f2f5183dfb | 5756 | * \par |
Kojto | 115:87f2f5183dfb | 5757 | * if x is outside of the table boundary, Linear interpolation returns first value of the table |
Kojto | 115:87f2f5183dfb | 5758 | * if x is below input range and returns last value of table if x is above range. |
Kojto | 115:87f2f5183dfb | 5759 | */ |
Kojto | 115:87f2f5183dfb | 5760 | |
Kojto | 115:87f2f5183dfb | 5761 | /** |
Kojto | 115:87f2f5183dfb | 5762 | * @addtogroup LinearInterpolate |
Kojto | 115:87f2f5183dfb | 5763 | * @{ |
Kojto | 115:87f2f5183dfb | 5764 | */ |
Kojto | 115:87f2f5183dfb | 5765 | |
Kojto | 115:87f2f5183dfb | 5766 | /** |
Kojto | 115:87f2f5183dfb | 5767 | * @brief Process function for the floating-point Linear Interpolation Function. |
Kojto | 115:87f2f5183dfb | 5768 | * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure |
Kojto | 115:87f2f5183dfb | 5769 | * @param[in] x input sample to process |
Kojto | 115:87f2f5183dfb | 5770 | * @return y processed output sample. |
Kojto | 115:87f2f5183dfb | 5771 | * |
Kojto | 115:87f2f5183dfb | 5772 | */ |
Kojto | 115:87f2f5183dfb | 5773 | |
Kojto | 115:87f2f5183dfb | 5774 | static __INLINE float32_t arm_linear_interp_f32( |
Kojto | 115:87f2f5183dfb | 5775 | arm_linear_interp_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 5776 | float32_t x) |
Kojto | 115:87f2f5183dfb | 5777 | { |
Kojto | 115:87f2f5183dfb | 5778 | |
Kojto | 115:87f2f5183dfb | 5779 | float32_t y; |
Kojto | 115:87f2f5183dfb | 5780 | float32_t x0, x1; /* Nearest input values */ |
Kojto | 115:87f2f5183dfb | 5781 | float32_t y0, y1; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 5782 | float32_t xSpacing = S->xSpacing; /* spacing between input values */ |
Kojto | 115:87f2f5183dfb | 5783 | int32_t i; /* Index variable */ |
Kojto | 115:87f2f5183dfb | 5784 | float32_t *pYData = S->pYData; /* pointer to output table */ |
Kojto | 115:87f2f5183dfb | 5785 | |
Kojto | 115:87f2f5183dfb | 5786 | /* Calculation of index */ |
Kojto | 115:87f2f5183dfb | 5787 | i = (int32_t) ((x - S->x1) / xSpacing); |
Kojto | 115:87f2f5183dfb | 5788 | |
Kojto | 115:87f2f5183dfb | 5789 | if(i < 0) |
Kojto | 115:87f2f5183dfb | 5790 | { |
Kojto | 115:87f2f5183dfb | 5791 | /* Iniatilize output for below specified range as least output value of table */ |
Kojto | 115:87f2f5183dfb | 5792 | y = pYData[0]; |
Kojto | 115:87f2f5183dfb | 5793 | } |
Kojto | 115:87f2f5183dfb | 5794 | else if((uint32_t)i >= S->nValues) |
Kojto | 115:87f2f5183dfb | 5795 | { |
Kojto | 115:87f2f5183dfb | 5796 | /* Iniatilize output for above specified range as last output value of table */ |
Kojto | 115:87f2f5183dfb | 5797 | y = pYData[S->nValues - 1]; |
Kojto | 115:87f2f5183dfb | 5798 | } |
Kojto | 115:87f2f5183dfb | 5799 | else |
Kojto | 115:87f2f5183dfb | 5800 | { |
Kojto | 115:87f2f5183dfb | 5801 | /* Calculation of nearest input values */ |
Kojto | 115:87f2f5183dfb | 5802 | x0 = S->x1 + i * xSpacing; |
Kojto | 115:87f2f5183dfb | 5803 | x1 = S->x1 + (i + 1) * xSpacing; |
Kojto | 115:87f2f5183dfb | 5804 | |
Kojto | 115:87f2f5183dfb | 5805 | /* Read of nearest output values */ |
Kojto | 115:87f2f5183dfb | 5806 | y0 = pYData[i]; |
Kojto | 115:87f2f5183dfb | 5807 | y1 = pYData[i + 1]; |
Kojto | 115:87f2f5183dfb | 5808 | |
Kojto | 115:87f2f5183dfb | 5809 | /* Calculation of output */ |
Kojto | 115:87f2f5183dfb | 5810 | y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); |
Kojto | 115:87f2f5183dfb | 5811 | |
Kojto | 115:87f2f5183dfb | 5812 | } |
Kojto | 115:87f2f5183dfb | 5813 | |
Kojto | 115:87f2f5183dfb | 5814 | /* returns output value */ |
Kojto | 115:87f2f5183dfb | 5815 | return (y); |
Kojto | 115:87f2f5183dfb | 5816 | } |
Kojto | 115:87f2f5183dfb | 5817 | |
Kojto | 115:87f2f5183dfb | 5818 | /** |
Kojto | 115:87f2f5183dfb | 5819 | * |
Kojto | 115:87f2f5183dfb | 5820 | * @brief Process function for the Q31 Linear Interpolation Function. |
Kojto | 115:87f2f5183dfb | 5821 | * @param[in] *pYData pointer to Q31 Linear Interpolation table |
Kojto | 115:87f2f5183dfb | 5822 | * @param[in] x input sample to process |
Kojto | 115:87f2f5183dfb | 5823 | * @param[in] nValues number of table values |
Kojto | 115:87f2f5183dfb | 5824 | * @return y processed output sample. |
Kojto | 115:87f2f5183dfb | 5825 | * |
Kojto | 115:87f2f5183dfb | 5826 | * \par |
Kojto | 115:87f2f5183dfb | 5827 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
Kojto | 115:87f2f5183dfb | 5828 | * This function can support maximum of table size 2^12. |
Kojto | 115:87f2f5183dfb | 5829 | * |
Kojto | 115:87f2f5183dfb | 5830 | */ |
Kojto | 115:87f2f5183dfb | 5831 | |
Kojto | 115:87f2f5183dfb | 5832 | |
Kojto | 115:87f2f5183dfb | 5833 | static __INLINE q31_t arm_linear_interp_q31( |
Kojto | 115:87f2f5183dfb | 5834 | q31_t * pYData, |
Kojto | 115:87f2f5183dfb | 5835 | q31_t x, |
Kojto | 115:87f2f5183dfb | 5836 | uint32_t nValues) |
Kojto | 115:87f2f5183dfb | 5837 | { |
Kojto | 115:87f2f5183dfb | 5838 | q31_t y; /* output */ |
Kojto | 115:87f2f5183dfb | 5839 | q31_t y0, y1; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 5840 | q31_t fract; /* fractional part */ |
Kojto | 115:87f2f5183dfb | 5841 | int32_t index; /* Index to read nearest output values */ |
Kojto | 115:87f2f5183dfb | 5842 | |
Kojto | 115:87f2f5183dfb | 5843 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 5844 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 5845 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 5846 | index = ((x & 0xFFF00000) >> 20); |
Kojto | 115:87f2f5183dfb | 5847 | |
Kojto | 115:87f2f5183dfb | 5848 | if(index >= (int32_t)(nValues - 1)) |
Kojto | 115:87f2f5183dfb | 5849 | { |
Kojto | 115:87f2f5183dfb | 5850 | return (pYData[nValues - 1]); |
Kojto | 115:87f2f5183dfb | 5851 | } |
Kojto | 115:87f2f5183dfb | 5852 | else if(index < 0) |
Kojto | 115:87f2f5183dfb | 5853 | { |
Kojto | 115:87f2f5183dfb | 5854 | return (pYData[0]); |
Kojto | 115:87f2f5183dfb | 5855 | } |
Kojto | 115:87f2f5183dfb | 5856 | else |
Kojto | 115:87f2f5183dfb | 5857 | { |
Kojto | 115:87f2f5183dfb | 5858 | |
Kojto | 115:87f2f5183dfb | 5859 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 5860 | /* shift left by 11 to keep fract in 1.31 format */ |
Kojto | 115:87f2f5183dfb | 5861 | fract = (x & 0x000FFFFF) << 11; |
Kojto | 115:87f2f5183dfb | 5862 | |
Kojto | 115:87f2f5183dfb | 5863 | /* Read two nearest output values from the index in 1.31(q31) format */ |
Kojto | 115:87f2f5183dfb | 5864 | y0 = pYData[index]; |
Kojto | 115:87f2f5183dfb | 5865 | y1 = pYData[index + 1u]; |
Kojto | 115:87f2f5183dfb | 5866 | |
Kojto | 115:87f2f5183dfb | 5867 | /* Calculation of y0 * (1-fract) and y is in 2.30 format */ |
Kojto | 115:87f2f5183dfb | 5868 | y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); |
Kojto | 115:87f2f5183dfb | 5869 | |
Kojto | 115:87f2f5183dfb | 5870 | /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ |
Kojto | 115:87f2f5183dfb | 5871 | y += ((q31_t) (((q63_t) y1 * fract) >> 32)); |
Kojto | 115:87f2f5183dfb | 5872 | |
Kojto | 115:87f2f5183dfb | 5873 | /* Convert y to 1.31 format */ |
Kojto | 115:87f2f5183dfb | 5874 | return (y << 1u); |
Kojto | 115:87f2f5183dfb | 5875 | |
Kojto | 115:87f2f5183dfb | 5876 | } |
Kojto | 115:87f2f5183dfb | 5877 | |
Kojto | 115:87f2f5183dfb | 5878 | } |
Kojto | 115:87f2f5183dfb | 5879 | |
Kojto | 115:87f2f5183dfb | 5880 | /** |
Kojto | 115:87f2f5183dfb | 5881 | * |
Kojto | 115:87f2f5183dfb | 5882 | * @brief Process function for the Q15 Linear Interpolation Function. |
Kojto | 115:87f2f5183dfb | 5883 | * @param[in] *pYData pointer to Q15 Linear Interpolation table |
Kojto | 115:87f2f5183dfb | 5884 | * @param[in] x input sample to process |
Kojto | 115:87f2f5183dfb | 5885 | * @param[in] nValues number of table values |
Kojto | 115:87f2f5183dfb | 5886 | * @return y processed output sample. |
Kojto | 115:87f2f5183dfb | 5887 | * |
Kojto | 115:87f2f5183dfb | 5888 | * \par |
Kojto | 115:87f2f5183dfb | 5889 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
Kojto | 115:87f2f5183dfb | 5890 | * This function can support maximum of table size 2^12. |
Kojto | 115:87f2f5183dfb | 5891 | * |
Kojto | 115:87f2f5183dfb | 5892 | */ |
Kojto | 115:87f2f5183dfb | 5893 | |
Kojto | 115:87f2f5183dfb | 5894 | |
Kojto | 115:87f2f5183dfb | 5895 | static __INLINE q15_t arm_linear_interp_q15( |
Kojto | 115:87f2f5183dfb | 5896 | q15_t * pYData, |
Kojto | 115:87f2f5183dfb | 5897 | q31_t x, |
Kojto | 115:87f2f5183dfb | 5898 | uint32_t nValues) |
Kojto | 115:87f2f5183dfb | 5899 | { |
Kojto | 115:87f2f5183dfb | 5900 | q63_t y; /* output */ |
Kojto | 115:87f2f5183dfb | 5901 | q15_t y0, y1; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 5902 | q31_t fract; /* fractional part */ |
Kojto | 115:87f2f5183dfb | 5903 | int32_t index; /* Index to read nearest output values */ |
Kojto | 115:87f2f5183dfb | 5904 | |
Kojto | 115:87f2f5183dfb | 5905 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 5906 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 5907 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 5908 | index = ((x & 0xFFF00000) >> 20u); |
Kojto | 115:87f2f5183dfb | 5909 | |
Kojto | 115:87f2f5183dfb | 5910 | if(index >= (int32_t)(nValues - 1)) |
Kojto | 115:87f2f5183dfb | 5911 | { |
Kojto | 115:87f2f5183dfb | 5912 | return (pYData[nValues - 1]); |
Kojto | 115:87f2f5183dfb | 5913 | } |
Kojto | 115:87f2f5183dfb | 5914 | else if(index < 0) |
Kojto | 115:87f2f5183dfb | 5915 | { |
Kojto | 115:87f2f5183dfb | 5916 | return (pYData[0]); |
Kojto | 115:87f2f5183dfb | 5917 | } |
Kojto | 115:87f2f5183dfb | 5918 | else |
Kojto | 115:87f2f5183dfb | 5919 | { |
Kojto | 115:87f2f5183dfb | 5920 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 5921 | /* fract is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 5922 | fract = (x & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 5923 | |
Kojto | 115:87f2f5183dfb | 5924 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 5925 | y0 = pYData[index]; |
Kojto | 115:87f2f5183dfb | 5926 | y1 = pYData[index + 1u]; |
Kojto | 115:87f2f5183dfb | 5927 | |
Kojto | 115:87f2f5183dfb | 5928 | /* Calculation of y0 * (1-fract) and y is in 13.35 format */ |
Kojto | 115:87f2f5183dfb | 5929 | y = ((q63_t) y0 * (0xFFFFF - fract)); |
Kojto | 115:87f2f5183dfb | 5930 | |
Kojto | 115:87f2f5183dfb | 5931 | /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ |
Kojto | 115:87f2f5183dfb | 5932 | y += ((q63_t) y1 * (fract)); |
Kojto | 115:87f2f5183dfb | 5933 | |
Kojto | 115:87f2f5183dfb | 5934 | /* convert y to 1.15 format */ |
Kojto | 115:87f2f5183dfb | 5935 | return (y >> 20); |
Kojto | 115:87f2f5183dfb | 5936 | } |
Kojto | 115:87f2f5183dfb | 5937 | |
Kojto | 115:87f2f5183dfb | 5938 | |
Kojto | 115:87f2f5183dfb | 5939 | } |
Kojto | 115:87f2f5183dfb | 5940 | |
Kojto | 115:87f2f5183dfb | 5941 | /** |
Kojto | 115:87f2f5183dfb | 5942 | * |
Kojto | 115:87f2f5183dfb | 5943 | * @brief Process function for the Q7 Linear Interpolation Function. |
Kojto | 115:87f2f5183dfb | 5944 | * @param[in] *pYData pointer to Q7 Linear Interpolation table |
Kojto | 115:87f2f5183dfb | 5945 | * @param[in] x input sample to process |
Kojto | 115:87f2f5183dfb | 5946 | * @param[in] nValues number of table values |
Kojto | 115:87f2f5183dfb | 5947 | * @return y processed output sample. |
Kojto | 115:87f2f5183dfb | 5948 | * |
Kojto | 115:87f2f5183dfb | 5949 | * \par |
Kojto | 115:87f2f5183dfb | 5950 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
Kojto | 115:87f2f5183dfb | 5951 | * This function can support maximum of table size 2^12. |
Kojto | 115:87f2f5183dfb | 5952 | */ |
Kojto | 115:87f2f5183dfb | 5953 | |
Kojto | 115:87f2f5183dfb | 5954 | |
Kojto | 115:87f2f5183dfb | 5955 | static __INLINE q7_t arm_linear_interp_q7( |
Kojto | 115:87f2f5183dfb | 5956 | q7_t * pYData, |
Kojto | 115:87f2f5183dfb | 5957 | q31_t x, |
Kojto | 115:87f2f5183dfb | 5958 | uint32_t nValues) |
Kojto | 115:87f2f5183dfb | 5959 | { |
Kojto | 115:87f2f5183dfb | 5960 | q31_t y; /* output */ |
Kojto | 115:87f2f5183dfb | 5961 | q7_t y0, y1; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 5962 | q31_t fract; /* fractional part */ |
Kojto | 115:87f2f5183dfb | 5963 | uint32_t index; /* Index to read nearest output values */ |
Kojto | 115:87f2f5183dfb | 5964 | |
Kojto | 115:87f2f5183dfb | 5965 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 5966 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 5967 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 5968 | if (x < 0) |
Kojto | 115:87f2f5183dfb | 5969 | { |
Kojto | 115:87f2f5183dfb | 5970 | return (pYData[0]); |
Kojto | 115:87f2f5183dfb | 5971 | } |
Kojto | 115:87f2f5183dfb | 5972 | index = (x >> 20) & 0xfff; |
Kojto | 115:87f2f5183dfb | 5973 | |
Kojto | 115:87f2f5183dfb | 5974 | |
Kojto | 115:87f2f5183dfb | 5975 | if(index >= (nValues - 1)) |
Kojto | 115:87f2f5183dfb | 5976 | { |
Kojto | 115:87f2f5183dfb | 5977 | return (pYData[nValues - 1]); |
Kojto | 115:87f2f5183dfb | 5978 | } |
Kojto | 115:87f2f5183dfb | 5979 | else |
Kojto | 115:87f2f5183dfb | 5980 | { |
Kojto | 115:87f2f5183dfb | 5981 | |
Kojto | 115:87f2f5183dfb | 5982 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 5983 | /* fract is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 5984 | fract = (x & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 5985 | |
Kojto | 115:87f2f5183dfb | 5986 | /* Read two nearest output values from the index and are in 1.7(q7) format */ |
Kojto | 115:87f2f5183dfb | 5987 | y0 = pYData[index]; |
Kojto | 115:87f2f5183dfb | 5988 | y1 = pYData[index + 1u]; |
Kojto | 115:87f2f5183dfb | 5989 | |
Kojto | 115:87f2f5183dfb | 5990 | /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ |
Kojto | 115:87f2f5183dfb | 5991 | y = ((y0 * (0xFFFFF - fract))); |
Kojto | 115:87f2f5183dfb | 5992 | |
Kojto | 115:87f2f5183dfb | 5993 | /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ |
Kojto | 115:87f2f5183dfb | 5994 | y += (y1 * fract); |
Kojto | 115:87f2f5183dfb | 5995 | |
Kojto | 115:87f2f5183dfb | 5996 | /* convert y to 1.7(q7) format */ |
Kojto | 115:87f2f5183dfb | 5997 | return (y >> 20u); |
Kojto | 115:87f2f5183dfb | 5998 | |
Kojto | 115:87f2f5183dfb | 5999 | } |
Kojto | 115:87f2f5183dfb | 6000 | |
Kojto | 115:87f2f5183dfb | 6001 | } |
Kojto | 115:87f2f5183dfb | 6002 | /** |
Kojto | 115:87f2f5183dfb | 6003 | * @} end of LinearInterpolate group |
Kojto | 115:87f2f5183dfb | 6004 | */ |
Kojto | 115:87f2f5183dfb | 6005 | |
Kojto | 115:87f2f5183dfb | 6006 | /** |
Kojto | 115:87f2f5183dfb | 6007 | * @brief Fast approximation to the trigonometric sine function for floating-point data. |
Kojto | 115:87f2f5183dfb | 6008 | * @param[in] x input value in radians. |
Kojto | 115:87f2f5183dfb | 6009 | * @return sin(x). |
Kojto | 115:87f2f5183dfb | 6010 | */ |
Kojto | 115:87f2f5183dfb | 6011 | |
Kojto | 115:87f2f5183dfb | 6012 | float32_t arm_sin_f32( |
Kojto | 115:87f2f5183dfb | 6013 | float32_t x); |
Kojto | 115:87f2f5183dfb | 6014 | |
Kojto | 115:87f2f5183dfb | 6015 | /** |
Kojto | 115:87f2f5183dfb | 6016 | * @brief Fast approximation to the trigonometric sine function for Q31 data. |
Kojto | 115:87f2f5183dfb | 6017 | * @param[in] x Scaled input value in radians. |
Kojto | 115:87f2f5183dfb | 6018 | * @return sin(x). |
Kojto | 115:87f2f5183dfb | 6019 | */ |
Kojto | 115:87f2f5183dfb | 6020 | |
Kojto | 115:87f2f5183dfb | 6021 | q31_t arm_sin_q31( |
Kojto | 115:87f2f5183dfb | 6022 | q31_t x); |
Kojto | 115:87f2f5183dfb | 6023 | |
Kojto | 115:87f2f5183dfb | 6024 | /** |
Kojto | 115:87f2f5183dfb | 6025 | * @brief Fast approximation to the trigonometric sine function for Q15 data. |
Kojto | 115:87f2f5183dfb | 6026 | * @param[in] x Scaled input value in radians. |
Kojto | 115:87f2f5183dfb | 6027 | * @return sin(x). |
Kojto | 115:87f2f5183dfb | 6028 | */ |
Kojto | 115:87f2f5183dfb | 6029 | |
Kojto | 115:87f2f5183dfb | 6030 | q15_t arm_sin_q15( |
Kojto | 115:87f2f5183dfb | 6031 | q15_t x); |
Kojto | 115:87f2f5183dfb | 6032 | |
Kojto | 115:87f2f5183dfb | 6033 | /** |
Kojto | 115:87f2f5183dfb | 6034 | * @brief Fast approximation to the trigonometric cosine function for floating-point data. |
Kojto | 115:87f2f5183dfb | 6035 | * @param[in] x input value in radians. |
Kojto | 115:87f2f5183dfb | 6036 | * @return cos(x). |
Kojto | 115:87f2f5183dfb | 6037 | */ |
Kojto | 115:87f2f5183dfb | 6038 | |
Kojto | 115:87f2f5183dfb | 6039 | float32_t arm_cos_f32( |
Kojto | 115:87f2f5183dfb | 6040 | float32_t x); |
Kojto | 115:87f2f5183dfb | 6041 | |
Kojto | 115:87f2f5183dfb | 6042 | /** |
Kojto | 115:87f2f5183dfb | 6043 | * @brief Fast approximation to the trigonometric cosine function for Q31 data. |
Kojto | 115:87f2f5183dfb | 6044 | * @param[in] x Scaled input value in radians. |
Kojto | 115:87f2f5183dfb | 6045 | * @return cos(x). |
Kojto | 115:87f2f5183dfb | 6046 | */ |
Kojto | 115:87f2f5183dfb | 6047 | |
Kojto | 115:87f2f5183dfb | 6048 | q31_t arm_cos_q31( |
Kojto | 115:87f2f5183dfb | 6049 | q31_t x); |
Kojto | 115:87f2f5183dfb | 6050 | |
Kojto | 115:87f2f5183dfb | 6051 | /** |
Kojto | 115:87f2f5183dfb | 6052 | * @brief Fast approximation to the trigonometric cosine function for Q15 data. |
Kojto | 115:87f2f5183dfb | 6053 | * @param[in] x Scaled input value in radians. |
Kojto | 115:87f2f5183dfb | 6054 | * @return cos(x). |
Kojto | 115:87f2f5183dfb | 6055 | */ |
Kojto | 115:87f2f5183dfb | 6056 | |
Kojto | 115:87f2f5183dfb | 6057 | q15_t arm_cos_q15( |
Kojto | 115:87f2f5183dfb | 6058 | q15_t x); |
Kojto | 115:87f2f5183dfb | 6059 | |
Kojto | 115:87f2f5183dfb | 6060 | |
Kojto | 115:87f2f5183dfb | 6061 | /** |
Kojto | 115:87f2f5183dfb | 6062 | * @ingroup groupFastMath |
Kojto | 115:87f2f5183dfb | 6063 | */ |
Kojto | 115:87f2f5183dfb | 6064 | |
Kojto | 115:87f2f5183dfb | 6065 | |
Kojto | 115:87f2f5183dfb | 6066 | /** |
Kojto | 115:87f2f5183dfb | 6067 | * @defgroup SQRT Square Root |
Kojto | 115:87f2f5183dfb | 6068 | * |
Kojto | 115:87f2f5183dfb | 6069 | * Computes the square root of a number. |
Kojto | 115:87f2f5183dfb | 6070 | * There are separate functions for Q15, Q31, and floating-point data types. |
Kojto | 115:87f2f5183dfb | 6071 | * The square root function is computed using the Newton-Raphson algorithm. |
Kojto | 115:87f2f5183dfb | 6072 | * This is an iterative algorithm of the form: |
Kojto | 115:87f2f5183dfb | 6073 | * <pre> |
Kojto | 115:87f2f5183dfb | 6074 | * x1 = x0 - f(x0)/f'(x0) |
Kojto | 115:87f2f5183dfb | 6075 | * </pre> |
Kojto | 115:87f2f5183dfb | 6076 | * where <code>x1</code> is the current estimate, |
Kojto | 115:87f2f5183dfb | 6077 | * <code>x0</code> is the previous estimate, and |
Kojto | 115:87f2f5183dfb | 6078 | * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>. |
Kojto | 115:87f2f5183dfb | 6079 | * For the square root function, the algorithm reduces to: |
Kojto | 115:87f2f5183dfb | 6080 | * <pre> |
Kojto | 115:87f2f5183dfb | 6081 | * x0 = in/2 [initial guess] |
Kojto | 115:87f2f5183dfb | 6082 | * x1 = 1/2 * ( x0 + in / x0) [each iteration] |
Kojto | 115:87f2f5183dfb | 6083 | * </pre> |
Kojto | 115:87f2f5183dfb | 6084 | */ |
Kojto | 115:87f2f5183dfb | 6085 | |
Kojto | 115:87f2f5183dfb | 6086 | |
Kojto | 115:87f2f5183dfb | 6087 | /** |
Kojto | 115:87f2f5183dfb | 6088 | * @addtogroup SQRT |
Kojto | 115:87f2f5183dfb | 6089 | * @{ |
Kojto | 115:87f2f5183dfb | 6090 | */ |
Kojto | 115:87f2f5183dfb | 6091 | |
Kojto | 115:87f2f5183dfb | 6092 | /** |
Kojto | 115:87f2f5183dfb | 6093 | * @brief Floating-point square root function. |
Kojto | 115:87f2f5183dfb | 6094 | * @param[in] in input value. |
Kojto | 115:87f2f5183dfb | 6095 | * @param[out] *pOut square root of input value. |
Kojto | 115:87f2f5183dfb | 6096 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
Kojto | 115:87f2f5183dfb | 6097 | * <code>in</code> is negative value and returns zero output for negative values. |
Kojto | 115:87f2f5183dfb | 6098 | */ |
Kojto | 115:87f2f5183dfb | 6099 | |
Kojto | 115:87f2f5183dfb | 6100 | static __INLINE arm_status arm_sqrt_f32( |
Kojto | 115:87f2f5183dfb | 6101 | float32_t in, |
Kojto | 115:87f2f5183dfb | 6102 | float32_t * pOut) |
Kojto | 115:87f2f5183dfb | 6103 | { |
Kojto | 115:87f2f5183dfb | 6104 | if(in >= 0.0f) |
Kojto | 115:87f2f5183dfb | 6105 | { |
Kojto | 115:87f2f5183dfb | 6106 | |
Kojto | 115:87f2f5183dfb | 6107 | // #if __FPU_USED |
Kojto | 115:87f2f5183dfb | 6108 | #if (__FPU_USED == 1) && defined ( __CC_ARM ) |
Kojto | 115:87f2f5183dfb | 6109 | *pOut = __sqrtf(in); |
Kojto | 115:87f2f5183dfb | 6110 | #else |
Kojto | 115:87f2f5183dfb | 6111 | *pOut = sqrtf(in); |
Kojto | 115:87f2f5183dfb | 6112 | #endif |
Kojto | 115:87f2f5183dfb | 6113 | |
Kojto | 115:87f2f5183dfb | 6114 | return (ARM_MATH_SUCCESS); |
Kojto | 115:87f2f5183dfb | 6115 | } |
Kojto | 115:87f2f5183dfb | 6116 | else |
Kojto | 115:87f2f5183dfb | 6117 | { |
Kojto | 115:87f2f5183dfb | 6118 | *pOut = 0.0f; |
Kojto | 115:87f2f5183dfb | 6119 | return (ARM_MATH_ARGUMENT_ERROR); |
Kojto | 115:87f2f5183dfb | 6120 | } |
Kojto | 115:87f2f5183dfb | 6121 | |
Kojto | 115:87f2f5183dfb | 6122 | } |
Kojto | 115:87f2f5183dfb | 6123 | |
Kojto | 115:87f2f5183dfb | 6124 | |
Kojto | 115:87f2f5183dfb | 6125 | /** |
Kojto | 115:87f2f5183dfb | 6126 | * @brief Q31 square root function. |
Kojto | 115:87f2f5183dfb | 6127 | * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. |
Kojto | 115:87f2f5183dfb | 6128 | * @param[out] *pOut square root of input value. |
Kojto | 115:87f2f5183dfb | 6129 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
Kojto | 115:87f2f5183dfb | 6130 | * <code>in</code> is negative value and returns zero output for negative values. |
Kojto | 115:87f2f5183dfb | 6131 | */ |
Kojto | 115:87f2f5183dfb | 6132 | arm_status arm_sqrt_q31( |
Kojto | 115:87f2f5183dfb | 6133 | q31_t in, |
Kojto | 115:87f2f5183dfb | 6134 | q31_t * pOut); |
Kojto | 115:87f2f5183dfb | 6135 | |
Kojto | 115:87f2f5183dfb | 6136 | /** |
Kojto | 115:87f2f5183dfb | 6137 | * @brief Q15 square root function. |
Kojto | 115:87f2f5183dfb | 6138 | * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. |
Kojto | 115:87f2f5183dfb | 6139 | * @param[out] *pOut square root of input value. |
Kojto | 115:87f2f5183dfb | 6140 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
Kojto | 115:87f2f5183dfb | 6141 | * <code>in</code> is negative value and returns zero output for negative values. |
Kojto | 115:87f2f5183dfb | 6142 | */ |
Kojto | 115:87f2f5183dfb | 6143 | arm_status arm_sqrt_q15( |
Kojto | 115:87f2f5183dfb | 6144 | q15_t in, |
Kojto | 115:87f2f5183dfb | 6145 | q15_t * pOut); |
Kojto | 115:87f2f5183dfb | 6146 | |
Kojto | 115:87f2f5183dfb | 6147 | /** |
Kojto | 115:87f2f5183dfb | 6148 | * @} end of SQRT group |
Kojto | 115:87f2f5183dfb | 6149 | */ |
Kojto | 115:87f2f5183dfb | 6150 | |
Kojto | 115:87f2f5183dfb | 6151 | |
Kojto | 115:87f2f5183dfb | 6152 | |
Kojto | 115:87f2f5183dfb | 6153 | |
Kojto | 115:87f2f5183dfb | 6154 | |
Kojto | 115:87f2f5183dfb | 6155 | |
Kojto | 115:87f2f5183dfb | 6156 | /** |
Kojto | 115:87f2f5183dfb | 6157 | * @brief floating-point Circular write function. |
Kojto | 115:87f2f5183dfb | 6158 | */ |
Kojto | 115:87f2f5183dfb | 6159 | |
Kojto | 115:87f2f5183dfb | 6160 | static __INLINE void arm_circularWrite_f32( |
Kojto | 115:87f2f5183dfb | 6161 | int32_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6162 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6163 | uint16_t * writeOffset, |
Kojto | 115:87f2f5183dfb | 6164 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6165 | const int32_t * src, |
Kojto | 115:87f2f5183dfb | 6166 | int32_t srcInc, |
Kojto | 115:87f2f5183dfb | 6167 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6168 | { |
Kojto | 115:87f2f5183dfb | 6169 | uint32_t i = 0u; |
Kojto | 115:87f2f5183dfb | 6170 | int32_t wOffset; |
Kojto | 115:87f2f5183dfb | 6171 | |
Kojto | 115:87f2f5183dfb | 6172 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6173 | * to the current location where the input samples to be copied */ |
Kojto | 115:87f2f5183dfb | 6174 | wOffset = *writeOffset; |
Kojto | 115:87f2f5183dfb | 6175 | |
Kojto | 115:87f2f5183dfb | 6176 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6177 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6178 | |
Kojto | 115:87f2f5183dfb | 6179 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6180 | { |
Kojto | 115:87f2f5183dfb | 6181 | /* copy the input sample to the circular buffer */ |
Kojto | 115:87f2f5183dfb | 6182 | circBuffer[wOffset] = *src; |
Kojto | 115:87f2f5183dfb | 6183 | |
Kojto | 115:87f2f5183dfb | 6184 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6185 | src += srcInc; |
Kojto | 115:87f2f5183dfb | 6186 | |
Kojto | 115:87f2f5183dfb | 6187 | /* Circularly update wOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6188 | wOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6189 | if(wOffset >= L) |
Kojto | 115:87f2f5183dfb | 6190 | wOffset -= L; |
Kojto | 115:87f2f5183dfb | 6191 | |
Kojto | 115:87f2f5183dfb | 6192 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6193 | i--; |
Kojto | 115:87f2f5183dfb | 6194 | } |
Kojto | 115:87f2f5183dfb | 6195 | |
Kojto | 115:87f2f5183dfb | 6196 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6197 | *writeOffset = wOffset; |
Kojto | 115:87f2f5183dfb | 6198 | } |
Kojto | 115:87f2f5183dfb | 6199 | |
Kojto | 115:87f2f5183dfb | 6200 | |
Kojto | 115:87f2f5183dfb | 6201 | |
Kojto | 115:87f2f5183dfb | 6202 | /** |
Kojto | 115:87f2f5183dfb | 6203 | * @brief floating-point Circular Read function. |
Kojto | 115:87f2f5183dfb | 6204 | */ |
Kojto | 115:87f2f5183dfb | 6205 | static __INLINE void arm_circularRead_f32( |
Kojto | 115:87f2f5183dfb | 6206 | int32_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6207 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6208 | int32_t * readOffset, |
Kojto | 115:87f2f5183dfb | 6209 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6210 | int32_t * dst, |
Kojto | 115:87f2f5183dfb | 6211 | int32_t * dst_base, |
Kojto | 115:87f2f5183dfb | 6212 | int32_t dst_length, |
Kojto | 115:87f2f5183dfb | 6213 | int32_t dstInc, |
Kojto | 115:87f2f5183dfb | 6214 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6215 | { |
Kojto | 115:87f2f5183dfb | 6216 | uint32_t i = 0u; |
Kojto | 115:87f2f5183dfb | 6217 | int32_t rOffset, dst_end; |
Kojto | 115:87f2f5183dfb | 6218 | |
Kojto | 115:87f2f5183dfb | 6219 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6220 | * to the current location from where the input samples to be read */ |
Kojto | 115:87f2f5183dfb | 6221 | rOffset = *readOffset; |
Kojto | 115:87f2f5183dfb | 6222 | dst_end = (int32_t) (dst_base + dst_length); |
Kojto | 115:87f2f5183dfb | 6223 | |
Kojto | 115:87f2f5183dfb | 6224 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6225 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6226 | |
Kojto | 115:87f2f5183dfb | 6227 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6228 | { |
Kojto | 115:87f2f5183dfb | 6229 | /* copy the sample from the circular buffer to the destination buffer */ |
Kojto | 115:87f2f5183dfb | 6230 | *dst = circBuffer[rOffset]; |
Kojto | 115:87f2f5183dfb | 6231 | |
Kojto | 115:87f2f5183dfb | 6232 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6233 | dst += dstInc; |
Kojto | 115:87f2f5183dfb | 6234 | |
Kojto | 115:87f2f5183dfb | 6235 | if(dst == (int32_t *) dst_end) |
Kojto | 115:87f2f5183dfb | 6236 | { |
Kojto | 115:87f2f5183dfb | 6237 | dst = dst_base; |
Kojto | 115:87f2f5183dfb | 6238 | } |
Kojto | 115:87f2f5183dfb | 6239 | |
Kojto | 115:87f2f5183dfb | 6240 | /* Circularly update rOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6241 | rOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6242 | |
Kojto | 115:87f2f5183dfb | 6243 | if(rOffset >= L) |
Kojto | 115:87f2f5183dfb | 6244 | { |
Kojto | 115:87f2f5183dfb | 6245 | rOffset -= L; |
Kojto | 115:87f2f5183dfb | 6246 | } |
Kojto | 115:87f2f5183dfb | 6247 | |
Kojto | 115:87f2f5183dfb | 6248 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6249 | i--; |
Kojto | 115:87f2f5183dfb | 6250 | } |
Kojto | 115:87f2f5183dfb | 6251 | |
Kojto | 115:87f2f5183dfb | 6252 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6253 | *readOffset = rOffset; |
Kojto | 115:87f2f5183dfb | 6254 | } |
Kojto | 115:87f2f5183dfb | 6255 | |
Kojto | 115:87f2f5183dfb | 6256 | /** |
Kojto | 115:87f2f5183dfb | 6257 | * @brief Q15 Circular write function. |
Kojto | 115:87f2f5183dfb | 6258 | */ |
Kojto | 115:87f2f5183dfb | 6259 | |
Kojto | 115:87f2f5183dfb | 6260 | static __INLINE void arm_circularWrite_q15( |
Kojto | 115:87f2f5183dfb | 6261 | q15_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6262 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6263 | uint16_t * writeOffset, |
Kojto | 115:87f2f5183dfb | 6264 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6265 | const q15_t * src, |
Kojto | 115:87f2f5183dfb | 6266 | int32_t srcInc, |
Kojto | 115:87f2f5183dfb | 6267 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6268 | { |
Kojto | 115:87f2f5183dfb | 6269 | uint32_t i = 0u; |
Kojto | 115:87f2f5183dfb | 6270 | int32_t wOffset; |
Kojto | 115:87f2f5183dfb | 6271 | |
Kojto | 115:87f2f5183dfb | 6272 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6273 | * to the current location where the input samples to be copied */ |
Kojto | 115:87f2f5183dfb | 6274 | wOffset = *writeOffset; |
Kojto | 115:87f2f5183dfb | 6275 | |
Kojto | 115:87f2f5183dfb | 6276 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6277 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6278 | |
Kojto | 115:87f2f5183dfb | 6279 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6280 | { |
Kojto | 115:87f2f5183dfb | 6281 | /* copy the input sample to the circular buffer */ |
Kojto | 115:87f2f5183dfb | 6282 | circBuffer[wOffset] = *src; |
Kojto | 115:87f2f5183dfb | 6283 | |
Kojto | 115:87f2f5183dfb | 6284 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6285 | src += srcInc; |
Kojto | 115:87f2f5183dfb | 6286 | |
Kojto | 115:87f2f5183dfb | 6287 | /* Circularly update wOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6288 | wOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6289 | if(wOffset >= L) |
Kojto | 115:87f2f5183dfb | 6290 | wOffset -= L; |
Kojto | 115:87f2f5183dfb | 6291 | |
Kojto | 115:87f2f5183dfb | 6292 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6293 | i--; |
Kojto | 115:87f2f5183dfb | 6294 | } |
Kojto | 115:87f2f5183dfb | 6295 | |
Kojto | 115:87f2f5183dfb | 6296 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6297 | *writeOffset = wOffset; |
Kojto | 115:87f2f5183dfb | 6298 | } |
Kojto | 115:87f2f5183dfb | 6299 | |
Kojto | 115:87f2f5183dfb | 6300 | |
Kojto | 115:87f2f5183dfb | 6301 | |
Kojto | 115:87f2f5183dfb | 6302 | /** |
Kojto | 115:87f2f5183dfb | 6303 | * @brief Q15 Circular Read function. |
Kojto | 115:87f2f5183dfb | 6304 | */ |
Kojto | 115:87f2f5183dfb | 6305 | static __INLINE void arm_circularRead_q15( |
Kojto | 115:87f2f5183dfb | 6306 | q15_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6307 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6308 | int32_t * readOffset, |
Kojto | 115:87f2f5183dfb | 6309 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6310 | q15_t * dst, |
Kojto | 115:87f2f5183dfb | 6311 | q15_t * dst_base, |
Kojto | 115:87f2f5183dfb | 6312 | int32_t dst_length, |
Kojto | 115:87f2f5183dfb | 6313 | int32_t dstInc, |
Kojto | 115:87f2f5183dfb | 6314 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6315 | { |
Kojto | 115:87f2f5183dfb | 6316 | uint32_t i = 0; |
Kojto | 115:87f2f5183dfb | 6317 | int32_t rOffset, dst_end; |
Kojto | 115:87f2f5183dfb | 6318 | |
Kojto | 115:87f2f5183dfb | 6319 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6320 | * to the current location from where the input samples to be read */ |
Kojto | 115:87f2f5183dfb | 6321 | rOffset = *readOffset; |
Kojto | 115:87f2f5183dfb | 6322 | |
Kojto | 115:87f2f5183dfb | 6323 | dst_end = (int32_t) (dst_base + dst_length); |
Kojto | 115:87f2f5183dfb | 6324 | |
Kojto | 115:87f2f5183dfb | 6325 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6326 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6327 | |
Kojto | 115:87f2f5183dfb | 6328 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6329 | { |
Kojto | 115:87f2f5183dfb | 6330 | /* copy the sample from the circular buffer to the destination buffer */ |
Kojto | 115:87f2f5183dfb | 6331 | *dst = circBuffer[rOffset]; |
Kojto | 115:87f2f5183dfb | 6332 | |
Kojto | 115:87f2f5183dfb | 6333 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6334 | dst += dstInc; |
Kojto | 115:87f2f5183dfb | 6335 | |
Kojto | 115:87f2f5183dfb | 6336 | if(dst == (q15_t *) dst_end) |
Kojto | 115:87f2f5183dfb | 6337 | { |
Kojto | 115:87f2f5183dfb | 6338 | dst = dst_base; |
Kojto | 115:87f2f5183dfb | 6339 | } |
Kojto | 115:87f2f5183dfb | 6340 | |
Kojto | 115:87f2f5183dfb | 6341 | /* Circularly update wOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6342 | rOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6343 | |
Kojto | 115:87f2f5183dfb | 6344 | if(rOffset >= L) |
Kojto | 115:87f2f5183dfb | 6345 | { |
Kojto | 115:87f2f5183dfb | 6346 | rOffset -= L; |
Kojto | 115:87f2f5183dfb | 6347 | } |
Kojto | 115:87f2f5183dfb | 6348 | |
Kojto | 115:87f2f5183dfb | 6349 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6350 | i--; |
Kojto | 115:87f2f5183dfb | 6351 | } |
Kojto | 115:87f2f5183dfb | 6352 | |
Kojto | 115:87f2f5183dfb | 6353 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6354 | *readOffset = rOffset; |
Kojto | 115:87f2f5183dfb | 6355 | } |
Kojto | 115:87f2f5183dfb | 6356 | |
Kojto | 115:87f2f5183dfb | 6357 | |
Kojto | 115:87f2f5183dfb | 6358 | /** |
Kojto | 115:87f2f5183dfb | 6359 | * @brief Q7 Circular write function. |
Kojto | 115:87f2f5183dfb | 6360 | */ |
Kojto | 115:87f2f5183dfb | 6361 | |
Kojto | 115:87f2f5183dfb | 6362 | static __INLINE void arm_circularWrite_q7( |
Kojto | 115:87f2f5183dfb | 6363 | q7_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6364 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6365 | uint16_t * writeOffset, |
Kojto | 115:87f2f5183dfb | 6366 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6367 | const q7_t * src, |
Kojto | 115:87f2f5183dfb | 6368 | int32_t srcInc, |
Kojto | 115:87f2f5183dfb | 6369 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6370 | { |
Kojto | 115:87f2f5183dfb | 6371 | uint32_t i = 0u; |
Kojto | 115:87f2f5183dfb | 6372 | int32_t wOffset; |
Kojto | 115:87f2f5183dfb | 6373 | |
Kojto | 115:87f2f5183dfb | 6374 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6375 | * to the current location where the input samples to be copied */ |
Kojto | 115:87f2f5183dfb | 6376 | wOffset = *writeOffset; |
Kojto | 115:87f2f5183dfb | 6377 | |
Kojto | 115:87f2f5183dfb | 6378 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6379 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6380 | |
Kojto | 115:87f2f5183dfb | 6381 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6382 | { |
Kojto | 115:87f2f5183dfb | 6383 | /* copy the input sample to the circular buffer */ |
Kojto | 115:87f2f5183dfb | 6384 | circBuffer[wOffset] = *src; |
Kojto | 115:87f2f5183dfb | 6385 | |
Kojto | 115:87f2f5183dfb | 6386 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6387 | src += srcInc; |
Kojto | 115:87f2f5183dfb | 6388 | |
Kojto | 115:87f2f5183dfb | 6389 | /* Circularly update wOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6390 | wOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6391 | if(wOffset >= L) |
Kojto | 115:87f2f5183dfb | 6392 | wOffset -= L; |
Kojto | 115:87f2f5183dfb | 6393 | |
Kojto | 115:87f2f5183dfb | 6394 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6395 | i--; |
Kojto | 115:87f2f5183dfb | 6396 | } |
Kojto | 115:87f2f5183dfb | 6397 | |
Kojto | 115:87f2f5183dfb | 6398 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6399 | *writeOffset = wOffset; |
Kojto | 115:87f2f5183dfb | 6400 | } |
Kojto | 115:87f2f5183dfb | 6401 | |
Kojto | 115:87f2f5183dfb | 6402 | |
Kojto | 115:87f2f5183dfb | 6403 | |
Kojto | 115:87f2f5183dfb | 6404 | /** |
Kojto | 115:87f2f5183dfb | 6405 | * @brief Q7 Circular Read function. |
Kojto | 115:87f2f5183dfb | 6406 | */ |
Kojto | 115:87f2f5183dfb | 6407 | static __INLINE void arm_circularRead_q7( |
Kojto | 115:87f2f5183dfb | 6408 | q7_t * circBuffer, |
Kojto | 115:87f2f5183dfb | 6409 | int32_t L, |
Kojto | 115:87f2f5183dfb | 6410 | int32_t * readOffset, |
Kojto | 115:87f2f5183dfb | 6411 | int32_t bufferInc, |
Kojto | 115:87f2f5183dfb | 6412 | q7_t * dst, |
Kojto | 115:87f2f5183dfb | 6413 | q7_t * dst_base, |
Kojto | 115:87f2f5183dfb | 6414 | int32_t dst_length, |
Kojto | 115:87f2f5183dfb | 6415 | int32_t dstInc, |
Kojto | 115:87f2f5183dfb | 6416 | uint32_t blockSize) |
Kojto | 115:87f2f5183dfb | 6417 | { |
Kojto | 115:87f2f5183dfb | 6418 | uint32_t i = 0; |
Kojto | 115:87f2f5183dfb | 6419 | int32_t rOffset, dst_end; |
Kojto | 115:87f2f5183dfb | 6420 | |
Kojto | 115:87f2f5183dfb | 6421 | /* Copy the value of Index pointer that points |
Kojto | 115:87f2f5183dfb | 6422 | * to the current location from where the input samples to be read */ |
Kojto | 115:87f2f5183dfb | 6423 | rOffset = *readOffset; |
Kojto | 115:87f2f5183dfb | 6424 | |
Kojto | 115:87f2f5183dfb | 6425 | dst_end = (int32_t) (dst_base + dst_length); |
Kojto | 115:87f2f5183dfb | 6426 | |
Kojto | 115:87f2f5183dfb | 6427 | /* Loop over the blockSize */ |
Kojto | 115:87f2f5183dfb | 6428 | i = blockSize; |
Kojto | 115:87f2f5183dfb | 6429 | |
Kojto | 115:87f2f5183dfb | 6430 | while(i > 0u) |
Kojto | 115:87f2f5183dfb | 6431 | { |
Kojto | 115:87f2f5183dfb | 6432 | /* copy the sample from the circular buffer to the destination buffer */ |
Kojto | 115:87f2f5183dfb | 6433 | *dst = circBuffer[rOffset]; |
Kojto | 115:87f2f5183dfb | 6434 | |
Kojto | 115:87f2f5183dfb | 6435 | /* Update the input pointer */ |
Kojto | 115:87f2f5183dfb | 6436 | dst += dstInc; |
Kojto | 115:87f2f5183dfb | 6437 | |
Kojto | 115:87f2f5183dfb | 6438 | if(dst == (q7_t *) dst_end) |
Kojto | 115:87f2f5183dfb | 6439 | { |
Kojto | 115:87f2f5183dfb | 6440 | dst = dst_base; |
Kojto | 115:87f2f5183dfb | 6441 | } |
Kojto | 115:87f2f5183dfb | 6442 | |
Kojto | 115:87f2f5183dfb | 6443 | /* Circularly update rOffset. Watch out for positive and negative value */ |
Kojto | 115:87f2f5183dfb | 6444 | rOffset += bufferInc; |
Kojto | 115:87f2f5183dfb | 6445 | |
Kojto | 115:87f2f5183dfb | 6446 | if(rOffset >= L) |
Kojto | 115:87f2f5183dfb | 6447 | { |
Kojto | 115:87f2f5183dfb | 6448 | rOffset -= L; |
Kojto | 115:87f2f5183dfb | 6449 | } |
Kojto | 115:87f2f5183dfb | 6450 | |
Kojto | 115:87f2f5183dfb | 6451 | /* Decrement the loop counter */ |
Kojto | 115:87f2f5183dfb | 6452 | i--; |
Kojto | 115:87f2f5183dfb | 6453 | } |
Kojto | 115:87f2f5183dfb | 6454 | |
Kojto | 115:87f2f5183dfb | 6455 | /* Update the index pointer */ |
Kojto | 115:87f2f5183dfb | 6456 | *readOffset = rOffset; |
Kojto | 115:87f2f5183dfb | 6457 | } |
Kojto | 115:87f2f5183dfb | 6458 | |
Kojto | 115:87f2f5183dfb | 6459 | |
Kojto | 115:87f2f5183dfb | 6460 | /** |
Kojto | 115:87f2f5183dfb | 6461 | * @brief Sum of the squares of the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6462 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6463 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6464 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6465 | * @return none. |
Kojto | 115:87f2f5183dfb | 6466 | */ |
Kojto | 115:87f2f5183dfb | 6467 | |
Kojto | 115:87f2f5183dfb | 6468 | void arm_power_q31( |
Kojto | 115:87f2f5183dfb | 6469 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6470 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6471 | q63_t * pResult); |
Kojto | 115:87f2f5183dfb | 6472 | |
Kojto | 115:87f2f5183dfb | 6473 | /** |
Kojto | 115:87f2f5183dfb | 6474 | * @brief Sum of the squares of the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6475 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6476 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6477 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6478 | * @return none. |
Kojto | 115:87f2f5183dfb | 6479 | */ |
Kojto | 115:87f2f5183dfb | 6480 | |
Kojto | 115:87f2f5183dfb | 6481 | void arm_power_f32( |
Kojto | 115:87f2f5183dfb | 6482 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6483 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6484 | float32_t * pResult); |
Kojto | 115:87f2f5183dfb | 6485 | |
Kojto | 115:87f2f5183dfb | 6486 | /** |
Kojto | 115:87f2f5183dfb | 6487 | * @brief Sum of the squares of the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6488 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6489 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6490 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6491 | * @return none. |
Kojto | 115:87f2f5183dfb | 6492 | */ |
Kojto | 115:87f2f5183dfb | 6493 | |
Kojto | 115:87f2f5183dfb | 6494 | void arm_power_q15( |
Kojto | 115:87f2f5183dfb | 6495 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6496 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6497 | q63_t * pResult); |
Kojto | 115:87f2f5183dfb | 6498 | |
Kojto | 115:87f2f5183dfb | 6499 | /** |
Kojto | 115:87f2f5183dfb | 6500 | * @brief Sum of the squares of the elements of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 6501 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6502 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6503 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6504 | * @return none. |
Kojto | 115:87f2f5183dfb | 6505 | */ |
Kojto | 115:87f2f5183dfb | 6506 | |
Kojto | 115:87f2f5183dfb | 6507 | void arm_power_q7( |
Kojto | 115:87f2f5183dfb | 6508 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6509 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6510 | q31_t * pResult); |
Kojto | 115:87f2f5183dfb | 6511 | |
Kojto | 115:87f2f5183dfb | 6512 | /** |
Kojto | 115:87f2f5183dfb | 6513 | * @brief Mean value of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 6514 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6515 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6516 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6517 | * @return none. |
Kojto | 115:87f2f5183dfb | 6518 | */ |
Kojto | 115:87f2f5183dfb | 6519 | |
Kojto | 115:87f2f5183dfb | 6520 | void arm_mean_q7( |
Kojto | 115:87f2f5183dfb | 6521 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6522 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6523 | q7_t * pResult); |
Kojto | 115:87f2f5183dfb | 6524 | |
Kojto | 115:87f2f5183dfb | 6525 | /** |
Kojto | 115:87f2f5183dfb | 6526 | * @brief Mean value of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6527 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6528 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6529 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6530 | * @return none. |
Kojto | 115:87f2f5183dfb | 6531 | */ |
Kojto | 115:87f2f5183dfb | 6532 | void arm_mean_q15( |
Kojto | 115:87f2f5183dfb | 6533 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6534 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6535 | q15_t * pResult); |
Kojto | 115:87f2f5183dfb | 6536 | |
Kojto | 115:87f2f5183dfb | 6537 | /** |
Kojto | 115:87f2f5183dfb | 6538 | * @brief Mean value of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6539 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6540 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6541 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6542 | * @return none. |
Kojto | 115:87f2f5183dfb | 6543 | */ |
Kojto | 115:87f2f5183dfb | 6544 | void arm_mean_q31( |
Kojto | 115:87f2f5183dfb | 6545 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6546 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6547 | q31_t * pResult); |
Kojto | 115:87f2f5183dfb | 6548 | |
Kojto | 115:87f2f5183dfb | 6549 | /** |
Kojto | 115:87f2f5183dfb | 6550 | * @brief Mean value of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6551 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6552 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6553 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6554 | * @return none. |
Kojto | 115:87f2f5183dfb | 6555 | */ |
Kojto | 115:87f2f5183dfb | 6556 | void arm_mean_f32( |
Kojto | 115:87f2f5183dfb | 6557 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6558 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6559 | float32_t * pResult); |
Kojto | 115:87f2f5183dfb | 6560 | |
Kojto | 115:87f2f5183dfb | 6561 | /** |
Kojto | 115:87f2f5183dfb | 6562 | * @brief Variance of the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6563 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6564 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6565 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6566 | * @return none. |
Kojto | 115:87f2f5183dfb | 6567 | */ |
Kojto | 115:87f2f5183dfb | 6568 | |
Kojto | 115:87f2f5183dfb | 6569 | void arm_var_f32( |
Kojto | 115:87f2f5183dfb | 6570 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6571 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6572 | float32_t * pResult); |
Kojto | 115:87f2f5183dfb | 6573 | |
Kojto | 115:87f2f5183dfb | 6574 | /** |
Kojto | 115:87f2f5183dfb | 6575 | * @brief Variance of the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6576 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6577 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6578 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6579 | * @return none. |
Kojto | 115:87f2f5183dfb | 6580 | */ |
Kojto | 115:87f2f5183dfb | 6581 | |
Kojto | 115:87f2f5183dfb | 6582 | void arm_var_q31( |
Kojto | 115:87f2f5183dfb | 6583 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6584 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6585 | q31_t * pResult); |
Kojto | 115:87f2f5183dfb | 6586 | |
Kojto | 115:87f2f5183dfb | 6587 | /** |
Kojto | 115:87f2f5183dfb | 6588 | * @brief Variance of the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6589 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6590 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6591 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6592 | * @return none. |
Kojto | 115:87f2f5183dfb | 6593 | */ |
Kojto | 115:87f2f5183dfb | 6594 | |
Kojto | 115:87f2f5183dfb | 6595 | void arm_var_q15( |
Kojto | 115:87f2f5183dfb | 6596 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6597 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6598 | q15_t * pResult); |
Kojto | 115:87f2f5183dfb | 6599 | |
Kojto | 115:87f2f5183dfb | 6600 | /** |
Kojto | 115:87f2f5183dfb | 6601 | * @brief Root Mean Square of the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6602 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6603 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6604 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6605 | * @return none. |
Kojto | 115:87f2f5183dfb | 6606 | */ |
Kojto | 115:87f2f5183dfb | 6607 | |
Kojto | 115:87f2f5183dfb | 6608 | void arm_rms_f32( |
Kojto | 115:87f2f5183dfb | 6609 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6610 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6611 | float32_t * pResult); |
Kojto | 115:87f2f5183dfb | 6612 | |
Kojto | 115:87f2f5183dfb | 6613 | /** |
Kojto | 115:87f2f5183dfb | 6614 | * @brief Root Mean Square of the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6615 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6616 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6617 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6618 | * @return none. |
Kojto | 115:87f2f5183dfb | 6619 | */ |
Kojto | 115:87f2f5183dfb | 6620 | |
Kojto | 115:87f2f5183dfb | 6621 | void arm_rms_q31( |
Kojto | 115:87f2f5183dfb | 6622 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6623 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6624 | q31_t * pResult); |
Kojto | 115:87f2f5183dfb | 6625 | |
Kojto | 115:87f2f5183dfb | 6626 | /** |
Kojto | 115:87f2f5183dfb | 6627 | * @brief Root Mean Square of the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6628 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6629 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6630 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6631 | * @return none. |
Kojto | 115:87f2f5183dfb | 6632 | */ |
Kojto | 115:87f2f5183dfb | 6633 | |
Kojto | 115:87f2f5183dfb | 6634 | void arm_rms_q15( |
Kojto | 115:87f2f5183dfb | 6635 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6636 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6637 | q15_t * pResult); |
Kojto | 115:87f2f5183dfb | 6638 | |
Kojto | 115:87f2f5183dfb | 6639 | /** |
Kojto | 115:87f2f5183dfb | 6640 | * @brief Standard deviation of the elements of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6641 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6642 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6643 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6644 | * @return none. |
Kojto | 115:87f2f5183dfb | 6645 | */ |
Kojto | 115:87f2f5183dfb | 6646 | |
Kojto | 115:87f2f5183dfb | 6647 | void arm_std_f32( |
Kojto | 115:87f2f5183dfb | 6648 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6649 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6650 | float32_t * pResult); |
Kojto | 115:87f2f5183dfb | 6651 | |
Kojto | 115:87f2f5183dfb | 6652 | /** |
Kojto | 115:87f2f5183dfb | 6653 | * @brief Standard deviation of the elements of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6654 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6655 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6656 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6657 | * @return none. |
Kojto | 115:87f2f5183dfb | 6658 | */ |
Kojto | 115:87f2f5183dfb | 6659 | |
Kojto | 115:87f2f5183dfb | 6660 | void arm_std_q31( |
Kojto | 115:87f2f5183dfb | 6661 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6662 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6663 | q31_t * pResult); |
Kojto | 115:87f2f5183dfb | 6664 | |
Kojto | 115:87f2f5183dfb | 6665 | /** |
Kojto | 115:87f2f5183dfb | 6666 | * @brief Standard deviation of the elements of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6667 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6668 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6669 | * @param[out] *pResult is output value. |
Kojto | 115:87f2f5183dfb | 6670 | * @return none. |
Kojto | 115:87f2f5183dfb | 6671 | */ |
Kojto | 115:87f2f5183dfb | 6672 | |
Kojto | 115:87f2f5183dfb | 6673 | void arm_std_q15( |
Kojto | 115:87f2f5183dfb | 6674 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6675 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6676 | q15_t * pResult); |
Kojto | 115:87f2f5183dfb | 6677 | |
Kojto | 115:87f2f5183dfb | 6678 | /** |
Kojto | 115:87f2f5183dfb | 6679 | * @brief Floating-point complex magnitude |
Kojto | 115:87f2f5183dfb | 6680 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6681 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 6682 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 6683 | * @return none. |
Kojto | 115:87f2f5183dfb | 6684 | */ |
Kojto | 115:87f2f5183dfb | 6685 | |
Kojto | 115:87f2f5183dfb | 6686 | void arm_cmplx_mag_f32( |
Kojto | 115:87f2f5183dfb | 6687 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6688 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 6689 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6690 | |
Kojto | 115:87f2f5183dfb | 6691 | /** |
Kojto | 115:87f2f5183dfb | 6692 | * @brief Q31 complex magnitude |
Kojto | 115:87f2f5183dfb | 6693 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6694 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 6695 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 6696 | * @return none. |
Kojto | 115:87f2f5183dfb | 6697 | */ |
Kojto | 115:87f2f5183dfb | 6698 | |
Kojto | 115:87f2f5183dfb | 6699 | void arm_cmplx_mag_q31( |
Kojto | 115:87f2f5183dfb | 6700 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6701 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 6702 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6703 | |
Kojto | 115:87f2f5183dfb | 6704 | /** |
Kojto | 115:87f2f5183dfb | 6705 | * @brief Q15 complex magnitude |
Kojto | 115:87f2f5183dfb | 6706 | * @param[in] *pSrc points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6707 | * @param[out] *pDst points to the real output vector |
Kojto | 115:87f2f5183dfb | 6708 | * @param[in] numSamples number of complex samples in the input vector |
Kojto | 115:87f2f5183dfb | 6709 | * @return none. |
Kojto | 115:87f2f5183dfb | 6710 | */ |
Kojto | 115:87f2f5183dfb | 6711 | |
Kojto | 115:87f2f5183dfb | 6712 | void arm_cmplx_mag_q15( |
Kojto | 115:87f2f5183dfb | 6713 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6714 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 6715 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6716 | |
Kojto | 115:87f2f5183dfb | 6717 | /** |
Kojto | 115:87f2f5183dfb | 6718 | * @brief Q15 complex dot product |
Kojto | 115:87f2f5183dfb | 6719 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6720 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6721 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6722 | * @param[out] *realResult real part of the result returned here |
Kojto | 115:87f2f5183dfb | 6723 | * @param[out] *imagResult imaginary part of the result returned here |
Kojto | 115:87f2f5183dfb | 6724 | * @return none. |
Kojto | 115:87f2f5183dfb | 6725 | */ |
Kojto | 115:87f2f5183dfb | 6726 | |
Kojto | 115:87f2f5183dfb | 6727 | void arm_cmplx_dot_prod_q15( |
Kojto | 115:87f2f5183dfb | 6728 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6729 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6730 | uint32_t numSamples, |
Kojto | 115:87f2f5183dfb | 6731 | q31_t * realResult, |
Kojto | 115:87f2f5183dfb | 6732 | q31_t * imagResult); |
Kojto | 115:87f2f5183dfb | 6733 | |
Kojto | 115:87f2f5183dfb | 6734 | /** |
Kojto | 115:87f2f5183dfb | 6735 | * @brief Q31 complex dot product |
Kojto | 115:87f2f5183dfb | 6736 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6737 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6738 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6739 | * @param[out] *realResult real part of the result returned here |
Kojto | 115:87f2f5183dfb | 6740 | * @param[out] *imagResult imaginary part of the result returned here |
Kojto | 115:87f2f5183dfb | 6741 | * @return none. |
Kojto | 115:87f2f5183dfb | 6742 | */ |
Kojto | 115:87f2f5183dfb | 6743 | |
Kojto | 115:87f2f5183dfb | 6744 | void arm_cmplx_dot_prod_q31( |
Kojto | 115:87f2f5183dfb | 6745 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6746 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6747 | uint32_t numSamples, |
Kojto | 115:87f2f5183dfb | 6748 | q63_t * realResult, |
Kojto | 115:87f2f5183dfb | 6749 | q63_t * imagResult); |
Kojto | 115:87f2f5183dfb | 6750 | |
Kojto | 115:87f2f5183dfb | 6751 | /** |
Kojto | 115:87f2f5183dfb | 6752 | * @brief Floating-point complex dot product |
Kojto | 115:87f2f5183dfb | 6753 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6754 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6755 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6756 | * @param[out] *realResult real part of the result returned here |
Kojto | 115:87f2f5183dfb | 6757 | * @param[out] *imagResult imaginary part of the result returned here |
Kojto | 115:87f2f5183dfb | 6758 | * @return none. |
Kojto | 115:87f2f5183dfb | 6759 | */ |
Kojto | 115:87f2f5183dfb | 6760 | |
Kojto | 115:87f2f5183dfb | 6761 | void arm_cmplx_dot_prod_f32( |
Kojto | 115:87f2f5183dfb | 6762 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6763 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6764 | uint32_t numSamples, |
Kojto | 115:87f2f5183dfb | 6765 | float32_t * realResult, |
Kojto | 115:87f2f5183dfb | 6766 | float32_t * imagResult); |
Kojto | 115:87f2f5183dfb | 6767 | |
Kojto | 115:87f2f5183dfb | 6768 | /** |
Kojto | 115:87f2f5183dfb | 6769 | * @brief Q15 complex-by-real multiplication |
Kojto | 115:87f2f5183dfb | 6770 | * @param[in] *pSrcCmplx points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6771 | * @param[in] *pSrcReal points to the real input vector |
Kojto | 115:87f2f5183dfb | 6772 | * @param[out] *pCmplxDst points to the complex output vector |
Kojto | 115:87f2f5183dfb | 6773 | * @param[in] numSamples number of samples in each vector |
Kojto | 115:87f2f5183dfb | 6774 | * @return none. |
Kojto | 115:87f2f5183dfb | 6775 | */ |
Kojto | 115:87f2f5183dfb | 6776 | |
Kojto | 115:87f2f5183dfb | 6777 | void arm_cmplx_mult_real_q15( |
Kojto | 115:87f2f5183dfb | 6778 | q15_t * pSrcCmplx, |
Kojto | 115:87f2f5183dfb | 6779 | q15_t * pSrcReal, |
Kojto | 115:87f2f5183dfb | 6780 | q15_t * pCmplxDst, |
Kojto | 115:87f2f5183dfb | 6781 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6782 | |
Kojto | 115:87f2f5183dfb | 6783 | /** |
Kojto | 115:87f2f5183dfb | 6784 | * @brief Q31 complex-by-real multiplication |
Kojto | 115:87f2f5183dfb | 6785 | * @param[in] *pSrcCmplx points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6786 | * @param[in] *pSrcReal points to the real input vector |
Kojto | 115:87f2f5183dfb | 6787 | * @param[out] *pCmplxDst points to the complex output vector |
Kojto | 115:87f2f5183dfb | 6788 | * @param[in] numSamples number of samples in each vector |
Kojto | 115:87f2f5183dfb | 6789 | * @return none. |
Kojto | 115:87f2f5183dfb | 6790 | */ |
Kojto | 115:87f2f5183dfb | 6791 | |
Kojto | 115:87f2f5183dfb | 6792 | void arm_cmplx_mult_real_q31( |
Kojto | 115:87f2f5183dfb | 6793 | q31_t * pSrcCmplx, |
Kojto | 115:87f2f5183dfb | 6794 | q31_t * pSrcReal, |
Kojto | 115:87f2f5183dfb | 6795 | q31_t * pCmplxDst, |
Kojto | 115:87f2f5183dfb | 6796 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6797 | |
Kojto | 115:87f2f5183dfb | 6798 | /** |
Kojto | 115:87f2f5183dfb | 6799 | * @brief Floating-point complex-by-real multiplication |
Kojto | 115:87f2f5183dfb | 6800 | * @param[in] *pSrcCmplx points to the complex input vector |
Kojto | 115:87f2f5183dfb | 6801 | * @param[in] *pSrcReal points to the real input vector |
Kojto | 115:87f2f5183dfb | 6802 | * @param[out] *pCmplxDst points to the complex output vector |
Kojto | 115:87f2f5183dfb | 6803 | * @param[in] numSamples number of samples in each vector |
Kojto | 115:87f2f5183dfb | 6804 | * @return none. |
Kojto | 115:87f2f5183dfb | 6805 | */ |
Kojto | 115:87f2f5183dfb | 6806 | |
Kojto | 115:87f2f5183dfb | 6807 | void arm_cmplx_mult_real_f32( |
Kojto | 115:87f2f5183dfb | 6808 | float32_t * pSrcCmplx, |
Kojto | 115:87f2f5183dfb | 6809 | float32_t * pSrcReal, |
Kojto | 115:87f2f5183dfb | 6810 | float32_t * pCmplxDst, |
Kojto | 115:87f2f5183dfb | 6811 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6812 | |
Kojto | 115:87f2f5183dfb | 6813 | /** |
Kojto | 115:87f2f5183dfb | 6814 | * @brief Minimum value of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 6815 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6816 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6817 | * @param[out] *result is output pointer |
Kojto | 115:87f2f5183dfb | 6818 | * @param[in] index is the array index of the minimum value in the input buffer. |
Kojto | 115:87f2f5183dfb | 6819 | * @return none. |
Kojto | 115:87f2f5183dfb | 6820 | */ |
Kojto | 115:87f2f5183dfb | 6821 | |
Kojto | 115:87f2f5183dfb | 6822 | void arm_min_q7( |
Kojto | 115:87f2f5183dfb | 6823 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6824 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6825 | q7_t * result, |
Kojto | 115:87f2f5183dfb | 6826 | uint32_t * index); |
Kojto | 115:87f2f5183dfb | 6827 | |
Kojto | 115:87f2f5183dfb | 6828 | /** |
Kojto | 115:87f2f5183dfb | 6829 | * @brief Minimum value of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6830 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6831 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6832 | * @param[out] *pResult is output pointer |
Kojto | 115:87f2f5183dfb | 6833 | * @param[in] *pIndex is the array index of the minimum value in the input buffer. |
Kojto | 115:87f2f5183dfb | 6834 | * @return none. |
Kojto | 115:87f2f5183dfb | 6835 | */ |
Kojto | 115:87f2f5183dfb | 6836 | |
Kojto | 115:87f2f5183dfb | 6837 | void arm_min_q15( |
Kojto | 115:87f2f5183dfb | 6838 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6839 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6840 | q15_t * pResult, |
Kojto | 115:87f2f5183dfb | 6841 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6842 | |
Kojto | 115:87f2f5183dfb | 6843 | /** |
Kojto | 115:87f2f5183dfb | 6844 | * @brief Minimum value of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6845 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6846 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6847 | * @param[out] *pResult is output pointer |
Kojto | 115:87f2f5183dfb | 6848 | * @param[out] *pIndex is the array index of the minimum value in the input buffer. |
Kojto | 115:87f2f5183dfb | 6849 | * @return none. |
Kojto | 115:87f2f5183dfb | 6850 | */ |
Kojto | 115:87f2f5183dfb | 6851 | void arm_min_q31( |
Kojto | 115:87f2f5183dfb | 6852 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6853 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6854 | q31_t * pResult, |
Kojto | 115:87f2f5183dfb | 6855 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6856 | |
Kojto | 115:87f2f5183dfb | 6857 | /** |
Kojto | 115:87f2f5183dfb | 6858 | * @brief Minimum value of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6859 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 6860 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 6861 | * @param[out] *pResult is output pointer |
Kojto | 115:87f2f5183dfb | 6862 | * @param[out] *pIndex is the array index of the minimum value in the input buffer. |
Kojto | 115:87f2f5183dfb | 6863 | * @return none. |
Kojto | 115:87f2f5183dfb | 6864 | */ |
Kojto | 115:87f2f5183dfb | 6865 | |
Kojto | 115:87f2f5183dfb | 6866 | void arm_min_f32( |
Kojto | 115:87f2f5183dfb | 6867 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6868 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6869 | float32_t * pResult, |
Kojto | 115:87f2f5183dfb | 6870 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6871 | |
Kojto | 115:87f2f5183dfb | 6872 | /** |
Kojto | 115:87f2f5183dfb | 6873 | * @brief Maximum value of a Q7 vector. |
Kojto | 115:87f2f5183dfb | 6874 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 6875 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6876 | * @param[out] *pResult maximum value returned here |
Kojto | 115:87f2f5183dfb | 6877 | * @param[out] *pIndex index of maximum value returned here |
Kojto | 115:87f2f5183dfb | 6878 | * @return none. |
Kojto | 115:87f2f5183dfb | 6879 | */ |
Kojto | 115:87f2f5183dfb | 6880 | |
Kojto | 115:87f2f5183dfb | 6881 | void arm_max_q7( |
Kojto | 115:87f2f5183dfb | 6882 | q7_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6883 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6884 | q7_t * pResult, |
Kojto | 115:87f2f5183dfb | 6885 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6886 | |
Kojto | 115:87f2f5183dfb | 6887 | /** |
Kojto | 115:87f2f5183dfb | 6888 | * @brief Maximum value of a Q15 vector. |
Kojto | 115:87f2f5183dfb | 6889 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 6890 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6891 | * @param[out] *pResult maximum value returned here |
Kojto | 115:87f2f5183dfb | 6892 | * @param[out] *pIndex index of maximum value returned here |
Kojto | 115:87f2f5183dfb | 6893 | * @return none. |
Kojto | 115:87f2f5183dfb | 6894 | */ |
Kojto | 115:87f2f5183dfb | 6895 | |
Kojto | 115:87f2f5183dfb | 6896 | void arm_max_q15( |
Kojto | 115:87f2f5183dfb | 6897 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6898 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6899 | q15_t * pResult, |
Kojto | 115:87f2f5183dfb | 6900 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6901 | |
Kojto | 115:87f2f5183dfb | 6902 | /** |
Kojto | 115:87f2f5183dfb | 6903 | * @brief Maximum value of a Q31 vector. |
Kojto | 115:87f2f5183dfb | 6904 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 6905 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6906 | * @param[out] *pResult maximum value returned here |
Kojto | 115:87f2f5183dfb | 6907 | * @param[out] *pIndex index of maximum value returned here |
Kojto | 115:87f2f5183dfb | 6908 | * @return none. |
Kojto | 115:87f2f5183dfb | 6909 | */ |
Kojto | 115:87f2f5183dfb | 6910 | |
Kojto | 115:87f2f5183dfb | 6911 | void arm_max_q31( |
Kojto | 115:87f2f5183dfb | 6912 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6913 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6914 | q31_t * pResult, |
Kojto | 115:87f2f5183dfb | 6915 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6916 | |
Kojto | 115:87f2f5183dfb | 6917 | /** |
Kojto | 115:87f2f5183dfb | 6918 | * @brief Maximum value of a floating-point vector. |
Kojto | 115:87f2f5183dfb | 6919 | * @param[in] *pSrc points to the input buffer |
Kojto | 115:87f2f5183dfb | 6920 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6921 | * @param[out] *pResult maximum value returned here |
Kojto | 115:87f2f5183dfb | 6922 | * @param[out] *pIndex index of maximum value returned here |
Kojto | 115:87f2f5183dfb | 6923 | * @return none. |
Kojto | 115:87f2f5183dfb | 6924 | */ |
Kojto | 115:87f2f5183dfb | 6925 | |
Kojto | 115:87f2f5183dfb | 6926 | void arm_max_f32( |
Kojto | 115:87f2f5183dfb | 6927 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6928 | uint32_t blockSize, |
Kojto | 115:87f2f5183dfb | 6929 | float32_t * pResult, |
Kojto | 115:87f2f5183dfb | 6930 | uint32_t * pIndex); |
Kojto | 115:87f2f5183dfb | 6931 | |
Kojto | 115:87f2f5183dfb | 6932 | /** |
Kojto | 115:87f2f5183dfb | 6933 | * @brief Q15 complex-by-complex multiplication |
Kojto | 115:87f2f5183dfb | 6934 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6935 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6936 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 6937 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6938 | * @return none. |
Kojto | 115:87f2f5183dfb | 6939 | */ |
Kojto | 115:87f2f5183dfb | 6940 | |
Kojto | 115:87f2f5183dfb | 6941 | void arm_cmplx_mult_cmplx_q15( |
Kojto | 115:87f2f5183dfb | 6942 | q15_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6943 | q15_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6944 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 6945 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6946 | |
Kojto | 115:87f2f5183dfb | 6947 | /** |
Kojto | 115:87f2f5183dfb | 6948 | * @brief Q31 complex-by-complex multiplication |
Kojto | 115:87f2f5183dfb | 6949 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6950 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6951 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 6952 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6953 | * @return none. |
Kojto | 115:87f2f5183dfb | 6954 | */ |
Kojto | 115:87f2f5183dfb | 6955 | |
Kojto | 115:87f2f5183dfb | 6956 | void arm_cmplx_mult_cmplx_q31( |
Kojto | 115:87f2f5183dfb | 6957 | q31_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6958 | q31_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6959 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 6960 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6961 | |
Kojto | 115:87f2f5183dfb | 6962 | /** |
Kojto | 115:87f2f5183dfb | 6963 | * @brief Floating-point complex-by-complex multiplication |
Kojto | 115:87f2f5183dfb | 6964 | * @param[in] *pSrcA points to the first input vector |
Kojto | 115:87f2f5183dfb | 6965 | * @param[in] *pSrcB points to the second input vector |
Kojto | 115:87f2f5183dfb | 6966 | * @param[out] *pDst points to the output vector |
Kojto | 115:87f2f5183dfb | 6967 | * @param[in] numSamples number of complex samples in each vector |
Kojto | 115:87f2f5183dfb | 6968 | * @return none. |
Kojto | 115:87f2f5183dfb | 6969 | */ |
Kojto | 115:87f2f5183dfb | 6970 | |
Kojto | 115:87f2f5183dfb | 6971 | void arm_cmplx_mult_cmplx_f32( |
Kojto | 115:87f2f5183dfb | 6972 | float32_t * pSrcA, |
Kojto | 115:87f2f5183dfb | 6973 | float32_t * pSrcB, |
Kojto | 115:87f2f5183dfb | 6974 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 6975 | uint32_t numSamples); |
Kojto | 115:87f2f5183dfb | 6976 | |
Kojto | 115:87f2f5183dfb | 6977 | /** |
Kojto | 115:87f2f5183dfb | 6978 | * @brief Converts the elements of the floating-point vector to Q31 vector. |
Kojto | 115:87f2f5183dfb | 6979 | * @param[in] *pSrc points to the floating-point input vector |
Kojto | 115:87f2f5183dfb | 6980 | * @param[out] *pDst points to the Q31 output vector |
Kojto | 115:87f2f5183dfb | 6981 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6982 | * @return none. |
Kojto | 115:87f2f5183dfb | 6983 | */ |
Kojto | 115:87f2f5183dfb | 6984 | void arm_float_to_q31( |
Kojto | 115:87f2f5183dfb | 6985 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6986 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 6987 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 6988 | |
Kojto | 115:87f2f5183dfb | 6989 | /** |
Kojto | 115:87f2f5183dfb | 6990 | * @brief Converts the elements of the floating-point vector to Q15 vector. |
Kojto | 115:87f2f5183dfb | 6991 | * @param[in] *pSrc points to the floating-point input vector |
Kojto | 115:87f2f5183dfb | 6992 | * @param[out] *pDst points to the Q15 output vector |
Kojto | 115:87f2f5183dfb | 6993 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 6994 | * @return none |
Kojto | 115:87f2f5183dfb | 6995 | */ |
Kojto | 115:87f2f5183dfb | 6996 | void arm_float_to_q15( |
Kojto | 115:87f2f5183dfb | 6997 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 6998 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 6999 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7000 | |
Kojto | 115:87f2f5183dfb | 7001 | /** |
Kojto | 115:87f2f5183dfb | 7002 | * @brief Converts the elements of the floating-point vector to Q7 vector. |
Kojto | 115:87f2f5183dfb | 7003 | * @param[in] *pSrc points to the floating-point input vector |
Kojto | 115:87f2f5183dfb | 7004 | * @param[out] *pDst points to the Q7 output vector |
Kojto | 115:87f2f5183dfb | 7005 | * @param[in] blockSize length of the input vector |
Kojto | 115:87f2f5183dfb | 7006 | * @return none |
Kojto | 115:87f2f5183dfb | 7007 | */ |
Kojto | 115:87f2f5183dfb | 7008 | void arm_float_to_q7( |
Kojto | 115:87f2f5183dfb | 7009 | float32_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7010 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 7011 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7012 | |
Kojto | 115:87f2f5183dfb | 7013 | |
Kojto | 115:87f2f5183dfb | 7014 | /** |
Kojto | 115:87f2f5183dfb | 7015 | * @brief Converts the elements of the Q31 vector to Q15 vector. |
Kojto | 115:87f2f5183dfb | 7016 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 7017 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 7018 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 7019 | * @return none. |
Kojto | 115:87f2f5183dfb | 7020 | */ |
Kojto | 115:87f2f5183dfb | 7021 | void arm_q31_to_q15( |
Kojto | 115:87f2f5183dfb | 7022 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7023 | q15_t * pDst, |
Kojto | 115:87f2f5183dfb | 7024 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7025 | |
Kojto | 115:87f2f5183dfb | 7026 | /** |
Kojto | 115:87f2f5183dfb | 7027 | * @brief Converts the elements of the Q31 vector to Q7 vector. |
Kojto | 115:87f2f5183dfb | 7028 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 7029 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 7030 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 7031 | * @return none. |
Kojto | 115:87f2f5183dfb | 7032 | */ |
Kojto | 115:87f2f5183dfb | 7033 | void arm_q31_to_q7( |
Kojto | 115:87f2f5183dfb | 7034 | q31_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7035 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 7036 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7037 | |
Kojto | 115:87f2f5183dfb | 7038 | /** |
Kojto | 115:87f2f5183dfb | 7039 | * @brief Converts the elements of the Q15 vector to floating-point vector. |
Kojto | 115:87f2f5183dfb | 7040 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 7041 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 7042 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 7043 | * @return none. |
Kojto | 115:87f2f5183dfb | 7044 | */ |
Kojto | 115:87f2f5183dfb | 7045 | void arm_q15_to_float( |
Kojto | 115:87f2f5183dfb | 7046 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7047 | float32_t * pDst, |
Kojto | 115:87f2f5183dfb | 7048 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7049 | |
Kojto | 115:87f2f5183dfb | 7050 | |
Kojto | 115:87f2f5183dfb | 7051 | /** |
Kojto | 115:87f2f5183dfb | 7052 | * @brief Converts the elements of the Q15 vector to Q31 vector. |
Kojto | 115:87f2f5183dfb | 7053 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 7054 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 7055 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 7056 | * @return none. |
Kojto | 115:87f2f5183dfb | 7057 | */ |
Kojto | 115:87f2f5183dfb | 7058 | void arm_q15_to_q31( |
Kojto | 115:87f2f5183dfb | 7059 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7060 | q31_t * pDst, |
Kojto | 115:87f2f5183dfb | 7061 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7062 | |
Kojto | 115:87f2f5183dfb | 7063 | |
Kojto | 115:87f2f5183dfb | 7064 | /** |
Kojto | 115:87f2f5183dfb | 7065 | * @brief Converts the elements of the Q15 vector to Q7 vector. |
Kojto | 115:87f2f5183dfb | 7066 | * @param[in] *pSrc is input pointer |
Kojto | 115:87f2f5183dfb | 7067 | * @param[out] *pDst is output pointer |
Kojto | 115:87f2f5183dfb | 7068 | * @param[in] blockSize is the number of samples to process |
Kojto | 115:87f2f5183dfb | 7069 | * @return none. |
Kojto | 115:87f2f5183dfb | 7070 | */ |
Kojto | 115:87f2f5183dfb | 7071 | void arm_q15_to_q7( |
Kojto | 115:87f2f5183dfb | 7072 | q15_t * pSrc, |
Kojto | 115:87f2f5183dfb | 7073 | q7_t * pDst, |
Kojto | 115:87f2f5183dfb | 7074 | uint32_t blockSize); |
Kojto | 115:87f2f5183dfb | 7075 | |
Kojto | 115:87f2f5183dfb | 7076 | |
Kojto | 115:87f2f5183dfb | 7077 | /** |
Kojto | 115:87f2f5183dfb | 7078 | * @ingroup groupInterpolation |
Kojto | 115:87f2f5183dfb | 7079 | */ |
Kojto | 115:87f2f5183dfb | 7080 | |
Kojto | 115:87f2f5183dfb | 7081 | /** |
Kojto | 115:87f2f5183dfb | 7082 | * @defgroup BilinearInterpolate Bilinear Interpolation |
Kojto | 115:87f2f5183dfb | 7083 | * |
Kojto | 115:87f2f5183dfb | 7084 | * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. |
Kojto | 115:87f2f5183dfb | 7085 | * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process |
Kojto | 115:87f2f5183dfb | 7086 | * determines values between the grid points. |
Kojto | 115:87f2f5183dfb | 7087 | * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. |
Kojto | 115:87f2f5183dfb | 7088 | * Bilinear interpolation is often used in image processing to rescale images. |
Kojto | 115:87f2f5183dfb | 7089 | * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. |
Kojto | 115:87f2f5183dfb | 7090 | * |
Kojto | 115:87f2f5183dfb | 7091 | * <b>Algorithm</b> |
Kojto | 115:87f2f5183dfb | 7092 | * \par |
Kojto | 115:87f2f5183dfb | 7093 | * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. |
Kojto | 115:87f2f5183dfb | 7094 | * For floating-point, the instance structure is defined as: |
Kojto | 115:87f2f5183dfb | 7095 | * <pre> |
Kojto | 115:87f2f5183dfb | 7096 | * typedef struct |
Kojto | 115:87f2f5183dfb | 7097 | * { |
Kojto | 115:87f2f5183dfb | 7098 | * uint16_t numRows; |
Kojto | 115:87f2f5183dfb | 7099 | * uint16_t numCols; |
Kojto | 115:87f2f5183dfb | 7100 | * float32_t *pData; |
Kojto | 115:87f2f5183dfb | 7101 | * } arm_bilinear_interp_instance_f32; |
Kojto | 115:87f2f5183dfb | 7102 | * </pre> |
Kojto | 115:87f2f5183dfb | 7103 | * |
Kojto | 115:87f2f5183dfb | 7104 | * \par |
Kojto | 115:87f2f5183dfb | 7105 | * where <code>numRows</code> specifies the number of rows in the table; |
Kojto | 115:87f2f5183dfb | 7106 | * <code>numCols</code> specifies the number of columns in the table; |
Kojto | 115:87f2f5183dfb | 7107 | * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values. |
Kojto | 115:87f2f5183dfb | 7108 | * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes. |
Kojto | 115:87f2f5183dfb | 7109 | * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers. |
Kojto | 115:87f2f5183dfb | 7110 | * |
Kojto | 115:87f2f5183dfb | 7111 | * \par |
Kojto | 115:87f2f5183dfb | 7112 | * Let <code>(x, y)</code> specify the desired interpolation point. Then define: |
Kojto | 115:87f2f5183dfb | 7113 | * <pre> |
Kojto | 115:87f2f5183dfb | 7114 | * XF = floor(x) |
Kojto | 115:87f2f5183dfb | 7115 | * YF = floor(y) |
Kojto | 115:87f2f5183dfb | 7116 | * </pre> |
Kojto | 115:87f2f5183dfb | 7117 | * \par |
Kojto | 115:87f2f5183dfb | 7118 | * The interpolated output point is computed as: |
Kojto | 115:87f2f5183dfb | 7119 | * <pre> |
Kojto | 115:87f2f5183dfb | 7120 | * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF)) |
Kojto | 115:87f2f5183dfb | 7121 | * + f(XF+1, YF) * (x-XF)*(1-(y-YF)) |
Kojto | 115:87f2f5183dfb | 7122 | * + f(XF, YF+1) * (1-(x-XF))*(y-YF) |
Kojto | 115:87f2f5183dfb | 7123 | * + f(XF+1, YF+1) * (x-XF)*(y-YF) |
Kojto | 115:87f2f5183dfb | 7124 | * </pre> |
Kojto | 115:87f2f5183dfb | 7125 | * Note that the coordinates (x, y) contain integer and fractional components. |
Kojto | 115:87f2f5183dfb | 7126 | * The integer components specify which portion of the table to use while the |
Kojto | 115:87f2f5183dfb | 7127 | * fractional components control the interpolation processor. |
Kojto | 115:87f2f5183dfb | 7128 | * |
Kojto | 115:87f2f5183dfb | 7129 | * \par |
Kojto | 115:87f2f5183dfb | 7130 | * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. |
Kojto | 115:87f2f5183dfb | 7131 | */ |
Kojto | 115:87f2f5183dfb | 7132 | |
Kojto | 115:87f2f5183dfb | 7133 | /** |
Kojto | 115:87f2f5183dfb | 7134 | * @addtogroup BilinearInterpolate |
Kojto | 115:87f2f5183dfb | 7135 | * @{ |
Kojto | 115:87f2f5183dfb | 7136 | */ |
Kojto | 115:87f2f5183dfb | 7137 | |
Kojto | 115:87f2f5183dfb | 7138 | /** |
Kojto | 115:87f2f5183dfb | 7139 | * |
Kojto | 115:87f2f5183dfb | 7140 | * @brief Floating-point bilinear interpolation. |
Kojto | 115:87f2f5183dfb | 7141 | * @param[in,out] *S points to an instance of the interpolation structure. |
Kojto | 115:87f2f5183dfb | 7142 | * @param[in] X interpolation coordinate. |
Kojto | 115:87f2f5183dfb | 7143 | * @param[in] Y interpolation coordinate. |
Kojto | 115:87f2f5183dfb | 7144 | * @return out interpolated value. |
Kojto | 115:87f2f5183dfb | 7145 | */ |
Kojto | 115:87f2f5183dfb | 7146 | |
Kojto | 115:87f2f5183dfb | 7147 | |
Kojto | 115:87f2f5183dfb | 7148 | static __INLINE float32_t arm_bilinear_interp_f32( |
Kojto | 115:87f2f5183dfb | 7149 | const arm_bilinear_interp_instance_f32 * S, |
Kojto | 115:87f2f5183dfb | 7150 | float32_t X, |
Kojto | 115:87f2f5183dfb | 7151 | float32_t Y) |
Kojto | 115:87f2f5183dfb | 7152 | { |
Kojto | 115:87f2f5183dfb | 7153 | float32_t out; |
Kojto | 115:87f2f5183dfb | 7154 | float32_t f00, f01, f10, f11; |
Kojto | 115:87f2f5183dfb | 7155 | float32_t *pData = S->pData; |
Kojto | 115:87f2f5183dfb | 7156 | int32_t xIndex, yIndex, index; |
Kojto | 115:87f2f5183dfb | 7157 | float32_t xdiff, ydiff; |
Kojto | 115:87f2f5183dfb | 7158 | float32_t b1, b2, b3, b4; |
Kojto | 115:87f2f5183dfb | 7159 | |
Kojto | 115:87f2f5183dfb | 7160 | xIndex = (int32_t) X; |
Kojto | 115:87f2f5183dfb | 7161 | yIndex = (int32_t) Y; |
Kojto | 115:87f2f5183dfb | 7162 | |
Kojto | 115:87f2f5183dfb | 7163 | /* Care taken for table outside boundary */ |
Kojto | 115:87f2f5183dfb | 7164 | /* Returns zero output when values are outside table boundary */ |
Kojto | 115:87f2f5183dfb | 7165 | if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 |
Kojto | 115:87f2f5183dfb | 7166 | || yIndex > (S->numCols - 1)) |
Kojto | 115:87f2f5183dfb | 7167 | { |
Kojto | 115:87f2f5183dfb | 7168 | return (0); |
Kojto | 115:87f2f5183dfb | 7169 | } |
Kojto | 115:87f2f5183dfb | 7170 | |
Kojto | 115:87f2f5183dfb | 7171 | /* Calculation of index for two nearest points in X-direction */ |
Kojto | 115:87f2f5183dfb | 7172 | index = (xIndex - 1) + (yIndex - 1) * S->numCols; |
Kojto | 115:87f2f5183dfb | 7173 | |
Kojto | 115:87f2f5183dfb | 7174 | |
Kojto | 115:87f2f5183dfb | 7175 | /* Read two nearest points in X-direction */ |
Kojto | 115:87f2f5183dfb | 7176 | f00 = pData[index]; |
Kojto | 115:87f2f5183dfb | 7177 | f01 = pData[index + 1]; |
Kojto | 115:87f2f5183dfb | 7178 | |
Kojto | 115:87f2f5183dfb | 7179 | /* Calculation of index for two nearest points in Y-direction */ |
Kojto | 115:87f2f5183dfb | 7180 | index = (xIndex - 1) + (yIndex) * S->numCols; |
Kojto | 115:87f2f5183dfb | 7181 | |
Kojto | 115:87f2f5183dfb | 7182 | |
Kojto | 115:87f2f5183dfb | 7183 | /* Read two nearest points in Y-direction */ |
Kojto | 115:87f2f5183dfb | 7184 | f10 = pData[index]; |
Kojto | 115:87f2f5183dfb | 7185 | f11 = pData[index + 1]; |
Kojto | 115:87f2f5183dfb | 7186 | |
Kojto | 115:87f2f5183dfb | 7187 | /* Calculation of intermediate values */ |
Kojto | 115:87f2f5183dfb | 7188 | b1 = f00; |
Kojto | 115:87f2f5183dfb | 7189 | b2 = f01 - f00; |
Kojto | 115:87f2f5183dfb | 7190 | b3 = f10 - f00; |
Kojto | 115:87f2f5183dfb | 7191 | b4 = f00 - f01 - f10 + f11; |
Kojto | 115:87f2f5183dfb | 7192 | |
Kojto | 115:87f2f5183dfb | 7193 | /* Calculation of fractional part in X */ |
Kojto | 115:87f2f5183dfb | 7194 | xdiff = X - xIndex; |
Kojto | 115:87f2f5183dfb | 7195 | |
Kojto | 115:87f2f5183dfb | 7196 | /* Calculation of fractional part in Y */ |
Kojto | 115:87f2f5183dfb | 7197 | ydiff = Y - yIndex; |
Kojto | 115:87f2f5183dfb | 7198 | |
Kojto | 115:87f2f5183dfb | 7199 | /* Calculation of bi-linear interpolated output */ |
Kojto | 115:87f2f5183dfb | 7200 | out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; |
Kojto | 115:87f2f5183dfb | 7201 | |
Kojto | 115:87f2f5183dfb | 7202 | /* return to application */ |
Kojto | 115:87f2f5183dfb | 7203 | return (out); |
Kojto | 115:87f2f5183dfb | 7204 | |
Kojto | 115:87f2f5183dfb | 7205 | } |
Kojto | 115:87f2f5183dfb | 7206 | |
Kojto | 115:87f2f5183dfb | 7207 | /** |
Kojto | 115:87f2f5183dfb | 7208 | * |
Kojto | 115:87f2f5183dfb | 7209 | * @brief Q31 bilinear interpolation. |
Kojto | 115:87f2f5183dfb | 7210 | * @param[in,out] *S points to an instance of the interpolation structure. |
Kojto | 115:87f2f5183dfb | 7211 | * @param[in] X interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7212 | * @param[in] Y interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7213 | * @return out interpolated value. |
Kojto | 115:87f2f5183dfb | 7214 | */ |
Kojto | 115:87f2f5183dfb | 7215 | |
Kojto | 115:87f2f5183dfb | 7216 | static __INLINE q31_t arm_bilinear_interp_q31( |
Kojto | 115:87f2f5183dfb | 7217 | arm_bilinear_interp_instance_q31 * S, |
Kojto | 115:87f2f5183dfb | 7218 | q31_t X, |
Kojto | 115:87f2f5183dfb | 7219 | q31_t Y) |
Kojto | 115:87f2f5183dfb | 7220 | { |
Kojto | 115:87f2f5183dfb | 7221 | q31_t out; /* Temporary output */ |
Kojto | 115:87f2f5183dfb | 7222 | q31_t acc = 0; /* output */ |
Kojto | 115:87f2f5183dfb | 7223 | q31_t xfract, yfract; /* X, Y fractional parts */ |
Kojto | 115:87f2f5183dfb | 7224 | q31_t x1, x2, y1, y2; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 7225 | int32_t rI, cI; /* Row and column indices */ |
Kojto | 115:87f2f5183dfb | 7226 | q31_t *pYData = S->pData; /* pointer to output table values */ |
Kojto | 115:87f2f5183dfb | 7227 | uint32_t nCols = S->numCols; /* num of rows */ |
Kojto | 115:87f2f5183dfb | 7228 | |
Kojto | 115:87f2f5183dfb | 7229 | |
Kojto | 115:87f2f5183dfb | 7230 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7231 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7232 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7233 | rI = ((X & 0xFFF00000) >> 20u); |
Kojto | 115:87f2f5183dfb | 7234 | |
Kojto | 115:87f2f5183dfb | 7235 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7236 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7237 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7238 | cI = ((Y & 0xFFF00000) >> 20u); |
Kojto | 115:87f2f5183dfb | 7239 | |
Kojto | 115:87f2f5183dfb | 7240 | /* Care taken for table outside boundary */ |
Kojto | 115:87f2f5183dfb | 7241 | /* Returns zero output when values are outside table boundary */ |
Kojto | 115:87f2f5183dfb | 7242 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
Kojto | 115:87f2f5183dfb | 7243 | { |
Kojto | 115:87f2f5183dfb | 7244 | return (0); |
Kojto | 115:87f2f5183dfb | 7245 | } |
Kojto | 115:87f2f5183dfb | 7246 | |
Kojto | 115:87f2f5183dfb | 7247 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7248 | /* shift left xfract by 11 to keep 1.31 format */ |
Kojto | 115:87f2f5183dfb | 7249 | xfract = (X & 0x000FFFFF) << 11u; |
Kojto | 115:87f2f5183dfb | 7250 | |
Kojto | 115:87f2f5183dfb | 7251 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7252 | x1 = pYData[(rI) + nCols * (cI)]; |
Kojto | 115:87f2f5183dfb | 7253 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
Kojto | 115:87f2f5183dfb | 7254 | |
Kojto | 115:87f2f5183dfb | 7255 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7256 | /* shift left yfract by 11 to keep 1.31 format */ |
Kojto | 115:87f2f5183dfb | 7257 | yfract = (Y & 0x000FFFFF) << 11u; |
Kojto | 115:87f2f5183dfb | 7258 | |
Kojto | 115:87f2f5183dfb | 7259 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7260 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
Kojto | 115:87f2f5183dfb | 7261 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
Kojto | 115:87f2f5183dfb | 7262 | |
Kojto | 115:87f2f5183dfb | 7263 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ |
Kojto | 115:87f2f5183dfb | 7264 | out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); |
Kojto | 115:87f2f5183dfb | 7265 | acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); |
Kojto | 115:87f2f5183dfb | 7266 | |
Kojto | 115:87f2f5183dfb | 7267 | /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7268 | out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7269 | acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7270 | |
Kojto | 115:87f2f5183dfb | 7271 | /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7272 | out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7273 | acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7274 | |
Kojto | 115:87f2f5183dfb | 7275 | /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7276 | out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7277 | acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); |
Kojto | 115:87f2f5183dfb | 7278 | |
Kojto | 115:87f2f5183dfb | 7279 | /* Convert acc to 1.31(q31) format */ |
Kojto | 115:87f2f5183dfb | 7280 | return (acc << 2u); |
Kojto | 115:87f2f5183dfb | 7281 | |
Kojto | 115:87f2f5183dfb | 7282 | } |
Kojto | 115:87f2f5183dfb | 7283 | |
Kojto | 115:87f2f5183dfb | 7284 | /** |
Kojto | 115:87f2f5183dfb | 7285 | * @brief Q15 bilinear interpolation. |
Kojto | 115:87f2f5183dfb | 7286 | * @param[in,out] *S points to an instance of the interpolation structure. |
Kojto | 115:87f2f5183dfb | 7287 | * @param[in] X interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7288 | * @param[in] Y interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7289 | * @return out interpolated value. |
Kojto | 115:87f2f5183dfb | 7290 | */ |
Kojto | 115:87f2f5183dfb | 7291 | |
Kojto | 115:87f2f5183dfb | 7292 | static __INLINE q15_t arm_bilinear_interp_q15( |
Kojto | 115:87f2f5183dfb | 7293 | arm_bilinear_interp_instance_q15 * S, |
Kojto | 115:87f2f5183dfb | 7294 | q31_t X, |
Kojto | 115:87f2f5183dfb | 7295 | q31_t Y) |
Kojto | 115:87f2f5183dfb | 7296 | { |
Kojto | 115:87f2f5183dfb | 7297 | q63_t acc = 0; /* output */ |
Kojto | 115:87f2f5183dfb | 7298 | q31_t out; /* Temporary output */ |
Kojto | 115:87f2f5183dfb | 7299 | q15_t x1, x2, y1, y2; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 7300 | q31_t xfract, yfract; /* X, Y fractional parts */ |
Kojto | 115:87f2f5183dfb | 7301 | int32_t rI, cI; /* Row and column indices */ |
Kojto | 115:87f2f5183dfb | 7302 | q15_t *pYData = S->pData; /* pointer to output table values */ |
Kojto | 115:87f2f5183dfb | 7303 | uint32_t nCols = S->numCols; /* num of rows */ |
Kojto | 115:87f2f5183dfb | 7304 | |
Kojto | 115:87f2f5183dfb | 7305 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7306 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7307 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7308 | rI = ((X & 0xFFF00000) >> 20); |
Kojto | 115:87f2f5183dfb | 7309 | |
Kojto | 115:87f2f5183dfb | 7310 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7311 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7312 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7313 | cI = ((Y & 0xFFF00000) >> 20); |
Kojto | 115:87f2f5183dfb | 7314 | |
Kojto | 115:87f2f5183dfb | 7315 | /* Care taken for table outside boundary */ |
Kojto | 115:87f2f5183dfb | 7316 | /* Returns zero output when values are outside table boundary */ |
Kojto | 115:87f2f5183dfb | 7317 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
Kojto | 115:87f2f5183dfb | 7318 | { |
Kojto | 115:87f2f5183dfb | 7319 | return (0); |
Kojto | 115:87f2f5183dfb | 7320 | } |
Kojto | 115:87f2f5183dfb | 7321 | |
Kojto | 115:87f2f5183dfb | 7322 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7323 | /* xfract should be in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7324 | xfract = (X & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 7325 | |
Kojto | 115:87f2f5183dfb | 7326 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7327 | x1 = pYData[(rI) + nCols * (cI)]; |
Kojto | 115:87f2f5183dfb | 7328 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
Kojto | 115:87f2f5183dfb | 7329 | |
Kojto | 115:87f2f5183dfb | 7330 | |
Kojto | 115:87f2f5183dfb | 7331 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7332 | /* yfract should be in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7333 | yfract = (Y & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 7334 | |
Kojto | 115:87f2f5183dfb | 7335 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7336 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
Kojto | 115:87f2f5183dfb | 7337 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
Kojto | 115:87f2f5183dfb | 7338 | |
Kojto | 115:87f2f5183dfb | 7339 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ |
Kojto | 115:87f2f5183dfb | 7340 | |
Kojto | 115:87f2f5183dfb | 7341 | /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ |
Kojto | 115:87f2f5183dfb | 7342 | /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ |
Kojto | 115:87f2f5183dfb | 7343 | out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); |
Kojto | 115:87f2f5183dfb | 7344 | acc = ((q63_t) out * (0xFFFFF - yfract)); |
Kojto | 115:87f2f5183dfb | 7345 | |
Kojto | 115:87f2f5183dfb | 7346 | /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7347 | out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); |
Kojto | 115:87f2f5183dfb | 7348 | acc += ((q63_t) out * (xfract)); |
Kojto | 115:87f2f5183dfb | 7349 | |
Kojto | 115:87f2f5183dfb | 7350 | /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7351 | out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); |
Kojto | 115:87f2f5183dfb | 7352 | acc += ((q63_t) out * (yfract)); |
Kojto | 115:87f2f5183dfb | 7353 | |
Kojto | 115:87f2f5183dfb | 7354 | /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7355 | out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); |
Kojto | 115:87f2f5183dfb | 7356 | acc += ((q63_t) out * (yfract)); |
Kojto | 115:87f2f5183dfb | 7357 | |
Kojto | 115:87f2f5183dfb | 7358 | /* acc is in 13.51 format and down shift acc by 36 times */ |
Kojto | 115:87f2f5183dfb | 7359 | /* Convert out to 1.15 format */ |
Kojto | 115:87f2f5183dfb | 7360 | return (acc >> 36); |
Kojto | 115:87f2f5183dfb | 7361 | |
Kojto | 115:87f2f5183dfb | 7362 | } |
Kojto | 115:87f2f5183dfb | 7363 | |
Kojto | 115:87f2f5183dfb | 7364 | /** |
Kojto | 115:87f2f5183dfb | 7365 | * @brief Q7 bilinear interpolation. |
Kojto | 115:87f2f5183dfb | 7366 | * @param[in,out] *S points to an instance of the interpolation structure. |
Kojto | 115:87f2f5183dfb | 7367 | * @param[in] X interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7368 | * @param[in] Y interpolation coordinate in 12.20 format. |
Kojto | 115:87f2f5183dfb | 7369 | * @return out interpolated value. |
Kojto | 115:87f2f5183dfb | 7370 | */ |
Kojto | 115:87f2f5183dfb | 7371 | |
Kojto | 115:87f2f5183dfb | 7372 | static __INLINE q7_t arm_bilinear_interp_q7( |
Kojto | 115:87f2f5183dfb | 7373 | arm_bilinear_interp_instance_q7 * S, |
Kojto | 115:87f2f5183dfb | 7374 | q31_t X, |
Kojto | 115:87f2f5183dfb | 7375 | q31_t Y) |
Kojto | 115:87f2f5183dfb | 7376 | { |
Kojto | 115:87f2f5183dfb | 7377 | q63_t acc = 0; /* output */ |
Kojto | 115:87f2f5183dfb | 7378 | q31_t out; /* Temporary output */ |
Kojto | 115:87f2f5183dfb | 7379 | q31_t xfract, yfract; /* X, Y fractional parts */ |
Kojto | 115:87f2f5183dfb | 7380 | q7_t x1, x2, y1, y2; /* Nearest output values */ |
Kojto | 115:87f2f5183dfb | 7381 | int32_t rI, cI; /* Row and column indices */ |
Kojto | 115:87f2f5183dfb | 7382 | q7_t *pYData = S->pData; /* pointer to output table values */ |
Kojto | 115:87f2f5183dfb | 7383 | uint32_t nCols = S->numCols; /* num of rows */ |
Kojto | 115:87f2f5183dfb | 7384 | |
Kojto | 115:87f2f5183dfb | 7385 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7386 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7387 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7388 | rI = ((X & 0xFFF00000) >> 20); |
Kojto | 115:87f2f5183dfb | 7389 | |
Kojto | 115:87f2f5183dfb | 7390 | /* Input is in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7391 | /* 12 bits for the table index */ |
Kojto | 115:87f2f5183dfb | 7392 | /* Index value calculation */ |
Kojto | 115:87f2f5183dfb | 7393 | cI = ((Y & 0xFFF00000) >> 20); |
Kojto | 115:87f2f5183dfb | 7394 | |
Kojto | 115:87f2f5183dfb | 7395 | /* Care taken for table outside boundary */ |
Kojto | 115:87f2f5183dfb | 7396 | /* Returns zero output when values are outside table boundary */ |
Kojto | 115:87f2f5183dfb | 7397 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
Kojto | 115:87f2f5183dfb | 7398 | { |
Kojto | 115:87f2f5183dfb | 7399 | return (0); |
Kojto | 115:87f2f5183dfb | 7400 | } |
Kojto | 115:87f2f5183dfb | 7401 | |
Kojto | 115:87f2f5183dfb | 7402 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7403 | /* xfract should be in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7404 | xfract = (X & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 7405 | |
Kojto | 115:87f2f5183dfb | 7406 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7407 | x1 = pYData[(rI) + nCols * (cI)]; |
Kojto | 115:87f2f5183dfb | 7408 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
Kojto | 115:87f2f5183dfb | 7409 | |
Kojto | 115:87f2f5183dfb | 7410 | |
Kojto | 115:87f2f5183dfb | 7411 | /* 20 bits for the fractional part */ |
Kojto | 115:87f2f5183dfb | 7412 | /* yfract should be in 12.20 format */ |
Kojto | 115:87f2f5183dfb | 7413 | yfract = (Y & 0x000FFFFF); |
Kojto | 115:87f2f5183dfb | 7414 | |
Kojto | 115:87f2f5183dfb | 7415 | /* Read two nearest output values from the index */ |
Kojto | 115:87f2f5183dfb | 7416 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
Kojto | 115:87f2f5183dfb | 7417 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
Kojto | 115:87f2f5183dfb | 7418 | |
Kojto | 115:87f2f5183dfb | 7419 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ |
Kojto | 115:87f2f5183dfb | 7420 | out = ((x1 * (0xFFFFF - xfract))); |
Kojto | 115:87f2f5183dfb | 7421 | acc = (((q63_t) out * (0xFFFFF - yfract))); |
Kojto | 115:87f2f5183dfb | 7422 | |
Kojto | 115:87f2f5183dfb | 7423 | /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7424 | out = ((x2 * (0xFFFFF - yfract))); |
Kojto | 115:87f2f5183dfb | 7425 | acc += (((q63_t) out * (xfract))); |
Kojto | 115:87f2f5183dfb | 7426 | |
Kojto | 115:87f2f5183dfb | 7427 | /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7428 | out = ((y1 * (0xFFFFF - xfract))); |
Kojto | 115:87f2f5183dfb | 7429 | acc += (((q63_t) out * (yfract))); |
Kojto | 115:87f2f5183dfb | 7430 | |
Kojto | 115:87f2f5183dfb | 7431 | /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ |
Kojto | 115:87f2f5183dfb | 7432 | out = ((y2 * (yfract))); |
Kojto | 115:87f2f5183dfb | 7433 | acc += (((q63_t) out * (xfract))); |
Kojto | 115:87f2f5183dfb | 7434 | |
Kojto | 115:87f2f5183dfb | 7435 | /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ |
Kojto | 115:87f2f5183dfb | 7436 | return (acc >> 40); |
Kojto | 115:87f2f5183dfb | 7437 | |
Kojto | 115:87f2f5183dfb | 7438 | } |
Kojto | 115:87f2f5183dfb | 7439 | |
Kojto | 115:87f2f5183dfb | 7440 | /** |
Kojto | 115:87f2f5183dfb | 7441 | * @} end of BilinearInterpolate group |
Kojto | 115:87f2f5183dfb | 7442 | */ |
Kojto | 115:87f2f5183dfb | 7443 | |
Kojto | 115:87f2f5183dfb | 7444 | |
Kojto | 115:87f2f5183dfb | 7445 | //SMMLAR |
Kojto | 115:87f2f5183dfb | 7446 | #define multAcc_32x32_keep32_R(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7447 | a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) |
Kojto | 115:87f2f5183dfb | 7448 | |
Kojto | 115:87f2f5183dfb | 7449 | //SMMLSR |
Kojto | 115:87f2f5183dfb | 7450 | #define multSub_32x32_keep32_R(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7451 | a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) |
Kojto | 115:87f2f5183dfb | 7452 | |
Kojto | 115:87f2f5183dfb | 7453 | //SMMULR |
Kojto | 115:87f2f5183dfb | 7454 | #define mult_32x32_keep32_R(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7455 | a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) |
Kojto | 115:87f2f5183dfb | 7456 | |
Kojto | 115:87f2f5183dfb | 7457 | //SMMLA |
Kojto | 115:87f2f5183dfb | 7458 | #define multAcc_32x32_keep32(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7459 | a += (q31_t) (((q63_t) x * y) >> 32) |
Kojto | 115:87f2f5183dfb | 7460 | |
Kojto | 115:87f2f5183dfb | 7461 | //SMMLS |
Kojto | 115:87f2f5183dfb | 7462 | #define multSub_32x32_keep32(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7463 | a -= (q31_t) (((q63_t) x * y) >> 32) |
Kojto | 115:87f2f5183dfb | 7464 | |
Kojto | 115:87f2f5183dfb | 7465 | //SMMUL |
Kojto | 115:87f2f5183dfb | 7466 | #define mult_32x32_keep32(a, x, y) \ |
Kojto | 115:87f2f5183dfb | 7467 | a = (q31_t) (((q63_t) x * y ) >> 32) |
Kojto | 115:87f2f5183dfb | 7468 | |
Kojto | 115:87f2f5183dfb | 7469 | |
Kojto | 115:87f2f5183dfb | 7470 | #if defined ( __CC_ARM ) //Keil |
Kojto | 115:87f2f5183dfb | 7471 | |
Kojto | 115:87f2f5183dfb | 7472 | //Enter low optimization region - place directly above function definition |
Kojto | 115:87f2f5183dfb | 7473 | #ifdef ARM_MATH_CM4 |
Kojto | 115:87f2f5183dfb | 7474 | #define LOW_OPTIMIZATION_ENTER \ |
Kojto | 115:87f2f5183dfb | 7475 | _Pragma ("push") \ |
Kojto | 115:87f2f5183dfb | 7476 | _Pragma ("O1") |
Kojto | 115:87f2f5183dfb | 7477 | #else |
Kojto | 115:87f2f5183dfb | 7478 | #define LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7479 | #endif |
Kojto | 115:87f2f5183dfb | 7480 | |
Kojto | 115:87f2f5183dfb | 7481 | //Exit low optimization region - place directly after end of function definition |
Kojto | 115:87f2f5183dfb | 7482 | #ifdef ARM_MATH_CM4 |
Kojto | 115:87f2f5183dfb | 7483 | #define LOW_OPTIMIZATION_EXIT \ |
Kojto | 115:87f2f5183dfb | 7484 | _Pragma ("pop") |
Kojto | 115:87f2f5183dfb | 7485 | #else |
Kojto | 115:87f2f5183dfb | 7486 | #define LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7487 | #endif |
Kojto | 115:87f2f5183dfb | 7488 | |
Kojto | 115:87f2f5183dfb | 7489 | //Enter low optimization region - place directly above function definition |
Kojto | 115:87f2f5183dfb | 7490 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7491 | |
Kojto | 115:87f2f5183dfb | 7492 | //Exit low optimization region - place directly after end of function definition |
Kojto | 115:87f2f5183dfb | 7493 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7494 | |
Kojto | 115:87f2f5183dfb | 7495 | #elif defined(__ICCARM__) //IAR |
Kojto | 115:87f2f5183dfb | 7496 | |
Kojto | 115:87f2f5183dfb | 7497 | //Enter low optimization region - place directly above function definition |
Kojto | 115:87f2f5183dfb | 7498 | #ifdef ARM_MATH_CM4 |
Kojto | 115:87f2f5183dfb | 7499 | #define LOW_OPTIMIZATION_ENTER \ |
Kojto | 115:87f2f5183dfb | 7500 | _Pragma ("optimize=low") |
Kojto | 115:87f2f5183dfb | 7501 | #else |
Kojto | 115:87f2f5183dfb | 7502 | #define LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7503 | #endif |
Kojto | 115:87f2f5183dfb | 7504 | |
Kojto | 115:87f2f5183dfb | 7505 | //Exit low optimization region - place directly after end of function definition |
Kojto | 115:87f2f5183dfb | 7506 | #define LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7507 | |
Kojto | 115:87f2f5183dfb | 7508 | //Enter low optimization region - place directly above function definition |
Kojto | 115:87f2f5183dfb | 7509 | #ifdef ARM_MATH_CM4 |
Kojto | 115:87f2f5183dfb | 7510 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ |
Kojto | 115:87f2f5183dfb | 7511 | _Pragma ("optimize=low") |
Kojto | 115:87f2f5183dfb | 7512 | #else |
Kojto | 115:87f2f5183dfb | 7513 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7514 | #endif |
Kojto | 115:87f2f5183dfb | 7515 | |
Kojto | 115:87f2f5183dfb | 7516 | //Exit low optimization region - place directly after end of function definition |
Kojto | 115:87f2f5183dfb | 7517 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7518 | |
Kojto | 115:87f2f5183dfb | 7519 | #elif defined(__GNUC__) |
Kojto | 115:87f2f5183dfb | 7520 | |
Kojto | 115:87f2f5183dfb | 7521 | #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) |
Kojto | 115:87f2f5183dfb | 7522 | |
Kojto | 115:87f2f5183dfb | 7523 | #define LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7524 | |
Kojto | 115:87f2f5183dfb | 7525 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7526 | |
Kojto | 115:87f2f5183dfb | 7527 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7528 | |
Kojto | 115:87f2f5183dfb | 7529 | #elif defined(__CSMC__) // Cosmic |
Kojto | 115:87f2f5183dfb | 7530 | |
Kojto | 115:87f2f5183dfb | 7531 | #define LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7532 | #define LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7533 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7534 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7535 | |
Kojto | 115:87f2f5183dfb | 7536 | #elif defined(__TASKING__) // TASKING |
Kojto | 115:87f2f5183dfb | 7537 | |
Kojto | 115:87f2f5183dfb | 7538 | #define LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7539 | #define LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7540 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
Kojto | 115:87f2f5183dfb | 7541 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
Kojto | 115:87f2f5183dfb | 7542 | |
Kojto | 115:87f2f5183dfb | 7543 | #endif |
Kojto | 115:87f2f5183dfb | 7544 | |
Kojto | 115:87f2f5183dfb | 7545 | |
Kojto | 115:87f2f5183dfb | 7546 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 7547 | } |
Kojto | 115:87f2f5183dfb | 7548 | #endif |
Kojto | 115:87f2f5183dfb | 7549 | |
Kojto | 115:87f2f5183dfb | 7550 | |
Kojto | 115:87f2f5183dfb | 7551 | #endif /* _ARM_MATH_H */ |
Kojto | 115:87f2f5183dfb | 7552 | |
Kojto | 115:87f2f5183dfb | 7553 | /** |
Kojto | 115:87f2f5183dfb | 7554 | * |
Kojto | 115:87f2f5183dfb | 7555 | * End of file. |
Kojto | 115:87f2f5183dfb | 7556 | */ |