MPI Simulations and stuff
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
vp = wh.parameter.vp.values(2);
|
||||
vb = wh.parameter.vb.values(1);
|
||||
rop = wh.parameter.rop.values;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
%% Settings
|
||||
|
||||
clear
|
||||
for M=[4]
|
||||
|
||||
for M=[8]
|
||||
|
||||
filename = '112G_2';
|
||||
load_sequence = 0;
|
||||
|
||||
datarate = 448e9;
|
||||
datarate = 224e9;
|
||||
|
||||
kover = 8;
|
||||
kover = 16;
|
||||
fsym = round(datarate*1e-9 / log2(M))*1e9;
|
||||
fdac = fsym;%256e9;
|
||||
|
||||
fdac = 256e9;%fsym;
|
||||
fadc = 256e9;
|
||||
|
||||
lowpass_cutoff = fsym/2 * 1.1;
|
||||
@@ -20,11 +20,11 @@ for M=[4]
|
||||
phd_bw = lowpass_cutoff;
|
||||
scp_bw = lowpass_cutoff;
|
||||
|
||||
LP_awg = Filter('filtdegree',4,"f_cutoff",75e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
||||
LP_modulator= Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
||||
LP_opt = Filter('filtdegree',3,"f_cutoff",fsym/log2(M).*1.5,"fs",fdac*kover,"filterType",filtertypes.gaussian);
|
||||
LP_phd = Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
||||
LP_scpe = Filter('filtdegree',4,"f_cutoff",110e9,"fs",fadc,"filterType",filtertypes.butterworth);
|
||||
LP_awg = Filter('filtdegree',4,"f_cutoff",75e9,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true);
|
||||
LP_modulator= Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true);
|
||||
LP_opt = Filter('filtdegree',3,"f_cutoff",fsym/log2(M).*1.5,"fs",fdac*kover,"filterType",filtertypes.gaussian,"active",true);
|
||||
LP_phd = Filter('filtdegree',2,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true);
|
||||
LP_scpe = Filter('filtdegree',4,"f_cutoff",110e9,"fs",fadc,"filterType",filtertypes.butterworth,"active",true);
|
||||
|
||||
% 1) PRBS Generation
|
||||
O = 18; %order of prbs
|
||||
@@ -48,15 +48,6 @@ for M=[4]
|
||||
digimod_out = PAMmapper(M,0).map(bits);
|
||||
digimod_out.fs = fsym;
|
||||
|
||||
|
||||
% linearGain = 1;
|
||||
% limit = 1;
|
||||
% SaturatingAmplifier = serdes.SaturatingAmplifier('Mode',1,...
|
||||
% 'Limit',limit,'LinearGain',linearGain);
|
||||
% X.signal = SaturatingAmplifier(X.signal);
|
||||
% X.signal = min(max(X.signal,-0.8),0.8);
|
||||
% X = X.normalize("mode","oneone");
|
||||
|
||||
sir = [20:2:36]; %decibel = attenuation of interference path
|
||||
laser_linewidth = [1e5 1e6 10e6];
|
||||
pn_key = [1:10];
|
||||
@@ -64,12 +55,12 @@ for M=[4]
|
||||
vb = [1:0.1:1.8];
|
||||
|
||||
rop = 0;
|
||||
sir = 28;
|
||||
laser_linewidth = 10e6;
|
||||
sir = 25;
|
||||
laser_linewidth = 0;
|
||||
pn_key = 9;
|
||||
vp = 0.5;
|
||||
vp = 1;%0.5;
|
||||
vb = 1;%[1:0.1:1.8];
|
||||
mpi_path = 50;
|
||||
mpi_path = 0;
|
||||
|
||||
cnt = 1;
|
||||
|
||||
@@ -85,62 +76,14 @@ for M=[4]
|
||||
%X = Pulseformer("fsym",fsym,"fdac",fdac,"pulse","rrc","pulselength",16,"rrcalpha",0.05).process(digimod_out);
|
||||
X = digimod_out;
|
||||
|
||||
% % precomp
|
||||
[b,a] = butter(2,75e9/(fsym/2),"low");
|
||||
H=freqz(b,a,length(X),fsym,'whole');
|
||||
max_amp_db = 3;
|
||||
p = find(abs(H)<10^(-max_amp_db/20));
|
||||
H(p) = 10^(-max_amp_db/20);
|
||||
H_maxatt = H;
|
||||
H_maxatt = max(H,10^(-20/20));
|
||||
H_inv = 1./H_maxatt;
|
||||
|
||||
freq_vec = linspace(-X.fs/2,X.fs/2,length(X));
|
||||
|
||||
h = sin(pi*freq_vec/fdac)./(pi*freq_vec/fdac);
|
||||
|
||||
max_amp_db = 40;
|
||||
max_amp_lin = 10^(-max_amp_db/20);
|
||||
|
||||
p = find(h<max_amp_lin);
|
||||
|
||||
h(p)=10^(-max_amp_db/20);
|
||||
|
||||
h = 1./h;
|
||||
|
||||
figure(13);
|
||||
plot(freq_vec.*1e-9,20*log10(fftshift(H_inv)));
|
||||
hold on
|
||||
plot(freq_vec.*1e-9,20*log10((h)));
|
||||
|
||||
|
||||
|
||||
X.signal = ifft(fftshift(h).'.*fft(X.signal));
|
||||
% X.signal = ifft(H_inv.*fft(X.signal));
|
||||
|
||||
figure(12)
|
||||
spectrum_plot(X.signal,fsym);
|
||||
|
||||
% 5) AWG (lowpass, quantization, sample and hold)
|
||||
X = AWG("fdac",fdac,"dac_min",-1,"dac_max",1,"lpf_active",0,"H_lpf",LP_awg,"kover",kover,"bit_resolution",16,"normalize2dac",1,"upsampling_method","samplehold").process(X);
|
||||
|
||||
spectrum_plot(X.signal,X.fs);
|
||||
|
||||
|
||||
burg_coeff = arburg(X.signal(10000:20000),100);
|
||||
|
||||
[h,w] = freqz(1,burg_coeff,length(X),"whole",fsym*kover);
|
||||
h = h/max(abs(h));
|
||||
hold on
|
||||
plot(w,20*log10(h),'DisplayName','Burg Coeff');
|
||||
|
||||
spectrum_plot(X.signal,X.fs);
|
||||
X = AWG("fdac",fdac,"dac_min",-1,"dac_max",1,"lpf_active",1,"H_lpf",LP_awg,"kover",kover,"bit_resolution",16,"normalize2dac",1,"upsampling_method","samplehold").process(X);
|
||||
|
||||
% 6) Lowpass behavior before laser
|
||||
X = LP_modulator.process(X);
|
||||
|
||||
% 7) Normalize signal
|
||||
X = X.normalize("mode","oneone");
|
||||
% % 7) Normalize signal
|
||||
% X = X.normalize("mode","oneone");
|
||||
|
||||
% 1) Laser; Modulation -> OPTICAL DOMAIN
|
||||
u_pi = 2;
|
||||
@@ -179,12 +122,12 @@ for M=[4]
|
||||
Combined_sig.signal = Combined_sig.signal(ceil(dly):end);
|
||||
|
||||
% Fiber
|
||||
Combined_sig = Fiber("fsimu",Combined_sig.fs,"fiber_length",2,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.08).process(Combined_sig);
|
||||
Combined_sig = Fiber("fsimu",Combined_sig.fs,"fiber_length",0,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.08).process(Combined_sig);
|
||||
|
||||
for i = 1:length(rop)
|
||||
|
||||
% Set ROP
|
||||
Rx_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",rop(i)).process(Combined_sig);
|
||||
Rx_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power","amplification_db",rop(i)).process(Combined_sig);
|
||||
rop_save(s,l,pnk,n,m,i) = Rx_sig.power;
|
||||
|
||||
% Square Law
|
||||
@@ -204,18 +147,8 @@ for M=[4]
|
||||
|
||||
% Sync Rx signal with reference
|
||||
[Scpe_sig,D,cuts] = Scpe_sig.tsynch("reference",digimod_out,"fs_ref",fsym);
|
||||
|
||||
% % % simple EQ (optimum mudc: 0.05 -> 0.005)
|
||||
% EQ_sig = EQ_silas_plain("Ne",[20,8,8],"Nb",[2,0,0],"trainlength",4096,"mu_dc_dd",0.005,"mu_dc_train",0.05,...
|
||||
% "mu_ffe_train",0.005,"mu_combined_dd",[0.0004 0.0006 0.0003 0.005],"ddloops",3,'trainloops',3,'sps',2).process(Rx_sig,digimod_out);
|
||||
|
||||
% EQ_sig = EQ("K",2,"plottrain",0,"plotfinal",0,...
|
||||
% "training_length",4096,"training_loops",3,...
|
||||
% "Ne",[50,8,8],"Nb",[2,0,0],...
|
||||
% "DCmu",0.005,"DDmu",[0.0004 0.0006 0.0003 0.005],"DFEmu",0.005,"FFEmu",0.00,...
|
||||
% "dd_loops",3,"epsilon",[10 100 1000 ],"M",2,...
|
||||
% "thres",[0.005 0.004 0.0005 ],"l1act",0,"delay",0,"rho",0.0005,"ideal_dfe",0,"DB_aim",0).process(Scpe_sig,digimod_out);
|
||||
|
||||
|
||||
Scpe_sig.spectrum;
|
||||
[EQ_sig,EQ_sym] = EQ_silas("Ne",[50,8,8],"Nb",[2,0,0],"trainlength",4096,...
|
||||
"sps",2,...
|
||||
"mu_dc_dd",0.00,...
|
||||
@@ -227,12 +160,12 @@ for M=[4]
|
||||
"ddloops",3,...
|
||||
"trainloops",3,...
|
||||
"eq_parallelization_blocklength",1, ...
|
||||
"eq_updatelatency",1,...
|
||||
"eq_updatelatency",0,...
|
||||
"eq_avg_blocklength",0).process(Scpe_sig,digimod_out);
|
||||
|
||||
% Demap
|
||||
|
||||
Rx_Bits = PAMmapper(M,0).demap(EQ_sym);
|
||||
Rx_Bits = PAMmapper(M,0).demap(EQ_sig);
|
||||
|
||||
% BER
|
||||
[~,errors_bm,BER(s,l,pnk,n,m,i),errors] = calc_ber(Rx_Bits.signal,bitpattern,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
||||
@@ -240,7 +173,7 @@ for M=[4]
|
||||
formatted_ber = sprintf('%.1e', BER(s,l,pnk,n,m,i));
|
||||
disp(['SIR: ',num2str(sir(s)),'; Lw:',num2str(laser_linewidth(l)),'; Key:',num2str(pn_key(pnk)),'; Vpeak: ',num2str(vp(n)),'; Vbias',num2str(vbias),'; BER: ',formatted_ber,'; run: ',num2str(cnt),' / 12961']);
|
||||
|
||||
plot_analysis_window;
|
||||
% plot_analysis_window;
|
||||
% drawnow;
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user