Merge branch 'main' of cau-git.rz.uni-kiel.de:nt/mitarbeiter/silas/imdd_simulation

This commit is contained in:
Silas Oettinghaus
2026-03-25 09:33:44 +01:00
14 changed files with 1033 additions and 24 deletions

View File

@@ -52,11 +52,17 @@ symbols = PAMmapper(M,0).map(bits);
symbols.fs = fsym;
symbols.spectrum("displayname",'Symbols','fignum',1);
%% RRC Shaping
rcalpha = 1;
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rcalpha);
Digi_sig = Pform.process(symbols);
Digi_sig.spectrum("displayname",'Signal after pluse shaping','fignum',1);
for rcalpha = 0.1:0.2:1
% rcalpha = 0.5;
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rc","pulselength",16,"alpha",rcalpha);
Digi_sig = Pform.process(symbols);
% Digi_sig.spectrum("displayname",'Signal after pluse shaping','fignum',1);
Digi_sig.eye(fsym,M,"fignum",0.1*10,"mode",1);
end
%% RRC Matched Filtering
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rcalpha);

View File

@@ -21,23 +21,23 @@ for k = 1:size(scenarios, 1)
Zr = scenarios{k,1};
Sr = scenarios{k,2};
col = scenarios{k,3};
[S_mesh, Z_mesh] = meshgrid(Sr, Zr);
D_all = zeros(length(lambda_nm), 4);
for i = 1:4
D_all(:,i) = (S_mesh(i)/4) .* (lambda_nm - (Z_mesh(i)^4)./(lambda_nm.^3));
end
D_min_env = min(D_all, [], 2);
D_max_env = max(D_all, [], 2);
[hl, hp] = boundedline(lambda_nm, (D_min_env+D_max_env)/2, (D_max_env-D_min_env)/2, ...
'cmap','alpha', col);
hp_handles(k) = hp;
set(hl, 'Visible', 'off');
if k == 1
D_wide_min = D_min_env;
D_wide_max = D_max_env;
@@ -49,6 +49,14 @@ for k = 1:size(scenarios, 1)
% 'HandleVisibility', 'off'); % Hide from legend
% Capture Wide Spec (k=1) bounds for the TikZ measurement lines
hp.FaceAlpha = 0.5;
% ho = outlinebounds(hl, hp);
% % Change properties
% set(ho, 'Color', 'k', ... % Make it black
% 'LineStyle', '--', ... % Make it dashed
% 'LineWidth', 1, ... % Make it thin
% 'HandleVisibility', 'off'); % Hide from legend
% Capture Wide Spec (k=1) bounds for the TikZ measurement lines
hp.FaceAlpha = 0.5;
else
hp.FaceAlpha = 0.8;
end

View File

@@ -0,0 +1,116 @@
% pmd_vs_length.m
% ------------------------------------------------------------
% Plots the Foschini-Poole (1991) analytical variance formula for PMD:
%
% sigma_T^2(z) = 2*(Delta_beta1)^2 * lc^2
% * [ exp(-z/lc) + z/lc - 1 ]
%
% and overlays the two asymptotic regimes:
% - Short-reach (z << lc) : sigma_T(z) ~ (Delta_beta1) * z
% - Long-haul (z >> lc) : sigma_T(z) ~ Dp * sqrt(z)
%
% Parameters follow typical SMF values from the literature.
% ------------------------------------------------------------
clear; clc;
%% Parameters
% Intrinsic local birefringence [ps/km]
Delta_beta1 = 1e-1; % typical value, adjust as needed
% Correlation length [km]
lc = 0.01; % ~50 m, typical for G.652 SMF
% PMD parameter [ps / sqrt(km)] derived from the two above
Dp = Delta_beta1 * sqrt(2 * lc);
% Distance axis [km]
z_max = 10; % maximum distance
z = linspace(0.001, z_max, 10000); % avoid z = 0 in log plot
%% Exact Foschini-Poole formula (sigma_T in ps)
sigma_T_sq = 2 .* Delta_beta1.^2 .* lc.^2 ...
.* (exp(-z ./ lc) + z ./ lc - 1);
sigma_T = sqrt(sigma_T_sq); % RMS DGD [ps]
%% Asymptotic regimes
% Short-reach: linear growth (z << lc)
sigma_T_short = Delta_beta1 .* z; % [ps]
% Long-haul: square-root growth (z >> lc)
sigma_T_long = Dp .* sqrt(z); % [ps]
%% Plot
figure('Color','w','Position',[100 100 760 480]);
hold on;
% Color palette (matching dissertation style)
c_exact = [0.1216, 0.4706, 0.7059]; % blue exact
c_short = [0.8392, 0.1529, 0.1569]; % red short-reach asymptote
c_long = [0.1961, 0.6314, 0.1725]; % green long-haul asymptote
% Exact solution
h_exact = plot(z, sigma_T, ...
'Color', c_exact, 'LineWidth', 2.0, ...
'DisplayName', 'Exact (Foschini \& Poole)');
% Short-reach asymptote σ_T Δβ · z
h_short = plot(z, sigma_T_short, ...
'Color', c_short, 'LineWidth', 1.4, 'LineStyle', '--', ...
'DisplayName', '$\sigma_T \approx \Delta\beta_1 \cdot z$ \quad ($z \ll l_c$)');
% Long-haul asymptote σ_T D_p z
h_long = plot(z, sigma_T_long, ...
'Color', c_long, 'LineWidth', 1.4, 'LineStyle', ':', ...
'DisplayName', '$\sigma_T \approx D_p \sqrt{z}$ \quad ($z \gg l_c$)');
%% Axes & decoration
ax = gca;
set(ax, 'XScale', 'log', 'YScale', 'log');
% X-axis: linear-style tick labels on log scale
x_ticks = [1e-3, 1e-2, 1e-1, 1, 10];
ax.XTick = x_ticks;
ax.XTickLabel = arrayfun(@(v) sprintf('%g km', v), x_ticks, 'UniformOutput', false);
% Y-axis: linear-style tick labels on log scale
y_ticks = [1e-3, 1e-2, 1e-1, 1, 10];
ax.YTick = y_ticks;
ax.YTickLabel = arrayfun(@(v) sprintf('%g ps', v), y_ticks, 'UniformOutput', false);
xlabel('Fiber length $z$ [km]', 'Interpreter', 'latex');
ylabel('RMS DGD $\sigma_T$ [ps]', 'Interpreter', 'latex');
grid on; box on;
xlim([min(z) z_max]);
legend([h_exact, h_short, h_long], ...
'Location', 'northwest', 'Interpreter', 'latex', 'FontSize', 9);
% Parameter annotation
anno_str = sprintf( ...
['$\\Delta\\beta_1 = %.3g$ ps/km\n' ...
'$l_c = %.0f$ m\n' ...
'$D_p = \\Delta\\beta_1\\sqrt{2l_c} = %.4g$ ps/$\\sqrt{\\mathrm{km}}$'], ...
Delta_beta1, lc*1e3, Dp);
annotation('textbox', [0.57 0.14 0.38 0.22], ...
'String', anno_str, ...
'Interpreter', 'latex', ...
'FontSize', 8.5, ...
'BackgroundColor','w', ...
'EdgeColor', [0.5 0.5 0.5], ...
'LineWidth', 0.8, ...
'FitBoxToText', 'on');
%% Regime transition marker
% Mark the crossover region around z = lc
xline(lc, '--', ...
'Color', [0.5 0.5 0.5], 'LineWidth', 0.8, ...
'HandleVisibility', 'off');
text(lc * 1.15, min(sigma_T)*3, '$l_c$', ...
'Interpreter', 'latex', 'Color', [0.4 0.4 0.4], 'FontSize', 9);
%% Export (uncomment to use)
% mat2tikz_improved('C:\...\tikz\pmd\pmd_vs_length.tikz')