Add some older Theory projects from the past years

This commit is contained in:
2026-03-25 09:45:42 +01:00
parent 5b90bc11a0
commit b4e735148e
17 changed files with 514 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
function [P_fwm, eta, deltaBeta, Leff] = calcFwmPower( ...
f_i, f_j, f_k, f_0, Ds, alphaDbPerKm, Lkm, ...
P_i, P_j, P_k, gammaWInvKmInv, degeneracyFactor)
% Calculate FWM power for a fiber with attenuation and phase mismatch.
%
% Inputs:
% f_i, f_j, f_k, f_0 : frequencies in Hz
% Ds : dispersion slope in ps / (nm^2 km)
% alphaDbPerKm : attenuation in dB/km
% Lkm : fiber length in km
% P_i, P_j, P_k : launch powers in W
% gammaWInvKmInv : nonlinear coefficient in 1/(W km)
% degeneracyFactor : typically 3 for degenerate FWM, 6 for non-degenerate
if nargin < 8 || isempty(P_i)
P_i = 1;
end
if nargin < 9 || isempty(P_j)
P_j = P_i;
end
if nargin < 10 || isempty(P_k)
P_k = 1;
end
if nargin < 11 || isempty(gammaWInvKmInv)
gammaWInvKmInv = 1;
end
if nargin < 12 || isempty(degeneracyFactor)
degeneracyFactor = 1;
end
[eta, deltaBeta] = calcFwmEfficiency(f_i, f_j, f_k, f_0, Ds, alphaDbPerKm, Lkm);
alphaNpPerM = alphaDbPerKm .* log(10) ./ 10 ./ 1e3;
Lm = Lkm .* 1e3;
gammaWInvMInv = gammaWInvKmInv ./ 1e3;
if abs(alphaNpPerM) < eps
Leff = Lm;
else
Leff = (1 - exp(-alphaNpPerM .* Lm)) ./ alphaNpPerM;
end
P_fwm = degeneracyFactor .* eta .* ...
(gammaWInvMInv .* Leff).^2 .* ...
P_i .* P_j .* P_k .* ...
exp(-alphaNpPerM .* Lm);
end