Minimal changes

Add Theory plots for Silas Diss
This commit is contained in:
Silas Oettinghaus
2026-01-29 16:49:50 +01:00
parent 7eaa4b8791
commit 7eb3364814
8 changed files with 860 additions and 115 deletions

View File

@@ -6,7 +6,7 @@ db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
pam_levels = [4, 6, 8]; % three tiles
bitrate_set = 360e9;
fiberL = 10;
fiberL = 2;
fields = [
db.getTableFieldNames('power_state_info');
@@ -96,7 +96,7 @@ end
%% ============================================================
% PLOT 1×3 (PAM-4, PAM-6, PAM-8)
% ============================================================
fig = figure(9110); clf;
fig = figure(9112); clf;
tiledlayout(1,3,'TileSpacing','compact','Padding','compact');
lw = 1.8;
@@ -223,19 +223,19 @@ ylabel('');
end
pos = 1e3.*[2.7770 1.2017 1.4000 0.3200];
set(fig, 'Position', pos);
% pos = 1e3.*[2.7770 1.2017 1.4000 0.3200];
% set(fig, 'Position', pos);
%% === EXPORT ===
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\wavelength_analysis.tikz';
matlab2tikz(outfile, ...
'width','\fwidth', ...
'height','\fheight', ...
'showInfo',false, ...
'extraAxisOptions',{ ...
'legend style={font=\footnotesize}', ...
'legend columns=1' ...
});
% outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\wavelength_analysis.tikz';
% matlab2tikz(outfile, ...
% 'width','\fwidth', ...
% 'height','\fheight', ...
% 'showInfo',false, ...
% 'extraAxisOptions',{ ...
% 'legend style={font=\footnotesize}', ...
% 'legend columns=1' ...
% });

View File

@@ -7,113 +7,133 @@ data = readtable(tablename,"Delimiter",';','DecimalSeparator',',');
% PLOT
% ============================================================
%% 1. DATA EXTRACTION & SETUP
% Extract columns from the table
%% 1. DATA EXTRACTION & SETUP
raw_M = data.M;
raw_baud = data.BaudRate;
raw_net = data.NetRate;
raw_names = string(data.ZoteroCode);
raw_band = string(data.Band); % Spalte 'Band' als String extrahieren
raw_codes = string(data.ZoteroCode);
raw_names = string(data.Name);
raw_band = string(data.Band);
% Filter: Keep only PAM 2, 4, 6, 8 and rows where Rates are not NaN
% Filter Valid Data
target_M = [2, 4, 6, 8];
validIdx = ismember(raw_M, target_M) & ~isnan(raw_baud) & ~isnan(raw_net);
% Apply filter to create the working variables
Mvals = raw_M(validIdx);
baud = raw_baud(validIdx);
netrate = raw_net(validIdx);
codes = raw_codes(validIdx);
names = raw_names(validIdx);
bands = raw_band(validIdx); % Gefilterte Bands
bands = raw_band(validIdx);
% Setup Lists for Formatting
pam_list = target_M;
colors = flip(cbrewer2('SET1',4));
% Visual Settings
colors = lines(4); % 4 Farben für PAM-2,4,6,8
% 2. PLOT
%% 2. PLOT (For Visual Check only)
figure; hold on;
ms = 40; % Marker size (etwas größer für bessere Sichtbarkeit)
lw = 1.5; % Line width für Fit
ms = 20;
lw = 0.5;
for k = 1:length(pam_list) % Loop durch PAM-Formate
for k = 1:length(pam_list)
M = pam_list(k);
% Logical mask for current PAM
idxPam = (Mvals == M);
% Extract for this PAM
x = baud(idxPam);
y = netrate(idxPam);
b = bands(idxPam);
n = names(idxPam);
b = bands(idxPam); % Bands für diese PAM-Gruppe
% Get color for this PAM format
col = colors(k,:);
% ----- LEGEND FLAG -----
firstLegend = true;
% ---- PLOT ALL POINTS (Marker basierend auf Band) ----
for i = 1:sum(idxPam)
% === MARKER LOGIC ===
currentBand = b(i);
if strcmpi(currentBand, 'O')
marker = 'o'; % Kreis für O-Band
elseif strcmpi(currentBand, 'C')
marker = 'd'; % Diamond für C-Band
% Marker Logic
ms = 20;
if strcmpi(b(i), 'O')
marker = 'o';
elseif strcmpi(b(i), 'C')
marker = 'd';
else
marker = 's'; % Fallback (Quadrat), falls andere Bands auftauchen
marker = 's';
end
if strcmpi(n(i), 'THIS WORK')
marker = 'pentagram';
ms = 100;
end
% Plotting
% Plot Scatter
if firstLegend
h = scatter(x(i), y(i), ms, ...
'Marker', marker, ...
'MarkerEdgeColor', col, ...
'MarkerFaceColor', col, ...
scatter(x(i), y(i), ms, 'Marker', marker, ...
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
'DisplayName', sprintf('PAM-%d', M));
firstLegend = false;
else
h = scatter(x(i), y(i), ms, ...
'Marker', marker, ...
'MarkerEdgeColor', col, ...
'MarkerFaceColor', col, ...
scatter(x(i), y(i), ms, 'Marker', marker, ...
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
'HandleVisibility','off');
end
% ====== CUSTOM DATATIP CONTENT ======
dt = h.DataTipTemplate;
dt.DataTipRows(1).Label = 'Baud rate';
dt.DataTipRows(2).Label = 'Net rate';
dt.DataTipRows(end+1) = dataTipTextRow('Band', b(i)); % Zeigt Band an
dt.DataTipRows(end+1) = dataTipTextRow('Paper', n(i));
end
% ---- Fit (PAM-specific) ----
% Fit lines
if length(x) >= 3
[p, S, mu] = polyfit(x, y, 2);
xfit = linspace(min(x), max(x), 200);
yfit = polyval(p, xfit, S, mu);
plot(xfit, yfit, ':', ...
'LineWidth', lw, ...
'Color', col, ...
'HandleVisibility', 'off');
plot(xfit, yfit, '-', 'LineWidth', lw, 'Color', col, 'HandleVisibility', 'off');
end
end
grid on; box on;
xlabel('Baud rate [GBd]');
ylabel('Net rate [Gb/s]');
title('Transmission Records (Circle=O, Diamond=C)');
legend('Location','northwest');
set(gca,'FontSize',11);
% title('Check Command Window for TikZ Code');
% legend('Location','northwest');
%% 3. GENERATE TIKZ ANNOTATION CODE
% This prints the manual \draw commands to the console
%% GENERATE TIKZ ANNOTATION CODE
% This prints the manual \draw commands to the console
%% GENERATE TIKZ ANNOTATION CODE (Colored Borders + Tiny Font)
%% GENERATE TIKZ ANNOTATION CODE (No Arrow, Close Text)
fprintf('\n\n%% ===========================================================\n');
fprintf('%% COPY THE FOLLOWING LINES INTO YOUR .TEX FILE \n');
fprintf('%% (Paste them just before \\end{axis})\n');
fprintf('%% ===========================================================\n\n');
for i = 1:length(baud)
bx = baud(i);
by = netrate(i);
key = codes(i);
M_val = Mvals(i);
% --- PLACEMENT LOGIC ---
if M_val == 8
% PAM-8: Place Top-Left
% 'south east' anchor means the text's bottom-right corner touches the coordinate
% shift moves it slightly up and left to clear the marker
anchorStr = 'south east';
shiftStr = 'shift={(-3pt, 3pt)}';
else
% Others: Place Bottom-Right
% 'north west' anchor means the text's top-left corner touches the coordinate
% shift moves it slightly down and right
anchorStr = 'north west';
shiftStr = 'shift={(3pt, -3pt)}';
end
% --- PRINT COMMAND ---
% Uses \node directly at the coordinate (axis cs:...)
fprintf('\\node[anchor=%s, %s, font=\\tiny, fill=white, inner sep=1pt] at (axis cs:%.2f, %.2f) {\\cite{%s}};\n', ...
anchorStr, shiftStr, bx, by, key);
end
fprintf('\n')
%% === EXPORT ===
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\highspeedresults.tikz';
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\media\matlab2tikz\highspeedresults_test.tikz';
matlab2tikz(outfile, ...
'width','\fwidth', ...
'height','\fheight', ...

View File

@@ -25,10 +25,10 @@ h = abs([0.3 0.9 0.3]); h = h/norm(h);
% h = [1 -1.67085330039878 1.17918163282514 -0.805210559745616 0.571564213123367 -0.296337147529674 0.00649773445209780 0.0854177610195952 -0.0576009020965258 0.0520994427061551 -0.0624586034913656 0.0553280962699552 -0.00705582559925755 -0.0336399056707792 0.0706903719452810 -0.0334124287931977 0.0131699455037966 0.0587431373842994 -0.0515902976066452 0.00647904355473619 0.0137506750904990 -0.0547974515885928 0.00994735499340592 -0.0135513582534086 -0.00463322575007739 0.0277311946101940];
% h = h/norm(h);
symbols_filt = Symbols.filter(1,h);
symbols_filt = Symbols.filter(h,1);
symbols_noi = symbols_filt;
symbols_noi.signal = awgn(symbols_filt.signal,SNR_dB,'measured');
symbols_noi.spectrum;
symbols_noi.spectrum();
% --- Generate all parameter pairs
[O,D] = ndgrid(order_range, delta_range);
@@ -42,7 +42,7 @@ ce_vec = nan(size(pairs,1),1);
ce_training = nan(size(pairs,1),training_len);
% --- Parallel loop over parameter pairs
parfor k = 1:size(pairs,1)
for k = 1:size(pairs,1)
order_k = pairs(k,1);
delta_k = pairs(k,2);
@@ -55,7 +55,7 @@ parfor k = 1:size(pairs,1)
try
ml = ML_MLSE("epochs_tr",training_len,"epochs_dd",1,"len_tr",2^15, ...
"mu_dd",0.1,"mu_tr",0.1,"order",order_k,"sps",1, ...
"traceback_depth",128,"L",2,"delta",delta_k,"adaptive_mu",0);
"traceback_depth",128,"L",3,"delta",delta_k,"adaptive_mu",0);
[y_ml,y_ref] = ml.process(symbols_noi,Symbols);
ref_bits = PAMmapper(M,0).demap(y_ref);