MPI Simulations and stuff
This commit is contained in:
86
projects/standard_system/imdd_minimal.m
Normal file
86
projects/standard_system/imdd_minimal.m
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
|
||||
clear
|
||||
M = 4;
|
||||
fsym = 112e9;
|
||||
fdac = 256e9;
|
||||
kover = 8;
|
||||
oneway_interference_meter = 0;
|
||||
link_total_meter = 10000;
|
||||
sir = 100;
|
||||
rop = 0;
|
||||
|
||||
|
||||
[D,B] = PAMsource("order",18,"useprbs",1,"fsym",fsym,"M",M).process();
|
||||
|
||||
if 1
|
||||
S = Pulseformer("fsym",fsym,"fdac",256e9,"pulse","rrc","pulselength",16,"rrcalpha",0.1).process(D);
|
||||
end
|
||||
|
||||
if 1
|
||||
min_ = min(D.signal) * 1.3 ;
|
||||
max_ = max(D.signal) * 1.3 ;
|
||||
S.signal = clip(S.signal,min_,max_);
|
||||
end
|
||||
|
||||
X = M8199A("kover",kover).process(S).*0.7222;
|
||||
|
||||
u_pi = 2.9;
|
||||
vbias = -0.85*u_pi;
|
||||
[O,extmodlaser] = EML("mode",eml_mode.im_cosinus,"power",0,"fsimu",X.fs,"lambda",1310,"bias",vbias,"u_pi",u_pi,"linewidth",0,"randomkey",1).process(X);
|
||||
|
||||
O.eye(fsym,M);
|
||||
|
||||
O.spectrum("fignum",112,"displayname",'Opt. transmit spectrum');
|
||||
|
||||
if oneway_interference_meter ~= 0
|
||||
%%%%% Ping Pong/ Interference Path %%%%%%
|
||||
I = Fiber("fsimu",O.fs,"fiber_length",oneway_interference_meter*2/1000,"alpha",0.3,"D",0,"lambda0",1320,"gamma",0,"Dslope",0.07).process(O);
|
||||
I = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",-sir).process(I);
|
||||
|
||||
%%%%% Delay the "main" signal as in reality the interference is "older" than the main signal %%%%%%
|
||||
[O,dly] = O.delay("delay_meter",oneway_interference_meter*2);
|
||||
|
||||
%%%%% Recombine Interference and Main Signal %%%%%%
|
||||
O = O + I;
|
||||
|
||||
%%%%% Cut (due to the delays there is a jump in the signals) %%%%%%
|
||||
if dly == 0;dly = 1;end
|
||||
O.signal = O.signal(ceil(dly):end);
|
||||
end
|
||||
|
||||
%%%%% Propagate through fiber %%%%%%
|
||||
O = Fiber("fsimu",O.fs,"fiber_length",link_total_meter/1000,"alpha",0.3,"D",0,"lambda0",1320,"gamma",0,"Dslope",0.07).process(O);
|
||||
|
||||
% Set ROP
|
||||
O = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",rop).process(O);
|
||||
|
||||
E = Photodiode("fsimu",fdac*kover,"dark_current",2e-08,"responsivity",1,"temperature",20).process(O);
|
||||
|
||||
E = Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.gaussian,"active",true).process(E);
|
||||
|
||||
Scpe_sig = Scope("fsimu",fdac*kover,"fadc",256e9,...
|
||||
"delay",0,"fixed_delay",0,"filtertype",filtertypes.butterworth,...
|
||||
"samplingdelay",0,"rand_samplingdelay",0,"freq_offset",0,"samp_jitter",0,...
|
||||
"adcresolution",16,"quantbuffer",0.1,'block_dc',1,'lpf_active',1,'H_lpf',Filter('filtdegree',4,"f_cutoff",63e9,"fs",256e9,"filterType",filtertypes.butterworth,"active",true)).process(E);
|
||||
|
||||
%%%%%% Sample to 2x fsym %%%%%%
|
||||
Scpe_sig = Scpe_sig.resample("fs_in",Scpe_sig.fs,"fs_out",2*fsym);
|
||||
% Scpe_sig.plot('fignum',12345,'displayname','bla')
|
||||
|
||||
%%%%%% Sync Rx signal with reference %%%%%%
|
||||
[Scpe_sig,delayed,cuts] = Scpe_sig.tsynch("reference",D,"fs_ref",fsym);
|
||||
|
||||
[EQ_sig] = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0,"order",80,"sps",2,"decide",1).process(Scpe_sig,D);
|
||||
|
||||
[~,errors_bm,ber,errors] = calc_ber(EQ_sig.signal,B.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
||||
|
||||
disp(['BER: ',sprintf('%.1E',ber),' - - ROP: ',num2str(O.power),'dBm - - PAM-',num2str(M),' - - ',num2str(fsym*1e-9),' GBd']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user