Home > complex-toolbox > CLMS > clms.m

clms

PURPOSE ^

FUNCTION clms() implements the CLMS algorithm

SYNOPSIS ^

function y = clms(x,N,mu)

DESCRIPTION ^

 FUNCTION clms() implements the CLMS algorithm 
 
 Based on Table 5.1, Adaptive Filter Theory, Simon Haykin.

 INPUT:
 x: input signal 
 N: filter length
 mu: step-size

 OUTPUT:
 y: filter output


 Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB
 Supplementary to the book:
 
 "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models"
 by Danilo P. Mandic and Vanessa Su Lee Goh
 
 (c) Copyright Danilo P. Mandic 2009
 http://www.commsp.ee.ic.ac.uk/~mandic
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You can obtain a copy of the GNU General Public License from
    http://www.gnu.org/copyleft/gpl.html or by writing to
    Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 ...........................................

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % FUNCTION clms() implements the CLMS algorithm
0002 %
0003 % Based on Table 5.1, Adaptive Filter Theory, Simon Haykin.
0004 %
0005 % INPUT:
0006 % x: input signal
0007 % N: filter length
0008 % mu: step-size
0009 %
0010 % OUTPUT:
0011 % y: filter output
0012 %
0013 %
0014 % Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB
0015 % Supplementary to the book:
0016 %
0017 % "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models"
0018 % by Danilo P. Mandic and Vanessa Su Lee Goh
0019 %
0020 % (c) Copyright Danilo P. Mandic 2009
0021 % http://www.commsp.ee.ic.ac.uk/~mandic
0022 %
0023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 %    This program is free software; you can redistribute it and/or modify
0025 %    it under the terms of the GNU General Public License as published by
0026 %    the Free Software Foundation; either version 2 of the License, or
0027 %    (at your option) any later version.
0028 %
0029 %    This program is distributed in the hope that it will be useful,
0030 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
0031 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0032 %    GNU General Public License for more details.
0033 %
0034 %    You can obtain a copy of the GNU General Public License from
0035 %    http://www.gnu.org/copyleft/gpl.html or by writing to
0036 %    Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
0037 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0038 % ...........................................
0039 function y = clms(x,N,mu)
0040 
0041 M = 1;% prediction horizon
0042 L = length(x)-M;
0043 filterinput = zeros(N,L); 
0044 WLMS = zeros(N,1); % weight
0045 eLMS = zeros(1,L); % error
0046 filteroutput = zeros(1,L); 
0047 
0048 for i = 1:L
0049     for m = 1:N
0050         if (i-m+1)>0
0051             filterinput(m,i) = x(1,i-m+1);
0052         else
0053             filterinput(m,i) = 0;
0054         end
0055     end
0056     filteroutput(i) = transpose(filterinput(:,i)) * WLMS;% filter output
0057     eLMS(i) = x(1,i+M) - filteroutput(i);% error(k)
0058     WLMS = WLMS + mu * eLMS(i) * conj(filterinput(:,i));% weight update
0059 end
0060 y = filteroutput;

Generated on Tue 21-Apr-2009 19:50:21 by m2html © 2003