FUNCTION DRNGD() implements the DRNGD algorithm. Based on the paper "A class of low complexity and fast convergence algorithms for complex-valued neural networks", % IEEE Workshop on Machine Learning for Signal Processing, pp. 13-22, 2004. INPUT: X_in: input signal which should be scaled according to the dynamic range of nonlinearity desired_x: desired response learn_rate: step-size L: filter length Sample: sample length dt_reuse: times of reuse AF: AF = 1 sigmoid function; AF = 0 tanh function; OUTPUT: y: output signal e: output error signal w: weight vector of adaptive filter 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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...........................................
0001 % FUNCTION DRNGD() implements the DRNGD algorithm. 0002 % 0003 % Based on the paper "A class of low complexity and fast convergence algorithms for complex-valued neural networks", % IEEE Workshop on Machine Learning for Signal Processing, pp. 13-22, 2004. 0004 % 0005 % INPUT: 0006 % X_in: input signal which should be scaled according to the dynamic range of nonlinearity 0007 % desired_x: desired response 0008 % learn_rate: step-size 0009 % L: filter length 0010 % Sample: sample length 0011 % dt_reuse: times of reuse 0012 % AF: AF = 1 sigmoid function; AF = 0 tanh function; 0013 % 0014 % OUTPUT: 0015 % y: output signal 0016 % e: output error signal 0017 % w: weight vector of adaptive filter 0018 % 0019 % 0020 % Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB 0021 % Supplementary to the book: 0022 % 0023 % "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models" 0024 % by Danilo P. Mandic and Vanessa Su Lee Goh 0025 % 0026 % (c) Copyright Danilo P. Mandic 2009 0027 % http://www.commsp.ee.ic.ac.uk/~mandic 0028 % 0029 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0030 % This program is free software; you can redistribute it and/or modify 0031 % it under the terms of the GNU General Public License as published by 0032 % the Free Software Foundation; either version 2 of the License, or 0033 % (at your option) any later version. 0034 % 0035 % This program is distributed in the hope that it will be useful, 0036 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0037 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0038 % GNU General Public License for more details. 0039 % 0040 % You can obtain a copy of the GNU General Public License from 0041 % http://www.gnu.org/copyleft/gpl.html or by writing to 0042 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0043 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0044 % ........................................... 0045 function [e,w,y] = drngd(X_in,desired_x,Sample,learn_rate,L,dt_reuse,W_init,AF); 0046 0047 u = learn_rate; 0048 beta=1; 0049 xin = zeros(L,1) + i*zeros(L,1); 0050 e = zeros(Sample,1) + i*zeros(Sample,1); 0051 w=W_init; 0052 0053 0054 for k=1:Sample 0055 0056 xin = [X_in(k) ; xin(1:L-1)]; 0057 0058 for t=1:dt_reuse 0059 0060 net(k) = xin.'*w; 0061 0062 if AF==1 0063 sig_function(k) = 1 / ( 1 + exp( -( beta * net(k) ))); % sigmoid function 0064 sig_function_der(k) = beta * sig_function(k) * ( 1 - sig_function(k) ); 0065 else 0066 sig_function(k) = tanh(beta * net(k)); 0067 sig_function_der(k) = beta * ( 1 - (sig_function(k))^2 ); 0068 end 0069 0070 y(k) =sig_function(k); 0071 e(k) = desired_x(k) - y(k); 0072 0073 w2 = w + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0074 w=w2; 0075 0076 if t==2 0077 w3 = w2 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0078 w=w3; 0079 end 0080 if t==3 0081 w4 = w3 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0082 w=w4; 0083 end 0084 if t==4 0085 w5 = w4 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0086 w=w5; 0087 end 0088 if t==5 0089 w6 = w5 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0090 w=w6; 0091 end 0092 if t==6 0093 w7 = w6 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0094 w=w7; 0095 end 0096 if t==7 0097 w8 = w7 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0098 w=w8; 0099 end 0100 if t==8 0101 w9 = w8 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0102 w=w9; 0103 end 0104 if t==9 0105 w10 = w9 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0106 w=w10; 0107 end 0108 if t==10 0109 w11 = w10 + (u * conj(sig_function_der(k)) * (e(k)) * conj(xin)); 0110 w=w11; 0111 end 0112 0113 end 0114 end