SDRu Receiver

Receive data from USRP device

  • Library:
  • Communications Toolbox Support Package for USRP Radio

Description

The SDRu Receiver block supports communication between Simulink® and a Universal Software Radio Peripheral (USRP™) device, enabling simulation and development for various software-defined radio applications. The SDRu Receiver block and the USRP board must be on the same Ethernet subnetwork.

The SDRu Receiver block receives signal and control data from a USRP board using the Universal Hardware Driver (UHD™) from Ettus ResearchTM. The SDRu Receiver block is a Simulink source that receives data from a USRP board and outputs a column vector or matrix signal with a fixed number of rows. The first call to this block can contain transient values, in this case the resulting packets contain undefined data.

This block diagram illustrates how Simulink, the SDRu Transmitter and Receiver blocks, and the USRP hardware interface.

When this block is called, it is possible that the host has not yet received any data from the USRP hardware. The data length port, length, indicates when valid data is present. When the data length port contains a zero value, there is no data. To qualify the execution of part of the model, use the data length with an enabled subsystem.

If your computer is not connected to any USRP hardware, you can still use this block to develop a model that propagates sample time and data type information. To propagate this information, select Simulation >> Update diagram.

For information about the USRP hardware products that interface with this block, see the Ettus ResearchTM website.

This icon shows all ports, including optional ones:

Ports

Input

expand all

Center frequency setting in Hz, specified as a positive scalar.

Example: 88.9e6 tunes the receiver to a center frequency of 88.9 MHz.

Dependencies

To enable this port, set Source of center frequency to Input Port.

Data Types: double

Local oscillator (LO) offset in Hz, specified as a scalar.

Example: 10 sets the LO offset to 10 Hz.

Dependencies

To enable this port, set Source of LO offset to Input Port.

Data Types: double

Receiver gain setting in dB, specified as a scalar or vector. The valid gain range is from –4 dB to 71 dB and depends on the center frequency. An incompatible gain and center frequency combination returns an error from the radio hardware.

Example: 10 sets the receiver gain level to 10 dB.

Dependencies

To enable this port, set Source of gain to Input Port.

Data Types: double

Output

expand all

Output data received from the radio hardware, returned as a vector of complex values. The complex output data values range from -1 to 1.

Dependencies

To specify the base data type, use the Output data type parameter.

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

Length of the data received from the radio hardware, returned as a nonnegative integer. When this port contains a zero value, the received data is not valid. When this port contains a positive value, use the length port and an enabled subsystem driven by the length signal to qualify the execution of the model. For more information, see Apply Conditional Execution.

At the time of radio initialization, there is no valid data. In this case, the output data is set to all zeros and length port is set to a zero value. When the host has received enough data from radio, the receiver block outputs valid data and length port is set to a positive integer value.

Data discontinuity flag, returned:

  • 0 — indicates that no data samples were lost.

  • 1 — indicates that data samples were lost.

Use this port as a diagnostic tool to determine real-time operation of the SDRu Receiver block. If your model is not running in real time, you can adjust parameters that reduce the number of transported samples. To approach or achieve real-time performance, you can decrease the baseband sampling rate or increase the decimation factor. For more information, see Detect Underruns and Overruns.

Dependencies

To enable this port, select Enable overrun output port.

Parameters

expand all

When you set block parameter values, the SDRu Receiver block first checks that the values have the correct data types. Even if the values pass those checks, the values can still be out of range for the radio hardware. In that case, the radio hardware sets the actual value as close to the specified value as possible. When you next synchronize the block with the radio hardware by clicking Info, a dialog box open to display the actual values along with other radio information.

If a parameter is listed as tunable, then you can change its value during simulation.

Radio Connection

Radio to configure, specified as one of USRP platforms listed.

IP address of the radio hardware, specified as a dotted quad expression.

This parameter must match the physical IP address of the radio hardware assigned during hardware setup. See Guided USRP Radio Support Package Hardware Setup. If you configure the radio hardware with an IP address other than the default, update IP address accordingly.

The IP address list displays IP addresses for USRP devices attached to the host computer. To specify another known dotted quad IP address, enter it directly into this field.

Dependencies

To enable this parameter, set Platform to N200/N210/USRP2, N300, N310, N320/N321, X300, or X310.

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

This parameter 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 Serial number accordingly.

The Serial number list displays serial numbers for USRP devices attached to the host computer.

Dependencies

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

Refresh the list of all connected devices to update the IP address or Serial number list. The updated list retains the value in focus before Refresh Device List is selected, even if the device with that setting was disconnected.

To enable the TwinRX daughterboard on an X-series radio, select this parameter.

When you select this parameter, you can use the Enable TwinRX Phase Synchronization parameter to provide phase synchronization between channels of the TwinRX daughterboard.

Dependencies

To enable this property, set Platform to 'X300' or 'X310'.

Provides information about the Platform associated with IP address or Serial number. IP address applies for N-series and X-series devices and Serial number applies for B-series devices. When you select the Info button, a new dialog box opens with information about the specified device.

Radio Properties

When you select this parameter, the TwinRX daughterboard provides phase synchronization between all channels. In this case, the value of Center Frequency must be the same for all channels.

Note

The Local oscillator (LO) source present on channel 1 is the master source to drive other LOs of the TwinRx daughterboard channels.

To share LOs between two TwinRx daughterboards, attach the four MMCX RA male cables on one daughterboard to the MMCX RA male cables on the other daughterboard by crisscrossing the cables between the two daughterboards. Make these cable connections, as also shown in the figure.

  • J1 to J2

  • J2 to J1

  • J3 to J4

  • J4 to J3

Dependencies

To enable this property, set Platform to 'X300' or 'X310' and select TwinRX Daughterboard.

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

Platform ValueChannel mapping Value

N200/N210/USRP2

When IP address includes N IP addresses: 1-by-N row vector

N300

1, 2, or [1 2]

N310

Row vector of length [1, 4] with channel numbers as {1, 2, 3, 4}

N320/N321

1, 2, or [1 2]

B200

1

B210

1, 2, or [1 2]

X300 or X310 when TwinRX Daughterboard parameter is cleared

  • When IP address includes one IP address, specify this parameter as 1, 2, or [1 2].

  • When IP address includes N IP addresses, specify this parameter as 1-by-2N row vector.

X300 or X310 when two TwinRX daughterboards are connected and TwinRX Daughterboard parameter is selected

When you clear the Enable TwinRX Phase Synchronization parameter, specify this parameter as one of these values.

  • [N M], where N and M are distinct integers from 1 to 4 — Channels N and M are in use.

  • [N M P], where N, M, and P are distinct integers from 1 to 4 — Channels N, M, and P are in use.

  • [1 2 3 4]

When you select the Enable TwinRX Phase Synchronization parameter, specify this parameter as 1, [1 2], [1 2 3], or [1 2 3 4].

When a scalar, 1 or 2 is specified, the device operates in SISO mode. When a vector is specified, the device operates in MIMO mode. When IP address includes multiple IP addresses, the channels defined by Channel mapping are sorted, 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 IP address contains 192.168.20.2, 192.168.10.3, then Channel mapping must be [1 2 3 4]. Channel mapping values 1 and 2 of the bundled radio refer to channels 1 and 2 of the radio with IP address 192.168.20.2. Channel mapping values 3 and 4 of the bundled radio refer to channels 1 and 2 of the radio with IP address 192.168.10.3.

Data Types: char

Select source of center frequency, specified as:

  • Dialog — Set the center frequency using the Center frequency (Hz) parameter.

  • Input port — Set the center frequency using the fc input port.

RF center frequency in Hz, specified as a nonnegative finite scalar or vector of nonnegative finite scalars. The valid range of this parameter depends on the RF daughterboard of the USRP device.

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

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

  • For multiple channels (MIMO) that use different center frequencies, specify the values in a vector. The ith element of the vector is applied to the ith channel specified by Channel mapping.

    Note

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

    • The channels corresponding to the same RF daughterboard of N310 must have same center frequency value.

When you select the TwinRX Daughterboard parameter:

  • To tune all channels to the same frequency, select the Enable TwinRX Phase Synchronization parameter and set the center frequency as a scalar or row vector of the same values.

  • To tune channels to different frequencies, clear the Enable TwinRX Phase Synchronization parameter and set the center frequency to a row vector. Each value in the row vector specifies the frequency of the corresponding channel.

Note

When you select the TwinRX Daughterboard and Enable TwinRX Phase Synchronization, the LO source present on channel 1 is the master source to drive other LOs of the TwinRX daughterboard channels. In this case, the Center frequency value must be the same for all channels of the TwinRX daughterboard.

For more information, see Enable TwinRX Phase Synchronization.

Tunable: Yes

Dependencies

To enable this parameter, set the Source of center frequency to Dialog.

Data Types: double

Select source of LO offset, specified as:

  • Dialog — Set the LO offset using the LO offset (Hz) parameter.

  • Input port — Set the LO offset using the LO offset input port.

Offset frequency for the local oscillator, specified as a scalar or vector. The valid range of this parameter depends on the RF daughterboard of the USRP device.

As shown in this illustration, the local oscillator offset affects the intermediate center frequency in the USRP hardware. It does not affect the received center frequency.

  • fRF represents the received RF frequency.

  • fcenter represents the center frequency specified by the block.

  • fLO offset is the local oscillator offset frequency.

  • Ideally, fRFfcenter = 0.

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

  • For a single channel (SISO), specify the value for 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 a scalar or as a vector.

Dependencies

To enable this parameter, set Source of LO offset to Dialog.

Select source of gain, specified as:

  • Dialog — Specify the gain using the Gain (dB) parameter.

  • Input port — Specify the gain using the gain input port.

Receiver gain in dB, specified as a scalar or vector. The valid gain range is from –4 dB to 71 dB and depends on the center frequency. An incompatible gain and center frequency combination returns an error from the radio hardware.

Set the value of gain based on the Channel Mapping configuration:

  • For a single channel (SISO), specify 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. The ith element of the vector is applied to the ith channel specified by Channel Mapping.

Tunable: Yes

Dependencies

To enable this parameter, set Source of gain to Dialog.

Data Types: double

Pulse 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 PPS source to External.

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 N3xx, 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 Clock source to External.

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 that is connected.

Platform ValuePossible Master clock rate (Hz) Value

N200/N210/USRP2

100e6 Hz. Read-only.

N300 or N310

122.88e6 Hz, 125e6 Hz, or 153.6e6 Hz

Default value is 125e6 Hz.

N320/N321

200e6 Hz, 245.76e6 Hz, or 250e6 Hz

Default value is 200e6 Hz.

B200 or B210

From 5e6 Hz to 56e6 Hz. 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 is 32e6 Hz.

X300 or X310

184.32e6 Hz or 200e6 Hz

200e6 Hz — When TwinRX daughterboard is selected.

Default value 200e6 Hz.

Dependencies

To enable this parameter, set Platform to B200, B210, N300, N310, N320/N321, X300, or X310.

Data Types: double

Decimation factor for the SDRu receiver, specified as an integer from 1 to 1024 with restrictions, based on the radio you use.

DecimationFactor Property ValueB-SeriesN2xx-SeriesN3xx-SeriesX-Series

1

Valid

Not valid

Valid

Not valid when connected with TwinRX daughterboard

2

Valid

Acceptable when you use only the int8 transport data type

Valid

Valid

3

Valid

Not valid

Valid

Valid

Odd number from 4 to 128

Valid

Valid

Not valid

Valid

Even number from 4 to 128

Valid

Valid

Valid

Valid

Even number from 128 to 256

Valid

Valid

Valid

Valid

Multiple of 4 from 256 to 512

Valid

Valid

Valid

Valid

Multiple of 8 from 512 to 1024

Not valid

Not valid

Valid

Valid

The radio uses the decimation factor when it downconverts the intermediate frequency (IF) signal to a complex baseband signal.

Data

This parameter is read-only.

Baseband sample rate of output signal, in Hz, specified as a scalar.

This parameter displays the computed baseband sample rate derived from the Master clock rate (Hz) and Decimation factor parameter values. This computation uses the formula, Baseband sample rate = Master clock rate/Decimation factor. If you change the Decimation factor during simulation, then the block changes hardware data rate, but does not change the Simulink sample time.

To get more information on sample time, see What Is Sample Time? (Simulink).

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 transport data rate data type as int16, assigns 16 bits for the in-phase component and 16 bits for the quadrature component, resulting in 32 bits for each complex sample of transport data.

Data type of the output signal, specified as Same as transport data type, double, or single. The complex output data values range from –1 to 1.

Number of samples per frame of the output signal that the object generates, specified as a positive integer scalar. This value optimally utilizes the underlying Ethernet packets, which have a size of 1500 8-bit bytes.

Option to enable burst mode. To produce a set of contiguous frames without an overrun or underrun to the radio, select Enable burst mode. 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 Number of frames in burst parameter. For more information, see Detect Underruns and Overruns.

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

Dependencies

To enable this parameter, select Enable burst mode.

More About

expand all

Compatibility Considerations

expand all

Errors starting in R2020a

Warns starting in R2020a

Errors starting in R2020a

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2011b