new plots for Diss. Mostly AI gen. Few changes in actual codebase
This commit is contained in:
@@ -5,9 +5,11 @@ dsp_options.recipe = @dsp_400g_recipe;
|
||||
dsp_options.append_to_db = false;
|
||||
% dsp_options.append_mpi_reduction_db = false;
|
||||
dsp_options.start_occurence = 1;
|
||||
dsp_options.max_occurences = 1;
|
||||
dsp_options.max_occurences = 3;
|
||||
dsp_options.debug_plots = false;
|
||||
|
||||
|
||||
|
||||
dsp_options.database_type = "mysql";
|
||||
dsp_options.dataBase = "labor_highspeed";
|
||||
|
||||
@@ -34,15 +36,15 @@ maxRunIds = 1; % keep small until the recipe settings are sett
|
||||
fp = QueryFilter();
|
||||
fp.where('Runs','fiber_length','EQUALS', 10);
|
||||
fp.where('Runs','wavelength','EQUALS', 1310);
|
||||
fp.where('Runs','bitrate','EQUALS', 330e9);
|
||||
fp.where('Runs','pam_level','EQUALS', 4);
|
||||
% fp.where('Runs','bitrate','LESS_THAN', 480e9);
|
||||
% fp.where('Runs','pam_level','EQUALS', 4);
|
||||
fp.where('Runs','rop_attenuation','EQUALS', 0);
|
||||
fp.where('Runs','is_mpi','EQUALS', 0);
|
||||
fp.where('Runs', 'db_mode','EQUALS', 2);
|
||||
% fp.where('Runs', 'db_mode','EQUALS', 2);
|
||||
|
||||
fields = db.getTableFieldNames('Runs');
|
||||
[dataTable, query] = db.queryDB(fp, fields);
|
||||
disp(query);
|
||||
% disp(query);
|
||||
|
||||
dataTable = sortrows(dataTable, {'bitrate', 'run_id'});
|
||||
|
||||
@@ -60,21 +62,12 @@ fprintf("Selected %d run_id(s): %s\n", numel(run_ids), mat2str(run_ids));
|
||||
%% Parameter sweep
|
||||
|
||||
dsp_options.userParameters = struct();
|
||||
dsp_options.userParameters.run_ml_mlse_db = true;
|
||||
dsp_options.userParameters.run_mlse_db = true;
|
||||
|
||||
% Enable/disable equalizer branches.
|
||||
% dsp_options.userParameters.run_ffe = false;
|
||||
% dsp_options.userParameters.run_vnle = false;
|
||||
% dsp_options.userParameters.run_dfe = false;
|
||||
% dsp_options.userParameters.run_vnle_mlse = true;
|
||||
% dsp_options.userParameters.run_dbtgt = true;
|
||||
|
||||
% Examples for parameter loops. DataStorage expands every vector-valued field.
|
||||
% dsp_options.userParameters.len_tr = 4096*2;
|
||||
% dsp_options.userParameters.pf_ncoeffs = 1;
|
||||
% dsp_options.userParameters.pf_ncoeffs = [1,2,3];
|
||||
|
||||
% dsp_options.userParameters.decoding_mode = [db_decoder.memoryless,db_decoder.sequencedetection];
|
||||
dsp_options.userParameters.decoding_mode = [db_decoder.sequencedetection];
|
||||
% dsp_options.userParameters.pf_ncoeffs = [1, 2, 3];
|
||||
% dsp_options.userParameters.mu_dc = [0, 1e-5, 1e-4];
|
||||
% dsp_options.userParameters.run_ml_mlse_db = [false, true];
|
||||
@@ -93,7 +86,7 @@ fprintf("-> [ %d run_id(s) x %d userParam combination(s) = %d job(s) ] x %d real
|
||||
|
||||
%% Run
|
||||
|
||||
[results, wh] = submitJobs(run_ids, dsp_options, processingMode.serial, ...
|
||||
[results, wh] = submitJobs(run_ids, dsp_options, processingMode.parallel, ...
|
||||
"wh", wh, ...
|
||||
"waitbar", true);
|
||||
|
||||
@@ -102,6 +95,7 @@ fprintf("-> [ %d run_id(s) x %d userParam combination(s) = %d job(s) ] x %d real
|
||||
|
||||
printBerSummary(wh);
|
||||
plotBerVsBitrateQuick(wh, dataTable);
|
||||
plotMlseBerPrecodedVsBitrateByPf(wh, dataTable);
|
||||
|
||||
function printBerSummary(wh)
|
||||
storageNames = fieldnames(wh.sto);
|
||||
@@ -182,7 +176,7 @@ for storageIdx = 1:numel(storageNames)
|
||||
end
|
||||
|
||||
modeData = sortrows(plotData(rowMask, :), "bitrate_Gbps");
|
||||
summaryData = groupsummary(modeData, "bitrate_Gbps", "median", "BER");
|
||||
summaryData = groupsummary(modeData, "bitrate_Gbps", "min", "BER");
|
||||
summaryData = sortrows(summaryData, "bitrate_Gbps");
|
||||
color = quickPlotColor(modeIdx);
|
||||
marker = markers(1 + mod(storageIdx - 1, numel(markers)));
|
||||
@@ -196,7 +190,7 @@ for storageIdx = 1:numel(storageNames)
|
||||
"MarkerEdgeAlpha", 0.25, ...
|
||||
"HandleVisibility", "off");
|
||||
|
||||
plot(ax, summaryData.bitrate_Gbps, summaryData.median_BER, ...
|
||||
plot(ax, summaryData.bitrate_Gbps, summaryData.min_BER, ...
|
||||
"LineStyle", lineStyles(metricIdx), ...
|
||||
"Marker", marker, ...
|
||||
"MarkerSize", 5, ...
|
||||
@@ -279,6 +273,108 @@ if ~isempty(plotData)
|
||||
end
|
||||
end
|
||||
|
||||
function plotMlseBerPrecodedVsBitrateByPf(wh, dataTable)
|
||||
storageName = "mlse_package";
|
||||
if ~isfield(wh.sto, storageName)
|
||||
fprintf("No %s storage available for BERp plot.\n", storageName);
|
||||
return
|
||||
end
|
||||
|
||||
runIds = dataTable.run_id(:);
|
||||
bitrates = dataTable.bitrate(:);
|
||||
pfCol = zeros(0, 1);
|
||||
bitrateCol = zeros(0, 1);
|
||||
berpCol = zeros(0, 1);
|
||||
|
||||
storageValues = wh.sto.(storageName);
|
||||
for linIdx = 1:numel(storageValues)
|
||||
[phys, storedValue] = wh.getPhysAndValueByLinIndex(storageName, linIdx);
|
||||
if ~isfield(phys, "pf_ncoeffs")
|
||||
continue
|
||||
end
|
||||
|
||||
berp = extractMinMetricValue(storedValue, "BER_precoded");
|
||||
if ~isfinite(berp) || berp <= 0
|
||||
continue
|
||||
end
|
||||
|
||||
runId = resolveRunId(phys, runIds);
|
||||
bitrate = resolveBitrate(runId, runIds, bitrates);
|
||||
if ~isfinite(bitrate)
|
||||
continue
|
||||
end
|
||||
|
||||
pfCol(end+1, 1) = double(phys.pf_ncoeffs); %#ok<AGROW>
|
||||
bitrateCol(end+1, 1) = double(bitrate) * 1e-9; %#ok<AGROW>
|
||||
berpCol(end+1, 1) = double(berp); %#ok<AGROW>
|
||||
end
|
||||
|
||||
if isempty(berpCol)
|
||||
fprintf("No BERp values available for %s.\n", storageName);
|
||||
return
|
||||
end
|
||||
|
||||
plotData = table(pfCol, bitrateCol, berpCol, ...
|
||||
'VariableNames', ["pf_ncoeffs", "bitrate_Gbps", "BERp"]);
|
||||
summaryData = groupsummary(plotData, ["pf_ncoeffs", "bitrate_Gbps"], ...
|
||||
"min", "BERp");
|
||||
|
||||
fig = figure(403); clf;
|
||||
ax = axes(fig); hold(ax, "on");
|
||||
pfValues = [1, 2, 3];
|
||||
markers = ["o", "square", "diamond"];
|
||||
colors = lines(numel(pfValues));
|
||||
|
||||
for pfIdx = 1:numel(pfValues)
|
||||
pfValue = pfValues(pfIdx);
|
||||
rowMask = summaryData.pf_ncoeffs == pfValue;
|
||||
if ~any(rowMask)
|
||||
continue
|
||||
end
|
||||
|
||||
curveData = sortrows(summaryData(rowMask, :), "bitrate_Gbps");
|
||||
plot(ax, curveData.bitrate_Gbps, curveData.min_BERp, ...
|
||||
"LineWidth", 1.3, ...
|
||||
"Marker", markers(pfIdx), ...
|
||||
"MarkerSize", 5, ...
|
||||
"Color", colors(pfIdx, :), ...
|
||||
"DisplayName", sprintf("pf\\_ncoeffs = %d", pfValue));
|
||||
end
|
||||
|
||||
xlabel(ax, "Bitrate [Gb/s]");
|
||||
ylabel(ax, "min BERp");
|
||||
title(ax, "MLSE BERp vs bitrate");
|
||||
set(ax, "YScale", "log");
|
||||
grid(ax, "on");
|
||||
box(ax, "on");
|
||||
legend(ax, "Location", "best", "Interpreter", "none");
|
||||
set(fig, "Position", [1200, 450, 560, 360]);
|
||||
end
|
||||
|
||||
function minValue = extractMinMetricValue(value, metricName)
|
||||
minValue = NaN;
|
||||
if isempty(value)
|
||||
return
|
||||
end
|
||||
if ~iscell(value)
|
||||
value = {value};
|
||||
end
|
||||
|
||||
metricValues = NaN(1, numel(value));
|
||||
for packageIdx = 1:numel(value)
|
||||
package = value{packageIdx};
|
||||
if ~isstruct(package) || ~isfield(package, "metrics")
|
||||
continue
|
||||
end
|
||||
metricValues(packageIdx) = readMetricValue(package.metrics, metricName);
|
||||
end
|
||||
|
||||
metricValues = metricValues(isfinite(metricValues) & metricValues > 0);
|
||||
if ~isempty(metricValues)
|
||||
minValue = min(metricValues);
|
||||
end
|
||||
end
|
||||
|
||||
function metricRows = extractBerMetricRows(values)
|
||||
metricNames = strings(0, 1);
|
||||
berValues = zeros(0, 1);
|
||||
|
||||
Reference in New Issue
Block a user