Main Content

basebandTransmitter

Configure SDR as baseband transmitter

Since R2022a

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

Description

Use the basebandTransmitter object to configure the specified software-defined radio (SDR) as a baseband transmitter to transmit IQ waveforms to the air.

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

Creation

Description

bbtx = basebandTransmitter(radio) creates a baseband transmitter application 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 application object associated with the specified radio from the workspace.

example

bbtx = basebandTransmitter(radio,PropertyName=Value) sets properties using one or more name-value arguments. For example, CenterFrequency=2.2e9 sets the center frequency to 2.2 GHz.

example

bbrx = basebandTransceiver(radio,Preload=true) loads the application onto the radio during object creation. (since R2025a)

Use this syntax when you plan to schedule or synchronize operations using the radio time.

example

Input Arguments

expand all

Radio setup configuration, specified as one of these options.

  • String scalar — The name of a radio setup configuration you saved using the Radio Setup wizard. To list all saved radio setup configurations, call the radioConfigurations function with no input arguments. For example, "MyRadio".

  • Radio object — A radio object that corresponds to a radio setup configuration you saved using the Radio Setup wizard. For example, to create a radio object for a radio setup configuration with the name "MyRadio", call radio = radioConfigurations("MyRadio").

    Use this option when you want to use synchronization features. You can refer to radio object properties to get information about the radio setup configuration that the object corresponds to, such as the model number of the radio, the radio IP address, and the synchronization options. Additionally, you can:

    For more information, see Time Synchronize Operations on NI USRP Radios.

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

Since R2025a

Option to load the application onto the radio, specified as one of these options.

  • false — The application is loaded onto the radio the first time you call the transmit function.

  • true — Load the application onto the radio during object creation. This takes a few extra seconds.

    Use this option when you plan to schedule or synchronize operations that use this object. Loading the application onto the radio at object creation prevents the radio time from being reset when you the transmit function. Specifying properties during object creation is also recommended, as updating some object properties will cause the radio time to be reset.

Data Types: logical

Properties

expand all

Radio center frequency in Hz, specified as one of these options.

  • Positive numeric scalar — The object applies this value by scalar expansion to each antenna in the Antennas property.

  • Numeric array — The object applies the ith array element value to the ith antenna in the Antennas property.

The valid center frequency range depends on the radio device.

Radio DeviceCenter Frequency

USRP™ N300

1 MHz to 6 GHz

USRP N310

1 MHz to 6 GHz

USRP N320

1 MHz to 6 GHz

USRP N321

1 MHz to 6 GHz

USRP X300

10 MHz to 6 GHz

USRP X310

10 MHz to 6 GHz

USRP X410

1 MHz to 8 GHz

Note

When setting this property for multiple antennas on a USRP N300 or USRP N310 radio, consider these hardware characteristics.

  • The antenna ports on the RF0 and RF1 radio channels use the same center frequency. Therefore, set identical center frequency values for the antennas specified as "RF0:TX/RX" and "RF1:TX/RX".

  • The antenna ports on the RF2 and RF3 radio channels use the same center frequency. Therefore, set identical center frequency values for the antennas specified as "RF2:TX/RX" and "RF3:TX/RX". These antennas are available only on a USRP N310 radio.

Data Types: double

Transmit radio antennas, specified as one of these options.

  • String scalar — Specify use of single antenna.

  • String array — Specify use of multiple antennas.

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 N300

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

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 X300

RFA channel: TX/RX port

"RFA:TX/RX" (default)

RFB channel: TX/RX port

"RFB: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.

Example: Antennas=["RF0:TX/RX","RF1:TX/RX"] specifies two transmit antennas.

Data Types: string

Transmit radio gain in dB, specified as one of these options.

  • Positive numeric scalar — The object applies this value by scalar expansion to each antenna that you specify in the Antennas property.

  • Numeric array — The object applies the ith array element value to the ith antenna in the Antennas property.

The valid gain range depends on the radio device.

Radio DeviceTransmit Radio Gain

USRP N300

0 dB to 65 dB

USRP N310

0 dB to 65 dB

USRP N320

0 dB to 60 dB

USRP N321

0 dB to 60 dB

USRP X300

0 dB to 31.5 dB

USRP X310

0 dB to 31.5 dB

USRP X410

0 dB to 60 dB

Data Types: double

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 valid sample rate depends on the radio device.

Radio DeviceSample Rate

USRP N300

  • 120,945 Hz to 76.8 MHz

  • 122.88 MHz

  • 125.00 MHz

  • 153.60 MHz (default)

USRP N310

USRP N320

  • 196,851 Hz to 125 MHz

  • 200.00 MHz

  • 245.76 MHz

  • 250.00 MHz (default)

USRP N321

USRP X300

  • 181,418 Hz to 100 MHz

  • 184.32 MHz

  • 200.00 MHz (default)

USRP X310

USRP X410

  • 241,890 Hz to 125 MHz

  • 245.76 MHz

  • 250.00 MHz (default)

  • 491.52 MHz (since R2025a)

  • 500 MHz (since R2025a)

Note

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

  • If you have a USRP X410 radio and you change the SampleRate property between a sample rate greater than 250 MHz and a sample rate less than or equal to 250 MHz, a new FPGA image is loaded to the radio when you call the transmit function. This can take up to a minute.

Data Types: double

Since R2025a

Data type of the transmitted data, specified as "int16", "double", or "single".

Use this property to specify the data type of the data that you transmit with the transmit function.

Note

  • You must specify a waveform with the same data type in your call to the transmit function, or the data type you specify with this argument will be overwritten.

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

Data Types: string

Object Functions

transmitTransmit waveform using baseband transmitter or transceiver
stopTransmissionStop transmission from baseband transmitter or transceiver

Examples

collapse all

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

bbtx = basebandTransmitter("MyRadio")
bbtx = 
  basebandTransmitter with properties:

          RadioGain: 10
    CenterFrequency: 2.4000e+09
         SampleRate: 250000000
           Antennas: "RF0:TX/RX"

Set the baseband sample rate and center frequency.

bbtx.SampleRate = 122.88e6;
bbtx.CenterFrequency = 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 transmitter object using the default antenna.

transmit(bbtx,txWaveform,"continuous");

Stop the continuous transmission after 5 seconds.

pause(5);
stopTransmission(bbtx);

Create a baseband transmitter object, specifying a radio setup configuration previously saved in the Radio Setup wizard. Specify two antennas, each with a different center frequency.

bbtx = basebandTransmitter("MyRadio", ...
    Antennas=["RF0:TX/RX" "RF1:TX/RX"], ...
    CenterFrequency=[2.2e9 2.4e9])
bbtx = 
  basebandTransmitter with properties:

          RadioGain: 10
    CenterFrequency: [2.2000e+09 2.4000e+09]
         SampleRate: 153600000
           Antennas: ["RF0:TX/RX"    "RF1:TX/RX"]

Generate two random complex transmit waveforms.

txWaveform = [complex(randn(1000,1),randn(1000,1)), ...
    complex(randn(1000,1),randn(1000,1))];

Transmit the generated waveform once with the radio associated with the baseband transmitter object.

transmit(bbtx,txWaveform,"once");

Create a radio object, specifying a radio setup configuration previously saved using the Radio Setup wizard.

radio = radioConfigurations("MyRadio")
radio = 
  X310 with properties:

           Name: "MyRadio"
       Hardware: "USRP X310"

      IPAddress: "192.168.10.2"

    ClockSource: "internal"
     TimeSource: "internal"

       LOSource: "internal"
     LOExported: 0

Create a baseband transmitter object, specifying your radio object. Specify the Preload name-value argument as true to load the application onto the radio during object creation. Specify the RF properties during object creation.

bbtx = basebandTransmitter(radio,Preload=true, ...
    SampleRate=50e6,CenterFrequency=2.4e9, ...
    TransmitDataType="double")
bbtx = 
  basebandTransmitter with properties:

           RadioGain: 10
     CenterFrequency: 2.4000e+09
          SampleRate: 50000000
            Antennas: "RFA:TX/RX"
    TransmitDataType: "double"

Schedule the start time for the transmit operation to be 5 seconds in the future.

startTime = getRadioTime(radio) + 5
startTime = 
5.5661

Generate a random transmit waveform.

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

Transmit the generated waveform in a single shot with the radio associated with the baseband transmitter object.

transmit(bbtx,txWaveform,"once");

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 basebandTransmitter 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

expand all