Files
imdd_silas/projects/HighSpeedExperiment_2024/Auswertung_JLT/final/FIGURE_WAVELENGTH.m
2025-12-15 15:41:02 +01:00

124 lines
3.4 KiB
Matlab
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%% ============================================================
% LOAD DATA
% ============================================================
database_type = 'mysql';
db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
M = 4; % PAM level for this analysis
fp = QueryFilter();
fp.where('Runs', 'pam_level', 'EQUALS', M);
fp.where('Runs', 'fiber_length', 'EQUALS', 10);
fp.where('Runs', 'bitrate', 'EQUALS', 360e9);
fp.where('Runs', 'is_mpi', 'EQUALS', 0);
fields = [
db.getTableFieldNames('power_state_info');
db.getTableFieldNames('dashboard_ungrouped_alltime')
];
[dataTable, ~] = db.queryDB(fp, fields);
%% ============================================================
% COMMON CONFIGURATION FOR ALL SUBPLOTS
% ============================================================
%% ============================================================
% DEFINE DSP ALGORITHMS FOR THE 4 SUBPLOTS
% ============================================================
curves = struct;
curves(1).name = 'VNLE';
curves(1).eq = equalizer_structure.vnle;
curves(1).pre = 0;
curves(1).color = clr.Paired.red;
curves(2).name = 'PF + MLSE';
curves(2).eq = equalizer_structure.vnle_pf_mlse;
curves(2).pre = 0;
curves(2).color = clr.Paired.green;
curves(3).name = 'DB-target + MLSE';
curves(3).eq = equalizer_structure.vnle_db_mlse;
curves(3).pre = 0;
curves(3).color = clr.Paired.blue;
curves(4).name = 'ML-based MLSE';
curves(4).eq = equalizer_structure.ml_mlse;
if M == 4
curves(4).pre = 0;
else
curves(4).pre = 1;
end
curves(4).color = clr.Paired.purple;
%% ============================================================
% ANALYSIS ENGINE — NO PLOTTING
% ============================================================
results = struct;
for k = 1:numel(curves)
%% ---- BASE CONFIG ----
cfg = struct;
cfg.x_axis = 'wavelength';
cfg.y_axis = 'BER';
cfg.agg = 'min';
cfg.outlier = 'none';
% cfg.group_by = {'wavelength'};
cfg.show_raw = false;
cfg.filters = struct( ...
'pam_level', M, ...
'is_mpi', 0, ...
'bitrate', 360e9, ...
'fiber_length', 10, ...
'equalizer_structure', curves(k).eq, ...
'pre_emph', curves(k).pre);
%% ---- GET BER ----
cfg.y_axis = 'BER';
A = analyze_measurements_gpt(dataTable, cfg);
results(k).wavelength = A.group{1}.x;
if curves(k).eq == equalizer_structure.vnle_db_mlse || ...
curves(k).eq == equalizer_structure.ml_mlse
% DB and ML-based need precoded BER
results(k).ber = A.group{1}.y_precoded;
else
results(k).ber = A.group{1}.y;
end
end
%% ============================================================
% 1×4 TILED BER-vs-WAVELENGTH FIGURE
% ============================================================
fig=figure(901);
tiledlayout(1,4,'TileSpacing','compact','Padding','compact');
lw = 1.8; % line width
ms = 6; % marker size
for k = 1:numel(curves)
nexttile; hold on;
plot(results(k).wavelength, results(k).ber, ...
'-o', ...
'Color', curves(k).color, ...
'MarkerFaceColor', curves(k).color, ...
'MarkerSize', ms, ...
'LineWidth', lw);
set(gca,'YScale','log');
grid on;
xlabel('wavelength');
ylabel('BER');
title(curves(k).name);
ylim([1e-4, 0.1])
beautifyBERplot();
end
pos = 1e3.*[0.1070 0.5497 1.4113 0.3253];
set(fig, 'Position', pos);