MATLAB实现 ICA 鸡尾酒会语音分离

% Andrew Ng机器学习课上使用MATLAB ICA 实现的鸡尾酒会语音分离
%Cock tail party problem algorithm:
%[W,s,v] = svd((repmat(sum(x.*x,1),size(x,1),1).*x)*x‘);
%audio examples
%http://research.ics.aalto.fi/ica/cocktail/cocktail_en.cgi
[x1, Fs1] = audioread(‘first.wav’);
[x2, Fs2] = audioread(‘second.wav’);

len=min(length(x1),length(x2));
xx = [x1(1:len), x2(1:len)]’;
yy = sqrtm(inv(cov(xx’)))*(xx-repmat(mean(xx,2),1,size(xx,2)));
[W,s,v] = svd((repmat(sum(yy.*yy,1),size(yy,1),1).*yy)*yy’);

a = W*xx; %W is unmixing matrix
subplot(2,2,1); plot(x1); title(‘mixed audio - mic 1’);
subplot(2,2,2); plot(x2); title(‘mixed audio - mic 2’);
subplot(2,2,3); plot(a(1,:), ‘g’); title(‘unmixed wave 1’);
subplot(2,2,4); plot(a(2,:),’r’); title(‘unmixed wave 2’);

audiowrite(‘unmixed1.wav’, a(1,:), Fs1);
audiowrite(‘unmixed2.wav’, a(2,:), Fs1);

  • 2
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值