Skip to content
Snippets Groups Projects
arm_math.h 243 KiB
Newer Older
  • Learn to ignore specific revisions
  •   q31_t y)
      {
    
        return (((x >> 16) * (y >> 16)) +
                (((x << 16) >> 16) * ((y << 16) >> 16)));
      }
    
      /*
       * @brief C custom defined SMUSD for M3 and M0 processors
       */
      __STATIC_INLINE q31_t __SMUSD(
      q31_t x,
      q31_t y)
      {
    
        return (-((x >> 16) * (y >> 16)) +
                (((x << 16) >> 16) * ((y << 16) >> 16)));
      }
    
    
      /*
       * @brief C custom defined SXTB16 for M3 and M0 processors
       */
      __STATIC_INLINE q31_t __SXTB16(
      q31_t x)
      {
    
        return ((((x << 24) >> 24) & 0x0000FFFF) |
                (((x << 8) >> 8) & 0xFFFF0000));
      }
    
    
    #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0) */
    
    
      /**
       * @brief Instance structure for the Q7 FIR filter.
       */
      typedef struct
      {
        uint16_t numTaps;        /**< number of filter coefficients in the filter. */
        q7_t *pState;            /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q7_t *pCoeffs;           /**< points to the coefficient array. The array is of length numTaps.*/
      } arm_fir_instance_q7;
    
      /**
       * @brief Instance structure for the Q15 FIR filter.
       */
      typedef struct
      {
        uint16_t numTaps;         /**< number of filter coefficients in the filter. */
        q15_t *pState;            /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q15_t *pCoeffs;           /**< points to the coefficient array. The array is of length numTaps.*/
      } arm_fir_instance_q15;
    
      /**
       * @brief Instance structure for the Q31 FIR filter.
       */
      typedef struct
      {
        uint16_t numTaps;         /**< number of filter coefficients in the filter. */
        q31_t *pState;            /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q31_t *pCoeffs;           /**< points to the coefficient array. The array is of length numTaps. */
      } arm_fir_instance_q31;
    
      /**
       * @brief Instance structure for the floating-point FIR filter.
       */
      typedef struct
      {
        uint16_t numTaps;     /**< number of filter coefficients in the filter. */
        float32_t *pState;    /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        float32_t *pCoeffs;   /**< points to the coefficient array. The array is of length numTaps. */
      } arm_fir_instance_f32;
    
    
      /**
       * @brief Processing function for the Q7 FIR filter.
       * @param[in] *S points to an instance of the Q7 FIR filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_q7(
      const arm_fir_instance_q7 * S,
      q7_t * pSrc,
      q7_t * pDst,
      uint32_t blockSize);
    
    
      /**
       * @brief  Initialization function for the Q7 FIR filter.
       * @param[in,out] *S points to an instance of the Q7 FIR structure.
       * @param[in] numTaps  Number of filter coefficients in the filter.
       * @param[in] *pCoeffs points to the filter coefficients.
       * @param[in] *pState points to the state buffer.
       * @param[in] blockSize number of samples that are processed.
       * @return none
       */
      void arm_fir_init_q7(
      arm_fir_instance_q7 * S,
      uint16_t numTaps,
      q7_t * pCoeffs,
      q7_t * pState,
      uint32_t blockSize);
    
    
      /**
       * @brief Processing function for the Q15 FIR filter.
       * @param[in] *S points to an instance of the Q15 FIR structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_q15(
      const arm_fir_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
       * @param[in] *S points to an instance of the Q15 FIR filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_fast_q15(
      const arm_fir_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the Q15 FIR filter.
       * @param[in,out] *S points to an instance of the Q15 FIR filter structure.
       * @param[in] numTaps  Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
       * @param[in] *pCoeffs points to the filter coefficients.
       * @param[in] *pState points to the state buffer.
       * @param[in] blockSize number of samples that are processed at a time.
       * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if
       * <code>numTaps</code> is not a supported value.
       */
    
      arm_status arm_fir_init_q15(
      arm_fir_instance_q15 * S,
      uint16_t numTaps,
      q15_t * pCoeffs,
      q15_t * pState,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the Q31 FIR filter.
       * @param[in] *S points to an instance of the Q31 FIR filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_q31(
      const arm_fir_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
       * @param[in] *S points to an instance of the Q31 FIR structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_fast_q31(
      const arm_fir_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the Q31 FIR filter.
       * @param[in,out] *S points to an instance of the Q31 FIR structure.
    
       * @param[in]   numTaps  Number of filter coefficients in the filter.
       * @param[in]   *pCoeffs points to the filter coefficients.
       * @param[in]   *pState points to the state buffer.
       * @param[in]   blockSize number of samples that are processed at a time.
       * @return    none.
    
       */
      void arm_fir_init_q31(
      arm_fir_instance_q31 * S,
      uint16_t numTaps,
      q31_t * pCoeffs,
      q31_t * pState,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the floating-point FIR filter.
       * @param[in] *S points to an instance of the floating-point FIR structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_f32(
      const arm_fir_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the floating-point FIR filter.
       * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
    
       * @param[in]   numTaps  Number of filter coefficients in the filter.
       * @param[in]   *pCoeffs points to the filter coefficients.
       * @param[in]   *pState points to the state buffer.
       * @param[in]   blockSize number of samples that are processed at a time.
       * @return      none.
    
       */
      void arm_fir_init_f32(
      arm_fir_instance_f32 * S,
      uint16_t numTaps,
      float32_t * pCoeffs,
      float32_t * pState,
      uint32_t blockSize);
    
    
      /**
       * @brief Instance structure for the Q15 Biquad cascade filter.
       */
      typedef struct
      {
        int8_t numStages;         /**< number of 2nd order stages in the filter.  Overall order is 2*numStages. */
        q15_t *pState;            /**< Points to the array of state coefficients.  The array is of length 4*numStages. */
        q15_t *pCoeffs;           /**< Points to the array of coefficients.  The array is of length 5*numStages. */
        int8_t postShift;         /**< Additional shift, in bits, applied to each output sample. */
    
      } arm_biquad_casd_df1_inst_q15;
    
    
      /**
       * @brief Instance structure for the Q31 Biquad cascade filter.
       */
      typedef struct
      {
        uint32_t numStages;      /**< number of 2nd order stages in the filter.  Overall order is 2*numStages. */
        q31_t *pState;           /**< Points to the array of state coefficients.  The array is of length 4*numStages. */
        q31_t *pCoeffs;          /**< Points to the array of coefficients.  The array is of length 5*numStages. */
        uint8_t postShift;       /**< Additional shift, in bits, applied to each output sample. */
    
      } arm_biquad_casd_df1_inst_q31;
    
      /**
       * @brief Instance structure for the floating-point Biquad cascade filter.
       */
      typedef struct
      {
        uint32_t numStages;         /**< number of 2nd order stages in the filter.  Overall order is 2*numStages. */
        float32_t *pState;          /**< Points to the array of state coefficients.  The array is of length 4*numStages. */
        float32_t *pCoeffs;         /**< Points to the array of coefficients.  The array is of length 5*numStages. */
    
    
      } arm_biquad_casd_df1_inst_f32;
    
    
    
      /**
       * @brief Processing function for the Q15 Biquad cascade filter.
       * @param[in]  *S points to an instance of the Q15 Biquad cascade structure.
       * @param[in]  *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in]  blockSize number of samples to process.
       * @return     none.
       */
    
      void arm_biquad_cascade_df1_q15(
      const arm_biquad_casd_df1_inst_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the Q15 Biquad cascade filter.
       * @param[in,out] *S           points to an instance of the Q15 Biquad cascade structure.
       * @param[in]     numStages    number of 2nd order stages in the filter.
       * @param[in]     *pCoeffs     points to the filter coefficients.
       * @param[in]     *pState      points to the state buffer.
       * @param[in]     postShift    Shift to be applied to the output. Varies according to the coefficients format
       * @return        none
       */
    
      void arm_biquad_cascade_df1_init_q15(
      arm_biquad_casd_df1_inst_q15 * S,
      uint8_t numStages,
      q15_t * pCoeffs,
      q15_t * pState,
      int8_t postShift);
    
    
      /**
       * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
       * @param[in]  *S points to an instance of the Q15 Biquad cascade structure.
       * @param[in]  *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in]  blockSize number of samples to process.
       * @return     none.
       */
    
      void arm_biquad_cascade_df1_fast_q15(
      const arm_biquad_casd_df1_inst_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
    
      /**
       * @brief Processing function for the Q31 Biquad cascade filter
       * @param[in]  *S         points to an instance of the Q31 Biquad cascade structure.
       * @param[in]  *pSrc      points to the block of input data.
       * @param[out] *pDst      points to the block of output data.
       * @param[in]  blockSize  number of samples to process.
       * @return     none.
       */
    
      void arm_biquad_cascade_df1_q31(
      const arm_biquad_casd_df1_inst_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
       * @param[in]  *S         points to an instance of the Q31 Biquad cascade structure.
       * @param[in]  *pSrc      points to the block of input data.
       * @param[out] *pDst      points to the block of output data.
       * @param[in]  blockSize  number of samples to process.
       * @return     none.
       */
    
      void arm_biquad_cascade_df1_fast_q31(
      const arm_biquad_casd_df1_inst_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the Q31 Biquad cascade filter.
       * @param[in,out] *S           points to an instance of the Q31 Biquad cascade structure.
       * @param[in]     numStages      number of 2nd order stages in the filter.
       * @param[in]     *pCoeffs     points to the filter coefficients.
       * @param[in]     *pState      points to the state buffer.
       * @param[in]     postShift    Shift to be applied to the output. Varies according to the coefficients format
       * @return        none
       */
    
      void arm_biquad_cascade_df1_init_q31(
      arm_biquad_casd_df1_inst_q31 * S,
      uint8_t numStages,
      q31_t * pCoeffs,
      q31_t * pState,
      int8_t postShift);
    
      /**
       * @brief Processing function for the floating-point Biquad cascade filter.
       * @param[in]  *S         points to an instance of the floating-point Biquad cascade structure.
       * @param[in]  *pSrc      points to the block of input data.
       * @param[out] *pDst      points to the block of output data.
       * @param[in]  blockSize  number of samples to process.
       * @return     none.
       */
    
      void arm_biquad_cascade_df1_f32(
      const arm_biquad_casd_df1_inst_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the floating-point Biquad cascade filter.
       * @param[in,out] *S           points to an instance of the floating-point Biquad cascade structure.
       * @param[in]     numStages    number of 2nd order stages in the filter.
       * @param[in]     *pCoeffs     points to the filter coefficients.
       * @param[in]     *pState      points to the state buffer.
       * @return        none
       */
    
      void arm_biquad_cascade_df1_init_f32(
      arm_biquad_casd_df1_inst_f32 * S,
      uint8_t numStages,
      float32_t * pCoeffs,
      float32_t * pState);
    
    
      /**
       * @brief Instance structure for the floating-point matrix structure.
       */
    
      typedef struct
      {
        uint16_t numRows;     /**< number of rows of the matrix.     */
        uint16_t numCols;     /**< number of columns of the matrix.  */
        float32_t *pData;     /**< points to the data of the matrix. */
      } arm_matrix_instance_f32;
    
      /**
       * @brief Instance structure for the Q15 matrix structure.
       */
    
      typedef struct
      {
        uint16_t numRows;     /**< number of rows of the matrix.     */
        uint16_t numCols;     /**< number of columns of the matrix.  */
        q15_t *pData;         /**< points to the data of the matrix. */
    
      } arm_matrix_instance_q15;
    
      /**
       * @brief Instance structure for the Q31 matrix structure.
       */
    
      typedef struct
      {
        uint16_t numRows;     /**< number of rows of the matrix.     */
        uint16_t numCols;     /**< number of columns of the matrix.  */
        q31_t *pData;         /**< points to the data of the matrix. */
    
      } arm_matrix_instance_q31;
    
    
    
      /**
       * @brief Floating-point matrix addition.
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_add_f32(
      const arm_matrix_instance_f32 * pSrcA,
      const arm_matrix_instance_f32 * pSrcB,
      arm_matrix_instance_f32 * pDst);
    
      /**
       * @brief Q15 matrix addition.
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_add_q15(
      const arm_matrix_instance_q15 * pSrcA,
      const arm_matrix_instance_q15 * pSrcB,
      arm_matrix_instance_q15 * pDst);
    
      /**
       * @brief Q31 matrix addition.
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_add_q31(
      const arm_matrix_instance_q31 * pSrcA,
      const arm_matrix_instance_q31 * pSrcB,
      arm_matrix_instance_q31 * pDst);
    
    
      /**
       * @brief Floating-point matrix transpose.
       * @param[in]  *pSrc points to the input matrix
       * @param[out] *pDst points to the output matrix
    
       * @return  The function returns either  <code>ARM_MATH_SIZE_MISMATCH</code>
    
       * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_trans_f32(
      const arm_matrix_instance_f32 * pSrc,
      arm_matrix_instance_f32 * pDst);
    
    
      /**
       * @brief Q15 matrix transpose.
       * @param[in]  *pSrc points to the input matrix
       * @param[out] *pDst points to the output matrix
    
       * @return  The function returns either  <code>ARM_MATH_SIZE_MISMATCH</code>
    
       * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_trans_q15(
      const arm_matrix_instance_q15 * pSrc,
      arm_matrix_instance_q15 * pDst);
    
      /**
       * @brief Q31 matrix transpose.
       * @param[in]  *pSrc points to the input matrix
       * @param[out] *pDst points to the output matrix
    
       * @return  The function returns either  <code>ARM_MATH_SIZE_MISMATCH</code>
    
       * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_trans_q31(
      const arm_matrix_instance_q31 * pSrc,
      arm_matrix_instance_q31 * pDst);
    
    
      /**
       * @brief Floating-point matrix multiplication
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_mult_f32(
      const arm_matrix_instance_f32 * pSrcA,
      const arm_matrix_instance_f32 * pSrcB,
      arm_matrix_instance_f32 * pDst);
    
      /**
       * @brief Q15 matrix multiplication
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_mult_q15(
      const arm_matrix_instance_q15 * pSrcA,
      const arm_matrix_instance_q15 * pSrcB,
      arm_matrix_instance_q15 * pDst,
      q15_t * pState);
    
      /**
       * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
       * @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.
       */
    
      arm_status arm_mat_mult_fast_q15(
      const arm_matrix_instance_q15 * pSrcA,
      const arm_matrix_instance_q15 * pSrcB,
      arm_matrix_instance_q15 * pDst,
      q15_t * pState);
    
      /**
       * @brief Q31 matrix multiplication
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_mult_q31(
      const arm_matrix_instance_q31 * pSrcA,
      const arm_matrix_instance_q31 * pSrcB,
      arm_matrix_instance_q31 * pDst);
    
      /**
       * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_mult_fast_q31(
      const arm_matrix_instance_q31 * pSrcA,
      const arm_matrix_instance_q31 * pSrcB,
      arm_matrix_instance_q31 * pDst);
    
    
      /**
       * @brief Floating-point matrix subtraction
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_sub_f32(
      const arm_matrix_instance_f32 * pSrcA,
      const arm_matrix_instance_f32 * pSrcB,
      arm_matrix_instance_f32 * pDst);
    
      /**
       * @brief Q15 matrix subtraction
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_sub_q15(
      const arm_matrix_instance_q15 * pSrcA,
      const arm_matrix_instance_q15 * pSrcB,
      arm_matrix_instance_q15 * pDst);
    
      /**
       * @brief Q31 matrix subtraction
       * @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
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_sub_q31(
      const arm_matrix_instance_q31 * pSrcA,
      const arm_matrix_instance_q31 * pSrcB,
      arm_matrix_instance_q31 * pDst);
    
      /**
       * @brief Floating-point matrix scaling.
       * @param[in]  *pSrc points to the input matrix
       * @param[in]  scale scale factor
       * @param[out] *pDst points to the output matrix
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_scale_f32(
      const arm_matrix_instance_f32 * pSrc,
      float32_t scale,
      arm_matrix_instance_f32 * pDst);
    
      /**
       * @brief Q15 matrix scaling.
       * @param[in]       *pSrc points to input matrix
       * @param[in]       scaleFract fractional portion of the scale factor
       * @param[in]       shift number of bits to shift the result by
       * @param[out]      *pDst points to output matrix
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_scale_q15(
      const arm_matrix_instance_q15 * pSrc,
      q15_t scaleFract,
      int32_t shift,
      arm_matrix_instance_q15 * pDst);
    
      /**
       * @brief Q31 matrix scaling.
       * @param[in]       *pSrc points to input matrix
       * @param[in]       scaleFract fractional portion of the scale factor
       * @param[in]       shift number of bits to shift the result by
       * @param[out]      *pDst points to output matrix structure
       * @return     The function returns either
       * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
       */
    
      arm_status arm_mat_scale_q31(
      const arm_matrix_instance_q31 * pSrc,
      q31_t scaleFract,
      int32_t shift,
      arm_matrix_instance_q31 * pDst);
    
    
      /**
       * @brief  Q31 matrix initialization.
       * @param[in,out] *S             points to an instance of the floating-point matrix structure.
       * @param[in]     nRows          number of rows in the matrix.
       * @param[in]     nColumns       number of columns in the matrix.
    
       * @param[in]     *pData         points to the matrix data array.
    
       * @return        none
       */
    
      void arm_mat_init_q31(
      arm_matrix_instance_q31 * S,
      uint16_t nRows,
      uint16_t nColumns,
      q31_t * pData);
    
      /**
       * @brief  Q15 matrix initialization.
       * @param[in,out] *S             points to an instance of the floating-point matrix structure.
       * @param[in]     nRows          number of rows in the matrix.
       * @param[in]     nColumns       number of columns in the matrix.
    
       * @param[in]     *pData         points to the matrix data array.
    
       * @return        none
       */
    
      void arm_mat_init_q15(
      arm_matrix_instance_q15 * S,
      uint16_t nRows,
      uint16_t nColumns,
      q15_t * pData);
    
      /**
       * @brief  Floating-point matrix initialization.
       * @param[in,out] *S             points to an instance of the floating-point matrix structure.
       * @param[in]     nRows          number of rows in the matrix.
       * @param[in]     nColumns       number of columns in the matrix.
    
       * @param[in]     *pData         points to the matrix data array.
    
       * @return        none
       */
    
      void arm_mat_init_f32(
      arm_matrix_instance_f32 * S,
      uint16_t nRows,
      uint16_t nColumns,
      float32_t * pData);
    
    
    
      /**
       * @brief Instance structure for the Q15 PID Control.
       */
      typedef struct
      {
        q15_t A0;    /**< The derived gain, A0 = Kp + Ki + Kd . */
    #ifdef ARM_MATH_CM0
        q15_t A1;
        q15_t A2;
    #else
        q31_t A1;           /**< The derived gain A1 = -Kp - 2Kd | Kd.*/
    #endif
        q15_t state[3];       /**< The state array of length 3. */
        q15_t Kp;           /**< The proportional gain. */
        q15_t Ki;           /**< The integral gain. */
        q15_t Kd;           /**< The derivative gain. */
      } arm_pid_instance_q15;
    
      /**
       * @brief Instance structure for the Q31 PID Control.
       */
      typedef struct
      {
        q31_t A0;            /**< The derived gain, A0 = Kp + Ki + Kd . */
        q31_t A1;            /**< The derived gain, A1 = -Kp - 2Kd. */
        q31_t A2;            /**< The derived gain, A2 = Kd . */
        q31_t state[3];      /**< The state array of length 3. */
        q31_t Kp;            /**< The proportional gain. */
        q31_t Ki;            /**< The integral gain. */
        q31_t Kd;            /**< The derivative gain. */
    
      } arm_pid_instance_q31;
    
      /**
       * @brief Instance structure for the floating-point PID Control.
       */
      typedef struct
      {
        float32_t A0;          /**< The derived gain, A0 = Kp + Ki + Kd . */
        float32_t A1;          /**< The derived gain, A1 = -Kp - 2Kd. */
        float32_t A2;          /**< The derived gain, A2 = Kd . */
        float32_t state[3];    /**< The state array of length 3. */
        float32_t Kp;               /**< The proportional gain. */
        float32_t Ki;               /**< The integral gain. */
        float32_t Kd;               /**< The derivative gain. */
      } arm_pid_instance_f32;
    
    
    
      /**
       * @brief  Initialization function for the floating-point PID Control.
       * @param[in,out] *S      points to an instance of the PID structure.
       * @param[in]     resetStateFlag  flag to reset the state. 0 = no change in state 1 = reset the state.
       * @return none.
       */
      void arm_pid_init_f32(
      arm_pid_instance_f32 * S,
      int32_t resetStateFlag);
    
      /**
       * @brief  Reset function for the floating-point PID Control.
       * @param[in,out] *S is an instance of the floating-point PID Control structure
       * @return none
       */
      void arm_pid_reset_f32(
      arm_pid_instance_f32 * S);
    
    
      /**
       * @brief  Initialization function for the Q31 PID Control.
       * @param[in,out] *S points to an instance of the Q15 PID structure.
       * @param[in]     resetStateFlag  flag to reset the state. 0 = no change in state 1 = reset the state.
       * @return none.
       */
      void arm_pid_init_q31(
      arm_pid_instance_q31 * S,
      int32_t resetStateFlag);
    
    
      /**
       * @brief  Reset function for the Q31 PID Control.
       * @param[in,out] *S points to an instance of the Q31 PID Control structure
       * @return none
       */
    
      void arm_pid_reset_q31(
      arm_pid_instance_q31 * S);
    
      /**
       * @brief  Initialization function for the Q15 PID Control.
       * @param[in,out] *S points to an instance of the Q15 PID structure.
       * @param[in] resetStateFlag  flag to reset the state. 0 = no change in state 1 = reset the state.
       * @return none.
       */
      void arm_pid_init_q15(
      arm_pid_instance_q15 * S,
      int32_t resetStateFlag);
    
      /**
       * @brief  Reset function for the Q15 PID Control.
       * @param[in,out] *S points to an instance of the q15 PID Control structure
       * @return none
       */
      void arm_pid_reset_q15(
      arm_pid_instance_q15 * S);
    
    
      /**
       * @brief Instance structure for the floating-point Linear Interpolate function.
       */
      typedef struct
      {
        uint32_t nValues;           /**< nValues */
        float32_t x1;               /**< x1 */
        float32_t xSpacing;         /**< xSpacing */
        float32_t *pYData;          /**< pointer to the table of Y values */
      } arm_linear_interp_instance_f32;
    
      /**
       * @brief Instance structure for the floating-point bilinear interpolation function.
       */
    
      typedef struct
      {
        uint16_t numRows;   /**< number of rows in the data table. */
        uint16_t numCols;   /**< number of columns in the data table. */
        float32_t *pData;   /**< points to the data table. */
      } arm_bilinear_interp_instance_f32;
    
       /**
       * @brief Instance structure for the Q31 bilinear interpolation function.
       */
    
      typedef struct
      {
        uint16_t numRows;   /**< number of rows in the data table. */
        uint16_t numCols;   /**< number of columns in the data table. */
        q31_t *pData;       /**< points to the data table. */
      } arm_bilinear_interp_instance_q31;
    
       /**
       * @brief Instance structure for the Q15 bilinear interpolation function.
       */
    
      typedef struct
      {
        uint16_t numRows;   /**< number of rows in the data table. */
        uint16_t numCols;   /**< number of columns in the data table. */
        q15_t *pData;       /**< points to the data table. */
      } arm_bilinear_interp_instance_q15;
    
       /**
       * @brief Instance structure for the Q15 bilinear interpolation function.
       */
    
      typedef struct
      {
        uint16_t numRows;   /**< number of rows in the data table. */
        uint16_t numCols;   /**< number of columns in the data table. */
        q7_t *pData;                /**< points to the data table. */
      } arm_bilinear_interp_instance_q7;
    
    
      /**
       * @brief Q7 vector multiplication.
       * @param[in]       *pSrcA points to the first input vector
       * @param[in]       *pSrcB points to the second input vector
       * @param[out]      *pDst  points to the output vector
       * @param[in]       blockSize number of samples in each vector
       * @return none.
       */
    
      void arm_mult_q7(
      q7_t * pSrcA,
      q7_t * pSrcB,
      q7_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Q15 vector multiplication.
       * @param[in]       *pSrcA points to the first input vector
       * @param[in]       *pSrcB points to the second input vector
       * @param[out]      *pDst  points to the output vector
       * @param[in]       blockSize number of samples in each vector
       * @return none.
       */
    
      void arm_mult_q15(
      q15_t * pSrcA,
      q15_t * pSrcB,
      q15_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Q31 vector multiplication.
       * @param[in]       *pSrcA points to the first input vector
       * @param[in]       *pSrcB points to the second input vector
       * @param[out]      *pDst points to the output vector
       * @param[in]       blockSize number of samples in each vector
       * @return none.
       */
    
      void arm_mult_q31(
      q31_t * pSrcA,
      q31_t * pSrcB,
      q31_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Floating-point vector multiplication.
       * @param[in]       *pSrcA points to the first input vector
       * @param[in]       *pSrcB points to the second input vector
       * @param[out]      *pDst points to the output vector
       * @param[in]       blockSize number of samples in each vector
       * @return none.
       */
    
      void arm_mult_f32(
      float32_t * pSrcA,
      float32_t * pSrcB,
      float32_t * pDst,
      uint32_t blockSize);
    
    
      /**
       * @brief Instance structure for the Q15 CFFT/CIFFT function.
       */
    
      typedef struct
      {
        uint16_t fftLen;                 /**< length of the FFT. */
        uint8_t ifftFlag;                /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
        uint8_t bitReverseFlag;          /**< 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_t twidCoefModifier;       /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
        uint16_t bitRevFactor;           /**< 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.
       */
    
      typedef struct
      {
        uint16_t fftLen;                 /**< length of the FFT. */
        uint8_t ifftFlag;                /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
        uint8_t bitReverseFlag;          /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
        q31_t *pTwiddle;                 /**< points to the twiddle factor table. */
        uint16_t *pBitRevTable;          /**< points to the bit reversal table. */
        uint16_t twidCoefModifier;       /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
        uint16_t bitRevFactor;           /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
      } arm_cfft_radix4_instance_q31;
    
    
      /**
       * @brief Instance structure for the floating-point CFFT/CIFFT function.
       */
    
      typedef struct
      {
        uint16_t fftLen;                   /**< length of the FFT. */
        uint8_t ifftFlag;                  /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
        uint8_t bitReverseFlag;            /**< 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_t twidCoefModifier;         /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
        uint16_t bitRevFactor;             /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
        float32_t onebyfftLen;                 /**< value of 1/fftLen. */
      } arm_cfft_radix4_instance_f32;
    
    
      /**
       * @brief Instance structure for the Q15 CFFT/CIFFT function.
       */
    
      typedef struct