System objects in DSP System Toolbox that Support SIMD Code Generation

When certain conditions are met, you can generate SIMD code using Intel AVX2 technology from certain MATLAB® System objects in DSP System Toolbox™.

To generate SIMD code from MATLAB System objects, create a coder.config (MATLAB Coder) object, set the CodeReplacementLibrary parameter to 'Intel AVX (Windows)' or 'Intel AVX (Linux)', and use it with the codegen (MATLAB Coder) command as shown.

This workflow requires you to install MATLAB Coder™ and Embedded Coder® on your machine.

cfg=coder.config('lib');
cfg.CodeReplacementLibrary='Intel AVX (Windows)';
codegen {FunctionName.m} -config cfg  
cfg=coder.config('dll');
cfg.CodeReplacementLibrary='Intel AVX (Windows)';
codegen {FunctionName.m} -config cfg
cfg=coder.config('exe');
cfg.CodeReplacementLibrary='Intel AVX (Windows)';
cfg.GenerateExampleMain='GenerateCodeAndCompile';
codegen {FunctionName.m} -config cfg

Here, FunctionName.m is the MATLAB function that calls the System object™ you are trying to generate SIMD code from.

This table contains a list of System objects in DSP System Toolbox that support SIMD code generation. The table also details the conditions under which the support is available.

MATLAB System objectsConditions
dsp.FIRFilter
  • Filter structure is set to 'Direct form' or 'Direct form transposed'.

  • Input signal is real-valued with real filter coefficients.

  • When the filter structure is set to 'Direct form', the input signal can also be complex-valued with real or complex filter coefficients.

  • Input signal has a data type of single or double.

dsp.FIRDecimator
  • Filter structure is set to 'Direct form'.

  • Input signal is real-valued with real filter coefficients.

  • Input signal is complex-valued with real or complex filter coefficients.

  • Input signal has a data type of single or double.

dsp.FIRInterpolator
  • Input signal is real-valued with real filter coefficients.

  • Input signal is complex-valued with real or complex filter coefficients.

  • Input signal has a data type of single or double.

dsp.LMSFilter
  • Method is set to 'LMS' or 'Normalized LMS'.

  • WeightsOutput is set to 'None' or 'Last'.

  • Input signal is real-valued.

  • Input signal has a data type of single or double.

Related Topics