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 SoC Blockset™ Support Package for AMD FPGA and SoC Devices.
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 AD936x Receiver block has an optional data discontinuity port called overflow.
1
indicates the presence of overflow resulting in non-contiguous data.0
indicates 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 AD936x Transmitter block also has an optional data discontinuity flag called underflow.
1
indicates the presence of underflow resulting in non-contiguous data.0
indicates 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.SDRRxAD936x
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.
true
indicates the presence of overflow resulting in non-contiguous data.false
indicates no overflow.
When you call the comm.SDRTxAD936x
transmitter
System object, the output argument is a logical value indicating data discontinuity in
the data packets streamed from MATLAB to the radio hardware.
true
indicates the presence of underflow resulting in non-contiguous data.false
indicates 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('AD936x');
Create transmission data.
txData = zeros(100,1);
Transmit data with
tx
, passinglostSamps
as an output argument.for counter = 1:20 underflow = tx(txData); if (underflow) display('### Warning lost samples') end end