BITSCALE

Purpose:

Converts raw AD counts to scaled engineering values.

Syntax:

BITSCALE(xi, numbits, yl, yh)

xi

-

An input series or scalar.

numbits

-

An integer. The number of AD converter bits.

yl

-

A real. The low value output range.

yh

-

A real. The high value output range.

Returns:

A series or real.

Example:

bitscale(4096, 16, -2.5, 2.5)

 

returns 0.312543, the corresponding output for input 4096 of a 16 bit converter with an output range of +-2.5

Example:

bitscale(-128..127, 8, 0.0, 10.0)

 

returns a series ranging from 0.0 to 10.0

Remarks:

BITSCALE assumes offset binary input data, i.e the input data ranges from:

 

-(2^numbits)/2 to (2^numbits)/2 - 1.

 

BITSCALE does not automatically clip out of range values.

See Also:

BITQUANT

LINSCALE

QUANTIZE

RESCALE