Detect Underruns and Overruns

You can detect underruns and overruns using the lost sample indicator of the SDR blocks and System objects available in the Communications Toolbox™ Support Package for USRP®[1] Embedded Series Radio.

Detect Lost Samples Using SDR Blocks

All SDR blocks have an optional lost samples output port that indicates a discontinuity in data in either the SDR transmitter or receiver. The discontinuity can be either overflow or underflow. This port is a useful diagnostic tool for determining real-time operation of a block. If your design is not running in real time, see Burst Mode.

To determine whether data loss is occurring during simulation, check the value of the lost samples port:

  • A zero indicates no data loss.

  • A positive number indicates that overruns or underruns are occurring.

The lost samples port is enabled by default. To disable it, open the block mask of the SDR receiver or transmitter block, and clear the Enable output port for Lost samples indicator parameter.

Detect Lost Samples Using SDR System Objects

Each SDR System object™ can return a flag that indicates a discontinuity in data. The discontinuity can be either overflow or underflow and can be detected in either the SDR transmitter or receiver System object. The value is a useful diagnostic tool to determine real-time operation of the System object. If your design is not running in real time, see Burst Mode.

This example shows how to use the lost data flag in the E310 transmitter System object. You can follow the same process for the E310 receiver System object.

  1. Create a transmitter System object. For example:

    tx = sdrtx('E310');
  2. Create transmission data.

    txData = zeros(100,1);
    
  3. Transmit data with tx, passing lostSamps as an output argument.

    for counter = 1:20
          lostSamps = tx(txData);
          if (lostSamps)
             display('### Warning lost samples')
          end
    end
    

    Check lostSamps to see if any data loss is occurring.

    • A zero indicates no data loss.

    • A positive number indicates that overruns or underruns are occurring.

See Also

Blocks

System Objects

Related Topics


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