Commit graph

30 commits

Author SHA1 Message Date
Lars Amsel
4289cc1eef examples: Don't do timed commands for X410 in tx_waveform examples
X410 cannot reliably tune using timed command. Therefore explicitly
disable that in TX examples for X410.
2024-06-26 14:49:20 +02:00
Marian Koop
675ab7c824 example: python: Make use of timespec consistent in MultiUSRP and RFNoC use cases
Created new command argument to specify transmit delay, and utilize it in all
three code path (MultiUSRP, DRAM send, and DRAM upload + issue_stream_cmd.
For the first code path use of predefined transmit start time is new behavior,
and could also result into unexpected errors if the tx_delay is selected to small.
2024-06-11 10:20:08 +02:00
Marian Koop
aedb8ac79f example: python: Changed setting frequency to use time commands
Modified example to support demonstratig the X440 phase repeatability
performance when using dram feature. Change is compatible with all supported
rfnoc devices that utilize the RFNoC Replay Block, but only improves
phase repeatability performance of X440.

Separated loops configuring radio properties and converted setting carrier
frequency into timed commands. This required moving this code to a later
part in the programming flow, after all the clock source settings are
applied and the LO locks are confirmed.
2024-06-11 10:20:08 +02:00
Martin Anderseck
94323947b8 examples: Amend rx_to_file.py to use DramReceiver
When calling rx_to_file.py with the --dram option, it will internally
use DramReceiver and buffer the signal into the DRAM before transferring
it to the host.
2024-02-27 11:29:00 -06:00
Marian Koop
bc97db2847 examples: Fixed bugs observing cmd argument -c in remote_rx.py example
Fixed bug that used hardcoded channel variable to configure
device (rate, freq, gain), but channel list from argument during
streaming configuration.
Fixed bug when specifying multiple channels with duration argument
that resulted into python syntax error.
Changed multi channel behavior to use unique streamer per channel,
which now requires specifying dest-port per channel. This approach
ensures receiver implementation can associate data with a usrp
channel.
2024-01-03 08:56:28 -06:00
Virendra Kakade
d6608fc4d0 fixup! examples: L band capture example using dual rate 2023-11-02 08:30:45 -05:00
Virendra Kakade
33a869892f examples: L band capture example using dual rate
This example demonstrates the simultaneous capture of the entire L-band
which extends from 1 GHz to 2.4 GHz using one channel on each of the two
radios using the dual rate feature. This is supported ionly on the X440 device.
Read the comments in the example for details.

Does the following:
- Sets up connections in rfnoc graph
- Configures radios and dual replay blocks
- Synchronously captures data and streams to replay block
- Fetches data to host and plots a windowed FFT.
- Repeat.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
2023-10-27 15:43:18 -05:00
Martin Braun
51c1a74eee examples: Amend tx_waveforms.py to use DramTransmitter
When calling tx_waveforms.py with the --dram option, it will internally
use DramTransmitter and first upload the signal before transmitting it
from DRAM.
2023-07-07 12:35:55 -07:00
Wade Fife
02558b69f7 examples: Add throttle to replay_capture.py
Adds --throttle argument, which controls the playback rate to the host
and is set as a percentage of maximum stream endpoint throughput.

Also adds --no-progress to disable the TQDM progress bar and increases
the buffer size used with TQDM to avoid overusing the CPU during
playback to the host.
2023-03-13 17:51:17 -04:00
Wade Fife
d647481681 examples: Fix play region in replay_capture.py 2023-02-06 13:09:11 -06:00
Martin Braun
a835bb67bc examples: remote_rx: Add --mac-address argument
This allows manually overriding the MAC address for a target.
2022-09-23 13:01:58 -07:00
Martin Braun
4d6b7263f5 Revert "uhd: Revert Raw UDP Host Changes"
This reverts commit 6cb1dcca83.

Raw UDP support is added back in on both MPM and UHD side.
2022-09-21 15:35:55 -07:00
Steven Koo
6cb1dcca83 uhd: Revert Raw UDP Host Changes
This reverts the Raw UDP host changes which is breaking
multiple interface streaming.

Commits addb81aa5d2d6adcd3a0c7a8d59fcd96af0c1ec4^..b1ca51f97aaa2226ed6ef339fb26fbea54ab7593
are reverted.

Reverts:
doc: Update manual on streaming
examples: Add remote RX streaming example
rfnoc: Enable remote UDP streaming
mpm: e320: Enable raw UDP streaming
mpm: n3xx: Enable raw UDP streaming
mpm: x4xx: Enable transport manager adapter
mpm: Enable opt-in transport adapter control
rfnoc: Transition stream managers and mgmt_portal to topo_graph_t
rfnoc: Add topology graph object
uhd/mpm: Add API to set remote routes
mpm: xports: Add XportAdapterMgr class
2022-09-12 17:00:19 -05:00
Martin Braun
d31e4a4ffe examples: Add remote RX streaming example
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
2022-08-30 13:43:36 -05:00
Martin Braun
f43511e913 examples: Add replay_capture.py
This is an example that allows capturing RF data into DRAM, and then
stream it back to host, using the Python API.
2022-03-31 08:10:45 -07:00
Lars Amsel
0fa4f7179b bug: fix channel indexing when reading USRP power
the USRP power meter will only receive from a single channel which
is configured by the argument parameter. The streamer receive
data will therefor alwalys have a single channel. So do not index
with chan when passing the streamer to uhd.dsp.signals.get_usrp_power.
2021-10-11 10:43:10 -07:00
Martin Braun
4e1068671f python: multi_usrp: Fix issues in send_waveform()
- Like with RX, this now allows passing in stream time and existing
  streamer
- There was no EOB being sent at the end (now there is)
- Fixed some linter issues
2021-10-06 11:57:25 -07:00
Martin Braun
b34e2f0593 python: Fix dropped-sample calculation in benchmark_rate.py
This fixes a subtle bug, where a variable to cache the timestamp of an
error gets bound to the metadata instead of creating a copy thereof.
Without this fix, the calculation of dropped samples would always be 0,
because the difference in timestamps would incorrectly be always zero.
This fix will now make a copy of the timestamp.

Shoutout to GitHub user bhorsfield for finding this issue.
2021-09-28 06:25:25 -07:00
Martin Braun
d2fc12dd8d examples: Fix underrun/seq error reporting in benchmark_rate.py
The numbers for these were swapped.
2021-05-20 14:58:43 -05:00
Lars Amsel
5476ec584e examples: Fix usrp_power_meter example
This PR applies antenna channel settings before available calibration
data, and moves initialization code to setup_device, returning necessary
settings in a tuple.
2020-06-11 08:26:23 -05:00
Martin Braun
14ed832af5 examples: Add usrp_power_meter example
This is a utility that can be used to measure received power, assuming
a calibrated device.

For example, it can be called like this:

    usrp_power_meter.py -a type=x300 -f 1e9 --mode continuous

To continuously measure input power at 1 GHz.
2020-05-19 13:30:20 -05:00
Martin Braun
1bba62a75a Remove remaining Python 2 references
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
  python3
2020-05-07 15:10:41 -05:00
Martin Braun
113b3262d3 examples: benchmark_rate.py: Add ?x_stream_args args
This allows adding stream args to the Python version of benchmark_rate
in the same way as for the C++ version, e.g.:

python3 ./benchmark_rate.py \
    --args addr=192.168.40.2,num_poll_offload_threads=4 \
    --rx_stream_args \
        recv_offload=1,num_recv_frames=32,recv_offload_wait_mode=poll \
    --tx_stream_args \
        send_offload=1,num_send_frames=32,send_offload_wait_mode=poll \
    [... other arguments ...]
2019-11-26 12:21:33 -08:00
Brent Stapleton
7d2ba938a7 python: Fixup bmark_rate printed statistics
- When printing statistics, the number of TX and RX timeouts were mixed
up.
- Fixing main() docstring

Fixes e735a63ff9 ("python: Adding Python API benchmark rate")
2019-08-21 16:36:37 -07:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Brent Stapleton
680855e85a python: Fix duration of benchmark rate
Duration of multichannel benchmark was 50 seconds longer than
intended- a 50ms initialization delay was mistakenly multiplied by
1000.

Fixes e735a63ff9 ("python: Adding Python API benchmark rate")
2018-09-12 09:59:55 -07:00
Brent Stapleton
e735a63ff9 python: Adding Python API benchmark rate
Python API version of the benchmark rate utility.
2018-06-20 19:02:32 -05:00
Paul David
a603c97d06 python: Added curses frequency plot example 2018-06-20 19:02:32 -05:00
Paul David
e74cf7635b python: Separating exposed Python data structures
- Separating exposed Python data structures into logical sections
- Exposes all of the multi_usrp API
- Adds a layer of Python for documentation and adding helper methods
- Adds improvements and fixes to the MultiUSRP object
- Includes additional exposed data structures (like time_spec_t, etc.)
- Add code to release the Python GIL during long C++ calls
2018-06-20 19:02:32 -05:00
Andrej Rode
22e24497a5 python: Initial commit of Python API
Initial commit of the Python API using Boost.Python. Bind the
MultiUSRP API for use in Python. Bindings intended to provide as
complete coverage as possible.
- Wrap most multi_usrp calls
- Adding multi channel send/recv examples in examples/python
- Adding setuptools support
- Initial attempt at binding the UHD types and filters
2018-06-20 19:02:32 -05:00