Skip to content

Commit

Permalink
Merge pull request #449 from SaikiranGudla/master
Browse files Browse the repository at this point in the history
rx_tx: Add tx_data_type
  • Loading branch information
tfcollins authored Jul 5, 2023
2 parents 03aa90a + 7ad8b30 commit 0778bab
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 0778bab

Please sign in to comment.