Auswertung Experiment
Database tüddelei DBHanlder läuft gut für DIESE Datanbank struktur... App begonnen aber weit entfernt von gutem Stand
This commit is contained in:
85
projects/HighSpeedExperiment_2024/auswertung/analyzeDB.m
Normal file
85
projects/HighSpeedExperiment_2024/auswertung/analyzeDB.m
Normal file
@@ -0,0 +1,85 @@
|
||||
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
|
||||
useGui = 0;
|
||||
|
||||
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
|
||||
if useGui
|
||||
filterParams = db.promptFilterParameters();
|
||||
selectedFields = db.promptSelectFields();
|
||||
else
|
||||
filterParams = db.tables;
|
||||
filterParams.Configurations = struct( ...
|
||||
'bitrate', [], ...
|
||||
'db_mode', [], ...
|
||||
'fiber_length', 10, ...
|
||||
'interference_attenuation', [], ...
|
||||
'interference_path_length', [], ...
|
||||
'is_mpi', 0, ...
|
||||
'pam_level', [], ...
|
||||
'precomp_amp', [], ...
|
||||
'rop_attenuation', 0, ...
|
||||
'symbolrate', [], ...
|
||||
'v_awg', [], ...
|
||||
'v_bias', [], ...
|
||||
'wavelength', 1310 ...
|
||||
);
|
||||
filterParams.Equalizer.eq_type = equalizer_structure.vnle_pf_mlse;
|
||||
filterParams.Equalizer.eq_id = equalizer_structure.vnle;
|
||||
selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','Equalizer.eq_type','BERs.ber','BERs.occurrence',...
|
||||
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp',...
|
||||
'Measurements.power_rop','Measurements.power_laser','Measurements.power_pd_in'};
|
||||
end
|
||||
|
||||
|
||||
[dataTable,~] = db.queryDB(filterParams, selectedFields);
|
||||
|
||||
% Calculate the mean BER for each combination of 'run_id' and 'eq_type'
|
||||
groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, 'mean', {'ber', 'power_rop','power_pd_in'});
|
||||
|
||||
% Extract unique rows from dataTable for each run_id with relevant configuration details
|
||||
uniqueConfigFields = {'run_id', 'pam_level', 'bitrate','symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'};
|
||||
[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices
|
||||
configDetails = dataTable(uniqueIdx, uniqueConfigFields); % Extract unique configurations for each run_id
|
||||
|
||||
% Prepare the join key for both groupedData and configDetails
|
||||
groupedDataTable = table(groupedData.run_id, groupedData.eq_type, groupedData.GroupCount, groupedData.mean_ber,groupedData.mean_power_rop,groupedData.mean_power_pd_in, ...
|
||||
'VariableNames', {'run_id', 'eq_type', 'GroupCount', 'mean_ber','mean_power_rop','mean_power_pd_in'});
|
||||
|
||||
% Join groupedData with configDetails on the run_id field
|
||||
joinedData = join(groupedDataTable, configDetails, 'Keys', 'run_id');
|
||||
|
||||
|
||||
|
||||
|
||||
a=plot(fsym_vals.*1e-9.*log2(M_vals(modulation_iter)),ber_ffe(:,modulation_iter),...
|
||||
'Color',cols(modulation_iter,:),'MarkerSize',2,'LineWidth',1,...
|
||||
'Marker','o','MarkerFaceColor',cols(modulation_iter,:),'MarkerEdgeColor','black',...
|
||||
'DisplayName',['PAM ',num2str(M_vals(modulation_iter))]);
|
||||
|
||||
a.DataTipTemplate.DataTipRows(1).Label = 'Bitr';
|
||||
a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',' Gbps'];
|
||||
|
||||
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
|
||||
a.DataTipTemplate.DataTipRows(2).Format ='%.1e';
|
||||
|
||||
a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
|
||||
a.DataTipTemplate.DataTipRows(3).Value = rop(:,modulation_iter);
|
||||
a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm'];
|
||||
|
||||
a.DataTipTemplate.DataTipRows(4).Label = 'Baudr';
|
||||
a.DataTipTemplate.DataTipRows(4).Value = fsym_vals.*1e-9;
|
||||
a.DataTipTemplate.DataTipRows(4).Format = ['%.1f',' GBd'];
|
||||
|
||||
|
||||
a.DataTipTemplate.FontSize = 9;
|
||||
a.DataTipTemplate.FontName = 'arial';
|
||||
|
||||
% Continue with the rest of your plot settings
|
||||
title('Opt B2B')
|
||||
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
|
||||
xlabel('Bit Rate in GBps');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
set(gca, 'yscale', 'log');
|
||||
set(gca, 'Box', 'on');
|
||||
grid on;
|
||||
grid minor;
|
||||
legend('Interpreter', 'none');
|
||||
Reference in New Issue
Block a user