|On this page…|
If the SDR Receiver or Transmitter block or System object™ is not keeping up with the hardware, you are not processing data in real time. Burst mode allows you to buffer a minimum set of contiguous samples without losing samples.
First, determine if you need burst mode. Both the block and the System object have a parameter to flag that samples are being dropped. Enabling this parameter helps you to decide whether you need burst mode.
Each of the SDR System objects has a LostSamplesOutputPort property. When you set this property to true, the step method outputs a value in the to indicate if one or more packets is dropped during host reception or transmission of FPGA hardware data.
This example shows how to enable the LostSamplesOutputPort property in an ADIFMCOMMSReceiver System object. The output from MATLAB® indicates that the LostSamplesOutputPort property is enabled.
hSDR = System: comm.SDRADIFMCOMMSReceiver Properties: IPAddress: '192.168.2.2' CenterFrequencySource: 'Property' CenterFrequency: 2500000000 ActualCenterFrequency: NaN GainSource: 'Property' Gain: 4.5 ActualGain: NaN ADCRate: 100000000 ActualADCRate: NaN DecimationFactor: 100 ActualDecimationFactor: NaN EnableBurstMode: false EnableUserLogicBypass: false LostSamplesOutputPort: true OutputDataType: 'int16' FrameLength: 3660
Call the step method using syntax that includes a LOST argument to determine if your simulation is dropping packets.
Each of the SDR blocks has an Enable number of lost samples output port parameter. Select this parameter to make the block output a value to indicate if one or more packets is dropped during host reception or transmission of FPGA hardware data.
When you enable this parameter, the SDR software adds a LostSamples output port to the block.
During simulation, check for a value in either the LOST argument to the step method of the SDR System object or the LostSamples output port of the SDR block:
A zero indicates no data loss. You do not need burst mode.
A positive number indicates that overruns or underruns occurred This result means you need to use burst mode.
For more information, see the reference pages for the blocks and System objects in this support package.
Use burst mode when your model is experiencing lost samples because it cannot keep up with the data being received in real time. Using burst mode allows you to buffer a minimum set of contiguous samples without losing samples. However, lost samples can still happen between bursts, especially with large burst sizes. If your model can keep up in real time, do not use burst mode.
Each of the SDR System objects has an EnableBurstMode property. When you set this property to true, the System object produces a set of contiguous frames without an overrun or underrun to the radio. This setting can help simulate models that cannot run in real time. Specify the desired contiguous data amount using the NumFramesInBurst property.
Each of the SDR blocks has an Enable burst mode parameter that, when selected, causes the SDR block to produce a set of contiguous frames without an overrun or underrun to the radio. This setting can help simulate models that cannot run in real time. Specify the desired contiguous data amount using the Number of frames in burst parameter.
The default number of frames in a burst is 20.
"Unable to allocate memory" error. The operating system imposes a maximum burst size. With a frame size of 4000, for example, the max number is approximately 67K frames. Depending on the specific host, a lower limit can hold due to memory constraints. Exceeding the limit is flagged by an unable to allocate memory error.
"Did not receive expected number of samples in a burst reception" error. This error occurs when the MATLAB or Simulink® software does not receive the requested number of samples from the Xilinx® FPGA-based radio.
The following are known causes of this problem:
On Linux® systems, the OS socket buffer size is not large enough for proper communication. Increase the socket size.
The Ethernet card cannot provide high speed communication. You can try Intel® chipsets, which provide high-quality connection in such cases.
The firewall or virus protection program on your system can block or slow your connection. Turn off the firewall or virus program to eliminate this problem. Note that turning off your firewall can expose your host computer to unauthorized access through the Internet.
Some laptops lose their Ethernet settings when the Ethernet connection is interrupted, for example when power cycling the FPGA device. Check the Ethernet connection settings as described in Configure Host Computer.