Skip to content

Commit

Permalink
rx_tx: Add tx_data_type
Browse files Browse the repository at this point in the history
To enable buffer transmission with data types larger than 16 bits.

Signed-off-by: SGudla <[email protected]>
  • Loading branch information
SaikiranGudla committed Jun 30, 2023
1 parent 03aa90a commit 7ad8b30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adi/rx_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class tx(dds, rx_tx_common):
_txdac: iio.Device = []
_tx_channel_names: List[str] = []
_complex_data = False
_tx_data_type = np.int16
__txbuf = None
_output_byte_filename = "out.bin"
_push_to_file = False
Expand Down Expand Up @@ -459,7 +460,7 @@ def tx(self, data_np=None):

indx = 0
stride = self._num_tx_channels_enabled * 2
data = np.empty(stride * len(data_np[0]), dtype=np.int16)
data = np.empty(stride * len(data_np[0]), dtype=self._tx_data_type)
for chan in data_np:
i = np.real(chan)
q = np.imag(chan)
Expand All @@ -475,7 +476,7 @@ def tx(self, data_np=None):

indx = 0
stride = self._num_tx_channels_enabled
data = np.empty(stride * len(data_np[0]), dtype=np.int16)
data = np.empty(stride * len(data_np[0]), dtype=self._tx_data_type)
for chan in data_np:
data[indx::stride] = chan.astype(int)
indx = indx + 1
Expand Down

0 comments on commit 7ad8b30

Please sign in to comment.