1D Look-up table

Description of the one dimensional lookup table component, which creates a vector a look-up-table of 100 data points based on the defined input and output.

Component Icon

Figure 1. One dimensional look-up table icon

Description

1D Lookup table generates an output signal by interpolating based on a given data set and input value. The Input values x property must be a strictly increasing or decreasing array.

It supports equidistant and non-equidistant distributions of table indexes (Input values x):
  • An example of an equidistant distribution of input values would be: in_vec_x = [-2, -1, 0, 1, 2];
  • An example of a non-equidistant distribution of input values would be: in_vec_x = [-4, 0, 2, 3, 10]

The table output can be calculated using the equidistant space method or the non-equidistant (binary search) implementation method.

When the input vector (Input values x) has a non-equidistant distribution and the equidistant space method is selected, an internal conversion from non-equidistant to equidistant distribution is done. In this case, a warning is displayed during compilation.

Extrapolation can be done by clipping the output to the first and last values of output vector f(x), or with the linear slope between the first or last two points of output vector f(x).
  • If the extrapolation method is clipping output, the value returned on the output will be the first value of the output vector f(x), provided that the input value is less than the first value of input vector. If the input value is greater than the last value of the input vector, the value returned on the output will be the last value of the output vector.
  • If the extrapolation method is Linear, a line between the first or last values of the output vector f(x) is traced, depending on whether the input value is less than the first or greater than the last values of output vector. The linear extrapolation method returns the value of the generated line corresponding to the input.

The following example illustrates the difference between equidistant and non-equidistant implementation, and linear and clip extrapolation.

Equidistant and Clip

Input value x = [1, 2, 3, 4, 5]

f(x) = [10, 20, 30, 40, 50]

Equidistant and Linear

Input value x = [1, 2, 3, 4, 5]

f(x) = [10, 20, 30, 40, 50]

x f(x) x f(x)
0 0 0 0
0.5 0 0.5 5
1 10 1 10
2 20 2 20
3.6 36 3.6 36
4.7 47 4.7 47
5 50 5 50
5.8 50 5.8 58
6.7 50 6.7 67

Non-equidistant and Clip

Input value x = [1, 1.5, 3, 4.2, 5]

f(x) = [10, 20, 30, 40, 50]

Non-equidistant and Linear

Input value x = [1, 1.5, 3, 4.2, 5]

f(x) = [10, 20, 30, 40, 50]

x f(x) x f(x)
0 0 10 -10
0.5 10 0.5 0
1 10 1 10
2 23.33 2 23.33
3.6 35 3.6 35
4.7 46.25 4.7 46.25
5 50 5 50
5.8 50 5.8 58
6.7 50 6.7 60

Ports

  • In(in)
    • Input signal value that is used to calculate the output.
      • Supported types: uint, int, real.
      • Vector support: no.
  • Output (out)
    • Output signal related to the input value and the lookup table.
      • Supported types: real.
      • Vector support: no

Properties

  • Input values x
    • Type in the array of input values used to calculate the output of the lookup table
  • Output values f(x)
    • Type in the array of output values according to the related input values used to calculate the output of the lookup table.
  • Implementation method
    • Choose the interpolation method used to calculate the output values when the input value is within the input array range.
  • Extrapolation method
    • Choose the extrapolation method used to calculate output values when the input value is outside of the input array range.
  • Execution rate
    • Type in the desired signal processing execution rate. This value must be compatible with other signal processing components of the same circuit: the value must be a multiple of the fastest execution rate in the circuit. There can be up to four different execution rates, but they must all be multiple of the basic simulation timestep. To specify the execution rate, you can use either decimal (e.g. 0.001) or exponential values (e.g. 1e-3) in seconds. Alternatively, you can type in ‘inherit’ in which case the component will be assigned execution rate based on the execution rate of the components it is receiving input from.