new function to eval every 2 km
This commit is contained in:
@@ -56,7 +56,7 @@ host = getenv('HOSTNAME'); if isempty(host), host = 'localhost'; end
|
|||||||
|
|
||||||
% Output directory depends on platform
|
% Output directory depends on platform
|
||||||
% create/ use folders foroptions.fiber_length_km, options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique
|
% create/ use folders foroptions.fiber_length_km, options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique
|
||||||
foldname = sprintf('%dkm_%dch_%dghz_%s', options.fiber_length_km, options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique);
|
foldname = sprintf('%dkm_%dch_%dghz_%s', options.fiber_length_km(end), options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique);
|
||||||
if ispc
|
if ispc
|
||||||
output_root = fullfile('C:\Users\Silas\Documents\MATLAB\Datensätze\FWM_2025\',foldname,'\');
|
output_root = fullfile('C:\Users\Silas\Documents\MATLAB\Datensätze\FWM_2025\',foldname,'\');
|
||||||
else
|
else
|
||||||
@@ -69,7 +69,7 @@ t = datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss');
|
|||||||
jobid = getenv('SLURM_JOB_ID'); if isempty(jobid), jobid = 'nojid'; end
|
jobid = getenv('SLURM_JOB_ID'); if isempty(jobid), jobid = 'nojid'; end
|
||||||
host = getenv('HOSTNAME'); if isempty(host), host = 'localhost'; end
|
host = getenv('HOSTNAME'); if isempty(host), host = 'localhost'; end
|
||||||
|
|
||||||
fname = sprintf('WDM_%s_%s_%s_%dkm_%dch_%dghz_%s.mat', char(t), host, jobid, options.fiber_length_km, options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique);
|
fname = sprintf('WDM_%s_%s_%s_%dkm_%dch_%dghz_%s.mat', char(t), host, jobid, options.fiber_length_km(end), options.num_channels, options.channel_spacing.*1e-9, options.fwm_mitigation_technique);
|
||||||
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
@@ -212,20 +212,22 @@ for realiz = 1:s.num_realiz
|
|||||||
d_local = d_local; %if ~=0, simulation uses "segmented fiber with d+,d-)
|
d_local = d_local; %if ~=0, simulation uses "segmented fiber with d+,d-)
|
||||||
randomize_D = true;
|
randomize_D = true;
|
||||||
Dvec = getDispersionVector(nSegments, d_local, zdw, randomize_D, s.random_key+realiz);
|
Dvec = getDispersionVector(nSegments, d_local, zdw, randomize_D, s.random_key+realiz);
|
||||||
|
propdist = 0;
|
||||||
for seg = 1:nSegments
|
for seg = 1:nSegments
|
||||||
|
|
||||||
Opt_sig_wdm_fib = DP_Fiber("L",segment_length,"D",Dvec(seg),"Dpmd",s.pmd,"Ds",0.07,...
|
Opt_sig_wdm_fib = DP_Fiber("L",segment_length,"D",Dvec(seg),"Dpmd",s.pmd,"Ds",0.07,...
|
||||||
"beat_len",10,"corr_len",100,"dz",1,"manakov",0,...
|
"beat_len",10,"corr_len",100,"dz",1,"manakov",0,...
|
||||||
"gamma",s.gamma,"lambda",zdw,"n_waveplates",10,"SS_dphimax",0.01,...
|
"gamma",s.gamma,"lambda",zdw,"n_waveplates",10,"SS_dphimax",0.01,...
|
||||||
"SS_dzmax",50,"SS_dzmin",10,"X_alpha",0.3,"X_beta",0,"rng",1).process(Opt_sig_wdm_fib);
|
"SS_dzmax",50,"SS_dzmin",10,"X_alpha",0.3,"X_beta",0,"rng",1).process(Opt_sig_wdm_fib);
|
||||||
|
|
||||||
|
|
||||||
|
propdist = segment_length;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
% Opt_sig_wdm_fib.spectrum("fignum",realiz,"displayname",'bla','lambda0_nm',1310,'useWavelengthAxis',0);
|
%%%%%% Demux after 2 km %%%%%%
|
||||||
|
|
||||||
% Opt_sig_wdm_fib.move_it_spectrum("fignum",100212,"displayname",'bla');
|
|
||||||
|
|
||||||
% Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",s.link_length/1000,"alpha",0.3,"D",0,"lambda0",1310,"s.gamma",0,"Dslope",0.07).process(Opt_sig)
|
|
||||||
Opt_sig_wdm_demux = Optical_Demultiplex("attenuation",0,"B",200e9,"filtype",1,"fs_out",fdac*kover,"fs_in",fdac*kover*upsample_pow,"lambda_center",1310).process(Opt_sig_wdm_fib);
|
Opt_sig_wdm_demux = Optical_Demultiplex("attenuation",0,"B",200e9,"filtype",1,"fs_out",fdac*kover,"fs_in",fdac*kover*upsample_pow,"lambda_center",1310).process(Opt_sig_wdm_fib);
|
||||||
|
|
||||||
for ri = 1:length(s.rop)
|
for ri = 1:length(s.rop)
|
||||||
@@ -327,6 +329,10 @@ for realiz = 1:s.num_realiz
|
|||||||
res.mlse = output_mlse;
|
res.mlse = output_mlse;
|
||||||
res.dbt = output_dbt;
|
res.dbt = output_dbt;
|
||||||
|
|
||||||
|
%%%%%% Demux after final (10) km %%%%%%
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% Save results
|
% Save results
|
||||||
save(fullfile(output_root, fname), 'res', '-v7.3');
|
save(fullfile(output_root, fname), 'res', '-v7.3');
|
||||||
fprintf('Saved results to: %s\n', fullfile(output_root, fname));
|
fprintf('Saved results to: %s\n', fullfile(output_root, fname));
|
||||||
|
|||||||
Reference in New Issue
Block a user