|
@@ -7,7 +7,7 @@ s_length = config.sceneLength;
|
|
N_Ref = config.numRef;
|
|
N_Ref = config.numRef;
|
|
N_Cpt = config.numSensor;
|
|
N_Cpt = config.numSensor;
|
|
N_sousCpt = config.numSubSensor;
|
|
N_sousCpt = config.numSubSensor;
|
|
-Bound_phen = config.Bound_phen;
|
|
|
|
|
|
+Bound_phen = reshape(config.Bound_phen(1:2*N_sousCpt),[2 N_sousCpt])';
|
|
Mu_beta = config.Mu_beta;
|
|
Mu_beta = config.Mu_beta;
|
|
Mu_alpha = config.Mu_alpha;
|
|
Mu_alpha = config.Mu_alpha;
|
|
Bound_beta = config.Bound_beta;
|
|
Bound_beta = config.Bound_beta;
|
|
@@ -15,11 +15,11 @@ Bound_alpha = config.Bound_alpha;
|
|
gamma = config.gamma;
|
|
gamma = config.gamma;
|
|
MV = config.mvR;
|
|
MV = config.mvR;
|
|
RV = config.rdvR;
|
|
RV = config.rdvR;
|
|
-var_n = config.var_n;
|
|
|
|
|
|
+noise = config.noise;
|
|
|
|
|
|
%% Scene simulation
|
|
%% Scene simulation
|
|
|
|
|
|
-n_pic = 15;
|
|
|
|
|
|
+n_pic = 5;
|
|
s_n = s_width*s_length; % Total number of areas in the scene
|
|
s_n = s_width*s_length; % Total number of areas in the scene
|
|
[xx,yy] = meshgrid((-1:2/(s_width-1):1),(-1:2/(s_length-1):1));
|
|
[xx,yy] = meshgrid((-1:2/(s_width-1):1),(-1:2/(s_length-1):1));
|
|
xxyy = cat(2,xx(:),yy(:));
|
|
xxyy = cat(2,xx(:),yy(:));
|
|
@@ -28,12 +28,10 @@ for sensor = 1:N_sousCpt
|
|
g = zeros(s_n,1);
|
|
g = zeros(s_n,1);
|
|
for pic = 1:n_pic
|
|
for pic = 1:n_pic
|
|
mu = 2*(rand(1,2)-0.5);
|
|
mu = 2*(rand(1,2)-0.5);
|
|
- sig = diag([ Bound_phen((sensor-1)*2+1) + (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))*abs(randn()+0.5) , ...
|
|
|
|
- Bound_phen((sensor-1)*2+1) + (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))*abs(randn()+0.5) ]);
|
|
|
|
|
|
+ sig = diag([0.2,0.45]);
|
|
g = g + mvnpdf(xxyy,mu,sig);
|
|
g = g + mvnpdf(xxyy,mu,sig);
|
|
end
|
|
end
|
|
- g = (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))/(max(g)-min(g))*(g-min(g)) + Bound_phen((sensor-1)*2+1);
|
|
|
|
- % .5*(g/max(g))+1e-5
|
|
|
|
|
|
+ g = (Bound_phen(sensor,2) - Bound_phen(sensor,1))/(max(g)-min(g))*(g-min(g)) + Bound_phen(sensor,1);
|
|
G_theo = cat(2, G_theo, g);
|
|
G_theo = cat(2, G_theo, g);
|
|
end
|
|
end
|
|
|
|
|
|
@@ -54,12 +52,12 @@ for sen = 1:N_sousCpt
|
|
Mu_alpha(sen)+(Bound_alpha((sen-1)*2+2)-Bound_alpha((sen-1)*2+1))*0.25*randn(1,N_Cpt))), 1);
|
|
Mu_alpha(sen)+(Bound_alpha((sen-1)*2+2)-Bound_alpha((sen-1)*2+1))*0.25*randn(1,N_Cpt))), 1);
|
|
F_theo(sen+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = f_theo;
|
|
F_theo(sen+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = f_theo;
|
|
|
|
|
|
- C = (1-gamma)/gamma*(F_theo(1,(sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)-1)+Bound_phen((sen-1)*2+1)*f_theo(1:end-1));
|
|
|
|
|
|
+ C = 10^(-gamma/20)*mean(Bound_phen(sen,:),2)*f_theo(1:end-1);
|
|
list_nosen = 1:N_sousCpt;
|
|
list_nosen = 1:N_sousCpt;
|
|
list_nosen(sen) = [];
|
|
list_nosen(sen) = [];
|
|
- maxPhen_nosen = norm(Bound_phen(2*list_nosen));
|
|
|
|
|
|
+ meanPhen_nosen = norm(mean(Bound_phen(list_nosen,:)));
|
|
for sor = list_nosen
|
|
for sor = list_nosen
|
|
- f_theo_nosen = rand(1,N_Cpt).*C/(sqrt(N_sousCpt)*maxPhen_nosen);
|
|
|
|
|
|
+ f_theo_nosen = rand(1,N_Cpt).*C/(sqrt(N_sousCpt)*meanPhen_nosen);
|
|
other_f_theo = cat(2, f_theo_nosen, 0);
|
|
other_f_theo = cat(2, f_theo_nosen, 0);
|
|
F_theo(sor+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = other_f_theo;
|
|
F_theo(sor+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = other_f_theo;
|
|
end
|
|
end
|
|
@@ -116,10 +114,18 @@ end
|
|
|
|
|
|
W = repmat(W, 1, N_sousCpt);
|
|
W = repmat(W, 1, N_sousCpt);
|
|
|
|
|
|
-N = var_n*randn(s_n,N_sousCpt*(N_Cpt+1)); % Noise simulation
|
|
|
|
-N(:,(N_Cpt+1)*(1:N_sousCpt)) = 0;
|
|
|
|
-N = max(N,-X_theo);
|
|
|
|
-
|
|
|
|
|
|
+if isinf(noise)
|
|
|
|
+ N = zeros(s_n,N_sousCpt*(N_Cpt+1));
|
|
|
|
+else
|
|
|
|
+ N = randn(s_n,N_sousCpt*(N_Cpt+1)); % Noise simulation
|
|
|
|
+ N(:,(N_Cpt+1)*(1:N_sousCpt)) = 0; % No noise for the references
|
|
|
|
+ for i = 1:N_sousCpt
|
|
|
|
+ noise_i = N(:,(i-1)*(N_Cpt+1)+1:i*(N_Cpt+1)-1);
|
|
|
|
+ X_i = X_theo(:,(i-1)*(N_Cpt+1)+1:i*(N_Cpt+1)-1);
|
|
|
|
+ N(:,(i-1)*(N_Cpt+1)+1:i*(N_Cpt+1)-1) = (max(X_i(:))-min(X_i(:)))/(max(noise_i(:))-min(noise_i(:)))*10^(-noise/20)*noise_i;
|
|
|
|
+ end
|
|
|
|
+ N = max(N,-X_theo);
|
|
|
|
+end
|
|
X = W.*(X_theo+N); % Data matrix X
|
|
X = W.*(X_theo+N); % Data matrix X
|
|
|
|
|
|
Omega_G = [ones(s_n,1),W(:,(N_Cpt+1)*(1:N_sousCpt))]; % Mask on known values in G (see eq.(14) of [1])
|
|
Omega_G = [ones(s_n,1),W(:,(N_Cpt+1)*(1:N_sousCpt))]; % Mask on known values in G (see eq.(14) of [1])
|
|
@@ -132,17 +138,19 @@ Phi_F = F_theo .* Omega_F; % Known values in F (see eq.(15) of [1])
|
|
|
|
|
|
Ginit = ones(s_n,1);
|
|
Ginit = ones(s_n,1);
|
|
for sensor = 1:N_sousCpt
|
|
for sensor = 1:N_sousCpt
|
|
- g = zeros(s_n,1);
|
|
|
|
- for pic = 1:n_pic
|
|
|
|
- mu = 2*(rand(1,2)-0.5);
|
|
|
|
- sig = diag([ Bound_phen((sensor-1)*2+1) + (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))*abs(randn()+0.5) , ...
|
|
|
|
- Bound_phen((sensor-1)*2+1) + (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))*abs(randn()+0.5) ]);
|
|
|
|
- g = g + mvnpdf(xxyy,mu,sig);
|
|
|
|
|
|
+ if ~isempty(find(sensor==config.CalibratedSensor,1))
|
|
|
|
+ g = X(:, (sensor-1)*(N_Cpt+1)+1:sensor*(N_Cpt+1)-1);
|
|
|
|
+ g(~W(:,(sensor-1)*(N_Cpt+1)+1:sensor*(N_Cpt+1)-1)) = NaN;
|
|
|
|
+ g = 1/Mu_alpha(sensor)*(nanmean(g,2)-Mu_beta(sensor));
|
|
|
|
+ g(isnan(g))=0;
|
|
|
|
+ else
|
|
|
|
+ g = Phi_G(:,sensor+1);
|
|
|
|
+ g(g==0) = mean(g(g~=0));
|
|
|
|
+ g(Phi_G(:,sensor+1)==0) = abs(1+0.05*randn(size(find(Phi_G(:,sensor+1)==0)))).*g(Phi_G(:,sensor+1)==0);
|
|
end
|
|
end
|
|
- g = (Bound_phen((sensor-1)*2+2) - Bound_phen((sensor-1)*2+1))/(max(g)-min(g))*(g-min(g)) + Bound_phen((sensor-1)*2+1);
|
|
|
|
- % .5*(g/max(g))+1e-5
|
|
|
|
Ginit = cat(2, Ginit, g);
|
|
Ginit = cat(2, Ginit, g);
|
|
end
|
|
end
|
|
|
|
+
|
|
Ginit = (1-Omega_G).*Ginit+Phi_G;
|
|
Ginit = (1-Omega_G).*Ginit+Phi_G;
|
|
% Ginit = G_theo;
|
|
% Ginit = G_theo;
|
|
|
|
|
|
@@ -151,28 +159,26 @@ Finit = zeros(N_sousCpt+1, N_sousCpt*(N_Cpt+1));
|
|
for sensor = 1:N_sousCpt
|
|
for sensor = 1:N_sousCpt
|
|
Finit(1,(sensor-1)*(N_Cpt+1)+1:sensor*(N_Cpt+1)) = ...
|
|
Finit(1,(sensor-1)*(N_Cpt+1)+1:sensor*(N_Cpt+1)) = ...
|
|
cat(2, max(Bound_beta((sensor-1)*2+1), min(Bound_beta((sensor-1)*2+2), ...
|
|
cat(2, max(Bound_beta((sensor-1)*2+1), min(Bound_beta((sensor-1)*2+2), ...
|
|
- Mu_beta(sensor)+(Bound_beta((sensor-1)*2+2)-Bound_beta((sensor-1)*2+1))*0.25*randn(1,N_Cpt))), 0);
|
|
|
|
|
|
+ Mu_beta(sensor)+(Bound_beta((sensor-1)*2+2)-Bound_beta((sensor-1)*2+1))*0.55*randn(1,N_Cpt)))+eps, 0);
|
|
end
|
|
end
|
|
|
|
|
|
for sen = 1:N_sousCpt
|
|
for sen = 1:N_sousCpt
|
|
finit = cat(2, max(Bound_alpha((sen-1)*2+1),...
|
|
finit = cat(2, max(Bound_alpha((sen-1)*2+1),...
|
|
min( Bound_alpha((sen-1)*2+2), ...
|
|
min( Bound_alpha((sen-1)*2+2), ...
|
|
- Mu_alpha(sen)+(Bound_alpha((sen-1)*2+2)-Bound_alpha((sen-1)*2+1))*0.25*randn(1,N_Cpt))), 1);
|
|
|
|
|
|
+ Mu_alpha(sen)+(Bound_alpha((sen-1)*2+2)-Bound_alpha((sen-1)*2+1))*0.25*randn(1,N_Cpt)))+eps, 1);
|
|
Finit(sen+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = finit;
|
|
Finit(sen+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = finit;
|
|
-
|
|
|
|
-% C = (1-gamma)/gamma*(Finit(1,(sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)-1)+Bound_phen((sen-1)*2+1)*finit(1:end-1));
|
|
|
|
-% list_nosen = 1:N_sousCpt;
|
|
|
|
-% list_nosen(sen) = [];
|
|
|
|
-% maxPhen_nosen = norm(Bound_phen(2*list_nosen));
|
|
|
|
- for sor = 1:N_sousCpt
|
|
|
|
- if sen~=sor
|
|
|
|
-% finit_nosen = rand(1,N_Cpt).*C/(sqrt(N_sousCpt)*maxPhen_nosen);
|
|
|
|
-% other_finit = cat(2, finit_nosen, 0);
|
|
|
|
-% Finit(sor+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = other_finit;
|
|
|
|
- Finit(sor+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = zeros(1,N_Cpt+1); % initialization of other dependencies at zero
|
|
|
|
- end
|
|
|
|
|
|
+ C = 10^(-0/20)*mean(Bound_phen(sen,:),2)*finit(1:end-1);
|
|
|
|
+ list_nosen = 1:N_sousCpt;
|
|
|
|
+ list_nosen(sen) = [];
|
|
|
|
+ meanPhen_nosen = norm(mean(Bound_phen(list_nosen,:)));
|
|
|
|
+ for sor = list_nosen
|
|
|
|
+ finit_nosen = rand(1,N_Cpt).*C/(sqrt(N_sousCpt)*meanPhen_nosen)+eps;
|
|
|
|
+ other_finit = cat(2, finit_nosen, 0);
|
|
|
|
+ Finit(sor+1, (sen-1)*(N_Cpt+1)+1:sen*(N_Cpt+1)) = other_finit;
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
+
|
|
|
|
+
|
|
% Finit = F_theo;
|
|
% Finit = F_theo;
|
|
|
|
|
|
end
|
|
end
|