Main Content


Capture IQ data using baseband receiver or transceiver



[data,timestamp,droppedSamples] = capture(bba,length) captures IQ data of length length from the air using the specified baseband receiver or baseband transceiver bba. The function returns the captured signal data, capture request timestamp timestamp, and dropped samples status droppedSamples.


collapse all

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

bbrx = basebandReceiver("MyRadio")
bbrx = 
  basebandReceiver with properties:

               RadioGain: 10
         CenterFrequency: 2.4000e+09
              SampleRate: 250000000
                Antennas: "RF0:RX2"
    DroppedSamplesAction: "error"
         CaptureDataType: "int16"

Set the baseband sample rate and center frequency.

bbrx.SampleRate = 122.88e6;
bbrx.CenterFrequency = 2.2e9;

Capture 3 ms of IQ data with the radio associated with the baseband receiver object using the default antenna.

[data,~] = capture(bbrx,milliseconds(3));

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

bbtrx = basebandTransceiver("MyRadio")
bbtrx = 
  basebandTransceiver with properties:

          TransmitRadioGain: 10
    TransmitCenterFrequency: 2.4000e+09
           TransmitAntennas: "RF0:TX/RX"
           CaptureRadioGain: 10
     CaptureCenterFrequency: 2.4000e+09
            CaptureAntennas: "RF0:RX2"
            CaptureDataType: "int16"
       DroppedSamplesAction: "error"
                 SampleRate: 250000000

Set the baseband sample rate.

bbtrx.SampleRate = 122.88e6;

Set the transmit and capture center frequencies.

bbtrx.TransmitCenterFrequency = 2.2e9;
bbtrx.CaptureCenterFrequency = 2.2e9;

Generate random transmit waveform.

txWaveform = complex(randn(1000,1),randn(1000,1));

Transmit the generated waveform continuously with the radio associated with the baseband transceiver object using the default transmit antenna.


Capture IQ data with the radio associated with the baseband transceiver object using the default capture antenna.

[data,~] = capture(bbtrx,milliseconds(3));

Stop the continuous transmission after data capture is complete.


Input Arguments

collapse all

Baseband application, specified as a basebandReceiver object or basebandTransceiver object.


The first object function call in which you specify this object as an input requires a few extra seconds to load the application onto the hardware.

Capture length, specified as an integer number of samples or a duration value in time units. The function converts length into N samples based on the SampleRate property of the bba input and captures ceil(N) number of data samples.

Specify the capture length relative to the onboard radio memory buffer size.

Radio DeviceMemory Buffer SizeMaximum Data Samples

USRP™ N310

2 GB229


2 GB229


2 GB229


1 GB228


  • Transmit and capture data samples on the baseband transceiver are buffered in the onboard radio memory. Therefore, if the bba input is a baseband transceiver, you must also take into account the length of the transmit waveform of any continuous transmission that you specify when calling the transmit object function with the bba input.

  • If your host computer does not have enough free memory to receive the captured data from the radio buffer, 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: seconds(5)

Data Types: double | duration

Output Arguments

collapse all

Captured signal, returned as one of these options.

  • Complex-valued column vector — The vector contains data that is captured on a single capture antenna.

  • Complex-valued matrix — The matrix contains data that is captured on multiple capture antennas. This option applies only when bba is a baseband receiver. The number of antennas specified by the Antennas property of the bba input determines the number of matrix columns.

Use the bba.CaptureDataType property to specify the data type of the returned data. If you specify the return data type as single or double, the function scales the captured data sample values to the range [–1, 1].


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

Data Types: int16 | single | double
Complex Number Support: Yes

Capture request timestamp, returned as a datetime value. The function creates this timestamp just before requesting data capture from the hardware.

Data Types: datetime

Status of dropped samples, returned as one of these logical values.

  • 1 — Samples are dropped during capture.

  • 0 — Samples are not dropped during capture.

Use the DroppedSamplesAction property of the bba input to specify the behavior of the function upon dropped samples.

Data Types: logical

Version History

Introduced in R2022a