Main Content

audioPluginConfig

Specify coder configuration of audio plugin

Description

The audioPluginConfig object enables you to validate and generate audio plugins that use deep learning pretrained networks. This object also allows you to pass code replacement libraries to the generateAudioPlugin function.

Creation

Description

example

obj = audioPluginConfig(Name,Value) creates an object that describes the coder configuration for your audio plugin. Use name-value arguments to specify the properties of the object.

This object generates a constant property called PluginConfig for audio plugin classes. Use the audioPluginConfig object if your plugin uses deep learning networks or a code replacement library.

Properties

expand all

Deep learning library configuration, specified as an empty array ([]), coder.DeepLearningConfig('none'), or coder.DeepLearningConfig('mkldnn').

  • [] — Do not use a deep learning library.

  • coder.DeepLearningConfig('none') — Generate code that does not use any third-party library.

  • coder.DeepLearningConfig('mkldnn') — Generate code that uses the Intel® Math Kernel Library for Deep Neural Networks (Intel MKL-DNN). This option does not work on Macintosh platforms. This option is not supported with the -win32 option of the generateAudioPlugin function.

You must have MATLAB® Coder™ Interface for Deep Learning Libraries installed to use this property unless you choose the [] option. See coder.DeepLearningConfig (MATLAB Coder) and Prerequisites for Deep Learning with MATLAB Coder (MATLAB Coder) for more information.

Code replacement library configuration, specified as an empty character vector (''), 'none', 'Intel AVX (Windows)', or 'DSP Intel AVX2-FMA (Windows)'.

  • '' — Do not use a code replacement library. 'none' is equivalent to ''.

  • 'Intel AVX (Windows)' — Generate code that uses the Intel AVX code replacement library. This option works only on Windows® platforms. This option is not supported with the -win32 option of the generateAudioPlugin function.

  • 'DSP Intel AVX2-FMA (Windows)' — Generate code that uses the Intel DSP AVX2-FMA code replacement library. This option works only on Windows platforms. This option is not supported with the -win32 option of the generateAudioPlugin function.

You must have Embedded Coder® installed to use this property.

Examples

collapse all

Create the source file for a plugin class, MyAudioPlugin, that uses the Intel AVX code replacement library for Windows. Add a processing function to the class.

classdef MyAudioPlugin < audioPlugin
    properties (Constant)
        PluginConfig = audioPluginConfig( ...
            'DeepLearningConfig',coder.DeepLearningConfig('none'), ...
            'CodeReplacementLibrary','Intel AVX (Windows)');
    end
    methods
        function out = process(~,in)
            out = in;
        end
    end
end

To validate the plugin, use the validateAudioPlugin function. To generate the plugin, use the generateAudioPlugin function.

Create a DeepLearningConfigBase configuration object that generates code that does not use any third-party library. Use the audioPluginConfig object to specify a plugin that incorporates the previous property and uses the Intel AVX code replacement library for Windows. Generate the audio plugin.

dlcfg = coder.DeepLearningConfig('none');
cfg = audioPluginConfig( ...
    'DeepLearningConfig',dlcfg, ...
    'CodeReplacementLibrary','Intel AVX (Windows)');
generateAudioPlugin -audioconfig cfg MyAudioPlugin
Introduced in R2021b