Dies und Das (MPI revisit)
This commit is contained in:
241
projects/Diss/simulation_nonlin_dsp.m
Normal file
241
projects/Diss/simulation_nonlin_dsp.m
Normal file
@@ -0,0 +1,241 @@
|
||||
%%% Run parameters
|
||||
% TX
|
||||
M = 4;
|
||||
m = floor(log2(M)*10)/10;
|
||||
fsym = 160e9;
|
||||
|
||||
apply_pulsef = 0;
|
||||
fdac = 256e9;
|
||||
fadc = 256e9;
|
||||
random_key = 1;
|
||||
|
||||
rcalpha = 0.05;
|
||||
kover = 16;
|
||||
vbias_rel = 0.5;
|
||||
u_pi = 3.2;
|
||||
vbias = -vbias_rel*u_pi;
|
||||
laser_wavelength = 1310;
|
||||
laser_linewidth = 0;
|
||||
eml_alpha = 0;
|
||||
|
||||
|
||||
% Channel
|
||||
link_length = 0;
|
||||
|
||||
vnle_order1 = 50;
|
||||
vnle_order2 = 0;
|
||||
vnle_order3 = 0;
|
||||
|
||||
vnle_order=[vnle_order1,vnle_order2,vnle_order3];
|
||||
dfe_order = [0 0 0];
|
||||
|
||||
alpha = 0;
|
||||
|
||||
len_tr = 4096*2;
|
||||
|
||||
mu_ffe1 = 0.0001;
|
||||
mu_ffe2 = 0.0008;
|
||||
mu_ffe3 = 0.001;
|
||||
mu_dc = 0.005;
|
||||
% mu_dc = 0;
|
||||
|
||||
mu_ffe = [mu_ffe1 mu_ffe3 mu_ffe3];
|
||||
mu_dfe = 0.0004;
|
||||
|
||||
dfe_ = sum(dfe_order)>0;
|
||||
|
||||
duob_mode = db_mode.no_db;
|
||||
cols = linspecer(6);
|
||||
rop = -6;
|
||||
bwl = 0.5:0.1:1.5;
|
||||
nonlin_mod = 0.5:0.025:0.7;
|
||||
fsym = ones(size(nonlin_mod)).*fsym;
|
||||
|
||||
ffe_results = {};
|
||||
mlse_results_lin= {};
|
||||
vnle_results= {};
|
||||
mlse_results_nonlin= {};
|
||||
mlse_results_nonlin_states= {};
|
||||
|
||||
g_eye = GifWriter('Name','eye','Parallel',true);
|
||||
g_mod = GifWriter('Name','modulator','Parallel',true);
|
||||
|
||||
for r = 1:length(nonlin_mod)
|
||||
|
||||
Pform = Pulseformer("fsym",fsym(r),"fdac",4*fsym(r),"pulse","rc","pulselength",16,"alpha",rcalpha);
|
||||
|
||||
apply_pulsef = 0;
|
||||
|
||||
[Digi_sig,Symbols,Tx_bits] = PAMsource(...
|
||||
"fsym",fsym(r),"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",fdac,...
|
||||
"applyclipping",0,"clipfactor",1.5,...
|
||||
"applypulseform",apply_pulsef,"pulseformer",Pform,...
|
||||
"randkey",random_key,...
|
||||
"mrds_code",0,"mrds_blocklength",512,"duobinary_mode",duob_mode).process();
|
||||
|
||||
% El_sig = AWG("fdac",fdac,"f_cutoff",fsym(r),"lpf_active",0,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",0).process(Digi_sig);
|
||||
El_sig = M8199B("kover",kover).process(Digi_sig);
|
||||
% AWG("fdac",fdac,"f_cutoff",fsym(r),"lpf_active",0,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",0).process(Digi_sig);
|
||||
|
||||
%%%%% Low-pass el. components %%%%%%
|
||||
tx_bwl = 85e9;
|
||||
El_sig = Filter("filtdegree",4,"f_cutoff",tx_bwl,"fs",fdac*kover, ...
|
||||
"filterType",filtertypes.bessel_inp,"active",true).process(El_sig);
|
||||
|
||||
%%%%% Electrical Driver Amplifier %%%%%%
|
||||
El_sig = El_sig.normalize("mode","oneone");
|
||||
% El_sig = El_sig.setPower(1,"dBm");
|
||||
% figure;histogram(El_sig.signal);
|
||||
|
||||
%%%%% MODULATE E/O CONVERSION %%%%%
|
||||
% scaling = nonlin_mod(r)*(u_pi/2-abs(vbias-u_pi/2));
|
||||
% El_sig = El_sig .* scaling;
|
||||
vbias = -nonlin_mod(r)*u_pi;
|
||||
[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, ...
|
||||
"alpha",eml_alpha).process(El_sig);
|
||||
|
||||
if 1
|
||||
figure(15);
|
||||
hold on
|
||||
scatter(El_sig.signal(1:100000)+vbias,(abs(Opt_sig.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
||||
xlabel('Input in V')
|
||||
ylabel('abs(Eopt)2 in mW','Interpreter','latex')
|
||||
ylim([0 2]);
|
||||
xlim([-3 0]);
|
||||
g_mod.addFrame(15, r);
|
||||
|
||||
Opt_sig.eye(fsym(r), M, "fignum", 103837);
|
||||
g_eye.addFrame(103837, r);
|
||||
end
|
||||
|
||||
%%%%%% Fiber %%%%%%
|
||||
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
||||
|
||||
%%%%%% ROP %%%%%%
|
||||
Opt_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",rop).process(Opt_sig);
|
||||
|
||||
%%%%%% PD Square Law %%%%%%
|
||||
PD_sig = Photodiode("fsimu",fdac*kover,"dark_current",2e-08,"responsivity",0.6,"temperature",20,"nep",1.8e-11).process(Opt_sig);
|
||||
|
||||
%%%%%% Low-pass RX (PD, El. Connectors and Scope %%%%%%
|
||||
rx_bwl = 90e9;
|
||||
PD_sig = Filter("filtdegree",4,"f_cutoff",rx_bwl,"fs",fdac*kover, ...
|
||||
"filterType",filtertypes.butterworth,"active",true).process(PD_sig);
|
||||
|
||||
% %%%%%% Low-pass Scope %%%%%%
|
||||
Lp_scpe = Filter("filtdegree",4,"f_cutoff",110e9,"fs",fadc, ...
|
||||
"filterType",filtertypes.butterworth,"active",true);
|
||||
|
||||
%%%%%% 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(PD_sig);
|
||||
|
||||
txPulseformer = [];
|
||||
if apply_pulsef
|
||||
txPulseformer = Pform;
|
||||
end
|
||||
|
||||
|
||||
Rx_sig = preprocessSignal(Scpe_sig, Symbols, fsym(r), ...
|
||||
"mode","auto", ...
|
||||
"tx_pulseformer",txPulseformer, ...
|
||||
"debug_plots",0,"gaussian_cutoff_factor",0.55,"apply_gaussian_filter",true);
|
||||
|
||||
|
||||
Rx_sig = Rx_sig.normalize("mode","rms");
|
||||
Rx_sig.signal = Rx_sig.signal(1:2*Symbols.length);
|
||||
Rx_sig.spectrum()
|
||||
|
||||
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_results = ffe(eq_ffe,M,Rx_sig,Symbols,Tx_bits,...
|
||||
% "precode_mode",duob_mode,...
|
||||
% 'showAnalysis',0,...
|
||||
% "postFFE",[],...
|
||||
% "eth_style_symbol_mapping",0);
|
||||
%
|
||||
% ffe_results.metrics.print;
|
||||
% ffe_results.config.equalizer_structure = "ffe";
|
||||
%
|
||||
|
||||
%% MLSE linear
|
||||
|
||||
pf_ncoeffs = 1;
|
||||
ffe_order = [50, 0, 0];
|
||||
eq_ = 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",1);
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',2,'trellis_exclusion',0,'trellis_state_mode',2,'debug',0);
|
||||
|
||||
[ffe_results{r}, mlse_results_lin{r}] = vnle_postfilter_mlse(eq_, pf_, mlse_, M, Rx_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", duob_mode,...
|
||||
'showAnalysis', 0, ...
|
||||
"postFFE", [],...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
mlse_results_lin{r}.metrics.print;
|
||||
ffe_results{r}.metrics.print;
|
||||
|
||||
%% MLSE nonlinear pre
|
||||
|
||||
pf_ncoeffs = 1;
|
||||
ffe_order = [50, 1, 0];
|
||||
eq_ = 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",1);
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',2,'trellis_exclusion',0,'trellis_state_mode',2);
|
||||
|
||||
[vnle_results{r}, mlse_results_nonlin{r}] = vnle_postfilter_mlse(eq_, pf_, mlse_, M, Rx_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", duob_mode,...
|
||||
'showAnalysis', 0, ...
|
||||
"postFFE", [],...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
mlse_results_nonlin{r}.metrics.print;
|
||||
vnle_results{r}.metrics.print;
|
||||
|
||||
%% nonlinear states MLSE linear pre
|
||||
|
||||
pf_ncoeffs = 1;
|
||||
ffe_order = [50, 0, 0];
|
||||
eq_ = 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",1);
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0).levels,'scale_mode',2,'trellis_exclusion',0,'trellis_state_mode',3);
|
||||
|
||||
[~, mlse_results_nonlin_states{r}] = vnle_postfilter_mlse(eq_, pf_, mlse_, M, Rx_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", duob_mode,...
|
||||
'showAnalysis', 0, ...
|
||||
"postFFE", [],...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
mlse_results_nonlin_states{r}.metrics.print;
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
g_mod.compile(15);
|
||||
g_eye.compile(103837);
|
||||
|
||||
%%
|
||||
|
||||
figure();hold on;
|
||||
plot(nonlin_mod,cellfun(@(x) x.metrics.BER, ffe_results),'DisplayName','FFE')
|
||||
plot(nonlin_mod,cellfun(@(x) x.metrics.BER, vnle_results),'DisplayName','VNLE')
|
||||
plot(nonlin_mod,cellfun(@(x) x.metrics.BER, mlse_results_lin),'DisplayName','FFE+MLSE')
|
||||
plot(nonlin_mod,cellfun(@(x) x.metrics.BER, mlse_results_nonlin_states),'DisplayName','FFE+nonlin. states MLSE')
|
||||
plot(nonlin_mod,cellfun(@(x) x.metrics.BER, mlse_results_nonlin),'DisplayName','VNLE+MLSE')
|
||||
xlabel('Nonlinear Driving');
|
||||
ylabel('BER')
|
||||
set(gca,'YScale','log');
|
||||
legend;
|
||||
ylim([1e-4 1e-1]);
|
||||
beautifyBERplot;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user