Revert "Merge branch 'main' of https://cau-git.rz.uni-kiel.de/nt/mitarbeiter/silas/imdd_simulation"
This reverts commit 798a0ca3b3
This commit is contained in:
@@ -1,252 +0,0 @@
|
||||
|
||||
base = "C:\Users\Silas\Nextcloud4\Dokumente\02_Ablage_Office\FSO_FP_QCL_60umUTC";
|
||||
mode = 0; %0 oder 1
|
||||
M = 2;
|
||||
|
||||
all_files = dir(fullfile(base, "**/*.mat"));
|
||||
|
||||
if M == 2
|
||||
tx_data = load("C:\Users\Silas\Nextcloud4\Dokumente\02_Ablage_Office\FSO_FP_QCL_60umUTC\14G_PAM2\tx_info\tx_info_PAM2_14Gbd0.75RRC.mat");
|
||||
filename = fullfile(base, "14G_PAM2\M=2_Rs=1.4e10_Fs=8e10_I=265mA_RoP=46.3mW_L=31m_PS=RRC_rolloff=0.75_Mode=Rise.mat");
|
||||
elseif M == 4
|
||||
tx_data = load("C:\Users\Silas\Nextcloud4\Dokumente\02_Ablage_Office\FSO_FP_QCL_60umUTC\6G_PAM4\tx_info\tx_info_PAM4_6Gbd0.6RRC.mat");
|
||||
filename = fullfile(base, "6G_PAM4\M=4_Rs=6e9_Fs=8e10_I=255mA_RoP=42.3mW_L=31m_PS=RRC_rolloff=0.6_Mode=Rise.mat");
|
||||
end
|
||||
|
||||
if mode == 1
|
||||
[f, p] = uigetfile(fullfile(base, "**/*.mat"));
|
||||
if f~=0
|
||||
filename = fullfile(p,f);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
datas = load(filename);
|
||||
|
||||
%%
|
||||
str = filename;
|
||||
M_ = str2double(regexp(str, 'M=([^_]+)', 'tokens', 'once'));
|
||||
assert(M==M_);
|
||||
fsym = str2double(regexp(str, 'Rs=([^_]+)', 'tokens', 'once'));
|
||||
fs = str2double(regexp(str, 'Fs=([^_]+)', 'tokens', 'once'));
|
||||
I = sscanf(char(regexp(str, 'I=([^_]+)', 'tokens', 'once')), '%f');
|
||||
rop = sscanf(char(regexp(str, 'RoP=([^_]+)', 'tokens', 'once')), '%f');
|
||||
L = sscanf(char(regexp(str, 'L=([^_]+)', 'tokens', 'once')), '%f');
|
||||
pulseshape = string( regexp(str, 'PS=([^_]+)', 'tokens', 'once'));
|
||||
rolloff = str2double(regexp(str, 'rolloff=([^_]+)', 'tokens', 'once'));
|
||||
mode = string( regexp(str, 'Mode=([^\.]+)', 'tokens', 'once'));
|
||||
|
||||
%%
|
||||
% Tx data
|
||||
|
||||
Bits = Informationsignal(tx_data.tx_data,"fs",fsym);
|
||||
Symbols = Informationsignal(real(tx_data.tx_PAM_sym),"fs",fsym);
|
||||
|
||||
mapping_style = M==4; % Pam2 is like move-it; PAM-4 is different, same mapping like ETH peopled used in Zurich... hence the "eth_style" argument here and there
|
||||
PM = PAMmapper(M,0,"eth_style",mapping_style); % one should rename "eth style" as this is simply a different mapping scheme
|
||||
|
||||
Symbols_ = PM.map(Bits) .* PM.scaling;
|
||||
assert(isequal(Symbols.signal,Symbols_.signal));
|
||||
|
||||
Bits_ = PM.demap(Symbols);
|
||||
[bits,errors,ber,errorIndice] = calc_ber(Bits_.signal,Bits.signal);
|
||||
assert(ber == 0);
|
||||
|
||||
%% For comparison, apply pulsef on Tx Symbols
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",fs,"pulse","rrc","pulselength",16,"alpha",rolloff);
|
||||
Digi_sig_tx_compare = Pform.process(Symbols);
|
||||
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rolloff);
|
||||
Digi_sync = Pform.process(Symbols);
|
||||
|
||||
MF = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rolloff);
|
||||
Rx_sig_compare = MF.process(Digi_sig_tx_compare);
|
||||
|
||||
%%
|
||||
|
||||
% Rx Data
|
||||
traceData = datas.tr.lastData(2).trace.ch3;
|
||||
|
||||
%FYI: Voltage=(RawData−YReference)×YIncrement+YOrigin
|
||||
scoperead_volts = (traceData.RawData - traceData.YReference) * traceData.YIncrement + traceData.YOrigin;
|
||||
demystified = isequal(traceData.YData,scoperead_volts);
|
||||
assert(demystified);
|
||||
|
||||
timesig_compare = [0:1:datas.tr.lastData(1).trace.ch3.Points-1] ./ fs;
|
||||
timesig = datas.tr.lastData(1).trace.ch3.XData;
|
||||
assert(isequal(traceData.YData,scoperead_volts));
|
||||
|
||||
Scope_sig = Electricalsignal(traceData.YData,"fs",fs);
|
||||
|
||||
%%
|
||||
% 1) matched filter
|
||||
% pulse is symmetric, hence we can use pulsef directly as matched filter.
|
||||
% It feels off (bit I think correct) that the fsym is now the output freq.!!
|
||||
% -> output 2 sps to omit timing recovery!?
|
||||
apply_matched_filter = 1;
|
||||
k = 1;
|
||||
if apply_matched_filter
|
||||
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",k*fsym,"pulse","rrc","pulselength",16,"alpha",rolloff,"matched",1);
|
||||
Rx_matched = Pform.process(Scope_sig);
|
||||
else
|
||||
|
||||
Rx_matched = Filter('filtdegree',4,"f_cutoff",fsym*0.5,"fs",Scope_sig.fs,"filterType",filtertypes.gaussian,"active",true).process(Scope_sig);
|
||||
Rx_matched = Rx_matched.resample("fs_out",k*fsym);
|
||||
end
|
||||
Rx_matched.spectrum();
|
||||
|
||||
|
||||
%%
|
||||
|
||||
coefficients = arburg(Rx_matched.signal,25);
|
||||
|
||||
figure()
|
||||
[h,w] = freqz(1,coefficients,Rx_matched.length,"whole",Rx_matched.fs);
|
||||
h = h/max(abs(h));
|
||||
hold on
|
||||
w_ = (w - Rx_matched.fs/2);
|
||||
plot(w_.*1e-9,20*log10(fftshift(abs(h))),'DisplayName',['Burg Coeffs: ', num2str(round(coefficients,2)), ' '],'LineWidth',2);
|
||||
|
||||
%% Timing Rec
|
||||
apply_timing_rec = 1;
|
||||
if apply_timing_rec
|
||||
[Rx_symbolsync, timing_error] = Timing_Recovery("timing_error_detector",'Gardner (non-data-aided)','sps',k,'damping_factor',0.1,'normalized_loop_bandwidth',0.1,'detector_gain',2.7).process(Rx_matched);
|
||||
figure();plot(timing_error);
|
||||
Rx_symbolsync.fs = fsym;
|
||||
% Tsynch
|
||||
[~,Rx_synced_cell,inverted,sequenceFound,sequenceStarts] = Rx_symbolsync.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 0);
|
||||
Rx_synced = Rx_synced_cell{1};
|
||||
sps = 1;
|
||||
else
|
||||
% Tsynch
|
||||
[~,Rx_synced_cell,inverted,sequenceFound,sequenceStarts] = Rx_matched.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 0);
|
||||
Rx_synced = Rx_synced_cell{1};
|
||||
Rx_synced = Rx_synced.resample("fs_out",2*fsym);
|
||||
sps = 2;
|
||||
end
|
||||
|
||||
if M == 2
|
||||
ber_in_paper = 10^(-2.6); %fig 3a) 4 Gb/s MWIR FSO Transmission using Directly Modulated QCL and an Uncooled UTC-PD at Room-Temperature
|
||||
elseif M == 4
|
||||
ber_in_paper = 10^(-2.5);
|
||||
end
|
||||
|
||||
|
||||
%%
|
||||
|
||||
Rx_synced = Rx_synced_cell{1};
|
||||
|
||||
|
||||
% -------------------- FFE --------------------
|
||||
% requires some more digging what is going on :-)
|
||||
eq_ffe = EQ("Ne",[50, 1, 1],"Nb",[2,0,0], ...
|
||||
"training_length",512,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
||||
|
||||
vars = logspace(-4,-3,36);
|
||||
|
||||
parfor i = 1:numel(vars)
|
||||
|
||||
len_tr = 4096;
|
||||
mu_ffe1 = 0.01;% mus(i);%0.0001;
|
||||
mu_ffe2 = 0.0008;
|
||||
mu_ffe3 = 0.001;
|
||||
mu_dc = 0.005;
|
||||
mu_ffe = [mu_ffe1 mu_ffe2 mu_ffe3];
|
||||
mu_dfe = vars(i);
|
||||
duob_mode = db_mode.no_db;
|
||||
|
||||
% requires some more digging what is going on :-)
|
||||
eq_ffe_1 = EQ("Ne",[150, 1, 0],"Nb",[50,0,0], ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",0);
|
||||
|
||||
eq_ffe_2 = FFE("epochs_tr",1,"epochs_dd",vars(i),"len_tr",4096,"mu_dd",vars(i),"mu_tr",vars(i),"order",999,"sps",1,"decide",0, "adaption",adaption_method.nlms,"dd_mode",0);
|
||||
% eq_ffe_2 = FFE_DFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"ffe_mu_dd",1e-5,"dfe_mu_dd",mus(i),"ffe_mu_tr",0,"dfe_mu_tr",0,"ffe_order",50,"dfe_order",10,"sps",1,"decide",1);
|
||||
|
||||
|
||||
ffe_results = ffe(eq_ffe_1,M,Rx_synced,Symbols,Bits, ...
|
||||
"precode_mode",duob_mode,'showAnalysis',1,"postFFE",[], ...
|
||||
"eth_style_symbol_mapping",mapping_style);
|
||||
|
||||
ffe_results.metrics.BER
|
||||
bers(i) = ffe_results.metrics.BER;
|
||||
end
|
||||
|
||||
figure();
|
||||
plot(vars,bers);
|
||||
yline(ber_in_paper)
|
||||
beautifyBERplot();
|
||||
%
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
ffe_results.metrics.print("description",'FFE');
|
||||
fprintf('FFE: %.1e \n',ffe_results.metrics.BER);
|
||||
|
||||
|
||||
%% -------------------- VNLE + MLSE --------------------
|
||||
len_tr = 4096;
|
||||
mu_ffe1 = 0.0001;% mus(i);%0.0001;
|
||||
mu_ffe2 = 0.0008;
|
||||
mu_ffe3 = 0.001;
|
||||
mu_dc = 0.005;
|
||||
mu_ffe = [mu_ffe1 mu_ffe2 mu_ffe3];
|
||||
mu_dfe = 0.0004;
|
||||
duob_mode = db_mode.no_db;
|
||||
|
||||
pf_ncoeffs = 4;
|
||||
|
||||
vars = 1:7;
|
||||
bers = zeros(size(vars));
|
||||
parfor i = 1:numel(vars)
|
||||
|
||||
eqv = EQ("Ne",[200, 1, 0],"Nb",[2, 0, 0], ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
||||
pf_ncoeffs = vars(i);
|
||||
pf = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0,"eth_style",mapping_style).levels);
|
||||
[vnle_results, mlse_results] = vnle_postfilter_mlse(eqv, pf, mlse_, M, Rx_synced, Symbols, Bits, ...
|
||||
"precode_mode", duob_mode, 'showAnalysis', 1, "postFFE", [], "eth_style_symbol_mapping", mapping_style);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
vnle_results.metrics.print("description",'VNLE');
|
||||
mlse_results.metrics.print("description",'MLSE');
|
||||
bers(i) = mlse_results.metrics.BER;
|
||||
end
|
||||
%%
|
||||
figure();hold on
|
||||
plot(vars,bers_ffe,'DisplayName','FFE [200,0,0] + PF + MLSE');
|
||||
plot(vars,bers_vnle,'DisplayName','VNLE [200,1,0] + PF + MLSE');
|
||||
plot(vars,bers_vnledfe,'DisplayName','VNLE [200,1,0] + DFE [2] + PF + MLSE');
|
||||
plot(vars,bers_vnledfe_ideal,'DisplayName','VNLE [200,1,0] + ideal DFE [2] + PF + MLSE');
|
||||
yline(ber_in_paper);
|
||||
yline([2e-2, 4.85e-3, 3.8e-3, 2,2e-4],'LineWidth',2,'Color',[0.8,0.8,0.8],'LineStyle',':','HandleVisibility','off');
|
||||
ylim([1e-5,0.1]);
|
||||
beautifyBERplot();
|
||||
|
||||
%% -------------------- DB target --------------------
|
||||
mlse_db_ = MLSE("DIR",[1,1],"duobinary_output",0,"M",M,'trellis_states',PAMmapper(M,0).levels);
|
||||
|
||||
eq_ = EQ("Ne",[50, 5, 5],"Nb",[0,0,0],"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
||||
|
||||
dbt_results = duobinary_target(eq_,mlse_db_, M, Rx_synced, Symbols, Bits, ...
|
||||
"precode_mode", duob_mode, 'showAnalysis', 0, "postFFE", [],"eth_style_symbol_mapping",mapping_style);
|
||||
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
dbt_results.metrics.print("description",'Duobinary');
|
||||
|
||||
|
||||
%%
|
||||
|
||||
%ML-based MLSE (L=2)
|
||||
mu_ml = 0.01; training_epochs = 100;
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",training_epochs,"epochs_dd",1, ...
|
||||
"len_tr",len_tr,"mu_dd",mu_ml,"mu_tr",mu_ml,"order",11,"sps",1, ...
|
||||
"traceback_depth",128,"L",3,"delta",4,"adaptive_mu",0);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode);
|
||||
ml_mlse_results.metrics.print("description",'ML ');
|
||||
@@ -6,7 +6,7 @@ db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
|
||||
|
||||
pam_levels = [4, 6, 8]; % three tiles
|
||||
bitrate_set = 360e9;
|
||||
fiberL = 2;
|
||||
fiberL = 10;
|
||||
|
||||
fields = [
|
||||
db.getTableFieldNames('power_state_info');
|
||||
@@ -96,7 +96,7 @@ end
|
||||
%% ============================================================
|
||||
% PLOT — 1×3 (PAM-4, PAM-6, PAM-8)
|
||||
% ============================================================
|
||||
fig = figure(9112); clf;
|
||||
fig = figure(9110); 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' ...
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,139 +1,83 @@
|
||||
tablename = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\HighSpeedExperiments_oneandonly_csv.csv';
|
||||
% Returns a Table
|
||||
data = readtable(tablename,"Delimiter",';','DecimalSeparator',',');
|
||||
|
||||
|
||||
%% ============================================================
|
||||
% PLOT
|
||||
% ============================================================
|
||||
%% 1. DATA EXTRACTION & SETUP
|
||||
%% 1. DATA EXTRACTION & SETUP
|
||||
raw_M = data.M;
|
||||
raw_baud = data.BaudRate;
|
||||
raw_net = data.NetRate;
|
||||
raw_codes = string(data.ZoteroCode);
|
||||
raw_names = string(data.Name);
|
||||
raw_band = string(data.Band);
|
||||
|
||||
% Filter Valid Data
|
||||
target_M = [2, 4, 6, 8];
|
||||
validIdx = ismember(raw_M, target_M) & ~isnan(raw_baud) & ~isnan(raw_net);
|
||||
|
||||
Mvals = raw_M(validIdx);
|
||||
baud = raw_baud(validIdx);
|
||||
netrate = raw_net(validIdx);
|
||||
codes = raw_codes(validIdx);
|
||||
names = raw_names(validIdx);
|
||||
bands = raw_band(validIdx);
|
||||
|
||||
pam_list = target_M;
|
||||
colors = flip(cbrewer2('SET1',4));
|
||||
|
||||
%% 2. PLOT (For Visual Check only)
|
||||
figure; hold on;
|
||||
ms = 20;
|
||||
lw = 0.5;
|
||||
ms = 32; % scatter size
|
||||
lw = 0.8; % line width
|
||||
|
||||
for k = 1:4 % PAM-2/4/6/8
|
||||
|
||||
for k = 1:length(pam_list)
|
||||
M = pam_list(k);
|
||||
idxPam = (Mvals == M);
|
||||
|
||||
|
||||
% Extract for this PAM
|
||||
x = baud(idxPam);
|
||||
y = netrate(idxPam);
|
||||
b = bands(idxPam);
|
||||
n = names(idxPam);
|
||||
|
||||
% Get color for this PAM format
|
||||
col = colors(k,:);
|
||||
|
||||
|
||||
% ----- LEGEND FLAG (only add one entry per PAM) -----
|
||||
firstLegend = true;
|
||||
|
||||
|
||||
% ---- PLOT ALL POINTS (marker based on publication) ----
|
||||
for i = 1:sum(idxPam)
|
||||
|
||||
% Marker Logic
|
||||
ms = 20;
|
||||
if strcmpi(b(i), 'O')
|
||||
marker = 'o';
|
||||
elseif strcmpi(b(i), 'C')
|
||||
marker = 'd';
|
||||
else
|
||||
marker = 's';
|
||||
end
|
||||
if strcmpi(n(i), 'THIS WORK')
|
||||
marker = 'pentagram';
|
||||
ms = 100;
|
||||
end
|
||||
|
||||
% Plot Scatter
|
||||
% marker selection by publication
|
||||
pubIdx = find(pub_list == n(i), 1);
|
||||
marker = markerlist{mod(pubIdx-1, nMarkers) + 1};
|
||||
|
||||
if firstLegend
|
||||
scatter(x(i), y(i), ms, 'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
|
||||
h = scatter(x(i), y(i), ms, ...
|
||||
'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, ...
|
||||
'MarkerFaceColor', col, ...
|
||||
'DisplayName', sprintf('PAM-%d', M));
|
||||
firstLegend = false;
|
||||
else
|
||||
scatter(x(i), y(i), ms, 'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
|
||||
h = 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';
|
||||
|
||||
% Add publication name
|
||||
dt.DataTipRows(end+1) = dataTipTextRow('Publication', n(i));
|
||||
|
||||
|
||||
end
|
||||
|
||||
% 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');
|
||||
|
||||
% ---- Fit (PAM-specific) ----
|
||||
valid = ~isnan(x) & ~isnan(y);
|
||||
if sum(valid) >= 3
|
||||
p = polyfit(x(valid), y(valid), 2);
|
||||
xfit = linspace(min(x(valid)), max(x(valid)), 200);
|
||||
yfit = polyval(p, xfit);
|
||||
|
||||
plot(xfit, yfit, ':', ...
|
||||
'LineWidth', lw, ...
|
||||
'Color', col, ...
|
||||
'HandleVisibility', 'off'); % do NOT add to legend
|
||||
end
|
||||
end
|
||||
|
||||
grid on; box on;
|
||||
grid on;
|
||||
xlabel('Baud rate [GBd]');
|
||||
ylabel('Net rate [Gb/s]');
|
||||
% title('Check Command Window for TikZ Code');
|
||||
% legend('Location','northwest');
|
||||
|
||||
%% 3. GENERATE TIKZ ANNOTATION CODE
|
||||
% This prints the manual \draw commands to the console
|
||||
legend('Location','northwest');
|
||||
set(gca,'FontSize',11);
|
||||
|
||||
%% 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_submission\media\matlab2tikz\highspeedresults_test.tikz';
|
||||
|
||||
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\highspeedresults.tikz';
|
||||
matlab2tikz(outfile, ...
|
||||
'width','\fwidth', ...
|
||||
'height','\fheight', ...
|
||||
|
||||
@@ -10,11 +10,10 @@ if dsp_options.mode == "load_run_id"
|
||||
|
||||
if experiment == "highspeed_2024"
|
||||
|
||||
dsp_options.database_type = "mysql";
|
||||
dsp_options.database_type = 'mysql';
|
||||
dsp_options.dataBase = 'labor_highspeed';%'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\silas_labor_newdsp_newstructure.db';
|
||||
dsp_options.storage_path = 'Z:\2024\sioe_labor\';
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase],...
|
||||
"type", dsp_options.database_type,"server","192.168.178.192","user","silas","password","silas");
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase], "type", dsp_options.database_type);
|
||||
|
||||
elseif experiment == "mpi_ecoc_2025"
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ M = 4;
|
||||
randkey = 1;
|
||||
|
||||
% --- Parameter sweep
|
||||
order_range = 5:5:50; % FFE order
|
||||
delta_range = 0:5:20; % delta
|
||||
SNR_dB = 30;
|
||||
order_range = 2:3:11; % FFE order
|
||||
delta_range = 0:2:4; % delta
|
||||
SNR_dB = 20;
|
||||
|
||||
% --- Prepare bit sequence
|
||||
order_bits = 19;
|
||||
@@ -21,14 +21,10 @@ Symbols = PAMmapper(M,0).map(Bits);
|
||||
Symbols.fs = 200e9;
|
||||
|
||||
% --- Channel (minimal ISI + AWGN)
|
||||
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);
|
||||
h = [0.3 0.9 0.3]; h = h/norm(h);
|
||||
symbols_filt = Symbols.filter(h,1);
|
||||
symbols_noi = symbols_filt;
|
||||
symbols_noi.signal = awgn(symbols_filt.signal,SNR_dB,'measured');
|
||||
symbols_noi.spectrum();
|
||||
|
||||
% --- Generate all parameter pairs
|
||||
[O,D] = ndgrid(order_range, delta_range);
|
||||
@@ -42,7 +38,7 @@ ce_vec = nan(size(pairs,1),1);
|
||||
ce_training = nan(size(pairs,1),training_len);
|
||||
|
||||
% --- Parallel loop over parameter pairs
|
||||
for k = 1:size(pairs,1)
|
||||
parfor k = 1:size(pairs,1)
|
||||
order_k = pairs(k,1);
|
||||
delta_k = pairs(k,2);
|
||||
|
||||
@@ -93,7 +89,7 @@ end
|
||||
beautifyBERplot
|
||||
ylabel('BER'); xlabel('Filter Order [N]');
|
||||
title('BER vs. Filter order');
|
||||
% ylim([1e-4, 0.1]);
|
||||
ylim([1e-4, 0.1]);
|
||||
yline(3.8e-3,'HandleVisibility','off');
|
||||
yline(2.2e-4,'HandleVisibility','off');
|
||||
|
||||
|
||||
@@ -48,36 +48,36 @@ for i = 1:numel(SNR_dB)
|
||||
symbols_noi = symbols_filt;
|
||||
symbols_noi.signal = awgn(symbols_filt.signal, SNR_dB(i), 'measured'); % AWGN with given SNR
|
||||
|
||||
% Sequence Est L=5
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',0,'trellis_exclusion',0,'trellis_state_mode',2,'debug',0,'DIR',h);
|
||||
mlse_.DIR = h;
|
||||
[y_mlse] = mlse_.process(symbols_noi,Symbols);
|
||||
mlse_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_mlse);
|
||||
[~, ~, ber_mlse_l5(i), ~] = calc_ber(mlse_bits.signal, Bits.signal, "skip_front", 10, "skip_end", 10, "returnErrorLocation", 1);
|
||||
fprintf('MLSE L5: %.2e \n',ber_mlse_l5(i));
|
||||
|
||||
% 2nd Approach
|
||||
mu_lms = 0.0005;
|
||||
pf_ncoeffs = 1;
|
||||
eq_ = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",2^13,"mu_dd",mu_lms,"mu_tr",mu_lms,"order",16,"sps",1,"dd_mode",1,"adaption_technique","lms");
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
|
||||
% FFE
|
||||
[y_ffe, ffe_noise] = eq_.process(symbols_noi, Symbols);
|
||||
|
||||
Eq_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_ffe);
|
||||
[~, ~, ber_ffe(i), ~] = calc_ber(Eq_bits.signal, Bits.signal, "skip_front", 0, "skip_end", 0, "returnErrorLocation", 1);
|
||||
fprintf('FFE: %.2e \n',ber_ffe(i));
|
||||
|
||||
% Postfilter
|
||||
[y_white,~] = pf_.process(y_ffe, ffe_noise);
|
||||
|
||||
% Sequence Est
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',0,'trellis_exclusion',0,'trellis_state_mode',2,'debug',0,'DIR',pf_.coefficients);
|
||||
[y_mlse] = mlse_.process(y_white,Symbols);
|
||||
mlse_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_mlse);
|
||||
[~, errors, ber_nwf_mlse_l2(i), errpos] = calc_ber(mlse_bits.signal, Bits.signal, "skip_front", 10, "skip_end", 10, "returnErrorLocation", 1);
|
||||
fprintf('MLSE: %.2e \n',ber_nwf_mlse_l2(i));
|
||||
% % Sequence Est L=5
|
||||
% mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',0,'trellis_exclusion',0,'trellis_state_mode',2,'debug',0,'DIR',h);
|
||||
% mlse_.DIR = h;
|
||||
% [y_mlse] = mlse_.process(symbols_noi,Symbols);
|
||||
% mlse_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_mlse);
|
||||
% [~, ~, ber_mlse_l5(i), ~] = calc_ber(mlse_bits.signal, Bits.signal, "skip_front", 10, "skip_end", 10, "returnErrorLocation", 1);
|
||||
% fprintf('MLSE L5: %.2e \n',ber_mlse_l5(i));
|
||||
%
|
||||
% % 2nd Approach
|
||||
% mu_lms = 0.0005;
|
||||
% pf_ncoeffs = 1;
|
||||
% eq_ = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",2^13,"mu_dd",mu_lms,"mu_tr",mu_lms,"order",16,"sps",1,"dd_mode",1,"adaption_technique","lms");
|
||||
% pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
%
|
||||
% % FFE
|
||||
% [y_ffe, ffe_noise] = eq_.process(symbols_noi, Symbols);
|
||||
%
|
||||
% Eq_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_ffe);
|
||||
% [~, ~, ber_ffe(i), ~] = calc_ber(Eq_bits.signal, Bits.signal, "skip_front", 0, "skip_end", 0, "returnErrorLocation", 1);
|
||||
% fprintf('FFE: %.2e \n',ber_ffe(i));
|
||||
%
|
||||
% % Postfilter
|
||||
% [y_white,~] = pf_.process(y_ffe, ffe_noise);
|
||||
%
|
||||
% % Sequence Est
|
||||
% mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',0,'trellis_exclusion',0,'trellis_state_mode',2,'debug',0,'DIR',pf_.coefficients);
|
||||
% [y_mlse] = mlse_.process(y_white,Symbols);
|
||||
% mlse_bits = PAMmapper(M, 0, "eth_style", 0).demap(y_mlse);
|
||||
% [~, errors, ber_nwf_mlse_l2(i), errpos] = calc_ber(mlse_bits.signal, Bits.signal, "skip_front", 10, "skip_end", 10, "returnErrorLocation", 1);
|
||||
% fprintf('MLSE: %.2e \n',ber_nwf_mlse_l2(i));
|
||||
|
||||
% ML-base MLSE L=2
|
||||
adaptive_mu = 0;
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
L = 4; % Oversampling factor
|
||||
fsym = 1e9/4;
|
||||
rollOff = 0.5; % Pulse shaping roll-off factor
|
||||
htx = rcosdesign(rollOff,16, L, 'sqrt');
|
||||
hrx = conj(fliplr(htx));
|
||||
|
||||
signal = zeros(1000,1);
|
||||
signal(500) = 1;
|
||||
Digi_sig = Informationsignal(signal,"fs",fsym);
|
||||
|
||||
% Digi_sig = Digi_sig.resample("fs_out",L*fsym);
|
||||
%
|
||||
% Digi_sig_tx = Digi_sig.filter(htx,1);
|
||||
% Digi_sig_rx = Digi_sig_tx.filter(hrx,1);
|
||||
%
|
||||
% figure;plot(Digi_sig_tx.signal);hold on;plot(Digi_sig_rx.signal),plot(Digi_sig.signal);
|
||||
%
|
||||
%
|
||||
%
|
||||
%
|
||||
pulsef = Pulseformer("alpha",1,"matched",0,"fdac",Digi_sig.fs*L,"fsym",fsym,"pulse","rrc","pulselength",16);
|
||||
Digi_sig = pulsef.process(Digi_sig);
|
||||
|
||||
pulsef = Pulseformer("alpha",1,"matched",1,"fdac",Digi_sig.fs,"fsym",fsym,"pulse","rrc","pulselength",16);
|
||||
Digi_sig_matched = pulsef.process(Digi_sig);
|
||||
|
||||
% Filter:
|
||||
htx = rcosdesign(rollOff,16, L, 'sqrt');
|
||||
% Note half of the target delay is used, because when combined
|
||||
% to the matched filter, the total delay will be achieved.
|
||||
hrx = conj(fliplr(htx));
|
||||
|
||||
figure
|
||||
plot(htx)
|
||||
title('Transmit Filter')
|
||||
xlabel('Index')
|
||||
ylabel('Amplitude')
|
||||
|
||||
figure
|
||||
plot(hrx)
|
||||
title('Rx Filter (Matched Filter)')
|
||||
xlabel('Index')
|
||||
ylabel('Amplitude')
|
||||
|
||||
p = conv(htx,hrx);
|
||||
|
||||
figure
|
||||
plot(p)
|
||||
title('Combined Tx-Rx = Raised Cosine')
|
||||
xlabel('Index')
|
||||
ylabel('Amplitude')
|
||||
|
||||
% And let's highlight the zero-crossings
|
||||
zeroCrossings = NaN*ones(size(p));
|
||||
zeroCrossings(1:L:end) = 0;
|
||||
zeroCrossings((rcDelay)*L + 1) = NaN; % Except for the central index
|
||||
hold on
|
||||
plot(zeroCrossings, 'o')
|
||||
legend('RC Pulse', 'Zero Crossings')
|
||||
hold off
|
||||
@@ -312,7 +312,7 @@ for realiz = 1:s.num_realiz
|
||||
Opt_sig_wdm_fib = DP_Fiber("L",segment_length,"D",Dvec(seg),"Dpmd",s.pmd,"Ds",0.07, ...
|
||||
"beat_len",10,"corr_len",100,"dz",1,"manakov",0, ...
|
||||
"gamma",s.gamma,"lambda",zdw,"n_waveplates",10,"SS_dphimax",0.01, ...
|
||||
"SS_dzmax",50,"SS_dzmin",10,"X_alpha",0.3,"X_beta",0,"rng",1,"useGPU",1,"useSingle",1).process(Opt_sig_wdm_fib);
|
||||
"SS_dzmax",50,"SS_dzmin",10,"X_alpha",0.3,"X_beta",0,"rng",1).process(Opt_sig_wdm_fib);
|
||||
|
||||
% -------- Evaluate at intermediate distance (enqueue jobs) --------
|
||||
if eval_ptr <= nEval && seg == eval_seg(eval_ptr)
|
||||
|
||||
Reference in New Issue
Block a user