Burst-Mode Buffering
In the Wireless Testbench™ Support Package for NI™ USRP™ Radios, if the SDRu blocks or SDRu System object™ cannot keep up with the radio hardware, the model or code is not processing data in real time. Burst mode enables you to buffer a set of contiguous samples without losing samples by setting the number of frames in a burst.
Determine If You Need Burst Mode
It is recommended that you enable burst mode when your application requires fresh samples or guaranteed contiguous samples.
To see if the transmitted or received data is contiguous for an SDRu block:
Check the underrun port on SDRu Transmitter block.
Check the overrun port on SDRu Receiver block.
To see if the transmitted or received data is contiguous for an SDRu System object:
Check the
underrun
output when you callcomm.SDRuTransmitter
System object.Check the
overrun
output when you callcomm.SDRuReceiver
System object.
Tip
If your model is not running in real time, you can:
Use Burst mode
Use vector-based processing
Accelerate with code generation
Any combination of these techniques may be applied to approach or achieve real-time performance.
Enable Burst Mode
Use burst mode when your model is experiencing underruns or overruns because it cannot keep up with the amount of transmitted or received data in real time. Burst mode allows you to buffer a minimum set of contiguous samples without underruns or overruns.
Note
Overruns and underruns can still happen between bursts, especially with large burst sizes. Therefore, enabling the burst mode feature is recommended only if your model cannot keep up in real time.
The maximum burst size (in frames) is imposed by the operating system and the USRP device UHD™. The maximum size imposed by the UHD is approximately 1 GB, or 256 megasamples. This maximum number of samples
is enforced by MATLAB®. For example, with a frame size of 4000 samples, the maximum burst is
approximately 67k frames. Depending on the memory constraints on a specific host, a
lower limit might be required. Exceeding the limit will be flagged by an error saying
'unable to allocate memory'
. For N3xx-
and X3xx- series radios , the maximum size of the burst is calculated as DecimationFactor
X NumFramesInBurst
X number of frames per burst X SamplesPerFrame
, for the devices that support RFNO. The
default burst size is 100
frames.
Enable Burst Mode in SDRu System objects
Receiver Burst Mode Processing
When you use the burst mode for data reception, the first SDRu receiver System object call transfers a whole burst to the host computer memory and then the SDRu receiver System object processes the first frame. Subsequent SDRu receiver System object calls process the rest of the burst, one frame at a time, from the host computer memory (not from the radio). When all the frames in the transferred data have been processed, the next SDRu receiver System object call transfers another whole burst to the host computer memory and the first frame of data is processed by the SDRu receiver System object.
For example, Set the EnableBurstMode
property to true
, NumFramesInBurst
property to 10
, and SamplesPerFrame
to 100000
. For the first SDRu
receiver System object call, a whole burst (1,00,000 samples/frame X 10 frames/burst
= 1,000,000 samples/burst) is transferred to the host computer memory and the SDRu
receiver System object processes the first frame of data. For subsequent SDRu
receiver System object calls (second through tenth calls), one frame at a time, is
processed from the host computer memory. After the whole burst has been processed,
on the eleventh SDRu receiver System object call, another whole burst is transferred
from the radio to the host computer memory and the first frame of data is processed
by the SDRu receiver System object.
Transmitter Burst Mode Processing
When you use burst mode for data transmission, the data is not transferred to the radio until
the SDRu transmitter System object has been called NumFramesInBurst
times. After the SDRu transmitter System object is
called for NumFramesInBurst
times, the whole burst is transferred
to the radio and then transmitted.
Enable Burst Mode in SDRu Blocks
The SDRu Receiver and SDRu Transmitter blocks have an Enable burst mode parameter. When you select this parameter, the block
produces a set of contiguous frames without underruns or overruns. Enable burst mode to
simulate models that cannot run in real time. Specify the amount of contiguous data by
using the Number of frames in burst parameter. The
default number of frames in a burst is 100
.
Related Examples
- WLAN Beacon Receiver Using Software-Defined Radio (WLAN Toolbox)