| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Embedded MATLAB |
| Contents | Index |
| On this page… |
|---|
The tutorial uses the following files:
Example M-code files for each step of the tutorial.
Throughout this tutorial, you work with M-files that contain a simple least mean squares (LMS) filter algorithm.
Build scripts that you use to compile your function code.
Test files that:
Perform the preprocessing functions, for example, setting up the signal length and filter length
Load the music sample
Call the specified filter function
Compare the outputs of the specified filter function (the algorithm under test) to the output of the original filter (the golden reference) so that you can determine if your modified code is functionally equivalent to your original code
Perform the post-processing functions, for example, plotting the filter's impulse response and playing the audio output
A MAT-file that contains the filter coefficients.
Simulink models for Integrating Your Embedded MATLAB Compliant Code with Simulink .
The tutorial files are located in the folder matlabroot/toolbox/eml/tutorial.
You will need to copy these files to a local folder. Instructions on how to copy the files are provided in Copying Files Locally.
| Type | Name | Description |
|---|---|---|
| Function code | emldemo_lms_01.m | Baseline MATLAB implementation of batch filter. Not Embedded MATLAB compliant. |
| emldemo_lms_01_mlint.m | Baseline batch filter after elimination of all M-Lint errors and warnings. | |
| emldemo_lms_02.m | Embedded MATLAB compliant batch filter. | |
| emldemo_lms_03.m | Embedded MATLAB compliant batch filter modified to accept a variable sized input. | |
| emldemo_lms_04.m | Embedded MATLAB compliant frame-based streaming filter. | |
| emldemo_lms_05.m | Embedded MATLAB compliant frame-based streaming filter with Reset and Adapt controls. | |
| Build script | emldemo_lms_build_01.m | Build script for emldemo_lms_01_mlint.m. |
| emldemo_lms_build_02_lib.m | Build script for emldemo_lms_02.m. Generates a C library. | |
| emldemo_lms_build_02_mex.m | Build script for emldemo_lms_02.m. Generates a MEX function. | |
| emldemo_lms_build_03_lib.m | Build script for emldemo_lms_03.m. Generates a C library. | |
| emldemo_lms_build_03_mex.m | Build script for emldemo_lms_03.m. Generates a MEX function. | |
| emldemo_lms_build_04_lib.m | Build script for emldemo_lms_04.m. Generates a C library. | |
| emldemo_lms_build_04_mex.m | Build script for emldemo_lms_04.m. Generates a MEX function. | |
| emldemo_lms_build_05_lib.m | Build script for emldemo_lms_05.m. Generates a C library. | |
| emldemo_lms_build_05_mex.m | Build script for emldemo_lms_05.m. Generates a MEX function. | |
| Test script | emldemo_lms_test_01.m | Tests baseline M-code emldemo_lms_01.m. |
| emldemo_lms_test_02.m | Tests emldemo_lms_02.m and compares output to baseline M-code. | |
| emldemo_lms_test_03.m | Tests emldemo_lms_03.m and compares output to baseline M-code. | |
| emldemo_lms_test_04.m | Tests emldemo_lms_04.m and compares output to baseline M-code. | |
| emldemo_lms_test_05.m | Tests emldemo_lms_05.m and compares output to baseline M-code. | |
| MAT-file | emldemo_lms_filter.mat | Contains the filter weights (or coefficients) that are loaded by the test scripts. |
| Simulink model file | emldemo_noise_cancel_01.mdl | Simulink model without an Embedded MATLAB function block. |
| emldemo_noise_cancel_02.mdl | Complete emldemo_noise_cancel_01 model including Embedded MATLAB function block. |
![]() | Example: The LMS Filter | Making Your M-Code Compliant with the Embedded MATLAB Subset | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |