|
void | tpt_mat_scale_f32 (f32_t *aOutMat, const f32_t *aInMat, uint16_t aRows, uint16_t aCols, f32_t aScale) |
| Floating-point matrix scaling. More...
|
|
void | tpt_mat_scale_f64 (f64_t *aOutMat, const f64_t *aInMat, uint16_t aRows, uint16_t aCols, f64_t aScale) |
| Floating-point matrix scaling. More...
|
|
void | tpt_mat_scale_q15 (q15_t *aOutMat, const q15_t *aInMat, uint16_t aRows, uint16_t aCols, q15_t aScaleFract, int8_t aShift) |
| Q15 matrix scaling. More...
|
|
void | tpt_mat_scale_q31 (q31_t *aOutMat, const q31_t *aInMat, uint16_t aRows, uint16_t aCols, q31_t aScaleFract, int8_t aShift) |
| Q31 matrix scaling. More...
|
|
Multiplies a matrix by a scalar. This is accomplished by multiplying each element in the matrix by the scalar. For example:
Matrix Scaling of a 3 x 3 matrix
In the fixed-point Q15 and Q31 functions, scale
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 overall scale factor applied to the fixed-point data is
scale = aScaleFract * 2^aShift.
◆ tpt_mat_scale_f32()
void tpt_mat_scale_f32 |
( |
f32_t * |
aOutMat, |
|
|
const f32_t * |
aInMat, |
|
|
uint16_t |
aRows, |
|
|
uint16_t |
aCols, |
|
|
f32_t |
aScale |
|
) |
| |
Floating-point matrix scaling.
- Parameters
-
[out] | aOutMat | points to output matrix |
[in] | aInMat | points to input matrix |
[in] | aRows | rows of matrix |
[in] | aCols | cols of matrix |
[in] | aScale | scale factor to be applied |
- Returns
- none
◆ tpt_mat_scale_f64()
void tpt_mat_scale_f64 |
( |
f64_t * |
aOutMat, |
|
|
const f64_t * |
aInMat, |
|
|
uint16_t |
aRows, |
|
|
uint16_t |
aCols, |
|
|
f64_t |
aScale |
|
) |
| |
Floating-point matrix scaling.
- Parameters
-
[out] | aOutMat | points to output matrix |
[in] | aInMat | points to input matrix |
[in] | aRows | rows of matrix |
[in] | aCols | cols of matrix |
[in] | aScale | scale factor to be applied |
- Returns
- none
◆ tpt_mat_scale_q15()
void tpt_mat_scale_q15 |
( |
q15_t * |
aOutMat, |
|
|
const q15_t * |
aInMat, |
|
|
uint16_t |
aRows, |
|
|
uint16_t |
aCols, |
|
|
q15_t |
aScaleFract, |
|
|
int8_t |
aShift |
|
) |
| |
Q15 matrix scaling.
- Parameters
-
[out] | aOutMat | points to output matrix |
[in] | aInMat | points to input matrix |
[in] | aRows | rows of matrix |
[in] | aCols | cols of matrix |
[in] | aScaleFract | fractional portion of the scale factor |
[in] | aShift | number of bits to shift the result by |
- Returns
- none
- Scaling and Overflow Behavior
- The input data
*aInMat
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_mat_scale_q31()
void tpt_mat_scale_q31 |
( |
q31_t * |
aOutMat, |
|
|
const q31_t * |
aInMat, |
|
|
uint16_t |
aRows, |
|
|
uint16_t |
aCols, |
|
|
q31_t |
aScaleFract, |
|
|
int8_t |
aShift |
|
) |
| |
Q31 matrix scaling.
- Parameters
-
[out] | aOutMat | points to output matrix |
[in] | aInMat | points to input matrix |
[in] | aRows | rows of matrix |
[in] | aCols | cols of matrix |
[in] | aScaleFract | scale factor to be applied |
[in] | aShift | scale factor to be applied |
- Returns
- none
- Scaling and Overflow Behavior
- The input data
*aInMat
and aScaleFract
are in 1.31 format. These are multiplied to yield a 2.62 intermediate result which is shifted with saturation to 1.31 format.