minor changes in datastorage

This commit is contained in:
Silas
2024-10-29 14:39:43 +01:00
parent cfd1bdb513
commit 77bcfd0a2a
2 changed files with 45 additions and 15 deletions

View File

@@ -125,7 +125,7 @@ classdef DataStorage < handle
lin_idx = obj.getIndicesByPhys(varargin); lin_idx = obj.getIndicesByPhys(varargin);
errcnt = 0; errcnt = 0;
for i=1:numel(lin_idx) for i=1:numel(lin_idx)
try % try
tmp = obj.sto.(storageVarName){lin_idx(i)}; tmp = obj.sto.(storageVarName){lin_idx(i)};
if ~isempty(tmp) if ~isempty(tmp)
if isa(tmp,'Signal') if isa(tmp,'Signal')
@@ -145,17 +145,17 @@ classdef DataStorage < handle
end end
else else
errcnt = errcnt+1; errcnt = errcnt+1;
value(i,:) = NaN ;
if errcnt < 3 if errcnt < 3
%get back the n-dimensional subiondices... %get back the n-dimensional subiondices...
[sub{1:length(size(obj.sto.(storageVarName)))}] = ind2sub(size(obj.sto.(storageVarName)),lin_idx(i)); % [sub{1:length(size(obj.sto.(storageVarName)))}] = ind2sub(size(obj.sto.(storageVarName)),lin_idx(i));
%get back the physical representaion %get back the physical representaion
word = []; % word = [];
for phys_idx = 1:numel(obj.fn) % for phys_idx = 1:numel(obj.fn)
parametername = obj.fn(phys_idx); % parametername = obj.fn(phys_idx);
word = [word,char(parametername),': ', num2str(obj.parameter.(parametername).getPhysForIndex(sub{phys_idx})),' ;']; % word = [word,char(parametername),': ', num2str(obj.parameter.(parametername).getPhysForIndex(sub{phys_idx})),' ;'];
end % end
% warning(['Requested Data is not in Warehouse ', word]); % warning(['Requested Data is not in Warehouse ', word]);
elseif errcnt == 3 elseif errcnt == 3
% warning(['... ', word]); % warning(['... ', word]);
@@ -166,9 +166,9 @@ classdef DataStorage < handle
% warning([num2str(errcnt),' requested datapoint(s) not in warehouse.']); % warning([num2str(errcnt),' requested datapoint(s) not in warehouse.']);
end end
catch % catch
error('Error in Datastorage: Something happened while looking up in warehouse.') % error('Error in Datastorage: Something happened while looking up in warehouse.')
end % end
end end
else else
error('Wrong Request using ExampleWarehouse.getStoValue(*parameter set*). Give me all the Parameters! Please!') error('Wrong Request using ExampleWarehouse.getStoValue(*parameter set*). Give me all the Parameters! Please!')

View File

@@ -1,10 +1,11 @@
filename = "C:\Users\Silas\Nextcloud4\Dokumente\02_Ablage_Office\Lab_Data_24\bias_sweep\PAM4_10km_ffe__wh.mat"; filename = "/Users/silasoettinghaus/Documents/MATLAB/PAM4_b2b_bias_sweep_20241023_145739_wh.mat";
a = load(filename); a = load(filename);
wh2 = a.obj; wh2 = a.obj;
m = wh2.getStoValue('m',wh2.parameter.vbias.values(1),wh2.parameter.awg_vpp.values(1)); precomp_max = 5;
m = wh2.getStoValue('m',wh2.parameter.vbias.values(1),wh2.parameter.awg_vpp.values(1),precomp_max);
v_bias_vals = wh2.parameter.vbias.values; v_bias_vals = wh2.parameter.vbias.values;
awg_vpp_vals = wh2.parameter.awg_vpp.values; awg_vpp_vals = wh2.parameter.awg_vpp.values;
@@ -14,8 +15,8 @@ rop_measured = [];
cnt = 0; cnt = 0;
for awg_vpp_cur = awg_vpp_vals for awg_vpp_cur = awg_vpp_vals
cnt = cnt+1; cnt = cnt+1;
bers(cnt,:) = wh2.getStoValue('ber',v_bias_vals,awg_vpp_cur); bers(cnt,:) = wh2.getStoValue('ber_mlse',v_bias_vals,awg_vpp_cur,precomp_max);
rop_measured(cnt,:) = wh2.getStoValue('rop',v_bias_vals,awg_vpp_cur); rop_measured(cnt,:) = wh2.getStoValue('rop',v_bias_vals,awg_vpp_cur,precomp_max);
end end
[bestber,bestindex] = min(bers,[],'all'); [bestber,bestindex] = min(bers,[],'all');
@@ -25,6 +26,35 @@ bestvbias=v_bias_vals(v_bias_pos);
disp(['Best Vpp: ',num2str(bestvbias),' V; Best Vpp AWG: ',num2str(bestawgvpp),' V' ]) disp(['Best Vpp: ',num2str(bestvbias),' V; Best Vpp AWG: ',num2str(bestawgvpp),' V' ])
figure()
hold on
for i = 1:numel(awg_vpp_vals)
va=awg_vpp_vals(i);
a=scatter(rop_measured(i,:),bers(i,:),'DisplayName',['FFE AWG:',num2str(va)],'LineWidth',1);
a.DataTipTemplate.DataTipRows(1).Label = 'P out';
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
a.DataTipTemplate.DataTipRows(3).Label = 'Vbias';
a.DataTipTemplate.DataTipRows(3).Value = v_bias_vals;
a.DataTipTemplate.DataTipRows(3).Format = 'auto';
end
% Continue with the rest of your plot settings
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
xlabel('ROP');
ylabel('Bit Error Rate (BER)');
title('Bit Error Rate vs. ROP');
set(gca, 'yscale', 'log');
set(gca, 'Box', 'on');
grid on;
grid minor;
legend('Interpreter', 'none');
figure(); figure();
sgtitle(['PAM ', num2str(m)]) sgtitle(['PAM ', num2str(m)])
subplot1 = subplot(1,2,1); subplot1 = subplot(1,2,1);