DC removal algorithm now with latency

This commit is contained in:
Silas Oettinghaus
2023-10-12 16:43:54 +02:00
parent 0452d34f67
commit 025498d120
3 changed files with 169 additions and 140 deletions

View File

@@ -13,9 +13,9 @@ for lp = 1
fiblen = 0; %main link in km
laser_linewidth =1e6;
laser_linewidth =5e6;
O = 18; %order of prbs
O = 19; %order of prbs
N = 2^(O-1); %length of prbs
[~,seed] = prbs(O,1); %initialize first seed of prbs
@@ -52,7 +52,7 @@ for lp = 1
u_pi = 3.5;
vbias = (0.5*u_pi)-u_pi;
extmodlaser = EML("mode",eml_mode.im_cosinus,"power",5,"fsimu",fsimu,"lambda",1550,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth);
extmodlaser = EML("mode",eml_mode.im_cosinus,"power",5,"fsimu",fsimu,"lambda",1310,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth);
fib = Fiber("fsimu",fdac*kover,"fiber_length",fiblen,"alpha",0.2,"D",16,"lambda0",thz2nm(193.1),"gamma",0);
@@ -77,8 +77,17 @@ for lp = 1
"dd_loops",2,"epsilon",[10 100 1000 ],"M",2,...
"thres",[0.005 0.004 0.0005 ],"l1act",0,"delay",0,"rho",0.0005,"ideal_dfe",0,"DB_aim",0);
eq2 = EQ_silas("Ne",[30,0,0],"Nb",[3,0,0],"trainlength",4096,"mu_dc_dd",0.005,...
"mu_dc_train",0.05,"mu_ffe_train",0.005,"mu_combined_dd",[0.0004 0.0006 0.0003 0.005],"ddloops",3,'dcmode',3);
eq = EQ_silas("Ne",[50,5,3],"Nb",[2,0,0],"trainlength",4096,...
"sps",2,...
"mu_dc_dd",0.05,...
"mu_dc_train",0.05,...
"mu_ffe_train",0,...
"mu_dfe_train",0.005,...
"mu_ffe_dd",[0.0004 0.0004 0.0004],...
"mu_dfe_dd",0.005,...
"ddloops",3,...
"trainloops",4,...
"dcmode",1);
%% C) PROCESS TX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -102,7 +111,7 @@ for lp = 1
% 6) Lowpass behavior of laser and hf-cable? why twice?
X = lp_laser.process(X);
X = lp_laser.process(X);
% X = lp_laser.process(X);
% 7) Normalize signal
X = X.normalize("mode","oneone");
@@ -141,38 +150,55 @@ for lp = 1
[pos_high] = find(abs(phasediff)>thresh);
[pos_low] = find(abs(phasediff)<=thresh);
figure(6);hold on;histogram(phaseX-phaseR,500,'EdgeAlpha',0)
figure()
subplot(3,1,1)
scatter(xax_sec.',wrapToPi(phaseX),4,'.','MarkerEdgeColor',col(2,:),'DisplayName','Phase of original Signal')
scatter(xax_sec.',wrapToPi(phaseX),4,'.','MarkerEdgeColor',col(2,:),'DisplayName','Desired Signal')
hold on
scatter(xax_sec,wrapToPi(phaseR),4,'.','MarkerEdgeColor',col(1,:),'DisplayName','Phase of delayed Signal')
scatter(xax_sec,wrapToPi(phaseR),4,'.','MarkerEdgeColor',col(1,:),'DisplayName','Reflected Signal')
hold on
% xline(delay/(physconst("LightSpeed")/1.4677),'LineWidth',4,'LineStyle','--','HandleVisibility','off')
lg = legend;
lg.Location = "southwest";
xlim([xax_sec(1) xax_sec(end)]);
xlabel('time in $\mu$s')
ylim([-pi pi]);
yticks([-pi 0 pi])
yticklabels({'$-\pi$',0, '$\pi$'})
ylabel('$\phi$')
subplot(3,1,2)
scatter(xax_sec(pos_low),phasediff(pos_low),4,'.','MarkerEdgeColor',col(5,:),'DisplayName','Phase Difference')
hold on
scatter(xax_sec(pos_high),phasediff(pos_high),4,'.','MarkerEdgeColor',col(2,:),'HandleVisibility','off')
% xline(delay/(physconst("LightSpeed")/1.4677),'LineWidth',4,'LineStyle','--','HandleVisibility','off')
yline(thresh,'LineWidth',2,'LineStyle','-','HandleVisibility','off')
yline(-thresh,'LineWidth',2,'LineStyle','-','HandleVisibility','off')
% yline(thresh,'LineWidth',2,'LineStyle','-','HandleVisibility','off')
% yline(-thresh,'LineWidth',2,'LineStyle','-','HandleVisibility','off')
lg = legend;
lg.Location = "southwest";
xlabel('time in $\mu$s')
xlim([xax_sec(1) xax_sec(end)]);
ylim([-pi pi]);
yticks([-pi 0 pi])
yticklabels({'$-\pi$',0, '$\pi$'})
ylabel('$\Delta \phi$')
X.signal = X.signal(n:end);
R.signal = R.signal(n:end);
X1 = X;
X = X+R;
subplot(3,1,3)
scatter(xax_sec(pos_low),abs(X.signal(pos_low).^2),4,'.','MarkerEdgeColor',col(5,:),'DisplayName','Constructive Interference');
scatter(xax_sec(pos_low),abs(X.signal(pos_low).^2)*1000,4,'.','MarkerEdgeColor',col(5,:),'DisplayName','Constructive Interference');
hold on
scatter(xax_sec(pos_high),abs(X.signal(pos_high).^2),4,'.','MarkerEdgeColor',col(2,:),'DisplayName','Destructive Interference');
% xline(delay/(physconst("LightSpeed")/1.4677),'LineWidth',4,'LineStyle','--','HandleVisibility','off')
scatter(xax_sec(pos_high),abs(X.signal(pos_high).^2)*1000,4,'.','MarkerEdgeColor',col(2,:),'DisplayName','Destructive Interference');
%scatter(xax_sec(pos_high),abs(X1.signal(pos_high).^2)*1000,4,'.','MarkerEdgeColor',col(1,:),'MarkerFaceAlpha',0.3,'DisplayName','Destructive Interference');
xlim([xax_sec(1) xax_sec(end)]);
xlabel('time in $\mu$s')
lg = legend;
lg.Location = "southwest";
ylabel('Optical power in mW');
@@ -255,8 +281,6 @@ for lp = 1
% figure(1);bar([evm_bm' evm_dcsm' evm_llp' evm_lsm']);ylim([0.01 0.1]);set(gca,'yscale','log');
%% PROCESS RX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1) Digi Demod
@@ -316,7 +340,8 @@ for lp = 1
subplot(1,3,2)
xindices = 1:Eq_out.length;
scatter(xindices(loc==0),Eq_out.signal(loc==0),4,'.','MarkerEdgeColor',col(4,:),'DisplayName','After EQ');
xax_sec = (1:Eq_out.length) / fsym .* 1e6;
scatter(xax_sec(loc==0),Eq_out.signal(loc==0),4,'.','MarkerEdgeColor',col(4,:),'DisplayName','After EQ');
hold on
scatter(xindices(loc~=0),Eq_out.signal(loc~=0),8,'x','MarkerEdgeColor',col(6,:),'DisplayName','Wrong Decision');
hold off
@@ -345,17 +370,6 @@ for lp = 1
hold off
% ERROR IN EQ
figure(13)
plot((eq2.error_log(1,:)),'DisplayName','First iteration DD mode','Linewidth',0.5);
hold on;
for i = 1:size(eq2.error_log,1)
plot((eq2.error_log(i,:)),'Linewidth',0.5);
end
loc(loc==0) = NaN;
stem(loc.*mean((eq2.error_log(end,:))),'DisplayName','Error Positions')
hold off
end
if 0