diff --git a/synapse/utils/ndtp_types.py b/synapse/utils/ndtp_types.py index 85641c3..9a3820b 100644 --- a/synapse/utils/ndtp_types.py +++ b/synapse/utils/ndtp_types.py @@ -53,12 +53,14 @@ def pack(self, seq_number: int): @staticmethod def from_ndtp_message(msg: NDTPMessage): + dtype = np.int16 if msg.payload.is_signed else np.uint16 return ElectricalBroadbandData( t0=msg.header.timestamp, bit_width=msg.payload.bit_width, + is_signed=msg.payload.is_signed, sample_rate=msg.payload.sample_rate, samples=[ - (ch.channel_id, np.array(ch.channel_data, dtype=np.int16)) + (ch.channel_id, np.array(ch.channel_data, dtype=dtype)) for ch in msg.payload.channels ], )