Main Content

Real-Time Operation

Block Lost Samples and Latency Outputs

The RTL-SDR Receiver block has optional output ports to report lost samples and latency.

  • Select the Lost samples output port parameter to enable the lost port, which outputs 0 if the block is processing data in real time (that is, if the block is keeping up with the RTL-SDR radio) and a positive number otherwise.

  • Select the Latency output port parameter to enable the late output port, which indicates the latency during host-hardware data transfers in number of frames.

These output ports can be useful diagnostic tools for determining real-time operation of the blocks. If your model is not running in real time, try the techniques in Model Performance Optimization to approach or achieve real time performance.

System Object Lost Samples and Latency Outputs

The RTL-SDR receiver System object™ has optional output arguments to report lost samples and latency. To output lost samples and latency, follow these steps.

  1. Identify the lost samples and latency outputs that is associated with the comm.SDRRTLReceiver System object. For this example, create a default RTL-SDR receiver System object.

    radio = comm.SDRRTLReceiver;
  2. Report the number of lost samples. If your model runs in real time, the lost samples output (lost) is 0, which indicates that no samples are lost.

    [y,len,lost] = radio();
  3. Report the latency of the received data in the frames. If the received frames of data have no latency, the late output is less than or equal to 1. Even when your model runs in real time, received signals can experience latency.

    [y,len,lost,late] = radio();

These output arguments can be useful for determining real-time operation of the System object. If your design is not running in real time, try the techniques described in MATLAB Performance Optimization to approach or achieve real-time performance.

See Also

Blocks

Objects