New MPI mitigation schemes // Duobinary // Start of FTN schemes
This commit is contained in:
BIN
projects/standard_system/400G_simulative_setup.mat
Normal file
BIN
projects/standard_system/400G_simulative_setup.mat
Normal file
Binary file not shown.
BIN
projects/standard_system/bla.mat
Normal file
BIN
projects/standard_system/bla.mat
Normal file
Binary file not shown.
28
projects/standard_system/freqresp_test.m
Normal file
28
projects/standard_system/freqresp_test.m
Normal file
@@ -0,0 +1,28 @@
|
||||
measure = 0;
|
||||
|
||||
|
||||
if measure
|
||||
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",70,"f_ref",256e9);
|
||||
%
|
||||
Digi_sig = freqresp.buildOFDM();
|
||||
else
|
||||
[Digi_sig,Symbols,Bits] = PAMsource("fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",M8199.fdac,"applyclipping",1,"clipfactor",1.7,"applypulseform",1,"pulseformer",Pform,"randkey",pn_key,"mrds_code",usemrds,"mrds_blocklength",512).process();
|
||||
end
|
||||
|
||||
Digi_sig.spectrum("fignum",1112,"displayname",['Signal']);
|
||||
|
||||
maxamp = -1;
|
||||
El_sig = freqresp.precomp(Digi_sig,"maxampdb",maxamp);
|
||||
|
||||
El_sig.spectrum("fignum",1112,"displayname",['maxamp:',num2str(maxamp)]);
|
||||
|
||||
El_sig = Filter('filtdegree',2,"f_cutoff",60e9,"fs",256e9,"filterType",filtertypes.butterworth,"active",true).process(El_sig);
|
||||
|
||||
if measure
|
||||
freqresp.estimate(El_sig,"fileName",'','save',false);
|
||||
end
|
||||
|
||||
|
||||
|
||||
El_sig.spectrum("fignum",1112,"displayname",['after filter; maxamp:',num2str(maxamp)]);
|
||||
197
projects/standard_system/imdd_minimal_2.m
Normal file
197
projects/standard_system/imdd_minimal_2.m
Normal file
@@ -0,0 +1,197 @@
|
||||
|
||||
%% Parameter to simulate and save
|
||||
params = struct;
|
||||
|
||||
params.M = [4];
|
||||
params.datarate = [440];
|
||||
params.rop = [0];
|
||||
|
||||
precomp_mode = 2; %0=do nothing ; 1= measure; 2=precomp active
|
||||
precomp_path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\standard_system\";
|
||||
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
|
||||
|
||||
|
||||
for M = wh.parameter.M.values
|
||||
for datarate = wh.parameter.datarate.values
|
||||
|
||||
% SETUP HERE: %%
|
||||
kover = 16;
|
||||
M8199 = M8199B("kover",kover);
|
||||
fdac = M8199.fdac;
|
||||
fsym = round(datarate / log2(M)) * 1e9;
|
||||
rrcalpha = 0.05;
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"rrcalpha",rrcalpha);
|
||||
|
||||
% MAIN SIGNAL
|
||||
|
||||
%%%%% Symbol Generation %%%%%%
|
||||
[Digi_sig,Symbols,Bits] = PAMsource("fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",M8199.fdac,"applyclipping",1,"clipfactor",1.7,...
|
||||
"applypulseform",0,"pulseformer",Pform,"randkey",pn_key,...
|
||||
"db_precode",1,...
|
||||
"mrds_code",usemrds,"mrds_blocklength",512).process();
|
||||
|
||||
Digi_sig.eye(fsym,M);
|
||||
Digi_sig.spectrum("fignum",11,"displayname",'before precomp');
|
||||
|
||||
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 = freqresp.precomp(Digi_sig,'maxampdb',3,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
Digi_sig.spectrum("fignum",11,"displayname",'after precomp');
|
||||
end
|
||||
|
||||
%%%%% AWG %%%%%%
|
||||
El_sig = M8199.process(Digi_sig);
|
||||
|
||||
% 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 = El_sig.setPower(6,"dBm");
|
||||
|
||||
fprintf('Driver output power: %s dBm\n', num2str(El_sig.power));
|
||||
fprintf('Driver output peak voltage: %s Vpp \n', num2str(max(El_sig.signal)-min(El_sig.signal)));
|
||||
|
||||
|
||||
% MAIN SIGNAL
|
||||
%%%%% MODULATE E/O CONVERSION %%%%%%
|
||||
vbias_rel = 0.5;
|
||||
u_pi = 2.9;
|
||||
vbias = -vbias_rel*u_pi;
|
||||
|
||||
[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);
|
||||
% %
|
||||
% figure(10)
|
||||
% hold on
|
||||
% scatter(El_sig.signal(1:100000)+vbias,(abs(Opt_sig.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
||||
% ylim([0 4]);
|
||||
% xlim([-u_pi/2, u_pi/2]+vbias);
|
||||
% xlabel('Input in V')
|
||||
% ylabel('abs(Output) in mW')
|
||||
|
||||
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 = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",0).process(Opt_sig);
|
||||
|
||||
i_ = wh.parameter.rop.length;
|
||||
|
||||
ber_ffe=zeros(i_);
|
||||
|
||||
patten=zeros(i_);
|
||||
|
||||
%%%%% Interference Signal Fiber Prop %%%%%%
|
||||
|
||||
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);
|
||||
|
||||
% Receiver ROP curve
|
||||
for i = 1:i_
|
||||
rop=wh.parameter.rop.values(i);
|
||||
|
||||
% Set ROP
|
||||
Rx_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",rop).process(Opt_sig);
|
||||
patten(i) = Rx_sig.power;
|
||||
|
||||
%%%%%% Square Law %%%%%%
|
||||
Rx_sig = Photodiode("fsimu",fdac*kover,"dark_current",2e-08,"responsivity",1,"temperature",20,"nep",1.8e-11).process(Rx_sig);
|
||||
|
||||
%%%%%% Lowpass PhDiode %%%%%%
|
||||
Rx_sig = Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.gaussian,"active",true).process(Rx_sig);
|
||||
|
||||
%%%%%% Scope %%%%%%
|
||||
fadc = 256e9;
|
||||
Lp_scpe = Filter('filtdegree',4,"f_cutoff",100e9,"fs",fadc,"filterType",filtertypes.butterworth,"active",true);
|
||||
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",10,"quantbuffer",0.1,'block_dc',1,'lpf_active',1,'H_lpf',Lp_scpe).process(Rx_sig);
|
||||
|
||||
if precomp_mode == 1
|
||||
freqresp.estimate(Scpe_sig,"save",true,"savePath",precomp_path,"fileName",precomp_fn);
|
||||
freqresp.plot();
|
||||
end
|
||||
|
||||
%%%%%% 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 = 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(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']);
|
||||
|
||||
end
|
||||
|
||||
for i = 1:i_
|
||||
rop=wh.parameter.rop.values(i);
|
||||
|
||||
wh.addValueToStorage(ber_ffe(i) ,'ber_ffe',M,datarate,rop);
|
||||
|
||||
end
|
||||
|
||||
toc
|
||||
disp(['Simulated: ',num2str(cnt/endcnt*100),' %']);
|
||||
wh.save('C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\MPI_August\auswertung\')
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
cols = linspecer(8);
|
||||
|
||||
%cnt = cnt+1;
|
||||
ber_ffe = wh.getStoValue('ber_ffe',M,datarate,wh.parameter.rop.values);
|
||||
|
||||
|
||||
% Create the initial plot
|
||||
|
||||
figure(44);
|
||||
a = gca;
|
||||
hold on; % Retain the plot so new points can be added without complete redraw
|
||||
|
||||
plot(wh.parameter.rop.values,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","FFE only");
|
||||
|
||||
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','LineStyle','--','HandleVisibility','off');
|
||||
xlabel('Received Optical Power (dBm)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title('Bit Error Rate vs. ROP');
|
||||
set(gca,'yscale','log');
|
||||
set(gca,'Box','on');
|
||||
grid on;
|
||||
grid minor
|
||||
legend
|
||||
54
projects/standard_system/sensitivity_analysis.m
Normal file
54
projects/standard_system/sensitivity_analysis.m
Normal file
@@ -0,0 +1,54 @@
|
||||
M = wh.parameter.M.values(1);
|
||||
datarates = wh.parameter.datarate.values;
|
||||
rop = wh.parameter.rop.values;
|
||||
|
||||
|
||||
cnt = 1;
|
||||
for dr = datarates
|
||||
|
||||
ber_ffe = wh.getStoValue('ber_ffe',M,dr,rop);
|
||||
|
||||
sens_ffe(cnt) = getIntersection(ber_ffe,rop);
|
||||
|
||||
figure(112)
|
||||
hold on
|
||||
plot(rop,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName",['FFE only; ',num2str(dr), ' Gbps']);
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','LineStyle','--','HandleVisibility','off');
|
||||
xlabel('Received Optical Power (dBm)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title('Bit Error Rate vs. ROP');
|
||||
set(gca,'yscale','log');
|
||||
set(gca,'Box','on');
|
||||
grid on;
|
||||
grid minor
|
||||
legend
|
||||
|
||||
cnt = cnt+1;
|
||||
|
||||
end
|
||||
|
||||
|
||||
figure(223);
|
||||
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)');
|
||||
ylabel('Receiver Sensitivity');
|
||||
title(['Bit Error Rate vs. SIR']);
|
||||
grid on;
|
||||
legend
|
||||
|
||||
|
||||
function i = getIntersection(ber,rop)
|
||||
|
||||
%get intersection between rop curve and hd-fec limit
|
||||
hdfec = 3.8e-3 .* ones(size(ber));
|
||||
i = InterX([rop;hdfec'],[rop;ber']);
|
||||
|
||||
if isempty(i)
|
||||
i = NaN;
|
||||
else
|
||||
i = i(1);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
36
projects/standard_system/testcode_duobinary.m
Normal file
36
projects/standard_system/testcode_duobinary.m
Normal file
@@ -0,0 +1,36 @@
|
||||
% Define parameters
|
||||
n = 1; % Define the memory length n+1 (e.g., 1 for duobinary, 2 for tribinary, 3 for tetrabinary)
|
||||
M = 4; % Modulation order (e.g., 4 for QPSK)
|
||||
d = randi([0 M-1], 1, 100); % Example input sequence d(k)
|
||||
|
||||
% Pre-coding: bPR(k) = (d(k) - bPR(k-1)) mod M
|
||||
bPR = zeros(size(d));
|
||||
%bPR(1) = d(1); % Initial condition for pre-coding
|
||||
|
||||
for k = 1:numel(d)-1
|
||||
bPR(k+1) = mod( d(k) - bPR(k), M );
|
||||
end
|
||||
|
||||
% Polybinary coding: Convolution with (1 + z^-1)^n
|
||||
% Generate coefficients for the polybinary filter (1 + z^-1)^n
|
||||
coeff = ones(1, n+1); % Initialize coefficients with ones
|
||||
|
||||
for i = 2:n+1
|
||||
coeff(i) = nchoosek(n, i-1); % Binomial coefficient for expansion
|
||||
end
|
||||
|
||||
% Apply convolution to get the polybinary coded sequence
|
||||
polybinary_data = conv(bPR, coeff, "same");
|
||||
|
||||
% Modulo operation for decoding to stay within M levels
|
||||
d_reconstructed = mod(polybinary_data, M);
|
||||
|
||||
% Check if reconstruction is correct
|
||||
reconstruction_success = isequal(d, d_reconstructed);
|
||||
|
||||
figure(111)
|
||||
hold on
|
||||
stairs(d_reconstructed)
|
||||
stairs(d)
|
||||
|
||||
disp(['Reconstruction success: ', num2str(reconstruction_success)]);
|
||||
BIN
projects/standard_system/tf_test.mat
Normal file
BIN
projects/standard_system/tf_test.mat
Normal file
Binary file not shown.
Reference in New Issue
Block a user