DADiSP Worksheet Functions > Function Categories > Fourier Transforms and Signal Processing > BITSCALE
Converts raw AD counts to scaled engineering values.
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. |
A series or real.
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
bitscale(-128..127, 8, 0.0, 10.0)
returns a series ranging from 0.0 to 10.0
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.