pwl_func :
A piecewise-linear (PWL) function for xreal-typed signals.
The pwl_func
primitive defines a piecewise-linear function of xreal-typed signals. With this primitive, one can define an arbitrary DC transfer function.
The piecewise-linear function is described by a set of PWL data points, which can be specified either inline using the parameter data
or within a file of which name is given by the parameter ‘filename’.
The parameter data
is formatted as a real array of (input, output) pairs with at least two data points: ‘{in1, out1, in2, out2, …}. For instance, if the value of data
is provided as ‘{-1.0, -10.0, 1.0, 10.0}, the pwl_func
primitive realizes a function of which output is:
-10.0 for input < -1.0 10*input for -1.0 <= input < 1.0 +10.0 for input >= 1.0
When the parameter filename
is defined, the primitive reads the named file that defines the parameter values in Python format. For instance, for the parameter data
, its real-typed array value can be defined as following:
data = [ in1, out1, in2, out2, in3, out3, ... ]
Input/Output Terminals
Name | I/O | Type | Description |
out | output | xreal | output signal |
in | input | xreal | input signal |
Parameters
Name | Type | Default | Unit | Description |
data | real array | ‘{-1.0, -1.0, 1.0, 1.0} | None | PWL data points |
filename | string | “” | None | parameter definition file |