* The library has separate functions for operating on 8-bit integers, 16-bit integers,
* 32-bit integer and 32-bit floating-point values.
*
* <b>Pre-processor Macros</b>
*
* Each library project have differant pre-processor macros.
*
* - UNALIGNED_SUPPORT_DISABLE:
*
* Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
*
* - ARM_MATH_BIG_ENDIAN:
*
* Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
*
* - ARM_MATH_MATRIX_CHECK:
*
* Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
*
* - ARM_MATH_ROUNDING:
*
* Define macro ARM_MATH_ROUNDING for rounding on support functions
*
* - ARM_MATH_CMx:
*
* Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
* and ARM_MATH_CM0 for building library on cortex-M0 target.
*
* - __FPU_PRESENT:
*
* Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
*
* <b>Toolchain Support</b>
*
* The library has been developed and tested with MDK-ARM version 4.23.
* The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
*
* <b>Using the Library</b>
*
* The library installer contains prebuilt versions of the libraries in the <code>Lib</code> folder.
...
...
@@ -103,12 +77,17 @@
* Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single
* public header file <code> arm_math.h</code> for Cortex-M4/M3/M0 with little endian and big endian. Same header file will be used for floating point unit(FPU) variants.
* Define the appropriate pre processor MACRO ARM_MATH_CM4 or ARM_MATH_CM3 or
* ARM_MATH_CM0 depending on the target processor in the application.
* ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application.
*
* <b>Examples</b>
*
* The library ships with a number of examples which demonstrate how to use the library functions.
*
* <b>Toolchain Support</b>
*
* The library has been developed and tested with MDK-ARM version 4.60.
* The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly.
*
* <b>Building the Library</b>
*
* The library installer contains project files to re build libraries on MDK Tool chain in the <code>CMSIS\\DSP_Lib\\Source\\ARM</code> folder.
...
...
@@ -122,11 +101,40 @@
* - arm_cortexM4lf_math.uvproj
*
*
* The project can be built by opening the appropriate project in MDK-ARM 4.23 chain and defining the optional pre processor MACROs detailed above.
* The project can be built by opening the appropriate project in MDK-ARM 4.60 chain and defining the optional pre processor MACROs detailed above.
*
* <b>Pre-processor Macros</b>
*
* Each library project have differant pre-processor macros.
*
* - UNALIGNED_SUPPORT_DISABLE:
*
* Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access
*
* - ARM_MATH_BIG_ENDIAN:
*
* Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets.
*
* - ARM_MATH_MATRIX_CHECK:
*
* Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices
*
* - ARM_MATH_ROUNDING:
*
* Define macro ARM_MATH_ROUNDING for rounding on support functions
*
* - ARM_MATH_CMx:
*
* Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target
* and ARM_MATH_CM0 for building library on cortex-M0 target, ARM_MATH_CM0PLUS for building library on cortex-M0+ target.
*
* - __FPU_PRESENT:
*
* Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries
*
* <b>Copyright Notice</b>
*
* Copyright (C) 2010 ARM Limited. All rights reserved.
* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
*/
...
...
@@ -264,6 +272,10 @@
#include "core_cm3.h"
#elif defined (ARM_MATH_CM0)
#include "core_cm0.h"
#define ARM_MATH_CM0_FAMILY
#elif defined (ARM_MATH_CM0PLUS)
#include "core_cm0plus.h"
#define ARM_MATH_CM0_FAMILY
#else
#include "ARMCM4.h"
#warning "Define either ARM_MATH_CM4 OR ARM_MATH_CM3...By Default building on ARM_MATH_CM4....."
...
...
@@ -365,17 +377,27 @@ extern "C"
/**
* @brief definition to read/write two 16 bit values.
#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0)
#define __SIMD64(addr) (*(int64_t **) & (addr))
#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
/**
* @brief definition to pack two 16 bit values.
*/
...
...
@@ -409,7 +431,7 @@ extern "C"
/**
* @brief Clips Q63 to Q31 values.
*/
__STATIC_INLINEq31_tclip_q63_to_q31(
static__INLINEq31_tclip_q63_to_q31(
q63_tx)
{
return((q31_t)(x>>32)!=((q31_t)x>>31))?
...
...
@@ -419,7 +441,7 @@ extern "C"
/**
* @brief Clips Q63 to Q15 values.
*/
__STATIC_INLINEq15_tclip_q63_to_q15(
static__INLINEq15_tclip_q63_to_q15(
q63_tx)
{
return((q31_t)(x>>32)!=((q31_t)x>>31))?
...
...
@@ -429,7 +451,7 @@ extern "C"
/**
* @brief Clips Q31 to Q7 values.
*/
__STATIC_INLINEq7_tclip_q31_to_q7(
static__INLINEq7_tclip_q31_to_q7(
q31_tx)
{
return((q31_t)(x>>24)!=((q31_t)x>>23))?
...
...
@@ -439,7 +461,7 @@ extern "C"
/**
* @brief Clips Q31 to Q15 values.
*/
__STATIC_INLINEq15_tclip_q31_to_q15(
static__INLINEq15_tclip_q31_to_q15(
q31_tx)
{
return((q31_t)(x>>16)!=((q31_t)x>>15))?
...
...
@@ -450,7 +472,7 @@ extern "C"
* @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
*/
__STATIC_INLINEq63_tmult32x64(
static__INLINEq63_tmult32x64(
q63_tx,
q31_ty)
{
...
...
@@ -459,20 +481,18 @@ extern "C"
}
#if defined (ARM_MATH_CM0) && defined ( __CC_ARM )
#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
#define __CLZ __clz
#endif
#if defined (ARM_MATH_CM0) && defined ( __TASKING__ )
/* No need to redefine __CLZ */
#endif
#if defined (ARM_MATH_CM0) && ((defined (__ICCARM__)) ||(defined (__GNUC__)) )
#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ||(defined (__GNUC__)) || defined (__TASKING__) )
__STATIC_INLINEuint32_t__CLZ(q31_tdata);
static__INLINEuint32_t__CLZ(
q31_tdata);
__STATIC_INLINEuint32_t__CLZ(q31_tdata)
static__INLINEuint32_t__CLZ(
q31_tdata)
{
uint32_tcount=0;
uint32_tmask=0x80000000;
...
...
@@ -490,10 +510,10 @@ extern "C"
#endif
/**
* @brief Function to Calculates 1/in(reciprocal) value of Q31 Data type.
* @brief Function to Calculates 1/in(reciprocal) value of Q31 Data type.
*/
__STATIC_INLINEuint32_tarm_recip_q31(
static__INLINEuint32_tarm_recip_q31(
q31_tin,
q31_t*dst,
q31_t*pRecipTable)
...
...
@@ -542,9 +562,9 @@ extern "C"
}
/**
* @brief Function to Calculates 1/in(reciprocal) value of Q15 Data type.
* @brief Function to Calculates 1/in(reciprocal) value of Q15 Data type.
*/
__STATIC_INLINEuint32_tarm_recip_q15(
static__INLINEuint32_tarm_recip_q15(
q15_tin,
q15_t*dst,
q15_t*pRecipTable)
...
...
@@ -595,9 +615,9 @@ extern "C"
/*
* @brief C custom defined intrinisic function for only M0 processors
*/
#if defined(ARM_MATH_CM0)
#if defined(ARM_MATH_CM0_FAMILY)
__STATIC_INLINEq31_t__SSAT(
static__INLINEq31_t__SSAT(
q31_tx,
uint32_ty)
{
...
...
@@ -633,19 +653,19 @@ extern "C"
}
#endif /* end of ARM_MATH_CM0 */
#endif /* end of ARM_MATH_CM0_FAMILY */
/*
* @brief C custom defined intrinsic function for M3 and M0 processors
*/
#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0)
#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
/*
* @brief C custom defined QADD8 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QADD8(
static__INLINEq31_t__QADD8(
q31_tx,
q31_ty)
{
...
...
@@ -672,7 +692,7 @@ extern "C"
/*
* @brief C custom defined QSUB8 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QSUB8(
static__INLINEq31_t__QSUB8(
q31_tx,
q31_ty)
{
...
...
@@ -702,7 +722,7 @@ extern "C"
/*
* @brief C custom defined QADD16 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QADD16(
static__INLINEq31_t__QADD16(
q31_tx,
q31_ty)
{
...
...
@@ -725,7 +745,7 @@ extern "C"
/*
* @brief C custom defined SHADD16 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SHADD16(
static__INLINEq31_t__SHADD16(
q31_tx,
q31_ty)
{
...
...
@@ -748,7 +768,7 @@ extern "C"
/*
* @brief C custom defined QSUB16 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QSUB16(
static__INLINEq31_t__QSUB16(
q31_tx,
q31_ty)
{
...
...
@@ -770,7 +790,7 @@ extern "C"
/*
* @brief C custom defined SHSUB16 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SHSUB16(
static__INLINEq31_t__SHSUB16(
q31_tx,
q31_ty)
{
...
...
@@ -792,7 +812,7 @@ extern "C"
/*
* @brief C custom defined QASX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QASX(
static__INLINEq31_t__QASX(
q31_tx,
q31_ty)
{
...
...
@@ -810,7 +830,7 @@ extern "C"
/*
* @brief C custom defined SHASX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SHASX(
static__INLINEq31_t__SHASX(
q31_tx,
q31_ty)
{
...
...
@@ -833,7 +853,7 @@ extern "C"
/*
* @brief C custom defined QSAX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QSAX(
static__INLINEq31_t__QSAX(
q31_tx,
q31_ty)
{
...
...
@@ -851,7 +871,7 @@ extern "C"
/*
* @brief C custom defined SHSAX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SHSAX(
static__INLINEq31_t__SHSAX(
q31_tx,
q31_ty)
{
...
...
@@ -873,7 +893,7 @@ extern "C"
/*
* @brief C custom defined SMUSDX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMUSDX(
static__INLINEq31_t__SMUSDX(
q31_tx,
q31_ty)
{
...
...
@@ -885,7 +905,7 @@ extern "C"
/*
* @brief C custom defined SMUADX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMUADX(
static__INLINEq31_t__SMUADX(
q31_tx,
q31_ty)
{
...
...
@@ -897,7 +917,7 @@ extern "C"
/*
* @brief C custom defined QADD for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QADD(
static__INLINEq31_t__QADD(
q31_tx,
q31_ty)
{
...
...
@@ -907,7 +927,7 @@ extern "C"
/*
* @brief C custom defined QSUB for M3 and M0 processors
*/
__STATIC_INLINEq31_t__QSUB(
static__INLINEq31_t__QSUB(
q31_tx,
q31_ty)
{
...
...
@@ -917,7 +937,7 @@ extern "C"
/*
* @brief C custom defined SMLAD for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMLAD(
static__INLINEq31_t__SMLAD(
q31_tx,
q31_ty,
q31_tsum)
...
...
@@ -930,7 +950,7 @@ extern "C"
/*
* @brief C custom defined SMLADX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMLADX(
static__INLINEq31_t__SMLADX(
q31_tx,
q31_ty,
q31_tsum)
...
...
@@ -943,7 +963,7 @@ extern "C"
/*
* @brief C custom defined SMLSDX for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMLSDX(
static__INLINEq31_t__SMLSDX(
q31_tx,
q31_ty,
q31_tsum)
...
...
@@ -956,7 +976,7 @@ extern "C"
/*
* @brief C custom defined SMLALD for M3 and M0 processors
*/
__STATIC_INLINEq63_t__SMLALD(
static__INLINEq63_t__SMLALD(
q31_tx,
q31_ty,
q63_tsum)
...
...
@@ -969,7 +989,7 @@ extern "C"
/*
* @brief C custom defined SMLALDX for M3 and M0 processors
*/
__STATIC_INLINEq63_t__SMLALDX(
static__INLINEq63_t__SMLALDX(
q31_tx,
q31_ty,
q63_tsum)
...
...
@@ -982,7 +1002,7 @@ extern "C"
/*
* @brief C custom defined SMUAD for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMUAD(
static__INLINEq31_t__SMUAD(
q31_tx,
q31_ty)
{
...
...
@@ -994,7 +1014,7 @@ extern "C"
/*
* @brief C custom defined SMUSD for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SMUSD(
static__INLINEq31_t__SMUSD(
q31_tx,
q31_ty)
{
...
...
@@ -1007,7 +1027,7 @@ extern "C"
/*
* @brief C custom defined SXTB16 for M3 and M0 processors
*/
__STATIC_INLINEq31_t__SXTB16(
static__INLINEq31_t__SXTB16(
q31_tx)
{
...
...
@@ -1016,7 +1036,7 @@ extern "C"
}
#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0) */
#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
/**
...
...
@@ -1516,6 +1536,7 @@ extern "C"
* @param[in] *pSrcA points to the first input matrix structure
* @param[in] *pSrcB points to the second input matrix structure
* @param[out] *pDst points to output matrix structure
* @param[in] *pState points to the array for storing intermediate results
* @return The function returns either
* <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
*/
...
...
@@ -1713,7 +1734,7 @@ extern "C"
typedefstruct
{
q15_tA0;/**< The derived gain, A0 = Kp + Ki + Kd . */
#ifdef ARM_MATH_CM0
#ifdef ARM_MATH_CM0_FAMILY
q15_tA1;
q15_tA2;
#else
...
...
@@ -1931,23 +1952,12 @@ extern "C"
uint32_tblockSize);
/**
* @brief Instance structure for the Q15 CFFT/CIFFT function.
*/
typedefstruct
{
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
q15_t*pTwiddle;/**< points to the twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
}arm_cfft_radix4_instance_q15;
/**
* @brief Instance structure for the Q31 CFFT/CIFFT function.
* @brief Instance structure for the Q15 CFFT/CIFFT function.
*/
typedefstruct
...
...
@@ -1955,28 +1965,22 @@ extern "C"
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
q31_t*pTwiddle;/**< points to the twiddle factor table. */
q15_t*pTwiddle;/**< points to the Sin twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
}arm_cfft_radix4_instance_q31;
}arm_cfft_radix2_instance_q15;
arm_statusarm_cfft_radix2_init_q15(
arm_cfft_radix2_instance_q15*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
/**
* @brief Instance structure for the floating-point CFFT/CIFFT function.
*/
voidarm_cfft_radix2_q15(
constarm_cfft_radix2_instance_q15*S,
q15_t*pSrc);
typedefstruct
{
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
float32_t*pTwiddle;/**< points to the twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
float32_tonebyfftLen;/**< value of 1/fftLen. */
}arm_cfft_radix4_instance_f32;
/**
...
...
@@ -1988,11 +1992,21 @@ extern "C"
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
q15_t*pTwiddle;/**< points to the Sin twiddle factor table. */
q15_t*pTwiddle;/**< points to the twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
}arm_cfft_radix2_instance_q15;
}arm_cfft_radix4_instance_q15;
arm_statusarm_cfft_radix4_init_q15(
arm_cfft_radix4_instance_q15*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
voidarm_cfft_radix4_q15(
constarm_cfft_radix4_instance_q15*S,
q15_t*pSrc);
/**
* @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
...
...
@@ -2009,8 +2023,18 @@ extern "C"
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
}arm_cfft_radix2_instance_q31;
arm_statusarm_cfft_radix2_init_q31(
arm_cfft_radix2_instance_q31*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
voidarm_cfft_radix2_q31(
constarm_cfft_radix2_instance_q31*S,
q31_t*pSrc);
/**
* @brief Instance structure for the floating-point CFFT/CIFFT function.
* @brief Instance structure for the Q31 CFFT/CIFFT function.
*/
typedefstruct
...
...
@@ -2018,86 +2042,17 @@ extern "C"
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
float32_t*pTwiddle;/**< points to the Twiddle factor table. */
q31_t*pTwiddle;/**< points to the twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
float32_tonebyfftLen;/**< value of 1/fftLen. */
}arm_cfft_radix2_instance_f32;
/**
* @brief Processing function for the Q15 CFFT/CIFFT.
* @param[in] *S points to an instance of the Q15 CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
*/
voidarm_cfft_radix4_q15(
constarm_cfft_radix4_instance_q15*S,
q15_t*pSrc);
/**
* @brief Processing function for the Q15 CFFT/CIFFT.
* @param[in] *S points to an instance of the Q15 CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
*/
voidarm_cfft_radix2_q15(
constarm_cfft_radix2_instance_q15*S,
q15_t*pSrc);
/**
* @brief Initialization function for the Q15 CFFT/CIFFT.
* @param[in,out] *S points to an instance of the Q15 CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
*/
arm_statusarm_cfft_radix4_init_q15(
arm_cfft_radix4_instance_q15*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
/**
* @brief Initialization function for the Q15 CFFT/CIFFT.
* @param[in,out] *S points to an instance of the Q15 CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
*/
}arm_cfft_radix4_instance_q31;
arm_statusarm_cfft_radix2_init_q15(
arm_cfft_radix2_instance_q15*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
/**
* @brief Processing function for the Q31 CFFT/CIFFT.
* @param[in] *S points to an instance of the Q31 CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
*/
voidarm_cfft_radix4_q31(
constarm_cfft_radix4_instance_q31*S,
q31_t*pSrc);
/**
* @brief Initialization function for the Q31 CFFT/CIFFT.
* @param[in,out] *S points to an instance of the Q31 CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
*/
arm_statusarm_cfft_radix4_init_q31(
arm_cfft_radix4_instance_q31*S,
uint16_tfftLen,
...
...
@@ -2105,322 +2060,79 @@ extern "C"
uint8_tbitReverseFlag);
/**
* @brief Processing function for the Radix-2 Q31 CFFT/CIFFT.
* @param[in] *S points to an instance of the Radix-2 Q31 CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
* @brief Instance structure for the floating-point CFFT/CIFFT function.
*/
voidarm_cfft_radix2_q31(
constarm_cfft_radix2_instance_q31*S,
q31_t*pSrc);
/**
* @brief Initialization function for the Radix-2 Q31 CFFT/CIFFT.
* @param[in,out] *S points to an instance of the Radix-2 Q31 CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
*/
typedefstruct
{
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
float32_t*pTwiddle;/**< points to the Twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
float32_tonebyfftLen;/**< value of 1/fftLen. */
}arm_cfft_radix2_instance_f32;
arm_statusarm_cfft_radix2_init_q31(
arm_cfft_radix2_instance_q31*S,
/* Deprecated */
arm_statusarm_cfft_radix2_init_f32(
arm_cfft_radix2_instance_f32*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
/**
* @brief Processing function for the floating-point CFFT/CIFFT.
* @param[in] *S points to an instance of the floating-point CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
*/
/* Deprecated */
voidarm_cfft_radix2_f32(
constarm_cfft_radix2_instance_f32*S,
float32_t*pSrc);
/**
* @brief Initialization function for the floating-point CFFT/CIFFT.
* @param[in,out] *S points to an instance of the floating-point CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
* @brief Instance structure for the floating-point CFFT/CIFFT function.
*/
arm_statusarm_cfft_radix2_init_f32(
arm_cfft_radix2_instance_f32*S,
typedefstruct
{
uint16_tfftLen;/**< length of the FFT. */
uint8_tifftFlag;/**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
uint8_tbitReverseFlag;/**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
float32_t*pTwiddle;/**< points to the Twiddle factor table. */
uint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_ttwidCoefModifier;/**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
uint16_tbitRevFactor;/**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
float32_tonebyfftLen;/**< value of 1/fftLen. */
}arm_cfft_radix4_instance_f32;
/* Deprecated */
arm_statusarm_cfft_radix4_init_f32(
arm_cfft_radix4_instance_f32*S,
uint16_tfftLen,
uint8_tifftFlag,
uint8_tbitReverseFlag);
/**
* @brief Processing function for the floating-point CFFT/CIFFT.
* @param[in] *S points to an instance of the floating-point CFFT/CIFFT structure.
* @param[in, out] *pSrc points to the complex data buffer. Processing occurs in-place.
* @return none.
*/
/* Deprecated */
voidarm_cfft_radix4_f32(
constarm_cfft_radix4_instance_f32*S,
float32_t*pSrc);
/**
* @brief Initialization function for the floating-point CFFT/CIFFT.
* @param[in,out] *S points to an instance of the floating-point CFFT/CIFFT structure.
* @param[in] fftLen length of the FFT.
* @param[in] ifftFlag flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLen</code> is not a supported value.
* @brief Instance structure for the floating-point CFFT/CIFFT function.
*/
arm_statusarm_cfft_radix4_init_f32(
arm_cfft_radix4_instance_f32*S,
uint16_tfftLen,
typedefstruct
{
uint16_tfftLen;/**< length of the FFT. */
constfloat32_t*pTwiddle;/**< points to the Twiddle factor table. */
constuint16_t*pBitRevTable;/**< points to the bit reversal table. */
uint16_tbitRevLength;/**< bit reversal table length. */
* @brief Core function for the floating-point CFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to the twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix4_butterfly_f32(
float32_t*pSrc,
uint16_tfftLen,
float32_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the floating-point CIFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @param[in] onebyfftLen value of 1/fftLen.
* @return none.
*/
voidarm_radix4_butterfly_inverse_f32(
float32_t*pSrc,
uint16_tfftLen,
float32_t*pCoef,
uint16_ttwidCoefModifier,
float32_tonebyfftLen);
/**
* @brief In-place bit reversal function.
* @param[in, out] *pSrc points to the in-place buffer of floating-point data type.
* @param[in] fftSize length of the FFT.
* @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table.
* @param[in] *pBitRevTab points to the bit reversal table.
* @return none.
*/
voidarm_bitreversal_f32(
float32_t*pSrc,
uint16_tfftSize,
uint16_tbitRevFactor,
uint16_t*pBitRevTab);
/**
* @brief Core function for the Q31 CFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix4_butterfly_q31(
q31_t*pSrc,
uint32_tfftLen,
q31_t*pCoef,
uint32_ttwidCoefModifier);
/**
* @brief Core function for the f32 FFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of f32 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix2_butterfly_f32(
float32_t*pSrc,
uint32_tfftLen,
float32_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the Radix-2 Q31 CFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix2_butterfly_q31(
q31_t*pSrc,
uint32_tfftLen,
q31_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the Radix-2 Q15 CFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q15 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix2_butterfly_q15(
q15_t*pSrc,
uint32_tfftLen,
q15_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the Radix-2 Q15 CFFT Inverse butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q15 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix2_butterfly_inverse_q15(
q15_t*pSrc,
uint32_tfftLen,
q15_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the Radix-2 Q31 CFFT Inverse butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix2_butterfly_inverse_q31(
q31_t*pSrc,
uint32_tfftLen,
q31_t*pCoef,
uint16_ttwidCoefModifier);
/**
* @brief Core function for the f32 IFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of f32 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to Twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @param[in] onebyfftLen 1/fftLenfth
* @return none.
*/
voidarm_radix2_butterfly_inverse_f32(
float32_t*pSrc,
uint32_tfftLen,
float32_t*pCoef,
uint16_ttwidCoefModifier,
float32_tonebyfftLen);
/**
* @brief Core function for the Q31 CIFFT butterfly process.
* @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef points to twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix4_butterfly_inverse_q31(
q31_t*pSrc,
uint32_tfftLen,
q31_t*pCoef,
uint32_ttwidCoefModifier);
/**
* @brief In-place bit reversal function.
* @param[in, out] *pSrc points to the in-place buffer of Q31 data type.
* @param[in] fftLen length of the FFT.
* @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table
* @param[in] *pBitRevTab points to bit reversal table.
* @return none.
*/
voidarm_bitreversal_q31(
q31_t*pSrc,
uint32_tfftLen,
uint16_tbitRevFactor,
uint16_t*pBitRevTab);
/**
* @brief Core function for the Q15 CFFT butterfly process.
* @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef16 points to twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix4_butterfly_q15(
q15_t*pSrc16,
uint32_tfftLen,
q15_t*pCoef16,
uint32_ttwidCoefModifier);
/**
* @brief Core function for the Q15 CIFFT butterfly process.
* @param[in, out] *pSrc16 points to the in-place buffer of Q15 data type.
* @param[in] fftLen length of the FFT.
* @param[in] *pCoef16 points to twiddle coefficient buffer.
* @param[in] twidCoefModifier twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table.
* @return none.
*/
voidarm_radix4_butterfly_inverse_q15(
q15_t*pSrc16,
uint32_tfftLen,
q15_t*pCoef16,
uint32_ttwidCoefModifier);
/**
* @brief In-place bit reversal function.
* @param[in, out] *pSrc points to the in-place buffer of Q15 data type.
* @param[in] fftLen length of the FFT.
* @param[in] bitRevFactor bit reversal modifier that supports different size FFTs with the same bit reversal table
* @param[in] *pBitRevTab points to bit reversal table.
* @return none.
*/
voidarm_bitreversal_q15(
q15_t*pSrc,
uint32_tfftLen,
uint16_tbitRevFactor,
uint16_t*pBitRevTab);
/**
* @brief Instance structure for the Q15 RFFT/RIFFT function.
*/
...
...
@@ -2437,6 +2149,18 @@ extern "C"
arm_cfft_radix4_instance_q15*pCfft;/**< points to the complex FFT instance. */
}arm_rfft_instance_q15;
arm_statusarm_rfft_init_q15(
arm_rfft_instance_q15*S,
arm_cfft_radix4_instance_q15*S_CFFT,
uint32_tfftLenReal,
uint32_tifftFlagR,
uint32_tbitReverseFlag);
voidarm_rfft_q15(
constarm_rfft_instance_q15*S,
q15_t*pSrc,
q15_t*pDst);
/**
* @brief Instance structure for the Q31 RFFT/RIFFT function.
*/
...
...
@@ -2453,6 +2177,18 @@ extern "C"
arm_cfft_radix4_instance_q31*pCfft;/**< points to the complex FFT instance. */
}arm_rfft_instance_q31;
arm_statusarm_rfft_init_q31(
arm_rfft_instance_q31*S,
arm_cfft_radix4_instance_q31*S_CFFT,
uint32_tfftLenReal,
uint32_tifftFlagR,
uint32_tbitReverseFlag);
voidarm_rfft_q31(
constarm_rfft_instance_q31*S,
q31_t*pSrc,
q31_t*pDst);
/**
* @brief Instance structure for the floating-point RFFT/RIFFT function.
*/
...
...
@@ -2469,76 +2205,6 @@ extern "C"
arm_cfft_radix4_instance_f32*pCfft;/**< points to the complex FFT instance. */
}arm_rfft_instance_f32;
/**
* @brief Processing function for the Q15 RFFT/RIFFT.
* @param[in] *S points to an instance of the Q15 RFFT/RIFFT structure.
* @param[in] *pSrc points to the input buffer.
* @param[out] *pDst points to the output buffer.
* @return none.
*/
voidarm_rfft_q15(
constarm_rfft_instance_q15*S,
q15_t*pSrc,
q15_t*pDst);
/**
* @brief Initialization function for the Q15 RFFT/RIFFT.
* @param[in, out] *S points to an instance of the Q15 RFFT/RIFFT structure.
* @param[in] *S_CFFT points to an instance of the Q15 CFFT/CIFFT structure.
* @param[in] fftLenReal length of the FFT.
* @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
*/
arm_statusarm_rfft_init_q15(
arm_rfft_instance_q15*S,
arm_cfft_radix4_instance_q15*S_CFFT,
uint32_tfftLenReal,
uint32_tifftFlagR,
uint32_tbitReverseFlag);
/**
* @brief Processing function for the Q31 RFFT/RIFFT.
* @param[in] *S points to an instance of the Q31 RFFT/RIFFT structure.
* @param[in] *pSrc points to the input buffer.
* @param[out] *pDst points to the output buffer.
* @return none.
*/
voidarm_rfft_q31(
constarm_rfft_instance_q31*S,
q31_t*pSrc,
q31_t*pDst);
/**
* @brief Initialization function for the Q31 RFFT/RIFFT.
* @param[in, out] *S points to an instance of the Q31 RFFT/RIFFT structure.
* @param[in, out] *S_CFFT points to an instance of the Q31 CFFT/CIFFT structure.
* @param[in] fftLenReal length of the FFT.
* @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
*/
arm_statusarm_rfft_init_q31(
arm_rfft_instance_q31*S,
arm_cfft_radix4_instance_q31*S_CFFT,
uint32_tfftLenReal,
uint32_tifftFlagR,
uint32_tbitReverseFlag);
/**
* @brief Initialization function for the floating-point RFFT/RIFFT.
* @param[in,out] *S points to an instance of the floating-point RFFT/RIFFT structure.
* @param[in,out] *S_CFFT points to an instance of the floating-point CFFT/CIFFT structure.
* @param[in] fftLenReal length of the FFT.
* @param[in] ifftFlagR flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
* @param[in] bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
*/
arm_statusarm_rfft_init_f32(
arm_rfft_instance_f32*S,
arm_cfft_radix4_instance_f32*S_CFFT,
...
...
@@ -2546,19 +2212,31 @@ extern "C"
uint32_tifftFlagR,
uint32_tbitReverseFlag);
/**
* @brief Processing function for the floating-point RFFT/RIFFT.
* @param[in] *S points to an instance of the floating-point RFFT/RIFFT structure.
* @param[in] *pSrc points to the input buffer.
* @param[out] *pDst points to the output buffer.
* @return none.
*/
voidarm_rfft_f32(
constarm_rfft_instance_f32*S,
float32_t*pSrc,
float32_t*pDst);
/**
* @brief Instance structure for the floating-point RFFT/RIFFT function.