Engee documentation

Abs

Page in progress.

The absolute value (modulus).

blockType: Abs

Path in the library:

/Basic/Math Operations/Abs

Description

Block Abs calculates the absolute value of the input signal.

Ports

Input

# IN_1 — input signal
scalar | vector

Details

Input signal.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

Yes

Output

# OUT_1 — output signal
scalar | vector

Details

The absolute value of the input signal.

Data types

Float64.

Complex numbers support

Yes

Parameters

Parameters

# Zero-Crossing Detection — zero crossing detection
Enable | Disable | Expose discontinuities to solver

Details

Zero crossing detection:

  • Enable — Zero crossing detection is enabled.

  • Disable — Zero crossing detection is disabled.

  • Expose discontinuities to solver — Gap detection using a solver.

Values

Enable | Disable | Expose discontinuities to solver

Default value

Expose discontinuities to solver

Program usage name

ZeroCross

Tunable

No

Evaluatable

No

Main

# Output data type — type of output data
Inherit: auto | Same as input | Float64 | Float32 | Float16 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Details

Select the data type for the output data.

Values

Inherit: auto | Same as input | Float64 | Float32 | Float16 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Default value

Same as input

Program usage name

OutDataTypeStr

Tunable

No

Evaluatable

No

# Output fixed-point type — the output type of fixed-point numbers
Data type

Details

Specify the output type of fixed-point numbers.

Dependencies

To use this parameter, set for the parameter Output data type meaning Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

OutDataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Integer rounding mode — rounding mode for fixed point operations
Ceiling | Convergent | Floor | Nearest | Round | Zero

Details

Select the rounding mode for fixed-point operations. You can choose:

  • Ceiling — rounds up both positive and negative numbers (towards positive infinity).

  • Convergent — rounds the number to the nearest representable value. If the fractional part of the number ends in 5, the number is rounded to the nearest even integer.

  • Floor — rounds down both positive and negative numbers (towards negative infinity).

  • Nearest — rounds the number to the nearest representable value. If the fractional part of the number ends in 5, the number is rounded up (towards positive infinity).

  • Round — rounds the number to the nearest integer.

  • Zero — rounds the number towards zero.

The block parameters are always rounded to the nearest representable value.

Values

Ceiling | Convergent | Floor | Nearest | Round | Zero

Default value

Floor

Program usage name

RndMeth

Tunable

No

Evaluatable

No

# Saturate on integer overflow — overflow behavior
Logical

Details

When this option is selected, saturation is applied to all internal operations in the block, not just to the output or result. In general, the code generation process can determine when overflow is not possible. In this case, the code generator does not generate a saturation code.

Action Justification Effect on overflow Example

The flag Saturate on integer overflow installed (enabled).

Overflow is possible for your model, and you want explicit overflow protection in the generated code.

In case of overflow, the result is automatically replaced with the maximum possible (modulo) value for the data type.

The number 130 does not fit into a signed, 8-bit integer and returns to the value `127'.

The flag Saturate on integer overflow not installed (disabled).

You want to optimize the efficiency of your generated code.

Overflows are transferred to the appropriate value, which can be represented by a data type.

The number 130 does not fit into a signed, 8-bit integer and returns to the value `-126'.

Default value

false (switched off)

Program usage name

SaturateOnIntegerOverflow

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes