How can I solve this code?

5 次查看(过去 30 天)
clc;
clear all;
close all;
fs=54100;
y= audioread('dsp1.wav');
p= audioread('dsp2.wav');
figure(1);
plot(y);
figure(2);
plot(p);
xx = [y p];
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
figure(4);
subplot(2,2,1); plot(y); title('mixed audio - mic 1');
subplot(2,2,2); plot(p); title('mixed audio - mic 2');
subplot(2,2,3); plot(a, 'g'); title('unmixed wave 1');
subplot(2,2,4); plot(a(1,:),'r'); title('unmixed wave 2');
This code is for the cocktail party problem. I actually want to mix the two signals and extract them using ICA. Is the logic correct?? But,I am getting an error for the above code.
Out of memory. Type HELP MEMORY for your options.
Error in cov (line 97)
xy = (xc' * xc) / (m-1);
Error in mix1 (line 27)
yy = sqrtm(inv(cov(xx')))*(xx-repmat(mean(xx,2),1,size(xx,2)));
  2 个评论
Walter Roberson
Walter Roberson 2017-7-27
What is the difference between this and your previous https://www.mathworks.com/matlabcentral/answers/350220-how-to-solve-the-code ? Is that previous question Answered to your satisfaction? If so you should Accept something there.
KSSV
KSSV 2017-7-27
Your size of xx would be very large.....so memory is not sufficient. Try taking a coarse signal.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2017-7-27
You have
y= audioread('dsp1.wav');
p= audioread('dsp2.wav');
Each of those will be either N x 1 (one channel) or N x 2 (2 channels)
xx = [y p];
so xx will be N x 2 (one channel each) or N x 4 (two channels each)
yy = sqrtm(inv(cov(xx')))*(xx-repmat(mean(xx,2),1,size(xx,2)));
xx is N x 2 or N x 4 so xx' is 2 x N or 4 x N . The output of cov() is an M x M matrix where M is the number of columns in the input, so the output of cov() would try to be N x N . You simply do not have enough memory for that. You will need to work with a portion of the files at a time.
  11 个评论
Walter Roberson
Walter Roberson 2017-7-30
You should use a shorter audio signal.
Darsana P M
Darsana P M 2017-7-30
thank you sir.i will try that

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by