Main Content

transmit

Transmit waveform using baseband transmitter or transceiver

Since R2022a

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

Description

transmit(bba,waveform,mode) transmits the IQ waveform waveform to the air using the specified baseband transmitter or baseband transceiver bba. The input mode specifies continuous or single-shot transmission. To stop a continuous transmission, call stopTransmission(bba).

example

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 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);

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 baseband transceiver object, specifying a radio setup configuration previously saved in the Radio Setup wizard. Specify two transmit antennas and two capture antennas, each with a different center frequency.

bbtrx = basebandTransceiver("MyRadio", ...
    TransmitAntennas=["RF0:TX/RX","RF1:TX/RX"], ...
    TransmitCenterFrequency=[2.2e9,2.4e9], ...
    CaptureAntennas=["RF0:RX2","RF1:RX2"], ...
    CaptureCenterFrequency=[2.2e9,2.4e9])
bbtrx = 
  basebandTransceiver with properties:

          TransmitRadioGain: 10
    TransmitCenterFrequency: [2.2000e+09 2.4000e+09]
           TransmitAntennas: ["RF0:TX/RX"    "RF1:TX/RX"]
           CaptureRadioGain: 10
     CaptureCenterFrequency: [2.2000e+09 2.4000e+09]
            CaptureAntennas: ["RF0:RX2"    "RF1:RX2"]
            CaptureDataType: "int16"
       DroppedSamplesAction: "error"
                 SampleRate: 153600000

Generate two random complex transmit waveforms with a length of 1000 samples.

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

Transmit the generated waveform continuously with the radio associated with the baseband transceiver object.

transmit(bbtrx,txWaveform,"continuous");

Capture IQ data with the radio associated with the baseband transceiver object.

[data,~] = capture(bbtrx,length);

The output data is a 1000 x 2 array. Each column contains the data captured on one antenna, in the order that they are specified.

Stop the continuous transmission when the capture is complete.

stopTransmission(bbtrx);

Input Arguments

collapse all

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

Note

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.

IQ waveform to transmit, specified as one of these options.

  • Complex-valued column vector with even number of rows — Use this option to send an IQ waveform on a single transmit antenna.

  • Complex-valued matrix with even number of rows — Use this option to send IQ waveforms on multiple transmit antennas. The number of antennas specified must match the number of matrix columns.

    • If the bba input is a basebandTransmitter object, the number of antennas is specified by the Antennas property.

    • If the bba input is a basebandTransciever object, the number of antennas is specified by the TransmitAntennas property. (since R2024b)

If you specify a waveform with a single or double data type, you must scale the transmit data sample values to the range [–1, 1].

The waveform length across all applicable antennas must be relative to the onboard radio memory buffer size.

Radio DeviceMemory Buffer SizeMaximum Data Samples

USRP™ N310

2 GB229

USRP N320

2 GB229

USRP N321

2 GB229

USRP X310

1 GB228

USRP X410

4 GB230

Note

  • 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 data capture length that you specify when calling the capture function.

  • To avoid underflow during the transmission of a waveform of length less than 513 samples, the function reserves up to 1024 samples on the onboard radio memory.

  • If the bba object uses a Farrow rate converter to achieve the sample rate that you specify with the SampleRate object property, the object resamples the transmit waveform. The resulting waveform has an increased number of data samples. For more information, see Baseband Sample Rate in NI USRP Radios.

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

Transmission mode, specified as one of these options.

  • "continuous" — The function transmits the waveform waveform continuously to the air by repeating the data samples until you call stopTransmission(bba).

  • "once" — The function transmits the waveform waveform once in a single-shot transmission.

Data Types: string

Version History

Introduced in R2022a

expand all

See Also

Functions