Engee documentation

1-D Lookup Table

Approximate one-dimensional function.

1 d lookup table

Description

Block 1-D Lookup Table calculates the approximate value of some function:

,

where the function can be empirical.

Block icon 1-D Lookup Table displays the graph of the function defined in the block.

The block maps the input data to a table of output values using interpolation and extrapolation methods.

The block supports the following interpolation methods: Flat, Linear point-slope, Linear Lagrange, Nearest, Cubic spline и Akima spline.

You can read more about interpolation methods here: Methods of approximation of function values

Setting reference points and output value table

These block parameters set the values for the datums and the output table.

Block parameter Назначение

Breakpoints 1

Sets the vector of reference points.

Table data

Defines the corresponding set of output values.

How the block generates output data

Block 1-D Lookup Table generates output data by searching the table or by evaluating values based on input values.

Block input data Block behaviour 1-D Lookup Table

Match the values in the datasets of the reference points

Outputs tabular value

Does not match the values in the datasets of the anchor points, but is within the range.

Interpolates the corresponding table values using the selected value Interpolation method

Do not match the values in the datasets of the reference points and are out of range

Extrapolates the output value using the selected Extrapolation method

Ports

Input

# IN_1 — input signal
scalar | vector | matrix

Details

An input signal , matched to an output value by searching or interpolating from a table of values.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Fixed-point, Bool.

Complex numbers support

Yes

Output

# OUT_1 — output signal calculated by searching or evaluating table values
scalar | vector | matrix

Details

An output calculated by finding or evaluating table values based on input values.

When the input data of a block is…​ Then the block 1-D Lookup Table…​

Match the values in the datasets of the reference points

Outputs a tabular value

Do not match the values in the datasets of the anchor points, but are within range

Interpolates the corresponding table values using the selected value. Interpolation method

Do not match the values in the anchor point datasets and are out of range

Extrapolates the output value using the selected Extrapolation method

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Fixed-point, Bool.

Complex numbers support

Yes

Parameters

Основные

# Table data — output value table
Array of real and/or complex numbers

Details

Table of output values.

Default value

tanh.(collect(-5:5))

Program usage name

Table

Tunable

Yes

Evaluatable

Yes

# Breakpoints 1 — reference point values for the first measurement
Array of real numbers

Details

Reference points for the first measurement.

Default value

collect(-5:5)

Program usage name

BreakpointsForDimension1

Tunable

Yes

Evaluatable

Yes

Lookup method

# Interpolation method — method of interpolation between the values of reference points
Flat | Nearest | Linear point-slope | Linear Lagrange | Cubic spline | Akima spline

Details

When the input signal falls between the reference point values, the unit interpolates the output value using the neighbouring points.

Read more about interpolation methods here: Methods of approximation of function values

Dependencies

  • If you select `Cubic spline`then the block will only support scalar signals. Other interpolation methods support non-scalar signals.

  • If you select Akima spline, the extrapolation method can only be Akima spline.

Values

Flat | Nearest | Linear point-slope | Linear Lagrange | Cubic spline | Akima spline

Default value

Linear point-slope

Program usage name

InterpMethod

Tunable

No

Evaluatable

No

# Extrapolation method — a method of processing input values that are outside the range of the dataset of reference points
Clip | Linear | Cubic spline | Akima spline

Details

Choice of extrapolation method.

Read more about extrapolation methods here: Methods of approximation of function values

Dependencies

  • To select Cubic spline for Extrapolation method, you must also select Cubic spline for Interpolation method.

  • To select Akima spline for the Extrapolation method, you must also select Akima spline for Interpolation method.

Values

Clip | Linear | Cubic spline | Akima spline

Default value

Linear

Program usage name

ExtrapMethod

Tunable

No

Evaluatable

No

Data type

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

Details

Specify the data type of the table values.

Values

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

Default value

Same as output

Program usage name

TableDataTypeStr

Tunable

No

Evaluatable

No

# Table fixed-point type — fixed-point data type for the table
Data type

Details

Specify the fixed point data type for the table.

Dependencies

To use this parameter, set parameter Table data value Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

TableDataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Breakpoints 1 — data type for the reference point values for the first measurement
Inherit: auto | Same as input | Float64 | Float32 | Float16 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Details

Specify the data type for the reference point values for the first measurement

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

BreakpointsForDimension1DataTypeStr

Tunable

No

Evaluatable

No

# Breakpoints 1 fixed-point type — fixed point data type for the reference point values for the first measurement
Data type

Details

Specify the fixed point data type for the reference point values for the first measurement.

Dependencies

To use this parameter, set the parameters to Breakpoints 1 value Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

BreakpointsForDimension1DataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Fraction — fraction data type
Inherit: auto | Float64 | Float32 | Fixed-point

Details

Specify the data type of a fraction.

Values

Inherit: auto | Float64 | Float32 | Fixed-point

Default value

Inherit: auto

Program usage name

FractionDataTypeStr

Tunable

No

Evaluatable

No

# Fraction fixed-point type — fixed-point fraction data type
Data type

Details

Specify the fixed-point fraction data type.

Dependencies

To use this parameter, set the parameters to Fraction value Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

FractionDataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Intermediate results — intermediate results data type
Inherit: auto | Same as output | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Details

Specify the data type of intermediate results.

Values

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

Default value

Same as output

Program usage name

IntermediateResultsDataTypeStr

Tunable

No

Evaluatable

No

# Intermediate results fixed-point type — fixed-point data type of intermediate results
Data type

Details

Specify the fixed-point data type of intermediate results.

Dependencies

To use this parameter, set the parameters to Intermediate results value Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

IntermediateResultsDataTypeStrFixed

Tunable

No

Evaluatable

Yes

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

Details

Specify the type of output data.

Values

Inherit: from `Table data` | 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 — fixed-point output data type
Data type

Details

Specify the fixed-point output type.

Dependencies

To use this parameter, set parameter Output value 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 select:

  • Floor - rounds both positive and negative numbers downwards (towards negative infinity).

  • Ceiling - rounds both positive and negative numbers upwards (towards positive infinity).

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

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

  • Round - rounds the number to the nearest representable value. If the fractional part of a number ends in 5, positive numbers are rounded upwards (towards positive infinity) and negative numbers are rounded downwards (towards negative infinity).

  • 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 action method
Logical

Details

When checked, saturation is applied to all internal block operations, not just the output or result.

Action Reasons for taking this action What happens when overflows Example

Check this box.

Overflows are possible in your model and you need explicit saturation protection in the generated code.

Overflows are saturated to the minimum or maximum value that this data type can represent.

An overflow associated with a signed 8-bit integer may saturate to -128 or 127.

Do not select this check box.

You want to optimise the efficiency of the generated code.
You want to avoid over-specifying how the block handles out-of-range signals.

Overflows are wrapped in an appropriate value that can be represented by a data type.

The number 130 does not fit into a signed 8-bit integer and is collapsed into -126

Default value

false (switched off)

Program usage name

SaturateOnIntegerOverflow

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes