The RTL-SDR Receiver block has optional output ports for reporting lost samples and latency.
When the Lost samples output port is active, it outputs a zero if the block is processing data in real time and a positive number if the block is not keeping up with the hardware.
When the Latency output port is active, it indicates latency during host-hardware data transfers in number of frames.
These ports are useful diagnostic tools for determining real time operation of the blocks. If your model is not running in real time, try the techniques described in Model Performance Optimization to approach or achieve real-time performance.
The comm.SDRRTLReceiver
System object™ has optional outputs for reporting lost samples and latency. These
outputs are returned when you call the object as a function.
Begin by creating a comm.SDRRTLReceiver
object. For example, rtlsdr = comm.SDRRTLReceiver
,
creates an receiver object.
[y,len,lost] = rtlsdr()
outputs the number of
lost samples. If lost
= 0, then no samples were
lost.
[y,len,lost,late] = rtlsdr()
outputs the number
of lost samples, lost
, and the latency,
late
. The output, late
, is
an integer valued scalar representing the latency in number of
frames.
These outputs are 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.