DB and 400G and minor changes
This commit is contained in:
0
projects/400G_FTN_setups/duobinary_example.m
Normal file
0
projects/400G_FTN_setups/duobinary_example.m
Normal file
Binary file not shown.
@@ -16,6 +16,7 @@ for i = 1:log2(M)
|
||||
[bitpattern(:,i),seed] = prbs(O,N,seed);
|
||||
end
|
||||
|
||||
|
||||
if M == 6
|
||||
bitpattern = reshape(bitpattern,[],1);
|
||||
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
||||
|
||||
Binary file not shown.
@@ -2,11 +2,17 @@
|
||||
%% Parameter to simulate and save
|
||||
params = struct;
|
||||
|
||||
params.M = [4];
|
||||
params.datarate = [300];
|
||||
params.rop = [0];
|
||||
params.M = [8];
|
||||
params.datarate = [448];
|
||||
params.rop = [-12:0];
|
||||
|
||||
precomp_mode = 0; %0=do nothing ; 1= measure; 2=precomp active
|
||||
postfilter = 0; % noise whiten. approach -> Postfilter + MLSE
|
||||
|
||||
db_precode = 1;
|
||||
db_encode = 1;
|
||||
db_channelapproach = 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";
|
||||
@@ -24,7 +30,7 @@ wh = DataStorage(params);
|
||||
wh.addStorage("ber_ffe");
|
||||
|
||||
%% Init Params
|
||||
link_length = 0; %meter
|
||||
link_length = 1000; %meter
|
||||
pn_key = 2;
|
||||
laser_linewidth = 0;
|
||||
|
||||
@@ -34,7 +40,6 @@ cnt=0;
|
||||
disp(['Start Simulation of ',num2str(endcnt),' loops...'])
|
||||
tic
|
||||
|
||||
|
||||
for M = wh.parameter.M.values
|
||||
for datarate = wh.parameter.datarate.values
|
||||
|
||||
@@ -50,32 +55,34 @@ for M = wh.parameter.M.values
|
||||
|
||||
%%%%% Symbol Generation %%%%%%
|
||||
[Digi_sig,Symbols,Bits] = PAMsource("fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",M8199.fdac,"applyclipping",1,"clipfactor",1.7,...
|
||||
"fs_out",M8199.fdac,"applyclipping",1,"clipfactor",1.5,...
|
||||
"applypulseform",0,"pulseformer",Pform,"randkey",pn_key,...
|
||||
"db_precode",0,...
|
||||
"db_precode",db_precode,"db_encode",db_encode,...
|
||||
"mrds_code",usemrds,"mrds_blocklength",512).process();
|
||||
|
||||
Digi_sig.eye(fsym,M);
|
||||
Digi_sig.spectrum("fignum",11,"displayname",'before precomp');
|
||||
% Digi_sig.eye(fsym,M);
|
||||
Digi_sig.spectrum("fignum",123434,"displayname",'Digital Tx Signal');
|
||||
|
||||
if precomp_mode == 1
|
||||
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs);
|
||||
Digi_sig = freqresp.buildOFDM();
|
||||
elseif precomp_mode == 2
|
||||
Digi_sig = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs).precomp(Digi_sig,'maxampdb',3,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
Digi_sig = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs).precomp(Digi_sig,'maxampdb',1,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
Digi_sig.spectrum("fignum",11,"displayname",'after precomp');
|
||||
end
|
||||
|
||||
%%%%% AWG %%%%%%
|
||||
El_sig = M8199.process(Digi_sig);
|
||||
|
||||
% El_sig.spectrum("displayname",'el','fignum',123434);
|
||||
|
||||
% El_sig.signal = awgn(El_sig.signal,-3,'measured',pn_key);
|
||||
|
||||
%%%%% Lowpass el. components %%%%%%
|
||||
El_sig = Filter('filtdegree',2,"f_cutoff",60e9,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true).process(El_sig);
|
||||
|
||||
%%%%% Electrical Driver Amplifier %%%%%%
|
||||
El_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",9).process(El_sig);
|
||||
El_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",3).process(El_sig);
|
||||
% El_sig = El_sig.setPower(6,"dBm");
|
||||
|
||||
fprintf('Driver output power: %s dBm\n', num2str(El_sig.power));
|
||||
@@ -90,9 +97,8 @@ for M = wh.parameter.M.values
|
||||
|
||||
[Opt_sig] = EML("mode",eml_mode.im_cosinus,"power",3,"fsimu",El_sig.fs,"lambda",1290,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth,"randomkey",pn_key).process(El_sig);
|
||||
|
||||
|
||||
% Opt_sig.eye(fsym,M);
|
||||
% %
|
||||
% Opt_sig.eye(fsym,7);
|
||||
%
|
||||
% figure(10)
|
||||
% hold on
|
||||
% scatter(El_sig.signal(1:100000)+vbias,(abs(Opt_sig.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
||||
@@ -104,6 +110,8 @@ for M = wh.parameter.M.values
|
||||
Optfilter = Filter('filtdegree',6,"f_cutoff",fsym.*0.7,"fs",fdac*kover,"filterType",filtertypes.gaussian,"active",true);
|
||||
Opt_sig = Optfilter.process(Opt_sig);
|
||||
|
||||
% Opt_sig.spectrum("fignum",122,"displayname",['Tx SPectrum; PAM ',num2str(M)]);
|
||||
|
||||
Opt_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",0).process(Opt_sig);
|
||||
|
||||
i_ = wh.parameter.rop.length;
|
||||
@@ -143,19 +151,54 @@ for M = wh.parameter.M.values
|
||||
freqresp.plot();
|
||||
end
|
||||
|
||||
Scpe_sig.spectrum("displayname",'After Scope','fignum',123434);
|
||||
|
||||
%%%%%% Sample to 2x fsym %%%%%%
|
||||
Scpe_sig = Scpe_sig.resample("fs_in",fadc,"fs_out",2*fsym);
|
||||
|
||||
|
||||
%%%%%% Sync Rx signal with reference %%%%%%
|
||||
[Scpe_sig,D,cuts] = 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 = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0,"order",25,"sps",2,"decide",0);
|
||||
%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);
|
||||
|
||||
if db_channelapproach
|
||||
% ref symbols and transm. sequence are precoded
|
||||
[EQ_sig, Noi] = Eq.process(Scpe_sig,Duobinary().encode(Symbols));
|
||||
else
|
||||
[EQ_sig, Noi] = Eq.process(Scpe_sig,Symbols);
|
||||
end
|
||||
|
||||
if db_encode || db_channelapproach
|
||||
EQ_sig = MLSE("DIR",[1,1],"duobinary_output",1,"M",M,"trellis_states",PAMmapper(M,0).levels).process(EQ_sig);
|
||||
EQ_sig = Duobinary().decode(EQ_sig);
|
||||
end
|
||||
|
||||
if postfilter
|
||||
% Noi.spectrum("displayname",'Noise Spectrum','fignum',1234);
|
||||
% EQ_sig.spectrum("displayname","Signal Spectrum","fignum",1234);
|
||||
|
||||
nc = 2;
|
||||
burg_coeff = arburg(Noi.signal,nc);
|
||||
|
||||
EQ_sig = EQ_sig.filter(burg_coeff,1);
|
||||
|
||||
% EQ_sig.spectrum("displayname","Signal Spectrum after Postfilter","fignum",1234);
|
||||
tic
|
||||
EQ_sig = MLSE("DIR",burg_coeff,"duobinary_output",0,"M",M,"trellis_states",PAMmapper(M,0).levels).process(EQ_sig);
|
||||
toc
|
||||
% EQ_sig.spectrum("displayname","Signal Spectrum after MLSE","fignum",1234);
|
||||
|
||||
if 0
|
||||
[h,w] = freqz(1,burg_coeff,length(Noi),"whole",Noi.fs);
|
||||
h = h/max(abs(h));
|
||||
hold on
|
||||
w_ = (w - Noi.fs/2);
|
||||
plot(w_.*1e-9,20*log10(fftshift(h)),'DisplayName',['', num2str(nc), ' coefficients for burg alg.']);
|
||||
end
|
||||
end
|
||||
|
||||
Rx_bits = PAMmapper(M,0).demap(EQ_sig);
|
||||
[~,errors_bm,ber_ffe(i),errors] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
||||
disp(['BER: ',sprintf('%.1E',ber_ffe(i)),' - - ROP: ',num2str(patten(i)),'dBm - - PAM-',num2str(M),' - - ',num2str(fsym*1e-9),' GBd']);
|
||||
@@ -170,19 +213,21 @@ for M = wh.parameter.M.values
|
||||
end
|
||||
|
||||
toc
|
||||
disp(['Simulated: ',num2str(cnt/endcnt*100),' %']);
|
||||
|
||||
% wh.save('C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\MPI_August\auswertung\')
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
disp('Simulation Done!')
|
||||
|
||||
|
||||
cols = linspecer(8);
|
||||
|
||||
%cnt = cnt+1;
|
||||
ber_ffe = wh.getStoValue('ber_ffe',M,datarate,wh.parameter.rop.values);
|
||||
|
||||
|
||||
% Create the initial plot
|
||||
|
||||
figure(44);
|
||||
|
||||
@@ -2,6 +2,9 @@ M = wh.parameter.M.values(1);
|
||||
datarates = wh.parameter.datarate.values;
|
||||
rop = wh.parameter.rop.values;
|
||||
|
||||
clear("sens_ffe")
|
||||
|
||||
col = flip(cbrewer2("RdYlGn",numel(datarates)));
|
||||
|
||||
cnt = 1;
|
||||
for dr = datarates
|
||||
@@ -10,9 +13,9 @@ for dr = datarates
|
||||
|
||||
sens_ffe(cnt) = getIntersection(ber_ffe,rop);
|
||||
|
||||
figure(112)
|
||||
figure(116)
|
||||
hold on
|
||||
plot(rop,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName",['FFE only; ',num2str(dr), ' Gbps']);
|
||||
plot(rop,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName",['Postfilter + MLSE; ',num2str(dr), ' Gbps'],'Color',col(cnt,:));
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','LineStyle','--','HandleVisibility','off');
|
||||
xlabel('Received Optical Power (dBm)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
@@ -28,7 +31,7 @@ for dr = datarates
|
||||
end
|
||||
|
||||
|
||||
figure(223);
|
||||
figure(22);
|
||||
hold on; % Retain the plot so new points can be added without complete redraw
|
||||
plot(datarates,sens_ffe,"LineWidth",1,"LineStyle","-","Marker",".","MarkerSize",10,"DisplayName",['Linewidth: ',num2str(laser_linewidth.*1e-6),' MHz']);
|
||||
xlabel('Signal to Interference Ratio (dB)');
|
||||
|
||||
Reference in New Issue
Block a user