LIBML  Version 3.2.4
LIBML DSP Software Library
Macros | Functions
Vector Subtraction
Collaboration diagram for Vector Subtraction:

Macros

#define Q7_MAX   (q7_t)0x7F
 U8 vector subtraction. More...
 
#define Q7_MIN   (q7_t)0x80
 

Functions

void tpt_sub_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInDataA, const f32_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector subtraction. More...
 
void tpt_sub_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInDataA, const f64_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector subtraction. More...
 
void tpt_sub_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInDataA, const q15_t *__restrict aInDataB, uint32_t aCount)
 Q15 vector subtraction. More...
 
void tpt_sub_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInDataA, const q31_t *__restrict aInDataB, uint32_t aCount)
 Q31 vector subtraction. More...
 
void tpt_sub_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInDataA, const q7_t *__restrict aInDataB, uint32_t aCount)
 Q7 vector subtraction. More...
 
static q31_t sat_q31_to_q7 (q31_t src)
 
void tpt_sub_u8_q7 (q7_t *__restrict aOutData, const uint8_t *__restrict aInDataA, const uint8_t *__restrict aInDataB, uint32_t aCount)
 U8 vector subtraction. More...
 

Detailed Description

Element-by-element subtraction of two vectors.

    aOutData[n] = aInDataA[n] - aInDataB[n],   0 <= n < aCount.
  

There are separate functions for floating-point, Q7, Q15, and Q31 data types.

Macro Definition Documentation

◆ Q7_MAX

#define Q7_MAX   (q7_t)0x7F

U8 vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none
Ouput results will be saturated in Q7 range [0x80 0x7F].

◆ Q7_MIN

#define Q7_MIN   (q7_t)0x80

Function Documentation

◆ sat_q31_to_q7()

static q31_t sat_q31_to_q7 ( q31_t  src)
inlinestatic

◆ tpt_sub_f32()

void tpt_sub_f32 ( f32_t *__restrict  aOutData,
const f32_t *__restrict  aInDataA,
const f32_t *__restrict  aInDataB,
uint32_t  aCount 
)

Floating-point vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none

◆ tpt_sub_f64()

void tpt_sub_f64 ( f64_t *__restrict  aOutData,
const f64_t *__restrict  aInDataA,
const f64_t *__restrict  aInDataB,
uint32_t  aCount 
)

Floating-point vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none

◆ tpt_sub_q15()

void tpt_sub_q15 ( q15_t *__restrict  aOutData,
const q15_t *__restrict  aInDataA,
const q15_t *__restrict  aInDataB,
uint32_t  aCount 
)

Q15 vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] are saturated.

◆ tpt_sub_q31()

void tpt_sub_q31 ( q31_t *__restrict  aOutData,
const q31_t *__restrict  aInDataA,
const q31_t *__restrict  aInDataB,
uint32_t  aCount 
)

Q31 vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q31 range [0x80000000 0x7FFFFFFF] are saturated.

◆ tpt_sub_q7()

void tpt_sub_q7 ( q7_t *__restrict  aOutData,
const q7_t *__restrict  aInDataA,
const q7_t *__restrict  aInDataB,
uint32_t  aCount 
)

Q7 vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q7 range [0x80 0x7F] are saturated.

◆ tpt_sub_u8_q7()

void tpt_sub_u8_q7 ( q7_t *__restrict  aOutData,
const uint8_t *__restrict  aInDataA,
const uint8_t *__restrict  aInDataB,
uint32_t  aCount 
)

U8 vector subtraction.

Parameters
[out]aOutDatapoints to output vector
[in]aInDataApoints to first input vector
[in]aInDataBpoints to second input vector
[in]aCountnumber of samples in each vector
Returns
none