📄 con_neg.m
字号:
function [y,PI] = con_neg()
%
%A conventional Negentropy-based Algorithm for Blind Source Separation
%copyright 2005.4.14
%author:lucky zhang
%used to separate audio signal
%usage:[y,PI]=con_neg()
%where x is the mixed signal
%y is the separation signal
%PI is the performance
s1=wavread('man.wav');
s2=wavread('women.wav');
s=[s1';s2'];
[dim,sample]=size(s);
A=rand(dim);
x=A*s;
fprintf('mixed signal has %d dim\n',dim);
fprintf('mixed signal has %d sample\n',sample);
z=baihua(x);
W=rand(dim);
u=0.0005;
for i=1:sample
y(:,i)=W'*z(:,i);
gy(:,i)=tanh(y(:,i));
W=W-u*z(:,i)*(gy(:,i))';
W=W/norm(W);
PI(i)=xnzb(W*A);
end
y=W'*z;
n=dim;
figure(1);
m=1:sample;
t=m/16000;
plot(t,PI);
figure(2);
for i=1:n
subplot(n,1,i);
plot(y(i,:));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -