資源簡介
很實用的matlab 自適應濾波程序 完整下載

代碼片段和文件信息
%AFQRRLS1?Problem?1.1.1.1.2.10
%
%???‘ifile.mat‘?-?input?file?containing:
%??????I?-?members?of?ensemble
%??????K?-?iterations
%??????sigmax?-?standard?deviation?of?input
%??????Wo?-?coefficient?vector?of?plant
%??????sigman?-?standard?deviation?of?measurement?noise
%??????lambda?-?forgetting?factor
%??????b?-?bits?in?decimal?part
%?
%???‘ofile.mat‘?-?output?file?containing:
%??????ind?-?sample?indexes?
%??????MSE?-?mean-square?error
clear?all %?clear?memory
load?ifile; %?read?input?variables
L=length(Wo); %?plant?and?filter?length
L1=L+1;
L2=L1+1; %?auxiliary?constants
N=L-1; %?plant?and?filter?order
MSE=zeros(K1); %?prepare?to?accumulate?MSE*I
for?i=1:I %?ensemble
??X=zeros(L1); %?initial?memory
??x=randn(K1)*sigmax; %?input?
??n=randn(K1)*sigman; %?measurement?noise?for?i=1:I
??xq2=zeros(L1);
??dq2=zeros(L1);
??for?l=1:L
????Qthetafp(:((1:L1)+(l-1)*L1))=sparse(eye(L1));
????Qtheta(:((1:L1)+(l-1)*L1))=sparse(eye(L1));
??end
??normef=abs(x(1));
??gammap=1;
??r=zeros(L1);
??for?k=1:(K-1) %?iterations
????AUX=[x(k+1)
?????????lambda^(1/2)*xq2];
????for?l=1:L
??????AUX=Qtheta(:((1:L1)+(l-1)*L1))*AUX;
??????AUX=qround(AUXb);
????end
????efq1=AUX(1);
????xq2=AUX(2:L1);
????aux=normef;
????normef=qround(sqrt(qround((lambda*aux^2+efq1^2)b))b);
????sinthetaf=efq1/normef;
????mu=normef;
????for?l=1:L
??????aux=mu;
??????mu=qround(sqrt(qround((aux^2+(xq2(l))^2)b))b);
??????costhetafp=aux/mu;
??????sinthetafp=xq2(l)/mu;
??????Qthetafp(ll+(L-l)*L1)=costhetafp;
??????Qthetafp(lL1+(L-l)*L1)=-sinthetafp;
??????Qthetafp(L1l+(L-l)*L1)=sinthetafp;
??????Qthetafp(L1L1+(L-l)*L1)=costhetafp;
????end
????re=[r
????????gammap*sinthetaf];
????for?l=L:-1:1
??????re=Qthetafp(:((1:L1)+(l-1)*L1))*re;
??????re=qround(reb);
????end
????r=re(2:L1);
????gammap=1;
????for?l=1:L
??????aux=gammap;
??????gammap2=qround((aux^2-(r(L1-l))^2)b);
??????if?gammap2<0
????????gammap2=0;
??????end
??????gammap=qround(sqrt(gammap2)b);
??????aux=max(aux2^(-b));
??????costheta=gammap/aux;
??????sintheta=r(L1-l)/aux;
??????Qtheta(11+(l-1)*L1)=costheta;
??????Qtheta(1L2-l+(l-1)*L1)=-sintheta;
??????Qtheta(L2-l1+(l-1)*L1)=sintheta;
??????Qtheta(L2-lL2-l+(l-1)*L1)=costheta;
????end
????X=[x(k+1)
???????X(1:N)]; %?new?input?vector
????d=Wo‘*X+n(k+1); %?noisy?desired?signal?sample
????AUX=[d
?????????lambda^(1/2)*dq2];
????for?l=1:L
??????AUX=Qtheta(:((1:L1)+(l-1)*L1))*AUX;
??????AUX=qround(AUXb);
????end
????eq1=AUX(1);
????dq2=AUX(2:L1);
????ep=eq1/gammap; %?a?priori?error?sample
????MSE(k+1)=MSE(k+1)+ep^2; %?accumulate?MSE*I
??end
end
ind=0:(K-1); %?sample?indexes
MSE=MSE/I; %?calculate?MSE
save?ofile?ind?MSE; %?write?output?variables
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2796??2001-09-25?01:26??matlab_algorithms\afqrrls1.m
?????文件???????2811??2001-09-25?01:26??matlab_algorithms\afqrrls2.m
?????文件????????939??2001-09-25?01:26??matlab_algorithms\ar.m
?????文件???????1285??2002-11-22?20:42??matlab_algorithms\brls.m
?????文件???????2562??2002-11-18?21:00??matlab_algorithms\cfdlms.m
?????文件???????4504??2002-11-14?22:56??matlab_algorithms\cosmod_4_64.mat
?????文件???????1868??2002-11-22?21:07??matlab_algorithms\crbf.m
?????文件???????3476??2002-11-18?20:54??matlab_algorithms\dlcllms.m
?????文件???????3034??2001-09-25?01:26??matlab_algorithms\eflrls1.m
?????文件???????2913??2001-09-25?01:26??matlab_algorithms\eflrls2.m
?????文件???????2513??2001-09-25?01:26??matlab_algorithms\eflrls3.m
?????文件???????3544??2001-09-25?01:26??matlab_algorithms\fqrrls1.m
?????文件???????3340??2001-09-25?01:26??matlab_algorithms\fqrrls2.m
?????文件???????4885??2001-09-25?01:26??matlab_algorithms\fqrrls3.m
?????文件????????624??2002-11-22?20:57??matlab_algorithms\ifile.mat
?????文件???????2188??2001-09-25?01:26??matlab_algorithms\iir1.m
?????文件???????3035??2001-09-25?01:26??matlab_algorithms\iir2.m
?????文件???????2742??2001-09-25?01:26??matlab_algorithms\iir3.m
?????文件???????3210??2001-09-25?01:26??matlab_algorithms\iir4.m
?????文件???????1553??2009-09-24?16:01??matlab_algorithms\lms1.m
?????文件???????1525??2001-09-25?01:26??matlab_algorithms\lms2.m
?????文件???????1491??2001-09-25?01:26??matlab_algorithms\lms3.m
?????文件???????1662??2001-09-25?01:26??matlab_algorithms\lms4.m
?????文件???????1211??2001-09-25?01:26??matlab_algorithms\lms5.m
?????文件???????1391??2001-09-25?01:26??matlab_algorithms\lms6.m
?????文件???????2873??2001-09-25?01:26??matlab_algorithms\lrls1.m
?????文件???????2750??2001-09-25?01:26??matlab_algorithms\lrls2.m
?????文件???????1694??2002-11-22?20:52??matlab_algorithms\mlp.m
?????文件???????1358??2001-09-25?01:26??matlab_algorithms\nlms1.m
?????文件???????1464??2001-09-25?01:26??matlab_algorithms\nlms2.m
............此處省略31個文件信息
評論
共有 條評論