This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Audio Tone Control Using General Standards Boards

This model shows how to do tone control audio processing using General Standards I/O boards. It requires the DSP System Toolbox™.

Left and right channel inputs are digitized with the 24DSI12 board, processed using the Tone Filters subsystem, and then fed to the 16AO16 board for output. The Tone Filters subsystem implements Bass, Mid, and Treble filters. Coefficients are selectable from a bank of filters and are slewed between the selected indices.

To test this model:

  1. Connect the differential pair B29/B30 on the 24DSI12 to B34/B33 on the 16AO16 boards.

  2. Attach a source (for example, a signal generator or mp3 player) to channels 1 & 2 of the 24DSI12 board.

  3. Attach a sink (for example, a speaker) to channels 1 & 2 of the 16AO16 board.

  4. Build, download, and run the model.

  5. Control the filter banks using the tone control GUI: tone_gui Note: To use tone_gui, you must run tone_controls_xpc in External mode.

Check Connection Between Development and Target Computers

Use 'slrtpingtarget' to test the connection between the development and target computers.

if ~strcmp(slrtpingtarget, 'success')

Open, Build, and Download Model to the Target Computer

Open the tone control model, tone_controls_xpc. Under the model's configuration parameter Simulink® Real-Time™ option settings, the system target file has been set to slrt.tlc. Hence, building the model will create an executable image, tone_controls_xpc.mldatx, that can be run on a computer booted with the Simulink Real-Time kernel.


Figure 1: Tone control model using the General Standards 24DSI12 and 16AO16 boards.

Build the model and download the image, xpcosc.mldatx, to the target computer.

set_param('tone_controls_xpc','RTWVerbose','off'); % Configure for a non-Verbose build.
rtwbuild('tone_controls_xpc');                     % Build and download application.
### Starting Simulink Real-Time build procedure for model: tone_controls_xpc
Warning: This model contains blocks that do not handle sample time
changes at runtime. To avoid incorrect results, only change
the sample time in the original model, then rebuild the model. 
### Successful completion of build procedure for model: tone_controls_xpc
### Looking for target: TargetPC1
### Download model onto target: TargetPC1

Run Model, Randomize 'Gain' Parameter, Plot Host Scope Data

Create the MATLAB® variable, tg, containing the Simulink Real-Time target object. This object allows you to communicate with and control the target computer.

tg =;           % Create a Simulink Real-Time target object
start(tg);                              % Start model execution


% EOF tone_controls_xpc.m
Was this topic helpful?