HPM SDK
HPMicro Software Development Kit
DSP Utils Functions

Functions

static float32_t hpm_dsp_cos_f32 (float32_t src)
 
static q31_t hpm_dsp_cos_q31 (q31_t src)
 
static q15_t hpm_dsp_cos_q15 (q15_t src)
 
static float32_t hpm_dsp_sin_f32 (float32_t src)
 
static q31_t hpm_dsp_sin_q31 (q31_t src)
 
static q15_t hpm_dsp_sin_q15 (q15_t src)
 
static float32_t hpm_dsp_atan_f32 (float32_t src)
 
static q31_t hpm_dsp_atan_q31 (q31_t src)
 
static q15_t hpm_dsp_atan_q15 (q15_t src)
 
static float32_t hpm_dsp_atan2_f32 (float32_t srcy, float32_t src2)
 
static q15_t hpm_dsp_atan2_q15 (q15_t srcy, q15_t src2)
 
static q31_t hpm_dsp_atan2_q31 (q31_t srcy, q31_t src2)
 
static float32_t hpm_dsp_sqrt_f32 (float32_t src)
 Square root of the floating-potint input. More...
 
static q31_t hpm_dsp_sqrt_q31 (q31_t src)
 Square root of the q31 input. More...
 
static q15_t hpm_dsp_sqrt_q15 (q15_t src)
 Square root of the q15 input. More...
 
static void hpm_dsp_convert_f32_q15 (float32_t *src, q15_t *dst, uint32_t size)
 Convert a floating-point vector to Q15. More...
 
static void hpm_dsp_convert_f32_q31 (float32_t *src, q31_t *dst, uint32_t size)
 Convert a floating-point vector to Q31. More...
 
static void hpm_dsp_convert_f32_q7 (float32_t *src, q7_t *dst, uint32_t size)
 Convert a floating-point vector to Q7. More...
 
static void hpm_dsp_convert_q15_f32 (q15_t *src, float32_t *dst, uint32_t size)
 Convert a Q15 vector to floating. More...
 
static void hpm_dsp_convert_q15_q31 (q15_t *src, q31_t *dst, uint32_t size)
 Convert a Q15 vector to Q31. More...
 
static void hpm_dsp_convert_q15_q7 (q15_t *src, q7_t *dst, uint32_t size)
 Convert a Q15 vector to Q7. More...
 
static void hpm_dsp_convert_q31_f32 (q31_t *src, float32_t *dst, uint32_t size)
 Convert a Q31 vector to floating. More...
 
static void hpm_dsp_convert_q31_q15 (q31_t *src, q15_t *dst, uint32_t size)
 Convert a Q31 vector to Q15. More...
 
static void hpm_dsp_convert_q31_q7 (q31_t *src, q7_t *dst, uint32_t size)
 Convert a Q31 vector to Q7. More...
 
static void hpm_dsp_convert_q7_f32 (q7_t *src, float32_t *dst, uint32_t size)
 Convert a Q7 vector to floating. More...
 
static void hpm_dsp_convert_q7_q15 (q7_t *src, q15_t *dst, uint32_t size)
 Convert a Q7 vector to Q15. More...
 
static void hpm_dsp_convert_q7_q31 (q7_t *src, q31_t *dst, uint32_t size)
 Convert a Q7 vector to Q31. More...
 
static void hpm_dsp_dup_f32 (float32_t *src, float32_t *dst, uint32_t size)
 Duplicate the floating vector. More...
 
static void hpm_dsp_dup_q15 (q15_t *src, q15_t *dst, uint32_t size)
 Duplicate the Q15 vector. More...
 
static void hpm_dsp_dup_q31 (q31_t *src, q31_t *dst, uint32_t size)
 Duplicate the Q31 vector. More...
 
static void hpm_dsp_dup_q7 (q7_t *src, q7_t *dst, uint32_t size)
 Duplicate the Q7 vector. More...
 
static void hpm_dsp_set_f32 (float32_t val, float32_t *dst, uint32_t size)
 Set the floating-point vector. More...
 
static void hpm_dsp_set_q15 (q15_t val, q15_t *dst, uint32_t size)
 Set the Q15 vector. More...
 
static void hpm_dsp_set_q31 (q31_t val, q31_t *dst, uint32_t size)
 Set the Q31 vector. More...
 
static void hpm_dsp_set_q7 (q7_t val, q7_t *dst, uint32_t size)
 Set the Q7 vector. More...
 
static float32_t hpm_dsp_weighted_sum_f32 (const float32_t *src, const float32_t *weight, uint32_t size)
 Weighted Sum of the floating-potint vector. More...
 
static void hpm_dsp_barycenter_f32 (const float32_t *src, const float32_t *weights, float32_t *out, uint32_t numofvec, uint32_t dimofvec)
 Barycenter of the floating-potint type. More...
 
static float32_t hpm_dsp_exp_f32 (float32_t src)
 Calculate exponential value of f32 vector. More...
 
static float32_t hpm_dsp_sigmoid_f32 (float32_t src)
 Calculate sigmoid value of f32 vector. More...
 
static float32_t hpm_dsp_log_f32 (float32_t src)
 Calculate the natural logarithm value of f32 vector. More...
 

Detailed Description

This set of functions implements sine, cosine, arctanm, and square root. There are separate functions for Q15, Q31, and floating-point data.

Function Documentation

◆ hpm_dsp_atan2_f32()

static float32_t hpm_dsp_atan2_f32 ( float32_t  srcy,
float32_t  src2 
)
inlinestatic

◆ hpm_dsp_atan2_q15()

static q15_t hpm_dsp_atan2_q15 ( q15_t  srcy,
q15_t  src2 
)
inlinestatic

◆ hpm_dsp_atan2_q31()

static q31_t hpm_dsp_atan2_q31 ( q31_t  srcy,
q31_t  src2 
)
inlinestatic

◆ hpm_dsp_atan_f32()

static float32_t hpm_dsp_atan_f32 ( float32_t  src)
inlinestatic

◆ hpm_dsp_atan_q15()

static q15_t hpm_dsp_atan_q15 ( q15_t  src)
inlinestatic

◆ hpm_dsp_atan_q31()

static q31_t hpm_dsp_atan_q31 ( q31_t  src)
inlinestatic

◆ hpm_dsp_barycenter_f32()

static void hpm_dsp_barycenter_f32 ( const float32_t *  src,
const float32_t *  weights,
float32_t *  out,
uint32_t  numofvec,
uint32_t  dimofvec 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Barycenter of the floating-potint type.

Parameters
[in]*srcpoints to the input vector.
[in]*weightspoints to the weighted vector.
[out]*outpoints to the out vector.
[in]numofvecsize of the vectors.
[in]dimofvecsize of the vectors.

◆ hpm_dsp_convert_f32_q15()

static void hpm_dsp_convert_f32_q15 ( float32_t *  src,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a floating-point vector to Q15.

Parameters
[in]*srcthe input vector point.
[out]*dstyhe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_f32_q31()

static void hpm_dsp_convert_f32_q31 ( float32_t *  src,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a floating-point vector to Q31.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_convert_f32_q7()

static void hpm_dsp_convert_f32_q7 ( float32_t *  src,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a floating-point vector to Q7.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_convert_q15_f32()

static void hpm_dsp_convert_q15_f32 ( q15_t *  src,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q15 vector to floating.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q15_q31()

static void hpm_dsp_convert_q15_q31 ( q15_t *  src,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q15 vector to Q31.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q15_q7()

static void hpm_dsp_convert_q15_q7 ( q15_t *  src,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q15 vector to Q7.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q31_f32()

static void hpm_dsp_convert_q31_f32 ( q31_t *  src,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q31 vector to floating.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q31_q15()

static void hpm_dsp_convert_q31_q15 ( q31_t *  src,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q31 vector to Q15.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q31_q7()

static void hpm_dsp_convert_q31_q7 ( q31_t *  src,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q31 vector to Q7.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q7_f32()

static void hpm_dsp_convert_q7_f32 ( q7_t *  src,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q7 vector to floating.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q7_q15()

static void hpm_dsp_convert_q7_q15 ( q7_t *  src,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q7 vector to Q15.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_convert_q7_q31()

static void hpm_dsp_convert_q7_q31 ( q7_t *  src,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Convert a Q7 vector to Q31.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vector.

◆ hpm_dsp_cos_f32()

static float32_t hpm_dsp_cos_f32 ( float32_t  src)
inlinestatic

◆ hpm_dsp_cos_q15()

static q15_t hpm_dsp_cos_q15 ( q15_t  src)
inlinestatic

◆ hpm_dsp_cos_q31()

static q31_t hpm_dsp_cos_q31 ( q31_t  src)
inlinestatic

◆ hpm_dsp_dup_f32()

static void hpm_dsp_dup_f32 ( float32_t *  src,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Duplicate the floating vector.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_dup_q15()

static void hpm_dsp_dup_q15 ( q15_t *  src,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Duplicate the Q15 vector.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_dup_q31()

static void hpm_dsp_dup_q31 ( q31_t *  src,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Duplicate the Q31 vector.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_dup_q7()

static void hpm_dsp_dup_q7 ( q7_t *  src,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Duplicate the Q7 vector.

Parameters
[in]*srcthe input vector point.
[out]*dstthe output vector point.
[in]sizesize of vectors.

◆ hpm_dsp_exp_f32()

static float32_t hpm_dsp_exp_f32 ( float32_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Calculate exponential value of f32 vector.

Parameters
[in]srcinput value
Returns
exponential value of the input

◆ hpm_dsp_log_f32()

static float32_t hpm_dsp_log_f32 ( float32_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Calculate the natural logarithm value of f32 vector.

Parameters
[in]srcinput value
Returns
natural logarithm value of the input

◆ hpm_dsp_set_f32()

static void hpm_dsp_set_f32 ( float32_t  val,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Set the floating-point vector.

Parameters
[in]valspecify floating-point value.
[out]*dstthe output vector point.
[in]sizesize of the vector.

◆ hpm_dsp_set_q15()

static void hpm_dsp_set_q15 ( q15_t  val,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Set the Q15 vector.

Parameters
[in]valspecify Q15 value.
[out]*dstthe output vector point.
[in]sizesize of the vector.

◆ hpm_dsp_set_q31()

static void hpm_dsp_set_q31 ( q31_t  val,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Set the Q31 vector.

Parameters
[in]valspecify Q31 value.
[out]*dstthe output vector point.
[in]sizesize of the vector.

◆ hpm_dsp_set_q7()

static void hpm_dsp_set_q7 ( q7_t  val,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Set the Q7 vector.

Parameters
[in]valspecify Q7 value.
[out]*dstthe output vector point.
[in]sizesize of the vector.

◆ hpm_dsp_sigmoid_f32()

static float32_t hpm_dsp_sigmoid_f32 ( float32_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Calculate sigmoid value of f32 vector.

Parameters
[in]srcinput value
Returns
sigmoid value of the input

◆ hpm_dsp_sin_f32()

static float32_t hpm_dsp_sin_f32 ( float32_t  src)
inlinestatic

◆ hpm_dsp_sin_q15()

static q15_t hpm_dsp_sin_q15 ( q15_t  src)
inlinestatic

◆ hpm_dsp_sin_q31()

static q31_t hpm_dsp_sin_q31 ( q31_t  src)
inlinestatic

◆ hpm_dsp_sqrt_f32()

static float32_t hpm_dsp_sqrt_f32 ( float32_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Square root of the floating-potint input.

Parameters
[in]srcthe input value.
Returns
the suqare root of input.

◆ hpm_dsp_sqrt_q15()

static q15_t hpm_dsp_sqrt_q15 ( q15_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Square root of the q15 input.

Parameters
[in]srcthe input value.
Returns
the suqare root of input.

◆ hpm_dsp_sqrt_q31()

static q31_t hpm_dsp_sqrt_q31 ( q31_t  src)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Square root of the q31 input.

Parameters
[in]srcthe input value.
Returns
the suqare root of input.

◆ hpm_dsp_weighted_sum_f32()

static float32_t hpm_dsp_weighted_sum_f32 ( const float32_t *  src,
const float32_t *  weight,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Weighted Sum of the floating-potint vector.

Parameters
[in]*srcpoints to the input vector.
[in]*weightpoints to the weighted vector.
[in]sizesize of the vectors.
Returns
Weighted Sumvalue.