transmit
Add-On Required: This feature requires the Wireless Testbench™ Support Package for NI™ USRP™ Radios add-on.
Description
Examples
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 a 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-by-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);
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");
Input Arguments
Baseband application, specified as a basebandTransmitter
object or basebandTransceiver
object.
Note
If you do not preload the application onto the radio during object creation, 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 radio. To load the application onto the radio
during object creation, specify the Preload
name-value
argument:
bbtrx = basebandTransceiver("MyRadio",Preload=true);
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 abasebandTransmitter
object, the number of antennas is specified by theAntennas
property.If the
bba
input is abasebandTransciever
object, the number of antennas is specified by theTransmitAntennas
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 Device | Memory Buffer Size | Maximum Data Samples |
---|---|---|
USRP™ N300 | 2 GB | 229 |
USRP N310 | 2 GB | 229 |
USRP N320 | 2 GB | 229 |
USRP N321 | 2 GB | 229 |
USRP X300 | 1 GB | 228 |
USRP X310 | 1 GB | 228 |
USRP X410 | 4 GB | 230 |
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 thecapture
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 theSampleRate
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 waveformwaveform
continuously to the air by repeating the data samples until you callstopTransmission(bba)
."once"
— The function transmits the waveformwaveform
once in a single-shot transmission.
Data Types: string
Since R2025a
Start time for transmission, specified as a positive numeric scalar. To schedule a
transmission to start at a future time, first use the getRadioTime
function to get the current radio time in seconds. Then, specify the radio time at which
you want to start transmitting data.
Note
A delay occurs when initializing the
transmit
function, which depends on the specific application and your host capability. The start time you specify must allow enough time for the function to be initialized. These factors increase the initialization time:Specifying a long waveform. The waveform is loaded into the onboard radio memory buffer during initialization.
Specifying the
SampleRate
property of thebba
object as a value that uses a Farrow rate converter. In this case, the object resamples the transmit waveform and the resulting waveform has an increased number of data samples. For more information, see Baseband Sample Rate in NI USRP Radios.
To use this name-value argument to schedule a transmission, you must create your baseband application object
bba
in a specific way:Load the application onto the radio during object creation by specifying the
Preload
name-value argument astrue
. Because updating object properties can cause the radio time to reset, be sure to specify properties during object creation.Specify RF properties during object creation using the
PropertyName=Value
syntax.Specify the data type of the transmit waveform using the
property with the data type that corresponds to the transmit waveformTransmitDataType
waveform
.
For more information about how to schedule transmit and capture operations, see Time Synchronize Operations on NI USRP Radios.
Example: getRadioTime(radio)+0.5
schedules the capture operation
to start 500 milliseconds in the future.
Data Types: double
Limitations
If you have a USRP X410 radio and you change the SampleRate
property of the
bba
input object 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
. This can take up to a minute.
Version History
Introduced in R2022aYou can now schedule the start time of a transmit operation by specifying the
StartTime
name-value argument equal to tStart
.
The basebandTransmitter
and basebandTransceiver
objects now support the following master clock rates (MCRs) on USRP X410 radios:
491.52 MHz
500 MHz
To transmit data at sample rates equal to these MCRs, set the
SampleRate
property on the bba
input
object.
You can now transmit data on multiple antennas with the
basebandTransceiver
object. Specify multiple antennas using the CaptureAntennas
property of the bba
input when it is a baseband transceiver.
See Also
Objects
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)