60 lines
1.7 KiB
Matlab
60 lines
1.7 KiB
Matlab
|
|
%% Parameter to simulate and save
|
|
params = struct;
|
|
|
|
params.M = [4];
|
|
params.datarate = [300];
|
|
params.rop = [0];
|
|
|
|
precomp_mode = 2; %0=do nothing ; 1= measure; 2=precomp active
|
|
|
|
if ismac
|
|
precomp_path = "/Users/silasoettinghaus/Documents/MATLAB/imdd_simulation/projects/standard_system";
|
|
else
|
|
precomp_path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\standard_system\";
|
|
end
|
|
|
|
precomp_fn = "400G_simulative_setup";
|
|
usemrds = 0;
|
|
|
|
name = ['wh_',strrep(num2str(now),'.','')];
|
|
|
|
wh = DataStorage(params);
|
|
|
|
wh.addStorage("ber_ffe");
|
|
|
|
%% Init Params
|
|
link_length = 0; %meter
|
|
pn_key = 2;
|
|
laser_linewidth = 0;
|
|
|
|
endcnt = prod(wh.dim);
|
|
cnt=0;
|
|
|
|
disp(['Start Simulation of ',num2str(endcnt),' loops...'])
|
|
tic
|
|
|
|
|
|
% SETUP HERE: %%
|
|
fsym = 92e9;
|
|
|
|
Symbols = Informationsignal(digi_mod_out',"fs",92e9);
|
|
|
|
Scpe_sig = Electricalsignal(awg2scope_keysight_out.no1',"fs",160e9);
|
|
Scpe_sig = Scpe_sig.resample("fs_in",160e9,"fs_out",2*92e9);
|
|
|
|
Bits = Informationsignal(prms_out',"fs",92e9);
|
|
|
|
%%%%%% Sync Rx signal with reference %%%%%%
|
|
[Scpe_sig,S] = Scpe_sig.tsynch("reference",Symbols,"fs_ref",fsym);
|
|
|
|
%%%%% EQUALIZE %%%%%%
|
|
% Eq = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0,"order",25,"sps",2,"decide",1);
|
|
Eq = VNLE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",[0.0004 0.0005 0.0006],"mu_tr",0,"order",[50,7,7],"sps",2,"decide",1);
|
|
[EQ_sig] = Eq.process(Scpe_sig,Symbols);
|
|
Rx_bits = PAMmapper(M,0).demap(EQ_sig);
|
|
[~,errors_bm,ber_ffe,errors] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
|
disp(['BER: ',sprintf('%.1E',ber_ffe),' - - - ',num2str(fsym*1e-9),' GBd']);
|
|
|
|
|