clear all;
close all;
clc;

addpath('C:\Users\TT\Desktop\academics\FinalCode_UBSS\signals');

simcomale = load('simcomale.mat');
simcofemale = load('simcofemale.mat');
dctdic = load('DCTdic.mat');
fftdic = load('FFTdic.mat');

for i = 1:512
    s(i)=sum(abs(simcomale.DTr(:,i)))./sqrt(sum(abs(simcomale.DTr(:,i)).^2));       
end
disp(mean(s));disp(std(s));

for i = 1:512
    s(i)=sum(abs(simcofemale.DTr(:,i)))./sqrt(sum(abs(simcofemale.DTr(:,i)).^2));       
end
disp(mean(s));disp(std(s));

for i = 1:512
    s(i)=sum(abs(dctdic.DTr(:,i)))./sqrt(sum(abs(dctdic.DTr(:,i)).^2));       
end
disp(mean(s));disp(std(s));

for i = 1:512
    s(i)=sum(abs(real(fftdic.DTr(:,i))))./sqrt(sum(abs(real(fftdic.DTr(:,i))).^2));       
end
disp(mean(s));disp(std(s));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

mm=wavread('dev2_female4_inst_mix.wav');

m1=mm(:,1);m2=mm(:,2);
mm1=buffer(m1,512,450,'nodelay');
mm2=buffer(m2,512,450,'nodelay'); 
TSM=[mm1,mm2];    

simcomale.coe = simcomale.DTr'*TSM;
simcofemale.coe = simcofemale.DTr'*TSM;
dctdic.coe = dctdic.DTr'*TSM;
fftdic.coe = real(fftdic.DTr)'*TSM;

for i = 1:512
    s(i)=sum(abs(simcomale.coe(:,i)))./sqrt(sum(abs(simcomale.coe(:,i)).^2));       
end
disp(mean(s));disp(std(s)/10);

for i = 1:512
    s(i)=sum(abs(simcofemale.coe(:,i)))./sqrt(sum(abs(simcofemale.coe(:,i)).^2));       
end
disp(mean(s));disp(std(s)/10);

for i = 1:512
    s(i)=sum(abs(dctdic.coe(:,i)))./sqrt(sum(abs(dctdic.coe(:,i)).^2));       
end
disp(mean(s));disp(std(s)/10);

for i = 1:512
    s(i)=sum(abs(fftdic.coe(:,i)))./sqrt(sum(abs(fftdic.coe(:,i)).^2));       
end
disp(mean(s));disp(std(s)/10);