CLEANUP - changes to folder structure
This commit is contained in:
116
Theory/Optical/PMD_maxwellshape/dgd_considerations.m
Normal file
116
Theory/Optical/PMD_maxwellshape/dgd_considerations.m
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
if 0
|
||||
pmd = 0.2 * ( 1e-12 / sqrt(1e3) ) ; % 0.1 ps/sqrt(km) -> 1e-9 -> s/sqrt(m)
|
||||
L = 1000; % m
|
||||
corr_len = 100;
|
||||
num_wave_plates = 100;
|
||||
wp_len = L / num_wave_plates; %waveplate length
|
||||
dgd = pmd * sqrt(L);
|
||||
fdac = 120e9; % GHz
|
||||
|
||||
fsim = fdac * 512 ; %oversampled simulation frequency
|
||||
dt = 1/fsim; % sample time
|
||||
nt = 4; % sampled signal length
|
||||
omega = 2*pi*[(0:nt/2-1),(-nt/2:-1)]/(dt*nt) ; %angular frequency vector for optical signal of length nt
|
||||
omega = 2*pi*fsim ; %angular frequency vector for optical signal of length nt
|
||||
|
||||
for rlz = 1:20000
|
||||
|
||||
db0 = [];
|
||||
db1 = [];
|
||||
delta_beta = [];
|
||||
|
||||
db0 = (rand(num_wave_plates,1)*2*pi - pi); % normal distr. between -pi <-> +pi
|
||||
|
||||
db1 = sqrt(3*pi/8)*(dgd/fsim)/ num_wave_plates .* omega; % linear increasing delta beta 1
|
||||
|
||||
%loop over waveplates
|
||||
for n_wp = 1:length(db0)
|
||||
delta_beta(n_wp,:) = (db1+db0(n_wp))./corr_len;
|
||||
end
|
||||
|
||||
dphi = delta_beta*wp_len; %phase shift due to propagation constant = beta * L
|
||||
|
||||
if rlz == 1
|
||||
figure()
|
||||
plot(cumsum( delta_beta ));
|
||||
end
|
||||
|
||||
dphi_end(rlz) = sum( dphi );
|
||||
|
||||
end
|
||||
|
||||
figure;
|
||||
histogram((dphi_end),100);
|
||||
|
||||
deltaT = mean(abs(dphi_end));
|
||||
|
||||
%H = exp(-1j*dphi); % Filter to apply phase shift in freq. domain
|
||||
end
|
||||
|
||||
|
||||
PMD = 0.1 * ( 1e-12 / sqrt(1e3) ); %PMD s/sqrt(m)
|
||||
L = 10e3; %m
|
||||
sigma_dgd = PMD * sqrt(L); % in sec.
|
||||
disp(['variance of DGD in pico seconds: ',num2str(sigma_dgd*1e12)]);
|
||||
disp(['variance of DGD in pico seconds: ',num2str(sigma_dgd*1e12)]);
|
||||
|
||||
dgd = [];
|
||||
for i = 1:4
|
||||
dgd(i,:) = DGD(sigma_dgd,10000);
|
||||
end
|
||||
|
||||
rms = PMD * sqrt(40e3) * 1e12 ; % in sec.
|
||||
t = [0:0.01:100];
|
||||
z2 = sqrt(2/pi).*(t.^2)/(rms.^3).*exp(-t.^2/(2*rms^2)) ;
|
||||
figure;
|
||||
histogram(dgd*1e12,1000,"Normalization","pdf");
|
||||
hold on
|
||||
plot(t(1:200),z2(1:200),'r');
|
||||
hold off
|
||||
|
||||
function z = DGD(sigma_dgd,N)
|
||||
|
||||
%PMD = sqrt( (PMD*1e12)^2/3 );
|
||||
|
||||
% PMD = PMD * 1/( 1e-12 / sqrt(1e3) );
|
||||
|
||||
sigma_dgd = sigma_dgd*1e12;
|
||||
|
||||
x = [0:N];
|
||||
|
||||
almaga = randn(3,N)*sigma_dgd;
|
||||
|
||||
y = almaga.^2;
|
||||
|
||||
z0 = sqrt(sum(y,1));
|
||||
|
||||
|
||||
disp(mean(z0));
|
||||
disp(std(z0));
|
||||
% disp(var(z0));
|
||||
|
||||
z1 = [];
|
||||
|
||||
for l = 0:0.1:N
|
||||
z1 = [z1 sum(z0(1,:)>l & z0(1,:)<l+0.1) / N ];
|
||||
end
|
||||
|
||||
z = z0 *1e-12;
|
||||
|
||||
rms = sigma_dgd;
|
||||
t = [0:0.01:N];
|
||||
z2 = sqrt(2/pi).*(t.^2)/(rms.^3).*exp(-t.^2/(2*rms^2)) ;
|
||||
|
||||
figure;
|
||||
histogram(z0,1000,"Normalization","pdf");
|
||||
hold on
|
||||
plot(t(1:200),z2(1:200),'r');
|
||||
|
||||
return
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
59
Theory/Optical/PMD_maxwellshape/pmd_maxwell.m
Normal file
59
Theory/Optical/PMD_maxwellshape/pmd_maxwell.m
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
PMDcoeff = 0.1 * ( 1e-12 / sqrt(1e3) ); %PMD s/sqrt(m)
|
||||
|
||||
|
||||
L_40 = 40e3; %m
|
||||
mean_dgd = PMDcoeff * sqrt(L_40); % in sec. E(tau) == PMD value
|
||||
|
||||
disp(['defined mean of DGD in pico seconds: ',num2str(mean_dgd*1e12)]);
|
||||
|
||||
dgd_40km = [];
|
||||
for i = 1:4000
|
||||
dgd_40km(i,:) = getDGDrealization(mean_dgd,1);
|
||||
end
|
||||
|
||||
disp(['simulated mean of DGD in pico seconds: ',num2str(mean(dgd_40km)*1e12)]);
|
||||
|
||||
%%% 2 test for segmented link %%%%
|
||||
|
||||
L_10 = 10e3; %m
|
||||
mean_dgd = PMDcoeff * sqrt(L_10); % in sec. E(tau) == PMD value
|
||||
|
||||
dgd_10km = [];
|
||||
for j = 1:4
|
||||
for i = 1:1000
|
||||
dgd_10km(i,j) = getDGDrealization(mean_dgd,1);
|
||||
end
|
||||
end
|
||||
|
||||
a = sum(dgd_10km,2) ;
|
||||
|
||||
%%% calc maxwell curve
|
||||
mean_dgd = PMDcoeff * sqrt(L_40) * 1e12 ; % in sec.
|
||||
q = sqrt(pi/8) * mean_dgd;
|
||||
t = [0:0.01:100];
|
||||
|
||||
maxwell = sqrt(2/pi).* (t.^2)/(q.^3) .* exp(-t.^2/(2*q^2)) ;
|
||||
|
||||
|
||||
%%% plot everything
|
||||
|
||||
figure;
|
||||
histogram(dgd_40km*1e12,1000,"Normalization","pdf",'EdgeColor','none','FaceColor','b','FaceAlpha',0.6);
|
||||
hold on
|
||||
histogram(a*1e12,1000,"Normalization","pdf",'EdgeColor','none','FaceColor','g','FaceAlpha',0.6);
|
||||
plot(t(1:200),maxwell(1:200),'r','LineWidth',3);
|
||||
xline(mean_dgd,'LineWidth',3,'Color','magenta')
|
||||
hold off
|
||||
|
||||
function z = getDGDrealization(mean_dgd,N)
|
||||
|
||||
mean_dgd = mean_dgd; %to pico seconds
|
||||
q = sqrt(pi/8) * mean_dgd;
|
||||
threenormaldists = randn(3,N)*q; %3x normal dist around [-1,1] with a deviation of mean_dgd
|
||||
|
||||
y = threenormaldists.^2;
|
||||
|
||||
z = sqrt(sum(y,1));
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user