MPI Simulations and stuff

This commit is contained in:
Silas Oettinghaus
2024-08-14 09:36:51 +02:00
parent 1eeb970d8f
commit 34f9149346
61 changed files with 4295 additions and 429 deletions

View File

@@ -49,7 +49,7 @@ classdef Fiber
function signalclass_out = process(obj,signalclass_in)
% actual processing of the signal (steps 1. - 3.)
signalclass_in.signal = obj.process_(signalclass_in.signal);
signalclass_in = obj.process_(signalclass_in);
% append to logbook
lbdesc = 'Fiber ';
@@ -60,27 +60,45 @@ classdef Fiber
end
function opt_out = process_(obj,opt_in)
function opt_sig = process_(obj,opt_sig)
%METHOD1 Summary of this method goes here
% Detailed explanation goes here
obj.b2 = -obj.D*obj.lambda0^2/(2*pi*Constant.LightSpeed);
obj.b3 = ((obj.lambda0.^2/(2*pi*Constant.LightSpeed)).^2*obj.Dslope);
obj.alpha_lin = obj.alpha/10*log(10)/1000;
signal = opt_sig.signal;
lambda_signal = opt_sig.lambda;
N = length(opt_in);
obj.D = obj.D + (lambda_signal-obj.lambda0)*obj.Dslope;
obj.b2 = -obj.D*lambda_signal^2/(2*pi*Constant.LightSpeed);
obj.b3 = ((lambda_signal.^2/(2*pi*Constant.LightSpeed)).^2*obj.Dslope);
obj.alpha_lin = obj.alpha/10*log(10)/1000;
N = length(signal);
faxis = linspace(-obj.fsimu/2,obj.fsimu/2,N+1);
faxis = ifftshift(faxis(:,1:end-1));
faxis = faxis';
obj.linstep = -obj.alpha_lin/2 - 2*1j*pi^2*obj.b2*faxis.^2 - 4/3*1j*pi^3*obj.b3*faxis.^3;
if obj.gamma ~= 0
opt_out = obj.NLSE(opt_in);
else
opt_out = ifft(fft(opt_in).*exp(obj.linstep*obj.fiber_length)); % only one linear step
if 0
H = exp((obj.linstep)*obj.fiber_length);
figure(222)
hold on
plot(faxis.*1e-9,abs(real(Y)),'LineStyle','-','DisplayName','Abs(real) part of complex TF');
xlabel("Frequency in GHz")
ylabel("$ R|(H(\omega, L))|$")
end
%attenuate nase
if obj.gamma ~= 0
opt_out = obj.NLSE(signal);
else
opt_out = ifft( fft(signal) .* exp(obj.linstep*obj.fiber_length) ); % only one linear step
end
%TODO: attenuate nase ...
opt_sig.signal = opt_out;
end