restructure and organize
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
% dsp_options.database_name = 'silas_labor_newdsp_newstructure.db';
|
||||
% dsp_options.storage_path = 'Z:\2024\sioe_labor\';
|
||||
%
|
||||
% dsp_options.parameters = struct();
|
||||
% dsp_options.parameters.mu_dc = [0.005];
|
||||
% dsp_options.userParameters = struct();
|
||||
% dsp_options.userParameters.mu_dc = [0.005];
|
||||
%
|
||||
% % === Get Run ID's ===
|
||||
% db = DBHandler("pathToDB", [dsp_options.database_path, dsp_options.database_name], "type", "sqlite");
|
||||
@@ -21,6 +21,7 @@ dsp_options.storage_path = 'W:\labdata\ECOC Silas\ECOC Silas\ecoc_2025\';
|
||||
dsp_options.server = "192.168.178.192";% "134.245.243.254";
|
||||
dsp_options.user = "silas";
|
||||
dsp_options.password = "silas";
|
||||
dsp_options.userParameters = struct();
|
||||
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase],...
|
||||
"type", dsp_options.database_type,...
|
||||
@@ -40,7 +41,7 @@ fp.where('Runs', 'bitrate','EQUALS', 360e9);
|
||||
[dataTable,~] = db.queryDB(fp, db.getTableFieldNames('Runs'));
|
||||
|
||||
% === Initialize DataStorage ===
|
||||
wh = DataStorage(dsp_options.parameters);
|
||||
wh = DataStorage(dsp_options.userParameters);
|
||||
wh.addStorage("ffe_package");
|
||||
wh.addStorage("mlse_package");
|
||||
wh.addStorage("vnle_package");
|
||||
@@ -131,4 +132,4 @@ ylabel(y_var, 'Interpreter', 'none');
|
||||
legend('show', 'Location', 'best');
|
||||
grid on;
|
||||
title(sprintf('%s vs. %s', y_var, x_var), 'Interpreter', 'none');
|
||||
hold off;
|
||||
hold off;
|
||||
|
||||
@@ -4,7 +4,7 @@ arguments
|
||||
run_id
|
||||
options.append_to_db = 0;
|
||||
options.max_occurences = 4;
|
||||
options.parameters = struct();
|
||||
options.userParameters = struct();
|
||||
|
||||
options.database_path
|
||||
options.database_name
|
||||
@@ -60,8 +60,8 @@ ffe_buffer_len = 1;
|
||||
smoothing_buffer_length = 4096;
|
||||
smoothing_buffer_update = 224;
|
||||
|
||||
% Overwrite default parameters if given in options.parameters
|
||||
paramStruct = options.parameters;
|
||||
% Overwrite default parameters if given in options.userParameters
|
||||
paramStruct = options.userParameters;
|
||||
if ~isempty(paramStruct)
|
||||
paramNames = fieldnames(paramStruct);
|
||||
for i = 1:numel(paramNames)
|
||||
@@ -261,4 +261,4 @@ output.vnle_pf_package = vnle_pf_package;
|
||||
output.vnle_package = vnle_package;
|
||||
output.dbtgt_package = dbtgt_package;
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ 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);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'userParameters',params);
|
||||
end
|
||||
|
||||
% ideal DC tracking
|
||||
@@ -66,7 +66,7 @@ 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);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'userParameters',params);
|
||||
end
|
||||
|
||||
% DC smoothing
|
||||
@@ -79,7 +79,7 @@ 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);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'userParameters',params);
|
||||
end
|
||||
|
||||
% only FFE
|
||||
@@ -92,7 +92,7 @@ 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);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'userParameters',params);
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ 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);
|
||||
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'userParameters',params);
|
||||
end
|
||||
|
||||
% Extract all ber_mlse values from the vnle_pf_package using cellfun
|
||||
|
||||
@@ -45,46 +45,12 @@ for i = 1:size(dataTable,1)
|
||||
Scpe_sig_raw.plot("displayname",['Scope Signal (Run ID: ',num2str(dataTable_.run_id)],"fignum",dataTable_.run_id,"clear",0);
|
||||
|
||||
|
||||
Scpe_sig_resampled = Scpe_sig_raw.resample("fs_in",Scpe_sig_raw.fs,"fs_out",fsym);
|
||||
[~,Scpe_cell,found_sync,test,shifts] = Scpe_sig_resampled.tsynch("reference",Symbols,"fs_ref",dataTable_.symbolrate,"debug_plots",0);
|
||||
|
||||
shifts_mus = shifts./Scpe_sig_resampled.fs .*1e6;
|
||||
Scpe_sig_resampled = Scpe_sig_resampled.normalize("mode","rms");
|
||||
% Scpe_sig_resampled.plot("displayname",['Scope Signal (Run ID: ',num2str(dataTable_.run_id)],"fignum",dataTable_.run_id,"clear",0);
|
||||
hold on;
|
||||
% xline(shifts_mus,'HandleVisibility','off');
|
||||
|
||||
shifts = shifts-shifts(1)+1;
|
||||
sep_sig = NaN(M,length(Scpe_sig_resampled));
|
||||
avg_sig = NaN(M,length(Scpe_sig_resampled));
|
||||
for j = 1:size(Scpe_cell,1)
|
||||
|
||||
[sep_sig_,avg_sig_]=showLevelScatter(Scpe_cell{j}.resample("fs_out",Symbols.fs),Symbols,"fignum",400);
|
||||
s = shifts(j);
|
||||
sep_sig(:,s+1:s+length(sep_sig_)) = sep_sig_;
|
||||
avg_sig(:,s+1:s+length(avg_sig_)) = avg_sig_;
|
||||
|
||||
end
|
||||
|
||||
disp(num2str(dataTable_.interference_path_length));
|
||||
[sep_sig, avg_sig] = showLevelScatter(Scpe_sig_raw, Symbols, ...
|
||||
"fsym", fsym, ...
|
||||
"syncFs", 2*fsym, ...
|
||||
"fignum", 400, ...
|
||||
"normalize", true, ...
|
||||
"debug_plots", false);
|
||||
var(sep_sig,0,2,'omitnan')
|
||||
|
||||
xax_in_sec = ((1:length(avg_sig)) / fsym) * 1e6;
|
||||
figure();hold on;
|
||||
cols = cbrewer2('Paired',8);
|
||||
for p = 1:size(avg_sig,1)
|
||||
sc=scatter(xax_in_sec,sep_sig(p,:),1,'.','MarkerEdgeColor',cols((2*p)-1,:),'MarkerEdgeAlpha',0.2);
|
||||
end
|
||||
for p = 1:size(avg_sig,1)
|
||||
sc=plot(xax_in_sec,avg_sig(p,:),'LineWidth',1,'Color',cols((2*p),:));
|
||||
end
|
||||
|
||||
yline(unique(Symbols.signal),'HandleVisibility','off');
|
||||
% xline(shifts./ fsym .*1e6,'HandleVisibility','off');
|
||||
xlabel('time in $\mu$s');
|
||||
ylabel('Normalized Amplitude');
|
||||
xlim([0 25]);
|
||||
ylim([-3 3]);
|
||||
|
||||
drawnow;
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ arguments
|
||||
savePath
|
||||
options.parallel (1,1) logical = true
|
||||
options.max_occurences = 1;
|
||||
options.paramstruct = struct();
|
||||
options.userParameters = struct();
|
||||
end
|
||||
|
||||
if options.parallel
|
||||
@@ -31,7 +31,7 @@ if options.parallel
|
||||
'storage_path', savePath, ...
|
||||
'append_to_db', 1, ...
|
||||
'max_occurences', options.max_occurences, ...
|
||||
'parameters', options.paramstruct ...
|
||||
'userParameters', options.userParameters ...
|
||||
);
|
||||
|
||||
output = [];
|
||||
@@ -49,7 +49,7 @@ else
|
||||
'storage_path', savePath, ...
|
||||
'append_to_db', 1, ...
|
||||
'max_occurences', options.max_occurences,...
|
||||
'parameters', options.paramstruct ...
|
||||
'userParameters', options.userParameters ...
|
||||
);
|
||||
|
||||
future = []; % No future since it's synchronous
|
||||
|
||||
Reference in New Issue
Block a user