Skip to content

Commit

Permalink
Use tx sr to create waveform
Browse files Browse the repository at this point in the history
Signed-off-by: Julia Pineda <Julia.Pineda@analog.com>
  • Loading branch information
jpineda3 committed May 21, 2024
1 parent 3eae8f2 commit 14bb0dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/dma_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,14 @@ def cw_loopback(uri, classname, channel, param_set, use_tx2=False, use_rx2=False
RXFS = int(getattr(sdr, attr))

A = 2 ** 15
fc = RXFS * 0.1
fc = int(fc / (RXFS / N)) * (RXFS / N)
if hasattr(sdr, "tx_sample_rate"):
FS = int(sdr.tx_sample_rate)
else:
FS = RXFS
fc = FS * 0.1
fc = int(fc / (FS / N)) * (FS / N)

ts = 1 / float(RXFS)
ts = 1 / float(FS)
t = np.arange(0, N * ts, ts)
if sdr._complex_data:
i = np.cos(2 * np.pi * t * fc) * A * 0.5
Expand Down

0 comments on commit 14bb0dc

Please sign in to comment.