auswertungsfiles und algos for ECOC 2025 rush...
This commit is contained in:
63
projects/ECOC_2025/dsp_loop_id.m
Normal file
63
projects/ECOC_2025/dsp_loop_id.m
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
|
||||
|
||||
savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
|
||||
databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
database_name = 'ecoc2025_loops.db';
|
||||
db = DBHandler("type","mysql");
|
||||
% db = DBHandler("pathToDB", [databasePath, database_name],"type","sqlite");
|
||||
|
||||
filterParams = db.tables;
|
||||
% filterParams.Configurations = struct('run_id', run_id);
|
||||
filterParams.Configurations = struct( ...
|
||||
'symbolrate', 112e9, ... %[224,336,360,390,420,448]
|
||||
'fiber_length', 0, ...
|
||||
'db_mode', '"no_db"', ...
|
||||
'interference_attenuation', [], ...
|
||||
'interference_path_length', 10, ...
|
||||
'is_mpi', 1, ...
|
||||
'pam_level', 4, ...
|
||||
'wavelength', 1310, ...
|
||||
'precomp_amp', [], ...
|
||||
'signal_attenuation', [], ...
|
||||
'v_awg', [], ...
|
||||
'v_bias', 2.65 ...
|
||||
);
|
||||
|
||||
selectedFields = {'Runs.run_id','Runs.loop_id','Runs.tx_bits_path','Runs.tx_signal_path','Runs.tx_symbols_path','Runs.rx_sync_path','Runs.rx_raw_path',...
|
||||
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp','Measurements.power_rop','Configurations.v_bias',...
|
||||
'Configurations.interference_attenuation', 'Configurations.interference_path_length'};
|
||||
|
||||
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
|
||||
|
||||
dataTable(dataTable.loop_id~=217,:) = [];
|
||||
|
||||
num_occ = 10;
|
||||
run_par = true;
|
||||
run_id = dataTable.run_id;
|
||||
|
||||
params.dc_buffer_len = 224;
|
||||
params.ffe_buffer_len = 1;
|
||||
params.smoothing_buffer_length = 0;
|
||||
params.smoothing_buffer_update = 0;
|
||||
params.mu_dc = 0.005;
|
||||
|
||||
futures_list = parallel.FevalFuture.empty();
|
||||
for id = 1:length(dataTable.run_id)
|
||||
run_id = dataTable.run_id(id);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
|
||||
end
|
||||
|
||||
% Extract all ber_mlse values from the vnle_pf_package using cellfun
|
||||
ber_mlse = cellfun(@(pkg) pkg.ber_mlse, future.OutputArguments{1,1}.vnle_pf_package);
|
||||
ber_vnle = cellfun(@(pkg) pkg.ber_vnle, future.OutputArguments{1,1}.vnle_pf_package);
|
||||
|
||||
figure(101)
|
||||
hold on;
|
||||
scatter(1:num_occ,ber_mlse,15,'Marker','*');
|
||||
scatter(1:num_occ,ber_vnle,15,'Marker','*');
|
||||
legend('Interpreter', 'latex');
|
||||
xlabel('Occurences');
|
||||
ylabel('BER');
|
||||
grid on;
|
||||
beautifyBERplot;
|
||||
@@ -48,15 +48,14 @@ mu_ffe3 = 0.001;
|
||||
mu_dfe = 0.0004;
|
||||
mu_dc = 0.00;
|
||||
|
||||
% mu_ffe1 = 0;
|
||||
% mu_ffe2 = 0;
|
||||
% mu_ffe3 = 0;
|
||||
% mu_dfe =0;
|
||||
% mu_dc = 0.00;
|
||||
|
||||
mu_ffe = [mu_ffe1 mu_ffe2 mu_ffe3];
|
||||
vnle_order=[vnle_order1,vnle_order2,vnle_order3];
|
||||
|
||||
dc_buffer_len = 224;
|
||||
ffe_buffer_len = 1;
|
||||
smoothing_buffer_length = 4096;
|
||||
smoothing_buffer_update = 224;
|
||||
|
||||
% Overwrite default parameters if given in options.parameters
|
||||
paramStruct = options.parameters;
|
||||
if ~isempty(paramStruct)
|
||||
@@ -78,7 +77,7 @@ eq_post = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0
|
||||
|
||||
output = struct();
|
||||
vnle_pf_package = {};
|
||||
vnle_dfe_package = {};
|
||||
vnle_package = {};
|
||||
dbtgt_package = {};
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -121,7 +120,7 @@ if ~found_sync
|
||||
end
|
||||
|
||||
record_realizations = min(options.max_occurences,length(Scpe_cell));
|
||||
for occ = 1:record_realizations
|
||||
for occ = 4:record_realizations
|
||||
|
||||
Scpe_sig = Scpe_cell{occ};
|
||||
|
||||
@@ -137,16 +136,27 @@ for occ = 1:record_realizations
|
||||
|
||||
if duob_mode ~= db_mode.db_encoded
|
||||
|
||||
vnle_pf = 1;
|
||||
vnle_pf = 0;
|
||||
dbtgt = 0;
|
||||
% %%%%% VNLE + DFE %%%%
|
||||
if 0
|
||||
if 1
|
||||
|
||||
eq_vnle_dfe = EQ("Ne",vnle_order,"Nb",[0,0,0],"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",0);
|
||||
eq_post = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0,"order",2001,"sps",1,"decide",0);
|
||||
eq_ = FFE_DCremoval_adaptive_mu("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
|
||||
0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0,...
|
||||
"mu_dc",mu_dc,...
|
||||
"dc_buffer_len",dc_buffer_len, ...
|
||||
"ffe_buffer_len",ffe_buffer_len,...
|
||||
"smoothing_buffer_length",smoothing_buffer_length,...
|
||||
"smoothing_buffer_update",smoothing_buffer_update);
|
||||
|
||||
[result] = vnle(eq_vnle_dfe,M,Scpe_sig,Symbols,Tx_bits,"precode_mode",duob_mode,"showAnalysis",1,"postFFE",[]);
|
||||
vnle_dfe_package{occ} = result;
|
||||
result = vnle(eq_,M,Scpe_sig,Symbols,Tx_bits,"precode_mode",duob_mode,'showAnalysis',1,"postFFE",[],"eth_style_symbol_mapping",0);
|
||||
vnle_package{occ} = result;
|
||||
fprintf("FFE Results: %.2e\n", result.ber_vnle);
|
||||
|
||||
|
||||
if options.append_to_db
|
||||
database.addProcessingResult(run_id, result.resultsVNLE, result.equalizerConfigVNLE);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -176,32 +186,32 @@ for occ = 1:record_realizations
|
||||
% % fprintf("BER VNLE: %.2e | %.2e; BER MLSE: %.2e | %.2e \n",vnle_pf_package{occ}.resultsVNLE.BER,vnle_pf_package{occ}.resultsVNLE.BER_precoded ,vnle_pf_package{occ}.resultsMLSE.BER,vnle_pf_package{occ}.resultsMLSE.BER_precoded);
|
||||
|
||||
if vnle_pf
|
||||
occ = 1; % or whatever your loop index is
|
||||
% occ = 1; % or whatever your loop index is
|
||||
|
||||
|
||||
% Extract VNLE results for readability
|
||||
vnle = vnle_pf_package{occ}.resultsVNLE;
|
||||
mlse = vnle_pf_package{occ}.resultsMLSE;
|
||||
vnle_result = vnle_pf_package{occ}.resultsVNLE;
|
||||
mlse_result = vnle_pf_package{occ}.resultsMLSE;
|
||||
|
||||
|
||||
% Print header
|
||||
fprintf("==== EQUALIZATION RUN-ID %d | PAM-%d | %.2f GBd ====\n\n", run_id, M, Symbols.fs.*1e-9);
|
||||
|
||||
s
|
||||
% VNLE Results
|
||||
fprintf(">> VNLE Results:\n");
|
||||
fprintf(" BER %.2e\n", vnle.BER);
|
||||
fprintf(" BER (pre-code) %.2e\n", vnle.BER_precoded);
|
||||
fprintf(" SNR: %.2f dB\n", vnle.SNR);
|
||||
fprintf(" GMI: %.4f\n", vnle.GMI);
|
||||
fprintf(" BER %.2e\n", vnle_result.BER);
|
||||
fprintf(" BER (pre-code) %.2e\n", vnle_result.BER_precoded);
|
||||
fprintf(" SNR: %.2f dB\n", vnle_result.SNR);
|
||||
fprintf(" GMI: %.4f\n", vnle_result.GMI);
|
||||
fprintf(" Linerate: %.2f Gbps\n", Symbols.fs .* floor(log2(M)*10)/10 .*1e-9);
|
||||
fprintf(" AIR: %.2f Gbps\n", vnle.AIR.*1e-9);
|
||||
fprintf(" AIR: %.2f Gbps\n", vnle_result.AIR.*1e-9);
|
||||
fprintf("\n");
|
||||
|
||||
% MLSE Results
|
||||
fprintf(">> MLSE Results:\n");
|
||||
fprintf(" BER : %.2e\n", mlse.BER);
|
||||
fprintf(" BER (pre-code): %.2e\n", mlse.BER_precoded);
|
||||
fprintf(" Channel Alpha : %.2f\n", mlse.Alpha);
|
||||
fprintf(" BER : %.2e\n", mlse_result.BER);
|
||||
fprintf(" BER (pre-code): %.2e\n", mlse_result.BER_precoded);
|
||||
fprintf(" Channel Alpha : %.2f\n", mlse_result.Alpha);
|
||||
fprintf("\n");
|
||||
end
|
||||
|
||||
@@ -244,6 +254,7 @@ end
|
||||
|
||||
output.dataTable = dataTable;
|
||||
output.vnle_pf_package = vnle_pf_package;
|
||||
output.vnle_package = vnle_package;
|
||||
output.dbtgt_package = dbtgt_package;
|
||||
|
||||
end
|
||||
@@ -4,9 +4,89 @@
|
||||
savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
|
||||
databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
database_name = 'ecoc2025_loops.db';
|
||||
db = DBHandler("pathToDB", [databasePath, database_name],"type","mysql");
|
||||
% db = DBHandler("type","mysql");
|
||||
num_occ = 5;
|
||||
run_par = false;
|
||||
run_id = 1958;
|
||||
[out, future] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ);
|
||||
db = DBHandler("type","mysql");
|
||||
% db = DBHandler("pathToDB", [databasePath, database_name],"type","sqlite");
|
||||
|
||||
filterParams = db.tables;
|
||||
% filterParams.Configurations = struct('run_id', 4001);
|
||||
filterParams.Configurations = struct( ...
|
||||
'symbolrate', 112e9, ... %[224,336,360,390,420,448]
|
||||
'fiber_length', 0, ...
|
||||
'db_mode', '"no_db"', ...
|
||||
'interference_attenuation', [], ...
|
||||
'interference_path_length', [], ...
|
||||
'is_mpi', 1, ...
|
||||
'pam_level', 4, ...
|
||||
'wavelength', 1310, ...
|
||||
'precomp_amp', [], ...
|
||||
'signal_attenuation', [], ...
|
||||
'v_awg', [], ...
|
||||
'v_bias', 2.65 ...
|
||||
);
|
||||
|
||||
selectedFields = {'Runs.run_id','Runs.loop_id','Runs.tx_bits_path','Runs.tx_signal_path','Runs.tx_symbols_path','Runs.rx_sync_path','Runs.rx_raw_path',...
|
||||
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp','Measurements.power_rop','Configurations.v_bias',...
|
||||
'Configurations.interference_attenuation', 'Configurations.interference_path_length'};
|
||||
|
||||
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
|
||||
|
||||
% dataTable(dataTable.loop_id<200,:) = [];
|
||||
|
||||
num_occ = 15;
|
||||
run_par = true;
|
||||
run_id = dataTable.run_id;
|
||||
params = struct();
|
||||
|
||||
% slow DC tracking
|
||||
params.dc_buffer_len = 224;
|
||||
params.ffe_buffer_len = 1;
|
||||
params.smoothing_buffer_length = 0;
|
||||
params.smoothing_buffer_update = 0;
|
||||
params.mu_dc = 0.005;
|
||||
|
||||
futures_list = parallel.FevalFuture.empty();
|
||||
for id = 1:length(dataTable.run_id)
|
||||
run_id = dataTable.run_id(id);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
|
||||
end
|
||||
|
||||
% ideal DC tracking
|
||||
params.dc_buffer_len = 1;
|
||||
params.ffe_buffer_len = 1;
|
||||
params.smoothing_buffer_length = 0;
|
||||
params.smoothing_buffer_update = 0;
|
||||
params.mu_dc = 0.005;
|
||||
|
||||
futures_list = parallel.FevalFuture.empty();
|
||||
for id = 1:length(dataTable.run_id)
|
||||
run_id = dataTable.run_id(id);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
|
||||
end
|
||||
|
||||
% DC smoothing
|
||||
params.dc_buffer_len = 1;
|
||||
params.ffe_buffer_len = 1;
|
||||
params.smoothing_buffer_length = 4096;
|
||||
params.smoothing_buffer_update = 224;
|
||||
params.mu_dc = 0.00;
|
||||
|
||||
futures_list = parallel.FevalFuture.empty();
|
||||
for id = 1:length(dataTable.run_id)
|
||||
run_id = dataTable.run_id(id);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
|
||||
end
|
||||
|
||||
% only FFE
|
||||
params.dc_buffer_len = 1;
|
||||
params.ffe_buffer_len = 1;
|
||||
params.smoothing_buffer_length = 0;
|
||||
params.smoothing_buffer_update = 0;
|
||||
params.mu_dc = 0.00;
|
||||
|
||||
futures_list = parallel.FevalFuture.empty();
|
||||
for id = 1:length(dataTable.run_id)
|
||||
run_id = dataTable.run_id(id);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
|
||||
end
|
||||
|
||||
|
||||
|
||||
58
projects/ECOC_2025/dsp_test/hyperparam_tuning.m
Normal file
58
projects/ECOC_2025/dsp_test/hyperparam_tuning.m
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
Scpe_sig = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_scopesignal.mat");Scpe_sig = Scpe_sig.Scpe_sig;
|
||||
Tx_bits = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_bits.mat");Tx_bits = Tx_bits.Tx_bits;
|
||||
Symbols = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_symbols.mat");Symbols = Symbols.Symbols;
|
||||
|
||||
eq_ = FFE_DCremoval("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",1e-5,"mu_tr",0,"order",50,"sps",2,"decide",0,"mu_dc",0.005,"dc_buffer_len",1);
|
||||
|
||||
savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
|
||||
databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
database_name = 'ecoc2025_loops.db';
|
||||
db = DBHandler("type","mysql");
|
||||
|
||||
params = (logspace(-6,-2,20));
|
||||
params = floor((logspace(2,3,20)));
|
||||
params = 224;
|
||||
|
||||
for i = 1:length(params)
|
||||
|
||||
eq_ = FFE_DCremoval_adaptive_mu("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
|
||||
0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0,...
|
||||
"mu_dc",0.005,"dc_buffer_len",224, ...
|
||||
"ffe_buffer_len",1,...
|
||||
"smoothing_buffer_length",0,...
|
||||
"smoothing_buffer_update",224);
|
||||
|
||||
result = vnle(eq_,4,Scpe_sig,Symbols,Tx_bits,"precode_mode",db_mode.no_db,'showAnalysis',1,"postFFE",[],"eth_style_symbol_mapping",0);
|
||||
ber_ffe(i) = result.ber_vnle;
|
||||
fprintf(" FFE Results: %.2e\n", ber_ffe(i));
|
||||
|
||||
db.addProcessingResult(run_id, result.resultsVNLE, result.equalizerConfigVNLE);
|
||||
|
||||
% eq_ = FFE_adaptive_decision("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
|
||||
% 0.0003,"mu_tr",0,"order",50,"sps",2,"decide",1,"buffer_length",params(i));
|
||||
%
|
||||
% result = vnle(eq_,4,Scpe_sig,Symbols,Tx_bits,"precode_mode",db_mode.no_db,'showAnalysis',1,"postFFE",[],"eth_style_symbol_mapping",0);
|
||||
% ber_dc(i) = result.ber_vnle;
|
||||
%
|
||||
% fprintf(" FFE+dc tr. Results: %.2e\n", ber_dc(i));
|
||||
|
||||
end
|
||||
|
||||
figure(103435)
|
||||
hold on;
|
||||
% scatter(params,ber_dc,15,'Marker','o','LineWidth',1,'DisplayName','DC tracking');
|
||||
% [a,b]=min(ber_dc);
|
||||
% scatter(params(b),a,45,'Marker','x','MarkerEdgeColor','r','LineWidth',1);
|
||||
|
||||
scatter(params,ber_ffe,15,'Marker','square','LineWidth',1);
|
||||
[a,b]=min(ber_ffe);
|
||||
scatter(params(b),a,45,'Marker','x','MarkerEdgeColor','r','LineWidth',1,'DisplayName','FFE');
|
||||
|
||||
legend('Interpreter', 'latex');
|
||||
xlabel('Occurences');
|
||||
ylabel('BER');
|
||||
grid on;
|
||||
beautifyBERplot;
|
||||
ylim([1e-4,0.1 ])
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
run_id = 231;
|
||||
run_id = 3966;
|
||||
|
||||
savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
|
||||
databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
@@ -9,7 +9,22 @@ db = DBHandler("type","mysql");
|
||||
% db = DBHandler("pathToDB", [databasePath, database_name],"type","sqlite");
|
||||
|
||||
filterParams = db.tables;
|
||||
filterParams.Configurations = struct('run_id', run_id);
|
||||
% filterParams.Configurations = struct('run_id', run_id);
|
||||
filterParams.Configurations = struct( ...
|
||||
'symbolrate', [], ... %[224,336,360,390,420,448]
|
||||
'fiber_length', 0, ...
|
||||
'db_mode', '"no_db"', ...
|
||||
'interference_attenuation', 4, ...
|
||||
'interference_path_length', 10, ...
|
||||
'is_mpi', 1, ...
|
||||
'pam_level', [], ...
|
||||
'wavelength', 1310, ...
|
||||
'precomp_amp', [], ...
|
||||
'signal_attenuation', [], ...
|
||||
'v_awg', [], ...
|
||||
'v_bias', 2.65 ...
|
||||
);
|
||||
|
||||
|
||||
selectedFields = {'Runs.run_id','Runs.tx_bits_path','Runs.tx_signal_path','Runs.tx_symbols_path','Runs.rx_sync_path','Runs.rx_raw_path',...
|
||||
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp','Measurements.power_rop','Configurations.v_bias',...
|
||||
@@ -18,29 +33,36 @@ selectedFields = {'Runs.run_id','Runs.tx_bits_path','Runs.tx_signal_path','Runs.
|
||||
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
|
||||
|
||||
[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices
|
||||
dataTable = dataTable(uniqueIdx,:); % Extract unique configurations for each run_id
|
||||
|
||||
fsym = dataTable.symbolrate;
|
||||
M = double(dataTable.pam_level);
|
||||
duob_mode = db_mode.(strrep(char(dataTable.db_mode),'"',''));
|
||||
|
||||
Tx_signal = load([savePath, char(dataTable.tx_signal_path)]);
|
||||
Tx_signal = Tx_signal.Digi_sig;
|
||||
for i = 1:4%size(dataTable,1)
|
||||
dataTable_ = dataTable(i,:); % Extract unique configurations for each run_id
|
||||
|
||||
fsym = dataTable_.symbolrate;
|
||||
M = double(dataTable_.pam_level);
|
||||
duob_mode = db_mode.(strrep(char(dataTable_.db_mode),'"',''));
|
||||
|
||||
Tx_signal = load([savePath, char(dataTable_.tx_signal_path)]);
|
||||
Tx_signal = Tx_signal.Digi_sig;
|
||||
|
||||
Tx_bits = load([savePath, char(dataTable.tx_bits_path)]);
|
||||
Tx_bits = Tx_bits.Bits;
|
||||
Symbols_mapped = PAMmapper(M,0).map(Tx_bits);
|
||||
Symbols_mapped.fs = dataTable.symbolrate;
|
||||
Tx_bits = load([savePath, char(dataTable_.tx_bits_path)]);
|
||||
Tx_bits = Tx_bits.Bits;
|
||||
Symbols_mapped = PAMmapper(M,0).map(Tx_bits);
|
||||
Symbols_mapped.fs = dataTable_.symbolrate;
|
||||
|
||||
Symbols = load([savePath, char(dataTable.tx_symbols_path)]);
|
||||
Symbols = Symbols.Symbols;
|
||||
Symbols = load([savePath, char(dataTable_.tx_symbols_path)]);
|
||||
Symbols = Symbols.Symbols;
|
||||
|
||||
Scpe_sig_raw = load([savePath, char(dataTable_.rx_raw_path(1))]);
|
||||
Scpe_sig_raw = Scpe_sig_raw.Scpe_sig_raw;
|
||||
Scpe_sig_raw.plot("displayname",['Scope Signal (Run ID: ',num2str(dataTable_.run_id)],"fignum",dataTable_.run_id,"clear",0);
|
||||
|
||||
Scpe_sig_raw = load([savePath, char(dataTable.rx_raw_path(1))]);
|
||||
Scpe_sig_raw = Scpe_sig_raw.Scpe_sig_raw;
|
||||
Scpe_sig_resampled = Scpe_sig_raw.resample("fs_in",Scpe_sig_raw.fs,"fs_out",2*fsym);
|
||||
[~,Scpe_cell,found_sync,~,shifts] = Scpe_sig_resampled.tsynch("reference",Symbols,"fs_ref",dataTable.symbolrate,"debug_plots",1);
|
||||
|
||||
shifts_mus = shifts./Scpe_sig_resampled.fs .*1e6;
|
||||
Scpe_sig_raw.plot("displayname",['Scope Signal (Run ID: ',num2str(run_id)],"fignum",2024,"clear",1);
|
||||
hold on;
|
||||
xline(shifts_mus,'HandleVisibility','off');
|
||||
Scpe_sig_resampled = Scpe_sig_raw.resample("fs_in",Scpe_sig_raw.fs,"fs_out",2*fsym);
|
||||
[~,Scpe_cell,found_sync,~,shifts] = Scpe_sig_resampled.tsynch("reference",Symbols,"fs_ref",dataTable_.symbolrate,"debug_plots",1);
|
||||
|
||||
shifts_mus = shifts./Scpe_sig_resampled.fs .*1e6;
|
||||
Scpe_sig_raw.plot("displayname",['Scope Signal (Run ID: ',num2str(dataTable_.run_id)],"fignum",dataTable_.run_id,"clear",0);
|
||||
hold on;
|
||||
xline(shifts_mus,'HandleVisibility','off');
|
||||
end
|
||||
@@ -1,67 +1,129 @@
|
||||
|
||||
local = 1;
|
||||
|
||||
if local
|
||||
databasePath = 'C:\Users\sioe\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
|
||||
else
|
||||
databasePath = '\\ntserver.tf.uni-kiel.de\scratch\sioe\ECOC_2025\';
|
||||
end
|
||||
|
||||
database_name = 'ecoc2025_loops.db';
|
||||
database = DBHandler("pathToDB", [databasePath, database_name]);
|
||||
|
||||
figure();
|
||||
plotBoundaries = 1;
|
||||
plotRealizations = 1;
|
||||
cols = linspecer(3); % Ensure color count matches
|
||||
% cols = cols(8,:);
|
||||
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
|
||||
% database = DBHandler("pathToDB",[basePath,'silas_labor.db']);
|
||||
database = DBHandler("type",'mysql');
|
||||
|
||||
filterParams = database.tables;
|
||||
%filterParams.Runs.loop_id = 209;
|
||||
filterParams.Configurations = struct( ...
|
||||
'symbolrate', 112e9, ... %[224,336,360,390,420,448]
|
||||
'fiber_length', 0, ...
|
||||
'db_mode', '"no_db"', ...
|
||||
'interference_attenuation', [], ...
|
||||
'interference_path_length', 10, ...
|
||||
'interference_path_length', [], ...
|
||||
'is_mpi', 1, ...
|
||||
'pam_level', 4, ...
|
||||
'wavelength', 1310, ...
|
||||
'precomp_amp', [], ...
|
||||
'signal_attenuation', [], ...
|
||||
'v_awg', 0.95, ...
|
||||
'v_bias', 2.5 ...
|
||||
'v_awg', [], ...
|
||||
'v_bias', [] ...
|
||||
);
|
||||
|
||||
% filterParams.EqualizerParameters.diff_precode = int32(db_mode.db_encoded);
|
||||
% filterParams.EqualizerParameters.equalizer_structure = int32(equalizer_structure.vnle);
|
||||
|
||||
% if 1
|
||||
% % filterParams.EqualizerParameters.dc_buffer_len = 1;
|
||||
% filterParams.EqualizerParameters.ffe_buffer_len = 1;
|
||||
% filterParams.EqualizerParameters.smoothing_buffer_len = 4096;
|
||||
% filterParams.EqualizerParameters.smoothing_buffer_update = 224;
|
||||
% filterParams.EqualizerParameters.DCmu = 0;
|
||||
% end
|
||||
|
||||
selectedFields = {'Configurations.run_id' 'Runs.loop_id' 'Runs.date_of_run' 'Runs.rx_raw_path' 'Configurations.bitrate' 'Configurations.v_bias' 'Configurations.v_awg' 'Configurations.precomp_amp' 'Configurations.symbolrate' 'Configurations.pam_level'...
|
||||
'Configurations.db_mode' 'Configurations.rop_attenuation' 'Configurations.is_mpi' 'Configurations.interference_attenuation' 'Configurations.interference_path_length' 'Configurations.signal_attenuation' ...
|
||||
'EqualizerParameters.equalizer_structure' 'EqualizerParameters.diff_precode' 'EqualizerParameters.eq_id' 'Measurements.power_pd_in' ...
|
||||
'Measurements.power_mpi_interference' 'Measurements.power_mpi_signal' 'Results.BER' 'Results.BER_precoded' 'Results.SNR' 'Results.GMI' 'Results.Alpha' 'Results.date_of_processing'};
|
||||
'EqualizerParameters.equalizer_structure' 'EqualizerParameters.diff_precode' 'EqualizerParameters.eq_id' 'EqualizerParameters.dc_buffer_len' 'EqualizerParameters.ffe_buffer_len' 'EqualizerParameters.smoothing_buffer_len' 'EqualizerParameters.smoothing_buffer_update' 'EqualizerParameters.DCmu' 'Measurements.power_pd_in' ...
|
||||
'Measurements.power_mpi_interference' 'Measurements.power_mpi_signal' 'Results.BER' 'Results.BER_precoded' 'Results.EVM' 'Results.SNR' 'Results.GMI' 'Results.Alpha' 'Results.date_of_processing'};
|
||||
|
||||
[dataTable,sql_query] = database.queryDB(filterParams, selectedFields);
|
||||
dataTable.SIR = round(-6 - dataTable.power_mpi_interference);
|
||||
dataTable = cleanUpTable(dataTable);
|
||||
% [dataTable_raw,sql_query] = database.queryDB(filterParams, selectedFields);
|
||||
|
||||
%%
|
||||
|
||||
|
||||
|
||||
|
||||
dataTable_clean = dataTable_raw;
|
||||
dataTable_clean.SIR = round(-7.5 - dataTable_clean.power_mpi_interference);
|
||||
dataTable_clean.NGMI = dataTable_clean.GMI ./ log2(dataTable_clean.pam_level);
|
||||
dataTable_clean = cleanUpTable(dataTable_clean);
|
||||
|
||||
%%
|
||||
|
||||
dataTable = dataTable_clean;
|
||||
|
||||
figure(26);
|
||||
plotBoundaries = 1;
|
||||
plotRealizations = 0;
|
||||
cols = linspecer(8); % Ensure color count matches
|
||||
|
||||
% ideal DC tracking
|
||||
if 0
|
||||
dataTable = dataTable(dataTable.dc_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.ffe_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_len == 0, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_update == 0, :);
|
||||
dataTable = dataTable(dataTable.DCmu == 0.005, :);
|
||||
cols = cols(1:1+1,:);
|
||||
method = 'ideal dc tracking';
|
||||
% slow DC tracking
|
||||
elseif 1
|
||||
|
||||
dataTable = dataTable(dataTable.dc_buffer_len == 224, :);
|
||||
dataTable = dataTable(dataTable.ffe_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_len == 0, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_update == 0, :);
|
||||
dataTable = dataTable(dataTable.DCmu == 0.005, :);
|
||||
cols = cols(2:2+1,:);
|
||||
method = 'parallelized dc tracking';
|
||||
% slow DC smoothing
|
||||
elseif 0
|
||||
|
||||
dataTable = dataTable(dataTable.dc_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.ffe_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_len == 4096, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_update == 224, :);
|
||||
dataTable = dataTable(dataTable.DCmu == 0, :);
|
||||
cols = cols(3:3+1,:);
|
||||
method = 'dc smoothing';
|
||||
elseif 0
|
||||
% No compensation method
|
||||
dataTable = dataTable(dataTable.dc_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.ffe_buffer_len == 1, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_len == 0, :);
|
||||
dataTable = dataTable(dataTable.smoothing_buffer_update == 0, :);
|
||||
dataTable = dataTable(dataTable.DCmu == 0, :);
|
||||
cols = cols(4:4+1,:);
|
||||
method = 'ffe only';
|
||||
end
|
||||
|
||||
dataTable(dataTable.eq_id==0,:) = [];
|
||||
dataTable(dataTable.equalizer_structure~=1,:) = [];
|
||||
|
||||
% dataTable.interference_path_length(dataTable.interference_path_length < 20, :) = 20;
|
||||
|
||||
dataTable = dataTable(dataTable.interference_path_length == 1000, :);
|
||||
|
||||
% dataTable(dataTable.interference_path_length ~= 50, :) = [];
|
||||
% dataTable = dataTable(dataTable.interference_path_length < 51, :);
|
||||
|
||||
% dataTable(dataTable.loop_id<200,:) = [];
|
||||
|
||||
% Filter by time
|
||||
filter_by_time = 0;
|
||||
if filter_by_time
|
||||
startTime = datetime('2025-04-14 13:00:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
stopTime = datetime('2025-04-14 19:30:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
startTime = datetime('2025-04-20 18:00:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
stopTime = datetime('2025-04-30 19:30:00', 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
dataTable.date_of_run = datetime(dataTable.date_of_run, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable.date_of_processing = datetime(dataTable.date_of_processing, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
dataTable = dataTable(dataTable.date_of_processing > startTime, :);
|
||||
dataTable = dataTable(dataTable.date_of_processing < stopTime, :);
|
||||
end
|
||||
|
||||
% Group by smth
|
||||
y_var = 'BER';
|
||||
x_var = 'SIR';
|
||||
|
||||
loop_var = 'eq_id';
|
||||
fixedVars = {'eq_id',x_var};
|
||||
loop_var = 'interference_path_length';
|
||||
fixedVars = {'equalizer_structure','interference_path_length',x_var};
|
||||
|
||||
[dataTable, outliersTable] = removeGroupOutliers(dataTable, fixedVars, y_var);
|
||||
|
||||
@@ -69,14 +131,13 @@ dataTableGrpd_mean = groupIt(fixedVars, dataTable, @mean);
|
||||
dataTableGrpd_min = groupIt(fixedVars, dataTable, @min);
|
||||
dataTableGrpd_max = groupIt(fixedVars, dataTable, @max);
|
||||
|
||||
|
||||
% Create a new figure
|
||||
mkr = '.';
|
||||
hold on
|
||||
|
||||
unique_loop_var = unique(dataTable.(loop_var));
|
||||
|
||||
for i = 1%:numel(unique_loop_var)
|
||||
for i = 1:numel(unique_loop_var)
|
||||
|
||||
% Prepare filtered data for this loop variable
|
||||
loopValue = unique_loop_var(i);
|
||||
@@ -98,32 +159,43 @@ for i = 1%:numel(unique_loop_var)
|
||||
y_bounds = [y_lower, y_upper];
|
||||
|
||||
% Display name (optional)
|
||||
idx = find(dataTable.(loop_var) == loopValue, 1, 'first');
|
||||
dispname = equalizer_structure(dataTable.equalizer_structure(idx));
|
||||
dispname = [char(dispname),'; ',num2str(unique(dataTable.interference_path_length)),' m'];
|
||||
try
|
||||
idx = find(dataTable.(loop_var) == loopValue, 1, 'first');
|
||||
% dispname = char(equalizer_structure(dataTable.equalizer_structure(idx)));
|
||||
dispname = [method];
|
||||
dispname = [dispname, '/ ',num2str(unique_loop_var(i)) ,' m'];
|
||||
% dispname = [dispname,'; ',num2str(unique(dataTable.interference_path_length)),' m'];
|
||||
dispname = [dispname, '/ PAM ', num2str(filterParams.Configurations.pam_level)];
|
||||
dispname = [dispname, '/ ', num2str(filterParams.Configurations.symbolrate.*1e-9),' GBd'];
|
||||
end
|
||||
|
||||
if plotBoundaries
|
||||
% Plot bounded line
|
||||
[hl, hp] = boundedline(x_values, y_mean, y_bounds, ...
|
||||
'alpha', 'transparency', 0.2, ...
|
||||
'alpha', 'transparency', 0.1, ...
|
||||
'cmap', cols(i,:), ...
|
||||
'nan', 'fill', ...
|
||||
'orientation', 'vert');
|
||||
|
||||
% Style the main line: thinnest, dotted, no marker
|
||||
% % Style the main line: thinnest, dotted, no marker
|
||||
set(hl, 'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none', ...
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
|
||||
plt = errorbar(x_values,y_mean,y_lower,y_upper,'LineWidth', 0.1, 'LineStyle', 'none', 'Marker', 'none','Color', cols(i,:), 'DisplayName', string(dispname),'HandleVisibility','off');
|
||||
|
||||
% Hide patch (shaded area) from legend
|
||||
set(hp, 'HandleVisibility', 'off','LineStyle',':','LineWidth',0.5,'Marker','none');
|
||||
|
||||
% Add invisible scatter for DataTips
|
||||
plt = scatter(x_values, y_mean, ...
|
||||
'Marker', 'o', 'MarkerEdgeColor', 'none', 'MarkerFaceColor', 'none', ...
|
||||
'HandleVisibility', 'off', 'PickableParts', 'all');
|
||||
% % Add invisible scatter for DataTips
|
||||
% plt = scatter(x_values, y_mean, ...
|
||||
% 'Marker', 'o', 'MarkerEdgeColor', 'none', 'MarkerFaceColor', 'none', ...
|
||||
% 'HandleVisibility', 'off', 'PickableParts', 'all');
|
||||
else
|
||||
|
||||
plt= plot(x_values,y_mean,'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none', ...
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
'Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
% plt= errorbar(x_values,y_mean,y_lower,y_upper,'LineWidth', 1, 'LineStyle', '-', 'Marker', 'none','Color', cols(i,:), 'DisplayName', string(dispname));
|
||||
|
||||
end
|
||||
% Add data tips to the invisible scatter
|
||||
pair_one = {'Run ID', dataTableGrpd_mean.run_id(loopFiltGrpd, :)};
|
||||
@@ -146,7 +218,7 @@ for i = 1%:numel(unique_loop_var)
|
||||
y_single = double(dataTable.(y_var)(loopFiltSingle, :));
|
||||
|
||||
sc = scatter(x_single, y_single, 'Marker', mkr, 'MarkerEdgeColor', cols(i, :), ...
|
||||
'LineWidth', 0.5, 'HandleVisibility', 'on', 'DisplayName', string(dispname));
|
||||
'LineWidth', 0.5, 'HandleVisibility', 'off', 'DisplayName', string(dispname));
|
||||
|
||||
pair_one = {'Run ID', dataTable.run_id(loopFiltSingle, :)};
|
||||
pair_two = {'Rate', dataTable.bitrate(loopFiltSingle, :) * 1e-9};
|
||||
@@ -161,12 +233,14 @@ xlabel(x_var);
|
||||
ylabel(y_var);
|
||||
title([x_var, ' vs. ', y_var]);
|
||||
|
||||
if y_var == 'BER'
|
||||
if string(y_var) == "BER"
|
||||
yline(4e-4, 'LineWidth', 1, 'LineStyle', '--', 'HandleVisibility', 'off');
|
||||
yline(3.8e-3, 'LineWidth', 1, 'LineStyle', '--', 'HandleVisibility', 'off');
|
||||
yline(2e-2, 'LineWidth', 1, 'LineStyle', '--', 'HandleVisibility', 'off');
|
||||
ylim([1e-5, 0.1]);
|
||||
end
|
||||
|
||||
xlim([15,50]);
|
||||
xlim([13,35]);
|
||||
|
||||
% Enable grid and beautify
|
||||
grid on;
|
||||
@@ -243,7 +317,6 @@ resultTable.nRows = groupCount;
|
||||
end
|
||||
|
||||
|
||||
|
||||
function addDatatips(sc, varargin)
|
||||
% addDatatips Adds custom data tip rows to a scatter plot.
|
||||
%
|
||||
@@ -283,7 +356,6 @@ end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function cleanedTable = cleanUpTable(inputTable)
|
||||
% cleanUpTable Cleans a MATLAB table where numbers and NaNs are stored as strings or structs.
|
||||
%
|
||||
@@ -335,7 +407,7 @@ for i = 1:numel(varNames)
|
||||
else
|
||||
% Try convert to datetime
|
||||
try
|
||||
cleanedTable.(varNames{i}) = datetime(col, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
|
||||
cleanedTable.(varNames{i}) = datetime(col, 'InputFormat', 'yyyy-MM-dd HH:mm:ss');
|
||||
catch
|
||||
% Leave as string
|
||||
end
|
||||
@@ -391,8 +463,9 @@ for groupIdx = 1:height(groupKeys)
|
||||
continue;
|
||||
end
|
||||
|
||||
% Detect outliers
|
||||
outlierMask = isoutlier(y_values, 'quartiles');
|
||||
% Detect outliers in log space
|
||||
y_log = log10(y_values);
|
||||
outlierMask = isoutlier(y_log, 'quartiles'); % or 'median', 'grubbs', etc.
|
||||
|
||||
% If any outliers found, collect their data
|
||||
if any(outlierMask)
|
||||
|
||||
@@ -12,6 +12,7 @@ arguments
|
||||
savePath
|
||||
options.parallel (1,1) logical = true
|
||||
options.max_occurences = 1;
|
||||
options.paramstruct = struct();
|
||||
end
|
||||
|
||||
if options.parallel
|
||||
@@ -29,7 +30,8 @@ if options.parallel
|
||||
"database_name", database_name, ...
|
||||
'storage_path', savePath, ...
|
||||
'append_to_db', 1, ...
|
||||
'max_occurences', options.max_occurences ...
|
||||
'max_occurences', options.max_occurences, ...
|
||||
'parameters', options.paramstruct ...
|
||||
);
|
||||
|
||||
output = [];
|
||||
@@ -46,7 +48,8 @@ else
|
||||
"database_name", database_name, ...
|
||||
'storage_path', savePath, ...
|
||||
'append_to_db', 1, ...
|
||||
'max_occurences', options.max_occurences ...
|
||||
'max_occurences', options.max_occurences,...
|
||||
'parameters', options.paramstruct ...
|
||||
);
|
||||
|
||||
future = []; % No future since it's synchronous
|
||||
|
||||
Reference in New Issue
Block a user