Add new minimal example (+ a ton of other, not so important, changes)
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
%% ============================================================
|
||||
% 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);
|
||||
Reference in New Issue
Block a user