Main Content

capture

Retrieve captured IQ data from an NI USRP radio device

Since R2024a

Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.

Description

[data,dataLength] = capture(device,length) captures IQ data of length length from the air using the specified NI™ USRP™ radio device. The function returns the captured signal data and the captured data length dataLength.

example

Examples

collapse all

Create a usrp System object, specifying a radio setup configuration previously saved in the Radio Setup wizard.

device = usrp("MyRadio");

Program the FPGA with your bitstream and configure the hardware interfaces.

programFPGA(device,"myBitstream.bit","myDeviceTree.dts");
Loading bitstream to FPGA...
Loading bitstream to FPGA is now complete.
describeFPGA(device,"ModelName_wthandoffinfo.mat"); 

Specify a capture antenna on the radio and memory allocation in the PL DDR buffer.

captureLength = 1000;
device.CaptureAntennas = "DB0:RF1:RX1";
device.CaptureDDRAllocation = captureLength;

Connect to the radio and apply radio front end properties.

setup(device);

Call the usrp System object as a function to start the radio front end. Request captureLength samples.

device(captureLength);

Retrieve captureLength samples of captured IQ data from the radio at the default center frequency and baseband sample rate.

[data,dataLength] = capture(device,captureLength);

Confirm that all requested samples were retrieved from the radio.

isequal(dataLength,captureLength)
ans = logical
   1

Input Arguments

collapse all

NI USRP radio device, specified as a usrp System object™.

Capture length, specified as an integer number of samples.

The number of samples that you can request is limited by the CaptureDDRAllocation property of the usrp object specified by the device input argument.

Note

If your host computer does not have enough free memory to receive the captured data, the function call can hang or error out. To free up memory space on your host computer, try closing other software or reduce the capture length.

Example: 1e5

Data Types: double | duration

Output Arguments

collapse all

Captured signal, returned as a complex-valued column vector.

Note

The first data samples of the captured signal can contain transient values from the radio data path.

Data Types: int16
Complex Number Support: Yes

Captured data length, returned as an integer number of samples.

Data Types: double

Version History

Introduced in R2024a