?? sfrls3.m
字號:
%SFRLS3 Problem 2.3
%
% 'ifile.mat' - input file containing:
% K - iterations
% H - FIR channel
% Neq - equalizer order
% sigman - standard deviation of measurement noise
% epsilon - small auxiliary constant
% kappa1, kappa2, kappa3 - auxiliary parameters
% lambda - forgetting factor
%
% 'ofile.mat' - output file containing:
% ind - sample indexes
% Weq - coefficient vector of equalizer
clear all % clear memory
load ifile; % read input variables
LH=length(H); % channel length
NH=LH-1; % channel order
Leq=Neq+1; % equalizer length
Leq1=Leq+1; % auxiliary constant
ND=round((Neq+NH)/2); % delayer order
LD=ND+1; % delayer length (>LH by hipothesis)
D=zeros(LD,1); % initial delayer memory
Xe=zeros(Leq1,1); % extended initial memory
t=sign(randn(K,1)); % training signal
n=randn(K,1)*sigman; % noise at channel output
%
% initial coefficient vectors
Wbeq=zeros(Leq,1);
Wfeq=Wbeq;
Weq=Wbeq;
%
% initialization
phih=zeros(Leq,1);
gamma=1;
xibmin=epsilon;
ixifmin=1/epsilon;
for k=1:K, % iterations
D=[t(k)
D(1:ND)]; % new delay vector
d=D(LD); % desired signal sample
x=H'*D(1:LH)+n(k); % input sample
Xe=[x
Xe(1:Leq)]; % new extended input vector
%
% predictions
efp=Xe'*[1
-Wfeq];
ef=efp*gamma;
phihe=[0
phih]+ixifmin/lambda*[1
-Wfeq]*efp;
gamma=1/(1/gamma+phihe(1)*efp); % gamma1
ixifmin=ixifmin/lambda-gamma*(phihe(1))^2;
Wfeq=Wfeq+phih*ef;
ebp1=lambda*xibmin*phihe(Leq1);
ebp2=[-Wbeq' 1]*Xe;
ebp=[1-kappa1 kappa1
1-kappa2 kappa2
1-kappa3 kappa3]*[ebp1
ebp2];
gamma=1/(1/gamma-phihe(Leq1)*ebp(3)); % gamma2
eb=gamma*ebp;
xibmin=lambda*xibmin+eb(2)*ebp(2);
phih=phihe(1:Leq)+phihe(Leq1)*Wbeq;
Wbeq=Wbeq+phih*eb(1);
gamma=1/(1+phih'*Xe(1:Leq)); % gamma3
%
% joint-process estimation
ep=d-Weq'*Xe(1:Leq);
e=ep*gamma; % error sample
Weq=Weq+phih*e; % new coefficient vector
end
ind=0:Neq; % sample indexes
save ofile ind Weq; % write output variables
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -