clear all;
close all;
clc;


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

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

mm=wavread('male_inst_mix.wav');

m1=mm(:,1);m2=mm(:,2);
mm1=buffer(m1,512,0,'nodelay');
mm2=buffer(m2,512,0,'nodelay'); 
TSM1=mm1;  
TSM2=mm2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
simcomale.C1=simcomale.DTr'*TSM1;
simcomale.C2=simcomale.DTr'*TSM2;
x1 = reshape(simcomale.C1,160256,1);
x2 = reshape(simcomale.C2,160256,1);
x1=abs(x1);
x2=abs(x2);
figure;plot(x1,x2,'.');
xlabel('x_1'),ylabel('x_2');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
simcofemale.C1=simcofemale.DTr'*TSM1;
simcofemale.C2=simcofemale.DTr'*TSM2;
x1 = reshape(simcofemale.C1,160256,1);
x2 = reshape(simcofemale.C2,160256,1);
x1=abs(x1);
x2=abs(x2);
figure;plot(x1,x2,'.');
xlabel('x_1'),ylabel('x_2');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dctdic.C1=dctdic.DTr'*TSM1;
dctdic.C2=dctdic.DTr'*TSM2;
x1 = reshape(dctdic.C1,160256,1);
x2 = reshape(dctdic.C2,160256,1);
x1=abs(x1);
x2=abs(x2);
figure;plot(x1,x2,'.');
xlabel('x_1'),ylabel('x_2');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fftdic.C1=real(fftdic.DTr)'*TSM1;
fftdic.C2=real(fftdic.DTr)'*TSM2;
x1 = reshape(fftdic.C1,160256,1);
x2 = reshape(fftdic.C2,160256,1);
x1=abs(x1);
x2=abs(x2);
figure;plot(x1,x2,'.');
xlabel('x_1'),ylabel('x_2');