www.pudn.com > ln.rar > mainp1test.asv


 
clear;clc;close all; 
 
display('This program is for the paper titled:A class of novel blind source extraction algorithms based on a linear predictor') 
display('for the whitened case and updated by the eqn.(21)----test:add the kalman filter') 
load ABio7 
sig=benchcicbar; 
s0=sig(2,:);s1=sig(3,:); 
s2=sig(4,:);s3=sig(5,:); 
%%%%%%%%%%------beginning of fiuring the source signal-----%%%%%%%%% 
figure 
subplot(5,1,1)    
plot(s0) 
subplot(5,1,2)    
plot(s1) 
subplot(5,1,3)   
plot(s2) 
subplot(5,1,4)    
plot(s3) 
 
%%%%%%%%%%------end of fiuring the source signal-----%%%%%%%%% 
A=[-0.9370 0.9448 0.3651 -0.2617; 
    -0.8263 -0.3478 -0.2872 0.6279; 
    0.3730 0.1975 0.9953 0.8325; 
    0.8955 0.3578 0.5649 0.6257]; 
s=[s0;s1;s2;s3]; 
x=A*s; 
 
%%%%%%%%  whiten the mixed signal 
covarianceMatrix=cov(x',1);     % 产生协方差阵 
[E,D]=eig(covarianceMatrix);           % 求出协方差的特征向量和特征值 
 
[x1,WhitenMatrix]=whitenSig(x,E,D);     % 对信号进行白化 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
[m,n]=size(x1); 
P=5;%%%%%-----length of the linear predicor 
b=rand(1,P)';%%%------------linear predictor coefficient vector---------- 
mu=0.4%%%%%%%%%%%%-------learn stepsize--- 
w=rand(m,1); 
wold=w; 
 
Q=eye(p); 
%%%%%%%%%%%%%%--------------update the weight vector--------------------- 
 
for i=P+1:n 
    y=w'*x1; 
    Y=[]; 
    X=[]; 
    for j=1:P 
        Y=[Y;y(i-j)]; 
        X=[X;x1(i-j)']; 
    end 
    K=Q*Y*(Y'*Q 
    e=y(i)-b'*Y; 
    hatx=x1(i)-(b'*X)'; 
    w=wold-mu*e*hatx;   
    w=w/norm(w); 
    if norm(w-wold)<0.0001; 
        break; 
    end 
    wold=w; 
end 
display('the demixing vector is:') 
w 
subplot(5,1,5) 
plot(y) 
 
display('the global demixing vector is:') 
w'*WhitenMatrix*A