Skip to content

Commit

Permalink
fix: fix parsing of unsigned electrical broadband data
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniaelsen committed Oct 16, 2024
1 parent 3ebca1a commit 731492e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion synapse/utils/ndtp_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
)
Expand Down

0 comments on commit 731492e

Please sign in to comment.