222 lines
6.2 KiB
Matlab
222 lines
6.2 KiB
Matlab
%% ============================================================
|
||
% GRID: NGMI, AIR, HD-NetRate, SD-NetRate (1 × 4)
|
||
% ============================================================
|
||
|
||
db = DBHandler("dataBase","labor_highspeed","type","mysql");
|
||
|
||
%% --- Base DB Filters (shared across all curves)
|
||
fp = QueryFilter();
|
||
fp.where('Runs','fiber_length','EQUALS', 2);
|
||
fp.where('Runs','wavelength','EQUALS', 1310);
|
||
fp.where('Runs','rop_attenuation','EQUALS', 0);
|
||
fp.where('Runs','is_mpi','EQUALS', 0);
|
||
|
||
fields = db.getTableFieldNames('dashboard_ungrouped_alltime');
|
||
[dataTable,~] = db.queryDB(fp, fields);
|
||
|
||
|
||
%% === Curve Definitions =======================================
|
||
curves = struct;
|
||
|
||
% PAM-8 — VNLE PF MLSE — no_emph = 1 — RED
|
||
curves(1).pam = 8;
|
||
curves(1).eq = equalizer_structure.vnle_pf_mlse;
|
||
curves(1).pre = 0;
|
||
curves(1).color = clr.Paired.red;
|
||
curves(1).mkr = 'o';
|
||
|
||
% PAM-6 — VNLE PF MLSE — no_emph = 1 — BLUE
|
||
curves(2).pam = 6;
|
||
curves(2).eq = equalizer_structure.vnle_pf_mlse;
|
||
curves(2).pre = 1;
|
||
curves(2).color = clr.Paired.blue;
|
||
curves(2).mkr = 'square';
|
||
|
||
% PAM-4 — VNLE DB MLSE — pre_emph = 0 — GREEN
|
||
curves(3).pam = 4;
|
||
curves(3).eq = equalizer_structure.vnle_db_mlse;
|
||
curves(3).pre = 0;
|
||
curves(3).color = clr.Paired.green;
|
||
curves(3).mkr = 'diamond';
|
||
|
||
%% === Prepare Analysis Config ==================================
|
||
base = struct;
|
||
base.group_by = {'equalizer_structure','pre_emph'};
|
||
base.x_axis = 'symbolrate';
|
||
base.outlier = 'none';
|
||
base.show_raw = false;
|
||
base.filters = struct; % will be filled per curve
|
||
|
||
|
||
%% === Precompute All Curves ====================================
|
||
results = struct;
|
||
|
||
for k = 1:numel(curves)
|
||
|
||
% --- BER ---
|
||
cfg = base;
|
||
cfg.y_axis = 'BER';
|
||
cfg.agg = 'min';
|
||
cfg.filters = struct('pam_level', curves(k).pam, ...
|
||
'equalizer_structure', curves(k).eq, ...
|
||
'pre_emph', curves(k).pre);
|
||
|
||
A = analyze_measurements_gpt(dataTable, cfg);
|
||
cfg.x_axis = 'grossrate';
|
||
B = analyze_measurements_gpt(dataTable, cfg);
|
||
|
||
results(k).baudr = A.group{1}.x;
|
||
results(k).gross = B.group{1}.x;
|
||
|
||
if curves(k).pam == 4
|
||
results(k).ber = A.group{1}.y_precoded;
|
||
else
|
||
results(k).ber = A.group{1}.y;
|
||
end
|
||
|
||
% --- NGMI ---
|
||
cfg.y_axis = 'NGMI';
|
||
cfg.agg = 'max';
|
||
A = analyze_measurements_gpt(dataTable, cfg);
|
||
results(k).ngmi = A.group{1}.y;
|
||
|
||
|
||
|
||
% --- AIR ---
|
||
cfg.y_axis = 'AIR';
|
||
cfg.agg = 'max';
|
||
A = analyze_measurements_gpt(dataTable, cfg);
|
||
results(k).air = A.group{1}.y;
|
||
results(k).air = results(k).ngmi .* results(k).gross;
|
||
|
||
% --- Net Rates ---
|
||
tp = TransmissionPerformance;
|
||
results(k).ndr = tp.calculateNetRate(results(k).gross, ...
|
||
'NGMI', results(k).ngmi, ...
|
||
'BER', results(k).ber);
|
||
end
|
||
|
||
|
||
%% ============================================================
|
||
% FIGURE: 1 × 4 GRID
|
||
% ============================================================
|
||
fig = figure(71); clf;
|
||
t = tiledlayout(1,4, 'TileSpacing','compact', 'Padding','compact');
|
||
|
||
lw = 1.0;
|
||
|
||
% === NGMI vs Grossrate ===
|
||
ax = nexttile(t,1);
|
||
hold on;
|
||
for k = 1:3
|
||
plot(results(k).baudr, results(k).ngmi, ...
|
||
'LineWidth', lw, ...
|
||
'Color', curves(k).color, ...
|
||
'MarkerSize', 1, ...
|
||
'MarkerFaceColor', curves(k).color,...
|
||
'Marker',curves(k).mkr);
|
||
end
|
||
ylabel('NGMI');
|
||
xlabel('Baud rate [GBd]');
|
||
xlim([100 210]);
|
||
xticks(100:15:225);
|
||
ylim([0.9, 1]);
|
||
grid minor; box on;
|
||
beautifyBERplot("logscale",0,"setmarkers",0);
|
||
|
||
|
||
% === AIR vs Grossrate ===
|
||
ax = nexttile(t,2);
|
||
hold on;
|
||
for k = 1:3
|
||
plot(results(k).baudr, results(k).air, ...
|
||
'-', 'LineWidth', lw, ...
|
||
'Color', curves(k).color, ...
|
||
'MarkerSize', 2, ...
|
||
'MarkerFaceColor', curves(k).color,'Marker',curves(k).mkr);
|
||
end
|
||
ylabel('AIR [Gb/s]');
|
||
xlabel('Baud rate [GBd]');
|
||
ylim([280 430]);
|
||
yticks(280:30:440)
|
||
xlim([100 210]);
|
||
xticks(100:15:225);
|
||
grid minor; box on;
|
||
beautifyBERplot("logscale",0,"setmarkers",0);
|
||
yline(400,'LineStyle','--');
|
||
|
||
% === SD-FEC Net Rate ===
|
||
ax = nexttile(t,3);
|
||
hold on;
|
||
for k = 1:3
|
||
plot(results(k).baudr, results(k).ndr.SDHD.NetRate, ...
|
||
'LineWidth', lw, ...
|
||
'Color', curves(k).color, ...
|
||
'MarkerSize', 2, ...
|
||
'MarkerFaceColor', curves(k).color,...
|
||
'Marker',curves(k).mkr);
|
||
end
|
||
ylabel('NDR [Gb/s]');
|
||
xlabel('Baud rate [GBd]');
|
||
ylim([280 430]);
|
||
yticks(280:30:440)
|
||
xlim([100 210]);
|
||
xticks(100:15:225);
|
||
grid minor; box on;
|
||
beautifyBERplot("logscale",0,"setmarkers",0);
|
||
yline(400,'LineStyle','--');
|
||
|
||
% === HD-FEC Net Rate ===
|
||
ax = nexttile(t,4);
|
||
hold on;
|
||
for k = 1:3
|
||
% plot(results(k).baudr, results(k).ndr.STAIR.NetRate, ...
|
||
% '-', 'LineWidth', lw, ...
|
||
% 'Color', curves(k).color, ...
|
||
% 'MarkerSize', 4,'Marker','+', ...
|
||
% 'MarkerFaceColor', curves(k).color);
|
||
|
||
plot(results(k).baudr, results(k).ndr.O_FEC.NetRate, ...
|
||
':', 'LineWidth', lw, ...
|
||
'Color', curves(k).color, ...
|
||
'MarkerSize', 2,...
|
||
'MarkerFaceColor', curves(k).color,...
|
||
'Marker',curves(k).mkr);
|
||
|
||
plot(results(k).baudr, results(k).ndr.KP4_hamming.NetRate, ...
|
||
'--', 'LineWidth', lw, ...
|
||
'Color', curves(k).color, ...
|
||
'MarkerSize', 2,'Marker','diamond', ...
|
||
'MarkerFaceColor', curves(k).color,...
|
||
'Marker',curves(k).mkr);
|
||
end
|
||
|
||
yline(400,'LineStyle','--');
|
||
ylabel('');
|
||
xlabel('Baud rate [GBd]');
|
||
ylim([280 430]);
|
||
yticks(280:30:440)
|
||
xlim([100 210]);
|
||
xticks(100:15:225);
|
||
grid minor; box on;
|
||
beautifyBERplot("logscale",0,"setmarkers",0);
|
||
|
||
% === FINAL FIGURE SIZE ===
|
||
pos = 1e3.*[0.7950 1.1150 1.4113 0.1900];
|
||
set(fig, 'Position', pos);
|
||
|
||
% % % %% === EXPORT ===
|
||
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\compare_ndr_v3.tikz';
|
||
matlab2tikz(outfile, ...
|
||
'width','\fwidth', ...
|
||
'height','\fheight', ...
|
||
'showInfo',false, ...
|
||
'extraAxisOptions',{ ...
|
||
'legend style={font=\footnotesize}', ...
|
||
'legend columns=1' ...
|
||
'every axis/.append style={font=\scriptsize}',...
|
||
'minor grid style={line width=0.2pt, solid, color=black!10}',...
|
||
'grid style={line width=0.4pt, solid, color=black!20}',...
|
||
'grid style={dashed}',...
|
||
});
|