Module SENSORM :: GENPOLY
Generic polynomial conversion function.
Syntax
GENPOLY( VIN, [NORDER,] VCOEFFS, VOUT )
Parameters
 VIN
 Input data values
 FLOAT PIPE
 NORDER
 Order of the polynomial function
 WORD CONSTANT
 VCOEFFS
 Coefficients of the polynomial
 FLOAT VECTOR
 VOUT
 Output data values
 FLOAT PIPE
Description
The GENPOLY command is a general purpose
mapping from a stream of input data received from pipe
VIN , to produce a stream of output data in
pipe VOUT. One common application of this command
is mapping measurements of an arbitrary nonlinear sensor into
the equivalent measurement in the desired physical units.
The polynomial mapping is determined by the VCOEFFS
vector. The coefficients specified in this vector start
with the zeroorder term, followed by the firstorder term,
followed by the secondorder term, etc. up to the order
specified by the NORDER parameter. If you omit
the NORDER parameter, the command will count
terms and assume the corresponding maximum order.
Using only a firstorder polynomial, this command becomes
equivalent to a SCALE command. From the opposite
point of view, this command covers the functionality of the
SCALE command at the same time that it performs
nonlinear mappings. When using this command for "linearizing"
the response of a nonlinear sensor, it can at the same time
provide gain and offset corrections.
Examples
VECTOR VCOEFFS FLOAT = ( 1.0, 3.085e3, 5.707e7 )
CONSTANT ORDER WORD = 2
...
GENPOLY( PIN, ORDER, VCOEFFS, POUT )
Take values X from the PIN
pipe one at a time, and for each one apply the
secondorder polynomial mapping
Y = 1.0 + 3.085e3*X + 5.707e7*X^{2}
to obtain the values Y that are placed into
the output data stream POUT.
See also:
SCALE, RTD, THERMPOLY
