Scattered stuff from Silas during Dissertation
This commit is contained in:
@@ -2,8 +2,17 @@
|
||||
% LOAD DATA (PAM-4, sweep over ROP)
|
||||
% ============================================================
|
||||
database_type = 'mysql';
|
||||
db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
|
||||
|
||||
% db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
|
||||
dsp_options.database_type = "mysql";
|
||||
dsp_options.dataBase = 'labor_highspeed';%'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\silas_labor_newdsp_newstructure.db';
|
||||
dsp_options.server = "192.168.178.192";% "134.245.243.254";
|
||||
dsp_options.user = "silas";
|
||||
dsp_options.password = "silas";
|
||||
dsp_options.storage_path = 'W:\labdata\sioe_labor\';
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase],...
|
||||
"type", dsp_options.database_type,...
|
||||
"server", dsp_options.server,...
|
||||
"user", dsp_options.user, "password", dsp_options.password);
|
||||
pam_level = 4;
|
||||
fiberL = 1; % 1 km
|
||||
wlen = 1310;
|
||||
@@ -59,7 +68,7 @@ for k = 1:numel(curves)
|
||||
precoded = decide_precoded(pam_level,curves(k).eq);
|
||||
|
||||
cfg = struct;
|
||||
cfg.x_axis = 'power_mzm'; % ROP axis
|
||||
cfg.x_axis = 'power_rop'; % ROP axis
|
||||
cfg.y_axis = 'BER';
|
||||
cfg.agg = 'min';
|
||||
cfg.outlier = 'none';
|
||||
|
||||
@@ -48,7 +48,7 @@ fp = QueryFilter();
|
||||
% fp.where('Runs', 'run_id','EQUALS', 2776);
|
||||
M = 4;
|
||||
fp.where('Runs', 'pam_level','EQUALS', M);
|
||||
fp.where('Runs', 'bitrate','EQUALS', 360e9);%360,390
|
||||
fp.where('Runs', 'bitrate','EQUALS', 420e9);%360,390
|
||||
% fp.where('Runs', 'symbolrate','EQUALS', 195e9);
|
||||
fp.where('Runs', 'fiber_length','EQUALS', 2);
|
||||
fp.where('Runs', 'is_mpi','EQUALS', 0);
|
||||
|
||||
257
projects/Diss/investigate_noise_enhancement.m
Normal file
257
projects/Diss/investigate_noise_enhancement.m
Normal file
@@ -0,0 +1,257 @@
|
||||
|
||||
% Minimal IMDD model for investigating FFE noise enhancement.
|
||||
% Parameters mirror the current IMDD_base_system/imdd_it.m,
|
||||
% IMDD_base_system/imdd_model.m, and the FFE branch in dsp_scope_signal.m.
|
||||
|
||||
clearvars;
|
||||
close all;
|
||||
|
||||
%% Sweep parameters from imdd_it.m
|
||||
fsym_values = (152:16:200).*1e9;
|
||||
|
||||
precomp = 0;
|
||||
laser_wavelength = 1310;
|
||||
M = 4;
|
||||
link_length = 2;
|
||||
channel_alpha = 0.5;
|
||||
duob_mode = db_mode.db_precoded;
|
||||
decoding_mode = db_decoder.sequencedetection;
|
||||
channel_mode = channel_model.physical;
|
||||
channel_snr_dB = 20;
|
||||
rop_values = -8:2:4;
|
||||
|
||||
%% Inner model parameters from imdd_model.m
|
||||
bitrate = [];
|
||||
apply_pulsef = 0;
|
||||
fdac = 256e9;
|
||||
fadc = 256e9;
|
||||
random_key = 1;
|
||||
|
||||
rcalpha = 0.05;
|
||||
kover = 16;
|
||||
|
||||
vbias_rel = 0.5;
|
||||
u_pi = 3;
|
||||
vbias = -vbias_rel*u_pi;
|
||||
|
||||
laser_linewidth = 0;
|
||||
eml_alpha = 0;
|
||||
|
||||
len_tr = 4096*2;
|
||||
pf_ncoeffs = 1;
|
||||
mu_dc = 0.005;
|
||||
|
||||
nRates = numel(fsym_values);
|
||||
nRops = numel(rop_values);
|
||||
eq_names = ["FFE","VNLE"];
|
||||
nEqs = numel(eq_names);
|
||||
emptyResult = struct("fsym",[],"ROP",[],"equalizer",[],"BER",[],"SNR",[],"numBitErr",[], ...
|
||||
"eq_noise",[],"eq_signal_sd",[],"eq",[],"Rx_sig",[],"Tx_sig",[],"Tx_symbols",[]);
|
||||
results = repmat(emptyResult,nRates,nRops,nEqs);
|
||||
cols = flip(cbrewer2('RdYlBu',nRates+4));
|
||||
midIdx = floor(size(cols,1)/2) + (-1:2);
|
||||
cols(midIdx,:) = [];
|
||||
|
||||
for i = 1:numel(fsym_values)
|
||||
fsym = fsym_values(i);
|
||||
fprintf("Running %.0f GBd (%d/%d)\n", fsym*1e-9, i, numel(fsym_values));
|
||||
|
||||
if isempty(bitrate)
|
||||
bitrateCurrent = fsym * log2(M);
|
||||
end
|
||||
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rc","pulselength",16,"alpha",rcalpha);
|
||||
[Digi_sig, Symbols, ~] = PAMsource( ...
|
||||
"fsym",fsym,"M",M,"order",18,"useprbs",0, ...
|
||||
"fs_out",fdac, ...
|
||||
"applyclipping",0,"clipfactor",1.5, ...
|
||||
"applypulseform",apply_pulsef,"pulseformer",Pform, ...
|
||||
"randkey",random_key, ...
|
||||
"duobinary_mode",duob_mode, ...
|
||||
"mrds_code",0,"mrds_blocklength",512).process();
|
||||
|
||||
rateResults = repmat(emptyResult,nRops,nEqs);
|
||||
|
||||
|
||||
Tx_sig = Digi_sig;
|
||||
|
||||
El_sig = M8199B("kover",kover).process(Digi_sig);
|
||||
|
||||
tx_bwl = 85e9;
|
||||
El_sig = Filter("filtdegree",4,"f_cutoff",tx_bwl,"fs",fdac*kover, ...
|
||||
"filterType",filtertypes.bessel_inp,"active",true).process(El_sig);
|
||||
|
||||
El_sig = El_sig.normalize("mode","oneone");
|
||||
scaling = 0.7*(u_pi/2-abs(vbias-u_pi/2));
|
||||
El_sig = El_sig .* scaling;
|
||||
|
||||
Opt_sig = EML("mode",eml_mode.im_cosinus,"power",3,"fsimu",El_sig.fs, ...
|
||||
"lambda",laser_wavelength,"bias",vbias,"u_pi",u_pi, ...
|
||||
"linewidth",laser_linewidth,"randomkey",random_key+1, ...
|
||||
"alpha",eml_alpha).process(El_sig);
|
||||
|
||||
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length, ...
|
||||
"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
||||
|
||||
parfor j = 1:nRops
|
||||
rop = rop_values(j);
|
||||
fprintf(" ROP %.1f dBm (%d/%d)\n", rop, j, nRops);
|
||||
|
||||
Rx_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","output_power", ...
|
||||
"amplification_db",rop).process(Opt_sig);
|
||||
|
||||
Rx_sig = Photodiode("fsimu",fdac*kover,"dark_current",2e-08, ...
|
||||
"responsivity",0.6,"temperature",20,"nep",1.8e-11).process(Rx_sig);
|
||||
|
||||
rx_bwl = 90e9;
|
||||
Rx_sig = Filter("filtdegree",4,"f_cutoff",rx_bwl,"fs",fdac*kover, ...
|
||||
"filterType",filtertypes.butterworth,"active",true).process(Rx_sig);
|
||||
|
||||
Lp_scpe = Filter("filtdegree",4,"f_cutoff",110e9,"fs",fadc, ...
|
||||
"filterType",filtertypes.butterworth,"active",true);
|
||||
|
||||
Rx_sig = Scope("fsimu",fdac*kover,"fadc",fadc, ...
|
||||
"delay",0,"fixed_delay",0,"filtertype",filtertypes.butterworth, ...
|
||||
"samplingdelay",0,"rand_samplingdelay",0,"freq_offset",0, ...
|
||||
"samp_jitter",0,"adcresolution",8,"quantbuffer",0.1, ...
|
||||
"block_dc",1,"lpf_active",1,"H_lpf",Lp_scpe).process(Rx_sig);
|
||||
|
||||
txPulseformer = [];
|
||||
if apply_pulsef
|
||||
txPulseformer = Pform;
|
||||
end
|
||||
|
||||
Scpe_sig = preprocessSignal(Rx_sig, Symbols, fsym, ...
|
||||
"mode","auto", ...
|
||||
"tx_pulseformer",txPulseformer, ...
|
||||
"debug_plots",0);
|
||||
Scpe_sig.signal = Scpe_sig.signal(1:2*Symbols.length);
|
||||
Scpe_sig.signal = real(Scpe_sig.signal);
|
||||
|
||||
for k = 1:nEqs
|
||||
switch eq_names(k)
|
||||
case "FFE"
|
||||
eq_ = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",len_tr, ...
|
||||
"mu_dd",1e-1,"mu_tr",0.4,"order",50, ...
|
||||
"sps",2,"decide",0,"optmize_mus",1,"dd_mode",1, ...
|
||||
"adaption_technique","nlms","mu_dc",1.021e-05);
|
||||
case "VNLE"
|
||||
eq_ = VNLE("epochs_tr",5,"epochs_dd",5,"len_tr",len_tr, ...
|
||||
"mu_dd",[0.0004 0.0005 0.0006],"mu_tr",0, ...
|
||||
"order",[25,2,2],"sps",2,"decide",0, ...
|
||||
"optmize_mus",1,"mu_dc",0.1);
|
||||
end
|
||||
|
||||
[eq_signal_sd, eq_noise] = eq_.process(Scpe_sig, Symbols);
|
||||
|
||||
eq_signal_hd = PAMmapper(M,0).quantize(eq_signal_sd);
|
||||
rx_bits = PAMmapper(M,0).demap(eq_signal_hd);
|
||||
tx_bits_demapped = PAMmapper(M,0).demap(Symbols);
|
||||
[~, errors, ber] = calc_ber(rx_bits.signal, tx_bits_demapped.signal, ...
|
||||
"skip_front",10,"skip_end",10);
|
||||
|
||||
localResult = emptyResult;
|
||||
localResult.fsym = fsym;
|
||||
localResult.ROP = rop;
|
||||
localResult.equalizer = eq_names(k);
|
||||
localResult.BER = ber;
|
||||
localResult.SNR = snr(eq_signal_sd.signal, eq_noise.signal);
|
||||
localResult.numBitErr = errors;
|
||||
localResult.eq_noise = eq_noise;
|
||||
localResult.eq_signal_sd = eq_signal_sd;
|
||||
localResult.eq = eq_;
|
||||
localResult.Rx_sig = Rx_sig;
|
||||
localResult.Tx_sig = Tx_sig;
|
||||
localResult.Tx_symbols = Symbols;
|
||||
rateResults(j,k) = localResult;
|
||||
end
|
||||
end
|
||||
results(i,:,:) = reshape(rateResults,1,nRops,nEqs);
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
%% Plot section
|
||||
close all
|
||||
berGrid = reshape([results.BER],nRates,nRops,nEqs);
|
||||
|
||||
figure(400);
|
||||
clf;
|
||||
for k = 1:nEqs
|
||||
subplot(1,nEqs,k);
|
||||
plot(fsym_values.*1e-9, berGrid(:,:,k), "LineWidth",0.8, ...
|
||||
"LineStyle","-","Marker",".","MarkerSize",15);
|
||||
set(gca,"YScale","log");
|
||||
grid on;
|
||||
grid minor;
|
||||
xlabel("Symbol rate (GBd)");
|
||||
ylabel("BER");
|
||||
title(eq_names(k) + " BER vs. Symbol Rate");
|
||||
legend(compose("ROP %.1f dBm",rop_values),"Location","best");
|
||||
end
|
||||
|
||||
%%
|
||||
figure(500);
|
||||
clf;
|
||||
for k = 1:nEqs
|
||||
subplot(1,nEqs,k);
|
||||
plot(rop_values, berGrid(:,:,k).', "LineWidth",0.8, ...
|
||||
"LineStyle","-","Marker",".","MarkerSize",15);
|
||||
set(gca,"YScale","log");
|
||||
grid on;
|
||||
grid minor;
|
||||
xlabel("ROP");
|
||||
ylabel("BER");
|
||||
title(eq_names(k) + " BER vs. ROP");
|
||||
legend(compose("%.0f GBd",fsym_values.*1e-9),"Location","best");
|
||||
end
|
||||
|
||||
%%
|
||||
plotResults = reshape(results(:,end,:),nRates,nEqs);
|
||||
for k = 1:nEqs
|
||||
for i = 1:nRates
|
||||
fsym = plotResults(i,k).fsym;
|
||||
eq_noise = plotResults(i,k).eq_noise;
|
||||
eq_signal_sd = plotResults(i,k).eq_signal_sd;
|
||||
Rx_sig = plotResults(i,k).Rx_sig;
|
||||
Tx_sig = plotResults(i,k).Tx_sig;
|
||||
Tx_symbols = plotResults(i,k).Tx_symbols;
|
||||
displayName = sprintf('%s, %d GBd, ROP %.1f dBm',plotResults(i,k).equalizer,fsym.*1e-9,plotResults(i,k).ROP);
|
||||
|
||||
showEQNoisePSD(eq_noise, "fignum", 1, "displayname", displayName,"color",cols(i,:));
|
||||
xlim([0, 120])
|
||||
% mat2tikz_improved("C:/Users/Silas/Documents/6971e0b65b380ca6d71c837f/03_DSP_Techniques/tikz/ffe_noise_enhancement/noise_psd.tex")
|
||||
|
||||
Tx_sig.normalize("mode","rms").spectrum("displayname",displayName,'fignum',2,'normalizeTo0dB',0,"color",cols(i,:),"linestyle",'-','HandleVisibility','on');
|
||||
xlim([0, 120])
|
||||
% mat2tikz_improved("C:/Users/Silas/Documents/6971e0b65b380ca6d71c837f/03_DSP_Techniques/tikz/ffe_noise_enhancement/tx_signals.tex")
|
||||
|
||||
Rx_sig.normalize("mode","rms").spectrum("displayname",displayName,'fignum',3,'normalizeTo0dB',0,"color",cols(i,:));
|
||||
xlim([0, 120])
|
||||
% mat2tikz_improved("C:/Users/Silas/Documents/6971e0b65b380ca6d71c837f/03_DSP_Techniques/tikz/ffe_noise_enhancement/rx_signals.tex")
|
||||
|
||||
showEQNoiseSNR(eq_signal_sd, eq_noise,"displayname",displayName,"color",cols(i,:),"fignum",4);
|
||||
xlim([0, 120])
|
||||
% mat2tikz_improved("C:/Users/Silas/Documents/6971e0b65b380ca6d71c837f/03_DSP_Techniques/tikz/ffe_noise_enhancement/snr_after_ffe.tex")
|
||||
|
||||
% showEQfilter(plotResults(i,k).eq.e, eq_signal_sd.fs.*2,"displayname",displayName,'fignum',5,"color",cols(i,:));
|
||||
% xlim([0, 120]);
|
||||
|
||||
fprintf('%s BER %.2e \n',plotResults(i,k).equalizer,plotResults(i,k).BER)
|
||||
|
||||
if i == 1 || i == nRates-1 || i == nRates
|
||||
show2Dconstellation(PAMmapper(M,0).get_scaling.*eq_signal_sd.signal(1:end), PAMmapper(M,0).get_scaling.*Tx_symbols.signal(1:end), ...
|
||||
"displayname",displayName, ...
|
||||
"fignum",5+(k-1)*nRates+i, ...
|
||||
"clear",i == 1 && k == 1,"rasterize", false);
|
||||
mat2tikz_improved(sprintf("C:/Users/Silas/Documents/6971e0b65b380ca6d71c837f/03_DSP_Techniques/tikz/ffe_noise_enhancement/noise_correlation_%s.tex",displayName),"cleanfigure",true);
|
||||
eq_signal_sd.eye(fsym,M,"fignum",8+(k-1)*nRates+i,"mode",1);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%%
|
||||
|
||||
|
||||
66
projects/Diss/peak_distortion.m
Normal file
66
projects/Diss/peak_distortion.m
Normal file
@@ -0,0 +1,66 @@
|
||||
% Build convolution matrix and solve c such that conv(x,c) approx delta
|
||||
x = [0.05; -0.12; 0.3; 1; 0.25; -0.1; 0.04]; % channel pulse response
|
||||
Ntaps = 7;
|
||||
mu = 0.002;
|
||||
Nit = 500;
|
||||
|
||||
[c, hhist] = peakDistEqualizer(x, Ntaps, mu, Nit);
|
||||
|
||||
h_eff = conv(x,c);
|
||||
|
||||
stem(h_eff)
|
||||
grid on
|
||||
xlabel('Sample index')
|
||||
ylabel('Combined impulse response')
|
||||
|
||||
|
||||
function [c, h_hist] = peakDistEqualizer(x, Ntaps, mu, Nit)
|
||||
% Peak-distortion / Lucky sign-gradient equalizer
|
||||
%
|
||||
% x : sampled channel pulse response, main cursor should be near center
|
||||
% Ntaps : odd number of equalizer taps
|
||||
% mu : step size
|
||||
% Nit : number of training iterations
|
||||
%
|
||||
% c : equalizer coefficients
|
||||
% h : combined impulse response h = conv(x,c)
|
||||
|
||||
x = x(:);
|
||||
assert(mod(Ntaps,2)==1, 'Ntaps must be odd');
|
||||
|
||||
midTap = (Ntaps+1)/2;
|
||||
c = zeros(Ntaps,1);
|
||||
c(midTap) = 1; % start with through connection
|
||||
|
||||
h_hist = cell(Nit,1);
|
||||
|
||||
for it = 1:Nit
|
||||
h = conv(x,c);
|
||||
h_hist{it} = h;
|
||||
|
||||
% locate main cursor
|
||||
[~, mainIdx] = max(abs(h));
|
||||
|
||||
% normalize main cursor conceptually
|
||||
h = h / h(mainIdx);
|
||||
|
||||
% update non-center equalizer taps
|
||||
for j = 1:Ntaps
|
||||
if j == midTap
|
||||
continue
|
||||
end
|
||||
|
||||
% map equalizer tap j to corresponding ISI sample
|
||||
isiIdx = mainIdx + (j - midTap);
|
||||
|
||||
if isiIdx >= 1 && isiIdx <= length(h)
|
||||
c(j) = c(j) - mu * sign(h(isiIdx));
|
||||
end
|
||||
end
|
||||
|
||||
% optional: normalize center/main gain
|
||||
h = conv(x,c);
|
||||
[~, mainIdx] = max(abs(h));
|
||||
c = c / h(mainIdx);
|
||||
end
|
||||
end
|
||||
@@ -11,25 +11,25 @@
|
||||
% -> FFE / DFE / VNLE+MLSE / DB target DSP branches
|
||||
% -> result packages stored in DataStorage
|
||||
|
||||
close all;
|
||||
% close all;
|
||||
|
||||
if 1
|
||||
|
||||
uloops = struct;
|
||||
uloops.precomp = [0];
|
||||
uloops.fsym = 180e9;
|
||||
% uloops.bitrate = 100e9;
|
||||
uloops.fsym = [152:8:212].*1e9;
|
||||
% uloops.bitrate = 380e9;
|
||||
% uloops.laser_wavelength = [1293,1297.5,1302,1306.5,1310,1313.4,1318,1322.7,1327.4];
|
||||
uloops.laser_wavelength = [1310];
|
||||
uloops.M = [2,4,6,8];
|
||||
uloops.link_length = 1;
|
||||
uloops.M = [4];
|
||||
uloops.link_length = 2;
|
||||
% uloops.link_length = [0:2:10]; % 1,2,3,5,6,8,10
|
||||
uloops.channel_alpha = [0.8];
|
||||
uloops.duob_mode = db_mode.no_db;
|
||||
uloops.decoding_mode = "memoryless";
|
||||
uloops.channel_mode = "awgn"; %awgn_alphad
|
||||
uloops.channel_alpha = [0.5];
|
||||
uloops.duob_mode = db_mode.db_precoded;
|
||||
uloops.decoding_mode = db_decoder.sequencedetection;
|
||||
uloops.channel_mode = channel_model.physical;
|
||||
uloops.channel_snr_dB = [20];
|
||||
uloops.rop = -6;
|
||||
uloops.rop = 0;
|
||||
|
||||
wh = DataStorage(uloops);
|
||||
wh.addStorage("ber");
|
||||
@@ -39,35 +39,119 @@ if 1
|
||||
end
|
||||
|
||||
%%
|
||||
figure
|
||||
|
||||
wh = load("C:\Users\Silas\Documents\MATLAB\Datensätze\Diss_400G\highspeed_loop.mat");
|
||||
wh = wh.wh;
|
||||
M = 6;
|
||||
rate = 212e9;
|
||||
precomp = wh.parameter.precomp.values(1);
|
||||
wavelength = wh.parameter.laser_wavelength.values(1);
|
||||
link_length = wh.parameter.link_length.values(1);
|
||||
alpha = wh.parameter.channel_alpha.values(1);
|
||||
duob_mode = wh.parameter.duob_mode.values(1);
|
||||
decoding_mode = wh.parameter.decoding_mode.values(1);
|
||||
channel_mode = wh.parameter.channel_mode.values(1);
|
||||
snr_dB = wh.parameter.channel_snr_dB.values(1);
|
||||
rop = wh.parameter.rop.values;
|
||||
fsym = wh.parameter.fsym.values;
|
||||
|
||||
%% get all ROP values for M = 4 and rate = 92e9:
|
||||
a = wh.getStoValue('ber',precomp, rate, wavelength, M, link_length,alpha,duob_mode,decoding_mode,channel_mode,snr_dB,rop);
|
||||
|
||||
ber_ffe = getResultBER(a, "ffe_results");
|
||||
ber_dfe = getResultBER(a, "dfe_results");
|
||||
ber_vnle = getResultBER(a, "vnle_results");
|
||||
ber_mlse = getResultBER(a, "mlse_results");
|
||||
ber_dbt = getResultBER(a, "dbt_results");
|
||||
|
||||
figure(44)
|
||||
clf
|
||||
hold on
|
||||
if isfield(uloops, 'fsym') && isfield(uloops, 'bitrate')
|
||||
error('Define only one of uloops.fsym or uloops.bitrate.');
|
||||
elseif isfield(uloops, 'fsym')
|
||||
rateLookup = uloops.fsym;
|
||||
elseif isfield(uloops, 'bitrate')
|
||||
rateLookup = uloops.bitrate;
|
||||
else
|
||||
error('Define either uloops.fsym or uloops.bitrate.');
|
||||
end
|
||||
|
||||
for alpha = uloops.channel_alpha
|
||||
a=wh.getStoValue('ber',0, rateLookup, uloops.laser_wavelength, uloops.M, uloops.link_length,alpha,uloops.duob_mode,uloops.decoding_mode,uloops.channel_mode,uloops.channel_snr_dB);
|
||||
gmi_ffe = cellfun(@(x) x.ffe_results.metrics.GMI, a);
|
||||
alpha_ffe = cellfun(@(x) x.ffe_results.metrics.Alpha, a);
|
||||
|
||||
gmi_mlse = cellfun(@(x) x.mlse_results.metrics.GMI, a);
|
||||
|
||||
plot(uloops.channel_snr_dB,gmi_ffe,'DisplayName',sprintf(''),'LineStyle','-','HandleVisibility','on');
|
||||
plot(uloops.channel_snr_dB,gmi_mlse,'DisplayName',sprintf(''),'LineStyle','-','HandleVisibility','on');
|
||||
end
|
||||
|
||||
set(gca, 'YScale', 'log');
|
||||
% ylim([5e-5 0.5]);
|
||||
% yline([3.8e-3, 2e-2],'HandleVisibility','off');
|
||||
legend
|
||||
plot(rop,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","FFE");
|
||||
plot(rop,ber_dfe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","DFE");
|
||||
plot(rop,ber_vnle,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","VNLE");
|
||||
plot(rop,ber_mlse,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","MLSE");
|
||||
plot(rop,ber_dbt,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","DB target");
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','LineStyle','--','HandleVisibility','off');
|
||||
xlabel('Received Optical Power (dBm)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title(sprintf('BER vs. ROP | PAM %d | %.0f GBd',M,rate.*1e-9));
|
||||
set(gca,'yscale','log');
|
||||
set(gca,'Box','on');
|
||||
grid on;
|
||||
grid minor
|
||||
legend('Interpreter','none');
|
||||
beautifyBERplot()
|
||||
ylabel('BER');
|
||||
|
||||
%% get all baudrate values for M = 4 and fixed ROP:
|
||||
rop_ = -6;
|
||||
a = wh.getStoValue('ber',precomp, fsym, wavelength, M, link_length,alpha,duob_mode,decoding_mode,channel_mode,snr_dB,rop_);
|
||||
|
||||
ber_ffe = getResultBER(a, "ffe_results");
|
||||
ber_dfe = getResultBER(a, "dfe_results");
|
||||
ber_vnle = getResultBER(a, "vnle_results");
|
||||
ber_mlse = getResultBER(a, "mlse_results");
|
||||
ber_dbt = getResultBER(a, "dbt_results");
|
||||
|
||||
figure(45)
|
||||
clf
|
||||
hold on
|
||||
plot(fsym.*1e-9,ber_ffe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","FFE");
|
||||
plot(fsym.*1e-9,ber_dfe,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","DFE");
|
||||
plot(fsym.*1e-9,ber_vnle,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","VNLE");
|
||||
plot(fsym.*1e-9,ber_mlse,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","MLSE");
|
||||
plot(fsym.*1e-9,ber_dbt,"LineWidth",0.5,"LineStyle","-","Marker",".","MarkerSize",15,"DisplayName","DB target");
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','LineStyle','--','HandleVisibility','off');
|
||||
xlabel('Baudrate (GBd)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title(sprintf('BER vs. Baudrate | PAM %d | ROP %g dBm',M,rop_));
|
||||
set(gca,'yscale','log');
|
||||
set(gca,'Box','on');
|
||||
grid on;
|
||||
grid minor
|
||||
legend('Interpreter','none');
|
||||
beautifyBERplot()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% figure
|
||||
% hold on
|
||||
% if isfield(uloops, 'fsym') && isfield(uloops, 'bitrate')
|
||||
% error('Define only one of uloops.fsym or uloops.bitrate.');
|
||||
% elseif isfield(uloops, 'fsym')
|
||||
% rateLookup = uloops.fsym;
|
||||
% elseif isfield(uloops, 'bitrate')
|
||||
% rateLookup = uloops.bitrate;
|
||||
% else
|
||||
% error('Define either uloops.fsym or uloops.bitrate.');
|
||||
% end
|
||||
|
||||
% for alpha = uloops.channel_alpha
|
||||
% a=wh.getStoValue('ber',0, rateLookup, uloops.laser_wavelength, uloops.M, uloops.link_length,alpha,uloops.duob_mode,uloops.decoding_mode,uloops.channel_mode,uloops.channel_snr_dB);
|
||||
% gmi_ffe = cellfun(@(x) x.ffe_results.metrics.GMI, a);
|
||||
% alpha_ffe = cellfun(@(x) x.ffe_results.metrics.Alpha, a);
|
||||
|
||||
% gmi_mlse = cellfun(@(x) x.mlse_results.metrics.GMI, a);
|
||||
|
||||
% plot(uloops.channel_snr_dB,gmi_ffe,'DisplayName',sprintf(''),'LineStyle','-','HandleVisibility','on');
|
||||
% plot(uloops.channel_snr_dB,gmi_mlse,'DisplayName',sprintf(''),'LineStyle','-','HandleVisibility','on');
|
||||
% end
|
||||
|
||||
% set(gca, 'YScale', 'log');
|
||||
% % ylim([5e-5 0.5]);
|
||||
% % yline([3.8e-3, 2e-2],'HandleVisibility','off');
|
||||
% legend
|
||||
% beautifyBERplot()
|
||||
% ylabel('BER');
|
||||
|
||||
|
||||
|
||||
@@ -585,3 +669,24 @@ ylabel('BER');
|
||||
%
|
||||
% beautifyBERplot();
|
||||
% legend('BER contour lines');
|
||||
|
||||
function ber = getResultBER(results, resultField)
|
||||
ber = nan(size(results));
|
||||
resultField = char(resultField);
|
||||
|
||||
for k = 1:numel(results)
|
||||
if isempty(results{k}) || ~isstruct(results{k}) || ~isfield(results{k}, resultField)
|
||||
continue
|
||||
end
|
||||
|
||||
branch = results{k}.(resultField);
|
||||
if isempty(branch) || ~isstruct(branch) || ~isfield(branch, 'metrics')
|
||||
continue
|
||||
end
|
||||
|
||||
val = branch.metrics.BER;
|
||||
if ~isempty(val)
|
||||
ber(k) = val(1);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,11 +3,11 @@ function [output] = imdd_model(varargin)
|
||||
simulation_mode = 1;
|
||||
|
||||
%%% Change folder
|
||||
curFolder = pwd;
|
||||
funcFolder=fileparts(mfilename('fullpath'));
|
||||
if ~isempty(funcFolder)
|
||||
cd(funcFolder);
|
||||
end
|
||||
% curFolder = pwd;
|
||||
% funcFolder=fileparts(mfilename('fullpath'));
|
||||
% if ~isempty(funcFolder)
|
||||
% cd(funcFolder);
|
||||
% end
|
||||
|
||||
%%% Run parameters
|
||||
% TX
|
||||
@@ -16,8 +16,8 @@ fsym = 150e9;
|
||||
bitrate = [];
|
||||
|
||||
apply_pulsef = 0;
|
||||
fdac = 4*fsym;%256e9;
|
||||
fadc = 4*fsym;%256e9;
|
||||
fdac = 256e9;
|
||||
fadc = 256e9;
|
||||
random_key = 1;
|
||||
|
||||
rcalpha = 0.05;
|
||||
@@ -29,7 +29,7 @@ vbias = -vbias_rel*u_pi;
|
||||
|
||||
laser_wavelength = 1293;
|
||||
laser_linewidth = 0;
|
||||
tx_bw_nyquist = 0.65;
|
||||
tx_bw_nyquist = 0.65;
|
||||
|
||||
% Channel
|
||||
link_length = 1;
|
||||
@@ -112,18 +112,26 @@ end
|
||||
|
||||
f_nyquist = fsym/2;
|
||||
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rc","pulselength",16,"alpha",rcalpha);
|
||||
|
||||
[Digi_sig,Symbols,Tx_bits] = PAMsource(...
|
||||
"fsym",fsym,"M",M,"order",16,"useprbs",0,...
|
||||
"fs_out",fdac,...
|
||||
"applyclipping",0,"clipfactor",1.5,...
|
||||
"applypulseform",apply_pulsef,"pulseformer",Pform,...
|
||||
"randkey",random_key,...
|
||||
'duobinary_mode',duob_mode,...
|
||||
"mrds_code",0,"mrds_blocklength",512).process();
|
||||
%%%%% START SIMULATION
|
||||
|
||||
Digi_sig.spectrum("displayname",'Digi Spectrum','fignum',10,'normalizeTo0dB',1);
|
||||
measure_tf = 0;
|
||||
if measure_tf
|
||||
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",70,"f_ref",fadc);
|
||||
Digi_sig = freqresp.buildOFDM();
|
||||
else
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rc","pulselength",16,"alpha",rcalpha);
|
||||
[Digi_sig,Symbols,Tx_bits] = PAMsource(...
|
||||
"fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",fdac,...
|
||||
"applyclipping",0,"clipfactor",1.5,...
|
||||
"applypulseform",apply_pulsef,"pulseformer",Pform,...
|
||||
"randkey",random_key,...
|
||||
'duobinary_mode',duob_mode,...
|
||||
"mrds_code",0,"mrds_blocklength",512).process();
|
||||
end
|
||||
|
||||
% Digi_sig.spectrum("displayname",'Digi Spectrum','fignum',10,'normalizeTo0dB',1);
|
||||
|
||||
channel_mode = lower(string(channel_mode));
|
||||
|
||||
@@ -131,26 +139,35 @@ switch channel_mode
|
||||
case "physical"
|
||||
|
||||
%%%%% AWG
|
||||
% El_sig = M8199A("kover",kover).process(Digi_sig);
|
||||
El_sig = AWG("fdac",fdac,"f_cutoff",fsym,"lpf_active",1,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",0).process(Digi_sig);
|
||||
El_sig = M8199B("kover",kover).process(Digi_sig);
|
||||
% El_sig = AWG("fdac",fdac,"f_cutoff",fsym,"lpf_active",1,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",0,"H_lpf",H_awg).process(Digi_sig);
|
||||
% El_sig.spectrum("displayname",'Digi Spectrum','fignum',100,'normalizeTo0dB',0);
|
||||
% El_sig = El_sig.setPower(0,"dBm");
|
||||
|
||||
%%%%% Low-pass el. components %%%%%%
|
||||
tx_bwl = tx_bw_nyquist.*f_nyquist;
|
||||
% tx_bwl = 80e9;
|
||||
El_sig = Filter('filtdegree',4,"f_cutoff",tx_bwl,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true).process(El_sig);
|
||||
% tx_bwl = tx_bw_nyquist.*f_nyquist;
|
||||
tx_bwl = 85e9;
|
||||
El_sig = Filter('filtdegree',4,"f_cutoff",tx_bwl,"fs",fdac*kover,"filterType",filtertypes.bessel_inp,"active",true).process(El_sig);
|
||||
% El_sig.spectrum("displayname",'Digi Spectrum','fignum',100,'normalizeTo0dB',1);
|
||||
|
||||
%%%%% Electrical Driver Amplifier %%%%%%
|
||||
% El_sig = Amplifier("amp_mode","ideal_no_noise","gain_mode","gain","amplification_db",3).process(El_sig);
|
||||
El_sig = El_sig.normalize("mode","oneone");
|
||||
scaling = 0.6*(u_pi/2-abs(vbias-u_pi/2));
|
||||
scaling = 0.7*(u_pi/2-abs(vbias-u_pi/2));
|
||||
El_sig = El_sig .* scaling;
|
||||
|
||||
%%%%% MODULATE E/O CONVERSION %%%%%%
|
||||
[Opt_sig] = EML("mode",eml_mode.im_cosinus,"power",3,"fsimu",El_sig.fs,"lambda",laser_wavelength,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth,"randomkey",random_key+1,"alpha",eml_alpha).process(El_sig);
|
||||
|
||||
% figure(10)
|
||||
% hold on
|
||||
% scatter(El_sig.signal(1:100000)+vbias,(abs(Opt_sig.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
||||
% ylim([0 u_pi]);
|
||||
% xlim([-u_pi/2, u_pi/2]+vbias);
|
||||
% xlabel('Input in V')
|
||||
% ylabel('abs(Output) in mW')
|
||||
|
||||
|
||||
% Opt_sig.spectrum("displayname",'Opt Spectrum','fignum',10,'normalizeTo0dB',1);
|
||||
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
||||
|
||||
@@ -161,14 +178,14 @@ switch channel_mode
|
||||
Rx_sig = Photodiode("fsimu",fdac*kover,"dark_current",2e-08,"responsivity",1,"temperature",20,"nep",1.8e-11).process(Rx_sig);
|
||||
|
||||
%%%%%% Low-pass RX (PD, El. Connectors and Scope %%%%%%
|
||||
rx_bwl = rx_bw_nyquist.*f_nyquist;
|
||||
% rx_bwl = 80e9;
|
||||
% rx_bwl = rx_bw_nyquist.*f_nyquist;
|
||||
rx_bwl = 90e9;
|
||||
Rx_sig = Filter('filtdegree',4,"f_cutoff",rx_bwl,"fs",fdac*kover,"filterType",filtertypes.butterworth,"active",true).process(Rx_sig);
|
||||
|
||||
% %%%%%% Low-pass Scope %%%%%%
|
||||
Lp_scpe = Filter('filtdegree',4,"f_cutoff",110e9,"fs",fadc,"filterType",filtertypes.butterworth,"active",true);
|
||||
|
||||
% Rx_sig.spectrum("displayname",'Analog Rx Spectrum','fignum',100,'normalizeTo0dB',1);
|
||||
% Rx_sig.spectrum("displayname",'Analog Rx Spectrum','fignum',10,'normalizeTo0dB',1);
|
||||
|
||||
%%%%%% Scope %%%%%%
|
||||
Rx_sig = Scope("fsimu",fdac*kover,"fadc",fadc,...
|
||||
@@ -193,6 +210,15 @@ switch channel_mode
|
||||
error('Unknown channel_mode "%s". Supported: physical, awgn, awgn_alphaD.', channel_mode);
|
||||
end
|
||||
|
||||
if measure_tf
|
||||
Rx_sig = Rx_sig.resample("fs_out",freqresp.f_ref);
|
||||
freqresp.estimate(Rx_sig,"fileName",'','save',false);
|
||||
freqresp.plot()
|
||||
return;
|
||||
end
|
||||
|
||||
Rx_sig.spectrum("displayname",'Sampled Rx Spectrum','fignum',1996,'normalizeTo0dB',1);
|
||||
|
||||
txPulseformer = [];
|
||||
if apply_pulsef
|
||||
txPulseformer = Pform;
|
||||
@@ -205,7 +231,7 @@ dspParameters.mu_dfe = mu_dfe;
|
||||
dspParameters.mu_dc = mu_dc;
|
||||
dspParameters.use_ffe = 1;
|
||||
dspParameters.use_dfe = 0;
|
||||
dspParameters.use_vnle_mlse = 1;
|
||||
dspParameters.use_vnle_mlse = 0;
|
||||
dspParameters.use_dbtgt = 0;
|
||||
dspParameters.use_dbenc = 0;
|
||||
dspParameters.use_ml_mlse = 0;
|
||||
@@ -213,9 +239,9 @@ dspParameters.pf_ncoeffs = pf_ncoeffs;
|
||||
dspParameters.ffe_order_ffe = [50, 0, 0];
|
||||
dspParameters.ffe_order_dfe = [50, 0, 0];
|
||||
dspParameters.dfe_feedback_order = [2, 0, 0];
|
||||
dspParameters.ffe_order_vnle = [200, 0, 0];
|
||||
dspParameters.ffe_order_vnle = [50, 4, 4];
|
||||
dspParameters.dfe_order_vnle = dfe_order;
|
||||
dspParameters.ffe_order_dbtgt = [50, 0, 0];
|
||||
dspParameters.ffe_order_dbtgt = [50, 4, 4];
|
||||
dspParameters.dfe_order_dbtgt = dfe_order;
|
||||
dspParameters.decoding_mode = decoding_mode;
|
||||
|
||||
|
||||
@@ -130,17 +130,20 @@ Scpe_sig = Scpe_sig - mean(Scpe_sig.signal);
|
||||
Scpe_sig.signal = Scpe_sig.signal(1:2*length(Symbols));
|
||||
|
||||
%%
|
||||
if 0
|
||||
if 1
|
||||
% -------------------- FFE --------------------
|
||||
ffe_order = [50, 0, 0];
|
||||
ffe_order = [150, 0, 0];
|
||||
eq_ = EQ("Ne",ffe_order,"Nb",[2,0,0], ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",2,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",0);
|
||||
|
||||
% eq_ = FFE("epochs_tr",4,"epochs_dd",5,"len_tr",4096,"mu_dd",0.01,"mu_tr",0.01,"order",50,"sps",2,"decide",0, "adaption",adaption_method.nlms,"dd_mode",1);
|
||||
eq_ = FFE_DFE("epochs_tr",5,"epochs_dd",5,"len_tr",512,"ffe_mu_dd",1e-4,"dfe_mu_dd",5e-4,"ffe_mu_tr",0,"dfe_mu_tr",0,"ffe_order",99,"dfe_order",99,"sps",2,"decide",0);
|
||||
% mu_tr_rls = 9.805e-01; mu_dd_rls = 0.999989348903919;
|
||||
eq_ = FFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",1.933e-04,"order",ffe_order(1),"sps",2,"decide",0,"optmize_mus",1,"dd_mode",1,"adaption_technique","nlms");
|
||||
|
||||
|
||||
% eq_ = FFE("epochs_tr",4,"epochs_dd",5,"len_tr",4096,"mu_dd",0.01,"mu_tr",0.01,"order",50,"sps",2,"decide",0, "adaption",adaption_method.nlms,"dd_mode",1);
|
||||
% eq_ = FFE_DFE("epochs_tr",5,"epochs_dd",5,"len_tr",512,"ffe_mu_dd",1e-4,"dfe_mu_dd",5e-4,"ffe_mu_tr",0,"dfe_mu_tr",0,"ffe_order",99,"dfe_order",99,"sps",2,"decide",0);
|
||||
|
||||
output.ffe_results = ffe(eq_,M,Scpe_sig,Symbols,Tx_bits, ...
|
||||
"precode_mode",duob_mode,'showAnalysis',1,"postFFE",[], ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
if 0
|
||||
if 1
|
||||
% A) RUN FULL LOOP
|
||||
M_format = [2,4,6,8];
|
||||
snr = 10:25;
|
||||
|
||||
@@ -210,8 +210,8 @@ classdef ml_mlse_pam < handle
|
||||
% ==============================================================
|
||||
% ML-Based Branch Metric Estimation + Viterbi
|
||||
% ==============================================================
|
||||
debug = 1;
|
||||
showPlots = 1;
|
||||
% debug = 1;
|
||||
% showPlots = 1;
|
||||
|
||||
nSymbols = ceil(N/obj.sps);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ for b = 1:numel(baudrates)
|
||||
|
||||
[Rx_sig_2sps_v1, Symbols_v1, Tx_bits_v1] = standard_link_model( ...
|
||||
"M",M,"fsym",baudrate,"rop",rop,"laser_linewidth",1310, ...
|
||||
"link_length_m",0,"random_key",1);
|
||||
"link_length_km",0,"random_key",1);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,19 +3,24 @@ M = 4;
|
||||
order = 18;
|
||||
randkey = 1;
|
||||
|
||||
bitpattern = [];
|
||||
s = RandStream('twister','Seed',randkey);
|
||||
for i = 1:log2(M)
|
||||
N = 2^(order-1); %length of prbs
|
||||
bitpattern(:,i) = randi(s,[0 1], N, 1);
|
||||
end
|
||||
% bitpattern = [];
|
||||
% s = RandStream('twister','Seed',randkey);
|
||||
% for i = 1:log2(M)
|
||||
% N = 2^(order-1); %length of prbs
|
||||
% bitpattern(:,i) = randi(s,[0 1], N, 1);
|
||||
% end
|
||||
%
|
||||
% if M == 6
|
||||
% bitpattern = reshape(bitpattern',[],1);
|
||||
% bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
||||
% end
|
||||
%
|
||||
% Bits = Informationsignal(bitpattern);
|
||||
|
||||
if M == 6
|
||||
bitpattern = reshape(bitpattern',[],1);
|
||||
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
||||
end
|
||||
|
||||
Bits = Informationsignal(bitpattern);
|
||||
Bits = Signalgenerator( ...
|
||||
"form", signalform.prms, ...
|
||||
"M", M, ...
|
||||
"order", order).process();
|
||||
|
||||
Symbols = PAMmapper(M,0).map(Bits);
|
||||
Symbols.fs = 200e9;
|
||||
@@ -31,8 +36,7 @@ symbols_filt = Symbols.filter(h,1);
|
||||
|
||||
%% SHOW FIG 3 in Paper: "ML Base Pre-Eq"
|
||||
|
||||
SNR_dB = [20:1:25];
|
||||
SNR_db = linspace(12,25,12);
|
||||
SNR_dB = [15:2:25];
|
||||
|
||||
ber_ffe = zeros(size(SNR_dB));
|
||||
ber_mlse_l5 = zeros(size(SNR_dB));
|
||||
@@ -43,7 +47,7 @@ ber_ml_mlse_l4 = zeros(size(SNR_dB));
|
||||
|
||||
epochs_training = 100;
|
||||
|
||||
for i = 1:numel(SNR_dB)
|
||||
parfor i = 1:numel(SNR_dB)
|
||||
|
||||
symbols_noi = symbols_filt;
|
||||
symbols_noi.signal = awgn(symbols_filt.signal, SNR_dB(i), 'measured'); % AWGN with given SNR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%% Run parameters
|
||||
% TX
|
||||
M = 4;
|
||||
m = floor(log2(M)*10)/10;
|
||||
m = floor(log2(M)*10)/10;
|
||||
fsym = 224e9;
|
||||
|
||||
apply_pulsef = 1;
|
||||
|
||||
Reference in New Issue
Block a user