Azzera filtri
Azzera filtri

How can I solve this code?

5 visualizzazioni (ultimi 30 giorni)
Darsana P M
Darsana P M il 27 Lug 2017
Commentato: Darsana P M il 30 Lug 2017
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 Commenti
Walter Roberson
Walter Roberson il 27 Lug 2017
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 il 27 Lug 2017
Your size of xx would be very large.....so memory is not sufficient. Try taking a coarse signal.

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 27 Lug 2017
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 Commenti
Walter Roberson
Walter Roberson il 30 Lug 2017
You should use a shorter audio signal.
Darsana P M
Darsana P M il 30 Lug 2017
thank you sir.i will try that

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Simulation, Tuning, and Visualization in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by