Data Type Conversion
Changes the data type of the signal.
blockType: DataTypeConversion
Data Type Conversion Path in the library:
|
|
Cast To Bool Path in the library:
|
|
Cast To Float64 Path in the library:
|
|
Cast To Float32 Path in the library:
|
Description
The Data Type Conversion block converts an input signal of any data type supported by Engee into the specified data type.
Ports
Input
#
IN_1
—
input signal
scalar
| vector
| matrix
| array
Details
Input signal as a scalar, vector, matrix or array.
The input signal can be any real or complex signal. If the input signal is real, the output signal is real. If the input signal is complex, the output signal is complex. The block converts the input signal to the data type specified in the parameter Output data type.
When converting fixed-point data types, use the Input and output to have equal parameters to specify the conversion method. Real World Value (RWV)
or Stored Integer (SI)
.
Data types |
|
Complex numbers support |
Yes |
Output
#
OUT_1
—
output signal
scalar
| vector
| matrix
| array
Details
An input signal converted to a given data type with the same dimensions as the input signal.
Data types |
|
Complex numbers support |
Yes |
Parameters
Main
#
Output data type —
type of output data
Float64
| Float32
| Float16
| Int8
| UInt8
| Int16
| UInt16
| Int32
| UInt32
| Int64
| UInt64
| Int128
| UInt128
| Bool
| Fixed-point
Details
Specify the type of output data.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Output fixed-point type —
the type of fixed-point output
Data type
Details
Specify the type of fixed-point output.
Dependencies
To use this parameter, set for the parameter Output data type meaning Fixed-point
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Input and output to have equal —
limitation for data type conversion
Real World Value (RWV)
| Stored Integer (SI)
Details
Specify what type of input and output should be in the context of a fixed-point data representation.:
-
Real World Value (RWV)
— Convert a signal from one data type to another, trying to preserve the original value of the input signal. The block takes into account the limitations imposed by scaling the input and output signals, and tries to generate an output signal equal to the original value. -
Stored Integer (SI)
— change the original value of the input signal by scaling the stored integer value. Within the specified data types, the block tries to store the integer value of the signal during conversion.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
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:
-
Floor
— rounds down both positive and negative numbers (towards negative infinity). -
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. -
Convergent
— 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.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Saturate on integer overflow —
method of action in case of overflow
Logical
Details
When this check box is selected, the value that goes beyond the type limits is reset to the maximum or minimum value that the selected data type can represent. Otherwise, overflow transfer occurs.
When this option is selected, saturation is applied to all internal operations in the block, not just to the output or result.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |