Commit b246b1e3 authored by Joanna Luberadzka's avatar Joanna Luberadzka

state today

parent 199ac47a
......@@ -2,95 +2,130 @@ clc
clear
close all
addpath(genpath('../Uncertainty_Data/'));
sname='pilot';
SNR=[-Inf -10 -5 0 5];
Nrtrials=20;
sname='CONSEQ500';
SNR=[Inf 5 0 -5 -10];
Nrtrials=50
Nrtrialsfull=500;
ax=[-90:5:90];
scase={'case1', 'case2', 'case3'}
scase={'case2'}%, 'case2', 'case3'}
for c=1:length(scase)
for s=1:length(SNR)
for s=1:length(SNR)
matfilename= [sname,'_', scase{c}, '_SNR',num2str(SNR(s)),'N1000_test.mat'];
load(matfilename);
DOAentropy=zeros(Nrtrials,2);
%% PLOT some of the obtained entropy curves
for n=1:Nrtrials
figure(c*100+s*10+1)
subplot(3,2,1)
plot(ax,sTEST_RESULTS.entropy{n});
[a b]=min(sTEST_RESULTS.entropy{n});
DOAentropy(n,:)=[a b]
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR',num2str(SNR(s)),' N1000 Entropy'])
hold all
subplot(3,2,3)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10,'sgolay'))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10,'sgolay'));
DOAentropy_sgolay(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR',num2str(SNR(s)),' N1000 Entropy smoothed (s.g.)'])
hold all
% figure(s*10+3)
% subplot(2,1,1)
subplot(3,2,5)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10));
DOAentropy_movav(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR',num2str(SNR(s)),' N1000 Entropy smoothed (m.av.)'])
hold all
% subplot(3,2,5)
% plot(sTEST_RESULTS.BVSB{n});
% [a b]=min(sTEST_RESULTS.BVSB{n});
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 BVSB'])
% hold all
%
% subplot(3,2,6)
% plot(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'))
% [a b]=min(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'));
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 Smoothed BVSB'])
% hold all
%
end
%% ESTIMATE DOA BASED ON MINIMUM
for n=1:Nrtrialsfull
[a b]=min(sTEST_RESULTS.entropy{n});
DOAentropy(n,:)=[a b]
matfilename= [sname,'_', scase{c}, '_SNR',num2str(SNR(s)),'N1000_test.mat'];
load(matfilename);
DOAentropy=zeros(Nrtrials,2);
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10,'sgolay'));
DOAentropy_sgolay(n,:)=[a b];
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10));
DOAentropy_movav(n,:)=[a b];
end
%% ESTIMATION MEASURES
Measures_entropy(1)=median(ax(DOAentropy(:,2)));
Measures_entropy(2)=sqrt((1/length(DOAentropy(:,2)))*(sum((-30-ax(DOAentropy(:,2))).^2)));
Measures_entropy(3)=length( find(ax(DOAentropy(:,2))+30<=5) )./length(DOAentropy(:,2));
Measures_entropy_sgolay(1)=median(ax(DOAentropy_sgolay(:,2)));
Measures_entropy_sgolay(2)=sqrt((1/length(DOAentropy_sgolay(:,2)))*(sum((-30-ax(DOAentropy_sgolay(:,2))).^2))) ;
Measures_entropy_sgolay(3)=length( find(ax(DOAentropy_sgolay(:,2))+30<=5) )./length(DOAentropy_sgolay(:,2));
Measures_entropy_movav(1)=median(ax(DOAentropy_movav(:,2)));
Measures_entropy_movav(2)=sqrt((1/length(DOAentropy_movav(:,2)))*(sum((-30-ax(DOAentropy_movav(:,2))).^2))) ;
Measures_entropy_movav(3)=length( find( ax(DOAentropy_movav(:,2))+30<=5) )./length(DOAentropy_movav(:,2));
for n=1:Nrtrials
%% PLOT ESTIMATION RESULTS
figure(c*100+s*10+1)
% subplot(2,1,1)
subplot(3,2,1)
plot(ax,sTEST_RESULTS.entropy{n});
[a b]=min(sTEST_RESULTS.entropy{n});
DOAentropy(n,:)=[a b]
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy'])
hold all
Nrtrialsfull=200
subplot(3,2,2)
hist(ax(DOAentropy(:,2)),-90:5:90)
axis([-90 90 0 Nrtrialsfull])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
title(['MEDIAN=',num2str(Measures_entropy(1)),'°; RMSE=',num2str(Measures_entropy(2)),'; GA=',num2str(Measures_entropy(3)*100),'%'])
% figure(s*10+2)
% subplot(2,1,1)
subplot(3,2,3)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10,'sgolay'))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10,'sgolay'));
DOAentropy_sgolay(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy smoothed (s.g.)'])
hold all
subplot(3,2,4)
hist(ax(DOAentropy_sgolay(:,2)),-90:5:90)
axis([-90 90 0 Nrtrialsfull])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
title(['MEDIAN=',num2str(Measures_entropy_movav(1)),'°; RMSE=',num2str(Measures_entropy_movav(2)),'; GA=',num2str(Measures_entropy_movav(3)*100),'%'])
% figure(s*10+3)
% subplot(2,1,1)
subplot(3,2,5)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10));
DOAentropy_movav(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy smoothed (m.av.)'])
hold all
subplot(3,2,6)
hist(ax(DOAentropy_movav(:,2)),-90:5:90)
axis([-90 90 0 Nrtrialsfull])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
title(['MEDIAN=',num2str(Measures_entropy_sgolay(1)),'°; RMSE=',num2str(Measures_entropy_sgolay(2)),'; GA=',num2str(Measures_entropy_sgolay(3)*100),'%'])
% subplot(3,2,5)
% plot(sTEST_RESULTS.BVSB{n});
% [a b]=min(sTEST_RESULTS.BVSB{n});
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 BVSB'])
% hold all
%
% subplot(3,2,6)
% plot(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'))
% [a b]=min(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'));
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 Smoothed BVSB'])
% hold all
%
end
% figure(s*10+1)
% subplot(2,1,2)
subplot(3,2,2)
hist(ax(DOAentropy(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
% figure(s*10+2)
% subplot(2,1,2)
subplot(3,2,4)
hist(ax(DOAentropy_sgolay(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
% figure(s*10+3)
% subplot(2,1,2)
subplot(3,2,6)
hist(ax(DOAentropy_movav(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
end
end
......@@ -3,7 +3,7 @@ clear
close all
SNR=[-10 -5 0 5];
SNR=[5 -10 -5 0 5];
for l=1:length(SNR)
create_test_h5f(SNR(l))
......
......@@ -8,24 +8,24 @@
% addpath(genpath('/home/joanna/UNCERTAINTY'))
datapath='/media/joanna/daten/user/joanna/Data/TIMIT';
% datapath='/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/';
% datapath='/media/joanna/daten/user/joanna/Data/TIMIT';
datapath='/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/';
addpath(genpath(datapath))
%% PRODUCING UNCERTAINTY CURVES
tic
load(['TIMIT_anecho_A700N500k-06-Sep-2016_traindata.mat' ],'-mat');
load(['TIMIT_conv_A1000N500k-02-Sep-2016_traindata.mat' ],'-mat');
SNR=[-Inf -10 -5 0 5];
Nrtrials=500;
SNR=[Inf 5 0 -5 -10];
Nrtrials=100;
sname='CONSEQ500';
sname='Conv_train';
for s=1:length(SNR)
if SNR(s)<20
if SNR(s)>20
n_cond=0;
else
n_cond='diff_ss';
......@@ -64,12 +64,12 @@ for s=1:length(SNR)
for i=1:Nrtrials
% test parameters
sParamTest=struct('datatype','spectral_slices','N',1000,'A',700,'epsilon',0.1,...
sParamTest=struct('datatype','spectral_slices','N',1000,'A',1000,'epsilon',0.1,...
'noise',n_cond,'SNR',SNR(s),'display',0,'position',[270 330 90] ,'gen_each_time', 1, 'frames', 'conseq','startat', randi(1400000))%,'DATA',DATA);
[v_Entropy,v_BVSB, ~, v_Error]=test_for_each_angle(stTrainingData.m_B,stTrainingData.m_W,sParamTest)
sParamTest=rmfield(sParamTest,'DATA');
% sParamTest=rmfield(sParamTest,'DATA');
sTEST_RESULTS.Nt=Nrtrials;
sTEST_RESULTS.test_param{i}=sParamTest;
......
......@@ -21,8 +21,8 @@
defaultProfile = parallel.defaultClusterProfile;
myCluster = parcluster(defaultProfile);
% parpool(myCluster);
set(myCluster, 'CommunicatingSubmitFcn', cat(2,myCluster.CommunicatingSubmitFcn,'memory','4G'));
%
% set(myCluster, 'CommunicatingSubmitFcn', cat(2,myCluster.CommunicatingSubmitFcn,'memory','4G'));
jobRW =...
batch(...
......
......@@ -7,9 +7,9 @@ close all
%
% Author: Joanna Luberadzka
%
% addpath(genpath('/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/'));
addpath(genpath('/home/joanna/UNCERTAINTY'))
addpath /media/joanna/daten/user/joanna/Data/TIMIT/WN1
addpath(genpath('/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/'));
% addpath(genpath('/home/joanna/UNCERTAINTY'))
% addpath /media/joanna/daten/user/joanna/Data/TIMIT/WN1
......@@ -53,40 +53,40 @@ addpath /media/joanna/daten/user/joanna/Data/TIMIT/WN1
Nrtrials=1;
for i=1:Nrtrials
ID=['nowe',num2str(datestr(now,'-dd-mmm-yyyy'))];
% load weights
% hold off W_cd & B_ck obtained in training
stTrainingData= load(['TIMIT_anecho_A700N500k-06-Sep-2016_traindata.mat' ],'-mat');
stTrainingData=stTrainingData.stTrainingData;
a=30000;
% test parameters
sTestingParam=struct('datatype','spectral_slices','N',500,'A',700,'epsilon',0.1,...
'noise',0,'display',0,'position',[90 180] ,'gen_each_time', 1, 'frames', 'conseq'); %cons
[stCurves, stDOA_estimated, stDiff ]= estimate_DOA(stTrainingData,sTestingParam,Nrtrials);
stTESTDOA.DOA_estimated{i}=stDOA_estimated;
stTESTDOA.Diff{i}=stDiff;
stTESTDOA.Curves{i}=stCurves;
stTESTDOA.TrainingData=stTrainingData;
stTESTDOA.TestingParam=sTestingParam;
% stTESTDOA.Param(i)=source_pos(i);
end
% hold off
% close(writerObj); % Saves the movie.
test_filename=['../Uncertainty_Data/TestResults/', ID, '_test.mat' ];
save(test_filename,'stTESTDOA');
% Nrtrials=1;
%
% for i=1:Nrtrials
%
%
% ID=['nowe',num2str(datestr(now,'-dd-mmm-yyyy'))];
%
%
% % load weights
% % hold off W_cd & B_ck obtained in training
% stTrainingData= load(['TIMIT_anecho_A700N500k-06-Sep-2016_traindata.mat' ],'-mat');
%
% stTrainingData=stTrainingData.stTrainingData;
%
%
% a=30000;
% % test parameters
% sTestingParam=struct('datatype','spectral_slices','N',500,'A',700,'epsilon',0.1,...
% 'noise',0,'display',0,'position',[90 180] ,'gen_each_time', 1, 'frames', 'conseq'); %cons
%
% [stCurves, stDOA_estimated, stDiff ]= estimate_DOA(stTrainingData,sTestingParam,Nrtrials);
%
% stTESTDOA.DOA_estimated{i}=stDOA_estimated;
% stTESTDOA.Diff{i}=stDiff;
% stTESTDOA.Curves{i}=stCurves;
% stTESTDOA.TrainingData=stTrainingData;
% stTESTDOA.TestingParam=sTestingParam;
% % stTESTDOA.Param(i)=source_pos(i);
%
% end
%
% % hold off
% % close(writerObj); % Saves the movie.
%
% test_filename=['../Uncertainty_Data/TestResults/', ID, '_test.mat' ];
% save(test_filename,'stTESTDOA');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment