Document toolboxDocument toolbox

Introduction1

This document describes Audio Weaver's MATLAB automation API. It allows you to leverage the power of MATLAB to configure and control Audio Weaver. The API can be used for parameter calculation, visualization, general automation, regression tests, and even full system building. The API is an advanced feature and assumes that the user is familiar with MATLAB.
The most straightforward use of the API allows MATLAB to interact with the Audio Weaver Designer GUI. This is documented in Section 2 and is sufficient for most users. More advanced scripting features are described in later sections.
MATLAB is an interpreted scripting language and all of the commands shown in this section can be typed in directly into MATLAB, or copy and pasted directly from this User's Guide.

Requirements

The API is compatible with MATLAB version 2017b or later. You'll need a standard MATLAB license and the Signal Processing Toolbox. 32-bit and 64-bit versions of MATLAB are supported.
The MATLAB API is included with the "Pro" versions of Audio Weaver; it is not part of the Standard version.

Setup

After installing Audio Weaver Developer or Pro, update MATLAB's search path to include the directory:
<AWE>\matlab
where <AWE> represents the installation directory. This directory contains the primary set of MATLAB scripts used by the tool. Note that you only have to add a single directory to the MATLAB path and not all of the subdirectories recursively. The MATLAB menu item "File  Setup Path…" can be used to update the path. Once the path is set, issue the command:
awe_designer
This launches the Audio Weaver Server followed by the Designer application. It also configures additional directories, and initializes global variables. If you just want to launch the Server and configure MATLAB to run scripts, then simply execute
awe_init
If you accidentally shut down the Server while using Audio Weaver Designer, then press the Reconnect to Server button found on the toolbar.

If you are not using Designer, then you can reconnect to the Server by reissuing the awe_init command.
If you forget to rerun awe_init.m, you'll get an error similar to the one shown below next time MATLAB tries to communicate with the Server:
??? Error using ==> awe_server_command at 47
Server Command Failure:
Command sent to server: "get_target_info"
Server response: "failed, transmit error 0xffffffff"

Error in ==> target_get_info at 89
str=awe_server_command('get_target_info');
Audio Weaver supports multiple simultaneous installations. Install each version in a separate directory. Then, select the version to use by configuring the MATLAB path to point to the appropriate <AWE>\matlab directory and then run the associated awe_init.m script. You can check which version of Audio Weaver is active by the command
>> awe_version
Audioweaver Version Number:
awe server: 32568
awe_module: 32465
awe_subsystem: 32465
awe_variable: 31481
pin: 32555
pin_type: 32495
feedback_pin_type: 31604
connection: 30792

On-line help

All of the Audio Weaver MATLAB functions have usage instructions within the function header. To get help on a particular function, type
help function_name
Additional help is available for audio modules. The command
awe_help
creates a list of available audio modules in the MATLAB command window. A partial list is shown below:
>> awe_help
GPIO_module - Misc
abs_fract32_module - BasicAudioFract32
abs_module - BasicAudioFloat32
acos_module - MathFloat32
adder_fract32_module - BasicAudioFract32
adder_int_module - BasicInt32
adder_module - BasicAudioFloat32
agc_attack_release_fract32_module - BasicAudioFract32
Each of the modules appears as a hyperlink, and clicking on an item provides detailed module specific help. The help provided is above and beyond the comments shown in the file header and accessed via the standard MATLAB "help" command. You can also obtain help for a specific module using the MATLAB command line. For example, to get help on the FIR filter module, type:
awe_help fir_module
The help documentation is provided in HTML format.