Detect Underruns and Overruns
You can detect underruns and overruns using the underflow and overflow indicators of the SDR blocks and System objects available in the Communications Toolbox™ Support Package for USRP™ Embedded Series Radio.
Use these indicators to determine real-time execution of your designs.
If your receiver design is not running in real time, use Burst Mode.
If your transmitter design is not running in real time, consider using transmit repeat. Alternatively, try to increase the frame size to approach or achieve real-time performance or decrease the baseband sampling rate.
Detect Lost Samples Using SDR Blocks
The E3xx Receiver block has an optional data discontinuity port called overflow.
1indicates the presence of overflow resulting in non-contiguous data.
0indicates no overflow.
The overflow port is enabled by default. To disable it, on the block mask, clear the Enable output port for overflow indicator parameter.
The E3xx Transmitter block also has an optional data discontinuity flag called underflow.
1indicates the presence of underflow resulting in non-contiguous data.
0indicates no underflow.
The underflow port is enabled by default. To disable it, on the block mask, clear the Enable output port for underflow indicator parameter.
Detect Lost Samples Using SDR System Objects
When you call the
comm.SDRRxE3xx receiver System object™, the second output argument is a logical value that indicates
discontinuity of the data packets streaming to MATLAB® from the radio hardware.
trueindicates the presence of overflow resulting in non-contiguous data.
falseindicates no overflow.
When you call the
System object, the output argument is a logical value indicating data discontinuity in
the data packets streamed from MATLAB to the radio hardware.
trueindicates the presence of underflow resulting in non-contiguous data.
falseindicates no underflow.
This example shows how to use the underflow indicator in a transmitter System object. You can follow the same process in a receiver System object.
Create a transmitter System object. For example:
tx = sdrtx('E3xx');
Create transmission data.
txData = zeros(100,1);
Transmit data with
lostSampsas an output argument.
for counter = 1:20 underflow = tx(txData); if (underflow) display('### Warning lost samples') end end