Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SI converstion #507

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions adi/rx_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ def __rx_unbuffered_data(self):

for samp in range(self.rx_buffer_size):
for i, m in enumerate(self.rx_enabled_channels):
s = self._get_iio_attr(
raw = self._get_iio_attr(
self._rx_channel_names[m], "raw", False, self._rxadc
)
if self._rx_output_type == "SI":
x[i][samp] = rx_scale[i] * s + rx_offset[i]
x[i][samp] = (raw + rx_offset[i]) * rx_scale[i]
else:
x[i][samp] = s
x[i][samp] = raw

return x

Expand Down Expand Up @@ -270,7 +270,7 @@ def __rx_non_complex(self):
rx_scale = self.__get_rx_channel_scales()
rx_offset = self.__get_rx_channel_offsets()
x = x if isinstance(x, list) else [x]
x = [rx_scale[i] * x[i] + rx_offset[i] for i in range(len(x))]
x = [rx_scale[i] * (x[i] + rx_offset[i]) for i in range(len(x))]
elif self._rx_output_type != "raw":
raise Exception("_rx_output_type undefined")

Expand Down
Loading