updates from lab pc during ecoc sprint
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
|
||||
local = 1;
|
||||
|
||||
if local
|
||||
databasePath = 'C:\Users\sioe\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
else
|
||||
databasePath = '\\ntserver.tf.uni-kiel.de\scratch\sioe\ECOC_2025\';
|
||||
end
|
||||
|
||||
basePath = 'C:\Users\sioe\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
database_name = 'ecoc2025_loops.db';
|
||||
database = DBHandler("pathToDB", [basePath, database_name]);
|
||||
database = DBHandler("pathToDB", [databasePath, database_name]);
|
||||
|
||||
figure();
|
||||
plotBoundaries = 1;
|
||||
plotRealizations = 1;
|
||||
cols = linspecer(3); % Ensure color count matches
|
||||
% cols = cols(8,:);
|
||||
|
||||
filterParams = database.tables;
|
||||
filterParams.Configurations = struct( ...
|
||||
@@ -10,7 +22,7 @@ filterParams.Configurations = struct( ...
|
||||
'fiber_length', 0, ...
|
||||
'db_mode', '"no_db"', ...
|
||||
'interference_attenuation', [], ...
|
||||
'interference_path_length', 50, ...
|
||||
'interference_path_length', 10, ...
|
||||
'is_mpi', 1, ...
|
||||
'pam_level', 4, ...
|
||||
'wavelength', 1310, ...
|
||||
@@ -23,8 +35,8 @@ filterParams.Configurations = struct( ...
|
||||
% filterParams.EqualizerParameters.diff_precode = int32(db_mode.db_encoded);
|
||||
% filterParams.EqualizerParameters.equalizer_structure = int32(equalizer_structure.vnle);
|
||||
|
||||
selectedFields = {'Configurations.run_id' 'Runs.date_of_run' 'Runs.rx_raw_path' 'Configurations.bitrate' 'Configurations.v_bias' 'Configurations.v_awg' 'Configurations.precomp_amp' 'Configurations.symbolrate' 'Configurations.pam_level'...
|
||||
'Configurations.db_mode' 'Configurations.rop_attenuation' 'Configurations.is_mpi' 'Configurations.interference_attenuation' 'Configurations.signal_attenuation' ...
|
||||
selectedFields = {'Configurations.run_id' 'Runs.loop_id' 'Runs.date_of_run' 'Runs.rx_raw_path' 'Configurations.bitrate' 'Configurations.v_bias' 'Configurations.v_awg' 'Configurations.precomp_amp' 'Configurations.symbolrate' 'Configurations.pam_level'...
|
||||
'Configurations.db_mode' 'Configurations.rop_attenuation' 'Configurations.is_mpi' 'Configurations.interference_attenuation' 'Configurations.interference_path_length' 'Configurations.signal_attenuation' ...
|
||||
'EqualizerParameters.equalizer_structure' 'EqualizerParameters.diff_precode' 'EqualizerParameters.eq_id' 'Measurements.power_pd_in' ...
|
||||
'Measurements.power_mpi_interference' 'Measurements.power_mpi_signal' 'Results.BER' 'Results.BER_precoded' 'Results.SNR' 'Results.GMI' 'Results.Alpha' 'Results.date_of_processing'};
|
||||
|
||||
@@ -32,14 +44,18 @@ selectedFields = {'Configurations.run_id' 'Runs.date_of_run' 'Runs.rx_raw_path'
|
||||
dataTable.SIR = round(-6 - dataTable.power_mpi_interference);
|
||||
dataTable = cleanUpTable(dataTable);
|
||||
|
||||
% Filter by time
|
||||
startTime = datetime('2025-04-12 18:00:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
stopTime = datetime('2025-04-13 19:30:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
dataTable.date_of_run = datetime(dataTable.date_of_run, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable.date_of_processing = datetime(dataTable.date_of_processing, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable = dataTable(dataTable.date_of_processing > startTime, :);
|
||||
dataTable = dataTable(dataTable.date_of_processing < stopTime, :);
|
||||
dataTable(dataTable.eq_id==0,:) = [];
|
||||
|
||||
% Filter by time
|
||||
filter_by_time = 0;
|
||||
if filter_by_time
|
||||
startTime = datetime('2025-04-14 13:00:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
stopTime = datetime('2025-04-14 19:30:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
dataTable.date_of_run = datetime(dataTable.date_of_run, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable.date_of_processing = datetime(dataTable.date_of_processing, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable = dataTable(dataTable.date_of_processing > startTime, :);
|
||||
dataTable = dataTable(dataTable.date_of_processing < stopTime, :);
|
||||
end
|
||||
% Group by smth
|
||||
y_var = 'BER';
|
||||
x_var = 'SIR';
|
||||
@@ -53,16 +69,14 @@ dataTableGrpd_mean = groupIt(fixedVars, dataTable, @mean);
|
||||
dataTableGrpd_min = groupIt(fixedVars, dataTable, @min);
|
||||
dataTableGrpd_max = groupIt(fixedVars, dataTable, @max);
|
||||
|
||||
plotRealizations = 1;
|
||||
|
||||
% Create a new figure
|
||||
mkr = '.';
|
||||
figure();
|
||||
hold on
|
||||
|
||||
unique_loop_var = unique(dataTable.(loop_var));
|
||||
cols = linspecer(numel(unique_loop_var)); % Ensure color count matches
|
||||
|
||||
for i = 1:2%1:numel(unique_loop_var)
|
||||
for i = 1%:numel(unique_loop_var)
|
||||
|
||||
% Prepare filtered data for this loop variable
|
||||
loopValue = unique_loop_var(i);
|
||||
@@ -86,31 +100,38 @@ for i = 1:2%1:numel(unique_loop_var)
|
||||
% Display name (optional)
|
||||
idx = find(dataTable.(loop_var) == loopValue, 1, 'first');
|
||||
dispname = equalizer_structure(dataTable.equalizer_structure(idx));
|
||||
dispname = [char(dispname),'; ',num2str(unique(dataTable.interference_path_length)),' m'];
|
||||
|
||||
% Plot bounded line
|
||||
[hl, hp] = boundedline(x_values, y_mean, y_bounds, ...
|
||||
'alpha', 'transparency', 0.2, ...
|
||||
'cmap', cols(i,:), ...
|
||||
'nan', 'fill', ...
|
||||
'orientation', 'vert');
|
||||
if plotBoundaries
|
||||
% Plot bounded line
|
||||
[hl, hp] = boundedline(x_values, y_mean, y_bounds, ...
|
||||
'alpha', 'transparency', 0.2, ...
|
||||
'cmap', cols(i,:), ...
|
||||
'nan', 'fill', ...
|
||||
'orientation', 'vert');
|
||||
|
||||
% Style the main line: thinnest, dotted, no marker
|
||||
set(hl, 'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none', ...
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
|
||||
% Hide patch (shaded area) from legend
|
||||
set(hp, 'HandleVisibility', 'off','LineStyle',':','LineWidth',0.5,'Marker','none');
|
||||
|
||||
% Add invisible scatter for DataTips
|
||||
plt = scatter(x_values, y_mean, ...
|
||||
'Marker', 'o', 'MarkerEdgeColor', 'none', 'MarkerFaceColor', 'none', ...
|
||||
'HandleVisibility', 'off', 'PickableParts', 'all');
|
||||
else
|
||||
plt= plot(x_values,y_mean,'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none', ...
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
end
|
||||
% Add data tips to the invisible scatter
|
||||
pair_one = {'Run ID', dataTableGrpd_mean.run_id(loopFiltGrpd, :)};
|
||||
pair_two = {'Rate', dataTableGrpd_mean.bitrate(loopFiltGrpd, :) * 1e-9};
|
||||
pair_three = {'PD in', round(dataTableGrpd_mean.power_pd_in(loopFiltGrpd, :), 2)};
|
||||
addDatatips(plt, pair_one, pair_two, pair_three);
|
||||
|
||||
% Style the main line: thinnest, dotted, no marker
|
||||
set(hl, 'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none', ...
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
|
||||
% Hide patch (shaded area) from legend
|
||||
set(hp, 'HandleVisibility', 'off','LineStyle',':','LineWidth',0.5,'Marker','none');
|
||||
|
||||
% Add invisible scatter for DataTips
|
||||
sc_fake = scatter(x_values, y_mean, ...
|
||||
'Marker', 'o', 'MarkerEdgeColor', 'none', 'MarkerFaceColor', 'none', ...
|
||||
'HandleVisibility', 'off', 'PickableParts', 'all');
|
||||
|
||||
% Add data tips to the invisible scatter
|
||||
pair_one = {'Run ID', dataTableGrpd_mean.run_id(loopFiltGrpd, :)};
|
||||
pair_two = {'Rate', dataTableGrpd_mean.bitrate(loopFiltGrpd, :) * 1e-9};
|
||||
pair_three = {'PD in', round(dataTableGrpd_mean.power_pd_in(loopFiltGrpd, :), 2)};
|
||||
addDatatips(sc_fake, pair_one, pair_two, pair_three);
|
||||
|
||||
|
||||
% Optionally: outline bounds for better visibility (optional)
|
||||
% hnew = outlinebounds(hl, hp);
|
||||
@@ -145,6 +166,8 @@ if y_var == 'BER'
|
||||
ylim([1e-5, 0.1]);
|
||||
end
|
||||
|
||||
xlim([15,50]);
|
||||
|
||||
% Enable grid and beautify
|
||||
grid on;
|
||||
beautifyBERplot;
|
||||
|
||||
Reference in New Issue
Block a user