Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
arm_math.h
00001 /* ---------------------------------------------------------------------- 00002 * Project: CMSIS DSP Library 00003 * Title: arm_math.h 00004 * Description: Public header file for CMSIS DSP Library 00005 * 00006 * $Date: 27. January 2017 00007 * $Revision: V.1.5.1 00008 * 00009 * Target Processor: Cortex-M cores 00010 * -------------------------------------------------------------------- */ 00011 /* 00012 * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 00013 * 00014 * SPDX-License-Identifier: Apache-2.0 00015 * 00016 * Licensed under the Apache License, Version 2.0 (the License); you may 00017 * not use this file except in compliance with the License. 00018 * You may obtain a copy of the License at 00019 * 00020 * www.apache.org/licenses/LICENSE-2.0 00021 * 00022 * Unless required by applicable law or agreed to in writing, software 00023 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00024 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00025 * See the License for the specific language governing permissions and 00026 * limitations under the License. 00027 */ 00028 00029 /** 00030 \mainpage CMSIS DSP Software Library 00031 * 00032 * Introduction 00033 * ------------ 00034 * 00035 * This user manual describes the CMSIS DSP software library, 00036 * a suite of common signal processing functions for use on Cortex-M processor based devices. 00037 * 00038 * The library is divided into a number of functions each covering a specific category: 00039 * - Basic math functions 00040 * - Fast math functions 00041 * - Complex math functions 00042 * - Filters 00043 * - Matrix functions 00044 * - Transforms 00045 * - Motor control functions 00046 * - Statistical functions 00047 * - Support functions 00048 * - Interpolation functions 00049 * 00050 * The library has separate functions for operating on 8-bit integers, 16-bit integers, 00051 * 32-bit integer and 32-bit floating-point values. 00052 * 00053 * Using the Library 00054 * ------------ 00055 * 00056 * The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder. 00057 * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit) 00058 * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit) 00059 * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit) 00060 * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on) 00061 * - arm_cortexM7l_math.lib (Cortex-M7, Little endian) 00062 * - arm_cortexM7b_math.lib (Cortex-M7, Big endian) 00063 * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit) 00064 * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit) 00065 * - arm_cortexM4l_math.lib (Cortex-M4, Little endian) 00066 * - arm_cortexM4b_math.lib (Cortex-M4, Big endian) 00067 * - arm_cortexM3l_math.lib (Cortex-M3, Little endian) 00068 * - arm_cortexM3b_math.lib (Cortex-M3, Big endian) 00069 * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian) 00070 * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian) 00071 * - arm_ARMv8MBLl_math.lib (ARMv8M Baseline, Little endian) 00072 * - arm_ARMv8MMLl_math.lib (ARMv8M Mainline, Little endian) 00073 * - arm_ARMv8MMLlfsp_math.lib (ARMv8M Mainline, Little endian, Single Precision Floating Point Unit) 00074 * - arm_ARMv8MMLld_math.lib (ARMv8M Mainline, Little endian, DSP instructions) 00075 * - arm_ARMv8MMLldfsp_math.lib (ARMv8M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit) 00076 * 00077 * The library functions are declared in the public file <code>arm_math.h</code> which is placed in the <code>Include</code> folder. 00078 * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single 00079 * public header file <code> arm_math.h</code> for Cortex-M cores with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. 00080 * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or 00081 * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. 00082 * For ARMv8M cores define pre processor MACRO ARM_MATH_ARMV8MBL or ARM_MATH_ARMV8MML. 00083 * Set Pre processor MACRO __DSP_PRESENT if ARMv8M Mainline core supports DSP instructions. 00084 * 00085 * 00086 * Examples 00087 * -------- 00088 * 00089 * The library ships with a number of examples which demonstrate how to use the library functions. 00090 * 00091 * Toolchain Support 00092 * ------------ 00093 * 00094 * The library has been developed and tested with MDK-ARM version 5.14.0.0 00095 * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. 00096 * 00097 * Building the Library 00098 * ------------ 00099 * 00100 * 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. 00101 * - arm_cortexM_math.uvprojx 00102 * 00103 * 00104 * 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. 00105 * 00106 * Pre-processor Macros 00107 * ------------ 00108 * 00109 * Each library project have differant pre-processor macros. 00110 * 00111 * - UNALIGNED_SUPPORT_DISABLE: 00112 * 00113 * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access 00114 * 00115 * - ARM_MATH_BIG_ENDIAN: 00116 * 00117 * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. 00118 * 00119 * - ARM_MATH_MATRIX_CHECK: 00120 * 00121 * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices 00122 * 00123 * - ARM_MATH_ROUNDING: 00124 * 00125 * Define macro ARM_MATH_ROUNDING for rounding on support functions 00126 * 00127 * - ARM_MATH_CMx: 00128 * 00129 * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target 00130 * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and 00131 * ARM_MATH_CM7 for building the library on cortex-M7. 00132 * 00133 * - ARM_MATH_ARMV8MxL: 00134 * 00135 * Define macro ARM_MATH_ARMV8MBL for building the library on ARMv8M Baseline target, ARM_MATH_ARMV8MBL for building library 00136 * on ARMv8M Mainline target. 00137 * 00138 * - __FPU_PRESENT: 00139 * 00140 * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for floating point libraries. 00141 * 00142 * - __DSP_PRESENT: 00143 * 00144 * Initialize macro __DSP_PRESENT = 1 when ARMv8M Mainline core supports DSP instructions. 00145 * 00146 * <hr> 00147 * CMSIS-DSP in ARM::CMSIS Pack 00148 * ----------------------------- 00149 * 00150 * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories: 00151 * |File/Folder |Content | 00152 * |------------------------------|------------------------------------------------------------------------| 00153 * |\b CMSIS\\Documentation\\DSP | This documentation | 00154 * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | 00155 * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | 00156 * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | 00157 * 00158 * <hr> 00159 * Revision History of CMSIS-DSP 00160 * ------------ 00161 * Please refer to \ref ChangeLog_pg. 00162 * 00163 * Copyright Notice 00164 * ------------ 00165 * 00166 * Copyright (C) 2010-2015 ARM Limited. All rights reserved. 00167 */ 00168 00169 00170 /** 00171 * @defgroup groupMath Basic Math Functions 00172 */ 00173 00174 /** 00175 * @defgroup groupFastMath Fast Math Functions 00176 * This set of functions provides a fast approximation to sine, cosine, and square root. 00177 * As compared to most of the other functions in the CMSIS math library, the fast math functions 00178 * operate on individual values and not arrays. 00179 * There are separate functions for Q15, Q31, and floating-point data. 00180 * 00181 */ 00182 00183 /** 00184 * @defgroup groupCmplxMath Complex Math Functions 00185 * This set of functions operates on complex data vectors. 00186 * The data in the complex arrays is stored in an interleaved fashion 00187 * (real, imag, real, imag, ...). 00188 * In the API functions, the number of samples in a complex array refers 00189 * to the number of complex values; the array contains twice this number of 00190 * real values. 00191 */ 00192 00193 /** 00194 * @defgroup groupFilters Filtering Functions 00195 */ 00196 00197 /** 00198 * @defgroup groupMatrix Matrix Functions 00199 * 00200 * This set of functions provides basic matrix math operations. 00201 * The functions operate on matrix data structures. For example, 00202 * the type 00203 * definition for the floating-point matrix structure is shown 00204 * below: 00205 * <pre> 00206 * typedef struct 00207 * { 00208 * uint16_t numRows; // number of rows of the matrix. 00209 * uint16_t numCols; // number of columns of the matrix. 00210 * float32_t *pData; // points to the data of the matrix. 00211 * } arm_matrix_instance_f32; 00212 * </pre> 00213 * There are similar definitions for Q15 and Q31 data types. 00214 * 00215 * The structure specifies the size of the matrix and then points to 00216 * an array of data. The array is of size <code>numRows X numCols</code> 00217 * and the values are arranged in row order. That is, the 00218 * matrix element (i, j) is stored at: 00219 * <pre> 00220 * pData[i*numCols + j] 00221 * </pre> 00222 * 00223 * \par Init Functions 00224 * There is an associated initialization function for each type of matrix 00225 * data structure. 00226 * The initialization function sets the values of the internal structure fields. 00227 * Refer to the function <code>arm_mat_init_f32()</code>, <code>arm_mat_init_q31()</code> 00228 * and <code>arm_mat_init_q15()</code> for floating-point, Q31 and Q15 types, respectively. 00229 * 00230 * \par 00231 * Use of the initialization function is optional. However, if initialization function is used 00232 * then the instance structure cannot be placed into a const data section. 00233 * To place the instance structure in a const data 00234 * section, manually initialize the data structure. For example: 00235 * <pre> 00236 * <code>arm_matrix_instance_f32 S = {nRows, nColumns, pData};</code> 00237 * <code>arm_matrix_instance_q31 S = {nRows, nColumns, pData};</code> 00238 * <code>arm_matrix_instance_q15 S = {nRows, nColumns, pData};</code> 00239 * </pre> 00240 * where <code>nRows</code> specifies the number of rows, <code>nColumns</code> 00241 * specifies the number of columns, and <code>pData</code> points to the 00242 * data array. 00243 * 00244 * \par Size Checking 00245 * By default all of the matrix functions perform size checking on the input and 00246 * output matrices. For example, the matrix addition function verifies that the 00247 * two input matrices and the output matrix all have the same number of rows and 00248 * columns. If the size check fails the functions return: 00249 * <pre> 00250 * ARM_MATH_SIZE_MISMATCH 00251 * </pre> 00252 * Otherwise the functions return 00253 * <pre> 00254 * ARM_MATH_SUCCESS 00255 * </pre> 00256 * There is some overhead associated with this matrix size checking. 00257 * The matrix size checking is enabled via the \#define 00258 * <pre> 00259 * ARM_MATH_MATRIX_CHECK 00260 * </pre> 00261 * within the library project settings. By default this macro is defined 00262 * and size checking is enabled. By changing the project settings and 00263 * undefining this macro size checking is eliminated and the functions 00264 * run a bit faster. With size checking disabled the functions always 00265 * return <code>ARM_MATH_SUCCESS</code>. 00266 */ 00267 00268 /** 00269 * @defgroup groupTransforms Transform Functions 00270 */ 00271 00272 /** 00273 * @defgroup groupController Controller Functions 00274 */ 00275 00276 /** 00277 * @defgroup groupStats Statistics Functions 00278 */ 00279 /** 00280 * @defgroup groupSupport Support Functions 00281 */ 00282 00283 /** 00284 * @defgroup groupInterpolation Interpolation Functions 00285 * These functions perform 1- and 2-dimensional interpolation of data. 00286 * Linear interpolation is used for 1-dimensional data and 00287 * bilinear interpolation is used for 2-dimensional data. 00288 */ 00289 00290 /** 00291 * @defgroup groupExamples Examples 00292 */ 00293 #ifndef _ARM_MATH_H 00294 #define _ARM_MATH_H 00295 00296 /* Compiler specific diagnostic adjustment */ 00297 #if defined ( __CC_ARM ) 00298 00299 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) 00300 00301 #elif defined ( __GNUC__ ) 00302 #pragma GCC diagnostic push 00303 #pragma GCC diagnostic ignored "-Wsign-conversion" 00304 #pragma GCC diagnostic ignored "-Wconversion" 00305 #pragma GCC diagnostic ignored "-Wunused-parameter" 00306 00307 #elif defined ( __ICCARM__ ) 00308 00309 #elif defined ( __TI_ARM__ ) 00310 00311 #elif defined ( __CSMC__ ) 00312 00313 #elif defined ( __TASKING__ ) 00314 00315 #else 00316 #error Unknown compiler 00317 #endif 00318 00319 00320 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */ 00321 00322 #if defined(ARM_MATH_CM7) 00323 #include "core_cm7.h" 00324 #define ARM_MATH_DSP 00325 #elif defined (ARM_MATH_CM4) 00326 #include "core_cm4.h" 00327 #define ARM_MATH_DSP 00328 #elif defined (ARM_MATH_CM3) 00329 #include "core_cm3.h" 00330 #elif defined (ARM_MATH_CM0) 00331 #include "core_cm0.h" 00332 #define ARM_MATH_CM0_FAMILY 00333 #elif defined (ARM_MATH_CM0PLUS) 00334 #include "core_cm0plus.h" 00335 #define ARM_MATH_CM0_FAMILY 00336 #elif defined (ARM_MATH_ARMV8MBL) 00337 #include "core_armv8mbl.h" 00338 #define ARM_MATH_CM0_FAMILY 00339 #elif defined (ARM_MATH_ARMV8MML) 00340 #include "core_armv8mml.h" 00341 #if (defined (__DSP_PRESENT) && (__DSP_PRESENT == 1)) 00342 #define ARM_MATH_DSP 00343 #endif 00344 #else 00345 #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS, ARM_MATH_CM0, ARM_MATH_ARMV8MBL, ARM_MATH_ARMV8MML" 00346 #endif 00347 00348 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ 00349 #include "string.h" 00350 #include "math.h" 00351 #ifdef __cplusplus 00352 extern "C" 00353 { 00354 #endif 00355 00356 00357 /** 00358 * @brief Macros required for reciprocal calculation in Normalized LMS 00359 */ 00360 00361 #define DELTA_Q31 (0x100) 00362 #define DELTA_Q15 0x5 00363 #define INDEX_MASK 0x0000003F 00364 #ifndef PI 00365 #define PI 3.14159265358979f 00366 #endif 00367 00368 /** 00369 * @brief Macros required for SINE and COSINE Fast math approximations 00370 */ 00371 00372 #define FAST_MATH_TABLE_SIZE 512 00373 #define FAST_MATH_Q31_SHIFT (32 - 10) 00374 #define FAST_MATH_Q15_SHIFT (16 - 10) 00375 #define CONTROLLER_Q31_SHIFT (32 - 9) 00376 #define TABLE_SPACING_Q31 0x400000 00377 #define TABLE_SPACING_Q15 0x80 00378 00379 /** 00380 * @brief Macros required for SINE and COSINE Controller functions 00381 */ 00382 /* 1.31(q31) Fixed value of 2/360 */ 00383 /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ 00384 #define INPUT_SPACING 0xB60B61 00385 00386 /** 00387 * @brief Macro for Unaligned Support 00388 */ 00389 #ifndef UNALIGNED_SUPPORT_DISABLE 00390 #define ALIGN4 00391 #else 00392 #if defined (__GNUC__) 00393 #define ALIGN4 __attribute__((aligned(4))) 00394 #else 00395 #define ALIGN4 __align(4) 00396 #endif 00397 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ 00398 00399 /** 00400 * @brief Error status returned by some functions in the library. 00401 */ 00402 00403 typedef enum 00404 { 00405 ARM_MATH_SUCCESS = 0, /**< No error */ 00406 ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ 00407 ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ 00408 ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ 00409 ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ 00410 ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ 00411 ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ 00412 } arm_status; 00413 00414 /** 00415 * @brief 8-bit fractional data type in 1.7 format. 00416 */ 00417 typedef int8_t q7_t; 00418 00419 /** 00420 * @brief 16-bit fractional data type in 1.15 format. 00421 */ 00422 typedef int16_t q15_t; 00423 00424 /** 00425 * @brief 32-bit fractional data type in 1.31 format. 00426 */ 00427 typedef int32_t q31_t; 00428 00429 /** 00430 * @brief 64-bit fractional data type in 1.63 format. 00431 */ 00432 typedef int64_t q63_t; 00433 00434 /** 00435 * @brief 32-bit floating-point type definition. 00436 */ 00437 typedef float float32_t; 00438 00439 /** 00440 * @brief 64-bit floating-point type definition. 00441 */ 00442 typedef double float64_t; 00443 00444 /** 00445 * @brief definition to read/write two 16 bit values. 00446 */ 00447 #if defined ( __CC_ARM ) 00448 #define __SIMD32_TYPE int32_t __packed 00449 #define CMSIS_UNUSED __attribute__((unused)) 00450 #define CMSIS_INLINE __attribute__((always_inline)) 00451 00452 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) 00453 #define __SIMD32_TYPE int32_t 00454 #define CMSIS_UNUSED __attribute__((unused)) 00455 #define CMSIS_INLINE __attribute__((always_inline)) 00456 00457 #elif defined ( __GNUC__ ) 00458 #define __SIMD32_TYPE int32_t 00459 #define CMSIS_UNUSED __attribute__((unused)) 00460 #define CMSIS_INLINE __attribute__((always_inline)) 00461 00462 #elif defined ( __ICCARM__ ) 00463 #define __SIMD32_TYPE int32_t __packed 00464 #define CMSIS_UNUSED 00465 #define CMSIS_INLINE 00466 00467 #elif defined ( __TI_ARM__ ) 00468 #define __SIMD32_TYPE int32_t 00469 #define CMSIS_UNUSED __attribute__((unused)) 00470 #define CMSIS_INLINE 00471 00472 #elif defined ( __CSMC__ ) 00473 #define __SIMD32_TYPE int32_t 00474 #define CMSIS_UNUSED 00475 #define CMSIS_INLINE 00476 00477 #elif defined ( __TASKING__ ) 00478 #define __SIMD32_TYPE __unaligned int32_t 00479 #define CMSIS_UNUSED 00480 #define CMSIS_INLINE 00481 00482 #else 00483 #error Unknown compiler 00484 #endif 00485 00486 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) 00487 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) 00488 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) 00489 #define __SIMD64(addr) (*(int64_t **) & (addr)) 00490 00491 /* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ 00492 #if !defined (ARM_MATH_DSP) 00493 /** 00494 * @brief definition to pack two 16 bit values. 00495 */ 00496 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ 00497 (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) 00498 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ 00499 (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) 00500 00501 /* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ 00502 #endif /* !defined (ARM_MATH_DSP) */ 00503 00504 /** 00505 * @brief definition to pack four 8 bit values. 00506 */ 00507 #ifndef ARM_MATH_BIG_ENDIAN 00508 00509 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ 00510 (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ 00511 (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ 00512 (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) 00513 #else 00514 00515 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ 00516 (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ 00517 (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ 00518 (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) 00519 00520 #endif 00521 00522 00523 /** 00524 * @brief Clips Q63 to Q31 values. 00525 */ 00526 CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31( 00527 q63_t x) 00528 { 00529 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? 00530 ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; 00531 } 00532 00533 /** 00534 * @brief Clips Q63 to Q15 values. 00535 */ 00536 CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15( 00537 q63_t x) 00538 { 00539 return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? 00540 ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); 00541 } 00542 00543 /** 00544 * @brief Clips Q31 to Q7 values. 00545 */ 00546 CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7( 00547 q31_t x) 00548 { 00549 return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? 00550 ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; 00551 } 00552 00553 /** 00554 * @brief Clips Q31 to Q15 values. 00555 */ 00556 CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15( 00557 q31_t x) 00558 { 00559 return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? 00560 ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; 00561 } 00562 00563 /** 00564 * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. 00565 */ 00566 00567 CMSIS_INLINE __STATIC_INLINE q63_t mult32x64( 00568 q63_t x, 00569 q31_t y) 00570 { 00571 return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + 00572 (((q63_t) (x >> 32) * y))); 00573 } 00574 00575 /* 00576 #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) 00577 #define __CLZ __clz 00578 #endif 00579 */ 00580 /* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ 00581 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) 00582 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( 00583 q31_t data); 00584 00585 CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( 00586 q31_t data) 00587 { 00588 uint32_t count = 0; 00589 uint32_t mask = 0x80000000; 00590 00591 while ((data & mask) == 0) 00592 { 00593 count += 1u; 00594 mask = mask >> 1u; 00595 } 00596 00597 return (count); 00598 } 00599 #endif 00600 00601 /** 00602 * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. 00603 */ 00604 00605 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31( 00606 q31_t in, 00607 q31_t * dst, 00608 q31_t * pRecipTable) 00609 { 00610 q31_t out; 00611 uint32_t tempVal; 00612 uint32_t index, i; 00613 uint32_t signBits; 00614 00615 if (in > 0) 00616 { 00617 signBits = ((uint32_t) (__CLZ( in) - 1)); 00618 } 00619 else 00620 { 00621 signBits = ((uint32_t) (__CLZ(-in) - 1)); 00622 } 00623 00624 /* Convert input sample to 1.31 format */ 00625 in = (in << signBits); 00626 00627 /* calculation of index for initial approximated Val */ 00628 index = (uint32_t)(in >> 24); 00629 index = (index & INDEX_MASK); 00630 00631 /* 1.31 with exp 1 */ 00632 out = pRecipTable[index]; 00633 00634 /* calculation of reciprocal value */ 00635 /* running approximation for two iterations */ 00636 for (i = 0u; i < 2u; i++) 00637 { 00638 tempVal = (uint32_t) (((q63_t) in * out) >> 31); 00639 tempVal = 0x7FFFFFFFu - tempVal; 00640 /* 1.31 with exp 1 */ 00641 /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ 00642 out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); 00643 } 00644 00645 /* write output */ 00646 *dst = out; 00647 00648 /* return num of signbits of out = 1/in value */ 00649 return (signBits + 1u); 00650 } 00651 00652 00653 /** 00654 * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. 00655 */ 00656 CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15( 00657 q15_t in, 00658 q15_t * dst, 00659 q15_t * pRecipTable) 00660 { 00661 q15_t out = 0; 00662 uint32_t tempVal = 0; 00663 uint32_t index = 0, i = 0; 00664 uint32_t signBits = 0; 00665 00666 if (in > 0) 00667 { 00668 signBits = ((uint32_t)(__CLZ( in) - 17)); 00669 } 00670 else 00671 { 00672 signBits = ((uint32_t)(__CLZ(-in) - 17)); 00673 } 00674 00675 /* Convert input sample to 1.15 format */ 00676 in = (in << signBits); 00677 00678 /* calculation of index for initial approximated Val */ 00679 index = (uint32_t)(in >> 8); 00680 index = (index & INDEX_MASK); 00681 00682 /* 1.15 with exp 1 */ 00683 out = pRecipTable[index]; 00684 00685 /* calculation of reciprocal value */ 00686 /* running approximation for two iterations */ 00687 for (i = 0u; i < 2u; i++) 00688 { 00689 tempVal = (uint32_t) (((q31_t) in * out) >> 15); 00690 tempVal = 0x7FFFu - tempVal; 00691 /* 1.15 with exp 1 */ 00692 out = (q15_t) (((q31_t) out * tempVal) >> 14); 00693 /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ 00694 } 00695 00696 /* write output */ 00697 *dst = out; 00698 00699 /* return num of signbits of out = 1/in value */ 00700 return (signBits + 1); 00701 } 00702 00703 00704 /* 00705 * @brief C custom defined intrinisic function for only M0 processors 00706 */ 00707 #if defined(ARM_MATH_CM0_FAMILY) 00708 CMSIS_INLINE __STATIC_INLINE q31_t __SSAT( 00709 q31_t x, 00710 uint32_t y) 00711 { 00712 int32_t posMax, negMin; 00713 uint32_t i; 00714 00715 posMax = 1; 00716 for (i = 0; i < (y - 1); i++) 00717 { 00718 posMax = posMax * 2; 00719 } 00720 00721 if (x > 0) 00722 { 00723 posMax = (posMax - 1); 00724 00725 if (x > posMax) 00726 { 00727 x = posMax; 00728 } 00729 } 00730 else 00731 { 00732 negMin = -posMax; 00733 00734 if (x < negMin) 00735 { 00736 x = negMin; 00737 } 00738 } 00739 return (x); 00740 } 00741 #endif /* end of ARM_MATH_CM0_FAMILY */ 00742 00743 00744 /* 00745 * @brief C custom defined intrinsic function for M3 and M0 processors 00746 */ 00747 /* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ 00748 #if !defined (ARM_MATH_DSP) 00749 00750 /* 00751 * @brief C custom defined QADD8 for M3 and M0 processors 00752 */ 00753 CMSIS_INLINE __STATIC_INLINE uint32_t __QADD8( 00754 uint32_t x, 00755 uint32_t y) 00756 { 00757 q31_t r, s, t, u; 00758 00759 r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; 00760 s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; 00761 t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; 00762 u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; 00763 00764 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); 00765 } 00766 00767 00768 /* 00769 * @brief C custom defined QSUB8 for M3 and M0 processors 00770 */ 00771 CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB8( 00772 uint32_t x, 00773 uint32_t y) 00774 { 00775 q31_t r, s, t, u; 00776 00777 r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; 00778 s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; 00779 t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; 00780 u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; 00781 00782 return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); 00783 } 00784 00785 00786 /* 00787 * @brief C custom defined QADD16 for M3 and M0 processors 00788 */ 00789 CMSIS_INLINE __STATIC_INLINE uint32_t __QADD16( 00790 uint32_t x, 00791 uint32_t y) 00792 { 00793 /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ 00794 q31_t r = 0, s = 0; 00795 00796 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; 00797 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; 00798 00799 return ((uint32_t)((s << 16) | (r ))); 00800 } 00801 00802 00803 /* 00804 * @brief C custom defined SHADD16 for M3 and M0 processors 00805 */ 00806 CMSIS_INLINE __STATIC_INLINE uint32_t __SHADD16( 00807 uint32_t x, 00808 uint32_t y) 00809 { 00810 q31_t r, s; 00811 00812 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00813 s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00814 00815 return ((uint32_t)((s << 16) | (r ))); 00816 } 00817 00818 00819 /* 00820 * @brief C custom defined QSUB16 for M3 and M0 processors 00821 */ 00822 CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB16( 00823 uint32_t x, 00824 uint32_t y) 00825 { 00826 q31_t r, s; 00827 00828 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; 00829 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; 00830 00831 return ((uint32_t)((s << 16) | (r ))); 00832 } 00833 00834 00835 /* 00836 * @brief C custom defined SHSUB16 for M3 and M0 processors 00837 */ 00838 CMSIS_INLINE __STATIC_INLINE uint32_t __SHSUB16( 00839 uint32_t x, 00840 uint32_t y) 00841 { 00842 q31_t r, s; 00843 00844 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00845 s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00846 00847 return ((uint32_t)((s << 16) | (r ))); 00848 } 00849 00850 00851 /* 00852 * @brief C custom defined QASX for M3 and M0 processors 00853 */ 00854 CMSIS_INLINE __STATIC_INLINE uint32_t __QASX( 00855 uint32_t x, 00856 uint32_t y) 00857 { 00858 q31_t r, s; 00859 00860 r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; 00861 s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; 00862 00863 return ((uint32_t)((s << 16) | (r ))); 00864 } 00865 00866 00867 /* 00868 * @brief C custom defined SHASX for M3 and M0 processors 00869 */ 00870 CMSIS_INLINE __STATIC_INLINE uint32_t __SHASX( 00871 uint32_t x, 00872 uint32_t y) 00873 { 00874 q31_t r, s; 00875 00876 r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00877 s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00878 00879 return ((uint32_t)((s << 16) | (r ))); 00880 } 00881 00882 00883 /* 00884 * @brief C custom defined QSAX for M3 and M0 processors 00885 */ 00886 CMSIS_INLINE __STATIC_INLINE uint32_t __QSAX( 00887 uint32_t x, 00888 uint32_t y) 00889 { 00890 q31_t r, s; 00891 00892 r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; 00893 s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; 00894 00895 return ((uint32_t)((s << 16) | (r ))); 00896 } 00897 00898 00899 /* 00900 * @brief C custom defined SHSAX for M3 and M0 processors 00901 */ 00902 CMSIS_INLINE __STATIC_INLINE uint32_t __SHSAX( 00903 uint32_t x, 00904 uint32_t y) 00905 { 00906 q31_t r, s; 00907 00908 r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00909 s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; 00910 00911 return ((uint32_t)((s << 16) | (r ))); 00912 } 00913 00914 00915 /* 00916 * @brief C custom defined SMUSDX for M3 and M0 processors 00917 */ 00918 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSDX( 00919 uint32_t x, 00920 uint32_t y) 00921 { 00922 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - 00923 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); 00924 } 00925 00926 /* 00927 * @brief C custom defined SMUADX for M3 and M0 processors 00928 */ 00929 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUADX( 00930 uint32_t x, 00931 uint32_t y) 00932 { 00933 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + 00934 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); 00935 } 00936 00937 00938 /* 00939 * @brief C custom defined QADD for M3 and M0 processors 00940 */ 00941 CMSIS_INLINE __STATIC_INLINE int32_t __QADD( 00942 int32_t x, 00943 int32_t y) 00944 { 00945 return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); 00946 } 00947 00948 00949 /* 00950 * @brief C custom defined QSUB for M3 and M0 processors 00951 */ 00952 CMSIS_INLINE __STATIC_INLINE int32_t __QSUB( 00953 int32_t x, 00954 int32_t y) 00955 { 00956 return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); 00957 } 00958 00959 00960 /* 00961 * @brief C custom defined SMLAD for M3 and M0 processors 00962 */ 00963 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLAD( 00964 uint32_t x, 00965 uint32_t y, 00966 uint32_t sum) 00967 { 00968 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + 00969 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + 00970 ( ((q31_t)sum ) ) )); 00971 } 00972 00973 00974 /* 00975 * @brief C custom defined SMLADX for M3 and M0 processors 00976 */ 00977 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLADX( 00978 uint32_t x, 00979 uint32_t y, 00980 uint32_t sum) 00981 { 00982 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + 00983 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + 00984 ( ((q31_t)sum ) ) )); 00985 } 00986 00987 00988 /* 00989 * @brief C custom defined SMLSDX for M3 and M0 processors 00990 */ 00991 CMSIS_INLINE __STATIC_INLINE uint32_t __SMLSDX( 00992 uint32_t x, 00993 uint32_t y, 00994 uint32_t sum) 00995 { 00996 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - 00997 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + 00998 ( ((q31_t)sum ) ) )); 00999 } 01000 01001 01002 /* 01003 * @brief C custom defined SMLALD for M3 and M0 processors 01004 */ 01005 CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALD( 01006 uint32_t x, 01007 uint32_t y, 01008 uint64_t sum) 01009 { 01010 /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ 01011 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + 01012 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + 01013 ( ((q63_t)sum ) ) )); 01014 } 01015 01016 01017 /* 01018 * @brief C custom defined SMLALDX for M3 and M0 processors 01019 */ 01020 CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALDX( 01021 uint32_t x, 01022 uint32_t y, 01023 uint64_t sum) 01024 { 01025 /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ 01026 return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + 01027 ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + 01028 ( ((q63_t)sum ) ) )); 01029 } 01030 01031 01032 /* 01033 * @brief C custom defined SMUAD for M3 and M0 processors 01034 */ 01035 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUAD( 01036 uint32_t x, 01037 uint32_t y) 01038 { 01039 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + 01040 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); 01041 } 01042 01043 01044 /* 01045 * @brief C custom defined SMUSD for M3 and M0 processors 01046 */ 01047 CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSD( 01048 uint32_t x, 01049 uint32_t y) 01050 { 01051 return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - 01052 ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); 01053 } 01054 01055 01056 /* 01057 * @brief C custom defined SXTB16 for M3 and M0 processors 01058 */ 01059 CMSIS_INLINE __STATIC_INLINE uint32_t __SXTB16( 01060 uint32_t x) 01061 { 01062 return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | 01063 ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); 01064 } 01065 01066 /* 01067 * @brief C custom defined SMMLA for M3 and M0 processors 01068 */ 01069 CMSIS_INLINE __STATIC_INLINE int32_t __SMMLA( 01070 int32_t x, 01071 int32_t y, 01072 int32_t sum) 01073 { 01074 return (sum + (int32_t) (((int64_t) x * y) >> 32)); 01075 } 01076 01077 #if 0 01078 /* 01079 * @brief C custom defined PKHBT for unavailable DSP extension 01080 */ 01081 CMSIS_INLINE __STATIC_INLINE uint32_t __PKHBT( 01082 uint32_t x, 01083 uint32_t y, 01084 uint32_t leftshift) 01085 { 01086 return ( ((x ) & 0x0000FFFFUL) | 01087 ((y << leftshift) & 0xFFFF0000UL) ); 01088 } 01089 01090 /* 01091 * @brief C custom defined PKHTB for unavailable DSP extension 01092 */ 01093 CMSIS_INLINE __STATIC_INLINE uint32_t __PKHTB( 01094 uint32_t x, 01095 uint32_t y, 01096 uint32_t rightshift) 01097 { 01098 return ( ((x ) & 0xFFFF0000UL) | 01099 ((y >> rightshift) & 0x0000FFFFUL) ); 01100 } 01101 #endif 01102 01103 /* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ 01104 #endif /* !defined (ARM_MATH_DSP) */ 01105 01106 01107 /** 01108 * @brief Instance structure for the Q7 FIR filter. 01109 */ 01110 typedef struct 01111 { 01112 uint16_t numTaps; /**< number of filter coefficients in the filter. */ 01113 q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 01114 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 01115 } arm_fir_instance_q7; 01116 01117 /** 01118 * @brief Instance structure for the Q15 FIR filter. 01119 */ 01120 typedef struct 01121 { 01122 uint16_t numTaps; /**< number of filter coefficients in the filter. */ 01123 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 01124 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 01125 } arm_fir_instance_q15; 01126 01127 /** 01128 * @brief Instance structure for the Q31 FIR filter. 01129 */ 01130 typedef struct 01131 { 01132 uint16_t numTaps; /**< number of filter coefficients in the filter. */ 01133 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 01134 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 01135 } arm_fir_instance_q31; 01136 01137 /** 01138 * @brief Instance structure for the floating-point FIR filter. 01139 */ 01140 typedef struct 01141 { 01142 uint16_t numTaps; /**< number of filter coefficients in the filter. */ 01143 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 01144 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 01145 } arm_fir_instance_f32; 01146 01147 01148 /** 01149 * @brief Processing function for the Q7 FIR filter. 01150 * @param[in] S points to an instance of the Q7 FIR filter structure. 01151 * @param[in] pSrc points to the block of input data. 01152 * @param[out] pDst points to the block of output data. 01153 * @param[in] blockSize number of samples to process. 01154 */ 01155 void arm_fir_q7( 01156 const arm_fir_instance_q7 * S, 01157 q7_t * pSrc, 01158 q7_t * pDst, 01159 uint32_t blockSize); 01160 01161 01162 /** 01163 * @brief Initialization function for the Q7 FIR filter. 01164 * @param[in,out] S points to an instance of the Q7 FIR structure. 01165 * @param[in] numTaps Number of filter coefficients in the filter. 01166 * @param[in] pCoeffs points to the filter coefficients. 01167 * @param[in] pState points to the state buffer. 01168 * @param[in] blockSize number of samples that are processed. 01169 */ 01170 void arm_fir_init_q7( 01171 arm_fir_instance_q7 * S, 01172 uint16_t numTaps, 01173 q7_t * pCoeffs, 01174 q7_t * pState, 01175 uint32_t blockSize); 01176 01177 01178 /** 01179 * @brief Processing function for the Q15 FIR filter. 01180 * @param[in] S points to an instance of the Q15 FIR structure. 01181 * @param[in] pSrc points to the block of input data. 01182 * @param[out] pDst points to the block of output data. 01183 * @param[in] blockSize number of samples to process. 01184 */ 01185 void arm_fir_q15( 01186 const arm_fir_instance_q15 * S, 01187 q15_t * pSrc, 01188 q15_t * pDst, 01189 uint32_t blockSize); 01190 01191 01192 /** 01193 * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. 01194 * @param[in] S points to an instance of the Q15 FIR filter structure. 01195 * @param[in] pSrc points to the block of input data. 01196 * @param[out] pDst points to the block of output data. 01197 * @param[in] blockSize number of samples to process. 01198 */ 01199 void arm_fir_fast_q15( 01200 const arm_fir_instance_q15 * S, 01201 q15_t * pSrc, 01202 q15_t * pDst, 01203 uint32_t blockSize); 01204 01205 01206 /** 01207 * @brief Initialization function for the Q15 FIR filter. 01208 * @param[in,out] S points to an instance of the Q15 FIR filter structure. 01209 * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. 01210 * @param[in] pCoeffs points to the filter coefficients. 01211 * @param[in] pState points to the state buffer. 01212 * @param[in] blockSize number of samples that are processed at a time. 01213 * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if 01214 * <code>numTaps</code> is not a supported value. 01215 */ 01216 arm_status arm_fir_init_q15( 01217 arm_fir_instance_q15 * S, 01218 uint16_t numTaps, 01219 q15_t * pCoeffs, 01220 q15_t * pState, 01221 uint32_t blockSize); 01222 01223 01224 /** 01225 * @brief Processing function for the Q31 FIR filter. 01226 * @param[in] S points to an instance of the Q31 FIR filter structure. 01227 * @param[in] pSrc points to the block of input data. 01228 * @param[out] pDst points to the block of output data. 01229 * @param[in] blockSize number of samples to process. 01230 */ 01231 void arm_fir_q31( 01232 const arm_fir_instance_q31 * S, 01233 q31_t * pSrc, 01234 q31_t * pDst, 01235 uint32_t blockSize); 01236 01237 01238 /** 01239 * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. 01240 * @param[in] S points to an instance of the Q31 FIR structure. 01241 * @param[in] pSrc points to the block of input data. 01242 * @param[out] pDst points to the block of output data. 01243 * @param[in] blockSize number of samples to process. 01244 */ 01245 void arm_fir_fast_q31( 01246 const arm_fir_instance_q31 * S, 01247 q31_t * pSrc, 01248 q31_t * pDst, 01249 uint32_t blockSize); 01250 01251 01252 /** 01253 * @brief Initialization function for the Q31 FIR filter. 01254 * @param[in,out] S points to an instance of the Q31 FIR structure. 01255 * @param[in] numTaps Number of filter coefficients in the filter. 01256 * @param[in] pCoeffs points to the filter coefficients. 01257 * @param[in] pState points to the state buffer. 01258 * @param[in] blockSize number of samples that are processed at a time. 01259 */ 01260 void arm_fir_init_q31( 01261 arm_fir_instance_q31 * S, 01262 uint16_t numTaps, 01263 q31_t * pCoeffs, 01264 q31_t * pState, 01265 uint32_t blockSize); 01266 01267 01268 /** 01269 * @brief Processing function for the floating-point FIR filter. 01270 * @param[in] S points to an instance of the floating-point FIR structure. 01271 * @param[in] pSrc points to the block of input data. 01272 * @param[out] pDst points to the block of output data. 01273 * @param[in] blockSize number of samples to process. 01274 */ 01275 void arm_fir_f32( 01276 const arm_fir_instance_f32 * S, 01277 float32_t * pSrc, 01278 float32_t * pDst, 01279 uint32_t blockSize); 01280 01281 01282 /** 01283 * @brief Initialization function for the floating-point FIR filter. 01284 * @param[in,out] S points to an instance of the floating-point FIR filter structure. 01285 * @param[in] numTaps Number of filter coefficients in the filter. 01286 * @param[in] pCoeffs points to the filter coefficients. 01287 * @param[in] pState points to the state buffer. 01288 * @param[in] blockSize number of samples that are processed at a time. 01289 */ 01290 void arm_fir_init_f32( 01291 arm_fir_instance_f32 * S, 01292 uint16_t numTaps, 01293 float32_t * pCoeffs, 01294 float32_t * pState, 01295 uint32_t blockSize); 01296 01297 01298 /** 01299 * @brief Instance structure for the Q15 Biquad cascade filter. 01300 */ 01301 typedef struct 01302 { 01303 int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 01304 q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ 01305 q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ 01306 int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ 01307 } arm_biquad_casd_df1_inst_q15; 01308 01309 /** 01310 * @brief Instance structure for the Q31 Biquad cascade filter. 01311 */ 01312 typedef struct 01313 { 01314 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 01315 q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ 01316 q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ 01317 uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ 01318 } arm_biquad_casd_df1_inst_q31; 01319 01320 /** 01321 * @brief Instance structure for the floating-point Biquad cascade filter. 01322 */ 01323 typedef struct 01324 { 01325 uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 01326 float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ 01327 float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ 01328 } arm_biquad_casd_df1_inst_f32; 01329 01330 01331 /** 01332 * @brief Processing function for the Q15 Biquad cascade filter. 01333 * @param[in] S points to an instance of the Q15 Biquad cascade structure. 01334 * @param[in] pSrc points to the block of input data. 01335 * @param[out] pDst points to the block of output data. 01336 * @param[in] blockSize number of samples to process. 01337 */ 01338 void arm_biquad_cascade_df1_q15( 01339 const arm_biquad_casd_df1_inst_q15 * S, 01340 q15_t * pSrc, 01341 q15_t * pDst, 01342 uint32_t blockSize); 01343 01344 01345 /** 01346 * @brief Initialization function for the Q15 Biquad cascade filter. 01347 * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. 01348 * @param[in] numStages number of 2nd order stages in the filter. 01349 * @param[in] pCoeffs points to the filter coefficients. 01350 * @param[in] pState points to the state buffer. 01351 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format 01352 */ 01353 void arm_biquad_cascade_df1_init_q15( 01354 arm_biquad_casd_df1_inst_q15 * S, 01355 uint8_t numStages, 01356 q15_t * pCoeffs, 01357 q15_t * pState, 01358 int8_t postShift); 01359 01360 01361 /** 01362 * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. 01363 * @param[in] S points to an instance of the Q15 Biquad cascade structure. 01364 * @param[in] pSrc points to the block of input data. 01365 * @param[out] pDst points to the block of output data. 01366 * @param[in] blockSize number of samples to process. 01367 */ 01368 void arm_biquad_cascade_df1_fast_q15( 01369 const arm_biquad_casd_df1_inst_q15 * S, 01370 q15_t * pSrc, 01371 q15_t * pDst, 01372 uint32_t blockSize); 01373 01374 01375 /** 01376 * @brief Processing function for the Q31 Biquad cascade filter 01377 * @param[in] S points to an instance of the Q31 Biquad cascade structure. 01378 * @param[in] pSrc points to the block of input data. 01379 * @param[out] pDst points to the block of output data. 01380 * @param[in] blockSize number of samples to process. 01381 */ 01382 void arm_biquad_cascade_df1_q31( 01383 const arm_biquad_casd_df1_inst_q31 * S, 01384 q31_t * pSrc, 01385 q31_t * pDst, 01386 uint32_t blockSize); 01387 01388 01389 /** 01390 * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. 01391 * @param[in] S points to an instance of the Q31 Biquad cascade structure. 01392 * @param[in] pSrc points to the block of input data. 01393 * @param[out] pDst points to the block of output data. 01394 * @param[in] blockSize number of samples to process. 01395 */ 01396 void arm_biquad_cascade_df1_fast_q31( 01397 const arm_biquad_casd_df1_inst_q31 * S, 01398 q31_t * pSrc, 01399 q31_t * pDst, 01400 uint32_t blockSize); 01401 01402 01403 /** 01404 * @brief Initialization function for the Q31 Biquad cascade filter. 01405 * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. 01406 * @param[in] numStages number of 2nd order stages in the filter. 01407 * @param[in] pCoeffs points to the filter coefficients. 01408 * @param[in] pState points to the state buffer. 01409 * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format 01410 */ 01411 void arm_biquad_cascade_df1_init_q31( 01412 arm_biquad_casd_df1_inst_q31 * S, 01413 uint8_t numStages, 01414 q31_t * pCoeffs, 01415 q31_t * pState, 01416 int8_t postShift); 01417 01418 01419 /** 01420 * @brief Processing function for the floating-point Biquad cascade filter. 01421 * @param[in] S points to an instance of the floating-point Biquad cascade structure. 01422 * @param[in] pSrc points to the block of input data. 01423 * @param[out] pDst points to the block of output data. 01424 * @param[in] blockSize number of samples to process. 01425 */ 01426 void arm_biquad_cascade_df1_f32( 01427 const arm_biquad_casd_df1_inst_f32 * S, 01428 float32_t * pSrc, 01429 float32_t * pDst, 01430 uint32_t blockSize); 01431 01432 01433 /** 01434 * @brief Initialization function for the floating-point Biquad cascade filter. 01435 * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. 01436 * @param[in] numStages number of 2nd order stages in the filter. 01437 * @param[in] pCoeffs points to the filter coefficients. 01438 * @param[in] pState points to the state buffer. 01439 */ 01440 void arm_biquad_cascade_df1_init_f32( 01441 arm_biquad_casd_df1_inst_f32 * S, 01442 uint8_t numStages, 01443 float32_t * pCoeffs, 01444 float32_t * pState); 01445 01446 01447 /** 01448 * @brief Instance structure for the floating-point matrix structure. 01449 */ 01450 typedef struct 01451 { 01452 uint16_t numRows; /**< number of rows of the matrix. */ 01453 uint16_t numCols; /**< number of columns of the matrix. */ 01454 float32_t *pData; /**< points to the data of the matrix. */ 01455 } arm_matrix_instance_f32; 01456 01457 01458 /** 01459 * @brief Instance structure for the floating-point matrix structure. 01460 */ 01461 typedef struct 01462 { 01463 uint16_t numRows; /**< number of rows of the matrix. */ 01464 uint16_t numCols; /**< number of columns of the matrix. */ 01465 float64_t *pData; /**< points to the data of the matrix. */ 01466 } arm_matrix_instance_f64; 01467 01468 /** 01469 * @brief Instance structure for the Q15 matrix structure. 01470 */ 01471 typedef struct 01472 { 01473 uint16_t numRows; /**< number of rows of the matrix. */ 01474 uint16_t numCols; /**< number of columns of the matrix. */ 01475 q15_t *pData; /**< points to the data of the matrix. */ 01476 } arm_matrix_instance_q15; 01477 01478 /** 01479 * @brief Instance structure for the Q31 matrix structure. 01480 */ 01481 typedef struct 01482 { 01483 uint16_t numRows; /**< number of rows of the matrix. */ 01484 uint16_t numCols; /**< number of columns of the matrix. */ 01485 q31_t *pData; /**< points to the data of the matrix. */ 01486 } arm_matrix_instance_q31; 01487 01488 01489 /** 01490 * @brief Floating-point matrix addition. 01491 * @param[in] pSrcA points to the first input matrix structure 01492 * @param[in] pSrcB points to the second input matrix structure 01493 * @param[out] pDst points to output matrix structure 01494 * @return The function returns either 01495 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01496 */ 01497 arm_status arm_mat_add_f32( 01498 const arm_matrix_instance_f32 * pSrcA, 01499 const arm_matrix_instance_f32 * pSrcB, 01500 arm_matrix_instance_f32 * pDst); 01501 01502 01503 /** 01504 * @brief Q15 matrix addition. 01505 * @param[in] pSrcA points to the first input matrix structure 01506 * @param[in] pSrcB points to the second input matrix structure 01507 * @param[out] pDst points to output matrix structure 01508 * @return The function returns either 01509 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01510 */ 01511 arm_status arm_mat_add_q15( 01512 const arm_matrix_instance_q15 * pSrcA, 01513 const arm_matrix_instance_q15 * pSrcB, 01514 arm_matrix_instance_q15 * pDst); 01515 01516 01517 /** 01518 * @brief Q31 matrix addition. 01519 * @param[in] pSrcA points to the first input matrix structure 01520 * @param[in] pSrcB points to the second input matrix structure 01521 * @param[out] pDst points to output matrix structure 01522 * @return The function returns either 01523 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01524 */ 01525 arm_status arm_mat_add_q31( 01526 const arm_matrix_instance_q31 * pSrcA, 01527 const arm_matrix_instance_q31 * pSrcB, 01528 arm_matrix_instance_q31 * pDst); 01529 01530 01531 /** 01532 * @brief Floating-point, complex, matrix multiplication. 01533 * @param[in] pSrcA points to the first input matrix structure 01534 * @param[in] pSrcB points to the second input matrix structure 01535 * @param[out] pDst points to output matrix structure 01536 * @return The function returns either 01537 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01538 */ 01539 arm_status arm_mat_cmplx_mult_f32( 01540 const arm_matrix_instance_f32 * pSrcA, 01541 const arm_matrix_instance_f32 * pSrcB, 01542 arm_matrix_instance_f32 * pDst); 01543 01544 01545 /** 01546 * @brief Q15, complex, matrix multiplication. 01547 * @param[in] pSrcA points to the first input matrix structure 01548 * @param[in] pSrcB points to the second input matrix structure 01549 * @param[out] pDst points to output matrix structure 01550 * @return The function returns either 01551 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01552 */ 01553 arm_status arm_mat_cmplx_mult_q15( 01554 const arm_matrix_instance_q15 * pSrcA, 01555 const arm_matrix_instance_q15 * pSrcB, 01556 arm_matrix_instance_q15 * pDst, 01557 q15_t * pScratch); 01558 01559 01560 /** 01561 * @brief Q31, complex, matrix multiplication. 01562 * @param[in] pSrcA points to the first input matrix structure 01563 * @param[in] pSrcB points to the second input matrix structure 01564 * @param[out] pDst points to output matrix structure 01565 * @return The function returns either 01566 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01567 */ 01568 arm_status arm_mat_cmplx_mult_q31( 01569 const arm_matrix_instance_q31 * pSrcA, 01570 const arm_matrix_instance_q31 * pSrcB, 01571 arm_matrix_instance_q31 * pDst); 01572 01573 01574 /** 01575 * @brief Floating-point matrix transpose. 01576 * @param[in] pSrc points to the input matrix 01577 * @param[out] pDst points to the output matrix 01578 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> 01579 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01580 */ 01581 arm_status arm_mat_trans_f32( 01582 const arm_matrix_instance_f32 * pSrc, 01583 arm_matrix_instance_f32 * pDst); 01584 01585 01586 /** 01587 * @brief Q15 matrix transpose. 01588 * @param[in] pSrc points to the input matrix 01589 * @param[out] pDst points to the output matrix 01590 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> 01591 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01592 */ 01593 arm_status arm_mat_trans_q15( 01594 const arm_matrix_instance_q15 * pSrc, 01595 arm_matrix_instance_q15 * pDst); 01596 01597 01598 /** 01599 * @brief Q31 matrix transpose. 01600 * @param[in] pSrc points to the input matrix 01601 * @param[out] pDst points to the output matrix 01602 * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> 01603 * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01604 */ 01605 arm_status arm_mat_trans_q31( 01606 const arm_matrix_instance_q31 * pSrc, 01607 arm_matrix_instance_q31 * pDst); 01608 01609 01610 /** 01611 * @brief Floating-point matrix multiplication 01612 * @param[in] pSrcA points to the first input matrix structure 01613 * @param[in] pSrcB points to the second input matrix structure 01614 * @param[out] pDst points to output matrix structure 01615 * @return The function returns either 01616 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01617 */ 01618 arm_status arm_mat_mult_f32( 01619 const arm_matrix_instance_f32 * pSrcA, 01620 const arm_matrix_instance_f32 * pSrcB, 01621 arm_matrix_instance_f32 * pDst); 01622 01623 01624 /** 01625 * @brief Q15 matrix multiplication 01626 * @param[in] pSrcA points to the first input matrix structure 01627 * @param[in] pSrcB points to the second input matrix structure 01628 * @param[out] pDst points to output matrix structure 01629 * @param[in] pState points to the array for storing intermediate results 01630 * @return The function returns either 01631 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01632 */ 01633 arm_status arm_mat_mult_q15( 01634 const arm_matrix_instance_q15 * pSrcA, 01635 const arm_matrix_instance_q15 * pSrcB, 01636 arm_matrix_instance_q15 * pDst, 01637 q15_t * pState); 01638 01639 01640 /** 01641 * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 01642 * @param[in] pSrcA points to the first input matrix structure 01643 * @param[in] pSrcB points to the second input matrix structure 01644 * @param[out] pDst points to output matrix structure 01645 * @param[in] pState points to the array for storing intermediate results 01646 * @return The function returns either 01647 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01648 */ 01649 arm_status arm_mat_mult_fast_q15( 01650 const arm_matrix_instance_q15 * pSrcA, 01651 const arm_matrix_instance_q15 * pSrcB, 01652 arm_matrix_instance_q15 * pDst, 01653 q15_t * pState); 01654 01655 01656 /** 01657 * @brief Q31 matrix multiplication 01658 * @param[in] pSrcA points to the first input matrix structure 01659 * @param[in] pSrcB points to the second input matrix structure 01660 * @param[out] pDst points to output matrix structure 01661 * @return The function returns either 01662 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01663 */ 01664 arm_status arm_mat_mult_q31( 01665 const arm_matrix_instance_q31 * pSrcA, 01666 const arm_matrix_instance_q31 * pSrcB, 01667 arm_matrix_instance_q31 * pDst); 01668 01669 01670 /** 01671 * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 01672 * @param[in] pSrcA points to the first input matrix structure 01673 * @param[in] pSrcB points to the second input matrix structure 01674 * @param[out] pDst points to output matrix structure 01675 * @return The function returns either 01676 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01677 */ 01678 arm_status arm_mat_mult_fast_q31( 01679 const arm_matrix_instance_q31 * pSrcA, 01680 const arm_matrix_instance_q31 * pSrcB, 01681 arm_matrix_instance_q31 * pDst); 01682 01683 01684 /** 01685 * @brief Floating-point matrix subtraction 01686 * @param[in] pSrcA points to the first input matrix structure 01687 * @param[in] pSrcB points to the second input matrix structure 01688 * @param[out] pDst points to output matrix structure 01689 * @return The function returns either 01690 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01691 */ 01692 arm_status arm_mat_sub_f32( 01693 const arm_matrix_instance_f32 * pSrcA, 01694 const arm_matrix_instance_f32 * pSrcB, 01695 arm_matrix_instance_f32 * pDst); 01696 01697 01698 /** 01699 * @brief Q15 matrix subtraction 01700 * @param[in] pSrcA points to the first input matrix structure 01701 * @param[in] pSrcB points to the second input matrix structure 01702 * @param[out] pDst points to output matrix structure 01703 * @return The function returns either 01704 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01705 */ 01706 arm_status arm_mat_sub_q15( 01707 const arm_matrix_instance_q15 * pSrcA, 01708 const arm_matrix_instance_q15 * pSrcB, 01709 arm_matrix_instance_q15 * pDst); 01710 01711 01712 /** 01713 * @brief Q31 matrix subtraction 01714 * @param[in] pSrcA points to the first input matrix structure 01715 * @param[in] pSrcB points to the second input matrix structure 01716 * @param[out] pDst points to output matrix structure 01717 * @return The function returns either 01718 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01719 */ 01720 arm_status arm_mat_sub_q31( 01721 const arm_matrix_instance_q31 * pSrcA, 01722 const arm_matrix_instance_q31 * pSrcB, 01723 arm_matrix_instance_q31 * pDst); 01724 01725 01726 /** 01727 * @brief Floating-point matrix scaling. 01728 * @param[in] pSrc points to the input matrix 01729 * @param[in] scale scale factor 01730 * @param[out] pDst points to the output matrix 01731 * @return The function returns either 01732 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01733 */ 01734 arm_status arm_mat_scale_f32( 01735 const arm_matrix_instance_f32 * pSrc, 01736 float32_t scale, 01737 arm_matrix_instance_f32 * pDst); 01738 01739 01740 /** 01741 * @brief Q15 matrix scaling. 01742 * @param[in] pSrc points to input matrix 01743 * @param[in] scaleFract fractional portion of the scale factor 01744 * @param[in] shift number of bits to shift the result by 01745 * @param[out] pDst points to output matrix 01746 * @return The function returns either 01747 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01748 */ 01749 arm_status arm_mat_scale_q15( 01750 const arm_matrix_instance_q15 * pSrc, 01751 q15_t scaleFract, 01752 int32_t shift, 01753 arm_matrix_instance_q15 * pDst); 01754 01755 01756 /** 01757 * @brief Q31 matrix scaling. 01758 * @param[in] pSrc points to input matrix 01759 * @param[in] scaleFract fractional portion of the scale factor 01760 * @param[in] shift number of bits to shift the result by 01761 * @param[out] pDst points to output matrix structure 01762 * @return The function returns either 01763 * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. 01764 */ 01765 arm_status arm_mat_scale_q31( 01766 const arm_matrix_instance_q31 * pSrc, 01767 q31_t scaleFract, 01768 int32_t shift, 01769 arm_matrix_instance_q31 * pDst); 01770 01771 01772 /** 01773 * @brief Q31 matrix initialization. 01774 * @param[in,out] S points to an instance of the floating-point matrix structure. 01775 * @param[in] nRows number of rows in the matrix. 01776 * @param[in] nColumns number of columns in the matrix. 01777 * @param[in] pData points to the matrix data array. 01778 */ 01779 void arm_mat_init_q31( 01780 arm_matrix_instance_q31 * S, 01781 uint16_t nRows, 01782 uint16_t nColumns, 01783 q31_t * pData); 01784 01785 01786 /** 01787 * @brief Q15 matrix initialization. 01788 * @param[in,out] S points to an instance of the floating-point matrix structure. 01789 * @param[in] nRows number of rows in the matrix. 01790 * @param[in] nColumns number of columns in the matrix. 01791 * @param[in] pData points to the matrix data array. 01792 */ 01793 void arm_mat_init_q15( 01794 arm_matrix_instance_q15 * S, 01795 uint16_t nRows, 01796 uint16_t nColumns, 01797 q15_t * pData); 01798 01799 01800 /** 01801 * @brief Floating-point matrix initialization. 01802 * @param[in,out] S points to an instance of the floating-point matrix structure. 01803 * @param[in] nRows number of rows in the matrix. 01804 * @param[in] nColumns number of columns in the matrix. 01805 * @param[in] pData points to the matrix data array. 01806 */ 01807 void arm_mat_init_f32( 01808 arm_matrix_instance_f32 * S, 01809 uint16_t nRows, 01810 uint16_t nColumns, 01811 float32_t * pData); 01812 01813 01814 01815 /** 01816 * @brief Instance structure for the Q15 PID Control. 01817 */ 01818 typedef struct 01819 { 01820 q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ 01821 #if !defined (ARM_MATH_DSP) 01822 q15_t A1; 01823 q15_t A2; 01824 #else 01825 q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ 01826 #endif 01827 q15_t state[3]; /**< The state array of length 3. */ 01828 q15_t Kp; /**< The proportional gain. */ 01829 q15_t Ki; /**< The integral gain. */ 01830 q15_t Kd; /**< The derivative gain. */ 01831 } arm_pid_instance_q15; 01832 01833 /** 01834 * @brief Instance structure for the Q31 PID Control. 01835 */ 01836 typedef struct 01837 { 01838 q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ 01839 q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ 01840 q31_t A2; /**< The derived gain, A2 = Kd . */ 01841 q31_t state[3]; /**< The state array of length 3. */ 01842 q31_t Kp; /**< The proportional gain. */ 01843 q31_t Ki; /**< The integral gain. */ 01844 q31_t Kd; /**< The derivative gain. */ 01845 } arm_pid_instance_q31; 01846 01847 /** 01848 * @brief Instance structure for the floating-point PID Control. 01849 */ 01850 typedef struct 01851 { 01852 float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ 01853 float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ 01854 float32_t A2; /**< The derived gain, A2 = Kd . */ 01855 float32_t state[3]; /**< The state array of length 3. */ 01856 float32_t Kp; /**< The proportional gain. */ 01857 float32_t Ki; /**< The integral gain. */ 01858 float32_t Kd; /**< The derivative gain. */ 01859 } arm_pid_instance_f32; 01860 01861 01862 01863 /** 01864 * @brief Initialization function for the floating-point PID Control. 01865 * @param[in,out] S points to an instance of the PID structure. 01866 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. 01867 */ 01868 void arm_pid_init_f32( 01869 arm_pid_instance_f32 * S, 01870 int32_t resetStateFlag); 01871 01872 01873 /** 01874 * @brief Reset function for the floating-point PID Control. 01875 * @param[in,out] S is an instance of the floating-point PID Control structure 01876 */ 01877 void arm_pid_reset_f32( 01878 arm_pid_instance_f32 * S); 01879 01880 01881 /** 01882 * @brief Initialization function for the Q31 PID Control. 01883 * @param[in,out] S points to an instance of the Q15 PID structure. 01884 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. 01885 */ 01886 void arm_pid_init_q31( 01887 arm_pid_instance_q31 * S, 01888 int32_t resetStateFlag); 01889 01890 01891 /** 01892 * @brief Reset function for the Q31 PID Control. 01893 * @param[in,out] S points to an instance of the Q31 PID Control structure 01894 */ 01895 01896 void arm_pid_reset_q31( 01897 arm_pid_instance_q31 * S); 01898 01899 01900 /** 01901 * @brief Initialization function for the Q15 PID Control. 01902 * @param[in,out] S points to an instance of the Q15 PID structure. 01903 * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. 01904 */ 01905 void arm_pid_init_q15( 01906 arm_pid_instance_q15 * S, 01907 int32_t resetStateFlag); 01908 01909 01910 /** 01911 * @brief Reset function for the Q15 PID Control. 01912 * @param[in,out] S points to an instance of the q15 PID Control structure 01913 */ 01914 void arm_pid_reset_q15( 01915 arm_pid_instance_q15 * S); 01916 01917 01918 /** 01919 * @brief Instance structure for the floating-point Linear Interpolate function. 01920 */ 01921 typedef struct 01922 { 01923 uint32_t nValues; /**< nValues */ 01924 float32_t x1; /**< x1 */ 01925 float32_t xSpacing; /**< xSpacing */ 01926 float32_t *pYData; /**< pointer to the table of Y values */ 01927 } arm_linear_interp_instance_f32; 01928 01929 /** 01930 * @brief Instance structure for the floating-point bilinear interpolation function. 01931 */ 01932 typedef struct 01933 { 01934 uint16_t numRows; /**< number of rows in the data table. */ 01935 uint16_t numCols; /**< number of columns in the data table. */ 01936 float32_t *pData; /**< points to the data table. */ 01937 } arm_bilinear_interp_instance_f32; 01938 01939 /** 01940 * @brief Instance structure for the Q31 bilinear interpolation function. 01941 */ 01942 typedef struct 01943 { 01944 uint16_t numRows; /**< number of rows in the data table. */ 01945 uint16_t numCols; /**< number of columns in the data table. */ 01946 q31_t *pData; /**< points to the data table. */ 01947 } arm_bilinear_interp_instance_q31; 01948 01949 /** 01950 * @brief Instance structure for the Q15 bilinear interpolation function. 01951 */ 01952 typedef struct 01953 { 01954 uint16_t numRows; /**< number of rows in the data table. */ 01955 uint16_t numCols; /**< number of columns in the data table. */ 01956 q15_t *pData; /**< points to the data table. */ 01957 } arm_bilinear_interp_instance_q15; 01958 01959 /** 01960 * @brief Instance structure for the Q15 bilinear interpolation function. 01961 */ 01962 typedef struct 01963 { 01964 uint16_t numRows; /**< number of rows in the data table. */ 01965 uint16_t numCols; /**< number of columns in the data table. */ 01966 q7_t *pData; /**< points to the data table. */ 01967 } arm_bilinear_interp_instance_q7; 01968 01969 01970 /** 01971 * @brief Q7 vector multiplication. 01972 * @param[in] pSrcA points to the first input vector 01973 * @param[in] pSrcB points to the second input vector 01974 * @param[out] pDst points to the output vector 01975 * @param[in] blockSize number of samples in each vector 01976 */ 01977 void arm_mult_q7( 01978 q7_t * pSrcA, 01979 q7_t * pSrcB, 01980 q7_t * pDst, 01981 uint32_t blockSize); 01982 01983 01984 /** 01985 * @brief Q15 vector multiplication. 01986 * @param[in] pSrcA points to the first input vector 01987 * @param[in] pSrcB points to the second input vector 01988 * @param[out] pDst points to the output vector 01989 * @param[in] blockSize number of samples in each vector 01990 */ 01991 void arm_mult_q15( 01992 q15_t * pSrcA, 01993 q15_t * pSrcB, 01994 q15_t * pDst, 01995 uint32_t blockSize); 01996 01997 01998 /** 01999 * @brief Q31 vector multiplication. 02000 * @param[in] pSrcA points to the first input vector 02001 * @param[in] pSrcB points to the second input vector 02002 * @param[out] pDst points to the output vector 02003 * @param[in] blockSize number of samples in each vector 02004 */ 02005 void arm_mult_q31( 02006 q31_t * pSrcA, 02007 q31_t * pSrcB, 02008 q31_t * pDst, 02009 uint32_t blockSize); 02010 02011 02012 /** 02013 * @brief Floating-point vector multiplication. 02014 * @param[in] pSrcA points to the first input vector 02015 * @param[in] pSrcB points to the second input vector 02016 * @param[out] pDst points to the output vector 02017 * @param[in] blockSize number of samples in each vector 02018 */ 02019 void arm_mult_f32( 02020 float32_t * pSrcA, 02021 float32_t * pSrcB, 02022 float32_t * pDst, 02023 uint32_t blockSize); 02024 02025 02026 /** 02027 * @brief Instance structure for the Q15 CFFT/CIFFT function. 02028 */ 02029 typedef struct 02030 { 02031 uint16_t fftLen; /**< length of the FFT. */ 02032 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02033 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02034 q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ 02035 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02036 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02037 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02038 } arm_cfft_radix2_instance_q15; 02039 02040 /* Deprecated */ 02041 arm_status arm_cfft_radix2_init_q15( 02042 arm_cfft_radix2_instance_q15 * S, 02043 uint16_t fftLen, 02044 uint8_t ifftFlag, 02045 uint8_t bitReverseFlag); 02046 02047 /* Deprecated */ 02048 void arm_cfft_radix2_q15( 02049 const arm_cfft_radix2_instance_q15 * S, 02050 q15_t * pSrc); 02051 02052 02053 /** 02054 * @brief Instance structure for the Q15 CFFT/CIFFT function. 02055 */ 02056 typedef struct 02057 { 02058 uint16_t fftLen; /**< length of the FFT. */ 02059 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02060 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02061 q15_t *pTwiddle; /**< points to the twiddle factor table. */ 02062 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02063 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02064 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02065 } arm_cfft_radix4_instance_q15; 02066 02067 /* Deprecated */ 02068 arm_status arm_cfft_radix4_init_q15( 02069 arm_cfft_radix4_instance_q15 * S, 02070 uint16_t fftLen, 02071 uint8_t ifftFlag, 02072 uint8_t bitReverseFlag); 02073 02074 /* Deprecated */ 02075 void arm_cfft_radix4_q15( 02076 const arm_cfft_radix4_instance_q15 * S, 02077 q15_t * pSrc); 02078 02079 /** 02080 * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. 02081 */ 02082 typedef struct 02083 { 02084 uint16_t fftLen; /**< length of the FFT. */ 02085 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02086 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02087 q31_t *pTwiddle; /**< points to the Twiddle factor table. */ 02088 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02089 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02090 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02091 } arm_cfft_radix2_instance_q31; 02092 02093 /* Deprecated */ 02094 arm_status arm_cfft_radix2_init_q31( 02095 arm_cfft_radix2_instance_q31 * S, 02096 uint16_t fftLen, 02097 uint8_t ifftFlag, 02098 uint8_t bitReverseFlag); 02099 02100 /* Deprecated */ 02101 void arm_cfft_radix2_q31( 02102 const arm_cfft_radix2_instance_q31 * S, 02103 q31_t * pSrc); 02104 02105 /** 02106 * @brief Instance structure for the Q31 CFFT/CIFFT function. 02107 */ 02108 typedef struct 02109 { 02110 uint16_t fftLen; /**< length of the FFT. */ 02111 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02112 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02113 q31_t *pTwiddle; /**< points to the twiddle factor table. */ 02114 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02115 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02116 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02117 } arm_cfft_radix4_instance_q31; 02118 02119 /* Deprecated */ 02120 void arm_cfft_radix4_q31( 02121 const arm_cfft_radix4_instance_q31 * S, 02122 q31_t * pSrc); 02123 02124 /* Deprecated */ 02125 arm_status arm_cfft_radix4_init_q31( 02126 arm_cfft_radix4_instance_q31 * S, 02127 uint16_t fftLen, 02128 uint8_t ifftFlag, 02129 uint8_t bitReverseFlag); 02130 02131 /** 02132 * @brief Instance structure for the floating-point CFFT/CIFFT function. 02133 */ 02134 typedef struct 02135 { 02136 uint16_t fftLen; /**< length of the FFT. */ 02137 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02138 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02139 float32_t *pTwiddle; /**< points to the Twiddle factor table. */ 02140 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02141 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02142 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02143 float32_t onebyfftLen; /**< value of 1/fftLen. */ 02144 } arm_cfft_radix2_instance_f32; 02145 02146 /* Deprecated */ 02147 arm_status arm_cfft_radix2_init_f32( 02148 arm_cfft_radix2_instance_f32 * S, 02149 uint16_t fftLen, 02150 uint8_t ifftFlag, 02151 uint8_t bitReverseFlag); 02152 02153 /* Deprecated */ 02154 void arm_cfft_radix2_f32( 02155 const arm_cfft_radix2_instance_f32 * S, 02156 float32_t * pSrc); 02157 02158 /** 02159 * @brief Instance structure for the floating-point CFFT/CIFFT function. 02160 */ 02161 typedef struct 02162 { 02163 uint16_t fftLen; /**< length of the FFT. */ 02164 uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ 02165 uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ 02166 float32_t *pTwiddle; /**< points to the Twiddle factor table. */ 02167 uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02168 uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02169 uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ 02170 float32_t onebyfftLen; /**< value of 1/fftLen. */ 02171 } arm_cfft_radix4_instance_f32; 02172 02173 /* Deprecated */ 02174 arm_status arm_cfft_radix4_init_f32( 02175 arm_cfft_radix4_instance_f32 * S, 02176 uint16_t fftLen, 02177 uint8_t ifftFlag, 02178 uint8_t bitReverseFlag); 02179 02180 /* Deprecated */ 02181 void arm_cfft_radix4_f32( 02182 const arm_cfft_radix4_instance_f32 * S, 02183 float32_t * pSrc); 02184 02185 /** 02186 * @brief Instance structure for the fixed-point CFFT/CIFFT function. 02187 */ 02188 typedef struct 02189 { 02190 uint16_t fftLen; /**< length of the FFT. */ 02191 const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ 02192 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02193 uint16_t bitRevLength; /**< bit reversal table length. */ 02194 } arm_cfft_instance_q15; 02195 02196 void arm_cfft_q15( 02197 const arm_cfft_instance_q15 * S, 02198 q15_t * p1, 02199 uint8_t ifftFlag, 02200 uint8_t bitReverseFlag); 02201 02202 /** 02203 * @brief Instance structure for the fixed-point CFFT/CIFFT function. 02204 */ 02205 typedef struct 02206 { 02207 uint16_t fftLen; /**< length of the FFT. */ 02208 const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ 02209 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02210 uint16_t bitRevLength; /**< bit reversal table length. */ 02211 } arm_cfft_instance_q31; 02212 02213 void arm_cfft_q31( 02214 const arm_cfft_instance_q31 * S, 02215 q31_t * p1, 02216 uint8_t ifftFlag, 02217 uint8_t bitReverseFlag); 02218 02219 /** 02220 * @brief Instance structure for the floating-point CFFT/CIFFT function. 02221 */ 02222 typedef struct 02223 { 02224 uint16_t fftLen; /**< length of the FFT. */ 02225 const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ 02226 const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ 02227 uint16_t bitRevLength; /**< bit reversal table length. */ 02228 } arm_cfft_instance_f32; 02229 02230 void arm_cfft_f32( 02231 const arm_cfft_instance_f32 * S, 02232 float32_t * p1, 02233 uint8_t ifftFlag, 02234 uint8_t bitReverseFlag); 02235 02236 /** 02237 * @brief Instance structure for the Q15 RFFT/RIFFT function. 02238 */ 02239 typedef struct 02240 { 02241 uint32_t fftLenReal; /**< length of the real FFT. */ 02242 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ 02243 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ 02244 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02245 q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ 02246 q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ 02247 const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ 02248 } arm_rfft_instance_q15; 02249 02250 arm_status arm_rfft_init_q15( 02251 arm_rfft_instance_q15 * S, 02252 uint32_t fftLenReal, 02253 uint32_t ifftFlagR, 02254 uint32_t bitReverseFlag); 02255 02256 void arm_rfft_q15( 02257 const arm_rfft_instance_q15 * S, 02258 q15_t * pSrc, 02259 q15_t * pDst); 02260 02261 /** 02262 * @brief Instance structure for the Q31 RFFT/RIFFT function. 02263 */ 02264 typedef struct 02265 { 02266 uint32_t fftLenReal; /**< length of the real FFT. */ 02267 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ 02268 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ 02269 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02270 q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ 02271 q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ 02272 const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ 02273 } arm_rfft_instance_q31; 02274 02275 arm_status arm_rfft_init_q31( 02276 arm_rfft_instance_q31 * S, 02277 uint32_t fftLenReal, 02278 uint32_t ifftFlagR, 02279 uint32_t bitReverseFlag); 02280 02281 void arm_rfft_q31( 02282 const arm_rfft_instance_q31 * S, 02283 q31_t * pSrc, 02284 q31_t * pDst); 02285 02286 /** 02287 * @brief Instance structure for the floating-point RFFT/RIFFT function. 02288 */ 02289 typedef struct 02290 { 02291 uint32_t fftLenReal; /**< length of the real FFT. */ 02292 uint16_t fftLenBy2; /**< length of the complex FFT. */ 02293 uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ 02294 uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ 02295 uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ 02296 float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ 02297 float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ 02298 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ 02299 } arm_rfft_instance_f32; 02300 02301 arm_status arm_rfft_init_f32( 02302 arm_rfft_instance_f32 * S, 02303 arm_cfft_radix4_instance_f32 * S_CFFT, 02304 uint32_t fftLenReal, 02305 uint32_t ifftFlagR, 02306 uint32_t bitReverseFlag); 02307 02308 void arm_rfft_f32( 02309 const arm_rfft_instance_f32 * S, 02310 float32_t * pSrc, 02311 float32_t * pDst); 02312 02313 /** 02314 * @brief Instance structure for the floating-point RFFT/RIFFT function. 02315 */ 02316 typedef struct 02317 { 02318 arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ 02319 uint16_t fftLenRFFT; /**< length of the real sequence */ 02320 float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ 02321 } arm_rfft_fast_instance_f32 ; 02322 02323 arm_status arm_rfft_fast_init_f32 ( 02324 arm_rfft_fast_instance_f32 * S, 02325 uint16_t fftLen); 02326 02327 void arm_rfft_fast_f32( 02328 arm_rfft_fast_instance_f32 * S, 02329 float32_t * p, float32_t * pOut, 02330 uint8_t ifftFlag); 02331 02332 /** 02333 * @brief Instance structure for the floating-point DCT4/IDCT4 function. 02334 */ 02335 typedef struct 02336 { 02337 uint16_t N; /**< length of the DCT4. */ 02338 uint16_t Nby2; /**< half of the length of the DCT4. */ 02339 float32_t normalize; /**< normalizing factor. */ 02340 float32_t *pTwiddle; /**< points to the twiddle factor table. */ 02341 float32_t *pCosFactor; /**< points to the cosFactor table. */ 02342 arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ 02343 arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ 02344 } arm_dct4_instance_f32; 02345 02346 02347 /** 02348 * @brief Initialization function for the floating-point DCT4/IDCT4. 02349 * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. 02350 * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. 02351 * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. 02352 * @param[in] N length of the DCT4. 02353 * @param[in] Nby2 half of the length of the DCT4. 02354 * @param[in] normalize normalizing factor. 02355 * @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. 02356 */ 02357 arm_status arm_dct4_init_f32( 02358 arm_dct4_instance_f32 * S, 02359 arm_rfft_instance_f32 * S_RFFT, 02360 arm_cfft_radix4_instance_f32 * S_CFFT, 02361 uint16_t N, 02362 uint16_t Nby2, 02363 float32_t normalize); 02364 02365 02366 /** 02367 * @brief Processing function for the floating-point DCT4/IDCT4. 02368 * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. 02369 * @param[in] pState points to state buffer. 02370 * @param[in,out] pInlineBuffer points to the in-place input and output buffer. 02371 */ 02372 void arm_dct4_f32( 02373 const arm_dct4_instance_f32 * S, 02374 float32_t * pState, 02375 float32_t * pInlineBuffer); 02376 02377 02378 /** 02379 * @brief Instance structure for the Q31 DCT4/IDCT4 function. 02380 */ 02381 typedef struct 02382 { 02383 uint16_t N; /**< length of the DCT4. */ 02384 uint16_t Nby2; /**< half of the length of the DCT4. */ 02385 q31_t normalize; /**< normalizing factor. */ 02386 q31_t *pTwiddle; /**< points to the twiddle factor table. */ 02387 q31_t *pCosFactor; /**< points to the cosFactor table. */ 02388 arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ 02389 arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ 02390 } arm_dct4_instance_q31; 02391 02392 02393 /** 02394 * @brief Initialization function for the Q31 DCT4/IDCT4. 02395 * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. 02396 * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure 02397 * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure 02398 * @param[in] N length of the DCT4. 02399 * @param[in] Nby2 half of the length of the DCT4. 02400 * @param[in] normalize normalizing factor. 02401 * @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. 02402 */ 02403 arm_status arm_dct4_init_q31( 02404 arm_dct4_instance_q31 * S, 02405 arm_rfft_instance_q31 * S_RFFT, 02406 arm_cfft_radix4_instance_q31 * S_CFFT, 02407 uint16_t N, 02408 uint16_t Nby2, 02409 q31_t normalize); 02410 02411 02412 /** 02413 * @brief Processing function for the Q31 DCT4/IDCT4. 02414 * @param[in] S points to an instance of the Q31 DCT4 structure. 02415 * @param[in] pState points to state buffer. 02416 * @param[in,out] pInlineBuffer points to the in-place input and output buffer. 02417 */ 02418 void arm_dct4_q31( 02419 const arm_dct4_instance_q31 * S, 02420 q31_t * pState, 02421 q31_t * pInlineBuffer); 02422 02423 02424 /** 02425 * @brief Instance structure for the Q15 DCT4/IDCT4 function. 02426 */ 02427 typedef struct 02428 { 02429 uint16_t N; /**< length of the DCT4. */ 02430 uint16_t Nby2; /**< half of the length of the DCT4. */ 02431 q15_t normalize; /**< normalizing factor. */ 02432 q15_t *pTwiddle; /**< points to the twiddle factor table. */ 02433 q15_t *pCosFactor; /**< points to the cosFactor table. */ 02434 arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ 02435 arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ 02436 } arm_dct4_instance_q15; 02437 02438 02439 /** 02440 * @brief Initialization function for the Q15 DCT4/IDCT4. 02441 * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. 02442 * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. 02443 * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. 02444 * @param[in] N length of the DCT4. 02445 * @param[in] Nby2 half of the length of the DCT4. 02446 * @param[in] normalize normalizing factor. 02447 * @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. 02448 */ 02449 arm_status arm_dct4_init_q15( 02450 arm_dct4_instance_q15 * S, 02451 arm_rfft_instance_q15 * S_RFFT, 02452 arm_cfft_radix4_instance_q15 * S_CFFT, 02453 uint16_t N, 02454 uint16_t Nby2, 02455 q15_t normalize); 02456 02457 02458 /** 02459 * @brief Processing function for the Q15 DCT4/IDCT4. 02460 * @param[in] S points to an instance of the Q15 DCT4 structure. 02461 * @param[in] pState points to state buffer. 02462 * @param[in,out] pInlineBuffer points to the in-place input and output buffer. 02463 */ 02464 void arm_dct4_q15( 02465 const arm_dct4_instance_q15 * S, 02466 q15_t * pState, 02467 q15_t * pInlineBuffer); 02468 02469 02470 /** 02471 * @brief Floating-point vector addition. 02472 * @param[in] pSrcA points to the first input vector 02473 * @param[in] pSrcB points to the second input vector 02474 * @param[out] pDst points to the output vector 02475 * @param[in] blockSize number of samples in each vector 02476 */ 02477 void arm_add_f32( 02478 float32_t * pSrcA, 02479 float32_t * pSrcB, 02480 float32_t * pDst, 02481 uint32_t blockSize); 02482 02483 02484 /** 02485 * @brief Q7 vector addition. 02486 * @param[in] pSrcA points to the first input vector 02487 * @param[in] pSrcB points to the second input vector 02488 * @param[out] pDst points to the output vector 02489 * @param[in] blockSize number of samples in each vector 02490 */ 02491 void arm_add_q7( 02492 q7_t * pSrcA, 02493 q7_t * pSrcB, 02494 q7_t * pDst, 02495 uint32_t blockSize); 02496 02497 02498 /** 02499 * @brief Q15 vector addition. 02500 * @param[in] pSrcA points to the first input vector 02501 * @param[in] pSrcB points to the second input vector 02502 * @param[out] pDst points to the output vector 02503 * @param[in] blockSize number of samples in each vector 02504 */ 02505 void arm_add_q15( 02506 q15_t * pSrcA, 02507 q15_t * pSrcB, 02508 q15_t * pDst, 02509 uint32_t blockSize); 02510 02511 02512 /** 02513 * @brief Q31 vector addition. 02514 * @param[in] pSrcA points to the first input vector 02515 * @param[in] pSrcB points to the second input vector 02516 * @param[out] pDst points to the output vector 02517 * @param[in] blockSize number of samples in each vector 02518 */ 02519 void arm_add_q31( 02520 q31_t * pSrcA, 02521 q31_t * pSrcB, 02522 q31_t * pDst, 02523 uint32_t blockSize); 02524 02525 02526 /** 02527 * @brief Floating-point vector subtraction. 02528 * @param[in] pSrcA points to the first input vector 02529 * @param[in] pSrcB points to the second input vector 02530 * @param[out] pDst points to the output vector 02531 * @param[in] blockSize number of samples in each vector 02532 */ 02533 void arm_sub_f32( 02534 float32_t * pSrcA, 02535 float32_t * pSrcB, 02536 float32_t * pDst, 02537 uint32_t blockSize); 02538 02539 02540 /** 02541 * @brief Q7 vector subtraction. 02542 * @param[in] pSrcA points to the first input vector 02543 * @param[in] pSrcB points to the second input vector 02544 * @param[out] pDst points to the output vector 02545 * @param[in] blockSize number of samples in each vector 02546 */ 02547 void arm_sub_q7( 02548 q7_t * pSrcA, 02549 q7_t * pSrcB, 02550 q7_t * pDst, 02551 uint32_t blockSize); 02552 02553 02554 /** 02555 * @brief Q15 vector subtraction. 02556 * @param[in] pSrcA points to the first input vector 02557 * @param[in] pSrcB points to the second input vector 02558 * @param[out] pDst points to the output vector 02559 * @param[in] blockSize number of samples in each vector 02560 */ 02561 void arm_sub_q15( 02562 q15_t * pSrcA, 02563 q15_t * pSrcB, 02564 q15_t * pDst, 02565 uint32_t blockSize); 02566 02567 02568 /** 02569 * @brief Q31 vector subtraction. 02570 * @param[in] pSrcA points to the first input vector 02571 * @param[in] pSrcB points to the second input vector 02572 * @param[out] pDst points to the output vector 02573 * @param[in] blockSize number of samples in each vector 02574 */ 02575 void arm_sub_q31( 02576 q31_t * pSrcA, 02577 q31_t * pSrcB, 02578 q31_t * pDst, 02579 uint32_t blockSize); 02580 02581 02582 /** 02583 * @brief Multiplies a floating-point vector by a scalar. 02584 * @param[in] pSrc points to the input vector 02585 * @param[in] scale scale factor to be applied 02586 * @param[out] pDst points to the output vector 02587 * @param[in] blockSize number of samples in the vector 02588 */ 02589 void arm_scale_f32( 02590 float32_t * pSrc, 02591 float32_t scale, 02592 float32_t * pDst, 02593 uint32_t blockSize); 02594 02595 02596 /** 02597 * @brief Multiplies a Q7 vector by a scalar. 02598 * @param[in] pSrc points to the input vector 02599 * @param[in] scaleFract fractional portion of the scale value 02600 * @param[in] shift number of bits to shift the result by 02601 * @param[out] pDst points to the output vector 02602 * @param[in] blockSize number of samples in the vector 02603 */ 02604 void arm_scale_q7( 02605 q7_t * pSrc, 02606 q7_t scaleFract, 02607 int8_t shift, 02608 q7_t * pDst, 02609 uint32_t blockSize); 02610 02611 02612 /** 02613 * @brief Multiplies a Q15 vector by a scalar. 02614 * @param[in] pSrc points to the input vector 02615 * @param[in] scaleFract fractional portion of the scale value 02616 * @param[in] shift number of bits to shift the result by 02617 * @param[out] pDst points to the output vector 02618 * @param[in] blockSize number of samples in the vector 02619 */ 02620 void arm_scale_q15( 02621 q15_t * pSrc, 02622 q15_t scaleFract, 02623 int8_t shift, 02624 q15_t * pDst, 02625 uint32_t blockSize); 02626 02627 02628 /** 02629 * @brief Multiplies a Q31 vector by a scalar. 02630 * @param[in] pSrc points to the input vector 02631 * @param[in] scaleFract fractional portion of the scale value 02632 * @param[in] shift number of bits to shift the result by 02633 * @param[out] pDst points to the output vector 02634 * @param[in] blockSize number of samples in the vector 02635 */ 02636 void arm_scale_q31( 02637 q31_t * pSrc, 02638 q31_t scaleFract, 02639 int8_t shift, 02640 q31_t * pDst, 02641 uint32_t blockSize); 02642 02643 02644 /** 02645 * @brief Q7 vector absolute value. 02646 * @param[in] pSrc points to the input buffer 02647 * @param[out] pDst points to the output buffer 02648 * @param[in] blockSize number of samples in each vector 02649 */ 02650 void arm_abs_q7( 02651 q7_t * pSrc, 02652 q7_t * pDst, 02653 uint32_t blockSize); 02654 02655 02656 /** 02657 * @brief Floating-point vector absolute value. 02658 * @param[in] pSrc points to the input buffer 02659 * @param[out] pDst points to the output buffer 02660 * @param[in] blockSize number of samples in each vector 02661 */ 02662 void arm_abs_f32( 02663 float32_t * pSrc, 02664 float32_t * pDst, 02665 uint32_t blockSize); 02666 02667 02668 /** 02669 * @brief Q15 vector absolute value. 02670 * @param[in] pSrc points to the input buffer 02671 * @param[out] pDst points to the output buffer 02672 * @param[in] blockSize number of samples in each vector 02673 */ 02674 void arm_abs_q15( 02675 q15_t * pSrc, 02676 q15_t * pDst, 02677 uint32_t blockSize); 02678 02679 02680 /** 02681 * @brief Q31 vector absolute value. 02682 * @param[in] pSrc points to the input buffer 02683 * @param[out] pDst points to the output buffer 02684 * @param[in] blockSize number of samples in each vector 02685 */ 02686 void arm_abs_q31( 02687 q31_t * pSrc, 02688 q31_t * pDst, 02689 uint32_t blockSize); 02690 02691 02692 /** 02693 * @brief Dot product of floating-point vectors. 02694 * @param[in] pSrcA points to the first input vector 02695 * @param[in] pSrcB points to the second input vector 02696 * @param[in] blockSize number of samples in each vector 02697 * @param[out] result output result returned here 02698 */ 02699 void arm_dot_prod_f32( 02700 float32_t * pSrcA, 02701 float32_t * pSrcB, 02702 uint32_t blockSize, 02703 float32_t * result); 02704 02705 02706 /** 02707 * @brief Dot product of Q7 vectors. 02708 * @param[in] pSrcA points to the first input vector 02709 * @param[in] pSrcB points to the second input vector 02710 * @param[in] blockSize number of samples in each vector 02711 * @param[out] result output result returned here 02712 */ 02713 void arm_dot_prod_q7( 02714 q7_t * pSrcA, 02715 q7_t * pSrcB, 02716 uint32_t blockSize, 02717 q31_t * result); 02718 02719 02720 /** 02721 * @brief Dot product of Q15 vectors. 02722 * @param[in] pSrcA points to the first input vector 02723 * @param[in] pSrcB points to the second input vector 02724 * @param[in] blockSize number of samples in each vector 02725 * @param[out] result output result returned here 02726 */ 02727 void arm_dot_prod_q15( 02728 q15_t * pSrcA, 02729 q15_t * pSrcB, 02730 uint32_t blockSize, 02731 q63_t * result); 02732 02733 02734 /** 02735 * @brief Dot product of Q31 vectors. 02736 * @param[in] pSrcA points to the first input vector 02737 * @param[in] pSrcB points to the second input vector 02738 * @param[in] blockSize number of samples in each vector 02739 * @param[out] result output result returned here 02740 */ 02741 void arm_dot_prod_q31( 02742 q31_t * pSrcA, 02743 q31_t * pSrcB, 02744 uint32_t blockSize, 02745 q63_t * result); 02746 02747 02748 /** 02749 * @brief Shifts the elements of a Q7 vector a specified number of bits. 02750 * @param[in] pSrc points to the input vector 02751 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. 02752 * @param[out] pDst points to the output vector 02753 * @param[in] blockSize number of samples in the vector 02754 */ 02755 void arm_shift_q7( 02756 q7_t * pSrc, 02757 int8_t shiftBits, 02758 q7_t * pDst, 02759 uint32_t blockSize); 02760 02761 02762 /** 02763 * @brief Shifts the elements of a Q15 vector a specified number of bits. 02764 * @param[in] pSrc points to the input vector 02765 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. 02766 * @param[out] pDst points to the output vector 02767 * @param[in] blockSize number of samples in the vector 02768 */ 02769 void arm_shift_q15( 02770 q15_t * pSrc, 02771 int8_t shiftBits, 02772 q15_t * pDst, 02773 uint32_t blockSize); 02774 02775 02776 /** 02777 * @brief Shifts the elements of a Q31 vector a specified number of bits. 02778 * @param[in] pSrc points to the input vector 02779 * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. 02780 * @param[out] pDst points to the output vector 02781 * @param[in] blockSize number of samples in the vector 02782 */ 02783 void arm_shift_q31( 02784 q31_t * pSrc, 02785 int8_t shiftBits, 02786 q31_t * pDst, 02787 uint32_t blockSize); 02788 02789 02790 /** 02791 * @brief Adds a constant offset to a floating-point vector. 02792 * @param[in] pSrc points to the input vector 02793 * @param[in] offset is the offset to be added 02794 * @param[out] pDst points to the output vector 02795 * @param[in] blockSize number of samples in the vector 02796 */ 02797 void arm_offset_f32( 02798 float32_t * pSrc, 02799 float32_t offset, 02800 float32_t * pDst, 02801 uint32_t blockSize); 02802 02803 02804 /** 02805 * @brief Adds a constant offset to a Q7 vector. 02806 * @param[in] pSrc points to the input vector 02807 * @param[in] offset is the offset to be added 02808 * @param[out] pDst points to the output vector 02809 * @param[in] blockSize number of samples in the vector 02810 */ 02811 void arm_offset_q7( 02812 q7_t * pSrc, 02813 q7_t offset, 02814 q7_t * pDst, 02815 uint32_t blockSize); 02816 02817 02818 /** 02819 * @brief Adds a constant offset to a Q15 vector. 02820 * @param[in] pSrc points to the input vector 02821 * @param[in] offset is the offset to be added 02822 * @param[out] pDst points to the output vector 02823 * @param[in] blockSize number of samples in the vector 02824 */ 02825 void arm_offset_q15( 02826 q15_t * pSrc, 02827 q15_t offset, 02828 q15_t * pDst, 02829 uint32_t blockSize); 02830 02831 02832 /** 02833 * @brief Adds a constant offset to a Q31 vector. 02834 * @param[in] pSrc points to the input vector 02835 * @param[in] offset is the offset to be added 02836 * @param[out] pDst points to the output vector 02837 * @param[in] blockSize number of samples in the vector 02838 */ 02839 void arm_offset_q31( 02840 q31_t * pSrc, 02841 q31_t offset, 02842 q31_t * pDst, 02843 uint32_t blockSize); 02844 02845 02846 /** 02847 * @brief Negates the elements of a floating-point vector. 02848 * @param[in] pSrc points to the input vector 02849 * @param[out] pDst points to the output vector 02850 * @param[in] blockSize number of samples in the vector 02851 */ 02852 void arm_negate_f32( 02853 float32_t * pSrc, 02854 float32_t * pDst, 02855 uint32_t blockSize); 02856 02857 02858 /** 02859 * @brief Negates the elements of a Q7 vector. 02860 * @param[in] pSrc points to the input vector 02861 * @param[out] pDst points to the output vector 02862 * @param[in] blockSize number of samples in the vector 02863 */ 02864 void arm_negate_q7( 02865 q7_t * pSrc, 02866 q7_t * pDst, 02867 uint32_t blockSize); 02868 02869 02870 /** 02871 * @brief Negates the elements of a Q15 vector. 02872 * @param[in] pSrc points to the input vector 02873 * @param[out] pDst points to the output vector 02874 * @param[in] blockSize number of samples in the vector 02875 */ 02876 void arm_negate_q15( 02877 q15_t * pSrc, 02878 q15_t * pDst, 02879 uint32_t blockSize); 02880 02881 02882 /** 02883 * @brief Negates the elements of a Q31 vector. 02884 * @param[in] pSrc points to the input vector 02885 * @param[out] pDst points to the output vector 02886 * @param[in] blockSize number of samples in the vector 02887 */ 02888 void arm_negate_q31( 02889 q31_t * pSrc, 02890 q31_t * pDst, 02891 uint32_t blockSize); 02892 02893 02894 /** 02895 * @brief Copies the elements of a floating-point vector. 02896 * @param[in] pSrc input pointer 02897 * @param[out] pDst output pointer 02898 * @param[in] blockSize number of samples to process 02899 */ 02900 void arm_copy_f32( 02901 float32_t * pSrc, 02902 float32_t * pDst, 02903 uint32_t blockSize); 02904 02905 02906 /** 02907 * @brief Copies the elements of a Q7 vector. 02908 * @param[in] pSrc input pointer 02909 * @param[out] pDst output pointer 02910 * @param[in] blockSize number of samples to process 02911 */ 02912 void arm_copy_q7( 02913 q7_t * pSrc, 02914 q7_t * pDst, 02915 uint32_t blockSize); 02916 02917 02918 /** 02919 * @brief Copies the elements of a Q15 vector. 02920 * @param[in] pSrc input pointer 02921 * @param[out] pDst output pointer 02922 * @param[in] blockSize number of samples to process 02923 */ 02924 void arm_copy_q15( 02925 q15_t * pSrc, 02926 q15_t * pDst, 02927 uint32_t blockSize); 02928 02929 02930 /** 02931 * @brief Copies the elements of a Q31 vector. 02932 * @param[in] pSrc input pointer 02933 * @param[out] pDst output pointer 02934 * @param[in] blockSize number of samples to process 02935 */ 02936 void arm_copy_q31( 02937 q31_t * pSrc, 02938 q31_t * pDst, 02939 uint32_t blockSize); 02940 02941 02942 /** 02943 * @brief Fills a constant value into a floating-point vector. 02944 * @param[in] value input value to be filled 02945 * @param[out] pDst output pointer 02946 * @param[in] blockSize number of samples to process 02947 */ 02948 void arm_fill_f32( 02949 float32_t value, 02950 float32_t * pDst, 02951 uint32_t blockSize); 02952 02953 02954 /** 02955 * @brief Fills a constant value into a Q7 vector. 02956 * @param[in] value input value to be filled 02957 * @param[out] pDst output pointer 02958 * @param[in] blockSize number of samples to process 02959 */ 02960 void arm_fill_q7( 02961 q7_t value, 02962 q7_t * pDst, 02963 uint32_t blockSize); 02964 02965 02966 /** 02967 * @brief Fills a constant value into a Q15 vector. 02968 * @param[in] value input value to be filled 02969 * @param[out] pDst output pointer 02970 * @param[in] blockSize number of samples to process 02971 */ 02972 void arm_fill_q15( 02973 q15_t value, 02974 q15_t * pDst, 02975 uint32_t blockSize); 02976 02977 02978 /** 02979 * @brief Fills a constant value into a Q31 vector. 02980 * @param[in] value input value to be filled 02981 * @param[out] pDst output pointer 02982 * @param[in] blockSize number of samples to process 02983 */ 02984 void arm_fill_q31( 02985 q31_t value, 02986 q31_t * pDst, 02987 uint32_t blockSize); 02988 02989 02990 /** 02991 * @brief Convolution of floating-point sequences. 02992 * @param[in] pSrcA points to the first input sequence. 02993 * @param[in] srcALen length of the first input sequence. 02994 * @param[in] pSrcB points to the second input sequence. 02995 * @param[in] srcBLen length of the second input sequence. 02996 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. 02997 */ 02998 void arm_conv_f32( 02999 float32_t * pSrcA, 03000 uint32_t srcALen, 03001 float32_t * pSrcB, 03002 uint32_t srcBLen, 03003 float32_t * pDst); 03004 03005 03006 /** 03007 * @brief Convolution of Q15 sequences. 03008 * @param[in] pSrcA points to the first input sequence. 03009 * @param[in] srcALen length of the first input sequence. 03010 * @param[in] pSrcB points to the second input sequence. 03011 * @param[in] srcBLen length of the second input sequence. 03012 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03013 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03014 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). 03015 */ 03016 void arm_conv_opt_q15( 03017 q15_t * pSrcA, 03018 uint32_t srcALen, 03019 q15_t * pSrcB, 03020 uint32_t srcBLen, 03021 q15_t * pDst, 03022 q15_t * pScratch1, 03023 q15_t * pScratch2); 03024 03025 03026 /** 03027 * @brief Convolution of Q15 sequences. 03028 * @param[in] pSrcA points to the first input sequence. 03029 * @param[in] srcALen length of the first input sequence. 03030 * @param[in] pSrcB points to the second input sequence. 03031 * @param[in] srcBLen length of the second input sequence. 03032 * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. 03033 */ 03034 void arm_conv_q15( 03035 q15_t * pSrcA, 03036 uint32_t srcALen, 03037 q15_t * pSrcB, 03038 uint32_t srcBLen, 03039 q15_t * pDst); 03040 03041 03042 /** 03043 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 03044 * @param[in] pSrcA points to the first input sequence. 03045 * @param[in] srcALen length of the first input sequence. 03046 * @param[in] pSrcB points to the second input sequence. 03047 * @param[in] srcBLen length of the second input sequence. 03048 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03049 */ 03050 void arm_conv_fast_q15( 03051 q15_t * pSrcA, 03052 uint32_t srcALen, 03053 q15_t * pSrcB, 03054 uint32_t srcBLen, 03055 q15_t * pDst); 03056 03057 03058 /** 03059 * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 03060 * @param[in] pSrcA points to the first input sequence. 03061 * @param[in] srcALen length of the first input sequence. 03062 * @param[in] pSrcB points to the second input sequence. 03063 * @param[in] srcBLen length of the second input sequence. 03064 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03065 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03066 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). 03067 */ 03068 void arm_conv_fast_opt_q15( 03069 q15_t * pSrcA, 03070 uint32_t srcALen, 03071 q15_t * pSrcB, 03072 uint32_t srcBLen, 03073 q15_t * pDst, 03074 q15_t * pScratch1, 03075 q15_t * pScratch2); 03076 03077 03078 /** 03079 * @brief Convolution of Q31 sequences. 03080 * @param[in] pSrcA points to the first input sequence. 03081 * @param[in] srcALen length of the first input sequence. 03082 * @param[in] pSrcB points to the second input sequence. 03083 * @param[in] srcBLen length of the second input sequence. 03084 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03085 */ 03086 void arm_conv_q31( 03087 q31_t * pSrcA, 03088 uint32_t srcALen, 03089 q31_t * pSrcB, 03090 uint32_t srcBLen, 03091 q31_t * pDst); 03092 03093 03094 /** 03095 * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 03096 * @param[in] pSrcA points to the first input sequence. 03097 * @param[in] srcALen length of the first input sequence. 03098 * @param[in] pSrcB points to the second input sequence. 03099 * @param[in] srcBLen length of the second input sequence. 03100 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03101 */ 03102 void arm_conv_fast_q31( 03103 q31_t * pSrcA, 03104 uint32_t srcALen, 03105 q31_t * pSrcB, 03106 uint32_t srcBLen, 03107 q31_t * pDst); 03108 03109 03110 /** 03111 * @brief Convolution of Q7 sequences. 03112 * @param[in] pSrcA points to the first input sequence. 03113 * @param[in] srcALen length of the first input sequence. 03114 * @param[in] pSrcB points to the second input sequence. 03115 * @param[in] srcBLen length of the second input sequence. 03116 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03117 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03118 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). 03119 */ 03120 void arm_conv_opt_q7( 03121 q7_t * pSrcA, 03122 uint32_t srcALen, 03123 q7_t * pSrcB, 03124 uint32_t srcBLen, 03125 q7_t * pDst, 03126 q15_t * pScratch1, 03127 q15_t * pScratch2); 03128 03129 03130 /** 03131 * @brief Convolution of Q7 sequences. 03132 * @param[in] pSrcA points to the first input sequence. 03133 * @param[in] srcALen length of the first input sequence. 03134 * @param[in] pSrcB points to the second input sequence. 03135 * @param[in] srcBLen length of the second input sequence. 03136 * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. 03137 */ 03138 void arm_conv_q7( 03139 q7_t * pSrcA, 03140 uint32_t srcALen, 03141 q7_t * pSrcB, 03142 uint32_t srcBLen, 03143 q7_t * pDst); 03144 03145 03146 /** 03147 * @brief Partial convolution of floating-point sequences. 03148 * @param[in] pSrcA points to the first input sequence. 03149 * @param[in] srcALen length of the first input sequence. 03150 * @param[in] pSrcB points to the second input sequence. 03151 * @param[in] srcBLen length of the second input sequence. 03152 * @param[out] pDst points to the block of output data 03153 * @param[in] firstIndex is the first output sample to start with. 03154 * @param[in] numPoints is the number of output points to be computed. 03155 * @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]. 03156 */ 03157 arm_status arm_conv_partial_f32( 03158 float32_t * pSrcA, 03159 uint32_t srcALen, 03160 float32_t * pSrcB, 03161 uint32_t srcBLen, 03162 float32_t * pDst, 03163 uint32_t firstIndex, 03164 uint32_t numPoints); 03165 03166 03167 /** 03168 * @brief Partial convolution of Q15 sequences. 03169 * @param[in] pSrcA points to the first input sequence. 03170 * @param[in] srcALen length of the first input sequence. 03171 * @param[in] pSrcB points to the second input sequence. 03172 * @param[in] srcBLen length of the second input sequence. 03173 * @param[out] pDst points to the block of output data 03174 * @param[in] firstIndex is the first output sample to start with. 03175 * @param[in] numPoints is the number of output points to be computed. 03176 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03177 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). 03178 * @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]. 03179 */ 03180 arm_status arm_conv_partial_opt_q15( 03181 q15_t * pSrcA, 03182 uint32_t srcALen, 03183 q15_t * pSrcB, 03184 uint32_t srcBLen, 03185 q15_t * pDst, 03186 uint32_t firstIndex, 03187 uint32_t numPoints, 03188 q15_t * pScratch1, 03189 q15_t * pScratch2); 03190 03191 03192 /** 03193 * @brief Partial convolution of Q15 sequences. 03194 * @param[in] pSrcA points to the first input sequence. 03195 * @param[in] srcALen length of the first input sequence. 03196 * @param[in] pSrcB points to the second input sequence. 03197 * @param[in] srcBLen length of the second input sequence. 03198 * @param[out] pDst points to the block of output data 03199 * @param[in] firstIndex is the first output sample to start with. 03200 * @param[in] numPoints is the number of output points to be computed. 03201 * @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]. 03202 */ 03203 arm_status arm_conv_partial_q15( 03204 q15_t * pSrcA, 03205 uint32_t srcALen, 03206 q15_t * pSrcB, 03207 uint32_t srcBLen, 03208 q15_t * pDst, 03209 uint32_t firstIndex, 03210 uint32_t numPoints); 03211 03212 03213 /** 03214 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 03215 * @param[in] pSrcA points to the first input sequence. 03216 * @param[in] srcALen length of the first input sequence. 03217 * @param[in] pSrcB points to the second input sequence. 03218 * @param[in] srcBLen length of the second input sequence. 03219 * @param[out] pDst points to the block of output data 03220 * @param[in] firstIndex is the first output sample to start with. 03221 * @param[in] numPoints is the number of output points to be computed. 03222 * @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]. 03223 */ 03224 arm_status arm_conv_partial_fast_q15( 03225 q15_t * pSrcA, 03226 uint32_t srcALen, 03227 q15_t * pSrcB, 03228 uint32_t srcBLen, 03229 q15_t * pDst, 03230 uint32_t firstIndex, 03231 uint32_t numPoints); 03232 03233 03234 /** 03235 * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 03236 * @param[in] pSrcA points to the first input sequence. 03237 * @param[in] srcALen length of the first input sequence. 03238 * @param[in] pSrcB points to the second input sequence. 03239 * @param[in] srcBLen length of the second input sequence. 03240 * @param[out] pDst points to the block of output data 03241 * @param[in] firstIndex is the first output sample to start with. 03242 * @param[in] numPoints is the number of output points to be computed. 03243 * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03244 * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). 03245 * @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]. 03246 */ 03247 arm_status arm_conv_partial_fast_opt_q15( 03248 q15_t * pSrcA, 03249 uint32_t srcALen, 03250 q15_t * pSrcB, 03251 uint32_t srcBLen, 03252 q15_t * pDst, 03253 uint32_t firstIndex, 03254 uint32_t numPoints, 03255 q15_t * pScratch1, 03256 q15_t * pScratch2); 03257 03258 03259 /** 03260 * @brief Partial convolution of Q31 sequences. 03261 * @param[in] pSrcA points to the first input sequence. 03262 * @param[in] srcALen length of the first input sequence. 03263 * @param[in] pSrcB points to the second input sequence. 03264 * @param[in] srcBLen length of the second input sequence. 03265 * @param[out] pDst points to the block of output data 03266 * @param[in] firstIndex is the first output sample to start with. 03267 * @param[in] numPoints is the number of output points to be computed. 03268 * @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]. 03269 */ 03270 arm_status arm_conv_partial_q31( 03271 q31_t * pSrcA, 03272 uint32_t srcALen, 03273 q31_t * pSrcB, 03274 uint32_t srcBLen, 03275 q31_t * pDst, 03276 uint32_t firstIndex, 03277 uint32_t numPoints); 03278 03279 03280 /** 03281 * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 03282 * @param[in] pSrcA points to the first input sequence. 03283 * @param[in] srcALen length of the first input sequence. 03284 * @param[in] pSrcB points to the second input sequence. 03285 * @param[in] srcBLen length of the second input sequence. 03286 * @param[out] pDst points to the block of output data 03287 * @param[in] firstIndex is the first output sample to start with. 03288 * @param[in] numPoints is the number of output points to be computed. 03289 * @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]. 03290 */ 03291 arm_status arm_conv_partial_fast_q31( 03292 q31_t * pSrcA, 03293 uint32_t srcALen, 03294 q31_t * pSrcB, 03295 uint32_t srcBLen, 03296 q31_t * pDst, 03297 uint32_t firstIndex, 03298 uint32_t numPoints); 03299 03300 03301 /** 03302 * @brief Partial convolution of Q7 sequences 03303 * @param[in] pSrcA points to the first input sequence. 03304 * @param[in] srcALen length of the first input sequence. 03305 * @param[in] pSrcB points to the second input sequence. 03306 * @param[in] srcBLen length of the second input sequence. 03307 * @param[out] pDst points to the block of output data 03308 * @param[in] firstIndex is the first output sample to start with. 03309 * @param[in] numPoints is the number of output points to be computed. 03310 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 03311 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). 03312 * @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]. 03313 */ 03314 arm_status arm_conv_partial_opt_q7( 03315 q7_t * pSrcA, 03316 uint32_t srcALen, 03317 q7_t * pSrcB, 03318 uint32_t srcBLen, 03319 q7_t * pDst, 03320 uint32_t firstIndex, 03321 uint32_t numPoints, 03322 q15_t * pScratch1, 03323 q15_t * pScratch2); 03324 03325 03326 /** 03327 * @brief Partial convolution of Q7 sequences. 03328 * @param[in] pSrcA points to the first input sequence. 03329 * @param[in] srcALen length of the first input sequence. 03330 * @param[in] pSrcB points to the second input sequence. 03331 * @param[in] srcBLen length of the second input sequence. 03332 * @param[out] pDst points to the block of output data 03333 * @param[in] firstIndex is the first output sample to start with. 03334 * @param[in] numPoints is the number of output points to be computed. 03335 * @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]. 03336 */ 03337 arm_status arm_conv_partial_q7( 03338 q7_t * pSrcA, 03339 uint32_t srcALen, 03340 q7_t * pSrcB, 03341 uint32_t srcBLen, 03342 q7_t * pDst, 03343 uint32_t firstIndex, 03344 uint32_t numPoints); 03345 03346 03347 /** 03348 * @brief Instance structure for the Q15 FIR decimator. 03349 */ 03350 typedef struct 03351 { 03352 uint8_t M; /**< decimation factor. */ 03353 uint16_t numTaps; /**< number of coefficients in the filter. */ 03354 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 03355 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 03356 } arm_fir_decimate_instance_q15; 03357 03358 /** 03359 * @brief Instance structure for the Q31 FIR decimator. 03360 */ 03361 typedef struct 03362 { 03363 uint8_t M; /**< decimation factor. */ 03364 uint16_t numTaps; /**< number of coefficients in the filter. */ 03365 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 03366 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 03367 } arm_fir_decimate_instance_q31; 03368 03369 /** 03370 * @brief Instance structure for the floating-point FIR decimator. 03371 */ 03372 typedef struct 03373 { 03374 uint8_t M; /**< decimation factor. */ 03375 uint16_t numTaps; /**< number of coefficients in the filter. */ 03376 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 03377 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 03378 } arm_fir_decimate_instance_f32; 03379 03380 03381 /** 03382 * @brief Processing function for the floating-point FIR decimator. 03383 * @param[in] S points to an instance of the floating-point FIR decimator structure. 03384 * @param[in] pSrc points to the block of input data. 03385 * @param[out] pDst points to the block of output data 03386 * @param[in] blockSize number of input samples to process per call. 03387 */ 03388 void arm_fir_decimate_f32( 03389 const arm_fir_decimate_instance_f32 * S, 03390 float32_t * pSrc, 03391 float32_t * pDst, 03392 uint32_t blockSize); 03393 03394 03395 /** 03396 * @brief Initialization function for the floating-point FIR decimator. 03397 * @param[in,out] S points to an instance of the floating-point FIR decimator structure. 03398 * @param[in] numTaps number of coefficients in the filter. 03399 * @param[in] M decimation factor. 03400 * @param[in] pCoeffs points to the filter coefficients. 03401 * @param[in] pState points to the state buffer. 03402 * @param[in] blockSize number of input samples to process per call. 03403 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03404 * <code>blockSize</code> is not a multiple of <code>M</code>. 03405 */ 03406 arm_status arm_fir_decimate_init_f32( 03407 arm_fir_decimate_instance_f32 * S, 03408 uint16_t numTaps, 03409 uint8_t M, 03410 float32_t * pCoeffs, 03411 float32_t * pState, 03412 uint32_t blockSize); 03413 03414 03415 /** 03416 * @brief Processing function for the Q15 FIR decimator. 03417 * @param[in] S points to an instance of the Q15 FIR decimator structure. 03418 * @param[in] pSrc points to the block of input data. 03419 * @param[out] pDst points to the block of output data 03420 * @param[in] blockSize number of input samples to process per call. 03421 */ 03422 void arm_fir_decimate_q15( 03423 const arm_fir_decimate_instance_q15 * S, 03424 q15_t * pSrc, 03425 q15_t * pDst, 03426 uint32_t blockSize); 03427 03428 03429 /** 03430 * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. 03431 * @param[in] S points to an instance of the Q15 FIR decimator structure. 03432 * @param[in] pSrc points to the block of input data. 03433 * @param[out] pDst points to the block of output data 03434 * @param[in] blockSize number of input samples to process per call. 03435 */ 03436 void arm_fir_decimate_fast_q15( 03437 const arm_fir_decimate_instance_q15 * S, 03438 q15_t * pSrc, 03439 q15_t * pDst, 03440 uint32_t blockSize); 03441 03442 03443 /** 03444 * @brief Initialization function for the Q15 FIR decimator. 03445 * @param[in,out] S points to an instance of the Q15 FIR decimator structure. 03446 * @param[in] numTaps number of coefficients in the filter. 03447 * @param[in] M decimation factor. 03448 * @param[in] pCoeffs points to the filter coefficients. 03449 * @param[in] pState points to the state buffer. 03450 * @param[in] blockSize number of input samples to process per call. 03451 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03452 * <code>blockSize</code> is not a multiple of <code>M</code>. 03453 */ 03454 arm_status arm_fir_decimate_init_q15( 03455 arm_fir_decimate_instance_q15 * S, 03456 uint16_t numTaps, 03457 uint8_t M, 03458 q15_t * pCoeffs, 03459 q15_t * pState, 03460 uint32_t blockSize); 03461 03462 03463 /** 03464 * @brief Processing function for the Q31 FIR decimator. 03465 * @param[in] S points to an instance of the Q31 FIR decimator structure. 03466 * @param[in] pSrc points to the block of input data. 03467 * @param[out] pDst points to the block of output data 03468 * @param[in] blockSize number of input samples to process per call. 03469 */ 03470 void arm_fir_decimate_q31( 03471 const arm_fir_decimate_instance_q31 * S, 03472 q31_t * pSrc, 03473 q31_t * pDst, 03474 uint32_t blockSize); 03475 03476 /** 03477 * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. 03478 * @param[in] S points to an instance of the Q31 FIR decimator structure. 03479 * @param[in] pSrc points to the block of input data. 03480 * @param[out] pDst points to the block of output data 03481 * @param[in] blockSize number of input samples to process per call. 03482 */ 03483 void arm_fir_decimate_fast_q31( 03484 arm_fir_decimate_instance_q31 * S, 03485 q31_t * pSrc, 03486 q31_t * pDst, 03487 uint32_t blockSize); 03488 03489 03490 /** 03491 * @brief Initialization function for the Q31 FIR decimator. 03492 * @param[in,out] S points to an instance of the Q31 FIR decimator structure. 03493 * @param[in] numTaps number of coefficients in the filter. 03494 * @param[in] M decimation factor. 03495 * @param[in] pCoeffs points to the filter coefficients. 03496 * @param[in] pState points to the state buffer. 03497 * @param[in] blockSize number of input samples to process per call. 03498 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03499 * <code>blockSize</code> is not a multiple of <code>M</code>. 03500 */ 03501 arm_status arm_fir_decimate_init_q31( 03502 arm_fir_decimate_instance_q31 * S, 03503 uint16_t numTaps, 03504 uint8_t M, 03505 q31_t * pCoeffs, 03506 q31_t * pState, 03507 uint32_t blockSize); 03508 03509 03510 /** 03511 * @brief Instance structure for the Q15 FIR interpolator. 03512 */ 03513 typedef struct 03514 { 03515 uint8_t L; /**< upsample factor. */ 03516 uint16_t phaseLength; /**< length of each polyphase filter component. */ 03517 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ 03518 q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ 03519 } arm_fir_interpolate_instance_q15; 03520 03521 /** 03522 * @brief Instance structure for the Q31 FIR interpolator. 03523 */ 03524 typedef struct 03525 { 03526 uint8_t L; /**< upsample factor. */ 03527 uint16_t phaseLength; /**< length of each polyphase filter component. */ 03528 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ 03529 q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ 03530 } arm_fir_interpolate_instance_q31; 03531 03532 /** 03533 * @brief Instance structure for the floating-point FIR interpolator. 03534 */ 03535 typedef struct 03536 { 03537 uint8_t L; /**< upsample factor. */ 03538 uint16_t phaseLength; /**< length of each polyphase filter component. */ 03539 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ 03540 float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ 03541 } arm_fir_interpolate_instance_f32; 03542 03543 03544 /** 03545 * @brief Processing function for the Q15 FIR interpolator. 03546 * @param[in] S points to an instance of the Q15 FIR interpolator structure. 03547 * @param[in] pSrc points to the block of input data. 03548 * @param[out] pDst points to the block of output data. 03549 * @param[in] blockSize number of input samples to process per call. 03550 */ 03551 void arm_fir_interpolate_q15( 03552 const arm_fir_interpolate_instance_q15 * S, 03553 q15_t * pSrc, 03554 q15_t * pDst, 03555 uint32_t blockSize); 03556 03557 03558 /** 03559 * @brief Initialization function for the Q15 FIR interpolator. 03560 * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. 03561 * @param[in] L upsample factor. 03562 * @param[in] numTaps number of filter coefficients in the filter. 03563 * @param[in] pCoeffs points to the filter coefficient buffer. 03564 * @param[in] pState points to the state buffer. 03565 * @param[in] blockSize number of input samples to process per call. 03566 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03567 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. 03568 */ 03569 arm_status arm_fir_interpolate_init_q15( 03570 arm_fir_interpolate_instance_q15 * S, 03571 uint8_t L, 03572 uint16_t numTaps, 03573 q15_t * pCoeffs, 03574 q15_t * pState, 03575 uint32_t blockSize); 03576 03577 03578 /** 03579 * @brief Processing function for the Q31 FIR interpolator. 03580 * @param[in] S points to an instance of the Q15 FIR interpolator structure. 03581 * @param[in] pSrc points to the block of input data. 03582 * @param[out] pDst points to the block of output data. 03583 * @param[in] blockSize number of input samples to process per call. 03584 */ 03585 void arm_fir_interpolate_q31( 03586 const arm_fir_interpolate_instance_q31 * S, 03587 q31_t * pSrc, 03588 q31_t * pDst, 03589 uint32_t blockSize); 03590 03591 03592 /** 03593 * @brief Initialization function for the Q31 FIR interpolator. 03594 * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. 03595 * @param[in] L upsample factor. 03596 * @param[in] numTaps number of filter coefficients in the filter. 03597 * @param[in] pCoeffs points to the filter coefficient buffer. 03598 * @param[in] pState points to the state buffer. 03599 * @param[in] blockSize number of input samples to process per call. 03600 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03601 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. 03602 */ 03603 arm_status arm_fir_interpolate_init_q31( 03604 arm_fir_interpolate_instance_q31 * S, 03605 uint8_t L, 03606 uint16_t numTaps, 03607 q31_t * pCoeffs, 03608 q31_t * pState, 03609 uint32_t blockSize); 03610 03611 03612 /** 03613 * @brief Processing function for the floating-point FIR interpolator. 03614 * @param[in] S points to an instance of the floating-point FIR interpolator structure. 03615 * @param[in] pSrc points to the block of input data. 03616 * @param[out] pDst points to the block of output data. 03617 * @param[in] blockSize number of input samples to process per call. 03618 */ 03619 void arm_fir_interpolate_f32( 03620 const arm_fir_interpolate_instance_f32 * S, 03621 float32_t * pSrc, 03622 float32_t * pDst, 03623 uint32_t blockSize); 03624 03625 03626 /** 03627 * @brief Initialization function for the floating-point FIR interpolator. 03628 * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. 03629 * @param[in] L upsample factor. 03630 * @param[in] numTaps number of filter coefficients in the filter. 03631 * @param[in] pCoeffs points to the filter coefficient buffer. 03632 * @param[in] pState points to the state buffer. 03633 * @param[in] blockSize number of input samples to process per call. 03634 * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if 03635 * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. 03636 */ 03637 arm_status arm_fir_interpolate_init_f32( 03638 arm_fir_interpolate_instance_f32 * S, 03639 uint8_t L, 03640 uint16_t numTaps, 03641 float32_t * pCoeffs, 03642 float32_t * pState, 03643 uint32_t blockSize); 03644 03645 03646 /** 03647 * @brief Instance structure for the high precision Q31 Biquad cascade filter. 03648 */ 03649 typedef struct 03650 { 03651 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 03652 q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ 03653 q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ 03654 uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ 03655 } arm_biquad_cas_df1_32x64_ins_q31; 03656 03657 03658 /** 03659 * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. 03660 * @param[in] pSrc points to the block of input data. 03661 * @param[out] pDst points to the block of output data 03662 * @param[in] blockSize number of samples to process. 03663 */ 03664 void arm_biquad_cas_df1_32x64_q31( 03665 const arm_biquad_cas_df1_32x64_ins_q31 * S, 03666 q31_t * pSrc, 03667 q31_t * pDst, 03668 uint32_t blockSize); 03669 03670 03671 /** 03672 * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. 03673 * @param[in] numStages number of 2nd order stages in the filter. 03674 * @param[in] pCoeffs points to the filter coefficients. 03675 * @param[in] pState points to the state buffer. 03676 * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format 03677 */ 03678 void arm_biquad_cas_df1_32x64_init_q31( 03679 arm_biquad_cas_df1_32x64_ins_q31 * S, 03680 uint8_t numStages, 03681 q31_t * pCoeffs, 03682 q63_t * pState, 03683 uint8_t postShift); 03684 03685 03686 /** 03687 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. 03688 */ 03689 typedef struct 03690 { 03691 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 03692 float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ 03693 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ 03694 } arm_biquad_cascade_df2T_instance_f32; 03695 03696 /** 03697 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. 03698 */ 03699 typedef struct 03700 { 03701 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 03702 float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ 03703 float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ 03704 } arm_biquad_cascade_stereo_df2T_instance_f32; 03705 03706 /** 03707 * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. 03708 */ 03709 typedef struct 03710 { 03711 uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ 03712 float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ 03713 float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ 03714 } arm_biquad_cascade_df2T_instance_f64; 03715 03716 03717 /** 03718 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 03719 * @param[in] S points to an instance of the filter data structure. 03720 * @param[in] pSrc points to the block of input data. 03721 * @param[out] pDst points to the block of output data 03722 * @param[in] blockSize number of samples to process. 03723 */ 03724 void arm_biquad_cascade_df2T_f32( 03725 const arm_biquad_cascade_df2T_instance_f32 * S, 03726 float32_t * pSrc, 03727 float32_t * pDst, 03728 uint32_t blockSize); 03729 03730 03731 /** 03732 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels 03733 * @param[in] S points to an instance of the filter data structure. 03734 * @param[in] pSrc points to the block of input data. 03735 * @param[out] pDst points to the block of output data 03736 * @param[in] blockSize number of samples to process. 03737 */ 03738 void arm_biquad_cascade_stereo_df2T_f32( 03739 const arm_biquad_cascade_stereo_df2T_instance_f32 * S, 03740 float32_t * pSrc, 03741 float32_t * pDst, 03742 uint32_t blockSize); 03743 03744 03745 /** 03746 * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 03747 * @param[in] S points to an instance of the filter data structure. 03748 * @param[in] pSrc points to the block of input data. 03749 * @param[out] pDst points to the block of output data 03750 * @param[in] blockSize number of samples to process. 03751 */ 03752 void arm_biquad_cascade_df2T_f64( 03753 const arm_biquad_cascade_df2T_instance_f64 * S, 03754 float64_t * pSrc, 03755 float64_t * pDst, 03756 uint32_t blockSize); 03757 03758 03759 /** 03760 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. 03761 * @param[in,out] S points to an instance of the filter data structure. 03762 * @param[in] numStages number of 2nd order stages in the filter. 03763 * @param[in] pCoeffs points to the filter coefficients. 03764 * @param[in] pState points to the state buffer. 03765 */ 03766 void arm_biquad_cascade_df2T_init_f32( 03767 arm_biquad_cascade_df2T_instance_f32 * S, 03768 uint8_t numStages, 03769 float32_t * pCoeffs, 03770 float32_t * pState); 03771 03772 03773 /** 03774 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. 03775 * @param[in,out] S points to an instance of the filter data structure. 03776 * @param[in] numStages number of 2nd order stages in the filter. 03777 * @param[in] pCoeffs points to the filter coefficients. 03778 * @param[in] pState points to the state buffer. 03779 */ 03780 void arm_biquad_cascade_stereo_df2T_init_f32( 03781 arm_biquad_cascade_stereo_df2T_instance_f32 * S, 03782 uint8_t numStages, 03783 float32_t * pCoeffs, 03784 float32_t * pState); 03785 03786 03787 /** 03788 * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. 03789 * @param[in,out] S points to an instance of the filter data structure. 03790 * @param[in] numStages number of 2nd order stages in the filter. 03791 * @param[in] pCoeffs points to the filter coefficients. 03792 * @param[in] pState points to the state buffer. 03793 */ 03794 void arm_biquad_cascade_df2T_init_f64( 03795 arm_biquad_cascade_df2T_instance_f64 * S, 03796 uint8_t numStages, 03797 float64_t * pCoeffs, 03798 float64_t * pState); 03799 03800 03801 /** 03802 * @brief Instance structure for the Q15 FIR lattice filter. 03803 */ 03804 typedef struct 03805 { 03806 uint16_t numStages; /**< number of filter stages. */ 03807 q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ 03808 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ 03809 } arm_fir_lattice_instance_q15; 03810 03811 /** 03812 * @brief Instance structure for the Q31 FIR lattice filter. 03813 */ 03814 typedef struct 03815 { 03816 uint16_t numStages; /**< number of filter stages. */ 03817 q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ 03818 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ 03819 } arm_fir_lattice_instance_q31; 03820 03821 /** 03822 * @brief Instance structure for the floating-point FIR lattice filter. 03823 */ 03824 typedef struct 03825 { 03826 uint16_t numStages; /**< number of filter stages. */ 03827 float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ 03828 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ 03829 } arm_fir_lattice_instance_f32; 03830 03831 03832 /** 03833 * @brief Initialization function for the Q15 FIR lattice filter. 03834 * @param[in] S points to an instance of the Q15 FIR lattice structure. 03835 * @param[in] numStages number of filter stages. 03836 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. 03837 * @param[in] pState points to the state buffer. The array is of length numStages. 03838 */ 03839 void arm_fir_lattice_init_q15( 03840 arm_fir_lattice_instance_q15 * S, 03841 uint16_t numStages, 03842 q15_t * pCoeffs, 03843 q15_t * pState); 03844 03845 03846 /** 03847 * @brief Processing function for the Q15 FIR lattice filter. 03848 * @param[in] S points to an instance of the Q15 FIR lattice structure. 03849 * @param[in] pSrc points to the block of input data. 03850 * @param[out] pDst points to the block of output data. 03851 * @param[in] blockSize number of samples to process. 03852 */ 03853 void arm_fir_lattice_q15( 03854 const arm_fir_lattice_instance_q15 * S, 03855 q15_t * pSrc, 03856 q15_t * pDst, 03857 uint32_t blockSize); 03858 03859 03860 /** 03861 * @brief Initialization function for the Q31 FIR lattice filter. 03862 * @param[in] S points to an instance of the Q31 FIR lattice structure. 03863 * @param[in] numStages number of filter stages. 03864 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. 03865 * @param[in] pState points to the state buffer. The array is of length numStages. 03866 */ 03867 void arm_fir_lattice_init_q31( 03868 arm_fir_lattice_instance_q31 * S, 03869 uint16_t numStages, 03870 q31_t * pCoeffs, 03871 q31_t * pState); 03872 03873 03874 /** 03875 * @brief Processing function for the Q31 FIR lattice filter. 03876 * @param[in] S points to an instance of the Q31 FIR lattice structure. 03877 * @param[in] pSrc points to the block of input data. 03878 * @param[out] pDst points to the block of output data 03879 * @param[in] blockSize number of samples to process. 03880 */ 03881 void arm_fir_lattice_q31( 03882 const arm_fir_lattice_instance_q31 * S, 03883 q31_t * pSrc, 03884 q31_t * pDst, 03885 uint32_t blockSize); 03886 03887 03888 /** 03889 * @brief Initialization function for the floating-point FIR lattice filter. 03890 * @param[in] S points to an instance of the floating-point FIR lattice structure. 03891 * @param[in] numStages number of filter stages. 03892 * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. 03893 * @param[in] pState points to the state buffer. The array is of length numStages. 03894 */ 03895 void arm_fir_lattice_init_f32( 03896 arm_fir_lattice_instance_f32 * S, 03897 uint16_t numStages, 03898 float32_t * pCoeffs, 03899 float32_t * pState); 03900 03901 03902 /** 03903 * @brief Processing function for the floating-point FIR lattice filter. 03904 * @param[in] S points to an instance of the floating-point FIR lattice structure. 03905 * @param[in] pSrc points to the block of input data. 03906 * @param[out] pDst points to the block of output data 03907 * @param[in] blockSize number of samples to process. 03908 */ 03909 void arm_fir_lattice_f32( 03910 const arm_fir_lattice_instance_f32 * S, 03911 float32_t * pSrc, 03912 float32_t * pDst, 03913 uint32_t blockSize); 03914 03915 03916 /** 03917 * @brief Instance structure for the Q15 IIR lattice filter. 03918 */ 03919 typedef struct 03920 { 03921 uint16_t numStages; /**< number of stages in the filter. */ 03922 q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ 03923 q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ 03924 q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ 03925 } arm_iir_lattice_instance_q15; 03926 03927 /** 03928 * @brief Instance structure for the Q31 IIR lattice filter. 03929 */ 03930 typedef struct 03931 { 03932 uint16_t numStages; /**< number of stages in the filter. */ 03933 q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ 03934 q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ 03935 q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ 03936 } arm_iir_lattice_instance_q31; 03937 03938 /** 03939 * @brief Instance structure for the floating-point IIR lattice filter. 03940 */ 03941 typedef struct 03942 { 03943 uint16_t numStages; /**< number of stages in the filter. */ 03944 float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ 03945 float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ 03946 float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ 03947 } arm_iir_lattice_instance_f32; 03948 03949 03950 /** 03951 * @brief Processing function for the floating-point IIR lattice filter. 03952 * @param[in] S points to an instance of the floating-point IIR lattice structure. 03953 * @param[in] pSrc points to the block of input data. 03954 * @param[out] pDst points to the block of output data. 03955 * @param[in] blockSize number of samples to process. 03956 */ 03957 void arm_iir_lattice_f32( 03958 const arm_iir_lattice_instance_f32 * S, 03959 float32_t * pSrc, 03960 float32_t * pDst, 03961 uint32_t blockSize); 03962 03963 03964 /** 03965 * @brief Initialization function for the floating-point IIR lattice filter. 03966 * @param[in] S points to an instance of the floating-point IIR lattice structure. 03967 * @param[in] numStages number of stages in the filter. 03968 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 03969 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 03970 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. 03971 * @param[in] blockSize number of samples to process. 03972 */ 03973 void arm_iir_lattice_init_f32( 03974 arm_iir_lattice_instance_f32 * S, 03975 uint16_t numStages, 03976 float32_t * pkCoeffs, 03977 float32_t * pvCoeffs, 03978 float32_t * pState, 03979 uint32_t blockSize); 03980 03981 03982 /** 03983 * @brief Processing function for the Q31 IIR lattice filter. 03984 * @param[in] S points to an instance of the Q31 IIR lattice structure. 03985 * @param[in] pSrc points to the block of input data. 03986 * @param[out] pDst points to the block of output data. 03987 * @param[in] blockSize number of samples to process. 03988 */ 03989 void arm_iir_lattice_q31( 03990 const arm_iir_lattice_instance_q31 * S, 03991 q31_t * pSrc, 03992 q31_t * pDst, 03993 uint32_t blockSize); 03994 03995 03996 /** 03997 * @brief Initialization function for the Q31 IIR lattice filter. 03998 * @param[in] S points to an instance of the Q31 IIR lattice structure. 03999 * @param[in] numStages number of stages in the filter. 04000 * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 04001 * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 04002 * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. 04003 * @param[in] blockSize number of samples to process. 04004 */ 04005 void arm_iir_lattice_init_q31( 04006 arm_iir_lattice_instance_q31 * S, 04007 uint16_t numStages, 04008 q31_t * pkCoeffs, 04009 q31_t * pvCoeffs, 04010 q31_t * pState, 04011 uint32_t blockSize); 04012 04013 04014 /** 04015 * @brief Processing function for the Q15 IIR lattice filter. 04016 * @param[in] S points to an instance of the Q15 IIR lattice structure. 04017 * @param[in] pSrc points to the block of input data. 04018 * @param[out] pDst points to the block of output data. 04019 * @param[in] blockSize number of samples to process. 04020 */ 04021 void arm_iir_lattice_q15( 04022 const arm_iir_lattice_instance_q15 * S, 04023 q15_t * pSrc, 04024 q15_t * pDst, 04025 uint32_t blockSize); 04026 04027 04028 /** 04029 * @brief Initialization function for the Q15 IIR lattice filter. 04030 * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. 04031 * @param[in] numStages number of stages in the filter. 04032 * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. 04033 * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. 04034 * @param[in] pState points to state buffer. The array is of length numStages+blockSize. 04035 * @param[in] blockSize number of samples to process per call. 04036 */ 04037 void arm_iir_lattice_init_q15( 04038 arm_iir_lattice_instance_q15 * S, 04039 uint16_t numStages, 04040 q15_t * pkCoeffs, 04041 q15_t * pvCoeffs, 04042 q15_t * pState, 04043 uint32_t blockSize); 04044 04045 04046 /** 04047 * @brief Instance structure for the floating-point LMS filter. 04048 */ 04049 typedef struct 04050 { 04051 uint16_t numTaps; /**< number of coefficients in the filter. */ 04052 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04053 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04054 float32_t mu; /**< step size that controls filter coefficient updates. */ 04055 } arm_lms_instance_f32; 04056 04057 04058 /** 04059 * @brief Processing function for floating-point LMS filter. 04060 * @param[in] S points to an instance of the floating-point LMS filter structure. 04061 * @param[in] pSrc points to the block of input data. 04062 * @param[in] pRef points to the block of reference data. 04063 * @param[out] pOut points to the block of output data. 04064 * @param[out] pErr points to the block of error data. 04065 * @param[in] blockSize number of samples to process. 04066 */ 04067 void arm_lms_f32( 04068 const arm_lms_instance_f32 * S, 04069 float32_t * pSrc, 04070 float32_t * pRef, 04071 float32_t * pOut, 04072 float32_t * pErr, 04073 uint32_t blockSize); 04074 04075 04076 /** 04077 * @brief Initialization function for floating-point LMS filter. 04078 * @param[in] S points to an instance of the floating-point LMS filter structure. 04079 * @param[in] numTaps number of filter coefficients. 04080 * @param[in] pCoeffs points to the coefficient buffer. 04081 * @param[in] pState points to state buffer. 04082 * @param[in] mu step size that controls filter coefficient updates. 04083 * @param[in] blockSize number of samples to process. 04084 */ 04085 void arm_lms_init_f32( 04086 arm_lms_instance_f32 * S, 04087 uint16_t numTaps, 04088 float32_t * pCoeffs, 04089 float32_t * pState, 04090 float32_t mu, 04091 uint32_t blockSize); 04092 04093 04094 /** 04095 * @brief Instance structure for the Q15 LMS filter. 04096 */ 04097 typedef struct 04098 { 04099 uint16_t numTaps; /**< number of coefficients in the filter. */ 04100 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04101 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04102 q15_t mu; /**< step size that controls filter coefficient updates. */ 04103 uint32_t postShift; /**< bit shift applied to coefficients. */ 04104 } arm_lms_instance_q15; 04105 04106 04107 /** 04108 * @brief Initialization function for the Q15 LMS filter. 04109 * @param[in] S points to an instance of the Q15 LMS filter structure. 04110 * @param[in] numTaps number of filter coefficients. 04111 * @param[in] pCoeffs points to the coefficient buffer. 04112 * @param[in] pState points to the state buffer. 04113 * @param[in] mu step size that controls filter coefficient updates. 04114 * @param[in] blockSize number of samples to process. 04115 * @param[in] postShift bit shift applied to coefficients. 04116 */ 04117 void arm_lms_init_q15( 04118 arm_lms_instance_q15 * S, 04119 uint16_t numTaps, 04120 q15_t * pCoeffs, 04121 q15_t * pState, 04122 q15_t mu, 04123 uint32_t blockSize, 04124 uint32_t postShift); 04125 04126 04127 /** 04128 * @brief Processing function for Q15 LMS filter. 04129 * @param[in] S points to an instance of the Q15 LMS filter structure. 04130 * @param[in] pSrc points to the block of input data. 04131 * @param[in] pRef points to the block of reference data. 04132 * @param[out] pOut points to the block of output data. 04133 * @param[out] pErr points to the block of error data. 04134 * @param[in] blockSize number of samples to process. 04135 */ 04136 void arm_lms_q15( 04137 const arm_lms_instance_q15 * S, 04138 q15_t * pSrc, 04139 q15_t * pRef, 04140 q15_t * pOut, 04141 q15_t * pErr, 04142 uint32_t blockSize); 04143 04144 04145 /** 04146 * @brief Instance structure for the Q31 LMS filter. 04147 */ 04148 typedef struct 04149 { 04150 uint16_t numTaps; /**< number of coefficients in the filter. */ 04151 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04152 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04153 q31_t mu; /**< step size that controls filter coefficient updates. */ 04154 uint32_t postShift; /**< bit shift applied to coefficients. */ 04155 } arm_lms_instance_q31; 04156 04157 04158 /** 04159 * @brief Processing function for Q31 LMS filter. 04160 * @param[in] S points to an instance of the Q15 LMS filter structure. 04161 * @param[in] pSrc points to the block of input data. 04162 * @param[in] pRef points to the block of reference data. 04163 * @param[out] pOut points to the block of output data. 04164 * @param[out] pErr points to the block of error data. 04165 * @param[in] blockSize number of samples to process. 04166 */ 04167 void arm_lms_q31( 04168 const arm_lms_instance_q31 * S, 04169 q31_t * pSrc, 04170 q31_t * pRef, 04171 q31_t * pOut, 04172 q31_t * pErr, 04173 uint32_t blockSize); 04174 04175 04176 /** 04177 * @brief Initialization function for Q31 LMS filter. 04178 * @param[in] S points to an instance of the Q31 LMS filter structure. 04179 * @param[in] numTaps number of filter coefficients. 04180 * @param[in] pCoeffs points to coefficient buffer. 04181 * @param[in] pState points to state buffer. 04182 * @param[in] mu step size that controls filter coefficient updates. 04183 * @param[in] blockSize number of samples to process. 04184 * @param[in] postShift bit shift applied to coefficients. 04185 */ 04186 void arm_lms_init_q31( 04187 arm_lms_instance_q31 * S, 04188 uint16_t numTaps, 04189 q31_t * pCoeffs, 04190 q31_t * pState, 04191 q31_t mu, 04192 uint32_t blockSize, 04193 uint32_t postShift); 04194 04195 04196 /** 04197 * @brief Instance structure for the floating-point normalized LMS filter. 04198 */ 04199 typedef struct 04200 { 04201 uint16_t numTaps; /**< number of coefficients in the filter. */ 04202 float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04203 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04204 float32_t mu; /**< step size that control filter coefficient updates. */ 04205 float32_t energy; /**< saves previous frame energy. */ 04206 float32_t x0; /**< saves previous input sample. */ 04207 } arm_lms_norm_instance_f32; 04208 04209 04210 /** 04211 * @brief Processing function for floating-point normalized LMS filter. 04212 * @param[in] S points to an instance of the floating-point normalized LMS filter structure. 04213 * @param[in] pSrc points to the block of input data. 04214 * @param[in] pRef points to the block of reference data. 04215 * @param[out] pOut points to the block of output data. 04216 * @param[out] pErr points to the block of error data. 04217 * @param[in] blockSize number of samples to process. 04218 */ 04219 void arm_lms_norm_f32( 04220 arm_lms_norm_instance_f32 * S, 04221 float32_t * pSrc, 04222 float32_t * pRef, 04223 float32_t * pOut, 04224 float32_t * pErr, 04225 uint32_t blockSize); 04226 04227 04228 /** 04229 * @brief Initialization function for floating-point normalized LMS filter. 04230 * @param[in] S points to an instance of the floating-point LMS filter structure. 04231 * @param[in] numTaps number of filter coefficients. 04232 * @param[in] pCoeffs points to coefficient buffer. 04233 * @param[in] pState points to state buffer. 04234 * @param[in] mu step size that controls filter coefficient updates. 04235 * @param[in] blockSize number of samples to process. 04236 */ 04237 void arm_lms_norm_init_f32( 04238 arm_lms_norm_instance_f32 * S, 04239 uint16_t numTaps, 04240 float32_t * pCoeffs, 04241 float32_t * pState, 04242 float32_t mu, 04243 uint32_t blockSize); 04244 04245 04246 /** 04247 * @brief Instance structure for the Q31 normalized LMS filter. 04248 */ 04249 typedef struct 04250 { 04251 uint16_t numTaps; /**< number of coefficients in the filter. */ 04252 q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04253 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04254 q31_t mu; /**< step size that controls filter coefficient updates. */ 04255 uint8_t postShift; /**< bit shift applied to coefficients. */ 04256 q31_t *recipTable; /**< points to the reciprocal initial value table. */ 04257 q31_t energy; /**< saves previous frame energy. */ 04258 q31_t x0; /**< saves previous input sample. */ 04259 } arm_lms_norm_instance_q31; 04260 04261 04262 /** 04263 * @brief Processing function for Q31 normalized LMS filter. 04264 * @param[in] S points to an instance of the Q31 normalized LMS filter structure. 04265 * @param[in] pSrc points to the block of input data. 04266 * @param[in] pRef points to the block of reference data. 04267 * @param[out] pOut points to the block of output data. 04268 * @param[out] pErr points to the block of error data. 04269 * @param[in] blockSize number of samples to process. 04270 */ 04271 void arm_lms_norm_q31( 04272 arm_lms_norm_instance_q31 * S, 04273 q31_t * pSrc, 04274 q31_t * pRef, 04275 q31_t * pOut, 04276 q31_t * pErr, 04277 uint32_t blockSize); 04278 04279 04280 /** 04281 * @brief Initialization function for Q31 normalized LMS filter. 04282 * @param[in] S points to an instance of the Q31 normalized LMS filter structure. 04283 * @param[in] numTaps number of filter coefficients. 04284 * @param[in] pCoeffs points to coefficient buffer. 04285 * @param[in] pState points to state buffer. 04286 * @param[in] mu step size that controls filter coefficient updates. 04287 * @param[in] blockSize number of samples to process. 04288 * @param[in] postShift bit shift applied to coefficients. 04289 */ 04290 void arm_lms_norm_init_q31( 04291 arm_lms_norm_instance_q31 * S, 04292 uint16_t numTaps, 04293 q31_t * pCoeffs, 04294 q31_t * pState, 04295 q31_t mu, 04296 uint32_t blockSize, 04297 uint8_t postShift); 04298 04299 04300 /** 04301 * @brief Instance structure for the Q15 normalized LMS filter. 04302 */ 04303 typedef struct 04304 { 04305 uint16_t numTaps; /**< Number of coefficients in the filter. */ 04306 q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ 04307 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ 04308 q15_t mu; /**< step size that controls filter coefficient updates. */ 04309 uint8_t postShift; /**< bit shift applied to coefficients. */ 04310 q15_t *recipTable; /**< Points to the reciprocal initial value table. */ 04311 q15_t energy; /**< saves previous frame energy. */ 04312 q15_t x0; /**< saves previous input sample. */ 04313 } arm_lms_norm_instance_q15; 04314 04315 04316 /** 04317 * @brief Processing function for Q15 normalized LMS filter. 04318 * @param[in] S points to an instance of the Q15 normalized LMS filter structure. 04319 * @param[in] pSrc points to the block of input data. 04320 * @param[in] pRef points to the block of reference data. 04321 * @param[out] pOut points to the block of output data. 04322 * @param[out] pErr points to the block of error data. 04323 * @param[in] blockSize number of samples to process. 04324 */ 04325 void arm_lms_norm_q15( 04326 arm_lms_norm_instance_q15 * S, 04327 q15_t * pSrc, 04328 q15_t * pRef, 04329 q15_t * pOut, 04330 q15_t * pErr, 04331 uint32_t blockSize); 04332 04333 04334 /** 04335 * @brief Initialization function for Q15 normalized LMS filter. 04336 * @param[in] S points to an instance of the Q15 normalized LMS filter structure. 04337 * @param[in] numTaps number of filter coefficients. 04338 * @param[in] pCoeffs points to coefficient buffer. 04339 * @param[in] pState points to state buffer. 04340 * @param[in] mu step size that controls filter coefficient updates. 04341 * @param[in] blockSize number of samples to process. 04342 * @param[in] postShift bit shift applied to coefficients. 04343 */ 04344 void arm_lms_norm_init_q15( 04345 arm_lms_norm_instance_q15 * S, 04346 uint16_t numTaps, 04347 q15_t * pCoeffs, 04348 q15_t * pState, 04349 q15_t mu, 04350 uint32_t blockSize, 04351 uint8_t postShift); 04352 04353 04354 /** 04355 * @brief Correlation of floating-point sequences. 04356 * @param[in] pSrcA points to the first input sequence. 04357 * @param[in] srcALen length of the first input sequence. 04358 * @param[in] pSrcB points to the second input sequence. 04359 * @param[in] srcBLen length of the second input sequence. 04360 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04361 */ 04362 void arm_correlate_f32( 04363 float32_t * pSrcA, 04364 uint32_t srcALen, 04365 float32_t * pSrcB, 04366 uint32_t srcBLen, 04367 float32_t * pDst); 04368 04369 04370 /** 04371 * @brief Correlation of Q15 sequences 04372 * @param[in] pSrcA points to the first input sequence. 04373 * @param[in] srcALen length of the first input sequence. 04374 * @param[in] pSrcB points to the second input sequence. 04375 * @param[in] srcBLen length of the second input sequence. 04376 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04377 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 04378 */ 04379 void arm_correlate_opt_q15( 04380 q15_t * pSrcA, 04381 uint32_t srcALen, 04382 q15_t * pSrcB, 04383 uint32_t srcBLen, 04384 q15_t * pDst, 04385 q15_t * pScratch); 04386 04387 04388 /** 04389 * @brief Correlation of Q15 sequences. 04390 * @param[in] pSrcA points to the first input sequence. 04391 * @param[in] srcALen length of the first input sequence. 04392 * @param[in] pSrcB points to the second input sequence. 04393 * @param[in] srcBLen length of the second input sequence. 04394 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04395 */ 04396 04397 void arm_correlate_q15( 04398 q15_t * pSrcA, 04399 uint32_t srcALen, 04400 q15_t * pSrcB, 04401 uint32_t srcBLen, 04402 q15_t * pDst); 04403 04404 04405 /** 04406 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. 04407 * @param[in] pSrcA points to the first input sequence. 04408 * @param[in] srcALen length of the first input sequence. 04409 * @param[in] pSrcB points to the second input sequence. 04410 * @param[in] srcBLen length of the second input sequence. 04411 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04412 */ 04413 04414 void arm_correlate_fast_q15( 04415 q15_t * pSrcA, 04416 uint32_t srcALen, 04417 q15_t * pSrcB, 04418 uint32_t srcBLen, 04419 q15_t * pDst); 04420 04421 04422 /** 04423 * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. 04424 * @param[in] pSrcA points to the first input sequence. 04425 * @param[in] srcALen length of the first input sequence. 04426 * @param[in] pSrcB points to the second input sequence. 04427 * @param[in] srcBLen length of the second input sequence. 04428 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04429 * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 04430 */ 04431 void arm_correlate_fast_opt_q15( 04432 q15_t * pSrcA, 04433 uint32_t srcALen, 04434 q15_t * pSrcB, 04435 uint32_t srcBLen, 04436 q15_t * pDst, 04437 q15_t * pScratch); 04438 04439 04440 /** 04441 * @brief Correlation of Q31 sequences. 04442 * @param[in] pSrcA points to the first input sequence. 04443 * @param[in] srcALen length of the first input sequence. 04444 * @param[in] pSrcB points to the second input sequence. 04445 * @param[in] srcBLen length of the second input sequence. 04446 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04447 */ 04448 void arm_correlate_q31( 04449 q31_t * pSrcA, 04450 uint32_t srcALen, 04451 q31_t * pSrcB, 04452 uint32_t srcBLen, 04453 q31_t * pDst); 04454 04455 04456 /** 04457 * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 04458 * @param[in] pSrcA points to the first input sequence. 04459 * @param[in] srcALen length of the first input sequence. 04460 * @param[in] pSrcB points to the second input sequence. 04461 * @param[in] srcBLen length of the second input sequence. 04462 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04463 */ 04464 void arm_correlate_fast_q31( 04465 q31_t * pSrcA, 04466 uint32_t srcALen, 04467 q31_t * pSrcB, 04468 uint32_t srcBLen, 04469 q31_t * pDst); 04470 04471 04472 /** 04473 * @brief Correlation of Q7 sequences. 04474 * @param[in] pSrcA points to the first input sequence. 04475 * @param[in] srcALen length of the first input sequence. 04476 * @param[in] pSrcB points to the second input sequence. 04477 * @param[in] srcBLen length of the second input sequence. 04478 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04479 * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. 04480 * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). 04481 */ 04482 void arm_correlate_opt_q7( 04483 q7_t * pSrcA, 04484 uint32_t srcALen, 04485 q7_t * pSrcB, 04486 uint32_t srcBLen, 04487 q7_t * pDst, 04488 q15_t * pScratch1, 04489 q15_t * pScratch2); 04490 04491 04492 /** 04493 * @brief Correlation of Q7 sequences. 04494 * @param[in] pSrcA points to the first input sequence. 04495 * @param[in] srcALen length of the first input sequence. 04496 * @param[in] pSrcB points to the second input sequence. 04497 * @param[in] srcBLen length of the second input sequence. 04498 * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. 04499 */ 04500 void arm_correlate_q7( 04501 q7_t * pSrcA, 04502 uint32_t srcALen, 04503 q7_t * pSrcB, 04504 uint32_t srcBLen, 04505 q7_t * pDst); 04506 04507 04508 /** 04509 * @brief Instance structure for the floating-point sparse FIR filter. 04510 */ 04511 typedef struct 04512 { 04513 uint16_t numTaps; /**< number of coefficients in the filter. */ 04514 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ 04515 float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ 04516 float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 04517 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ 04518 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ 04519 } arm_fir_sparse_instance_f32; 04520 04521 /** 04522 * @brief Instance structure for the Q31 sparse FIR filter. 04523 */ 04524 typedef struct 04525 { 04526 uint16_t numTaps; /**< number of coefficients in the filter. */ 04527 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ 04528 q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ 04529 q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 04530 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ 04531 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ 04532 } arm_fir_sparse_instance_q31; 04533 04534 /** 04535 * @brief Instance structure for the Q15 sparse FIR filter. 04536 */ 04537 typedef struct 04538 { 04539 uint16_t numTaps; /**< number of coefficients in the filter. */ 04540 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ 04541 q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ 04542 q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 04543 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ 04544 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ 04545 } arm_fir_sparse_instance_q15; 04546 04547 /** 04548 * @brief Instance structure for the Q7 sparse FIR filter. 04549 */ 04550 typedef struct 04551 { 04552 uint16_t numTaps; /**< number of coefficients in the filter. */ 04553 uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ 04554 q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ 04555 q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ 04556 uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ 04557 int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ 04558 } arm_fir_sparse_instance_q7; 04559 04560 04561 /** 04562 * @brief Processing function for the floating-point sparse FIR filter. 04563 * @param[in] S points to an instance of the floating-point sparse FIR structure. 04564 * @param[in] pSrc points to the block of input data. 04565 * @param[out] pDst points to the block of output data 04566 * @param[in] pScratchIn points to a temporary buffer of size blockSize. 04567 * @param[in] blockSize number of input samples to process per call. 04568 */ 04569 void arm_fir_sparse_f32( 04570 arm_fir_sparse_instance_f32 * S, 04571 float32_t * pSrc, 04572 float32_t * pDst, 04573 float32_t * pScratchIn, 04574 uint32_t blockSize); 04575 04576 04577 /** 04578 * @brief Initialization function for the floating-point sparse FIR filter. 04579 * @param[in,out] S points to an instance of the floating-point sparse FIR structure. 04580 * @param[in] numTaps number of nonzero coefficients in the filter. 04581 * @param[in] pCoeffs points to the array of filter coefficients. 04582 * @param[in] pState points to the state buffer. 04583 * @param[in] pTapDelay points to the array of offset times. 04584 * @param[in] maxDelay maximum offset time supported. 04585 * @param[in] blockSize number of samples that will be processed per block. 04586 */ 04587 void arm_fir_sparse_init_f32( 04588 arm_fir_sparse_instance_f32 * S, 04589 uint16_t numTaps, 04590 float32_t * pCoeffs, 04591 float32_t * pState, 04592 int32_t * pTapDelay, 04593 uint16_t maxDelay, 04594 uint32_t blockSize); 04595 04596 04597 /** 04598 * @brief Processing function for the Q31 sparse FIR filter. 04599 * @param[in] S points to an instance of the Q31 sparse FIR structure. 04600 * @param[in] pSrc points to the block of input data. 04601 * @param[out] pDst points to the block of output data 04602 * @param[in] pScratchIn points to a temporary buffer of size blockSize. 04603 * @param[in] blockSize number of input samples to process per call. 04604 */ 04605 void arm_fir_sparse_q31( 04606 arm_fir_sparse_instance_q31 * S, 04607 q31_t * pSrc, 04608 q31_t * pDst, 04609 q31_t * pScratchIn, 04610 uint32_t blockSize); 04611 04612 04613 /** 04614 * @brief Initialization function for the Q31 sparse FIR filter. 04615 * @param[in,out] S points to an instance of the Q31 sparse FIR structure. 04616 * @param[in] numTaps number of nonzero coefficients in the filter. 04617 * @param[in] pCoeffs points to the array of filter coefficients. 04618 * @param[in] pState points to the state buffer. 04619 * @param[in] pTapDelay points to the array of offset times. 04620 * @param[in] maxDelay maximum offset time supported. 04621 * @param[in] blockSize number of samples that will be processed per block. 04622 */ 04623 void arm_fir_sparse_init_q31( 04624 arm_fir_sparse_instance_q31 * S, 04625 uint16_t numTaps, 04626 q31_t * pCoeffs, 04627 q31_t * pState, 04628 int32_t * pTapDelay, 04629 uint16_t maxDelay, 04630 uint32_t blockSize); 04631 04632 04633 /** 04634 * @brief Processing function for the Q15 sparse FIR filter. 04635 * @param[in] S points to an instance of the Q15 sparse FIR structure. 04636 * @param[in] pSrc points to the block of input data. 04637 * @param[out] pDst points to the block of output data 04638 * @param[in] pScratchIn points to a temporary buffer of size blockSize. 04639 * @param[in] pScratchOut points to a temporary buffer of size blockSize. 04640 * @param[in] blockSize number of input samples to process per call. 04641 */ 04642 void arm_fir_sparse_q15( 04643 arm_fir_sparse_instance_q15 * S, 04644 q15_t * pSrc, 04645 q15_t * pDst, 04646 q15_t * pScratchIn, 04647 q31_t * pScratchOut, 04648 uint32_t blockSize); 04649 04650 04651 /** 04652 * @brief Initialization function for the Q15 sparse FIR filter. 04653 * @param[in,out] S points to an instance of the Q15 sparse FIR structure. 04654 * @param[in] numTaps number of nonzero coefficients in the filter. 04655 * @param[in] pCoeffs points to the array of filter coefficients. 04656 * @param[in] pState points to the state buffer. 04657 * @param[in] pTapDelay points to the array of offset times. 04658 * @param[in] maxDelay maximum offset time supported. 04659 * @param[in] blockSize number of samples that will be processed per block. 04660 */ 04661 void arm_fir_sparse_init_q15( 04662 arm_fir_sparse_instance_q15 * S, 04663 uint16_t numTaps, 04664 q15_t * pCoeffs, 04665 q15_t * pState, 04666 int32_t * pTapDelay, 04667 uint16_t maxDelay, 04668 uint32_t blockSize); 04669 04670 04671 /** 04672 * @brief Processing function for the Q7 sparse FIR filter. 04673 * @param[in] S points to an instance of the Q7 sparse FIR structure. 04674 * @param[in] pSrc points to the block of input data. 04675 * @param[out] pDst points to the block of output data 04676 * @param[in] pScratchIn points to a temporary buffer of size blockSize. 04677 * @param[in] pScratchOut points to a temporary buffer of size blockSize. 04678 * @param[in] blockSize number of input samples to process per call. 04679 */ 04680 void arm_fir_sparse_q7( 04681 arm_fir_sparse_instance_q7 * S, 04682 q7_t * pSrc, 04683 q7_t * pDst, 04684 q7_t * pScratchIn, 04685 q31_t * pScratchOut, 04686 uint32_t blockSize); 04687 04688 04689 /** 04690 * @brief Initialization function for the Q7 sparse FIR filter. 04691 * @param[in,out] S points to an instance of the Q7 sparse FIR structure. 04692 * @param[in] numTaps number of nonzero coefficients in the filter. 04693 * @param[in] pCoeffs points to the array of filter coefficients. 04694 * @param[in] pState points to the state buffer. 04695 * @param[in] pTapDelay points to the array of offset times. 04696 * @param[in] maxDelay maximum offset time supported. 04697 * @param[in] blockSize number of samples that will be processed per block. 04698 */ 04699 void arm_fir_sparse_init_q7( 04700 arm_fir_sparse_instance_q7 * S, 04701 uint16_t numTaps, 04702 q7_t * pCoeffs, 04703 q7_t * pState, 04704 int32_t * pTapDelay, 04705 uint16_t maxDelay, 04706 uint32_t blockSize); 04707 04708 04709 /** 04710 * @brief Floating-point sin_cos function. 04711 * @param[in] theta input value in degrees 04712 * @param[out] pSinVal points to the processed sine output. 04713 * @param[out] pCosVal points to the processed cos output. 04714 */ 04715 void arm_sin_cos_f32( 04716 float32_t theta, 04717 float32_t * pSinVal, 04718 float32_t * pCosVal); 04719 04720 04721 /** 04722 * @brief Q31 sin_cos function. 04723 * @param[in] theta scaled input value in degrees 04724 * @param[out] pSinVal points to the processed sine output. 04725 * @param[out] pCosVal points to the processed cosine output. 04726 */ 04727 void arm_sin_cos_q31( 04728 q31_t theta, 04729 q31_t * pSinVal, 04730 q31_t * pCosVal); 04731 04732 04733 /** 04734 * @brief Floating-point complex conjugate. 04735 * @param[in] pSrc points to the input vector 04736 * @param[out] pDst points to the output vector 04737 * @param[in] numSamples number of complex samples in each vector 04738 */ 04739 void arm_cmplx_conj_f32( 04740 float32_t * pSrc, 04741 float32_t * pDst, 04742 uint32_t numSamples); 04743 04744 /** 04745 * @brief Q31 complex conjugate. 04746 * @param[in] pSrc points to the input vector 04747 * @param[out] pDst points to the output vector 04748 * @param[in] numSamples number of complex samples in each vector 04749 */ 04750 void arm_cmplx_conj_q31( 04751 q31_t * pSrc, 04752 q31_t * pDst, 04753 uint32_t numSamples); 04754 04755 04756 /** 04757 * @brief Q15 complex conjugate. 04758 * @param[in] pSrc points to the input vector 04759 * @param[out] pDst points to the output vector 04760 * @param[in] numSamples number of complex samples in each vector 04761 */ 04762 void arm_cmplx_conj_q15( 04763 q15_t * pSrc, 04764 q15_t * pDst, 04765 uint32_t numSamples); 04766 04767 04768 /** 04769 * @brief Floating-point complex magnitude squared 04770 * @param[in] pSrc points to the complex input vector 04771 * @param[out] pDst points to the real output vector 04772 * @param[in] numSamples number of complex samples in the input vector 04773 */ 04774 void arm_cmplx_mag_squared_f32( 04775 float32_t * pSrc, 04776 float32_t * pDst, 04777 uint32_t numSamples); 04778 04779 04780 /** 04781 * @brief Q31 complex magnitude squared 04782 * @param[in] pSrc points to the complex input vector 04783 * @param[out] pDst points to the real output vector 04784 * @param[in] numSamples number of complex samples in the input vector 04785 */ 04786 void arm_cmplx_mag_squared_q31( 04787 q31_t * pSrc, 04788 q31_t * pDst, 04789 uint32_t numSamples); 04790 04791 04792 /** 04793 * @brief Q15 complex magnitude squared 04794 * @param[in] pSrc points to the complex input vector 04795 * @param[out] pDst points to the real output vector 04796 * @param[in] numSamples number of complex samples in the input vector 04797 */ 04798 void arm_cmplx_mag_squared_q15( 04799 q15_t * pSrc, 04800 q15_t * pDst, 04801 uint32_t numSamples); 04802 04803 04804 /** 04805 * @ingroup groupController 04806 */ 04807 04808 /** 04809 * @defgroup PID PID Motor Control 04810 * 04811 * A Proportional Integral Derivative (PID) controller is a generic feedback control 04812 * loop mechanism widely used in industrial control systems. 04813 * A PID controller is the most commonly used type of feedback controller. 04814 * 04815 * This set of functions implements (PID) controllers 04816 * for Q15, Q31, and floating-point data types. The functions operate on a single sample 04817 * of data and each call to the function returns a single processed value. 04818 * <code>S</code> points to an instance of the PID control data structure. <code>in</code> 04819 * is the input sample value. The functions return the output value. 04820 * 04821 * \par Algorithm: 04822 * <pre> 04823 * y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] 04824 * A0 = Kp + Ki + Kd 04825 * A1 = (-Kp ) - (2 * Kd ) 04826 * A2 = Kd </pre> 04827 * 04828 * \par 04829 * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant 04830 * 04831 * \par 04832 * \image html PID.gif "Proportional Integral Derivative Controller" 04833 * 04834 * \par 04835 * The PID controller calculates an "error" value as the difference between 04836 * the measured output and the reference input. 04837 * The controller attempts to minimize the error by adjusting the process control inputs. 04838 * The proportional value determines the reaction to the current error, 04839 * the integral value determines the reaction based on the sum of recent errors, 04840 * and the derivative value determines the reaction based on the rate at which the error has been changing. 04841 * 04842 * \par Instance Structure 04843 * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. 04844 * A separate instance structure must be defined for each PID Controller. 04845 * There are separate instance structure declarations for each of the 3 supported data types. 04846 * 04847 * \par Reset Functions 04848 * There is also an associated reset function for each data type which clears the state array. 04849 * 04850 * \par Initialization Functions 04851 * There is also an associated initialization function for each data type. 04852 * The initialization function performs the following operations: 04853 * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. 04854 * - Zeros out the values in the state buffer. 04855 * 04856 * \par 04857 * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. 04858 * 04859 * \par Fixed-Point Behavior 04860 * Care must be taken when using the fixed-point versions of the PID Controller functions. 04861 * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. 04862 * Refer to the function specific documentation below for usage guidelines. 04863 */ 04864 04865 /** 04866 * @addtogroup PID 04867 * @{ 04868 */ 04869 04870 /** 04871 * @brief Process function for the floating-point PID Control. 04872 * @param[in,out] S is an instance of the floating-point PID Control structure 04873 * @param[in] in input sample to process 04874 * @return out processed output sample. 04875 */ 04876 CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32( 04877 arm_pid_instance_f32 * S, 04878 float32_t in) 04879 { 04880 float32_t out; 04881 04882 /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ 04883 out = (S->A0 * in) + 04884 (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); 04885 04886 /* Update state */ 04887 S->state[1] = S->state[0]; 04888 S->state[0] = in; 04889 S->state[2] = out; 04890 04891 /* return to application */ 04892 return (out); 04893 04894 } 04895 04896 /** 04897 * @brief Process function for the Q31 PID Control. 04898 * @param[in,out] S points to an instance of the Q31 PID Control structure 04899 * @param[in] in input sample to process 04900 * @return out processed output sample. 04901 * 04902 * <b>Scaling and Overflow Behavior:</b> 04903 * \par 04904 * The function is implemented using an internal 64-bit accumulator. 04905 * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. 04906 * Thus, if the accumulator result overflows it wraps around rather than clip. 04907 * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. 04908 * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. 04909 */ 04910 CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31( 04911 arm_pid_instance_q31 * S, 04912 q31_t in) 04913 { 04914 q63_t acc; 04915 q31_t out; 04916 04917 /* acc = A0 * x[n] */ 04918 acc = (q63_t) S->A0 * in; 04919 04920 /* acc += A1 * x[n-1] */ 04921 acc += (q63_t) S->A1 * S->state[0]; 04922 04923 /* acc += A2 * x[n-2] */ 04924 acc += (q63_t) S->A2 * S->state[1]; 04925 04926 /* convert output to 1.31 format to add y[n-1] */ 04927 out = (q31_t) (acc >> 31u); 04928 04929 /* out += y[n-1] */ 04930 out += S->state[2]; 04931 04932 /* Update state */ 04933 S->state[1] = S->state[0]; 04934 S->state[0] = in; 04935 S->state[2] = out; 04936 04937 /* return to application */ 04938 return (out); 04939 } 04940 04941 04942 /** 04943 * @brief Process function for the Q15 PID Control. 04944 * @param[in,out] S points to an instance of the Q15 PID Control structure 04945 * @param[in] in input sample to process 04946 * @return out processed output sample. 04947 * 04948 * <b>Scaling and Overflow Behavior:</b> 04949 * \par 04950 * The function is implemented using a 64-bit internal accumulator. 04951 * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. 04952 * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. 04953 * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. 04954 * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. 04955 * Lastly, the accumulator is saturated to yield a result in 1.15 format. 04956 */ 04957 CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15( 04958 arm_pid_instance_q15 * S, 04959 q15_t in) 04960 { 04961 q63_t acc; 04962 q15_t out; 04963 04964 #if defined (ARM_MATH_DSP) 04965 __SIMD32_TYPE *vstate; 04966 04967 /* Implementation of PID controller */ 04968 04969 /* acc = A0 * x[n] */ 04970 acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); 04971 04972 /* acc += A1 * x[n-1] + A2 * x[n-2] */ 04973 vstate = __SIMD32_CONST(S->state); 04974 acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); 04975 #else 04976 /* acc = A0 * x[n] */ 04977 acc = ((q31_t) S->A0) * in; 04978 04979 /* acc += A1 * x[n-1] + A2 * x[n-2] */ 04980 acc += (q31_t) S->A1 * S->state[0]; 04981 acc += (q31_t) S->A2 * S->state[1]; 04982 #endif 04983 04984 /* acc += y[n-1] */ 04985 acc += (q31_t) S->state[2] << 15; 04986 04987 /* saturate the output */ 04988 out = (q15_t) (__SSAT((acc >> 15), 16)); 04989 04990 /* Update state */ 04991 S->state[1] = S->state[0]; 04992 S->state[0] = in; 04993 S->state[2] = out; 04994 04995 /* return to application */ 04996 return (out); 04997 } 04998 04999 /** 05000 * @} end of PID group 05001 */ 05002 05003 05004 /** 05005 * @brief Floating-point matrix inverse. 05006 * @param[in] src points to the instance of the input floating-point matrix structure. 05007 * @param[out] dst points to the instance of the output floating-point matrix structure. 05008 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. 05009 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. 05010 */ 05011 arm_status arm_mat_inverse_f32( 05012 const arm_matrix_instance_f32 * src, 05013 arm_matrix_instance_f32 * dst); 05014 05015 05016 /** 05017 * @brief Floating-point matrix inverse. 05018 * @param[in] src points to the instance of the input floating-point matrix structure. 05019 * @param[out] dst points to the instance of the output floating-point matrix structure. 05020 * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. 05021 * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. 05022 */ 05023 arm_status arm_mat_inverse_f64( 05024 const arm_matrix_instance_f64 * src, 05025 arm_matrix_instance_f64 * dst); 05026 05027 05028 05029 /** 05030 * @ingroup groupController 05031 */ 05032 05033 /** 05034 * @defgroup clarke Vector Clarke Transform 05035 * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. 05036 * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents 05037 * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>. 05038 * When <code>Ialpha</code> is superposed with <code>Ia</code> as shown in the figure below 05039 * \image html clarke.gif Stator current space vector and its components in (a,b). 05040 * and <code>Ia + Ib + Ic = 0</code>, in this condition <code>Ialpha</code> and <code>Ibeta</code> 05041 * can be calculated using only <code>Ia</code> and <code>Ib</code>. 05042 * 05043 * The function operates on a single sample of data and each call to the function returns the processed output. 05044 * The library provides separate functions for Q31 and floating-point data types. 05045 * \par Algorithm 05046 * \image html clarkeFormula.gif 05047 * where <code>Ia</code> and <code>Ib</code> are the instantaneous stator phases and 05048 * <code>pIalpha</code> and <code>pIbeta</code> are the two coordinates of time invariant vector. 05049 * \par Fixed-Point Behavior 05050 * Care must be taken when using the Q31 version of the Clarke transform. 05051 * In particular, the overflow and saturation behavior of the accumulator used must be considered. 05052 * Refer to the function specific documentation below for usage guidelines. 05053 */ 05054 05055 /** 05056 * @addtogroup clarke 05057 * @{ 05058 */ 05059 05060 /** 05061 * 05062 * @brief Floating-point Clarke transform 05063 * @param[in] Ia input three-phase coordinate <code>a</code> 05064 * @param[in] Ib input three-phase coordinate <code>b</code> 05065 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha 05066 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta 05067 */ 05068 CMSIS_INLINE __STATIC_INLINE void arm_clarke_f32( 05069 float32_t Ia, 05070 float32_t Ib, 05071 float32_t * pIalpha, 05072 float32_t * pIbeta) 05073 { 05074 /* Calculate pIalpha using the equation, pIalpha = Ia */ 05075 *pIalpha = Ia; 05076 05077 /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ 05078 *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); 05079 } 05080 05081 05082 /** 05083 * @brief Clarke transform for Q31 version 05084 * @param[in] Ia input three-phase coordinate <code>a</code> 05085 * @param[in] Ib input three-phase coordinate <code>b</code> 05086 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha 05087 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta 05088 * 05089 * <b>Scaling and Overflow Behavior:</b> 05090 * \par 05091 * The function is implemented using an internal 32-bit accumulator. 05092 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. 05093 * There is saturation on the addition, hence there is no risk of overflow. 05094 */ 05095 CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31( 05096 q31_t Ia, 05097 q31_t Ib, 05098 q31_t * pIalpha, 05099 q31_t * pIbeta) 05100 { 05101 q31_t product1, product2; /* Temporary variables used to store intermediate results */ 05102 05103 /* Calculating pIalpha from Ia by equation pIalpha = Ia */ 05104 *pIalpha = Ia; 05105 05106 /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ 05107 product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); 05108 05109 /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ 05110 product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); 05111 05112 /* pIbeta is calculated by adding the intermediate products */ 05113 *pIbeta = __QADD(product1, product2); 05114 } 05115 05116 /** 05117 * @} end of clarke group 05118 */ 05119 05120 /** 05121 * @brief Converts the elements of the Q7 vector to Q31 vector. 05122 * @param[in] pSrc input pointer 05123 * @param[out] pDst output pointer 05124 * @param[in] blockSize number of samples to process 05125 */ 05126 void arm_q7_to_q31( 05127 q7_t * pSrc, 05128 q31_t * pDst, 05129 uint32_t blockSize); 05130 05131 05132 05133 /** 05134 * @ingroup groupController 05135 */ 05136 05137 /** 05138 * @defgroup inv_clarke Vector Inverse Clarke Transform 05139 * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. 05140 * 05141 * The function operates on a single sample of data and each call to the function returns the processed output. 05142 * The library provides separate functions for Q31 and floating-point data types. 05143 * \par Algorithm 05144 * \image html clarkeInvFormula.gif 05145 * where <code>pIa</code> and <code>pIb</code> are the instantaneous stator phases and 05146 * <code>Ialpha</code> and <code>Ibeta</code> are the two coordinates of time invariant vector. 05147 * \par Fixed-Point Behavior 05148 * Care must be taken when using the Q31 version of the Clarke transform. 05149 * In particular, the overflow and saturation behavior of the accumulator used must be considered. 05150 * Refer to the function specific documentation below for usage guidelines. 05151 */ 05152 05153 /** 05154 * @addtogroup inv_clarke 05155 * @{ 05156 */ 05157 05158 /** 05159 * @brief Floating-point Inverse Clarke transform 05160 * @param[in] Ialpha input two-phase orthogonal vector axis alpha 05161 * @param[in] Ibeta input two-phase orthogonal vector axis beta 05162 * @param[out] pIa points to output three-phase coordinate <code>a</code> 05163 * @param[out] pIb points to output three-phase coordinate <code>b</code> 05164 */ 05165 CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_f32( 05166 float32_t Ialpha, 05167 float32_t Ibeta, 05168 float32_t * pIa, 05169 float32_t * pIb) 05170 { 05171 /* Calculating pIa from Ialpha by equation pIa = Ialpha */ 05172 *pIa = Ialpha; 05173 05174 /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ 05175 *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; 05176 } 05177 05178 05179 /** 05180 * @brief Inverse Clarke transform for Q31 version 05181 * @param[in] Ialpha input two-phase orthogonal vector axis alpha 05182 * @param[in] Ibeta input two-phase orthogonal vector axis beta 05183 * @param[out] pIa points to output three-phase coordinate <code>a</code> 05184 * @param[out] pIb points to output three-phase coordinate <code>b</code> 05185 * 05186 * <b>Scaling and Overflow Behavior:</b> 05187 * \par 05188 * The function is implemented using an internal 32-bit accumulator. 05189 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. 05190 * There is saturation on the subtraction, hence there is no risk of overflow. 05191 */ 05192 CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31( 05193 q31_t Ialpha, 05194 q31_t Ibeta, 05195 q31_t * pIa, 05196 q31_t * pIb) 05197 { 05198 q31_t product1, product2; /* Temporary variables used to store intermediate results */ 05199 05200 /* Calculating pIa from Ialpha by equation pIa = Ialpha */ 05201 *pIa = Ialpha; 05202 05203 /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ 05204 product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); 05205 05206 /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ 05207 product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); 05208 05209 /* pIb is calculated by subtracting the products */ 05210 *pIb = __QSUB(product2, product1); 05211 } 05212 05213 /** 05214 * @} end of inv_clarke group 05215 */ 05216 05217 /** 05218 * @brief Converts the elements of the Q7 vector to Q15 vector. 05219 * @param[in] pSrc input pointer 05220 * @param[out] pDst output pointer 05221 * @param[in] blockSize number of samples to process 05222 */ 05223 void arm_q7_to_q15( 05224 q7_t * pSrc, 05225 q15_t * pDst, 05226 uint32_t blockSize); 05227 05228 05229 05230 /** 05231 * @ingroup groupController 05232 */ 05233 05234 /** 05235 * @defgroup park Vector Park Transform 05236 * 05237 * Forward Park transform converts the input two-coordinate vector to flux and torque components. 05238 * The Park transform can be used to realize the transformation of the <code>Ialpha</code> and the <code>Ibeta</code> currents 05239 * from the stationary to the moving reference frame and control the spatial relationship between 05240 * the stator vector current and rotor flux vector. 05241 * If we consider the d axis aligned with the rotor flux, the diagram below shows the 05242 * current vector and the relationship from the two reference frames: 05243 * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" 05244 * 05245 * The function operates on a single sample of data and each call to the function returns the processed output. 05246 * The library provides separate functions for Q31 and floating-point data types. 05247 * \par Algorithm 05248 * \image html parkFormula.gif 05249 * where <code>Ialpha</code> and <code>Ibeta</code> are the stator vector components, 05250 * <code>pId</code> and <code>pIq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the 05251 * cosine and sine values of theta (rotor flux position). 05252 * \par Fixed-Point Behavior 05253 * Care must be taken when using the Q31 version of the Park transform. 05254 * In particular, the overflow and saturation behavior of the accumulator used must be considered. 05255 * Refer to the function specific documentation below for usage guidelines. 05256 */ 05257 05258 /** 05259 * @addtogroup park 05260 * @{ 05261 */ 05262 05263 /** 05264 * @brief Floating-point Park transform 05265 * @param[in] Ialpha input two-phase vector coordinate alpha 05266 * @param[in] Ibeta input two-phase vector coordinate beta 05267 * @param[out] pId points to output rotor reference frame d 05268 * @param[out] pIq points to output rotor reference frame q 05269 * @param[in] sinVal sine value of rotation angle theta 05270 * @param[in] cosVal cosine value of rotation angle theta 05271 * 05272 * The function implements the forward Park transform. 05273 * 05274 */ 05275 CMSIS_INLINE __STATIC_INLINE void arm_park_f32( 05276 float32_t Ialpha, 05277 float32_t Ibeta, 05278 float32_t * pId, 05279 float32_t * pIq, 05280 float32_t sinVal, 05281 float32_t cosVal) 05282 { 05283 /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ 05284 *pId = Ialpha * cosVal + Ibeta * sinVal; 05285 05286 /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ 05287 *pIq = -Ialpha * sinVal + Ibeta * cosVal; 05288 } 05289 05290 05291 /** 05292 * @brief Park transform for Q31 version 05293 * @param[in] Ialpha input two-phase vector coordinate alpha 05294 * @param[in] Ibeta input two-phase vector coordinate beta 05295 * @param[out] pId points to output rotor reference frame d 05296 * @param[out] pIq points to output rotor reference frame q 05297 * @param[in] sinVal sine value of rotation angle theta 05298 * @param[in] cosVal cosine value of rotation angle theta 05299 * 05300 * <b>Scaling and Overflow Behavior:</b> 05301 * \par 05302 * The function is implemented using an internal 32-bit accumulator. 05303 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. 05304 * There is saturation on the addition and subtraction, hence there is no risk of overflow. 05305 */ 05306 CMSIS_INLINE __STATIC_INLINE void arm_park_q31( 05307 q31_t Ialpha, 05308 q31_t Ibeta, 05309 q31_t * pId, 05310 q31_t * pIq, 05311 q31_t sinVal, 05312 q31_t cosVal) 05313 { 05314 q31_t product1, product2; /* Temporary variables used to store intermediate results */ 05315 q31_t product3, product4; /* Temporary variables used to store intermediate results */ 05316 05317 /* Intermediate product is calculated by (Ialpha * cosVal) */ 05318 product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); 05319 05320 /* Intermediate product is calculated by (Ibeta * sinVal) */ 05321 product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); 05322 05323 05324 /* Intermediate product is calculated by (Ialpha * sinVal) */ 05325 product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); 05326 05327 /* Intermediate product is calculated by (Ibeta * cosVal) */ 05328 product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); 05329 05330 /* Calculate pId by adding the two intermediate products 1 and 2 */ 05331 *pId = __QADD(product1, product2); 05332 05333 /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ 05334 *pIq = __QSUB(product4, product3); 05335 } 05336 05337 /** 05338 * @} end of park group 05339 */ 05340 05341 /** 05342 * @brief Converts the elements of the Q7 vector to floating-point vector. 05343 * @param[in] pSrc is input pointer 05344 * @param[out] pDst is output pointer 05345 * @param[in] blockSize is the number of samples to process 05346 */ 05347 void arm_q7_to_float( 05348 q7_t * pSrc, 05349 float32_t * pDst, 05350 uint32_t blockSize); 05351 05352 05353 /** 05354 * @ingroup groupController 05355 */ 05356 05357 /** 05358 * @defgroup inv_park Vector Inverse Park transform 05359 * Inverse Park transform converts the input flux and torque components to two-coordinate vector. 05360 * 05361 * The function operates on a single sample of data and each call to the function returns the processed output. 05362 * The library provides separate functions for Q31 and floating-point data types. 05363 * \par Algorithm 05364 * \image html parkInvFormula.gif 05365 * where <code>pIalpha</code> and <code>pIbeta</code> are the stator vector components, 05366 * <code>Id</code> and <code>Iq</code> are rotor vector components and <code>cosVal</code> and <code>sinVal</code> are the 05367 * cosine and sine values of theta (rotor flux position). 05368 * \par Fixed-Point Behavior 05369 * Care must be taken when using the Q31 version of the Park transform. 05370 * In particular, the overflow and saturation behavior of the accumulator used must be considered. 05371 * Refer to the function specific documentation below for usage guidelines. 05372 */ 05373 05374 /** 05375 * @addtogroup inv_park 05376 * @{ 05377 */ 05378 05379 /** 05380 * @brief Floating-point Inverse Park transform 05381 * @param[in] Id input coordinate of rotor reference frame d 05382 * @param[in] Iq input coordinate of rotor reference frame q 05383 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha 05384 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta 05385 * @param[in] sinVal sine value of rotation angle theta 05386 * @param[in] cosVal cosine value of rotation angle theta 05387 */ 05388 CMSIS_INLINE __STATIC_INLINE void arm_inv_park_f32( 05389 float32_t Id, 05390 float32_t Iq, 05391 float32_t * pIalpha, 05392 float32_t * pIbeta, 05393 float32_t sinVal, 05394 float32_t cosVal) 05395 { 05396 /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ 05397 *pIalpha = Id * cosVal - Iq * sinVal; 05398 05399 /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ 05400 *pIbeta = Id * sinVal + Iq * cosVal; 05401 } 05402 05403 05404 /** 05405 * @brief Inverse Park transform for Q31 version 05406 * @param[in] Id input coordinate of rotor reference frame d 05407 * @param[in] Iq input coordinate of rotor reference frame q 05408 * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha 05409 * @param[out] pIbeta points to output two-phase orthogonal vector axis beta 05410 * @param[in] sinVal sine value of rotation angle theta 05411 * @param[in] cosVal cosine value of rotation angle theta 05412 * 05413 * <b>Scaling and Overflow Behavior:</b> 05414 * \par 05415 * The function is implemented using an internal 32-bit accumulator. 05416 * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. 05417 * There is saturation on the addition, hence there is no risk of overflow. 05418 */ 05419 CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31( 05420 q31_t Id, 05421 q31_t Iq, 05422 q31_t * pIalpha, 05423 q31_t * pIbeta, 05424 q31_t sinVal, 05425 q31_t cosVal) 05426 { 05427 q31_t product1, product2; /* Temporary variables used to store intermediate results */ 05428 q31_t product3, product4; /* Temporary variables used to store intermediate results */ 05429 05430 /* Intermediate product is calculated by (Id * cosVal) */ 05431 product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); 05432 05433 /* Intermediate product is calculated by (Iq * sinVal) */ 05434 product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); 05435 05436 05437 /* Intermediate product is calculated by (Id * sinVal) */ 05438 product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); 05439 05440 /* Intermediate product is calculated by (Iq * cosVal) */ 05441 product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); 05442 05443 /* Calculate pIalpha by using the two intermediate products 1 and 2 */ 05444 *pIalpha = __QSUB(product1, product2); 05445 05446 /* Calculate pIbeta by using the two intermediate products 3 and 4 */ 05447 *pIbeta = __QADD(product4, product3); 05448 } 05449 05450 /** 05451 * @} end of Inverse park group 05452 */ 05453 05454 05455 /** 05456 * @brief Converts the elements of the Q31 vector to floating-point vector. 05457 * @param[in] pSrc is input pointer 05458 * @param[out] pDst is output pointer 05459 * @param[in] blockSize is the number of samples to process 05460 */ 05461 void arm_q31_to_float( 05462 q31_t * pSrc, 05463 float32_t * pDst, 05464 uint32_t blockSize); 05465 05466 /** 05467 * @ingroup groupInterpolation 05468 */ 05469 05470 /** 05471 * @defgroup LinearInterpolate Linear Interpolation 05472 * 05473 * Linear interpolation is a method of curve fitting using linear polynomials. 05474 * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line 05475 * 05476 * \par 05477 * \image html LinearInterp.gif "Linear interpolation" 05478 * 05479 * \par 05480 * A Linear Interpolate function calculates an output value(y), for the input(x) 05481 * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) 05482 * 05483 * \par Algorithm: 05484 * <pre> 05485 * y = y0 + (x - x0) * ((y1 - y0)/(x1-x0)) 05486 * where x0, x1 are nearest values of input x 05487 * y0, y1 are nearest values to output y 05488 * </pre> 05489 * 05490 * \par 05491 * This set of functions implements Linear interpolation process 05492 * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single 05493 * sample of data and each call to the function returns a single processed value. 05494 * <code>S</code> points to an instance of the Linear Interpolate function data structure. 05495 * <code>x</code> is the input sample value. The functions returns the output value. 05496 * 05497 * \par 05498 * if x is outside of the table boundary, Linear interpolation returns first value of the table 05499 * if x is below input range and returns last value of table if x is above range. 05500 */ 05501 05502 /** 05503 * @addtogroup LinearInterpolate 05504 * @{ 05505 */ 05506 05507 /** 05508 * @brief Process function for the floating-point Linear Interpolation Function. 05509 * @param[in,out] S is an instance of the floating-point Linear Interpolation structure 05510 * @param[in] x input sample to process 05511 * @return y processed output sample. 05512 * 05513 */ 05514 CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32( 05515 arm_linear_interp_instance_f32 * S, 05516 float32_t x) 05517 { 05518 float32_t y; 05519 float32_t x0, x1; /* Nearest input values */ 05520 float32_t y0, y1; /* Nearest output values */ 05521 float32_t xSpacing = S->xSpacing; /* spacing between input values */ 05522 int32_t i; /* Index variable */ 05523 float32_t *pYData = S->pYData; /* pointer to output table */ 05524 05525 /* Calculation of index */ 05526 i = (int32_t) ((x - S->x1) / xSpacing); 05527 05528 if (i < 0) 05529 { 05530 /* Iniatilize output for below specified range as least output value of table */ 05531 y = pYData[0]; 05532 } 05533 else if ((uint32_t)i >= S->nValues) 05534 { 05535 /* Iniatilize output for above specified range as last output value of table */ 05536 y = pYData[S->nValues - 1]; 05537 } 05538 else 05539 { 05540 /* Calculation of nearest input values */ 05541 x0 = S->x1 + i * xSpacing; 05542 x1 = S->x1 + (i + 1) * xSpacing; 05543 05544 /* Read of nearest output values */ 05545 y0 = pYData[i]; 05546 y1 = pYData[i + 1]; 05547 05548 /* Calculation of output */ 05549 y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); 05550 05551 } 05552 05553 /* returns output value */ 05554 return (y); 05555 } 05556 05557 05558 /** 05559 * 05560 * @brief Process function for the Q31 Linear Interpolation Function. 05561 * @param[in] pYData pointer to Q31 Linear Interpolation table 05562 * @param[in] x input sample to process 05563 * @param[in] nValues number of table values 05564 * @return y processed output sample. 05565 * 05566 * \par 05567 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. 05568 * This function can support maximum of table size 2^12. 05569 * 05570 */ 05571 CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31( 05572 q31_t * pYData, 05573 q31_t x, 05574 uint32_t nValues) 05575 { 05576 q31_t y; /* output */ 05577 q31_t y0, y1; /* Nearest output values */ 05578 q31_t fract; /* fractional part */ 05579 int32_t index; /* Index to read nearest output values */ 05580 05581 /* Input is in 12.20 format */ 05582 /* 12 bits for the table index */ 05583 /* Index value calculation */ 05584 index = ((x & (q31_t)0xFFF00000) >> 20); 05585 05586 if (index >= (int32_t)(nValues - 1)) 05587 { 05588 return (pYData[nValues - 1]); 05589 } 05590 else if (index < 0) 05591 { 05592 return (pYData[0]); 05593 } 05594 else 05595 { 05596 /* 20 bits for the fractional part */ 05597 /* shift left by 11 to keep fract in 1.31 format */ 05598 fract = (x & 0x000FFFFF) << 11; 05599 05600 /* Read two nearest output values from the index in 1.31(q31) format */ 05601 y0 = pYData[index]; 05602 y1 = pYData[index + 1]; 05603 05604 /* Calculation of y0 * (1-fract) and y is in 2.30 format */ 05605 y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); 05606 05607 /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ 05608 y += ((q31_t) (((q63_t) y1 * fract) >> 32)); 05609 05610 /* Convert y to 1.31 format */ 05611 return (y << 1u); 05612 } 05613 } 05614 05615 05616 /** 05617 * 05618 * @brief Process function for the Q15 Linear Interpolation Function. 05619 * @param[in] pYData pointer to Q15 Linear Interpolation table 05620 * @param[in] x input sample to process 05621 * @param[in] nValues number of table values 05622 * @return y processed output sample. 05623 * 05624 * \par 05625 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. 05626 * This function can support maximum of table size 2^12. 05627 * 05628 */ 05629 CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15( 05630 q15_t * pYData, 05631 q31_t x, 05632 uint32_t nValues) 05633 { 05634 q63_t y; /* output */ 05635 q15_t y0, y1; /* Nearest output values */ 05636 q31_t fract; /* fractional part */ 05637 int32_t index; /* Index to read nearest output values */ 05638 05639 /* Input is in 12.20 format */ 05640 /* 12 bits for the table index */ 05641 /* Index value calculation */ 05642 index = ((x & (int32_t)0xFFF00000) >> 20); 05643 05644 if (index >= (int32_t)(nValues - 1)) 05645 { 05646 return (pYData[nValues - 1]); 05647 } 05648 else if (index < 0) 05649 { 05650 return (pYData[0]); 05651 } 05652 else 05653 { 05654 /* 20 bits for the fractional part */ 05655 /* fract is in 12.20 format */ 05656 fract = (x & 0x000FFFFF); 05657 05658 /* Read two nearest output values from the index */ 05659 y0 = pYData[index]; 05660 y1 = pYData[index + 1]; 05661 05662 /* Calculation of y0 * (1-fract) and y is in 13.35 format */ 05663 y = ((q63_t) y0 * (0xFFFFF - fract)); 05664 05665 /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ 05666 y += ((q63_t) y1 * (fract)); 05667 05668 /* convert y to 1.15 format */ 05669 return (q15_t) (y >> 20); 05670 } 05671 } 05672 05673 05674 /** 05675 * 05676 * @brief Process function for the Q7 Linear Interpolation Function. 05677 * @param[in] pYData pointer to Q7 Linear Interpolation table 05678 * @param[in] x input sample to process 05679 * @param[in] nValues number of table values 05680 * @return y processed output sample. 05681 * 05682 * \par 05683 * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. 05684 * This function can support maximum of table size 2^12. 05685 */ 05686 CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7( 05687 q7_t * pYData, 05688 q31_t x, 05689 uint32_t nValues) 05690 { 05691 q31_t y; /* output */ 05692 q7_t y0, y1; /* Nearest output values */ 05693 q31_t fract; /* fractional part */ 05694 uint32_t index; /* Index to read nearest output values */ 05695 05696 /* Input is in 12.20 format */ 05697 /* 12 bits for the table index */ 05698 /* Index value calculation */ 05699 if (x < 0) 05700 { 05701 return (pYData[0]); 05702 } 05703 index = (x >> 20) & 0xfff; 05704 05705 if (index >= (nValues - 1)) 05706 { 05707 return (pYData[nValues - 1]); 05708 } 05709 else 05710 { 05711 /* 20 bits for the fractional part */ 05712 /* fract is in 12.20 format */ 05713 fract = (x & 0x000FFFFF); 05714 05715 /* Read two nearest output values from the index and are in 1.7(q7) format */ 05716 y0 = pYData[index]; 05717 y1 = pYData[index + 1]; 05718 05719 /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ 05720 y = ((y0 * (0xFFFFF - fract))); 05721 05722 /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ 05723 y += (y1 * fract); 05724 05725 /* convert y to 1.7(q7) format */ 05726 return (q7_t) (y >> 20); 05727 } 05728 } 05729 05730 /** 05731 * @} end of LinearInterpolate group 05732 */ 05733 05734 /** 05735 * @brief Fast approximation to the trigonometric sine function for floating-point data. 05736 * @param[in] x input value in radians. 05737 * @return sin(x). 05738 */ 05739 float32_t arm_sin_f32( 05740 float32_t x); 05741 05742 05743 /** 05744 * @brief Fast approximation to the trigonometric sine function for Q31 data. 05745 * @param[in] x Scaled input value in radians. 05746 * @return sin(x). 05747 */ 05748 q31_t arm_sin_q31( 05749 q31_t x); 05750 05751 05752 /** 05753 * @brief Fast approximation to the trigonometric sine function for Q15 data. 05754 * @param[in] x Scaled input value in radians. 05755 * @return sin(x). 05756 */ 05757 q15_t arm_sin_q15( 05758 q15_t x); 05759 05760 05761 /** 05762 * @brief Fast approximation to the trigonometric cosine function for floating-point data. 05763 * @param[in] x input value in radians. 05764 * @return cos(x). 05765 */ 05766 float32_t arm_cos_f32( 05767 float32_t x); 05768 05769 05770 /** 05771 * @brief Fast approximation to the trigonometric cosine function for Q31 data. 05772 * @param[in] x Scaled input value in radians. 05773 * @return cos(x). 05774 */ 05775 q31_t arm_cos_q31( 05776 q31_t x); 05777 05778 05779 /** 05780 * @brief Fast approximation to the trigonometric cosine function for Q15 data. 05781 * @param[in] x Scaled input value in radians. 05782 * @return cos(x). 05783 */ 05784 q15_t arm_cos_q15( 05785 q15_t x); 05786 05787 05788 /** 05789 * @ingroup groupFastMath 05790 */ 05791 05792 05793 /** 05794 * @defgroup SQRT Square Root 05795 * 05796 * Computes the square root of a number. 05797 * There are separate functions for Q15, Q31, and floating-point data types. 05798 * The square root function is computed using the Newton-Raphson algorithm. 05799 * This is an iterative algorithm of the form: 05800 * <pre> 05801 * x1 = x0 - f(x0)/f'(x0) 05802 * </pre> 05803 * where <code>x1</code> is the current estimate, 05804 * <code>x0</code> is the previous estimate, and 05805 * <code>f'(x0)</code> is the derivative of <code>f()</code> evaluated at <code>x0</code>. 05806 * For the square root function, the algorithm reduces to: 05807 * <pre> 05808 * x0 = in/2 [initial guess] 05809 * x1 = 1/2 * ( x0 + in / x0) [each iteration] 05810 * </pre> 05811 */ 05812 05813 05814 /** 05815 * @addtogroup SQRT 05816 * @{ 05817 */ 05818 05819 /** 05820 * @brief Floating-point square root function. 05821 * @param[in] in input value. 05822 * @param[out] pOut square root of input value. 05823 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if 05824 * <code>in</code> is negative value and returns zero output for negative values. 05825 */ 05826 CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32( 05827 float32_t in, 05828 float32_t * pOut) 05829 { 05830 if (in >= 0.0f) 05831 { 05832 05833 #if (__FPU_USED == 1) && defined ( __CC_ARM ) 05834 *pOut = __sqrtf(in); 05835 #elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) 05836 *pOut = __builtin_sqrtf(in); 05837 #elif (__FPU_USED == 1) && defined(__GNUC__) 05838 *pOut = __builtin_sqrtf(in); 05839 #elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) 05840 __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); 05841 #else 05842 *pOut = sqrtf(in); 05843 #endif 05844 05845 return (ARM_MATH_SUCCESS); 05846 } 05847 else 05848 { 05849 *pOut = 0.0f; 05850 return (ARM_MATH_ARGUMENT_ERROR); 05851 } 05852 } 05853 05854 05855 /** 05856 * @brief Q31 square root function. 05857 * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. 05858 * @param[out] pOut square root of input value. 05859 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if 05860 * <code>in</code> is negative value and returns zero output for negative values. 05861 */ 05862 arm_status arm_sqrt_q31( 05863 q31_t in, 05864 q31_t * pOut); 05865 05866 05867 /** 05868 * @brief Q15 square root function. 05869 * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. 05870 * @param[out] pOut square root of input value. 05871 * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if 05872 * <code>in</code> is negative value and returns zero output for negative values. 05873 */ 05874 arm_status arm_sqrt_q15( 05875 q15_t in, 05876 q15_t * pOut); 05877 05878 /** 05879 * @} end of SQRT group 05880 */ 05881 05882 05883 /** 05884 * @brief floating-point Circular write function. 05885 */ 05886 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32( 05887 int32_t * circBuffer, 05888 int32_t L, 05889 uint16_t * writeOffset, 05890 int32_t bufferInc, 05891 const int32_t * src, 05892 int32_t srcInc, 05893 uint32_t blockSize) 05894 { 05895 uint32_t i = 0u; 05896 int32_t wOffset; 05897 05898 /* Copy the value of Index pointer that points 05899 * to the current location where the input samples to be copied */ 05900 wOffset = *writeOffset; 05901 05902 /* Loop over the blockSize */ 05903 i = blockSize; 05904 05905 while (i > 0u) 05906 { 05907 /* copy the input sample to the circular buffer */ 05908 circBuffer[wOffset] = *src; 05909 05910 /* Update the input pointer */ 05911 src += srcInc; 05912 05913 /* Circularly update wOffset. Watch out for positive and negative value */ 05914 wOffset += bufferInc; 05915 if (wOffset >= L) 05916 wOffset -= L; 05917 05918 /* Decrement the loop counter */ 05919 i--; 05920 } 05921 05922 /* Update the index pointer */ 05923 *writeOffset = (uint16_t)wOffset; 05924 } 05925 05926 05927 05928 /** 05929 * @brief floating-point Circular Read function. 05930 */ 05931 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32( 05932 int32_t * circBuffer, 05933 int32_t L, 05934 int32_t * readOffset, 05935 int32_t bufferInc, 05936 int32_t * dst, 05937 int32_t * dst_base, 05938 int32_t dst_length, 05939 int32_t dstInc, 05940 uint32_t blockSize) 05941 { 05942 uint32_t i = 0u; 05943 int32_t rOffset, dst_end; 05944 05945 /* Copy the value of Index pointer that points 05946 * to the current location from where the input samples to be read */ 05947 rOffset = *readOffset; 05948 dst_end = (int32_t) (dst_base + dst_length); 05949 05950 /* Loop over the blockSize */ 05951 i = blockSize; 05952 05953 while (i > 0u) 05954 { 05955 /* copy the sample from the circular buffer to the destination buffer */ 05956 *dst = circBuffer[rOffset]; 05957 05958 /* Update the input pointer */ 05959 dst += dstInc; 05960 05961 if (dst == (int32_t *) dst_end) 05962 { 05963 dst = dst_base; 05964 } 05965 05966 /* Circularly update rOffset. Watch out for positive and negative value */ 05967 rOffset += bufferInc; 05968 05969 if (rOffset >= L) 05970 { 05971 rOffset -= L; 05972 } 05973 05974 /* Decrement the loop counter */ 05975 i--; 05976 } 05977 05978 /* Update the index pointer */ 05979 *readOffset = rOffset; 05980 } 05981 05982 05983 /** 05984 * @brief Q15 Circular write function. 05985 */ 05986 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15( 05987 q15_t * circBuffer, 05988 int32_t L, 05989 uint16_t * writeOffset, 05990 int32_t bufferInc, 05991 const q15_t * src, 05992 int32_t srcInc, 05993 uint32_t blockSize) 05994 { 05995 uint32_t i = 0u; 05996 int32_t wOffset; 05997 05998 /* Copy the value of Index pointer that points 05999 * to the current location where the input samples to be copied */ 06000 wOffset = *writeOffset; 06001 06002 /* Loop over the blockSize */ 06003 i = blockSize; 06004 06005 while (i > 0u) 06006 { 06007 /* copy the input sample to the circular buffer */ 06008 circBuffer[wOffset] = *src; 06009 06010 /* Update the input pointer */ 06011 src += srcInc; 06012 06013 /* Circularly update wOffset. Watch out for positive and negative value */ 06014 wOffset += bufferInc; 06015 if (wOffset >= L) 06016 wOffset -= L; 06017 06018 /* Decrement the loop counter */ 06019 i--; 06020 } 06021 06022 /* Update the index pointer */ 06023 *writeOffset = (uint16_t)wOffset; 06024 } 06025 06026 06027 /** 06028 * @brief Q15 Circular Read function. 06029 */ 06030 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15( 06031 q15_t * circBuffer, 06032 int32_t L, 06033 int32_t * readOffset, 06034 int32_t bufferInc, 06035 q15_t * dst, 06036 q15_t * dst_base, 06037 int32_t dst_length, 06038 int32_t dstInc, 06039 uint32_t blockSize) 06040 { 06041 uint32_t i = 0; 06042 int32_t rOffset, dst_end; 06043 06044 /* Copy the value of Index pointer that points 06045 * to the current location from where the input samples to be read */ 06046 rOffset = *readOffset; 06047 06048 dst_end = (int32_t) (dst_base + dst_length); 06049 06050 /* Loop over the blockSize */ 06051 i = blockSize; 06052 06053 while (i > 0u) 06054 { 06055 /* copy the sample from the circular buffer to the destination buffer */ 06056 *dst = circBuffer[rOffset]; 06057 06058 /* Update the input pointer */ 06059 dst += dstInc; 06060 06061 if (dst == (q15_t *) dst_end) 06062 { 06063 dst = dst_base; 06064 } 06065 06066 /* Circularly update wOffset. Watch out for positive and negative value */ 06067 rOffset += bufferInc; 06068 06069 if (rOffset >= L) 06070 { 06071 rOffset -= L; 06072 } 06073 06074 /* Decrement the loop counter */ 06075 i--; 06076 } 06077 06078 /* Update the index pointer */ 06079 *readOffset = rOffset; 06080 } 06081 06082 06083 /** 06084 * @brief Q7 Circular write function. 06085 */ 06086 CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7( 06087 q7_t * circBuffer, 06088 int32_t L, 06089 uint16_t * writeOffset, 06090 int32_t bufferInc, 06091 const q7_t * src, 06092 int32_t srcInc, 06093 uint32_t blockSize) 06094 { 06095 uint32_t i = 0u; 06096 int32_t wOffset; 06097 06098 /* Copy the value of Index pointer that points 06099 * to the current location where the input samples to be copied */ 06100 wOffset = *writeOffset; 06101 06102 /* Loop over the blockSize */ 06103 i = blockSize; 06104 06105 while (i > 0u) 06106 { 06107 /* copy the input sample to the circular buffer */ 06108 circBuffer[wOffset] = *src; 06109 06110 /* Update the input pointer */ 06111 src += srcInc; 06112 06113 /* Circularly update wOffset. Watch out for positive and negative value */ 06114 wOffset += bufferInc; 06115 if (wOffset >= L) 06116 wOffset -= L; 06117 06118 /* Decrement the loop counter */ 06119 i--; 06120 } 06121 06122 /* Update the index pointer */ 06123 *writeOffset = (uint16_t)wOffset; 06124 } 06125 06126 06127 /** 06128 * @brief Q7 Circular Read function. 06129 */ 06130 CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7( 06131 q7_t * circBuffer, 06132 int32_t L, 06133 int32_t * readOffset, 06134 int32_t bufferInc, 06135 q7_t * dst, 06136 q7_t * dst_base, 06137 int32_t dst_length, 06138 int32_t dstInc, 06139 uint32_t blockSize) 06140 { 06141 uint32_t i = 0; 06142 int32_t rOffset, dst_end; 06143 06144 /* Copy the value of Index pointer that points 06145 * to the current location from where the input samples to be read */ 06146 rOffset = *readOffset; 06147 06148 dst_end = (int32_t) (dst_base + dst_length); 06149 06150 /* Loop over the blockSize */ 06151 i = blockSize; 06152 06153 while (i > 0u) 06154 { 06155 /* copy the sample from the circular buffer to the destination buffer */ 06156 *dst = circBuffer[rOffset]; 06157 06158 /* Update the input pointer */ 06159 dst += dstInc; 06160 06161 if (dst == (q7_t *) dst_end) 06162 { 06163 dst = dst_base; 06164 } 06165 06166 /* Circularly update rOffset. Watch out for positive and negative value */ 06167 rOffset += bufferInc; 06168 06169 if (rOffset >= L) 06170 { 06171 rOffset -= L; 06172 } 06173 06174 /* Decrement the loop counter */ 06175 i--; 06176 } 06177 06178 /* Update the index pointer */ 06179 *readOffset = rOffset; 06180 } 06181 06182 06183 /** 06184 * @brief Sum of the squares of the elements of a Q31 vector. 06185 * @param[in] pSrc is input pointer 06186 * @param[in] blockSize is the number of samples to process 06187 * @param[out] pResult is output value. 06188 */ 06189 void arm_power_q31( 06190 q31_t * pSrc, 06191 uint32_t blockSize, 06192 q63_t * pResult); 06193 06194 06195 /** 06196 * @brief Sum of the squares of the elements of a floating-point vector. 06197 * @param[in] pSrc is input pointer 06198 * @param[in] blockSize is the number of samples to process 06199 * @param[out] pResult is output value. 06200 */ 06201 void arm_power_f32( 06202 float32_t * pSrc, 06203 uint32_t blockSize, 06204 float32_t * pResult); 06205 06206 06207 /** 06208 * @brief Sum of the squares of the elements of a Q15 vector. 06209 * @param[in] pSrc is input pointer 06210 * @param[in] blockSize is the number of samples to process 06211 * @param[out] pResult is output value. 06212 */ 06213 void arm_power_q15( 06214 q15_t * pSrc, 06215 uint32_t blockSize, 06216 q63_t * pResult); 06217 06218 06219 /** 06220 * @brief Sum of the squares of the elements of a Q7 vector. 06221 * @param[in] pSrc is input pointer 06222 * @param[in] blockSize is the number of samples to process 06223 * @param[out] pResult is output value. 06224 */ 06225 void arm_power_q7( 06226 q7_t * pSrc, 06227 uint32_t blockSize, 06228 q31_t * pResult); 06229 06230 06231 /** 06232 * @brief Mean value of a Q7 vector. 06233 * @param[in] pSrc is input pointer 06234 * @param[in] blockSize is the number of samples to process 06235 * @param[out] pResult is output value. 06236 */ 06237 void arm_mean_q7( 06238 q7_t * pSrc, 06239 uint32_t blockSize, 06240 q7_t * pResult); 06241 06242 06243 /** 06244 * @brief Mean value of a Q15 vector. 06245 * @param[in] pSrc is input pointer 06246 * @param[in] blockSize is the number of samples to process 06247 * @param[out] pResult is output value. 06248 */ 06249 void arm_mean_q15( 06250 q15_t * pSrc, 06251 uint32_t blockSize, 06252 q15_t * pResult); 06253 06254 06255 /** 06256 * @brief Mean value of a Q31 vector. 06257 * @param[in] pSrc is input pointer 06258 * @param[in] blockSize is the number of samples to process 06259 * @param[out] pResult is output value. 06260 */ 06261 void arm_mean_q31( 06262 q31_t * pSrc, 06263 uint32_t blockSize, 06264 q31_t * pResult); 06265 06266 06267 /** 06268 * @brief Mean value of a floating-point vector. 06269 * @param[in] pSrc is input pointer 06270 * @param[in] blockSize is the number of samples to process 06271 * @param[out] pResult is output value. 06272 */ 06273 void arm_mean_f32( 06274 float32_t * pSrc, 06275 uint32_t blockSize, 06276 float32_t * pResult); 06277 06278 06279 /** 06280 * @brief Variance of the elements of a floating-point vector. 06281 * @param[in] pSrc is input pointer 06282 * @param[in] blockSize is the number of samples to process 06283 * @param[out] pResult is output value. 06284 */ 06285 void arm_var_f32( 06286 float32_t * pSrc, 06287 uint32_t blockSize, 06288 float32_t * pResult); 06289 06290 06291 /** 06292 * @brief Variance of the elements of a Q31 vector. 06293 * @param[in] pSrc is input pointer 06294 * @param[in] blockSize is the number of samples to process 06295 * @param[out] pResult is output value. 06296 */ 06297 void arm_var_q31( 06298 q31_t * pSrc, 06299 uint32_t blockSize, 06300 q31_t * pResult); 06301 06302 06303 /** 06304 * @brief Variance of the elements of a Q15 vector. 06305 * @param[in] pSrc is input pointer 06306 * @param[in] blockSize is the number of samples to process 06307 * @param[out] pResult is output value. 06308 */ 06309 void arm_var_q15( 06310 q15_t * pSrc, 06311 uint32_t blockSize, 06312 q15_t * pResult); 06313 06314 06315 /** 06316 * @brief Root Mean Square of the elements of a floating-point vector. 06317 * @param[in] pSrc is input pointer 06318 * @param[in] blockSize is the number of samples to process 06319 * @param[out] pResult is output value. 06320 */ 06321 void arm_rms_f32( 06322 float32_t * pSrc, 06323 uint32_t blockSize, 06324 float32_t * pResult); 06325 06326 06327 /** 06328 * @brief Root Mean Square of the elements of a Q31 vector. 06329 * @param[in] pSrc is input pointer 06330 * @param[in] blockSize is the number of samples to process 06331 * @param[out] pResult is output value. 06332 */ 06333 void arm_rms_q31( 06334 q31_t * pSrc, 06335 uint32_t blockSize, 06336 q31_t * pResult); 06337 06338 06339 /** 06340 * @brief Root Mean Square of the elements of a Q15 vector. 06341 * @param[in] pSrc is input pointer 06342 * @param[in] blockSize is the number of samples to process 06343 * @param[out] pResult is output value. 06344 */ 06345 void arm_rms_q15( 06346 q15_t * pSrc, 06347 uint32_t blockSize, 06348 q15_t * pResult); 06349 06350 06351 /** 06352 * @brief Standard deviation of the elements of a floating-point vector. 06353 * @param[in] pSrc is input pointer 06354 * @param[in] blockSize is the number of samples to process 06355 * @param[out] pResult is output value. 06356 */ 06357 void arm_std_f32( 06358 float32_t * pSrc, 06359 uint32_t blockSize, 06360 float32_t * pResult); 06361 06362 06363 /** 06364 * @brief Standard deviation of the elements of a Q31 vector. 06365 * @param[in] pSrc is input pointer 06366 * @param[in] blockSize is the number of samples to process 06367 * @param[out] pResult is output value. 06368 */ 06369 void arm_std_q31( 06370 q31_t * pSrc, 06371 uint32_t blockSize, 06372 q31_t * pResult); 06373 06374 06375 /** 06376 * @brief Standard deviation of the elements of a Q15 vector. 06377 * @param[in] pSrc is input pointer 06378 * @param[in] blockSize is the number of samples to process 06379 * @param[out] pResult is output value. 06380 */ 06381 void arm_std_q15( 06382 q15_t * pSrc, 06383 uint32_t blockSize, 06384 q15_t * pResult); 06385 06386 06387 /** 06388 * @brief Floating-point complex magnitude 06389 * @param[in] pSrc points to the complex input vector 06390 * @param[out] pDst points to the real output vector 06391 * @param[in] numSamples number of complex samples in the input vector 06392 */ 06393 void arm_cmplx_mag_f32( 06394 float32_t * pSrc, 06395 float32_t * pDst, 06396 uint32_t numSamples); 06397 06398 06399 /** 06400 * @brief Q31 complex magnitude 06401 * @param[in] pSrc points to the complex input vector 06402 * @param[out] pDst points to the real output vector 06403 * @param[in] numSamples number of complex samples in the input vector 06404 */ 06405 void arm_cmplx_mag_q31( 06406 q31_t * pSrc, 06407 q31_t * pDst, 06408 uint32_t numSamples); 06409 06410 06411 /** 06412 * @brief Q15 complex magnitude 06413 * @param[in] pSrc points to the complex input vector 06414 * @param[out] pDst points to the real output vector 06415 * @param[in] numSamples number of complex samples in the input vector 06416 */ 06417 void arm_cmplx_mag_q15( 06418 q15_t * pSrc, 06419 q15_t * pDst, 06420 uint32_t numSamples); 06421 06422 06423 /** 06424 * @brief Q15 complex dot product 06425 * @param[in] pSrcA points to the first input vector 06426 * @param[in] pSrcB points to the second input vector 06427 * @param[in] numSamples number of complex samples in each vector 06428 * @param[out] realResult real part of the result returned here 06429 * @param[out] imagResult imaginary part of the result returned here 06430 */ 06431 void arm_cmplx_dot_prod_q15( 06432 q15_t * pSrcA, 06433 q15_t * pSrcB, 06434 uint32_t numSamples, 06435 q31_t * realResult, 06436 q31_t * imagResult); 06437 06438 06439 /** 06440 * @brief Q31 complex dot product 06441 * @param[in] pSrcA points to the first input vector 06442 * @param[in] pSrcB points to the second input vector 06443 * @param[in] numSamples number of complex samples in each vector 06444 * @param[out] realResult real part of the result returned here 06445 * @param[out] imagResult imaginary part of the result returned here 06446 */ 06447 void arm_cmplx_dot_prod_q31( 06448 q31_t * pSrcA, 06449 q31_t * pSrcB, 06450 uint32_t numSamples, 06451 q63_t * realResult, 06452 q63_t * imagResult); 06453 06454 06455 /** 06456 * @brief Floating-point complex dot product 06457 * @param[in] pSrcA points to the first input vector 06458 * @param[in] pSrcB points to the second input vector 06459 * @param[in] numSamples number of complex samples in each vector 06460 * @param[out] realResult real part of the result returned here 06461 * @param[out] imagResult imaginary part of the result returned here 06462 */ 06463 void arm_cmplx_dot_prod_f32( 06464 float32_t * pSrcA, 06465 float32_t * pSrcB, 06466 uint32_t numSamples, 06467 float32_t * realResult, 06468 float32_t * imagResult); 06469 06470 06471 /** 06472 * @brief Q15 complex-by-real multiplication 06473 * @param[in] pSrcCmplx points to the complex input vector 06474 * @param[in] pSrcReal points to the real input vector 06475 * @param[out] pCmplxDst points to the complex output vector 06476 * @param[in] numSamples number of samples in each vector 06477 */ 06478 void arm_cmplx_mult_real_q15( 06479 q15_t * pSrcCmplx, 06480 q15_t * pSrcReal, 06481 q15_t * pCmplxDst, 06482 uint32_t numSamples); 06483 06484 06485 /** 06486 * @brief Q31 complex-by-real multiplication 06487 * @param[in] pSrcCmplx points to the complex input vector 06488 * @param[in] pSrcReal points to the real input vector 06489 * @param[out] pCmplxDst points to the complex output vector 06490 * @param[in] numSamples number of samples in each vector 06491 */ 06492 void arm_cmplx_mult_real_q31( 06493 q31_t * pSrcCmplx, 06494 q31_t * pSrcReal, 06495 q31_t * pCmplxDst, 06496 uint32_t numSamples); 06497 06498 06499 /** 06500 * @brief Floating-point complex-by-real multiplication 06501 * @param[in] pSrcCmplx points to the complex input vector 06502 * @param[in] pSrcReal points to the real input vector 06503 * @param[out] pCmplxDst points to the complex output vector 06504 * @param[in] numSamples number of samples in each vector 06505 */ 06506 void arm_cmplx_mult_real_f32( 06507 float32_t * pSrcCmplx, 06508 float32_t * pSrcReal, 06509 float32_t * pCmplxDst, 06510 uint32_t numSamples); 06511 06512 06513 /** 06514 * @brief Minimum value of a Q7 vector. 06515 * @param[in] pSrc is input pointer 06516 * @param[in] blockSize is the number of samples to process 06517 * @param[out] result is output pointer 06518 * @param[in] index is the array index of the minimum value in the input buffer. 06519 */ 06520 void arm_min_q7( 06521 q7_t * pSrc, 06522 uint32_t blockSize, 06523 q7_t * result, 06524 uint32_t * index); 06525 06526 06527 /** 06528 * @brief Minimum value of a Q15 vector. 06529 * @param[in] pSrc is input pointer 06530 * @param[in] blockSize is the number of samples to process 06531 * @param[out] pResult is output pointer 06532 * @param[in] pIndex is the array index of the minimum value in the input buffer. 06533 */ 06534 void arm_min_q15( 06535 q15_t * pSrc, 06536 uint32_t blockSize, 06537 q15_t * pResult, 06538 uint32_t * pIndex); 06539 06540 06541 /** 06542 * @brief Minimum value of a Q31 vector. 06543 * @param[in] pSrc is input pointer 06544 * @param[in] blockSize is the number of samples to process 06545 * @param[out] pResult is output pointer 06546 * @param[out] pIndex is the array index of the minimum value in the input buffer. 06547 */ 06548 void arm_min_q31( 06549 q31_t * pSrc, 06550 uint32_t blockSize, 06551 q31_t * pResult, 06552 uint32_t * pIndex); 06553 06554 06555 /** 06556 * @brief Minimum value of a floating-point vector. 06557 * @param[in] pSrc is input pointer 06558 * @param[in] blockSize is the number of samples to process 06559 * @param[out] pResult is output pointer 06560 * @param[out] pIndex is the array index of the minimum value in the input buffer. 06561 */ 06562 void arm_min_f32( 06563 float32_t * pSrc, 06564 uint32_t blockSize, 06565 float32_t * pResult, 06566 uint32_t * pIndex); 06567 06568 06569 /** 06570 * @brief Maximum value of a Q7 vector. 06571 * @param[in] pSrc points to the input buffer 06572 * @param[in] blockSize length of the input vector 06573 * @param[out] pResult maximum value returned here 06574 * @param[out] pIndex index of maximum value returned here 06575 */ 06576 void arm_max_q7( 06577 q7_t * pSrc, 06578 uint32_t blockSize, 06579 q7_t * pResult, 06580 uint32_t * pIndex); 06581 06582 06583 /** 06584 * @brief Maximum value of a Q15 vector. 06585 * @param[in] pSrc points to the input buffer 06586 * @param[in] blockSize length of the input vector 06587 * @param[out] pResult maximum value returned here 06588 * @param[out] pIndex index of maximum value returned here 06589 */ 06590 void arm_max_q15( 06591 q15_t * pSrc, 06592 uint32_t blockSize, 06593 q15_t * pResult, 06594 uint32_t * pIndex); 06595 06596 06597 /** 06598 * @brief Maximum value of a Q31 vector. 06599 * @param[in] pSrc points to the input buffer 06600 * @param[in] blockSize length of the input vector 06601 * @param[out] pResult maximum value returned here 06602 * @param[out] pIndex index of maximum value returned here 06603 */ 06604 void arm_max_q31( 06605 q31_t * pSrc, 06606 uint32_t blockSize, 06607 q31_t * pResult, 06608 uint32_t * pIndex); 06609 06610 06611 /** 06612 * @brief Maximum value of a floating-point vector. 06613 * @param[in] pSrc points to the input buffer 06614 * @param[in] blockSize length of the input vector 06615 * @param[out] pResult maximum value returned here 06616 * @param[out] pIndex index of maximum value returned here 06617 */ 06618 void arm_max_f32( 06619 float32_t * pSrc, 06620 uint32_t blockSize, 06621 float32_t * pResult, 06622 uint32_t * pIndex); 06623 06624 06625 /** 06626 * @brief Q15 complex-by-complex multiplication 06627 * @param[in] pSrcA points to the first input vector 06628 * @param[in] pSrcB points to the second input vector 06629 * @param[out] pDst points to the output vector 06630 * @param[in] numSamples number of complex samples in each vector 06631 */ 06632 void arm_cmplx_mult_cmplx_q15( 06633 q15_t * pSrcA, 06634 q15_t * pSrcB, 06635 q15_t * pDst, 06636 uint32_t numSamples); 06637 06638 06639 /** 06640 * @brief Q31 complex-by-complex multiplication 06641 * @param[in] pSrcA points to the first input vector 06642 * @param[in] pSrcB points to the second input vector 06643 * @param[out] pDst points to the output vector 06644 * @param[in] numSamples number of complex samples in each vector 06645 */ 06646 void arm_cmplx_mult_cmplx_q31( 06647 q31_t * pSrcA, 06648 q31_t * pSrcB, 06649 q31_t * pDst, 06650 uint32_t numSamples); 06651 06652 06653 /** 06654 * @brief Floating-point complex-by-complex multiplication 06655 * @param[in] pSrcA points to the first input vector 06656 * @param[in] pSrcB points to the second input vector 06657 * @param[out] pDst points to the output vector 06658 * @param[in] numSamples number of complex samples in each vector 06659 */ 06660 void arm_cmplx_mult_cmplx_f32( 06661 float32_t * pSrcA, 06662 float32_t * pSrcB, 06663 float32_t * pDst, 06664 uint32_t numSamples); 06665 06666 06667 /** 06668 * @brief Converts the elements of the floating-point vector to Q31 vector. 06669 * @param[in] pSrc points to the floating-point input vector 06670 * @param[out] pDst points to the Q31 output vector 06671 * @param[in] blockSize length of the input vector 06672 */ 06673 void arm_float_to_q31( 06674 float32_t * pSrc, 06675 q31_t * pDst, 06676 uint32_t blockSize); 06677 06678 06679 /** 06680 * @brief Converts the elements of the floating-point vector to Q15 vector. 06681 * @param[in] pSrc points to the floating-point input vector 06682 * @param[out] pDst points to the Q15 output vector 06683 * @param[in] blockSize length of the input vector 06684 */ 06685 void arm_float_to_q15( 06686 float32_t * pSrc, 06687 q15_t * pDst, 06688 uint32_t blockSize); 06689 06690 06691 /** 06692 * @brief Converts the elements of the floating-point vector to Q7 vector. 06693 * @param[in] pSrc points to the floating-point input vector 06694 * @param[out] pDst points to the Q7 output vector 06695 * @param[in] blockSize length of the input vector 06696 */ 06697 void arm_float_to_q7( 06698 float32_t * pSrc, 06699 q7_t * pDst, 06700 uint32_t blockSize); 06701 06702 06703 /** 06704 * @brief Converts the elements of the Q31 vector to Q15 vector. 06705 * @param[in] pSrc is input pointer 06706 * @param[out] pDst is output pointer 06707 * @param[in] blockSize is the number of samples to process 06708 */ 06709 void arm_q31_to_q15( 06710 q31_t * pSrc, 06711 q15_t * pDst, 06712 uint32_t blockSize); 06713 06714 06715 /** 06716 * @brief Converts the elements of the Q31 vector to Q7 vector. 06717 * @param[in] pSrc is input pointer 06718 * @param[out] pDst is output pointer 06719 * @param[in] blockSize is the number of samples to process 06720 */ 06721 void arm_q31_to_q7( 06722 q31_t * pSrc, 06723 q7_t * pDst, 06724 uint32_t blockSize); 06725 06726 06727 /** 06728 * @brief Converts the elements of the Q15 vector to floating-point vector. 06729 * @param[in] pSrc is input pointer 06730 * @param[out] pDst is output pointer 06731 * @param[in] blockSize is the number of samples to process 06732 */ 06733 void arm_q15_to_float( 06734 q15_t * pSrc, 06735 float32_t * pDst, 06736 uint32_t blockSize); 06737 06738 06739 /** 06740 * @brief Converts the elements of the Q15 vector to Q31 vector. 06741 * @param[in] pSrc is input pointer 06742 * @param[out] pDst is output pointer 06743 * @param[in] blockSize is the number of samples to process 06744 */ 06745 void arm_q15_to_q31( 06746 q15_t * pSrc, 06747 q31_t * pDst, 06748 uint32_t blockSize); 06749 06750 06751 /** 06752 * @brief Converts the elements of the Q15 vector to Q7 vector. 06753 * @param[in] pSrc is input pointer 06754 * @param[out] pDst is output pointer 06755 * @param[in] blockSize is the number of samples to process 06756 */ 06757 void arm_q15_to_q7( 06758 q15_t * pSrc, 06759 q7_t * pDst, 06760 uint32_t blockSize); 06761 06762 06763 /** 06764 * @ingroup groupInterpolation 06765 */ 06766 06767 /** 06768 * @defgroup BilinearInterpolate Bilinear Interpolation 06769 * 06770 * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. 06771 * The underlying function <code>f(x, y)</code> is sampled on a regular grid and the interpolation process 06772 * determines values between the grid points. 06773 * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. 06774 * Bilinear interpolation is often used in image processing to rescale images. 06775 * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. 06776 * 06777 * <b>Algorithm</b> 06778 * \par 06779 * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. 06780 * For floating-point, the instance structure is defined as: 06781 * <pre> 06782 * typedef struct 06783 * { 06784 * uint16_t numRows; 06785 * uint16_t numCols; 06786 * float32_t *pData; 06787 * } arm_bilinear_interp_instance_f32; 06788 * </pre> 06789 * 06790 * \par 06791 * where <code>numRows</code> specifies the number of rows in the table; 06792 * <code>numCols</code> specifies the number of columns in the table; 06793 * and <code>pData</code> points to an array of size <code>numRows*numCols</code> values. 06794 * The data table <code>pTable</code> is organized in row order and the supplied data values fall on integer indexes. 06795 * That is, table element (x,y) is located at <code>pTable[x + y*numCols]</code> where x and y are integers. 06796 * 06797 * \par 06798 * Let <code>(x, y)</code> specify the desired interpolation point. Then define: 06799 * <pre> 06800 * XF = floor(x) 06801 * YF = floor(y) 06802 * </pre> 06803 * \par 06804 * The interpolated output point is computed as: 06805 * <pre> 06806 * f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF)) 06807 * + f(XF+1, YF) * (x-XF)*(1-(y-YF)) 06808 * + f(XF, YF+1) * (1-(x-XF))*(y-YF) 06809 * + f(XF+1, YF+1) * (x-XF)*(y-YF) 06810 * </pre> 06811 * Note that the coordinates (x, y) contain integer and fractional components. 06812 * The integer components specify which portion of the table to use while the 06813 * fractional components control the interpolation processor. 06814 * 06815 * \par 06816 * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. 06817 */ 06818 06819 /** 06820 * @addtogroup BilinearInterpolate 06821 * @{ 06822 */ 06823 06824 06825 /** 06826 * 06827 * @brief Floating-point bilinear interpolation. 06828 * @param[in,out] S points to an instance of the interpolation structure. 06829 * @param[in] X interpolation coordinate. 06830 * @param[in] Y interpolation coordinate. 06831 * @return out interpolated value. 06832 */ 06833 CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32( 06834 const arm_bilinear_interp_instance_f32 * S, 06835 float32_t X, 06836 float32_t Y) 06837 { 06838 float32_t out; 06839 float32_t f00, f01, f10, f11; 06840 float32_t *pData = S->pData; 06841 int32_t xIndex, yIndex, index; 06842 float32_t xdiff, ydiff; 06843 float32_t b1, b2, b3, b4; 06844 06845 xIndex = (int32_t) X; 06846 yIndex = (int32_t) Y; 06847 06848 /* Care taken for table outside boundary */ 06849 /* Returns zero output when values are outside table boundary */ 06850 if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) 06851 { 06852 return (0); 06853 } 06854 06855 /* Calculation of index for two nearest points in X-direction */ 06856 index = (xIndex - 1) + (yIndex - 1) * S->numCols; 06857 06858 06859 /* Read two nearest points in X-direction */ 06860 f00 = pData[index]; 06861 f01 = pData[index + 1]; 06862 06863 /* Calculation of index for two nearest points in Y-direction */ 06864 index = (xIndex - 1) + (yIndex) * S->numCols; 06865 06866 06867 /* Read two nearest points in Y-direction */ 06868 f10 = pData[index]; 06869 f11 = pData[index + 1]; 06870 06871 /* Calculation of intermediate values */ 06872 b1 = f00; 06873 b2 = f01 - f00; 06874 b3 = f10 - f00; 06875 b4 = f00 - f01 - f10 + f11; 06876 06877 /* Calculation of fractional part in X */ 06878 xdiff = X - xIndex; 06879 06880 /* Calculation of fractional part in Y */ 06881 ydiff = Y - yIndex; 06882 06883 /* Calculation of bi-linear interpolated output */ 06884 out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; 06885 06886 /* return to application */ 06887 return (out); 06888 } 06889 06890 06891 /** 06892 * 06893 * @brief Q31 bilinear interpolation. 06894 * @param[in,out] S points to an instance of the interpolation structure. 06895 * @param[in] X interpolation coordinate in 12.20 format. 06896 * @param[in] Y interpolation coordinate in 12.20 format. 06897 * @return out interpolated value. 06898 */ 06899 CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31( 06900 arm_bilinear_interp_instance_q31 * S, 06901 q31_t X, 06902 q31_t Y) 06903 { 06904 q31_t out; /* Temporary output */ 06905 q31_t acc = 0; /* output */ 06906 q31_t xfract, yfract; /* X, Y fractional parts */ 06907 q31_t x1, x2, y1, y2; /* Nearest output values */ 06908 int32_t rI, cI; /* Row and column indices */ 06909 q31_t *pYData = S->pData; /* pointer to output table values */ 06910 uint32_t nCols = S->numCols; /* num of rows */ 06911 06912 /* Input is in 12.20 format */ 06913 /* 12 bits for the table index */ 06914 /* Index value calculation */ 06915 rI = ((X & (q31_t)0xFFF00000) >> 20); 06916 06917 /* Input is in 12.20 format */ 06918 /* 12 bits for the table index */ 06919 /* Index value calculation */ 06920 cI = ((Y & (q31_t)0xFFF00000) >> 20); 06921 06922 /* Care taken for table outside boundary */ 06923 /* Returns zero output when values are outside table boundary */ 06924 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) 06925 { 06926 return (0); 06927 } 06928 06929 /* 20 bits for the fractional part */ 06930 /* shift left xfract by 11 to keep 1.31 format */ 06931 xfract = (X & 0x000FFFFF) << 11u; 06932 06933 /* Read two nearest output values from the index */ 06934 x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; 06935 x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; 06936 06937 /* 20 bits for the fractional part */ 06938 /* shift left yfract by 11 to keep 1.31 format */ 06939 yfract = (Y & 0x000FFFFF) << 11u; 06940 06941 /* Read two nearest output values from the index */ 06942 y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; 06943 y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; 06944 06945 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ 06946 out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); 06947 acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); 06948 06949 /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ 06950 out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); 06951 acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); 06952 06953 /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ 06954 out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); 06955 acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); 06956 06957 /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ 06958 out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); 06959 acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); 06960 06961 /* Convert acc to 1.31(q31) format */ 06962 return ((q31_t)(acc << 2)); 06963 } 06964 06965 06966 /** 06967 * @brief Q15 bilinear interpolation. 06968 * @param[in,out] S points to an instance of the interpolation structure. 06969 * @param[in] X interpolation coordinate in 12.20 format. 06970 * @param[in] Y interpolation coordinate in 12.20 format. 06971 * @return out interpolated value. 06972 */ 06973 CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15( 06974 arm_bilinear_interp_instance_q15 * S, 06975 q31_t X, 06976 q31_t Y) 06977 { 06978 q63_t acc = 0; /* output */ 06979 q31_t out; /* Temporary output */ 06980 q15_t x1, x2, y1, y2; /* Nearest output values */ 06981 q31_t xfract, yfract; /* X, Y fractional parts */ 06982 int32_t rI, cI; /* Row and column indices */ 06983 q15_t *pYData = S->pData; /* pointer to output table values */ 06984 uint32_t nCols = S->numCols; /* num of rows */ 06985 06986 /* Input is in 12.20 format */ 06987 /* 12 bits for the table index */ 06988 /* Index value calculation */ 06989 rI = ((X & (q31_t)0xFFF00000) >> 20); 06990 06991 /* Input is in 12.20 format */ 06992 /* 12 bits for the table index */ 06993 /* Index value calculation */ 06994 cI = ((Y & (q31_t)0xFFF00000) >> 20); 06995 06996 /* Care taken for table outside boundary */ 06997 /* Returns zero output when values are outside table boundary */ 06998 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) 06999 { 07000 return (0); 07001 } 07002 07003 /* 20 bits for the fractional part */ 07004 /* xfract should be in 12.20 format */ 07005 xfract = (X & 0x000FFFFF); 07006 07007 /* Read two nearest output values from the index */ 07008 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; 07009 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; 07010 07011 /* 20 bits for the fractional part */ 07012 /* yfract should be in 12.20 format */ 07013 yfract = (Y & 0x000FFFFF); 07014 07015 /* Read two nearest output values from the index */ 07016 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; 07017 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; 07018 07019 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ 07020 07021 /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ 07022 /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ 07023 out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); 07024 acc = ((q63_t) out * (0xFFFFF - yfract)); 07025 07026 /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ 07027 out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); 07028 acc += ((q63_t) out * (xfract)); 07029 07030 /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ 07031 out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); 07032 acc += ((q63_t) out * (yfract)); 07033 07034 /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ 07035 out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); 07036 acc += ((q63_t) out * (yfract)); 07037 07038 /* acc is in 13.51 format and down shift acc by 36 times */ 07039 /* Convert out to 1.15 format */ 07040 return ((q15_t)(acc >> 36)); 07041 } 07042 07043 07044 /** 07045 * @brief Q7 bilinear interpolation. 07046 * @param[in,out] S points to an instance of the interpolation structure. 07047 * @param[in] X interpolation coordinate in 12.20 format. 07048 * @param[in] Y interpolation coordinate in 12.20 format. 07049 * @return out interpolated value. 07050 */ 07051 CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7( 07052 arm_bilinear_interp_instance_q7 * S, 07053 q31_t X, 07054 q31_t Y) 07055 { 07056 q63_t acc = 0; /* output */ 07057 q31_t out; /* Temporary output */ 07058 q31_t xfract, yfract; /* X, Y fractional parts */ 07059 q7_t x1, x2, y1, y2; /* Nearest output values */ 07060 int32_t rI, cI; /* Row and column indices */ 07061 q7_t *pYData = S->pData; /* pointer to output table values */ 07062 uint32_t nCols = S->numCols; /* num of rows */ 07063 07064 /* Input is in 12.20 format */ 07065 /* 12 bits for the table index */ 07066 /* Index value calculation */ 07067 rI = ((X & (q31_t)0xFFF00000) >> 20); 07068 07069 /* Input is in 12.20 format */ 07070 /* 12 bits for the table index */ 07071 /* Index value calculation */ 07072 cI = ((Y & (q31_t)0xFFF00000) >> 20); 07073 07074 /* Care taken for table outside boundary */ 07075 /* Returns zero output when values are outside table boundary */ 07076 if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) 07077 { 07078 return (0); 07079 } 07080 07081 /* 20 bits for the fractional part */ 07082 /* xfract should be in 12.20 format */ 07083 xfract = (X & (q31_t)0x000FFFFF); 07084 07085 /* Read two nearest output values from the index */ 07086 x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; 07087 x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; 07088 07089 /* 20 bits for the fractional part */ 07090 /* yfract should be in 12.20 format */ 07091 yfract = (Y & (q31_t)0x000FFFFF); 07092 07093 /* Read two nearest output values from the index */ 07094 y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; 07095 y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; 07096 07097 /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ 07098 out = ((x1 * (0xFFFFF - xfract))); 07099 acc = (((q63_t) out * (0xFFFFF - yfract))); 07100 07101 /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ 07102 out = ((x2 * (0xFFFFF - yfract))); 07103 acc += (((q63_t) out * (xfract))); 07104 07105 /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ 07106 out = ((y1 * (0xFFFFF - xfract))); 07107 acc += (((q63_t) out * (yfract))); 07108 07109 /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ 07110 out = ((y2 * (yfract))); 07111 acc += (((q63_t) out * (xfract))); 07112 07113 /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ 07114 return ((q7_t)(acc >> 40)); 07115 } 07116 07117 /** 07118 * @} end of BilinearInterpolate group 07119 */ 07120 07121 07122 /* SMMLAR */ 07123 #define multAcc_32x32_keep32_R(a, x, y) \ 07124 a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) 07125 07126 /* SMMLSR */ 07127 #define multSub_32x32_keep32_R(a, x, y) \ 07128 a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) 07129 07130 /* SMMULR */ 07131 #define mult_32x32_keep32_R(a, x, y) \ 07132 a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) 07133 07134 /* SMMLA */ 07135 #define multAcc_32x32_keep32(a, x, y) \ 07136 a += (q31_t) (((q63_t) x * y) >> 32) 07137 07138 /* SMMLS */ 07139 #define multSub_32x32_keep32(a, x, y) \ 07140 a -= (q31_t) (((q63_t) x * y) >> 32) 07141 07142 /* SMMUL */ 07143 #define mult_32x32_keep32(a, x, y) \ 07144 a = (q31_t) (((q63_t) x * y ) >> 32) 07145 07146 07147 #if defined ( __CC_ARM ) 07148 /* Enter low optimization region - place directly above function definition */ 07149 #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) 07150 #define LOW_OPTIMIZATION_ENTER \ 07151 _Pragma ("push") \ 07152 _Pragma ("O1") 07153 #else 07154 #define LOW_OPTIMIZATION_ENTER 07155 #endif 07156 07157 /* Exit low optimization region - place directly after end of function definition */ 07158 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) 07159 #define LOW_OPTIMIZATION_EXIT \ 07160 _Pragma ("pop") 07161 #else 07162 #define LOW_OPTIMIZATION_EXIT 07163 #endif 07164 07165 /* Enter low optimization region - place directly above function definition */ 07166 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07167 07168 /* Exit low optimization region - place directly after end of function definition */ 07169 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07170 07171 #elif defined (__ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) 07172 #define LOW_OPTIMIZATION_ENTER 07173 #define LOW_OPTIMIZATION_EXIT 07174 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07175 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07176 07177 #elif defined ( __GNUC__ ) 07178 #define LOW_OPTIMIZATION_ENTER \ 07179 __attribute__(( optimize("-O1") )) 07180 #define LOW_OPTIMIZATION_EXIT 07181 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07182 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07183 07184 #elif defined ( __ICCARM__ ) 07185 /* Enter low optimization region - place directly above function definition */ 07186 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) 07187 #define LOW_OPTIMIZATION_ENTER \ 07188 _Pragma ("optimize=low") 07189 #else 07190 #define LOW_OPTIMIZATION_ENTER 07191 #endif 07192 07193 /* Exit low optimization region - place directly after end of function definition */ 07194 #define LOW_OPTIMIZATION_EXIT 07195 07196 /* Enter low optimization region - place directly above function definition */ 07197 #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) 07198 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ 07199 _Pragma ("optimize=low") 07200 #else 07201 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07202 #endif 07203 07204 /* Exit low optimization region - place directly after end of function definition */ 07205 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07206 07207 #elif defined ( __TI_ARM__ ) 07208 #define LOW_OPTIMIZATION_ENTER 07209 #define LOW_OPTIMIZATION_EXIT 07210 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07211 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07212 07213 #elif defined ( __CSMC__ ) 07214 #define LOW_OPTIMIZATION_ENTER 07215 #define LOW_OPTIMIZATION_EXIT 07216 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07217 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07218 07219 #elif defined ( __TASKING__ ) 07220 #define LOW_OPTIMIZATION_ENTER 07221 #define LOW_OPTIMIZATION_EXIT 07222 #define IAR_ONLY_LOW_OPTIMIZATION_ENTER 07223 #define IAR_ONLY_LOW_OPTIMIZATION_EXIT 07224 07225 #endif 07226 07227 07228 #ifdef __cplusplus 07229 } 07230 #endif 07231 07232 /* Compiler specific diagnostic adjustment */ 07233 #if defined ( __CC_ARM ) 07234 07235 #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) 07236 07237 #elif defined ( __GNUC__ ) 07238 #pragma GCC diagnostic pop 07239 07240 #elif defined ( __ICCARM__ ) 07241 07242 #elif defined ( __TI_ARM__ ) 07243 07244 #elif defined ( __CSMC__ ) 07245 07246 #elif defined ( __TASKING__ ) 07247 07248 #else 07249 #error Unknown compiler 07250 #endif 07251 07252 #endif /* _ARM_MATH_H */ 07253 07254 /** 07255 * 07256 * End of file. 07257 */
Generated on Tue Jul 12 2022 19:39:48 by
