I am sending data (signed 16bit fixed-point with 14 fractional bits) from one system to another. Due to constraints, the data has to be reinterpreted as uint16 before it is transmitted (i.e. bit representation is the same). The data ends up in Python but I am struggling to find a method to reinterpret this back to its original form.
For example:
The original value is -0.123
, reinterpreted as uint16 with value
63521
.
How do I convert this back to the value -0.123
using Python?
Some More Examples
1.0450 -> 17121
0.9870 -> 16171
-0.9870 -> 49365
-0.9870 -> 49365
is consistent with49365 -> -16171 / 2^14 = 0.986999
– harold