High Speed Auswertung und Database code

This commit is contained in:
sioe
2024-11-13 10:49:49 +01:00
parent ca769f2b3d
commit 553ed19b9f
20 changed files with 2931 additions and 66 deletions

View File

@@ -0,0 +1,85 @@
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
%1) Get path info from DB
filterParams = db.promptFilterParameters();
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', 300e9, ...
'db_mode', 0, ...
'fiber_length', 10, ...
'interference_attenuation', [], ...
'interference_path_length', [], ...
'is_mpi', 0, ...
'pam_level', 4, ...
'precomp_amp', [], ...
'rop_attenuation', 0, ...
'symbolrate', [], ...
'v_awg', [], ...
'v_bias', [], ...
'wavelength', 1310 ...
);
% filterParams.Equalizer.eq_id = 1;
% selectedFields = db.promptSelectFields();
selectedFields = {'Runs.run_id','Runs.tx_bits_path', 'Runs.tx_symbols_path', 'Runs.rx_sync_path','Runs.rx_raw_path','Configurations.db_mode'};
pathTable = db.getPathsWithFlexibleFilter(filterParams, selectedFields);
fprintf('Found %d entries for requested Configuration. IDs are: %s \n',size(pathTable,1),jsonencode(pathTable.run_id));
selectedBerFields = {'BERs.ber_id','BERs.run_id','BERs.eq_id'};
berresult = db.getPathsWithFlexibleFilter(filterParams, selectedBerFields);
%2) Process
for i = 1:size(pathTable,1)
tx_bits = load([basePath, char(pathTable.tx_bits_path(i))]);
tx_bits = tx_bits.Bits;
tx_symbols = load([basePath, char(pathTable.tx_symbols_path(i))]);
tx_symbols = tx_symbols.Symbols;
rx_sync = load([basePath, char(pathTable.rx_sync_path(i))]);
rx_sync = rx_sync.S;
%rx_raw = load([basePath, char(result.rx_raw_path(i))]);
%2.1) EQ
for o = 1:numel(rx_sync)
rx_sig = rx_sync{o};
switch pathTable.db_mode(i)
case 0
%normal signaling
eq_ = EQ("Ne",[50,7,7],"Nb",[0,0,0],"training_length",4096*2,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[0.0004 0.0004 0.0004 0.0004 ],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
eq_sig = vnle(eq_,rx_sig,tx_symbols);
case 1
%db targeting => less precompensation; pre-coded
case 2
%db signaling => db encoded
end
rx_bits = PAMmapper(4,0).demap(eq_sig);
[~,~,ber_vnle(o),~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
end
%2.2) Store BER to DB Table "BERs"
% structure = ""; % Description or Comment of BER technqiue
% settings = EQ;
%
% newBer = struct(...
% 'ber_id', NaN,...
% 'run_id', current_run_id,...
% 'processing_structure', structure,...
% 'processing_settings', settings,...
% 'ber', jsonencode(ber)...
% );
%
% db.appendToTable('BERs', newBer);
end
%3) Look at BER that just ran