Main Content

basebandTransceiver

Configure SDR as baseband transceiver

Since R2022a

Description

Use the basebandTransceiver object to configure the specified software-defined radio (SDR) as a baseband transceiver to simultaneously transmit and capture IQ waveforms over the air.

This diagram shows a conceptual overview of capturing and transmitting radio signals in Wireless Testbench™ using a radio that you configure with this object. The onboard data buffering ensures contiguous data capture and transmit. The transmission controller enables you to specify continuous or single-shot transmissions.

Arrows appoint the path of the captured and transmit data. The captured data path consists of radio antenna, onboard memory, and MATLAB. The transmit data path consists of MATLAB, onboard memory, transmission controller, and radio antenna.

Creation

Description

example

bbtrx = basebandTransceiver(radio) creates a baseband transceiver object for the specified radio radio.

Note

The object requires exclusive access to radio hardware resources. Before creating this object, clear any existing Wireless Testbench object associated with the specified radio from the workspace.

bbtrx = basebandTransceiver(radio,Name=Value) sets properties using one or more name-value arguments. For example, CaptureDataType="double" sets the data type of the returned captured data to double.

Input Arguments

expand all

Radio setup configuration, specified as a string scalar. To create a radio setup configuration, set up your radio and save your radio setup configuration using the Radio Setup wizard. To list all saved radio setup configurations, call the radioConfigurations function.

For a list of supported radios, see Supported Radio Devices.

Example: "MyRadio" indicates that you saved a radio setup configuration under the name MyRadio in the Radio Setup wizard.

Properties

expand all

Transmit center frequency in Hz, specified as a positive numeric scalar. The valid center frequency range depends on the radio device.

Radio DeviceCenter Frequency

USRP™ N310

1 MHz to 6 GHz

USRP N320

1 MHz to 6 GHz

USRP N321

1 MHz to 6 GHz

USRP X310

10 MHz to 6 GHz

USRP X410

1 MHz to 8 GHz

Transmit radio antenna, specified as a string scalar. Specify a single antenna with a string constant. Use this table to identify a supported radio antenna port on the radio device and the corresponding string constant that you can specify for this property. The default value depends on the radio.

Radio DeviceSupported Antenna PortString Scalar

USRP N310

RF0 channel: TX/RX port"RF0:TX/RX" (default)
RF1 channel: TX/RX port"RF1:TX/RX"
RF2 channel: TX/RX port"RF2:TX/RX"
RF3 channel: TX/RX port"RF3:TX/RX"

USRP N320

RF0 channel: TX/RX port"RF0:TX/RX" (default)
RF1 channel: TX/RX port"RF1:TX/RX"

USRP N321

RF0 channel: TX/RX port"RF0:TX/RX" (default)
RF1 channel: TX/RX port"RF1:TX/RX"

USRP X310

RFA channel: TX/RX port

"RFA:TX/RX" (default)

RFB channel: TX/RX port

"RFB:TX/RX"

USRP X410

DB0 RF0 channel: TX/RX 0 port

"DB0:RF0:TX/RX0" (default)

DB0 RF1 channel: TX/RX 0 port

"DB0:RF1:TX/RX0"

DB1 RF0 channel: TX/RX 0 port

"DB1:RF0:TX/RX0"

DB1 RF1 channel: TX/RX 0 port

"DB1:RF1:TX/RX0"

Note

When you update this property, the execution time of the next object function call increases by a few seconds.

Data Types: string

Transmit radio gain in dB, specified as a positive numeric scalar. The valid gain range depends on the radio device.

Radio DeviceTransmit Radio Gain

USRP N310

0 dB to 65 dB

USRP N320

0 dB to 60 dB

USRP N321

0 dB to 60 dB

USRP X310

0 dB to 31.5 dB

USRP X410

0 dB to 60 dB

Data Types: double

Capture center frequency in Hz, specified as a positive numeric scalar. The valid center frequency range depends on the radio device.

Radio DeviceCenter Frequency

USRP N310

1 MHz to 6 GHz

USRP N320

1 MHz to 6 GHz

USRP N321

1 MHz to 6 GHz

USRP X310

10 MHz to 6 GHz

USRP X410

1 MHz to 8 GHz

Data Types: double

Capture radio antenna, specified as a string scalar. Specify a single antenna with a string constant. Use this table to identify a supported radio antenna port on the radio device and the corresponding string constant that you can specify for this property. The default value depends on the radio.

Radio DeviceSupported Antenna PortString Scalar

USRP N310

RF0 channel: RX2 port"RF0:RX2" (default)
RF1 channel: RX2 port"RF1:RX2"
RF2 channel: RX2 port"RF2:RX2"
RF3 channel: RX2 port"RF3:RX2"

USRP N320

RF0 channel: RX2 port"RF0:RX2" (default)
RF1 channel: RX2 port"RF1:RX2"

USRP N321

RF0 channel: RX2 port"RF0:RX2" (default)
RF1 channel: RX2 port"RF1:RX2"

USRP X310

RFA channel: RX2 port

"RFA:RX2" (default)

RFB channel: RX2 port

"RFB:RX2"

USRP X410

DB0 RF0 channel: RX 1 port

"DB0:RF0:RX1" (default)

DB0 RF1 channel: RX 1 port

"DB0:RF1:RX1"

DB1 RF0 channel: RX 1 port

"DB1:RF0:RX1"

DB1 RF1 channel: RX 1 port

"DB1:RF1:RX1"

Note

When you update this property, the execution time of the next object function call increases by a few seconds.

Data Types: string

Capture radio gain in dB, specified as a positive numeric scalar. The valid gain range depends on the radio device.

Radio DeviceCapture Radio Gain

USRP N310

0 dB to 75 dB

USRP N320

0 dB to 60 dB

USRP N321

0 dB to 60 dB

USRP X310

0 dB to 31.5 dB

USRP X410

0 dB to 60 dB

Data Types: double

Data type of the captured data, specified as "int16", "double", or "single". Use this property to set the data type of the captured data that the capture object function returns.

Note

When you update this property, the execution time of the next object function call increases by a few seconds.

Data Types: string

Baseband sample rate in Hz, specified as a positive numeric scalar. For more information on how the radio achieves the specified sample rate, see Baseband Sample Rate in NI USRP Radios.

The sample rate depends on the radio device.

Radio DeviceSample Rate

USRP N310

  • 120,945 Hz to 76.8 MHz

  • 122.88 MHz

  • 125.00 MHz

  • 153.60 MHz (default)

USRP N320

  • 196,851 Hz to 125 MHz

  • 200.00 MHz

  • 245.76 MHz

  • 250.00 MHz (default)

USRP N321

  • 196,851 Hz to 125 MHz

  • 200.00 MHz

  • 245.76 MHz

  • 250.00 MHz (default)

USRP X310

  • 181,418 Hz to 100 MHz

  • 184.32 MHz

  • 200.00 MHz (default)

USRP X410

  • 241,890 Hz to 125 MHz

  • 245.76 MHz

  • 250.00 MHz (default)

Note

To update this property, you must stop any ongoing transmission by calling the stopTransmission function on the object. When you update this property, the execution time of the next object function call increases by a few seconds.

Data Types: double

Behavior of the capture object function upon dropped samples, specified as one of these values.

  • "error" — The object function stops with an error message.

  • "warning" — The object function displays a warning message.

  • "none" — The object function ignores dropped samples.

Data Types: string

Object Functions

captureCapture IQ data using baseband receiver or transceiver
transmitTransmit waveform using baseband transmitter or transceiver
stopTransmissionStop transmission from baseband transmitter or transceiver

Examples

collapse all

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.

transmit(bbtrx,txWaveform,"continuous");

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.

stopTransmission(bbtrx);

Tips

You cannot use save and load to store and reload Wireless Testbench objects. Instead, you can re-create the object with these steps:

  1. Write code to create a basebandTransceiver object with a saved radio setup configuration radio and set the properties.

  2. Save the code to a script.

  3. Run the script in a new MATLAB® session with the same saved radio setup configuration.

Version History

Introduced in R2022a