HPM SDK
HPMicro Software Development Kit
DSP Basic Functions

Modules

 Basic_clip
 
 Bitwise AND Functions
 Bitwise AND Functions.
 
 Bitwise Inclusive OR Functions
 Bitwise Inclusive OR Functions.
 
 Bitwise NOT Functions
 Bitwise NOT Functions.
 
 Bitwise exclusive OR Functions
 Bitwise exclusive OR Functions.
 

Functions

static void hpm_dsp_abs_f32 (float32_t *src, float32_t *dst, uint32_t size)
 Absolute value of floating-potint vectors. More...
 
static void hpm_dsp_abs_q31 (q31_t *src, q31_t *dst, uint32_t size)
 Absolute value of q31 vectors. More...
 
static void hpm_dsp_abs_q15 (q15_t *src, q15_t *dst, uint32_t size)
 Absolute value of q15 vectors. More...
 
static void hpm_dsp_abs_q7 (q7_t *src, q7_t *dst, uint32_t size)
 Absolute value of q7 vectors. More...
 
static void hpm_dsp_add_f32 (float32_t *src1, float32_t *src2, float32_t *dst, uint32_t size)
 Addition of floating-potint vectors. More...
 
static void hpm_dsp_add_q31 (q31_t *src1, q31_t *src2, q31_t *dst, uint32_t size)
 Addition of q31 vectors. More...
 
static void hpm_dsp_add_q15 (q15_t *src1, q15_t *src2, q15_t *dst, uint32_t size)
 Addition of q15 vectors. More...
 
static void hpm_dsp_add_q7 (q7_t *src1, q7_t *src2, q7_t *dst, uint32_t size)
 Addition of q7 vectors. More...
 
static void hpm_dsp_add_u8_u16 (uint8_t *src1, uint8_t *src2, uint16_t *dst, uint32_t size)
 Addition of U8 vectors. More...
 
static void hpm_dsp_sub_f32 (float32_t *src1, float32_t *src2, float32_t *dst, uint32_t size)
 Subtraction of floating-point vectors. More...
 
static void hpm_dsp_sub_q31 (q31_t *src1, q31_t *src2, q31_t *dst, uint32_t size)
 Subtraction of q31 vectors. More...
 
static void hpm_dsp_sub_q15 (q15_t *src1, q15_t *src2, q15_t *dst, uint32_t size)
 Subtraction of q15 vectors. More...
 
static void hpm_dsp_sub_q7 (q7_t *src1, q7_t *src2, q7_t *dst, uint32_t size)
 Subtraction of q7 vectors. More...
 
static void hpm_dsp_sub_u8_q7 (uint8_t *src1, uint8_t *src2, q7_t *dst, uint32_t size)
 Subtraction of u8 vectors. More...
 
static void hpm_dsp_mul_f32 (float32_t *src1, float32_t *src2, float32_t *dst, uint32_t size)
 Multiplication of floating-point vectors. More...
 
static void hpm_dsp_mul_q31 (q31_t *src1, q31_t *src2, q31_t *dst, uint32_t size)
 Multiplication of q31 vectors. More...
 
static void hpm_dsp_mul_q15 (q15_t *src1, q15_t *src2, q15_t *dst, uint32_t size)
 Multiplication of q15 vectors. More...
 
static void hpm_dsp_mul_q7 (q7_t *src1, q7_t *src2, q7_t *dst, uint32_t size)
 Multiplication of q7 vectors. More...
 
static void hpm_dsp_mul_u8_u16 (uint8_t *src1, uint8_t *src2, uint16_t *dst, uint32_t size)
 Multiplication of u8 vectors. More...
 
static void hpm_dsp_div_f32 (float32_t *src1, float32_t *src2, float32_t *dst, uint32_t size)
 Division of floating-point vectors. More...
 
static q31_t hpm_dsp_div_q31 (q31_t src1, q31_t src2)
 Division of q31 inputs. More...
 
static q31_t hpm_dsp_div_s64_u32 (q63_t src1, uint32_t src2)
 Division of q63 inputs divided by a positive 32 bits. More...
 
static q31_t hpm_dsp_div_u64_u32 (uint64_t src1, uint32_t src2)
 Division of positive 64-bits inputs divided by a positive 32-bits. More...
 
static void hpm_dsp_neg_f32 (float32_t *src, float32_t *dst, uint32_t size)
 Negation of floating-potint vectors. More...
 
static void hpm_dsp_neg_q31 (q31_t *src, q31_t *dst, uint32_t size)
 Negation of q31 vectors. More...
 
static void hpm_dsp_neg_q15 (q15_t *src, q15_t *dst, uint32_t size)
 Negation of q15 vectors. More...
 
static void hpm_dsp_neg_q7 (q7_t *src, q7_t *dst, uint32_t size)
 Negation of q15 vectors. More...
 
static float32_t hpm_dsp_dprod_f32 (float32_t *src1, float32_t *src2, uint32_t size)
 Dot production of floating-point vectors. More...
 
static q63_t hpm_dsp_dprod_q31 (q31_t *src1, q31_t *src2, uint32_t size)
 Dot production of q31 vectors. More...
 
static q63_t hpm_dsp_dprod_q15 (q15_t *src1, q15_t *src2, uint32_t size)
 Dot production of q15 vectors. More...
 
static q31_t hpm_dsp_dprod_u8xq15 (uint8_t *src1, q15_t *src2, uint32_t size)
 Dot production of u8 * q15 vectors. More...
 
static q31_t hpm_dsp_dprod_q7 (q7_t *src1, q7_t *src2, uint32_t size)
 Dot production of q7 vectors. More...
 
static q31_t hpm_dsp_dprod_q7xq15 (q7_t *src1, q15_t *src2, uint32_t size)
 Dot production of q7 * q15 vectors. More...
 
static uint32_t hpm_dsp_dprod_u8 (uint8_t *src1, uint8_t *src2, uint32_t size)
 Dot production of U8 vectors. More...
 
static void hpm_dsp_offset_f32 (float32_t *src, float32_t offset, float32_t *dst, uint32_t size)
 The offset of floating-point vectors. More...
 
static void hpm_dsp_offset_q31 (q31_t *src, q31_t offset, q31_t *dst, uint32_t size)
 The offset of q31 vectors. More...
 
static void hpm_dsp_offset_q15 (q15_t *src, q15_t offset, q15_t *dst, uint32_t size)
 The offset of q15 vectors. More...
 
static void hpm_dsp_offset_q7 (q7_t *src, q7_t offset, q7_t *dst, uint32_t size)
 The offset of q7 vectors. More...
 
static void hpm_dsp_offset_u8 (uint8_t *src, q7_t offset, uint8_t *dst, uint32_t size)
 The offset of U8 vectors. More...
 
static void hpm_dsp_scale_f32 (float32_t *src, float32_t scale, float32_t *dst, uint32_t size)
 To multiply a floating-point vectors by a floating-point scale. More...
 
static void hpm_dsp_scale_q31 (q31_t *src, q31_t scalefract, int8_t shift, q31_t *dst, uint32_t size)
 To multiply a q31 vectors by a q31 scale. More...
 
static void hpm_dsp_scale_q15 (q15_t *src, q15_t scalefract, int8_t shift, q15_t *dst, uint32_t size)
 To multiply a q15 vectors by a q15 scale. More...
 
static void hpm_dsp_scale_q7 (q7_t *src, q7_t scalefract, int8_t shift, q7_t *dst, uint32_t size)
 To multiply a q7 vectors by a q7 scale. More...
 
static void hpm_dsp_scale_u8 (uint8_t *src, q7_t scalefract, int8_t shift, uint8_t *dst, uint32_t size)
 To multiply a u8 vectors by a q7 scale. More...
 
static void hpm_dsp_shift_q15 (q15_t *src, int8_t shift, q15_t *dst, uint32_t size)
 Shifts a q15 vector with a specified shift number. More...
 
static void hpm_dsp_shift_q31 (q31_t *src, int8_t shift, q31_t *dst, uint32_t size)
 Shifts a q31 vector with a specified shift number. More...
 
static void hpm_dsp_shift_q7 (q7_t *src, int8_t shift, q7_t *dst, uint32_t size)
 Shifts a q7 vector with a specified shift number. More...
 
static void hpm_dsp_shift_u8 (uint8_t *src, int8_t shift, uint8_t *dst, uint32_t size)
 Shifts a u8 vector for a specified shift number. More...
 

Detailed Description

Function Documentation

◆ hpm_dsp_abs_f32()

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

#include <middleware/hpm_math/hpm_math.h>

Absolute value of floating-potint vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_abs_q15()

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

#include <middleware/hpm_math/hpm_math.h>

Absolute value of q15 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q15 value INT16_MIN (0x8000) will be saturated to the maximum allowable positive value INT16_MAX.

◆ hpm_dsp_abs_q31()

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

#include <middleware/hpm_math/hpm_math.h>

Absolute value of q31 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q31 value INT32_MIN (0x80000000) will be saturated to the maximum allowable positive value INT32_MAX.

◆ hpm_dsp_abs_q7()

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

#include <middleware/hpm_math/hpm_math.h>

Absolute value of q7 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q7 value INT8_MIN (0x8000) will be saturated to the maximum allowable positive value INT8_MAX.

◆ hpm_dsp_add_f32()

static void hpm_dsp_add_f32 ( float32_t *  src1,
float32_t *  src2,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of floating-potint vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_add_q15()

static void hpm_dsp_add_q15 ( q15_t *  src1,
q15_t *  src2,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of q15 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The output results will be saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_add_q31()

static void hpm_dsp_add_q31 ( q31_t *  src1,
q31_t *  src2,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of q31 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_add_q7()

static void hpm_dsp_add_q7 ( q7_t *  src1,
q7_t *  src2,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of q7 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q7 range [0x80 0x7F].

◆ hpm_dsp_add_u8_u16()

static void hpm_dsp_add_u8_u16 ( uint8_t *  src1,
uint8_t *  src2,
uint16_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of U8 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in U16 range [0x0000 0xFFFF].

◆ hpm_dsp_div_f32()

static void hpm_dsp_div_f32 ( float32_t *  src1,
float32_t *  src2,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Division of floating-point vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_div_q31()

static q31_t hpm_dsp_div_q31 ( q31_t  src1,
q31_t  src2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Division of q31 inputs.

Parameters
[in]src1the smaller input value.
[in]src2the larger input value.
Returns
division of two inputs.

◆ hpm_dsp_div_s64_u32()

static q31_t hpm_dsp_div_s64_u32 ( q63_t  src1,
uint32_t  src2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Division of q63 inputs divided by a positive 32 bits.

Parameters
[in]src1the q63 input value.
[in]src2the positive 32 bits input value.
Returns
division of two inputs.

◆ hpm_dsp_div_u64_u32()

static q31_t hpm_dsp_div_u64_u32 ( uint64_t  src1,
uint32_t  src2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Division of positive 64-bits inputs divided by a positive 32-bits.

Parameters
[in]src1the positive 64-bits input value.
[in]src2the positive 32-bits input value.
Returns
division of two inputs.

◆ hpm_dsp_dprod_f32()

static float32_t hpm_dsp_dprod_f32 ( float32_t *  src1,
float32_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of floating-point vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

◆ hpm_dsp_dprod_q15()

static q63_t hpm_dsp_dprod_q15 ( q15_t *  src1,
q15_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of q15 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is in 2.30 format and then added to a 64-bit accumulator in 34.30 format. The return value is in 34.30 format.

◆ hpm_dsp_dprod_q31()

static q63_t hpm_dsp_dprod_q31 ( q31_t *  src1,
q31_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of q31 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is truncated from 2.62 to 2.48 format and then added without saturation to a 64-bit accumulator. The return value is in 16.48 format. When the size of the vectors less than 2^16, there is no risk to overflow.

◆ hpm_dsp_dprod_q7()

static q31_t hpm_dsp_dprod_q7 ( q7_t *  src1,
q7_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of q7 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is in 2.14 format and then added to an accumulator in 18.14 format. The return result is in 18.14 format.

◆ hpm_dsp_dprod_q7xq15()

static q31_t hpm_dsp_dprod_q7xq15 ( q7_t *  src1,
q15_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of q7 * q15 vectors.

Parameters
[in]*src1points to the q7_t format input vector.
[in]*src2points to the q15 format input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is in 1.22 format and then added to an accumulator in 10.22 format. The return result is in 10.22 format.

◆ hpm_dsp_dprod_u8()

static uint32_t hpm_dsp_dprod_u8 ( uint8_t *  src1,
uint8_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of U8 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is in 0.16 format and then added to an accumulator in 16.16 format. The return result is in 16.16 format.

◆ hpm_dsp_dprod_u8xq15()

static q31_t hpm_dsp_dprod_u8xq15 ( uint8_t *  src1,
q15_t *  src2,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Dot production of u8 * q15 vectors.

Parameters
[in]*src1points to the uint8_t format input vector.
[in]*src2points to the q15 format input vector.
[in]sizesize of the vectors.
Returns
dot product of two input vectors.

The output of multiplications is in 1.23 format and then added to an accumulator in 9.23 format. The return result is in 9.23 format.

◆ hpm_dsp_mul_f32()

static void hpm_dsp_mul_f32 ( float32_t *  src1,
float32_t *  src2,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of floating-point vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_mul_q15()

static void hpm_dsp_mul_q15 ( q15_t *  src1,
q15_t *  src2,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of q15 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Output results will be saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_mul_q31()

static void hpm_dsp_mul_q31 ( q31_t *  src1,
q31_t *  src2,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of q31 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_mul_q7()

static void hpm_dsp_mul_q7 ( q7_t *  src1,
q7_t *  src2,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of q7 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q7 range [0x80 0x7F].

◆ hpm_dsp_mul_u8_u16()

static void hpm_dsp_mul_u8_u16 ( uint8_t *  src1,
uint8_t *  src2,
uint16_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of u8 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be in U16 range [0x00 0xFFFF].

◆ hpm_dsp_neg_f32()

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

#include <middleware/hpm_math/hpm_math.h>

Negation of floating-potint vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_neg_q15()

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

#include <middleware/hpm_math/hpm_math.h>

Negation of q15 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q15 value INT16_MIN (0x8000) will be saturated to the maximum allowable positive value INT16_MAX.

◆ hpm_dsp_neg_q31()

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

#include <middleware/hpm_math/hpm_math.h>

Negation of q31 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q31 value INT32_MIN (0x80000000) will be saturated to the maximum allowable positive value INT32_MAX.

◆ hpm_dsp_neg_q7()

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

#include <middleware/hpm_math/hpm_math.h>

Negation of q15 vectors.

Parameters
[in]*srcpoints to the input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The Q7 value INT8_MIN (0x80) will be saturated to the maximum allowable positive value INT8_MAX.

◆ hpm_dsp_offset_f32()

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

#include <middleware/hpm_math/hpm_math.h>

The offset of floating-point vectors.

Parameters
[in]*srcpoints to the input vector.
[in]offsetis the value to be added.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_offset_q15()

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

#include <middleware/hpm_math/hpm_math.h>

The offset of q15 vectors.

Parameters
[in]*srcpoints to the input vector.
[in]offsetis the value to be added.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Output results are saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_offset_q31()

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

#include <middleware/hpm_math/hpm_math.h>

The offset of q31 vectors.

Parameters
[in]*srcpoints to the input vector.
[in]offsetis the value to be added.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Output results are saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_offset_q7()

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

#include <middleware/hpm_math/hpm_math.h>

The offset of q7 vectors.

Parameters
[in]*srcpoints to the input vector.
[in]offsetis the value to be added.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Output results are saturated in Q7 range [0x80 0x7F].

◆ hpm_dsp_offset_u8()

static void hpm_dsp_offset_u8 ( uint8_t *  src,
q7_t  offset,
uint8_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

The offset of U8 vectors.

Parameters
[in]*srcpoints to the input vector.
[in]offsetis the value to be added.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Output results are saturated in U8 range [0x00 0xFF].

◆ hpm_dsp_scale_f32()

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

#include <middleware/hpm_math/hpm_math.h>

To multiply a floating-point vectors by a floating-point scale.

Parameters
[in]*srcpoints to the input vector.
[in]scaleis the value to be multiplied.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_scale_q15()

static void hpm_dsp_scale_q15 ( q15_t *  src,
q15_t  scalefract,
int8_t  shift,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

To multiply a q15 vectors by a q15 scale.

Parameters
[in]*srcpoints to the input vector.
[in]scalefractis the fractional portion value to be multiplied.
[in]shiftnumber of bits to shift.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

These are multiplied to yield a 2.30 output and then is shifted with saturation to 1.15 format.

◆ hpm_dsp_scale_q31()

static void hpm_dsp_scale_q31 ( q31_t *  src,
q31_t  scalefract,
int8_t  shift,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

To multiply a q31 vectors by a q31 scale.

Parameters
[in]*srcpoints to the input vector.
[in]scalefractis the fractional portion value to be multiplied.
[in]shiftnumber of bits to shift.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

These are multiplied to yield a 2.62 output and then is shift with saturation to 1.31 format.

◆ hpm_dsp_scale_q7()

static void hpm_dsp_scale_q7 ( q7_t *  src,
q7_t  scalefract,
int8_t  shift,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

To multiply a q7 vectors by a q7 scale.

Parameters
[in]*srcpoints to the input vector.
[in]scalefractis the fractional portion value to be multiplied.
[in]shiftnumber of bits to shift.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

These are multiplied to yield a 2.14 output and then is shifted with saturation to 1.7 format.

◆ hpm_dsp_scale_u8()

static void hpm_dsp_scale_u8 ( uint8_t *  src,
q7_t  scalefract,
int8_t  shift,
uint8_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

To multiply a u8 vectors by a q7 scale.

Parameters
[in]*srcpoints to the input vector.
[in]scalefractis the fractional portion value to be multiplied.
[in]shiftnumber of bits to shift.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The inputs are multiplied to yield a 1.15 output and then are shift with saturation to 8-bit formats.

◆ hpm_dsp_shift_q15()

static void hpm_dsp_shift_q15 ( q15_t *  src,
int8_t  shift,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Shifts a q15 vector with a specified shift number.

Parameters
[in]*srcthe input vector.
[in]shiftnumber of shift bits. If (shift > 0) means shifts left; (shift < 0) means shifts right.
[out]*dstthe output vector.
[in]sizesize of the vectors.

The input and output are all saturated to q15 range [0x8000 0x7FFF].

◆ hpm_dsp_shift_q31()

static void hpm_dsp_shift_q31 ( q31_t *  src,
int8_t  shift,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Shifts a q31 vector with a specified shift number.

Parameters
[in]*srcthe input vector.
[in]shiftnumber of shift bits. If (shift > 0) means shifts left; (shift < 0) means shifts right.
[out]*dstthe output vector.
[in]sizesize of the vectors.

The input and output are all saturated to q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_shift_q7()

static void hpm_dsp_shift_q7 ( q7_t *  src,
int8_t  shift,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Shifts a q7 vector with a specified shift number.

Parameters
[in]*srcthe input vector.
[in]shiftnumber of shift bits. If (shift > 0) means shifts left; (shift < 0) means shifts right.
[out]*dstthe output vector.
[in]sizesize of the vectors.

The input and output are all saturated to q7 range [0x80 0x7F].

◆ hpm_dsp_shift_u8()

static void hpm_dsp_shift_u8 ( uint8_t *  src,
int8_t  shift,
uint8_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Shifts a u8 vector for a specified shift number.

Parameters
[in]*srcthe input vector.
[in]shiftnumber of shift bits. If (shift > 0) means shifts left; (shift < 0) means shifts right.
[out]*dstthe output vector.
[in]sizesize of the vectors.

The input and output are all saturated to u8 range [0x00 0xFF].

◆ hpm_dsp_sub_f32()

static void hpm_dsp_sub_f32 ( float32_t *  src1,
float32_t *  src2,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Subtraction of floating-point vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

◆ hpm_dsp_sub_q15()

static void hpm_dsp_sub_q15 ( q15_t *  src1,
q15_t *  src2,
q15_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Subtraction of q15 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

The output results will be saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_sub_q31()

static void hpm_dsp_sub_q31 ( q31_t *  src1,
q31_t *  src2,
q31_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Subtraction of q31 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_sub_q7()

static void hpm_dsp_sub_q7 ( q7_t *  src1,
q7_t *  src2,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Subtraction of q7 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q7 range [0x80 0x7F].

◆ hpm_dsp_sub_u8_q7()

static void hpm_dsp_sub_u8_q7 ( uint8_t *  src1,
uint8_t *  src2,
q7_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Subtraction of u8 vectors.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input vector.
[out]*dstpoints to the output vector.
[in]sizesize of the vectors.

Ouput results will be saturated in Q7 range [0x80 0x7F].