236 lines
8.7 KiB
Matlab
236 lines
8.7 KiB
Matlab
|
|
precomp_mode = 0;
|
|
precomp_path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\HighSpeedExperiment_2024\Auswertung_JLT";
|
|
precomp_fn = "precomp_simulated.mat";
|
|
|
|
% TX
|
|
M = 4;
|
|
fsym = 72e9;
|
|
f_nyquist = fsym/2;
|
|
apply_pulsef = 1;
|
|
fdac = 256e9;
|
|
fadc = 256e9;
|
|
% fdac = 2*fsym;
|
|
% fadc = 2*fsym;
|
|
random_key = 1;
|
|
|
|
duob_mode = db_mode.no_db;
|
|
|
|
tx_bwl = 0.8.*f_nyquist;
|
|
rx_bwl = 0.8.*f_nyquist;
|
|
|
|
rcalpha = 0.05;
|
|
kover = 16;
|
|
vbias_rel = 0.5;
|
|
u_pi = 2.9;
|
|
vbias = -vbias_rel*u_pi;
|
|
laser_wavelength = 1293;
|
|
laser_linewidth = 0;
|
|
|
|
|
|
% Channel
|
|
link_length = 60000;
|
|
|
|
% RX
|
|
rop = -8;
|
|
|
|
% EQ
|
|
eq_mode = equalizer_structure.vnle_pf_mlse;
|
|
ffe_order=[50,0,0];
|
|
vnle_order=[50,5,5];
|
|
dfe_order = [0 0 0];
|
|
|
|
len_tr = 4096*2;
|
|
mu_ffe = [0.0004 0.0004 0.0004];
|
|
mu_dfe = 0.0004;
|
|
mu_dc = 0.00;
|
|
|
|
dfe_ = sum(dfe_order)>0;
|
|
|
|
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rc","pulselength",16,"alpha",rcalpha);
|
|
|
|
[Digi_sig,Symbols,Tx_bits] = PAMsource(...
|
|
"fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
|
"fs_out",fdac,...
|
|
"applyclipping",0,"clipfactor",1.5,...
|
|
"applypulseform",apply_pulsef,"pulseformer",Pform,...
|
|
"randkey",random_key,...
|
|
"duobinary_mode",duob_mode).process();
|
|
|
|
if precomp_mode == 1 % measure channel
|
|
precomp_est = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',fdac);
|
|
Digi_sig = precomp_est.buildOFDM();
|
|
elseif precomp_mode == 2 % apply precomp
|
|
precomp_est = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs);
|
|
Digi_sig = precomp_est.precomp(Digi_sig,'maxampdb',-50,'loadPath',precomp_path,'fileName',precomp_fn);
|
|
end
|
|
|
|
% Symbols.spectrum("displayname",'Tx Symbols','fignum',10,'normalizeTo0dB',1);
|
|
|
|
Digi_sig.eye(fsym,M,"fignum",1234567);
|
|
%%%%% AWG
|
|
%El_sig = M8199B("kover",kover).process(Digi_sig);
|
|
El_sig = AWG("fdac",fdac,"f_cutoff",fsym,"lpf_active",0,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",1).process(Digi_sig);
|
|
% El_sig.spectrum("displayname",'Digi Spectrum','fignum',100,'normalizeTo0dB',0);
|
|
% El_sig = El_sig.setPower(0,"dBm");
|
|
El_sig.spectrum("displayname",'Tx Signal','fignum',10,'normalizeTo0dB',0);
|
|
%%%%% Low-pass el. components %%%%%%
|
|
|
|
El_sig = Filter('filtdegree',4,"f_cutoff",tx_bwl,"fs",fdac*kover,"filterType",filtertypes.gaussian,"active",true).process(El_sig);
|
|
% El_sig.spectrum("displayname",'Digi Spectrum','fignum',100,'normalizeTo0dB',1);
|
|
|
|
%%%%% Electrical Driver Amplifier %%%%%%
|
|
El_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",3).process(El_sig);
|
|
El_sig = El_sig.normalize("mode","oneone");
|
|
|
|
%%%%% MODULATE E/O CONVERSION %%%%%%
|
|
[Opt_sig] = EML("mode",eml_mode.im_cosinus,"power",3,"fsimu",El_sig.fs,"lambda",laser_wavelength,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth,"randomkey",random_key+1).process(El_sig);
|
|
|
|
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length/1000,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
|
|
|
%%%%%% ROP %%%%%%
|
|
Rx_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",rop).process(Opt_sig);
|
|
|
|
%%%%%% PD Square Law %%%%%%
|
|
Rx_sig = Photodiode("fsimu",fdac*kover,"dark_current",2e-08,"responsivity",1,"temperature",20,"nep",1.8e-11).process(Rx_sig);
|
|
|
|
%%%%%% Low-pass RX (PD, El. Connectors and Scope %%%%%%
|
|
Rx_sig = Filter('filtdegree',4,"f_cutoff",rx_bwl,"fs",fdac*kover,"filterType",filtertypes.bessel_inp,"active",true).process(Rx_sig);
|
|
|
|
% %%%%%% Low-pass Scope %%%%%%
|
|
Lp_scpe = Filter('filtdegree',4,"f_cutoff",35e9,"fs",fadc,"filterType",filtertypes.butterworth,"active",true);
|
|
|
|
% Rx_sig.spectrum("displayname",'Analog Rx Spectrum','fignum',100,'normalizeTo0dB',1);
|
|
|
|
%%%%%% Scope %%%%%%
|
|
Scpe_sig = Scope("fsimu",fdac*kover,"fadc",fadc,...
|
|
"delay",0,"fixed_delay",0,"filtertype",filtertypes.butterworth,...
|
|
"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);
|
|
|
|
Scpe_sig.spectrum("displayname",'Rx Signal','fignum',10,'normalizeTo0dB',1);
|
|
Scpe_sig.eye(fsym,M,"fignum",1973763)
|
|
|
|
%%%%% Precompensation Routine %%%%%%
|
|
if precomp_mode == 1
|
|
Scpe_sig_resampled = Scpe_sig.resample("fs_in",fadc,"fs_out",2*fsym);
|
|
precomp_est.estimate(Scpe_sig_resampled,"save",false,"savePath",precomp_path,"fileName",precomp_fn);
|
|
precomp_est.plot();
|
|
precomp_est.save();
|
|
end
|
|
|
|
% Preprocess signal
|
|
Scpe_sig = preprocessSignal(Scpe_sig, Symbols, fsym);
|
|
Scpe_sig.signal = Scpe_sig.signal(1:2*Symbols.length);
|
|
use_ffe = 0;
|
|
use_dfe = 0;
|
|
use_vnle_mlse = 1;
|
|
use_dbtgt = 1;
|
|
use_dbenc = 1;
|
|
|
|
|
|
if duob_mode ~= db_mode.db_encoded
|
|
|
|
if use_ffe
|
|
|
|
ffe_order = [50, 0, 0];
|
|
eq_dfe = 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_results = ffe(eq_dfe,M,Scpe_sig,Symbols,Tx_bits,...
|
|
"precode_mode",duob_mode,...
|
|
'showAnalysis',1,...
|
|
"postFFE",[],...
|
|
"eth_style_symbol_mapping",0);
|
|
|
|
disp('FFE:')
|
|
ffe_results.metrics.print;
|
|
|
|
|
|
end
|
|
|
|
if use_dfe
|
|
|
|
ffe_order = [50, 5, 5];
|
|
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);
|
|
|
|
dfe_results = ffe(eq_dfe,M,Scpe_sig,Symbols,Tx_bits,...
|
|
"precode_mode",duob_mode,...
|
|
'showAnalysis',0,...
|
|
"postFFE",[],...
|
|
"eth_style_symbol_mapping",0);
|
|
|
|
disp('DFE:')
|
|
dfe_results.metrics.print;
|
|
|
|
|
|
end
|
|
|
|
if use_vnle_mlse
|
|
|
|
if 0
|
|
pf_ncoeffs = 1;
|
|
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);
|
|
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
|
% mlse_ = MLSE_viterbi("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels);
|
|
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels);
|
|
|
|
[ffe_results, mlse_results] = vnle_postfilter_mlse(eq_, pf_, mlse_, M, Scpe_sig, Symbols, Tx_bits, ...
|
|
"precode_mode", duob_mode,...
|
|
'showAnalysis', 1, ...
|
|
"postFFE", [],...
|
|
"eth_style_symbol_mapping", 0);
|
|
|
|
disp('VNLE:')
|
|
ffe_results.metrics.print;
|
|
disp('MLSE:')
|
|
mlse_results.metrics.print;
|
|
end
|
|
|
|
pf_ncoeffs = 2;
|
|
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);
|
|
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
|
% mlse_ = MLSE_viterbi("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels);
|
|
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels);
|
|
|
|
[ffe_results, mlse_results] = vnle_postfilter_mlse(eq_, pf_, mlse_, M, Scpe_sig, Symbols, Tx_bits, ...
|
|
"precode_mode", duob_mode,...
|
|
'showAnalysis', 1, ...
|
|
"postFFE", [],...
|
|
"eth_style_symbol_mapping", 0);
|
|
|
|
disp('VNLE:')
|
|
ffe_results.metrics.print;
|
|
disp('MLSE:')
|
|
mlse_results.metrics.print;
|
|
|
|
|
|
end
|
|
|
|
if use_dbtgt
|
|
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);
|
|
|
|
mlse_db_ = MLSE("DIR",[1,1],"duobinary_output",0,"M",M,"trellis_states",PAMmapper(M,0).levels);
|
|
|
|
dbt_results = duobinary_target(eq_, mlse_db_, M, Scpe_sig, Symbols, Tx_bits, ...
|
|
"precode_mode", duob_mode, ...
|
|
'showAnalysis',1 ,...
|
|
"postFFE", []);
|
|
|
|
disp('DB:')
|
|
dbt_results.metrics.print;
|
|
|
|
end
|
|
end
|
|
|
|
if duob_mode == db_mode.db_encoded
|
|
|
|
eq_db_enc = 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);
|
|
|
|
mlse_db_enc = MLSE("DIR", [1,1], "duobinary_output", 0, "M", M, "trellis_states", PAMmapper(M,0).levels);
|
|
|
|
db_results = duobinary_signaling(eq_db_enc, mlse_db_enc, M, Scpe_sig, Symbols, Tx_bits, "precode_mode",duob_mode, "showAnalysis",1,"postFFE",[]);
|
|
|
|
db_results.metrics.print;
|
|
end |