From 77bcfd0a2a59be14f5eb10e250a51e8e592dc074 Mon Sep 17 00:00:00 2001 From: Silas Date: Tue, 29 Oct 2024 14:39:43 +0100 Subject: [PATCH] minor changes in datastorage --- Classes/Warehouse_class/classes/DataStorage.m | 22 +++++------ projects/Lab_2024/bias_sweep_evaluation.m | 38 +++++++++++++++++-- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Classes/Warehouse_class/classes/DataStorage.m b/Classes/Warehouse_class/classes/DataStorage.m index dd9eb4b..2702798 100644 --- a/Classes/Warehouse_class/classes/DataStorage.m +++ b/Classes/Warehouse_class/classes/DataStorage.m @@ -125,7 +125,7 @@ classdef DataStorage < handle lin_idx = obj.getIndicesByPhys(varargin); errcnt = 0; for i=1:numel(lin_idx) - try + % try tmp = obj.sto.(storageVarName){lin_idx(i)}; if ~isempty(tmp) if isa(tmp,'Signal') @@ -145,17 +145,17 @@ classdef DataStorage < handle end else errcnt = errcnt+1; - + value(i,:) = NaN ; if errcnt < 3 %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 - word = []; - for phys_idx = 1:numel(obj.fn) - parametername = obj.fn(phys_idx); - word = [word,char(parametername),': ', num2str(obj.parameter.(parametername).getPhysForIndex(sub{phys_idx})),' ;']; - end + % word = []; + % for phys_idx = 1:numel(obj.fn) + % parametername = obj.fn(phys_idx); + % word = [word,char(parametername),': ', num2str(obj.parameter.(parametername).getPhysForIndex(sub{phys_idx})),' ;']; + % end % warning(['Requested Data is not in Warehouse ', word]); elseif errcnt == 3 % warning(['... ', word]); @@ -166,9 +166,9 @@ classdef DataStorage < handle % warning([num2str(errcnt),' requested datapoint(s) not in warehouse.']); end - catch - error('Error in Datastorage: Something happened while looking up in warehouse.') - end + % catch + % error('Error in Datastorage: Something happened while looking up in warehouse.') + % end end else error('Wrong Request using ExampleWarehouse.getStoValue(*parameter set*). Give me all the Parameters! Please!') diff --git a/projects/Lab_2024/bias_sweep_evaluation.m b/projects/Lab_2024/bias_sweep_evaluation.m index 46ebf62..8ad9625 100644 --- a/projects/Lab_2024/bias_sweep_evaluation.m +++ b/projects/Lab_2024/bias_sweep_evaluation.m @@ -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); 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; awg_vpp_vals = wh2.parameter.awg_vpp.values; @@ -14,8 +15,8 @@ rop_measured = []; cnt = 0; for awg_vpp_cur = awg_vpp_vals cnt = cnt+1; - bers(cnt,:) = wh2.getStoValue('ber',v_bias_vals,awg_vpp_cur); - rop_measured(cnt,:) = wh2.getStoValue('rop',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,precomp_max); end [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' ]) + + +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(); sgtitle(['PAM ', num2str(m)]) subplot1 = subplot(1,2,1);