1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
%function mixage(s1,s2)
function [s3] = mixage(s1,s2)
% Blind signal separation for speech signals
h12=0.2;
h21=-0.3;
u=0.0001;%adaptation step
temp = s1;
temp=temp';
s=temp(1,:);
N=length(s);
temp = s2;
temp=temp';
s(2,:)=temp(1,1:N);
A=[0.5 h12;h21 0.6]; %mixing matrix
x=A*s; %mixing process
y=zeros(2,length(s));
M=[u 0;0 u]; %diagonal matrix of adaptation steps
L=0; %filter order, if L=0 then output y is computied using only current value of vector x(sensors)
for j=0:L
W{j+1}=eye(2);
end %demixing matrixes W initialized as an identity matrix
begin=3*L+1;
for i=begin:length(s)
for j=0:L
dW{j+1}=M*(W{j+1}-(sign(fonction_mixage1(i-L,W,L,x))*fonction_mixage2(i,W,L,x)'));
end
for j=0:L
W{j+1}=W{j+1}+dW{j+1};
end
end
%source signals estimates:
y=W{1}*x;
%normalization to <-1,1>
maks1=max(abs(y(1,:)));
maks2=max(abs(y(2,:)));
y(1,:)=y(1,:)/maks1;
y(2,:)=y(2,:)/maks2;
s1 = s(1,:);
s2 = s(2,:);
s3 = ((s1+s2)/2); |
Partager