|
void | tpt_scale_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInData, f32_t aScale, uint32_t aCount) |
| Multiplies a floating-point vector by a scalar. More...
|
|
void | tpt_scale_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInData, f64_t aScale, uint32_t aCount) |
| Multiplies a floating-point vector by a scalar. More...
|
|
void | tpt_scale_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, q15_t aScaleFract, int8_t aShift, uint32_t aCount) |
| Multiplies a Q15 vector by a scalar. More...
|
|
void | tpt_scale_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInData, q31_t aScaleFract, int8_t aShift, uint32_t aCount) |
| Multiplies a Q31 vector by a scalar. More...
|
|
void | tpt_scale_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, q7_t aScaleFract, int8_t aShift, uint32_t aCount) |
| Multiplies a Q7 vector by a scalar. More...
|
|
Multiply a vector by a scalar value. For floating-point data, the algorithm used is:
aOutData[n] = aInData[n] * aScale, 0 <= n < aCount.
In the fixed-point Q7, Q15, and Q31 functions, aScale
is represented by a fractional multiplication aScaleFract
and an arithmetic shift aShift
. The shift allows the gain of the scaling operation to exceed 1.0. The algorithm used with fixed-point data is:
aOutData[n] = (aInData[n] * aScaleFract) << aShift, 0 <= n < aCount.
The overall scale factor applied to the fixed-point data is
scale = aScaleFract * 2^aShift, 0 <= n < aCount.
The functions support in-place computation allowing the source and destination pointers to reference the same memory buffer.
◆ tpt_scale_f32()
void tpt_scale_f32 |
( |
f32_t *__restrict |
aOutData, |
|
|
const f32_t *__restrict |
aInData, |
|
|
f32_t |
aScale, |
|
|
uint32_t |
aCount |
|
) |
| |
Multiplies a floating-point vector by a scalar.
- Parameters
-
[out] | aOutData | points to the output vector |
[in] | aInData | points to the input vector |
[in] | aScale | scale factor to be applied |
[in] | aCount | number of samples in the vector |
- Returns
- none
◆ tpt_scale_f64()
void tpt_scale_f64 |
( |
f64_t *__restrict |
aOutData, |
|
|
const f64_t *__restrict |
aInData, |
|
|
f64_t |
aScale, |
|
|
uint32_t |
aCount |
|
) |
| |
Multiplies a floating-point vector by a scalar.
- Parameters
-
[out] | aOutData | points to the output vector |
[in] | aInData | points to the input vector |
[in] | aScale | scale factor to be applied |
[in] | aCount | number of samples in the vector |
- Returns
- none
◆ tpt_scale_q15()
void tpt_scale_q15 |
( |
q15_t *__restrict |
aOutData, |
|
|
const q15_t *__restrict |
aInData, |
|
|
q15_t |
aScaleFract, |
|
|
int8_t |
aShift, |
|
|
uint32_t |
aCount |
|
) |
| |
Multiplies a Q15 vector by a scalar.
- Parameters
-
[out] | aOutData | points to the output vector |
[in] | aInData | points to the input vector |
[in] | aScaleFract | fractional portion of the scale value |
[in] | aShift | number of bits to shift the result by |
[in] | aCount | number of samples in the vector |
- Returns
- none
- Scaling and Overflow Behavior
- The input data
*aInData
and aScaleFract
are in 1.15 format. These are multiplied to yield a 2.30 intermediate result and this is shifted with saturation to 1.15 format.
◆ tpt_scale_q31()
void tpt_scale_q31 |
( |
q31_t *__restrict |
aOutData, |
|
|
const q31_t *__restrict |
aInData, |
|
|
q31_t |
aScaleFract, |
|
|
int8_t |
aShift, |
|
|
uint32_t |
aCount |
|
) |
| |
Multiplies a Q31 vector by a scalar.
- Parameters
-
[out] | aOutData | points to the output vector |
[in] | aInData | points to the input vector |
[in] | aScaleFract | fractional portion of the scale value |
[in] | aShift | number of bits to shift the result by |
[in] | aCount | number of samples in the vector |
- Returns
- none
- Scaling and Overflow Behavior
- The input data
*aInData
and aScaleFract
are in 1.31 format. These are multiplied to yield a 2.62 intermediate result and this is shifted with saturation to 1.31 format.
◆ tpt_scale_q7()
void tpt_scale_q7 |
( |
q7_t *__restrict |
aOutData, |
|
|
const q7_t *__restrict |
aInData, |
|
|
q7_t |
aScaleFract, |
|
|
int8_t |
aShift, |
|
|
uint32_t |
aCount |
|
) |
| |
Multiplies a Q7 vector by a scalar.
- Parameters
-
[out] | aOutData | points to the output vector |
[in] | aInData | points to the input vector |
[in] | aScaleFract | fractional portion of the scale value |
[in] | aShift | number of bits to shift the result by |
[in] | aCount | number of samples in the vector |
- Returns
- none
- Scaling and Overflow Behavior
- The input data
*aInData
and aScaleFract
are in 1.7 format. These are multiplied to yield a 2.14 intermediate result and this is shifted with saturation to 1.7 format.