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

@@ -0,0 +1,28 @@
function opt_signal = channel_model_mpi(opt_signal,link_total_meter,oneway_interference_meter,sir)
%%%%% Local Parameter %%%%%%%%
%%%%% Ping Pong/ Interference Path %%%%%%
interference_sig = Fiber("fsimu",opt_signal.fs,"fiber_length",oneway_interference_meter*2/1000,"alpha",0.3,"D",0,"lambda0",1320,"gamma",0,"Dslope",0.07).process(opt_signal);
interference_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",-sir).process(interference_sig);
%%%%% Delay the "main" signal as in reality the interference is "older" than the main signal %%%%%%
[main_sig,dly] = opt_signal.delay("delay_meter",oneway_interference_meter*2);
main_sig.power;
interference_sig.power;
%%%%% ADD Interference and Main Signal %%%%%%
combined_sig = main_sig + interference_sig;
%%%%% Cut (due to the delays there is a jump in the signals) %%%%%%
if dly == 0;dly = 1;end
combined_sig.signal = combined_sig.signal(ceil(dly):end);
%%%%% Propagate through fiber %%%%%%
opt_signal = Fiber("fsimu",combined_sig.fs,"fiber_length",link_total_meter/1000,"alpha",0.3,"D",0,"lambda0",1320,"gamma",0,"Dslope",0.07).process(combined_sig);
end