5.0

5.0 | 1 rating Rate this file 199 downloads (last 30 days) File Size: 16.84 KB File ID: #16278

Vectorized Adaptive noise canceler using LMS filter

by Kiran Kintali

 

07 Sep 2007 (Updated 14 Aug 2008)

Code covered by BSD License  

This demo shows to call external functions in an Embedded MATLAB block

Download Now | Watch this File

File Information
Description

(Demo developed using R2007b)

Embedded MATLAB block in Simulink supports calling three types of functions;

1) Embedded MATLAB builtin library functions
2) Subfunctions within the Embedded MATLAB block script and
3) External MATLAB functions

This demo shows how to call user written compilable "External MATLAB functions" from an Embedded MATLAB block.

The attached model implements a vectorized adaptive noise canceler using a Least Mean Square (LMS) filter written in Embedded MATLAB.

The LMS filter retrieves the original music signal ('err_sig') from Pilot's Mic by filtering the Exterior Mic's signal. The weights of the filter are updated(adapted) in real time based on 'input' and 'err_sig'

The main body of the canceler implementation is part of the block script in
'lms_eml_hardware/Embedded MATLAB Function'. The script embedded in that block calls the following M functions on the path

tapped_delay_fcn.m, treesum_fcn.m, update_weight_fcn.m

For code generation (C and HDL) the user must instruct Embedded MATLAB to compile an external function by adding the following compilation directive or pragma to the function body

%#eml

For more info related to this topic search for "Calling Functions in Embedded MATLAB" in MATALAB documentation

For general info about Embedded MATLAB visit
http://www.mathworks.com/products/featured/embeddedmatlab/index.html?s_cid=HP_MI_EmbeddedMATLAB

Required Products Fixed-Point Toolbox
Simulink
MATLAB release MATLAB 7.4 (R2007a)
Zip File Content  
Other Files lms_eml/eml_vectorized_lms_7b.mdl,
lms_eml/treesum_fcn.m,
lms_eml/update_weight_fcn.m,
lms_eml/tapped_delay_fcn.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
12 Feb 2008 Ali Buendia

Good use of embedded matlab

27 Apr 2008 farzad MOAZZAMI

I believe LMS is the best line enhancer

Please login to add a comment or rating.
Updates
10 Sep 2007

updated the screen shot

26 Sep 2007

requires the following wave file matlab\toolbox\dspblks\dspdemos\dspafxf_8000.wav

14 Aug 2008

add to eML category

Tag Activity for this File
Tag Applied By Date/Time
embedded matlab Kiran Kintali 22 Oct 2008 09:26:05
hdl Kiran Kintali 22 Oct 2008 09:26:05
lms Kiran Kintali 22 Oct 2008 09:26:05
embedded matlab Kiran Kintali 22 Oct 2008 09:26:05
adaptive filter Kiran Kintali 22 Oct 2008 09:26:05
adaptive filter Saleh Badgail 03 Apr 2009 10:42:22
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com