Closed schote closed 1 year ago
Potential reasoning:
Minimal example to reproduce the root of the problem:
data = np.int16(6000) >> 1 | (0 << 15)
print(f"A: {np.int16(data << 1)}; D: {np.int16(data >> 15)}")
data = np.int16(6000) >> 1 | (1 << 15)
print(f"A: {np.int16(data << 1)}; D: {np.int16(data >> 15)}")
data = np.int16(-6000) >> 1 | (0 << 15)
print(f"A: {np.int16(data << 1)}; D: {np.int16(data >> 15)}")
data = np.int16(-6000) >> 1 | (1 << 15)
print(f"A: {np.int16(data << 1)}; D: {np.int16(data >> 15)}")
Output:
A: 6000; D: 0
A: 6000; D: 1
A: -6000; D: -1
A: -6000; D: -1
Use the following workaround:
np.uint16(value) >> 1 | digital
Transform the int16 value to uint16 before shifting.
Since the manipulate the bitorder anyway (by using 15th bit as digital and 14th bit as new MSB of analog value) the value is not a true int16 value anymore
Cause in plotting the sequence can be excluded since the scope showed the same track
Before combining digital and gradient signal, unblanking signal looks good
[ ] Ensure that the sequence plot agrees to the scope