Function Use - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_AbsSat

2.1.3 Function use

The use of the
MLIB_Abs
#include "mlib.h"
static
frac32_t
f32Result;
static
frac32_t
f32Val;
void main(void)
{
f32Val = FRAC32(-0.354);
/* f32Result = |f32Val| */
f32Result = MLIB_Abs_F32(f32Val);
}
2.2 MLIB_AbsSat
The
MLIB_AbsSat
functions return the absolute value of the input. The function
saturates the output. See the following equation:
2.2.1 Available versions
This function is available in the following versions:
• Fractional output - the output is the fractional portion of the result; the result is
within the range <0 ; 1). The result may saturate.
The available versions of the
Function name
Input type
MLIB_AbsSat_F16
frac16_t
MLIB_AbsSat_F32
frac32_t
24
function is shown in the following example:
/* f32Val = -0.354 */
Equation 2. Algorithm formula
MLIB_AbsSat
function are shown in the following table.
Table 2-2. Function versions
Result type
frac16_t
Absolute value of a 16-bit fractional value. The output is within the
range <0 ; 1).
frac32_t
Absolute value of a 32-bit fractional value. The output is within the
range <0 ; 1).
MLIB User's Guide, Rev. 2, 10/2015
Description
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents