Unify scope preprocessing and simulation DSP handoff

This commit is contained in:
Silas Oettinghaus
2026-03-25 14:52:43 +01:00
parent 8c55b25112
commit d3235a5c9c
6 changed files with 317 additions and 116 deletions

View File

@@ -62,7 +62,9 @@ mu_dfe = 0.0004;
dfe_ = sum(dfe_order)>0;
% duob_mode = db_mode.no_db;
duob_mode = db_mode.no_db;
decoding_mode = [];
bitrate = fsym * log2(M);
%%% change specific parameter if given in varargin
% Parse optional input arguments
@@ -158,82 +160,50 @@ Scpe_sig = Scope("fsimu",fdac*kover,"fadc",fadc,...
"samplingdelay",0,"rand_samplingdelay",0,"freq_offset",0,"samp_jitter",0,...
"adcresolution",8,"quantbuffer",0.1,'block_dc',1,'lpf_active',1,'H_lpf',Lp_scpe).process(Rx_sig);
txPulseformer = [];
if apply_pulsef
txPulseformer = Pform;
end
dspParameters = struct();
dspParameters.len_tr = len_tr;
dspParameters.mu_ffe = mu_ffe;
dspParameters.mu_dfe = mu_dfe;
dspParameters.mu_dc = mu_dc;
dspParameters.use_ffe = 1;
dspParameters.use_dfe = 1;
dspParameters.use_vnle_mlse = 1;
dspParameters.use_dbtgt = 1;
dspParameters.use_dbenc = 0;
dspParameters.use_ml_mlse = 0;
dspParameters.showAnalysis = 0;
dspParameters.pf_ncoeffs = pf_ncoeffs;
dspParameters.ffe_order_ffe = [50, 0, 0];
dspParameters.ffe_order_dfe = [50, 0, 0];
dspParameters.dfe_feedback_order = [2, 0, 0];
dspParameters.ffe_order_vnle = [200, 0, 0];
dspParameters.dfe_order_vnle = dfe_order;
dspParameters.ffe_order_dbtgt = [50, 0, 0];
dspParameters.dfe_order_dbtgt = dfe_order;
dspParameters.decoding_mode = decoding_mode;
scopeOutput = dsp_scope_signal(Scpe_sig, Symbols, Tx_bits, ...
"fsym", fsym, ...
"M", M, ...
"duob_mode", duob_mode, ...
"parameters", dspParameters, ...
"preprocess_mode", "auto", ...
"tx_pulseformer", txPulseformer, ...
"debug_plots", false);
output = struct();
output.ffe_results = scopeOutput.ffe_package;
output.dfe_results = scopeOutput.dfe_package;
output.vnle_results = scopeOutput.vnle_package;
output.mlse_results = scopeOutput.mlse_package;
output.dbt_results = scopeOutput.dbtgt_package;
output.dbenc_results = scopeOutput.dbenc_package;
output.mlmlse_results = scopeOutput.mlmlse_package;
%%%%%% Sample to 2x fsym %%%%%%
Scpe_sig = Scpe_sig.resample("fs_out",2*fsym);
Scpe_sig.signal = Scpe_sig.signal(1:2*length(Symbols));
%%%%%% Sync Rx signal with reference %%%%%%
[Scpe_sig,~] = Scpe_sig.tsynch("reference",Symbols,"fs_ref",fsym,"debug_plots",0);
Scpe_sig = Filter('filtdegree',4,"f_cutoff",Symbols.fs.*0.5,"fs",Scpe_sig.fs,"filterType",filtertypes.gaussian,"active",true).process(Scpe_sig);
Scpe_sig = Scpe_sig - mean(Scpe_sig.signal);
%%% EQUALIZING
if 1
% -------------------- FFE --------------------
ffe_order = [50, 0, 0];
eq_ffe = EQ("Ne",ffe_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);
% -------------------- FFE --------------------
ffe_order = [50, 0, 0];
eq_ffe = EQ("Ne",ffe_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);
output.ffe_results = ffe(eq_ffe,M,Scpe_sig,Symbols,Tx_bits, ...
"precode_mode",duob_mode,'showAnalysis',0,"postFFE",[], ...
"eth_style_symbol_mapping",0);
output.ffe_results.metrics.print
% -------------------- DFE --------------------
eq_dfe = EQ("Ne",ffe_order,"Nb",[2,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);
output.dfe_results = ffe(eq_dfe,M,Scpe_sig,Symbols,Tx_bits, ...
"precode_mode",duob_mode,'showAnalysis',0,"postFFE",[], ...
"eth_style_symbol_mapping",0);
output.dfe_results.metrics.print("description",'DFE');
% -------------------- VNLE + MLSE --------------------
pf_ncoeffs = 1;
ffe_order3 = [200, 0, 0];
eq_v = EQ("Ne",ffe_order3,"Nb",dfe_order, ...
"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",1);
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels);
[output.vnle_results, output.mlse_results] = vnle_postfilter_mlse(eq_v, pf_, mlse_, M, Scpe_sig, Symbols, Tx_bits, ...
"precode_mode", duob_mode, 'showAnalysis', 0, "postFFE", [], "eth_style_symbol_mapping", 0);
% -------------------- DB target --------------------
mlse_db_ = MLSE("DIR",[1,1],"duobinary_output",0,"M",M,'trellis_states',PAMmapper(M,0).levels);
ffe_order = [50, 0, 0];
eq_ = EQ("Ne",ffe_order,"Nb",dfe_order,"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",1);
output.dbt_results = duobinary_target(eq_,mlse_db_, M, Scpe_sig, Symbols, Tx_bits, ...
"precode_mode", duob_mode, 'showAnalysis', 0, "postFFE", [], "decoding_mode", decoding_mode);
output.dbt_results.metrics.print("description",'Duobinary');
disp('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ')
fprintf('\n')
end
disp('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ')
fprintf('\n')