Documentation Center

  • Trial Software
  • Product Updates

Performance Maximization

General Host Operations

Tune your computing environment to improve performance:

  • Turn off antivirus and firewall software.

  • Turn off all nonessential background processes on your computer.

  • Disable all but IP4 in your network stack.

Model Performance Optimization

Performance improvements can help you achieve real-time execution The following lists contains performance improvements you can make to models that contain any of the SDR Receiver or Transmitter blocks.


Run your application in Accelerator or Rapid Accelerator mode instead of Normal mode. Be aware that some scopes do not plot data when run in Rapid Accelerator mode.

When you use Accelerator or Rapid Accelerator mode, set Model Configuration Parameters > Optimization > Compiler optimization level to Optimizations on (faster runs).

Model Tuning

  • Use frame-based processing. With frame-based processing, the model processes multiple samples during a single execution call to a block. Consider using frame sizes from roughly 100 to several thousand.

  • In Model Configuration Parameters > Data Import/Export, turn off all logging.

  • The model must be single-rate. If the model requires resampling, then choose rational coefficients that keep the model single-rate.

  • Do not add any Buffer blocks to the model. If you want to create convenient frame sizes, do it in your data sources. Using a Buffer block typically degrades performance.

  • Avoid feedback loops. Typically, such loops imply scalar processing, which slows the model considerably.

  • Avoid using scopes. To visualize your data, send it to a workspace variable and post-process it.

  • If the model has many Constant blocks, check Model Configuration Parameters > Optimization (Signals and Parameters) > Inline parameters. This setting causes the sample time of those Constant blocks to become inf, and Simulink® gets the values only once during a run.

Simulink Code Generation

  • If you are generating code from the model, set the Solver setting to Fixed-step/discrete. Set tasking mode to SingleTasking.

  • To improve performance, you can generate a standalone executable for your Simulink model. The generated code runs without Simulink in the loop. To perform any code generation, you must have an appropriate compiler installed. See for compilers supported in the current release.

    You can generate generic real-time target (GRT) code if you have a Simulink Coder™ license. To do so, set Model Configuration Parameters > Code Generation > System target file to grt.tlc (Generic Real-Time Target).

  • When you select the option to generate code for any target (not just GRT), clear the Model Configuration Parameters > Hardware Implementation > Test hardware > Test hardware is the same as production hardware check box. Then, set the Device type to MATLAB Host Computer.

  • You can create generated code with a smaller stack than the GRT code if you have an Embedded Coder® license. To do so, set Model Configuration Parameters > Code Generation > System target file to ert.tlc (Embedded Coder). Then, add the following lines to the Model Configuration Parameters > Code Generation > Custom Code > Include custom C code in generated: > Source file:

    #include <stdio.h>
    #include <stdlib.h>

MATLAB Performance Improvements

Vector-Based Processing

  • Use vector-based processing. With vector-based processing, the program processes multiple samples during a single execution call to a System object™. Consider using vectors from roughly 366 to several thousand. The default is 3660, which represents 10 Ethernet packets.

  • Use large vectors of data to minimize function call overhead.

MATLAB Code Generation

You can accelerate your MATLAB® algorithms by generating a MEX function using the MATLAB Coder function codegen.

Use codegen to generate a MEX function from MATLAB code. The following example generates a MEX file called sdrfExMex from the function sdrfExample:

codegen sdrfExample -args {ones(10,1)} -o sdrfExMex -g -launchreport

For a full list of syntax options and input parameters, see the codegen reference page.

    Note:   sdrfExample is used only for illustrative purposes; it is not a function shipped with the Xilinx® FPGA-Based Radio support package. You must provide your own function for codegen.

Was this topic helpful?