comm.SDRuTransmitter

Send data to USRP® device

Description

The SDRuTransmitter System object™ sends data to a Universal Software Radio Peripheral (USRP®[1] ) hardware device, allowing simulation and development for various software-defined radio applications. The object enables communication with a USRP® board on the same Ethernet subnetwork or a USRP® board via a USB connection. You can write a MATLAB® application that uses the System object or you can generate code for the System object without connecting to a USRP® radio.

This object accepts a column vector or matrix input signal from MATLAB and transmits signal and control data to a USRP® board using the Universal Hardware Driver (UHD) from Ettus Research®. The SDRuTransmitter System object is a sink that sends the data it receives to a USRP® board. The first call to this object might contain transient values, which can result in packets containing undefined data.

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

tx = comm.SDRuTransmitter creates an SDRuTransmitter System object, tx.

tx = comm.SDRuTransmitter(Name,Value) creates an SDRuTransmitter System object with the specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

tx = comm.SDRuTransmitter(address,Name,Value) creates an SDRuTransmitter System object, with the IPAddress property set to address and the other specified properties set to the specified values.

Properties

expand all

Model number of the radio, specified as:

  • 'N200/N210/USRP2'

  • 'B200'

  • 'B210'

  • 'X300'

  • 'X310'

Setting Platform to 'N200/N210/USRP2', 'X300', or 'X310' enables the IPAddress property. Setting Platform to 'B200' or 'B210' enables the SerialNum property.

Data Types: char

IP address of the USRP® device, specified as a character vector. When more than one IP address is specified, each address is separated by commas or spaces.

To find the logical network location of all connected USRP® radios, use the findsdru function.

Example: '192.168.10.2, 192.168.10.5' specifies IP addresses for two devices.

Dependencies

To enable this property, set 'Platform' to 'N200/N210/USRP2', 'X300', or 'X310'.

Data Types: char

Serial number of radio hardware, specified as a character vector.

This property must match the serial number of the radio hardware assigned during hardware setup. See Guided USRP Radio Support Package Hardware Setup. If you configure the radio hardware with a serial number other than the default, update SerialNum accordingly.

The drop-down list displays serial numbers for USRP® devices attached to the host computer.

Dependencies

To enable this parameter, set 'Platform' to 'B200' or 'B210'.

Data Types: char

Channel mapping for radio or bundled radios, specified as a positive integer scalar or vector. This table shows valid values for various radio platforms.

Platform ValuePossible ChannelMapping Value

'N200/N210/USRP2'

1-by-N row vector, where N is the number of IP addresses included in IPAddress

'B200'

1

'B210'

1, 2, or [1 2]

'X300'

1, 2, or [1 2] when IPAddress includes one IP address.

1-by-2N row vector, where N is the number of IP addresses included in IPAddress.

'X310'

1, 2, or [1 2] when IPAddress includes one IP address.

1-by-2N row vector, where N is the number of IP addresses included in IPAddress.

When IPAddress includes multiple IP addresses, the channels defined by ChannelMapping are ordered first by the order in which the IP addresses appear in the list and then by the channel order within the same radio.

Example: If Platform is 'X300' and IPAddress is '192.168.20.2, 192.168.10.3', then ChannelMapping must be [1 2 3 4]. Channels 1, 2, 3, 4 of the bundled radio refer to channels 1 and 2 of the radio with IP address 192.168.20.2 and channels 1 and 2 of the radio with IP address 192.168.10.3.

Data Types: char

Center frequency, specified as a nonnegative scalar or row vector in Hz. The valid range of values for this property depends on the RF daughter card of the USRP® device.

When you call the step method to change the center frequency, specify the value according to these conditions:

  • For a single channel (SISO), specify the value for the center frequency as a nonnegative scalar.

  • For multiple channels (MIMO) that use the same center frequency, specify the center frequency as a nonnegative scalar. The center frequency is set by scalar expansion.

  • For multiple channels (MIMO) that use different center frequencies, specify the values in a row vector, for example, [70e6 100e6]. The ith element of the vector is applied to the ith channel specified by ChannelMapping.

    Note

    The center frequency for B210 with MIMO must be a scalar. You cannot specify the frequencies as a vector.

Tunable: Yes

Data Types: double

Local oscillator (LO) offset frequency, specified as a scalar in Hz. The valid range of this property depends on the RF daughterboard of the USRP® device.

The local oscillator offset does not affect the transmitted center frequency. However, it does affect the intermediate center frequency in the USRP® hardware, as shown in the diagram.

  • fcenter represents the center frequency specified by the System object.

  • fLO offset is the local oscillator offset frequency.

To move the center frequency away from interference or harmonics generated by the USRP® hardware, use LocalOscillatorOffset.

When you call the step method to change the LO offset, specify the value according to these conditions:

  • For a single channel (SISO), specify the LO offset as a scalar.

  • For multiple channels (MIMO), the LO offset must be zero. This restriction is due to a UHD limitation. You can specify the LO offset as scalar (0) or as a vector ([0 0]).

Tunable: Yes

Data Types: double

Overall gain for the USRP® hardware transmitter data path, including both analog and digital components, specified as a scalar or row vector in dB. The valid range of this property depends on the RF daughterboard of the USRP® device.

When you call the step method to change the gain, specify the value according to these conditions:

  • For a single channel (SISO), specify the value for the gain as a scalar.

  • For multiple channels (MIMO) that use the same gain value, specify the gain as a scalar. The gain is set by scalar expansion.

  • For multiple channels (MIMO) that use different gains, specify the values in a row vector, for example, [32 30]. The ith element of the vector is applied to the ith channel specified by ChannelMapping.

Tunable: Yes

Clock source, specified as:

  • Internal — Uses the internal clock signal of the USRP® radio.

  • External — Uses the 10-MHz clock signal from an external clock generator.

For B-series radios, the external clock port is labeled 10 MHz. For N2xx, USRP2®, and X-series radios, the external clock port is labeled REF IN.

To synchronize the frequency for all channels of the bundled radios, provide a common external 10-MHz clock signal to all the bundled radios and set ClockSource to 'External'.

Data Types: char

Interpolation factor, specified as an integer from 1 to 512 with restrictions, based on the radio you are using.

ValueB-seriesN-seriesX-series

1

Not valid.

2

Acceptable when using int8 transport data type only.

3

Not valid.

Any number from 4 to 128

Any even number from 128 to 256

Any multiple of 4 from 256 to 512

The radio uses the interpolation factor when upconverting the complex baseband signal to an intermediate frequency (IF) signal.

Tunable: Yes

Data Types: double

Transport data type, specified as:

  • 'int16' — Uses 16-bit transport. Achieves higher precision than 8-bit transport.

  • 'int8' — Uses 8-bit transport. Uses a quantization step 256 times larger and achieves approximately two times faster transport data rate than 16-bit transport.

Specifying TransportDataType as int16 results in 32 bits for each complex sample of transport data. Each complex sample assigns 16 bits for the in-phase component and 16 bits for the quadrature component.

Data Types: char

Option to enable burst mode, specified as true or false. To produce a set of contiguous frames without an overrun or underrun to the radio, set EnableBurstMode to true. Enabling burst mode helps you simulate models that cannot run in real time.

When burst mode is enabled, specify the desired amount of contiguous data using the NumFramesInBurst property. For more information, see Detect Underruns and Overruns.

Data Types: logical

Number of frames in a contiguous burst, specified as an integer.

Dependencies

To enable this parameter, set EnableBurstMode to true.

Data Types: double

Master clock rate, specified as a scalar in Hz. The master clock rate is the A/D and D/A clock rate. The valid range of values for this property depends on the radio platform connected.

Platform ValuePossible Master clock rate (Hz) Value

'N200/N210/USRP2'

100e6 Hz

'B200' or 'B210'

From 5e6 to 56e6. When using B210 with multiple channels, the clock rate must be no higher than 30.72e6 Hz. This restriction is a hardware limitation for the B210 radios only when using two-channel operations.

Default value 32e6.

'X300' or 'X310'

120e6, 184.32e6, or 200e6

Default value 200e6.

Dependencies

To enable this parameter, set Platform to 'B200', 'B210', 'X300', or 'X310'.

Data Types: double

Parts per second (PPS) signal source, specified as:

  • 'Internal' — Uses the internal PPS signal of the USRP® radio.

  • 'External' — Uses the PPS signal from an external signal generator.

To synchronize the time for all channels of the bundled radios, provide a common external PPS signal to all the bundled radios and set PPSSource to 'External'.

Data Types: char

Methods

infoDisplay information about SDRuTransmitter System object
stepTransmit signal and control data to USRP® board
Common to All System Objects
release

Allow System object property value changes

Examples

Create Transmitter System Object for N-Series/USRP2 Board

tx = comm.SDRuTransmitter('Platform','N200/N210/USRP2', ...
   'IPAddress','192.168.20.2')
tx = 

  comm.SDRuTransmitter with properties:

                 Platform: 'N200/N210/USRP2'
                IPAddress: '192.168.20.2'
           ChannelMapping: 1
          CenterFrequency: 2.4500e+09
    LocalOscillatorOffset: 0
                     Gain: 8
                PPSSource: 'Internal'
              ClockSource: 'Internal'
          MasterClockRate: 100000000
      InterpolationFactor: 512
        TransportDataType: 'int16'
          EnableBurstMode: false

Configure N-Series/USRP2 Board for Transmission

Configure an N-series/USRP2® board with an IP address of 192.168.30.7 to transmit at 2.5 GHz with an interpolation factor of 256.

    tx = comm.SDRuTransmitter(...
              'Platform','N200/N210/USRP2', ...
              'IPAddress','192.168.30.7', ...
              'CenterFrequency',2.5e9, ...
              'InterpolationFactor',256);
    mod = comm.DPSKModulator('BitInput',true);
    for counter = 1:20
      data = randi([0 1],30,1);
      modSignal = mod(data);
      tx(modSignal);
    end

Use info method to confirm actual radio settings.

info(tx)
ans = 

  struct with fields:

                    Mboard: 'N210r4'
                  RXSubdev: 'WBXv3 RX+GDB'
                  TXSubdev: 'WBXv3 TX+GDB'
    MinimumCenterFrequency: 48750000
    MaximumCenterFrequency: 2.2200e+09
               MinimumGain: 0
               MaximumGain: 31
                  GainStep: 1
           CenterFrequency: 2.2200e+09
     LocalOscillatorOffset: 2.0000e+07
                      Gain: 8
           MasterClockRate: 100000000
       InterpolationFactor: 256
        BasebandSampleRate: 390625

Create Transmitter System Object for B210 Board

tx = comm.SDRuTransmitter('Platform','B210','SerialNum','ECR04ZDBT')
tx = 

  comm.SDRuTransmitter with properties:

                 Platform: 'B210'
                SerialNum: 'ECR04ZDBT'
           ChannelMapping: 1
          CenterFrequency: 2.4500e+09
    LocalOscillatorOffset: 0
                     Gain: 8
                PPSSource: 'Internal'
              ClockSource: 'Internal'
          MasterClockRate: 32000000
      InterpolationFactor: 512
        TransportDataType: 'int16'
          EnableBurstMode: false

Create Transmitter System Object for X310 Board

tx = comm.SDRuTransmitter('Platform','X310','IPAddress','192.168.10.2')
tx = 

  comm.SDRuTransmitter with properties:

                 Platform: 'X310'
                IPAddress: '192.168.10.2'
           ChannelMapping: 1
          CenterFrequency: 2.4500e+09
    LocalOscillatorOffset: 0
                     Gain: 8
                PPSSource: 'Internal'
              ClockSource: 'Internal'
          MasterClockRate: 200000000
      InterpolationFactor: 512
        TransportDataType: 'int16'
          EnableBurstMode: false

More About

expand all

Introduced in R2011b


[1] USRP, USRP2, UHD, and Ettus Research are trademarks of National Instruments Corp.