Stuff during JLT writing...

This commit is contained in:
Silas Oettinghaus
2025-11-21 15:37:58 +01:00
parent 888cbbd23e
commit 75dddca1f2
25 changed files with 946 additions and 189 deletions

View File

@@ -5,7 +5,7 @@ db = DBHandler("dataBase", [dataBase], "type", database_type);
fp = QueryFilter();
% fp.where('Runs', 'run_id','EQUALS', 987);
M = 4;
M = 6;
fp.where('Runs', 'pam_level','EQUALS', M);
% fp.where('Runs', 'bitrate','LESS_THAN', 310e9);
fp.where('Runs', 'fiber_length','EQUALS', 2);
@@ -18,7 +18,7 @@ fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fields = db.getTableFieldNames('power_state_info');
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_new')];
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_aug_nov_2025')];
[dataTable,~] = db.queryDB(fp, fields);
eqstructures = unique(dataTable.equalizer_structure);
@@ -29,7 +29,7 @@ show_bitrate = true;
figure(5);
hold on
for eqs = [equalizer_structure.vnle, equalizer_structure.vnle_pf_mlse]
for eqs = [equalizer_structure.vnle]
% figure('Name',string([char(eqs),'']));
% hold on
@@ -148,13 +148,14 @@ for eqs = [equalizer_structure.vnle, equalizer_structure.vnle_pf_mlse]
xticks(xraw);
if show_bitrate
xticks(200:25:500);
xlim([350 500]);
% xticks(200:25:500);
% xlim([350 500]);
xlim([min(xraw), max(xraw)]);
else
xlim([min(xraw), max(xraw)]);
end
ylim([5e-4, 0.3]);
ylim([1e-4, 0.5]);
end
yline([2.2e-4, 4.85e-3, 2e-2],'LineWidth',1,'LineStyle','--','HandleVisibility','off');

View File

@@ -17,7 +17,7 @@ fp.where('Runs', 'wavelength','EQUALS', 1310);
% fp.where('Runs', 'db_mode','EQUALS', 1);
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
[dataTable,~] = db.queryDB(fp, db.getTableFieldNames('dashboard'));
[dataTable,~] = db.queryDB(fp, db.getTableFieldNames('dashboard_ungrouped_after_nov_2025'));
eqstructures = unique(dataTable.equalizer_structure);

View File

@@ -0,0 +1,223 @@
database_type = 'mysql';
dataBase = 'labor_highspeed';
db = DBHandler("dataBase", [dataBase], "type", database_type);
% M = 4;
fp = QueryFilter();
% fp.where('Runs', 'pam_level','EQUALS', M);
fp.where('Runs', 'fiber_length','EQUALS', 2);
fp.where('Runs', 'wavelength','LESS_THAN', 1312);
% fp.where('Runs', 'db_mode','EQUALS', 1); % 0 == high preemphasis // 1 == low preemphasis
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fields = db.getTableFieldNames('power_state_info');
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_alltime')]; %dashboard_ungrouped_after_nov_2025 dashboard_ungrouped_aug_nov_2025
[dataTable,~] = db.queryDB(fp, fields);
%%
cfg = struct;
cfg.x_axis = 'grossrate'; % 'symbol rate' | 'bitrate' | 'wavelength' grossrate
cfg.y_axis = 'BER'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.y_scale = 'auto'; % auto -> log for BER*, linear otherwise
cfg.outlier = 'mad'; % simple, robust; 'none' or 'pctl' also available
cfg.show_raw = false;
cfg.show_spread = 'none'; % 'none' or 'iqr' or minmax
cfg.agg = 'min'; % or 'median'
cfg.show_precoded = 0;
% cfg.fec_lines = [2.2e-4 4.85e-3 2e-2]; % optional
cfg.fec_lines = [];
cfg.plot.custom_colors = [
clr.Paired.red;
clr.Paired.blue;
clr.Paired.green;
clr.Paired.orange;
clr.Paired.purple
];
cfg.plot.custom_colors_scatter = [
clr.Paired.lightred;
clr.Paired.lightblue;
clr.Paired.lightgreen;
clr.Paired.lightorange;
clr.Paired.lightpurple
];
% New styling knobs
cfg.plot.use_cbrewer2 = true;
cfg.plot.colormap = 'Paired';
cfg.plot.paired_dark_first = false; % dark for lines, light for scatter
cfg.plot.lineWidth = 2.0;
cfg.plot.errWidth = 1.2;
cfg.plot.scatterAlpha = 0.35;
cfg.plot.legendLocation = 'best';
cfg.plot.fecLineWidth = 2.4; % thicker FEC limits
cfg.plot.lineStyle_pre_emph_on = '-';
cfg.plot.lineStyle_pre_emph_off = '-';
%% PLOT NGMI
% Common cfg
cfg.show_precoded = 1;
cfg.group_by = {'equalizer_structure','pre_emph'};
cfg.x_axis = 'grossrate';
cfg.y_axis = 'NGMI'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.y_scale = 'lin';
cfg.plot.custom_colors_scatter = [];
cfg.plot.use_cbrewer2 = false;
cfg.fec_lines = [];
cfg.agg = 'max';
cfg.figure_number = 45;
% fig = figure(cfg.figure_number);
lambda = 1310;
% PAM 4
cfg.plot.custom_colors = clr.Paired.red;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',4, ...
'equalizer_structure',equalizer_structure.vnle_db_mlse, ...
'pre_emph',0,'wavelength',lambda);
cfg.show_precoded = 1;
a = plot_measurements_gpt(dataTable, cfg);
ngmi_pam4 = a.lines(1).YData;
tp = TransmissionPerformance;
netrates_vnle = tp.calculateNetRate(baudrate.* m, ...
'NGMI', ngmi_pam4, ...
'BER', BER_VNLE);
cfg.plot.custom_colors = clr.Paired.red;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',4, ...
'equalizer_structure',equalizer_structure.vnle_db_mlse, ...
'pre_emph',0,'wavelength',1293);
cfg.show_precoded = 1;
plot_measurements_gpt(dataTable, cfg);
% PAM 6
cfg.plot.custom_colors = clr.Paired.blue;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',6, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',lambda);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
cfg.plot.custom_colors = clr.Paired.blue;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',6, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',1293);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
% PAM 8
cfg.plot.custom_colors = clr.Paired.green;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',8, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',lambda);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
cfg.plot.custom_colors = clr.Paired.green;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',8, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',1293);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
beautifyBERplot
ylim([0.87,1.01]);
% xlim([290,480]);
%% PLOT AIR
% Common cfg
cfg.show_precoded = 1;
cfg.group_by = {'equalizer_structure','pre_emph'};
cfg.x_axis = 'grossrate';
cfg.y_axis = 'AIR'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.y_scale = 'lin';
cfg.plot.custom_colors_scatter = [];
cfg.plot.use_cbrewer2 = false;
cfg.fec_lines = [];
cfg.agg = 'max';
cfg.figure_number = 47;
% fig = figure(cfg.figure_number);
lambda = 1310;
% PAM 4
cfg.plot.custom_colors = clr.Paired.red;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',4, ...
'equalizer_structure',equalizer_structure.vnle_db_mlse, ...
'pre_emph',0,'wavelength',lambda);
cfg.show_precoded = 1;
plot_measurements_gpt(dataTable, cfg);
cfg.plot.custom_colors = clr.Paired.red;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',4, ...
'equalizer_structure',equalizer_structure.vnle_db_mlse, ...
'pre_emph',0,'wavelength',1293);
cfg.show_precoded = 1;
plot_measurements_gpt(dataTable, cfg);
% PAM 6
cfg.plot.custom_colors = clr.Paired.blue;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',6, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',lambda);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
cfg.plot.custom_colors = clr.Paired.blue;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',6, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',1293);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
% PAM 8
cfg.plot.custom_colors = clr.Paired.green;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',8, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',lambda);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
cfg.plot.custom_colors = clr.Paired.green;
cfg.plot.custom_linetypes = {'--'};
cfg.filters = struct('is_mpi',0,'pam_level',8, ...
'equalizer_structure',equalizer_structure.vnle_pf_mlse, ...
'pre_emph',1,'wavelength',1293);
cfg.show_precoded = 0;
plot_measurements_gpt(dataTable, cfg);
ax = gca;
beautifyBERplot
ylim([275,435]);
xlim([290,480]);
%%

View File

@@ -0,0 +1,170 @@
database_type = 'mysql';
dataBase = 'labor_highspeed';
db = DBHandler("dataBase", [dataBase], "type", database_type);
% M = 4;
fp = QueryFilter();
% fp.where('Runs', 'pam_level','EQUALS', M);
fp.where('Runs', 'fiber_length','EQUALS', 2);
fp.where('Runs', 'wavelength','EQUALS', 1310);
% fp.where('Runs', 'db_mode','EQUALS', 1); % 0 == high preemphasis // 1 == low preemphasis
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fields = db.getTableFieldNames('power_state_info');
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_alltime')]; %dashboard_ungrouped_after_nov_2025 dashboard_ungrouped_aug_nov_2025
[dataTable,~] = db.queryDB(fp, fields);
%%
cfg = struct;
cfg.x_axis = 'grossrate'; % 'symbol rate' | 'bitrate' | 'wavelength' grossrate
cfg.y_axis = 'BER'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.y_scale = 'auto'; % auto -> log for BER*, linear otherwise
cfg.outlier = 'mad'; % simple, robust; 'none' or 'pctl' also available
cfg.show_raw = false;
cfg.show_spread = 'none'; % 'none' or 'iqr' or minmax
cfg.agg = 'min'; % or 'median'
cfg.show_precoded = 0;
% cfg.fec_lines = [2.2e-4 4.85e-3 2e-2]; % optional
cfg.fec_lines = [];
cfg.plot.custom_colors = [
clr.Paired.red;
clr.Paired.blue;
clr.Paired.green;
clr.Paired.orange;
clr.Paired.purple
];
cfg.plot.custom_colors_scatter = [
clr.Paired.lightred;
clr.Paired.lightblue;
clr.Paired.lightgreen;
clr.Paired.lightorange;
clr.Paired.lightpurple
];
% New styling knobs
cfg.plot.use_cbrewer2 = true;
cfg.plot.colormap = 'Paired';
cfg.plot.paired_dark_first = false; % dark for lines, light for scatter
cfg.plot.lineWidth = 2.0;
cfg.plot.errWidth = 1.2;
cfg.plot.scatterAlpha = 0.35;
cfg.plot.legendLocation = 'best';
cfg.plot.fecLineWidth = 2.4; % thicker FEC limits
cfg.plot.lineStyle_pre_emph_on = '-';
cfg.plot.lineStyle_pre_emph_off = '-';
%% Grid configuration
rows = 3; % PAM 4,6,8
cols = 4; % DSP schemes
pam = [4 6 8];
cfg.figure_number = 46;
fig = figure(cfg.figure_number); clf;
% Create extremely compact tile layout
t = tiledlayout(rows, cols, ...
'TileSpacing','compact', ...
'Padding','compact');
% Common cfg
cfg.show_precoded = 1;
cfg.group_by = {'equalizer_structure','pre_emph'};
cfg.x_axis = 'grossrate';
cfg.y_axis = 'BER';
cfg.y_scale = 'log';
cfg.plot.custom_colors_scatter = [];
cfg.plot.use_cbrewer2 = false;
cfg.fec_lines = [];
% DSP scheme definitions ---------------------------------------------
DSP(1).name = 'vnle';
DSP(1).eq = equalizer_structure.vnle;
DSP(1).color = clr.Paired.red;
DSP(1).lightcolor = clr.Paired.lightred;
DSP(2).name = 'VNLE PF MLSE';
DSP(2).eq = equalizer_structure.vnle_pf_mlse;
DSP(2).color = clr.Paired.green;
DSP(2).lightcolor = clr.Paired.lightgreen;
DSP(3).name = 'VNLE DB MLSE';
DSP(3).eq = equalizer_structure.vnle_db_mlse;
DSP(3).color = clr.Paired.blue;
DSP(3).lightcolor = clr.Paired.lightblue;
DSP(4).name = 'ML MLSE';
DSP(4).eq = equalizer_structure.ml_mlse;
DSP(4).color = clr.Paired.purple;
DSP(4).lightcolor = clr.Paired.lightpurple;
% === Main nested loop: rows = PAM format, columns = DSP scheme ===
for r = 1:rows
M = pam(r);
for c = 1:cols
ax = nexttile(t, (r-1)*cols + c);
cfg.ax = ax;
% ---- pre-emph = 1 (solid) ----
cfg.plot.custom_colors = DSP(c).lightcolor;
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',M, ...
'equalizer_structure',DSP(c).eq, ...
'pre_emph',1);
plot_measurements_gpt(dataTable, cfg);
% ---- pre-emph = 0 (dashed) ----
cfg.plot.custom_colors = DSP(c).color;
cfg.plot.custom_linetypes = {'-'};
cfg.filters.pre_emph = 0;
plot_measurements_gpt(dataTable, cfg);
if M == 4
ylim([1e-5 0.2]);
else
ylim([6e-4 0.2]);
end
% % FEC limits
yline([2.2e-4 4.85e-3 2e-2],'LineWidth',1.1,'Color',[0.2 0.2 0.2], ...
'LineStyle',':','HandleVisibility','off');
% Axes prettification
beautifyBERplot;
% ===== Remove redundant labels =====
if c > 1
ax.YLabel = [];
end
if r < rows
ax.XLabel = [];
end
grid(ax,'on'); box(ax,'on');
end
end
%this is just a ranom size but fits and is fixed now!
pos = 1e3.*[0.0983 0.6110 1.4113 0.4733];
set(fig, 'Position', pos)
%% === EXPORT TO TIKZ ===
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\compare_pre_emphasis.tikz';
matlab2tikz(outfile, ...
'width','\fwidth', ...
'height','\fheight', ...
'showInfo',false, ...
'extraAxisOptions',{ ...
'legend style={font=\footnotesize}', ...
'legend columns=1' ...
} );

View File

@@ -0,0 +1,112 @@
database_type = 'mysql';
dataBase = 'labor_highspeed';
db = DBHandler("dataBase", [dataBase], "type", database_type);
M = 4;
fp = QueryFilter();
fp.where('Runs', 'pam_level','EQUALS', M);
fp.where('Runs', 'fiber_length','EQUALS', 2);
fp.where('Runs', 'wavelength','EQUALS', 1310);
% fp.where('Runs', 'db_mode','EQUALS', 1); % 0 == high preemphasis // 1 == low preemphasis
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fields = db.getTableFieldNames('power_state_info');
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_aug_nov_2025')]; %dashboard_ungrouped_after_nov_2025 dashboard_ungrouped_aug_nov_2025
[dataTable,~] = db.queryDB(fp, fields);
%%
cfg = struct;
cfg.x_axis = 'grossrate'; % 'symbol rate' | 'bitrate' | 'wavelength' grossrate
cfg.y_axis = 'BER'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.y_scale = 'auto'; % auto -> log for BER*, linear otherwise
cfg.outlier = 'mad'; % simple, robust; 'none' or 'pctl' also available
cfg.show_raw = false;
cfg.show_spread = 'none'; % 'none' or 'iqr' or minmax
cfg.agg = 'min'; % or 'median'
cfg.show_precoded = 0;
% cfg.fec_lines = [2.2e-4 4.85e-3 2e-2]; % optional
cfg.fec_lines = [];
cfg.plot.custom_colors = [
clr.Paired.red;
clr.Paired.blue;
clr.Paired.green;
clr.Paired.orange;
clr.Paired.purple
];
cfg.plot.custom_colors_scatter = [
clr.Paired.lightred;
clr.Paired.lightblue;
clr.Paired.lightgreen;
clr.Paired.lightorange;
clr.Paired.lightpurple
];
% New styling knobs
cfg.plot.use_cbrewer2 = true;
cfg.plot.colormap = 'Paired';
cfg.plot.paired_dark_first = false; % dark for lines, light for scatter
cfg.plot.lineWidth = 2.0;
cfg.plot.errWidth = 1.2;
cfg.plot.scatterAlpha = 0.35;
cfg.plot.legendLocation = 'best';
cfg.plot.fecLineWidth = 2.4; % thicker FEC limits
cfg.plot.lineStyle_pre_emph_on = '-';
cfg.plot.lineStyle_pre_emph_off = '-';
%%
cfg.figure_number = 42;
% ---- VNLE, no pre-emph (solid red) ----
cfg.plot.custom_colors = [clr.Paired.red];
cfg.plot.custom_linetypes = {'-'};
cfg.filters = struct('is_mpi',0,'pam_level',M, ...
'equalizer_structure',equalizer_structure.vnle, ...
'pre_emph',0);
plot_measurements_gpt(dataTable, cfg);
% ---- VNLE, with pre-emph (dashed red) ----
cfg.plot.custom_colors = [clr.Paired.red];
cfg.plot.custom_linetypes = {'--'};
cfg.filters.pre_emph = 1;
plot_measurements_gpt(dataTable, cfg);
% ---- VNLE PF MLSE, no pre-emph (solid green) ----
cfg.plot.custom_colors = [clr.Paired.green];
cfg.plot.custom_linetypes = {'-'};
cfg.filters.equalizer_structure = equalizer_structure.vnle_pf_mlse;
cfg.filters.pre_emph = 0;
plot_measurements_gpt(dataTable, cfg);
% ---- VNLE PF MLSE, with pre-emph (dashed green) ----
cfg.plot.custom_colors = [clr.Paired.green];
cfg.plot.custom_linetypes = {'--'};
cfg.filters.pre_emph = 1;
plot_measurements_gpt(dataTable, cfg);
% === FEC LINES (no legend) ===
yline([2.2e-4 4.85e-3 2e-2], ...
'LineWidth',1.5,'Color',[0.4 0.4 0.4], ...
'LineStyle',':','HandleVisibility','off');
% === BEAUTIFY ===
% beautifyBERplot; % your function
%% === EXPORT TO TIKZ ===
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\compare_pre_emphasis.tikz';
matlab2tikz(outfile, ...
'width','\fwidth', ...
'height','\fheight', ...
'showInfo',false, ...
'extraAxisOptions',{ ...
'legend style={font=\footnotesize}', ...
'legend columns=1' ...
} );

View File

@@ -0,0 +1,100 @@
dsp_options.storage_path = 'Z:\2024\sioe_labor\';
dsp_options.max_occurences = 1;
database = DBHandler("dataBase", 'labor_highspeed', "type", 'mysql' );
rate = 390e9;
%% 1 - PAM 4 with preemphasis
fp = QueryFilter();
M = 4;
fp.where('Runs', 'pam_level','EQUALS', M);
fp.where('Runs', 'bitrate','EQUALS', rate);%360,390
fp.where('Runs', 'fiber_length','EQUALS', 2);
fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'db_mode','EQUALS', 0);
fp.where('Runs', 'rop_attenuation','EQUAL', 0);
[dataTable,~] = db.queryDB(fp, database.getTableFieldNames('Runs'));
dataTable = queryRunid(dataTable.run_id, database);
fsym = dataTable.symbolrate;
M = double(dataTable.pam_level);
% Load and Sync signal data from DB
[Tx_bits, Symbols, Scpe_cell, ~] = loadAndSyncSignalDataFromDb(dataTable, dsp_options);
% Preprocess signal
Scpe_sig = preprocessSignal(Scpe_cell{1}, Symbols, fsym);
if rate == 390e9
Scpe_sig.spectrum("fignum",200,"normalizeTo0dB",1,"displayname",'Rx','addDCoffset',-5.8);
elseif rate == 300e9
Scpe_sig.spectrum("fignum",200,"normalizeTo0dB",1,"displayname",'Rx','addDCoffset',-4.7);
end
ylim([-30,3]);
xlim([-5,100]);
Scpe_sig.spectrum("fignum",201,"normalizeTo0dB",0,"displayname",'Rx');
%% 1 - PAM 4 without preemphasis
fp = QueryFilter();
M = 4;
fp.where('Runs', 'pam_level','EQUALS', M);
fp.where('Runs', 'bitrate','EQUALS', rate);%360,390
fp.where('Runs', 'fiber_length','EQUALS', 2);
fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'db_mode','EQUALS', 1);
fp.where('Runs', 'rop_attenuation','EQUAL', 0);
[dataTable,~] = db.queryDB(fp, database.getTableFieldNames('Runs'));
dataTable = queryRunid(dataTable.run_id, database);
fsym = dataTable.symbolrate;
M = double(dataTable.pam_level);
% Load and Sync signal data from DB
[Tx_bits, Symbols, Scpe_cell, ~] = loadAndSyncSignalDataFromDb(dataTable, dsp_options);
% Preprocess signal
Scpe_sig = preprocessSignal(Scpe_cell{1}, Symbols, fsym);
Scpe_sig.spectrum("fignum",200,"normalizeTo0dB",1,"displayname",'Rx','addDCoffset',0);
ylim([-30,3]);
xlim([-5,100]);
Scpe_sig.spectrum("fignum",201,"normalizeTo0dB",0,"displayname",'Rx');
if 0
%% show freuqncy response of filter
measure = 1;
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",70,"f_ref",256e9);
%
Digi_sig = freqresp.buildOFDM();
Digi_sig.spectrum("fignum",1112,"displayname",['maxamp:',num2str(maxamp)]);
Digi_sig = Filter('filtdegree',3,"f_cutoff",70e9,"fs",256e9,"filterType",filtertypes.butterworth,"active",true).process(Digi_sig);
Digi_sig = Filter('filtdegree',3,"f_cutoff",70e9,"fs",256e9,"filterType",filtertypes.bessel_inp,"active",true).process(Digi_sig);
freqresp.estimate(Digi_sig,"fileName",'','save',false);
freqresp.plot()
a = gca;
a.YTick = [-30,-20,-10,0];
%% system frex
precomp_filename ='lab_high_speed';
precomp_path = "C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\precomp";
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',92e9);
freqresp.load('loadPath', precomp_path, 'fileName', precomp_filename);
fprintf('Plotting: %s\n', precomp_filename);
freqresp.plot();
end

View File

@@ -14,13 +14,13 @@ defaults = struct( ...
'filters' , struct, ...
'agg' , 'mean', ...
'outlier' , 'auto', ...
'mad_z' , 3, ...
'mad_z' , 4, ...
'pct_limits' , [2.5 97.5], ...
'min_pts_x' , 3, ...
'show_raw' , true, ...
'show_precoded', [], ...
'show_spread' , 'none', ...
'fec_lines' , [2.2e-4 4.85e-3 2e-2], ...
'fec_lines' , [], ...
'plot', struct() ...
);
cfg = filldefaults(cfg, defaults);
@@ -75,6 +75,11 @@ T = T(validXY, :);
x_raw = x_raw(validXY);
y_raw = y_raw(validXY);
if mean(abs(y_raw)) > 1e8
%giga values
y_raw = y_raw.*1e-9;
end
if cfg.show_precoded && ismember('BER_precoded', T.Properties.VariableNames)
y_raw_p = T.BER_precoded(validXY);
else
@@ -92,8 +97,29 @@ nG = max(G);
% ==== Colors (cbrewer2 'Paired' with dark/ light pairs) ====
[cols_line, cols_scatter] = buildGroupColors(nG, cfg.plot);
%% ---- Plotting
figure; hold on; grid on;
%% ---- Axes / Figure handling (new unified logic)
% Priority:
% 1) cfg.ax use existing axes (subplots/tiles)
% 2) cfg.figure_number select/create figure
% 3) fallback: create new figure
if isfield(cfg,'ax') && ~isempty(cfg.ax) && isgraphics(cfg.ax,'axes')
ax = cfg.ax; % use caller-provided axes
set(gcf,'CurrentAxes',ax);
else
if isfield(cfg,'figure_number') && ~isempty(cfg.figure_number)
figure(cfg.figure_number);
else
figure;
end
ax = gca; % active axes
end
hold(ax,'on');
grid(ax,'on');
h.lines = gobjects(nG,1);
h.err = gobjects(nG,1);
h.scat = gobjects(nG,1);
@@ -120,34 +146,32 @@ for gi = 1:nG
if nnz(km) < cfg.min_pts_x, km = true(size(yy)); end
yy = yy(km);
if strcmpi(cfg.agg,'median'), yu(k)=median(yy,'omitnan'); elseif strcmpi(cfg.agg,'mean'), yu(k)=mean(yy,'omitnan'); elseif strcmpi(cfg.agg,'min'), yu(k)=min(yy); end
if strcmpi(cfg.agg,'median'), yu(k)=median(yy,'omitnan'); elseif strcmpi(cfg.agg,'mean'), yu(k)=mean(yy,'omitnan'); elseif strcmpi(cfg.agg,'min'), yu(k)=min(yy); elseif strcmpi(cfg.agg,'max'), yu(k)=max(yy); end
if strcmpi(cfg.show_spread,'iqr')
q = prctile(yy,[25 75]);
ylo(k) = max(yu(k)-q(1), eps);
yhi(k) = max(q(2)-yu(k), eps);
elseif strcmpi(cfg.show_spread,'minmax')
ylo(k) = min(yy);
yhi(k) = max(yy);
end
end
% sort
[xu, ord] = sort(xu);
yu = yu(ord); ylo = ylo(ord); yhi = yhi(ord);
yu = yu(ord);
ylo = ylo(ord);
yhi = yhi(ord);
% Styles
% Decide if we style by pre_emph
canStyleByPre = cfg.plot.use_pre_emph_styling && ismember('pre_emph', T.Properties.VariableNames);
% --- LINE TYPE SELECTION (no pre-emphasis logic) ---
ls = cfg.plot.lineStyle_default;
if canStyleByPre
if any(strcmp(group_by,'pre_emph'))
% pre_emph is an explicit grouping key -> take it from the group table
pre = logical(grpTbl.pre_emph(gi));
else
% pre_emph not grouped, but available in the rows -> infer from the members of this group
pre = logical(mode(T.pre_emph(G==gi)));
end
ls = tern(pre, cfg.plot.lineStyle_pre_emph_on, cfg.plot.lineStyle_pre_emph_off);
else
% no pre-emph styling use a single default style
ls = cfg.plot.lineStyle_default;
% User-defined override (cycled)
if isfield(cfg.plot,'custom_linetypes') && ~isempty(cfg.plot.custom_linetypes)
L = cfg.plot.custom_linetypes;
ls = L{ mod(gi-1, numel(L)) + 1 };
end
lbl = buildLabel(grpTbl(gi,:), group_by);
@@ -156,12 +180,12 @@ for gi = 1:nG
colL = cols_line(gi,:);
h.lines(gi) = plot(xu, yu, ...
'LineWidth', cfg.plot.lineWidth, ...
'Marker', cfg.plot.marker, 'MarkerSize', 5, ...
'Marker', cfg.plot.marker, 'MarkerSize', 3, ...
'Color', colL, 'LineStyle', ls, ...
'DisplayName', char(lbl));
% Spread (IQR) in line color
if strcmpi(cfg.show_spread,'iqr') && any(isfinite(ylo)) && any(isfinite(yhi))
if any(isfinite(ylo)) && any(isfinite(yhi))
h.err(gi) = errorbar(xu, yu, ylo, yhi, 'LineStyle','none', ...
'Color', colL, 'CapSize', cfg.plot.capSize, 'HandleVisibility','off');
h.err(gi).LineWidth = cfg.plot.errWidth;
@@ -195,30 +219,38 @@ for gi = 1:nG
km = outlierMask(yy, cfg, true);
if nnz(km) < cfg.min_pts_x, km = true(size(yy)); end
yy = yy(km);
if strcmpi(cfg.agg,'median'), ypu(k)=median(yy,'omitnan'); elseif strcmpi(cfg.agg,'mean'), ypu(k)=mean(yy,'omitnan'); elseif strcmpi(cfg.agg,'min'), ypu(k)=min(yy); end
if strcmpi(cfg.agg,'median'), ypu(k)=median(yy,'omitnan'); elseif strcmpi(cfg.agg,'mean'), ypu(k)=mean(yy,'omitnan'); elseif strcmpi(cfg.agg,'min'), ypu(k)=min(yy); elseif strcmpi(cfg.agg,'max'), ypu(k)=max(yy); end
end
h.lines_p(gi) = plot(xu, ypu, ...
'LineWidth', max(1.2, cfg.plot.lineWidth-0.2), ...
'Marker', cfg.plot.marker_precoded, 'MarkerSize', 5, ...
'Marker', cfg.plot.marker_precoded, 'MarkerSize', 3, ...
'Color', colL, 'LineStyle', ':', ...
'DisplayName', [char(lbl) ' (precoded)']);
end
end
%% ---- Axes / Labels / FEC
ylabel(cfg.y_axis, 'Interpreter','none');
xlabel(x_label, 'Interpreter','none');
set(gca, 'YScale', cfg.y_scale, 'FontSize', 11);
legend('Location', cfg.plot.legendLocation); box on;
% legend('Location', cfg.plot.legendLocation); box on;
xticks(floor(xu));
xlim([min(xu), max(xu)])
if startsWith(cfg.y_axis,"BER",'IgnoreCase',true)
for v = cfg.fec_lines
yline(v, '--', 'Color', cfg.plot.fecColor, ...
'LineWidth', cfg.plot.fecLineWidth, 'HandleVisibility','off');
end
ylim([1e-4, 0.3]);
ylim([1e-5, 0.5]);
yticks([1e-5, 1e-4, 1e-3, 1e-2, 1e-1]);
end
end % ===== main =====
@@ -237,7 +269,11 @@ end
end
function out = tern(cond, a, b)
if cond, out = a; else, out = b; end
if cond
out = a;
else
out = b;
end
end
function T2 = applyFilters(T, filters)
@@ -274,9 +310,12 @@ switch lower(whichX)
if ~ismember('pam_level', T.Properties.VariableNames)
error('bitrate requires "pam_level" column.');
end
bits = log2(double(T.pam_level));
bits = floor(log2(double(T.pam_level))*10)/10;
x = (T.symbolrate .* bits) * 1e-9;
label = 'Bitrate [Gb/s]';
label = 'Grossrate [Gb/s]';
case 'grossrate'
x = (T.grossrate) * 1e-9;
label = 'Grossrate [Gb/s]';
otherwise
if ~ismember(whichX, T.Properties.VariableNames)
error('x_axis "%s" not found in table.', whichX);
@@ -317,38 +356,78 @@ for i = 1:numel(group_by)
key = group_by{i};
val = grpRow.(key);
if iscell(val), val = val{1}; end
if islogical(val), val = tern(val,'pre-emph on','pre-emph off'); end
parts(i) = sprintf('%s=%s', key, string(val));
if islogical(val), val = tern(val,'w/','w/o'); end
if key == "equalizer_structure"
key = '';
val = upper(val);
val = strrep(val,'_',' ');
end
if key == "pre_emph"
% key = strrep(key,'_','-');
val = [val, ' pre-emph.'];
key = '';
end
parts(i) = sprintf('%s %s', key, string(val));
end
s = strjoin(parts, ', ');
end
function [cols_line, cols_scatter] = buildGroupColors(nG, plotcfg)
% Build paired colors (dark for lines, light for scatter) using cbrewer2('Paired')
% --- 1) User-provided custom colors -------------------------------
if isfield(plotcfg,'custom_colors') && ~isempty(plotcfg.custom_colors)
C = plotcfg.custom_colors;
if size(C,1) < nG
error('custom_colors must have at least nG=%d rows.', nG);
end
cols_line = C(1:nG, :);
% Scatter colors: either user-provided or lightened
if isfield(plotcfg,'custom_colors_scatter') && ~isempty(plotcfg.custom_colors_scatter)
Cs = plotcfg.custom_colors_scatter;
if size(Cs,1) < nG
error('custom_colors_scatter must have at least nG=%d rows.', nG);
end
cols_scatter = Cs(1:nG, :);
else
% auto-lighten scatter colors
cols_scatter = zeros(nG,3);
for i = 1:nG
cols_scatter(i,:) = lightenColor(cols_line(i,:), 0.40);
end
end
return;
end
% --- 2) Standard behavior (using cbrewer2 or fallback) ------------
useBrewer = plotcfg.use_cbrewer2 && exist('cbrewer2','file')==2;
if useBrewer
N = max(2*nG, 12); % ensure pairs available
N = max(2*nG, 12);
C = cbrewer2(plotcfg.colormap, N);
cols_line = zeros(nG,3);
cols_scatter = zeros(nG,3);
for i = 1:nG
if plotcfg.paired_dark_first
dark = C(2*i-1, :); light = C(2*i, :);
dark = C(2*i-1, :);
light = C(2*i, :);
else
light = C(2*i-1, :); dark = C(2*i, :);
light = C(2*i-1, :);
dark = C(2*i, :);
end
cols_line(i,:) = dark;
cols_scatter(i,:) = light;
end
else
% Fallback: lines() + lightened scatter
C = lines(max(nG,7));
cols_line = C(1:nG,:);
cols_scatter = zeros(nG,3);
for i = 1:nG
cols_scatter(i,:) = lightenColor(cols_line(i,:), 0.5); % 50% toward white
cols_scatter(i,:) = lightenColor(cols_line(i,:), 0.50);
end
end
end
function c2 = lightenColor(c, fracTowardWhite)

View File

@@ -0,0 +1,34 @@
path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\HighSpeedExperiment_2024\Auswertung_JLT\final\rates.csv";
%% === Read CSV into a table ===
T = readtable(path, 'Delimiter', ';', 'DecimalSeparator', ',');
%% === Column definitions ===
x = T.X_Werte;
pam_cols = {'PAM_2','PAM_4','PAM_6','PAM_8','PAM_12'};
titles = {'PAM-2','PAM-4','PAM-6','PAM-8','PAM-12'};
% === Create subplots ===
figure;hold on
c = linspecer(6);
for k = 1:numel(pam_cols)
y = T.(pam_cols{k});
valid = ~isnan(y);
% Scatter plot
s = scatter(x(valid), y(valid), 25, 'filled','MarkerEdgeColor',c(k,:),'MarkerFaceColor',c(k,:),'DisplayName',titles{k});
% Fit (2nd-order polynomial)
p = polyfit(x(valid), y(valid), 2);
xfit = linspace(min(x(valid)), max(x(valid)), 200);
yfit = polyval(p, xfit);
% Plot fit curve
plot(xfit, yfit, 'LineWidth', 1,'linestyle',':','Color',c(k,:),'HandleVisibility','off');
xlabel('baud rate [GBd]');
ylabel('net rate [Gb/s]');
end

View File

@@ -0,0 +1,38 @@
X-Werte;PAM-2;PAM-4;PAM-6;PAM-8;PAM-12
224;204;;;;
205,5;193,4;;;;
205,1;189,7;;;;
192;168;;;;
240;;427,4;;;
225;;420,5;;;
210;;336;;;
184;;332;;;
192;;320;;;
176;;306,0869565;;;
190;;304;;;
168;;294;;;
156,2;;287,1;;;
160,8;;286,9;;;
170;;272;;;
132;;250,9505703;;;
112;;209,3457944;;;
172;;337;;;
216;;;474,6;;
147,2;;;329,9;;
132;;;319,7891753;;
143,1;;;318;;
160;;;377;;
225;;;;562,5;
200;;;;510;
160;;;;438;
180;;;;432;
180;;;;432;
144;;;;384;
143,7;;;;363,4;
144;;;;360;
136;;;;353,859497;
136;;;;342,7995295;
128;;;;329,0488432;
129,7;;;;311,2;
160;;;;413;
160;;;;;481,2
1 X-Werte PAM-2 PAM-4 PAM-6 PAM-8 PAM-12
2 224 204
3 205,5 193,4
4 205,1 189,7
5 192 168
6 240 427,4
7 225 420,5
8 210 336
9 184 332
10 192 320
11 176 306,0869565
12 190 304
13 168 294
14 156,2 287,1
15 160,8 286,9
16 170 272
17 132 250,9505703
18 112 209,3457944
19 172 337
20 216 474,6
21 147,2 329,9
22 132 319,7891753
23 143,1 318
24 160 377
25 225 562,5
26 200 510
27 160 438
28 180 432
29 180 432
30 144 384
31 143,7 363,4
32 144 360
33 136 353,859497
34 136 342,7995295
35 128 329,0488432
36 129,7 311,2
37 160 413
38 160 481,2

View File

@@ -2,40 +2,59 @@ database_type = 'mysql';
dataBase = 'labor_highspeed';%'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\silas_labor_newdsp_newstructure.db';
db = DBHandler("dataBase", [dataBase], "type", database_type);
M = 4;
M = 8;
fp = QueryFilter();
% fp.where('Runs', 'run_id','EQUALS', 987);
fp.where('Runs', 'pam_level','EQUALS', M);
% fp.where('Runs', 'symbolrate','EQUALS', 165e9); %150, 165, 180, 195, 210, 225, 240
fp.where('Runs', 'fiber_length','EQUALS', 10);
fp.where('Runs', 'fiber_length','EQUALS', 2);
% fp.where('Runs', 'is_mpi','EQUALS', 0);
% fp.where('Runs', 'power_pd_in','GREATER_THAN', 7);
% fp.where('Runs', 'interference_path_length','EQUALS', 1000);
% fp.where('Runs', 'loop_id','GREATER_THAN', 11);
% fp.where('Runs', 'sir','EQUALS',18);
fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'db_mode','EQUALS', 1); % 0 == high preemphasis // 1 == low preemphasis
% fp.where('Runs', 'db_mode','EQUALS', 1); % 0 == high preemphasis // 1 == low preemphasis
% fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fields = db.getTableFieldNames('power_state_info');
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_new')];
fields = [fields; db.getTableFieldNames('dashboard_ungrouped_alltime')]; %dashboard_ungrouped_after_nov_2025 dashboard_ungrouped_aug_nov_2025
[dataTable,~] = db.queryDB(fp, fields);
%%
cfg = struct;
cfg.x_axis = 'symbolrate'; % 'symbolrate' | 'bitrate' | 'wavelength'
cfg.x_axis = 'grossrate'; % 'symbol rate' | 'bitrate' | 'wavelength' grossrate
cfg.y_axis = 'BER'; % 'BER' | 'GMI' | 'AIR' | ...
cfg.group_by = {'wavelength','equalizer_structure','pre_emph'};
cfg.filters = struct('is_mpi',0,'pam_level',M,'equalizer_structure',[equalizer_structure.ml_mlse,equalizer_structure.vnle,equalizer_structure.vnle_pf_mlse,equalizer_structure.vnle_db_mlse,equalizer_structure.dfe]);
cfg.group_by = {'equalizer_structure','pre_emph'};
cfg.filters = struct('is_mpi',0,'pam_level',M,'equalizer_structure',[equalizer_structure.ml_mlse]);%,equalizer_structure.vnle_pf_mlse,equalizer_structure.vnle]);
cfg.y_scale = 'auto'; % auto -> log for BER*, linear otherwise
cfg.outlier = 'mad'; % simple, robust; 'none' or 'pctl' also available
cfg.show_raw = true;
cfg.show_spread = 'none'; % 'none' or 'iqr'
cfg.agg = 'mean'; % or 'median'
cfg.show_precoded = 1;
cfg.show_raw = false;
cfg.show_spread = 'none'; % 'none' or 'iqr' or minmax
cfg.agg = 'min'; % or 'median'
cfg.show_precoded = 0;
cfg.fec_lines = [2.2e-4 4.85e-3 2e-2]; % optional
cfg.figure_number = 42;
cfg.plot.custom_colors = [
clr.Paired.red;
clr.Paired.blue;
clr.Paired.green;
clr.Paired.orange;
clr.Paired.purple
];
cfg.plot.custom_colors_scatter = [
clr.Paired.lightred;
clr.Paired.lightblue;
clr.Paired.lightgreen;
clr.Paired.lightorange;
clr.Paired.lightpurple
];
% New styling knobs
cfg.plot.use_cbrewer2 = true;
cfg.plot.colormap = 'Paired';
@@ -48,4 +67,10 @@ cfg.plot.fecLineWidth = 2.4; % thicker FEC limits
plot_measurements_gpt(dataTable, cfg);
% beautifyBERplot()
% beautifyBERplot()
%% FIG PRE EMPHASIS

View File

@@ -1,6 +1,6 @@
% === SETTINGS ===
dsp_options.append_to_db = 0;
dsp_options.max_occurences = 15;
dsp_options.max_occurences = 5;
experiment = "highspeed_2024";
dsp_options.mode = "load_run_id"; % 'simulate' & 'load_files'
@@ -42,15 +42,15 @@ fp = QueryFilter();
% fp.where('Runs', 'run_id','EQUALS', 2776);
M = 4;
fp.where('Runs', 'pam_level','EQUALS', M);
% fp.where('Runs', 'bitrate','EQUALS', 300e9);%360,390
fp.where('Runs', 'bitrate','EQUALS', 390e9);%360,390
% fp.where('Runs', 'symbolrate','EQUALS', 195e9);
fp.where('Runs', 'fiber_length','EQUALS', 2);
% fp.where('Runs', 'is_mpi','EQUALS', 0);
% fp.where('Runs', 'interference_path_length','EQUALS', 1000);
% fp.where('Runs', 'loop_id','GREATER_THAN', 11);
% fp.where('Runs', 'sir','EQUALS',18);
fp.where('Runs', 'wavelength','EQUAL', 1310);
fp.where('Runs', 'db_mode','EQUALS', 1);
fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'db_mode','EQUALS', 0);
fp.where('Runs', 'rop_attenuation','EQUAL', 0);
% fp.where('Runs', 'power_pd_in','GREATER_THAN', 7);

View File

@@ -61,7 +61,7 @@ rcalpha = 0.05;
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rcalpha);
Pamsource = PAMsource(...
"fsym",fsym,"M",M,"order",19,"useprbs",1,...
"fsym",fsym,"M",M,"order",19,"useprbs",0,...
"fs_out",fdac,...
"applyclipping",0,"clipfactor",1.2,...
"applypulseform",pulsef,"pulseformer",Pform,...
@@ -87,4 +87,5 @@ Digi_sig= Digi_sig.normalize("mode","rms");
Digi_sig.spectrum("displayname","Strong Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0);
ylim([-30,3]);
xlim([-5,100]);

View File

@@ -26,11 +26,14 @@ clf
hold on
cols = cbrewer2('Set1',3);
for l = 1:numel(lambda_vals)
figure()
for m = 1:numel(M_vals)
ber_ffe = wh.getStoValue('ber_ffe',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),M_vals(m),lambda_vals(l));
ber = wh.getStoValue('ber_collect',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),M_vals(m),lambda_vals(l));
exfo = wh.getStoValue('exfo',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),M_vals(m),lambda_vals(l));
lb = wh.getStoValue('exfo',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),M_vals(m),lambda_vals(l));
for e = 1:numel(exfo)
laser_pow(e) = exfo{e}.cur_power;
@@ -42,7 +45,7 @@ for l = 1:numel(lambda_vals)
rx_logbook = wh.getStoValue('rx_logbook',v_bias_vals(1),awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),M_vals(1),lambda_vals(1));
subplot(1,3,l)
hold on
a = scatter(v_bias_vals,min(ber,[],2),40,'LineWidth',2,'Marker','.','DisplayName',['PAM ',num2str(M_vals(m))],'MarkerEdgeColor',cols(m,:));
title([num2str(lambda_vals(l)),'nm'])
@@ -66,7 +69,7 @@ for l = 1:numel(lambda_vals)
% Polynomial fit (e.g., second-order polynomial)
[woutliers,n] = rmoutliers( min(ber,[],2) );
p = polyfit( v_bias_vals(~n), log10(woutliers), 4); % Adjust order as needed
p = polyfit( v_bias_vals(~n), log10(woutliers), 3); % Adjust order as needed
BER_fit = polyval(p, v_bias_vals);
@@ -93,6 +96,7 @@ for l = 1:numel(lambda_vals)
end
end
%%
filename = "Z:\2024\sioe\High Speed Messungen Oktober\bias_testing_and_b2b\PAM4_b2b_bias_sweep_20241023_191202_wh_BB_BIAS_FINAL.mat";