Additions:
- Correction of the weighted DFE function in EQ.m - Some evaluation scripts for FSO Data
This commit is contained in:
@@ -172,9 +172,9 @@ classdef Signal
|
||||
|
||||
hold on;
|
||||
if isempty(options.color)
|
||||
plot(t* 1e6, sig(1:length(t)), 'DisplayName', dn, 'LineWidth', 0.1, 'Marker', '.', 'LineStyle','none', 'MarkerSize', 0.1);
|
||||
plot(t* 1e6, sig(1:length(t)), 'DisplayName', dn, 'LineWidth', 0.1, 'Marker', 'none', 'LineStyle','-', 'MarkerSize', 0.1);
|
||||
else
|
||||
plot(t* 1e6, sig(1:length(t)), 'DisplayName', dn, 'LineWidth', 0.1, 'Marker', '.', 'LineStyle','none', 'MarkerSize', 0.1,'Color',options.color);
|
||||
plot(t* 1e6, sig(1:length(t)), 'DisplayName', dn, 'LineWidth', 0.1, 'Marker', 'none', 'LineStyle','-', 'MarkerSize', 0.1,'Color',options.color);
|
||||
end
|
||||
% 2 c)
|
||||
% - xlabel if not already here: time in readable format (1 ms and not 1e-3 s)
|
||||
|
||||
@@ -10,10 +10,12 @@ classdef EQ < handle
|
||||
training_length %Number of training symbols
|
||||
training_loops %Number of loops through sequence for training mode
|
||||
ideal_dfe %Error free DFE decisions
|
||||
weighted_DFE %Weighted DFE on/off
|
||||
weighted_DFE %Weighted DFE off (0)/on (1)/PDFE (2)
|
||||
weighted_DFE_mode %Weighted DFE mode
|
||||
weighted_DFE_d_min %d_min threshold parameter for weighted DFE mode 1
|
||||
weighted_DFE_I_mode %[a_s, b_s, I_max]-parameters for the weighted DFE
|
||||
PDFE_coefficient %Coefficient for PDFE
|
||||
weighted_error %error based on hard- or weighted decision
|
||||
|
||||
DB_aim %Aim at duobinary output sequence
|
||||
|
||||
@@ -43,7 +45,6 @@ classdef EQ < handle
|
||||
|
||||
save_taps
|
||||
|
||||
|
||||
%during simulation
|
||||
k0
|
||||
b
|
||||
@@ -76,6 +77,8 @@ classdef EQ < handle
|
||||
options.weighted_DFE_mode = 'R1';
|
||||
options.weighted_DFE_d_min = 0.5;
|
||||
options.weighted_DFE_I_mode = [5,0.5,0.6];
|
||||
options.PDFE_coefficient = 0.5;
|
||||
options.weighted_error = 0; %0: Error based on hard-decision. 1: Error based on weighted decision.
|
||||
|
||||
options.DB_aim %Aim at duobinary output sequence
|
||||
|
||||
@@ -243,19 +246,11 @@ classdef EQ < handle
|
||||
cnt = 1;
|
||||
m = obj.k0+1; % starting symbol index at the delay compared to the training sequence
|
||||
|
||||
|
||||
|
||||
% n => index in rx data sequence
|
||||
%Step From: Oversampling(=2) * Startdelay + 1
|
||||
%Step Width: Oversampling(=2)
|
||||
%Step To: Oversampling(=2) * Training Length
|
||||
for n = obj.K*obj.k0+1:obj.K:obj.K*obj.training_length
|
||||
|
||||
% m => index in reference sequence
|
||||
m = m+1;
|
||||
|
||||
%
|
||||
%dc_ = mean(data(obj.Ne(1)+n+(obj.K-1):-1:n+obj.K).');
|
||||
% cut symbols from rx data sequence
|
||||
X_1 = data(obj.Ne(1)+n+(obj.K-1):-1:n+obj.K).';
|
||||
|
||||
@@ -275,8 +270,6 @@ classdef EQ < handle
|
||||
|
||||
error = e_dc + e_ffe - e_dfe - ref_in(m-obj.k0);
|
||||
|
||||
%error = e_dc + e_.'*input_vec - b_.'*reference_vec - ref_in(m-obj.k0);
|
||||
|
||||
if real(obj.FFEmu)
|
||||
if obj.l1act
|
||||
sgn_e = e_;
|
||||
@@ -297,28 +290,13 @@ classdef EQ < handle
|
||||
|
||||
e_dc = e_dc - obj.DCmu*error;
|
||||
|
||||
% obj.error_log.e_ffe(cnt,trainloops) = e_ffe;
|
||||
% obj.error_log.e_dfe(cnt,trainloops) = e_dfe;
|
||||
% obj.error_log.e_(cnt,trainloops) = error;
|
||||
|
||||
cnt = cnt+1;
|
||||
if obj.Nb(1) > 0
|
||||
b_ = b_ + obj.DFEmu*error*reference_vec; % Seems like normalized DFE has worse performance
|
||||
end
|
||||
|
||||
% figure(111);stem((e_),'Markersize',2);ylim([-1 1]);title('FFE Filter Taps');
|
||||
%
|
||||
% figure(222);
|
||||
% stem(input_vec);ylim([-3 3]);
|
||||
% hold on;
|
||||
% stem(reference_vec);ylim([-3 3]);
|
||||
% yline(error,'LineWidth',2); title('Input Vector');
|
||||
% hold off
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
%%
|
||||
% Plot the intermediate coefficients after training mode
|
||||
obj.b = b_(1:obj.Nb(1));
|
||||
@@ -349,10 +327,8 @@ classdef EQ < handle
|
||||
subplot(2,3,6);stem(obj.b3,'Markersize',2);
|
||||
title('DFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
%set(gcf,'Position',[200 500 700 400])
|
||||
end
|
||||
|
||||
|
||||
if obj.l1act
|
||||
neg_lin = find(abs(obj.e) < obj.thres(1));
|
||||
neg_2nd = find(abs(obj.e2) < obj.thres(2));
|
||||
@@ -401,6 +377,7 @@ classdef EQ < handle
|
||||
cnt = 1;
|
||||
m = 0;
|
||||
output_vec = zeros(1,floor(length(data_in)/obj.K)); % initilaization of the output vector
|
||||
output_vec_weighted = zeros(size(output_vec));
|
||||
dd_DFE = zeros(obj.Nb(1),1);
|
||||
D_2 = zeros(Nb2,1);
|
||||
D_3 = zeros(Nb3,1);
|
||||
@@ -418,7 +395,6 @@ classdef EQ < handle
|
||||
if obj.load_decisions
|
||||
pathn = evalin('base','modeldir');
|
||||
temp = load([pathn, 'MLSE_out', '.mat']) ;
|
||||
%eval(['dd_out_vals = temp.', 'a', ';']) ;
|
||||
dd_out_vals=temp.a;
|
||||
dd_out = zeros(size(data_in));
|
||||
dd_out(1:2:length(data_in)) = dd_out_vals;
|
||||
@@ -440,79 +416,103 @@ classdef EQ < handle
|
||||
end
|
||||
|
||||
output_vec(m) = e_dc + input_vec.'*coeff;
|
||||
y_raw = output_vec(m); % ungeweighteter Equalizer-Ausgang
|
||||
|
||||
if ~obj.load_decisions
|
||||
[~,dd_idx] = min(abs(output_vec(m) - constellation_in_)); % decision for closest constellation point
|
||||
dd_out(k) = constellation_in_(dd_idx);
|
||||
end
|
||||
|
||||
% Implementation of a weighted DFE in
|
||||
% order to prevent error propagation.
|
||||
% For further details, study [1], chapter 3.2.2 -
|
||||
% Modifications of DFE
|
||||
% ---------- WDFE / PDFE ----------
|
||||
fb_sym = dd_out(k);
|
||||
|
||||
if obj.weighted_DFE
|
||||
% define new constellations
|
||||
const = unique(ref_in);
|
||||
if obj.weighted_DFE ~= 0
|
||||
% Get constellation
|
||||
const = obj.constellation_in;
|
||||
|
||||
% determine reliability factor gamma_k
|
||||
% Half minimum symbol distance (for normalization of |x - xhat|)
|
||||
const_s = sort(const(:).');
|
||||
d = diff(const_s);
|
||||
dmin = min(d(d>0));
|
||||
halfStep = dmin/2;
|
||||
|
||||
% Reliability gamma_k
|
||||
if output_vec(m) > min(const) && output_vec(m) < max(const)
|
||||
gamma_k = 1 - abs(output_vec(m) - dd_out(k));
|
||||
gamma_k = 1 - abs(output_vec(m) - dd_out(k))/halfStep;
|
||||
gamma_k = max(0, min(1, gamma_k)); % clamp to [0,1]
|
||||
else
|
||||
gamma_k = 1;
|
||||
end
|
||||
|
||||
% select mode
|
||||
if strcmp(obj.weighted_DFE_mode,'R1')
|
||||
if gamma_k >= obj.weighted_DFE_d_min
|
||||
f_gamma_k = 1;
|
||||
else
|
||||
f_gamma_k = 0;
|
||||
% f(gamma_k)
|
||||
if obj.weighted_DFE == 1
|
||||
switch obj.weighted_DFE_mode
|
||||
case 'R1'
|
||||
f_gamma_k = double(gamma_k >= obj.weighted_DFE_d_min);
|
||||
|
||||
case 'R2'
|
||||
f_gamma_k = gamma_k;
|
||||
|
||||
case 'I1'
|
||||
a_s = obj.weighted_DFE_I_mode(1);
|
||||
b_s = obj.weighted_DFE_I_mode(2);
|
||||
t = a_s*((gamma_k/b_s) - 1);
|
||||
f_gamma_k = 0.5*(tanh(t) + 1);
|
||||
|
||||
case 'I2'
|
||||
a_s = obj.weighted_DFE_I_mode(1);
|
||||
b_s = obj.weighted_DFE_I_mode(2);
|
||||
Imax = obj.weighted_DFE_I_mode(3);
|
||||
t = a_s*((gamma_k/b_s) - 1);
|
||||
f_gamma_k = (Imax/2)*(tanh(t) + 1);
|
||||
|
||||
otherwise
|
||||
error('Unknown weighted_DFE_mode');
|
||||
end
|
||||
elseif strcmp(obj.weighted_DFE_mode,'R2')
|
||||
f_gamma_k = gamma_k;
|
||||
elseif strcmp(obj.weighted_DFE_mode,'I1')
|
||||
nom = 1-exp(-obj.weighted_DFE_I_mode(1)*((gamma_k/obj.weighted_DFE_I_mode(2))-1));
|
||||
denom = 1+exp(-obj.weighted_DFE_I_mode(1)*((gamma_k/obj.weighted_DFE_I_mode(2))-1));
|
||||
f_gamma_k = (1/2)*((nom/denom) - 1);
|
||||
elseif strcmp(obj.weighted_DFE_mode,'I2')
|
||||
nom = 1-exp(-obj.weighted_DFE_I_mode(1)*((gamma_k/obj.weighted_DFE_I_mode(2))-1));
|
||||
denom = 1+exp(-obj.weighted_DFE_I_mode(1)*((gamma_k/obj.weighted_DFE_I_mode(2))-1));
|
||||
f_gamma_k = (obj.weighted_DFE_I_mode(3)/2)*((nom/denom) - 1);
|
||||
|
||||
% Weighted decision
|
||||
xbar = f_gamma_k*dd_out(k) + (1 - f_gamma_k)*output_vec(m);
|
||||
|
||||
elseif obj.weighted_DFE == 2
|
||||
% PDFE
|
||||
xbar = obj.PDFE_coefficient*dd_out(k) + (1 - obj.PDFE_coefficient)*output_vec(m);
|
||||
end
|
||||
% calculate weighted output
|
||||
output_vec(m) = f_gamma_k.*dd_out(k)+(1-f_gamma_k).*output_vec(m);
|
||||
|
||||
output_vec_weighted(m) = xbar;
|
||||
fb_sym = xbar;
|
||||
output_vec(m) = xbar;
|
||||
end
|
||||
|
||||
if obj.Nb(1) > 0
|
||||
dd_DFE(2:end) = dd_DFE(1:end-1);
|
||||
dd_DFE(1) = dd_out(k);
|
||||
dd_DFE(1) = fb_sym;
|
||||
|
||||
if obj.ideal_dfe && m > obj.k0
|
||||
dd_DFE(1) = ref_in(m-obj.k0);
|
||||
end
|
||||
[D_2,D_3] = obj.calc_nl_vecs(dd_DFE,ind_mat_DFE_2nd,ind_mat_DFE_3rd,norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
|
||||
[D_2,D_3] = obj.calc_nl_vecs(dd_DFE,ind_mat_DFE_2nd,ind_mat_DFE_3rd,...
|
||||
norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
end
|
||||
|
||||
if obj.weighted_DFE ~= 0 && obj.weighted_error
|
||||
% Error weighted decision
|
||||
error = y_raw - output_vec(m);
|
||||
else
|
||||
% Error hard decision
|
||||
error = y_raw - dd_out(k);
|
||||
end
|
||||
% if dd_loop ~= 21
|
||||
error = output_vec(m) - dd_out(k);
|
||||
% else
|
||||
% error = 0;
|
||||
% end
|
||||
|
||||
coeff = coeff - mu_mat*error*conj(input_vec);
|
||||
% e_save(:,save_ind) = coeff;
|
||||
% save_ind = save_ind+1;
|
||||
|
||||
if 1%mu_mat ~= 0
|
||||
e_dc = e_dc - obj.DCmu*error;
|
||||
% error_log(cnt,dd_loop) = e_dc;
|
||||
cnt = cnt+1;
|
||||
if 1 % mu_mat ~= 0
|
||||
e_dc = e_dc - obj.DCmu*error;
|
||||
cnt = cnt+1;
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
%figure(2023);plot(error_log(:,1))
|
||||
% shifting the output sequence by k0 symbols
|
||||
yout = (circshift(output_vec.',-(obj.k0))).'; %(circshift(dd_out.',-(obj.k0))).';
|
||||
|
||||
@@ -581,12 +581,6 @@ classdef EQ < handle
|
||||
|
||||
% save frequency response to the work space
|
||||
if obj.save_taps
|
||||
% save the FFE coefficients to the work space
|
||||
% pathn = evalin('base','modeldir');
|
||||
% eval([obj.field_ffe, ' = obj.e ;']) ;
|
||||
% eval([obj.field_dfe, ' = b ;']) ;
|
||||
% eval(['save(''', pathn, '\',obj.filen,''', ''', obj.field_ffe,''', ''',obj.field_dfe,''') ;']) ;
|
||||
|
||||
save("coefficients",obj.e, obj.b);
|
||||
end
|
||||
|
||||
@@ -726,19 +720,11 @@ classdef EQ < handle
|
||||
|
||||
ind_mat_3rd2 = NaN(N3,3);
|
||||
count = 1;
|
||||
% for t = 1:Ne3
|
||||
% ind_mat_3rd2(count,:) = [t t t];
|
||||
% count = count + 1;
|
||||
% end
|
||||
for t = 1:Ne3
|
||||
% ind_mat_3rd2(count,:) = [t t t];
|
||||
% count = count + 1;
|
||||
for u = t:min(Ne3,t+len_3rd)
|
||||
for v = unique([t u])
|
||||
ind_mat_3rd2(count,:) = [t v u];
|
||||
count = count + 1;
|
||||
% ind_mat_3rd2(count,:) = [t u u];
|
||||
% count = count + 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -785,5 +771,5 @@ classdef EQ < handle
|
||||
end
|
||||
|
||||
% References
|
||||
% [1] T. J. Wettlin, “Experimental Evaluation of Advanced Digital Signal Processing for Intra-Datacenter Systems using Direct-Detection,” 2023. [Online]. Available: https://nbn-resolving.org/urn:nbn:de:gbv:8:3-2023-00703-8
|
||||
|
||||
% [1] T. J. Wettlin, “Experimental Evaluation of Advanced Digital Signal Processing for Intra-Datacenter Systems using Direct-Detection,” 2023.
|
||||
% [Online]. Available: https://nbn-resolving.org/urn:nbn:de:gbv:8:3-2023-00703-8
|
||||
@@ -621,7 +621,8 @@ classdef ML_MLSE < handle
|
||||
|
||||
% --- Initialize weights
|
||||
if isempty(obj.w) || any(size(obj.w) ~= [obj.Nf+1,obj.nFeasible])
|
||||
obj.w = randn(obj.Nf+1,obj.nFeasible);
|
||||
% obj.w = randn(obj.Nf+1,obj.nFeasible);
|
||||
obj.w = zeros(obj.Nf+1,obj.nFeasible);
|
||||
end
|
||||
|
||||
% --- Fast lookup tables
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
classdef Timing_Recovery < handle
|
||||
|
||||
properties(Access=public)
|
||||
modulation
|
||||
timing_error_detector
|
||||
sps
|
||||
damping_factor
|
||||
@@ -12,6 +13,7 @@ classdef Timing_Recovery < handle
|
||||
function obj = Timing_Recovery(options)
|
||||
arguments(Input)
|
||||
|
||||
options.modulation = 'PAM/PSK/QAM'
|
||||
options.timing_error_detector = 'Gardner';
|
||||
options.sps = 2;
|
||||
options.damping_factor = 1.0;
|
||||
@@ -32,6 +34,7 @@ classdef Timing_Recovery < handle
|
||||
function [data_out,timing_error] = process(obj, data_in)
|
||||
|
||||
timing_synchronization = comm.SymbolSynchronizer( ...
|
||||
"Modulation", obj.modulation, ...
|
||||
"TimingErrorDetector", obj.timing_error_detector, ...
|
||||
"SamplesPerSymbol", obj.sps, ...
|
||||
"DampingFactor", obj.damping_factor, ...
|
||||
|
||||
@@ -101,11 +101,11 @@ switch precode_mode
|
||||
tx_bits_precoded = mapper.demap(tx_symbols_precoded);
|
||||
|
||||
rx_bits = mapper.demap(eq_signal_hd_precoded);
|
||||
[~, errors_precoded, ber_precoded, ~] = calc_ber(rx_bits.signal, tx_bits_precoded.signal, "skip_front", 30000, "skip_end", 150, "returnErrorLocation", 1);
|
||||
[~, errors_precoded, ber_precoded, ~] = calc_ber(rx_bits.signal, tx_bits_precoded.signal, "skip_front", 150, "skip_end", 150, "returnErrorLocation", 1);
|
||||
|
||||
% B) Just determine BER
|
||||
rx_bits = mapper.demap(eq_signal_hd);
|
||||
[bits, errors, ber, error_pos] = calc_ber(rx_bits.signal, tx_bits.signal, "skip_front", 30000, "skip_end", 150, "returnErrorLocation", 1);
|
||||
[bits, errors, ber, error_pos] = calc_ber(rx_bits.signal, tx_bits.signal, "skip_front", 150, "skip_end", 150, "returnErrorLocation", 1);
|
||||
|
||||
case db_mode.db_precoded
|
||||
% Data is precoded on TX side
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
%%
|
||||
current = 225:10:285;
|
||||
current = string(current);
|
||||
power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [2, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
x = 225:10:285;
|
||||
BER_PAM_4 = [];
|
||||
filter_length = 210;
|
||||
eq_method = 2;
|
||||
num_signal_sweep = 11;
|
||||
our_signal = 1;
|
||||
|
||||
idx = 4;
|
||||
|
||||
obj = @(x) first_analysis_ber( ...
|
||||
current(idx), power(idx), num_pf_coeff, taps_ffe, taps_dfe, ...
|
||||
M, trlength, eq_method, filter_length, num_signal_sweep, our_signal, x);
|
||||
|
||||
x0 = [1 0.1 0.1];
|
||||
lb = [1 0 0];
|
||||
ub = [10 1 1];
|
||||
|
||||
opts = optimoptions('fmincon', ...
|
||||
'Display','iter', ...
|
||||
'Algorithm','sqp', ...
|
||||
'MaxFunctionEvaluations', 500, ...
|
||||
'StepTolerance', 1e-3, ...
|
||||
'OptimalityTolerance', 1e-3);
|
||||
|
||||
[xbest, berbest] = fmincon(obj, x0, [], [], [], [], lb, ub, [], opts);
|
||||
@@ -0,0 +1,38 @@
|
||||
%%
|
||||
current = 225:10:285;
|
||||
current = string(current);
|
||||
power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
curr_pow_num = 4;
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [0, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
eq_method = 2;
|
||||
filter_length = 210;
|
||||
our_signal = 0;
|
||||
BER_vec = [];
|
||||
|
||||
for i = 1:15
|
||||
BER_value = first_analysis_ber(current(curr_pow_num), power(curr_pow_num), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, i, our_signal);
|
||||
BER_vec = [BER_vec, BER_value];
|
||||
end
|
||||
|
||||
%%
|
||||
BER_Our_Signal = [1.2e-3,1.3e-3,9.0e-4,3.8e-4,4.8e-4,4.8e-4,5.7e-4,4.1e-4,4.8e-4,5.6e-4,3.8e-4,4.1e-4,4.1e-4,5.2e-4,3.8e-4];
|
||||
BER_Their_Signal = [5.7e-4,4.0e-4,5.2e-4,4.9e-4,5.2e-4,5.5e-4,4.8e-4,4.0e-4,3.6e-4,4.6e-4,5.7e-4,5.3e-4,4.5e-4,5.9e-4,6.4e-4];
|
||||
|
||||
figure;
|
||||
x = 1:15;
|
||||
plot(x, BER_Our_Signal, 'Marker', 'o', 'LineWidth', 1.75)
|
||||
hold on
|
||||
plot(x, BER_Their_Signal, 'Marker', 'o', 'LineWidth', 1.75)
|
||||
title('BER for FFE+PF+VNLE', 'Interpreter', 'latex')
|
||||
xlabel('Cell Entry', 'Interpreter', 'latex')
|
||||
ylabel('BER', 'Interpreter', 'latex')
|
||||
legend('Our Signal', 'Their Signal', 'Interpreter', 'latex')
|
||||
grid('minor')
|
||||
xlim([0 16])
|
||||
ylim([3e-4, 1.5e-3])
|
||||
hold off
|
||||
@@ -11,24 +11,28 @@ trlength = 4096*2;
|
||||
x = 225:10:285;
|
||||
BER_PAM_2 = [];
|
||||
post_only = 0;
|
||||
filter_length_vec = 140;
|
||||
num_signal = 11;
|
||||
our_signal = 1;
|
||||
|
||||
for eq_method = 2:4
|
||||
for eq_method = 1:4
|
||||
|
||||
if ~post_only
|
||||
for j = 1:length(current)
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method);
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length_vec, num_signal, our_signal);
|
||||
BER_PAM_2 = [BER_PAM_2, BER_run];
|
||||
end
|
||||
|
||||
save('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\BER_PAM_2_' + string(eq_method) + '.mat', 'x', 'BER_PAM_2')
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_' + string(eq_method) + '.mat', 'x', 'BER_PAM_2')
|
||||
BER_PAM_2 = [];
|
||||
|
||||
end
|
||||
|
||||
%%
|
||||
x = 225:10:285;
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\BER_PAM_2_' + string(k) + '.mat');
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_' + string(k) + '.mat');
|
||||
BER = BER.BER_PAM_2;
|
||||
|
||||
figure(202120)
|
||||
@@ -50,10 +54,10 @@ legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(280,2.2e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(280,3.3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(280,5.4e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(280,2.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
text(221,2.2e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,3.3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,5.4e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(231,2.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
%%
|
||||
current = 225:10:285;
|
||||
current = string(current);
|
||||
power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [200, 0, 0];
|
||||
taps_dfe = [0, 0, 0];
|
||||
M = 2;
|
||||
trlength = 4096*2;
|
||||
x = 225:10:285;
|
||||
BER_PAM_2 = [];
|
||||
BER_num_signal_sweep = [];
|
||||
BER_num_signal_sweep_matrix = [];
|
||||
post_only = 0;
|
||||
filter_length = 140;
|
||||
our_signal = 1;
|
||||
idx_opt = [];
|
||||
|
||||
for eq_method = 1:4
|
||||
for j = 1:length(power)
|
||||
for num_signal_sweep = 1:15
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, num_signal_sweep, our_signal);
|
||||
BER_num_signal_sweep = [BER_num_signal_sweep, BER_run];
|
||||
end
|
||||
[BER_opt, num_signal_opt] = min(BER_num_signal_sweep);
|
||||
BER_PAM_2 = [BER_PAM_2, BER_opt];
|
||||
idx_opt = [idx_opt, num_signal_opt];
|
||||
BER_num_signal_sweep_matrix = [BER_num_signal_sweep_matrix; BER_num_signal_sweep];
|
||||
BER_num_signal_sweep = [];
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_Optimal' + string(eq_method) + '.mat', 'BER_PAM_2', 'BER_num_signal_sweep_matrix', 'idx_opt')
|
||||
BER_PAM_2 = [];
|
||||
idx_opt = [];
|
||||
end
|
||||
|
||||
%%
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_Optimal' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_2;
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
old_BER = [-1.5, -1.75, -2, -2.3, -2.6, -2.25, -1.95];
|
||||
old_BER = 10.^(old_BER);
|
||||
plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','northwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(23,2.6e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(23,2.6e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(23.5,6.5e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(23,1.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex', 'FontSize', 14)
|
||||
ylabel('BER', 'Interpreter','latex', 'FontSize', 14)
|
||||
% title('BER for PAM-4', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
ylim([1e-4 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -5,34 +5,37 @@ power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [5, 0, 0];
|
||||
taps_dfe = [0, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
x = 225:10:285;
|
||||
BER_PAM_4 = [];
|
||||
filter_length = 210;
|
||||
num_signal = 11;
|
||||
our_signal = 1;
|
||||
|
||||
for eq_method = 2
|
||||
for j = 4
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method);
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, num_signal, our_signal);
|
||||
BER_PAM_4 = [BER_PAM_4, BER_run];
|
||||
save_and_append('meineDB.sqlite', 'BER_PAM_4_Save_and_Append', eq_method, num_signal, BER_run, x)
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\BER_PAM_4_DFE_' + string(eq_method) + '.mat', 'x', 'BER_PAM_4')
|
||||
BER_PAM_4 = [];
|
||||
end
|
||||
|
||||
%%
|
||||
x = 225:10:285;
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\BER_PAM_4_' + string(k) + '.mat');
|
||||
BER = BER.BER_PAM_4;
|
||||
x = 0:5:40;
|
||||
for k = 2
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_DFE_Tap_Sweep_' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_4;
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER, '-o','LineWidth',1.75);
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
old_BER = [-1.6, -1.85, -2.2, -2.45, -2.3, -2, -1.4];
|
||||
old_BER = 10.^(old_BER);
|
||||
plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
% old_BER = [-1.6, -1.85, -2.2, -2.45, -2.3, -2, -1.4];
|
||||
% old_BER = 10.^(old_BER);
|
||||
% plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
@@ -42,16 +45,16 @@ h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
'Location','northwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(286,2.2e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(285,3.3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(282.5,5.4e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(287,2.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
text(23,2.6e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(23,2.6e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(23.5,6.5e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(23,1.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex', 'FontSize', 14)
|
||||
ylabel('BER', 'Interpreter','latex', 'FontSize', 14)
|
||||
% title('BER for PAM-4', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
|
||||
@@ -10,20 +10,22 @@ trlength = 4096*4;
|
||||
x = 4:1:8;
|
||||
BER_PAM_4 = [];
|
||||
Alpha_PAM_4 = [];
|
||||
filter_length = 210;
|
||||
num_signal = 11;
|
||||
|
||||
for method = 1:4
|
||||
for i = 1:5
|
||||
[BER_run, ~] = first_analysis_baud_rate_sweep(baud_rate(i), power(i), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, method);
|
||||
for i = 1:length(power)
|
||||
[BER_run, ~] = first_analysis_baud_rate_sweep(baud_rate(i), power(i), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, method, filter_length, num_signal);
|
||||
BER_PAM_4 = [BER_PAM_4, BER_run];
|
||||
% Alpha_PAM_4 = [Alpha_PAM_4, Alpha_run];
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\New Baud Rate Sweep Data\BER_PAM_4_' + string(method) + '.mat', 'x', 'BER_PAM_4')
|
||||
save('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Baud_Rate_Sweep_' + string(method) + '.mat', 'x', 'BER_PAM_4')
|
||||
BER_PAM_4 = [];
|
||||
end
|
||||
|
||||
%% BER
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\Silas DSP\imdd_simulation\projects\FSO_transmission\New Baud Rate Sweep Data\BER_PAM_4_' + string(k) + '.mat');
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Baud_Rate_Sweep_' + string(k) + '.mat');
|
||||
BER = BER.BER_PAM_4;
|
||||
% x = BER.x;
|
||||
% BER_Alpha = load(filename);
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
baud_rate = 4:1:8;
|
||||
baud_rate = string(baud_rate);
|
||||
power = [8.4, 8.4, 42.3, 8.4, 8.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [0, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
x = 4:1:8;
|
||||
BER_PAM_4 = [];
|
||||
BER_num_signal_sweep = [];
|
||||
BER_num_signal_sweep_matrix = [];
|
||||
Alpha_PAM_4 = [];
|
||||
filter_length = 210;
|
||||
idx_opt = [];
|
||||
|
||||
for method = 1:4
|
||||
for j = 1:length(power)
|
||||
for num_signal_sweep = 1:15
|
||||
[BER_run, ~] = first_analysis_baud_rate_sweep(baud_rate(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, method, filter_length, num_signal_sweep);
|
||||
BER_num_signal_sweep = [BER_num_signal_sweep, BER_run];
|
||||
% Alpha_PAM_4 = [Alpha_PAM_4, Alpha_run];
|
||||
end
|
||||
[BER_opt, num_signal_opt] = min(BER_num_signal_sweep);
|
||||
BER_PAM_4 = [BER_PAM_4, BER_opt];
|
||||
idx_opt = [idx_opt, num_signal_opt];
|
||||
BER_num_signal_sweep_matrix = [BER_num_signal_sweep_matrix; BER_num_signal_sweep];
|
||||
BER_num_signal_sweep = [];
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Baud_Rate_Sweep_Optimal_' + string(method) + '.mat', 'BER_PAM_4', 'BER_num_signal_sweep_matrix', 'idx_opt')
|
||||
BER_PAM_4 = [];
|
||||
end
|
||||
|
||||
%% BER
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Baud_Rate_Sweep_Optimal_' + string(k) + '.mat');
|
||||
BER = BER.BER_PAM_4;
|
||||
% x = BER.x;
|
||||
% BER_Alpha = load(filename);
|
||||
% BER = BER_Alpha.BER_PAM_4;
|
||||
|
||||
% close all
|
||||
figure(239)
|
||||
plot(x, BER, '-o','LineWidth',1.75)
|
||||
hold on
|
||||
end
|
||||
|
||||
% old_BER = [-4.4, -4, -3.3, -2.7, -2.5, -2.475];
|
||||
% old_BER = 10.^(old_BER);
|
||||
% plot(x, old_BER, '--o','LineWidth',1)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE','FFE+PF+MLSE','DB','ML-MLSE',...
|
||||
'Interpreter','latex', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(8.2,2.3e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(8.2,3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(8.2,5.6e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(8.2,2.5e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Symbol Rate [GBd]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
% title('BER for PAM-4', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
% ylim([1e-4 5e-2])
|
||||
xlim([3 9])
|
||||
set(gca,'YScale','log')
|
||||
hold off
|
||||
|
||||
%% Channel Alpha
|
||||
% Alpha = BER_Alpha.Alpha_PAM_4;
|
||||
% figure
|
||||
% plot(x, Alpha, '--o','LineWidth',1)
|
||||
% hold on
|
||||
% xlabel('Symbol Rate [GBd]', 'Interpreter','latex')
|
||||
% ylabel('Channel Alpha', 'Interpreter','latex')
|
||||
% title('Channel Alpha for PAM-4 - 300-Tap-FFE - 1 Postfilter Coefficients - 8192 Training Symbols', 'Interpreter','latex')
|
||||
% grid minor
|
||||
% hold off
|
||||
@@ -0,0 +1,73 @@
|
||||
%%
|
||||
current = 225:10:285;
|
||||
current = string(current);
|
||||
power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [0, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
x = 225:10:285;
|
||||
BER_PAM_4 = [];
|
||||
BER_num_signal_sweep = [];
|
||||
BER_num_signal_sweep_matrix = [];
|
||||
filter_length = 210;
|
||||
our_signal = 1;
|
||||
idx_opt = [];
|
||||
|
||||
for eq_method = 1:4
|
||||
for j = 1:length(power)
|
||||
for num_signal_sweep = 1:15
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, num_signal_sweep, our_signal);
|
||||
BER_num_signal_sweep = [BER_num_signal_sweep, BER_run];
|
||||
end
|
||||
[BER_opt, num_signal_opt] = min(BER_num_signal_sweep);
|
||||
BER_PAM_4 = [BER_PAM_4, BER_opt];
|
||||
idx_opt = [idx_opt, num_signal_opt];
|
||||
BER_num_signal_sweep_matrix = [BER_num_signal_sweep_matrix; BER_num_signal_sweep];
|
||||
BER_num_signal_sweep = [];
|
||||
end
|
||||
save('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Optimal' + string(eq_method) + '.mat', 'BER_PAM_4', 'BER_num_signal_sweep_matrix', 'idx_opt')
|
||||
BER_PAM_4 = [];
|
||||
idx_opt = [];
|
||||
end
|
||||
|
||||
%%
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Optimal' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_4;
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
% old_BER = [-1.6, -1.85, -2.2, -2.45, -2.3, -2, -1.4];
|
||||
% old_BER = 10.^(old_BER);
|
||||
% plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','northwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(23,2.6e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(23,2.6e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(23.5,6.5e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(23,1.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex', 'FontSize', 14)
|
||||
ylabel('BER', 'Interpreter','latex', 'FontSize', 14)
|
||||
% title('BER for PAM-4', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
ylim([1e-4 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -0,0 +1,64 @@
|
||||
%%
|
||||
current = 225:10:285;
|
||||
current = string(current);
|
||||
power = [28.02, 33.2, 37.5, 42.3, 46.3, 49.3, 53.4];
|
||||
power = string(power);
|
||||
num_pf_coeff = 4;
|
||||
taps_ffe = [300, 0, 0];
|
||||
taps_dfe = [5, 0, 0];
|
||||
M = 4;
|
||||
trlength = 4096*4;
|
||||
x = 225:10:285;
|
||||
BER_PAM_4 = [];
|
||||
filter_length = 210;
|
||||
num_signal = 11;
|
||||
our_signal = 1;
|
||||
|
||||
for eq_method = 2
|
||||
for j = 4
|
||||
BER_run = first_analysis_ber(current(j), power(j), num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, num_signal, our_signal);
|
||||
BER_PAM_4 = [BER_PAM_4, BER_run];
|
||||
save_and_append('FSO_DB.sqlite', 'BER_PAM_4_Save_and_Append', 0, eq_method, num_signal, BER_run, x, taps_ffe)
|
||||
end
|
||||
BER_PAM_4 = [];
|
||||
end
|
||||
|
||||
%%
|
||||
x = 0:5:40;
|
||||
for k = 2
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Save_and_Append.mat');
|
||||
BER_values = BER.BER_PAM_4;
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
% old_BER = [-1.6, -1.85, -2.2, -2.45, -2.3, -2, -1.4];
|
||||
% old_BER = 10.^(old_BER);
|
||||
% plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','northwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(23,2.6e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(23,2.6e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(23.5,6.5e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(23,1.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex', 'FontSize', 14)
|
||||
ylabel('BER', 'Interpreter','latex', 'FontSize', 14)
|
||||
% title('BER for PAM-4', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
ylim([1e-4 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -0,0 +1,3 @@
|
||||
run('evalscript_pam_2_opt')
|
||||
run('evalscript_pam_4_opt')
|
||||
run('evalscript_pam_4_baud_rate_sweep_opt')
|
||||
@@ -1,4 +1,4 @@
|
||||
function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power, num_pf_coeff, taps_ffe, taps_dfe, M, trlength, method)
|
||||
function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power, num_pf_coeff, taps_ffe, taps_dfe, M, trlength, method, filter_length, num_signal)
|
||||
%%
|
||||
close all
|
||||
base = "C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\FSO Equalizer\Sweep Data\";
|
||||
@@ -90,7 +90,7 @@ function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power,
|
||||
% timing sync -> at this point we still have no symbol timing recovery, we
|
||||
% try to do this with 2sps EQ!
|
||||
[~,Rx_synced_cell,inverted,sequenceFound,sequenceStarts] = Rx_matched.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 1);
|
||||
Rx_matched_1 = Rx_synced_cell{1};
|
||||
Rx_matched_1 = Rx_synced_cell{num_signal};
|
||||
|
||||
% Rx_Time_Rec = Rx_matched;
|
||||
% Rx_Time_Rec = Timing_Recovery_Move_It('f_sim', 28e9, 'gamma', 0.1).process(Rx_matched_1);
|
||||
@@ -172,18 +172,6 @@ function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power,
|
||||
% Channel_Alpha = mlse_results.metrics.Alpha;
|
||||
|
||||
elseif method == 3
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",150,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",80,"sps",sps, ...
|
||||
"traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
fprintf('ML-based MLSE:\n');
|
||||
fprintf('My EQ: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
BER = ml_mlse_results.metrics.BER;
|
||||
|
||||
elseif method == 4
|
||||
%% -------------------- DB target --------------------
|
||||
mlse_db_ = MLSE("DIR",[1,1],"duobinary_output",0,"M",M,'trellis_states',PAMmapper(M,0).levels);
|
||||
|
||||
@@ -197,6 +185,19 @@ function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power,
|
||||
fprintf('My EQ: %.1e \n',dbt_results.metrics.BER);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
BER = dbt_results.metrics.BER;
|
||||
|
||||
elseif method == 4
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",150,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",filter_length,"sps",sps, ...
|
||||
"traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
fprintf('ML-based MLSE:\n');
|
||||
fprintf('My EQ: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
BER = ml_mlse_results.metrics.BER;
|
||||
|
||||
end
|
||||
Channel_Alpha = 0;
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method)
|
||||
function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe, taps_dfe, M, trlength, eq_method, filter_length, num_signal, our_signal, weighted_DFE)
|
||||
%%
|
||||
close all
|
||||
|
||||
@@ -12,9 +12,11 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
if M == 2
|
||||
tx_data_path = fullfile(base, "14G_PAM2\tx_info\tx_info_PAM2_14Gbd0.75RRC.mat");
|
||||
filename = fullfile(base, "14G_PAM2\M=2_Rs=1.4e10_Fs=8e10_I=" + current + "mA_RoP=" + power + "mW_L=31m_PS=RRC_rolloff=0.75_Mode=Rise.mat");
|
||||
data_tr_mf = load("C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\FSO Equalizer\FSO_FP_QCL_60umUTC\Already Recovered and Filtered\AfterSync_M=2_Rs=1.4e10_Fs=8e10_I=265mA_RoP=46.3mW_L=31m_PS=RRC_rolloff=0.75_Mode=Rise.mat");
|
||||
elseif M == 4
|
||||
tx_data_path = fullfile(base, "6G_PAM4\tx_info\tx_info_PAM4_6Gbd0.6RRC.mat");
|
||||
filename = fullfile(base, "6G_PAM4\M=4_Rs=6e9_Fs=8e10_I=" + current + "mA_RoP=" + power + "mW_L=31m_PS=RRC_rolloff=0.6_Mode=Rise.mat");
|
||||
data_tr_mf = load("C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\FSO Equalizer\FSO_FP_QCL_60umUTC\Already Recovered and Filtered\AfterSync_M=4_Rs=6e9_Fs=8e10_I=255mA_RoP=42.3mW_L=31m_PS=RRC_rolloff=0.6_Mode=Rise.mat");
|
||||
end
|
||||
|
||||
if mode == 1
|
||||
@@ -92,7 +94,11 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
% timing sync -> at this point we still have no symbol timing recovery, we
|
||||
% try to do this with 2sps EQ!
|
||||
[~,Rx_synced_cell,inverted,sequenceFound,sequenceStarts] = Rx_matched.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 1);
|
||||
Rx_matched_1 = Rx_synced_cell{1};
|
||||
Rx_matched_1 = Rx_synced_cell{num_signal};
|
||||
|
||||
data_tr_mf = Electricalsignal(data_tr_mf.Results, "fs", fsym);
|
||||
[~,Rx_synced_cell_tr_mf,inverted_tr_mf,sequenceFound_tr_mf,sequenceStarts_tr_mf] = data_tr_mf.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 1);
|
||||
Rx_tr_mf = Rx_synced_cell_tr_mf{num_signal};
|
||||
|
||||
% Rx_Time_Rec = Rx_matched;
|
||||
% Rx_Time_Rec = Timing_Recovery_Move_It('f_sim', 28e9, 'gamma', 0.1).process(Rx_matched_1);
|
||||
@@ -106,13 +112,21 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
end
|
||||
Rx_Time_Rec.fs = fsym;
|
||||
|
||||
Rx_Time_Rec = Rx_Time_Rec.normalize('mode','rms');
|
||||
Rx_tr_mf = Rx_tr_mf.normalize('mode','rms');
|
||||
|
||||
% Rx_Time_Rec.signal = resample(Rx_Time_Rec.signal, 12e9, 6e9);
|
||||
|
||||
% Rx_matched_1.plot("fignum",231231)
|
||||
% Rx_Time_Rec.plot("fignum",231231)
|
||||
|
||||
%% not working..
|
||||
Rx_synced = Rx_Time_Rec;
|
||||
if our_signal
|
||||
Rx_synced = Rx_Time_Rec;
|
||||
else
|
||||
Rx_synced = Rx_tr_mf;
|
||||
end
|
||||
% Rx_synced = Rx_Time_Rec;
|
||||
% Rx_synced = Rx_synced_cell{1};
|
||||
len_tr = trlength;
|
||||
mu_ffe1 = 0.0001;
|
||||
@@ -140,7 +154,7 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
|
||||
%% -------------------- FFE --------------------
|
||||
% requires some more digging what is going on :-)
|
||||
eq_ffe = EQ("Ne",[500, 0, 0],"Nb",[0,0,0], ...
|
||||
eq_ffe = EQ("Ne",[500, 0, 0],"Nb",[0, 0, 0], ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
||||
@@ -162,7 +176,8 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
eq_v = EQ("Ne",taps_ffe,"Nb",taps_dfe, ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",0,'weighted_DFE',1,'weighted_DFE_d_min',0.5, ...
|
||||
'weighted_DFE_mode','I2','weighted_DFE_I_mode',weighted_DFE,'PDFE_coefficient',0.01);
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0,"eth_style",mapping_style).levels);
|
||||
|
||||
@@ -194,7 +209,7 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
|
||||
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",150,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",80,"sps",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",filter_length,"sps",1, ...
|
||||
"traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
|
||||
@@ -98,7 +98,7 @@ H_transfer = Rx_spectrum.signal./Tx_spectrum.signal;
|
||||
H_inv = 1./H_transfer;
|
||||
|
||||
%Number of Samples/Symbol after Matched Filter
|
||||
Kov = 14;
|
||||
Kov = 40;
|
||||
|
||||
Scope_sig = Scope_sig.resample('fs_in',fs,'fs_out',Kov*fsym);
|
||||
|
||||
@@ -114,7 +114,7 @@ Rx_matched.spectrum("displayname",'Signal after matched filter','fignum',1);
|
||||
|
||||
data_tr_mf = Electricalsignal(data_tr_mf.Results, "fs", fsym);
|
||||
[~,Rx_synced_cell_tr_mf,inverted_tr_mf,sequenceFound_tr_mf,sequenceStarts_tr_mf] = data_tr_mf.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 1);
|
||||
Rx_tr_mf = Rx_synced_cell_tr_mf{1};
|
||||
Rx_tr_mf = Rx_synced_cell_tr_mf{11};
|
||||
|
||||
% timing sync -> at this point we still have no symbol timing recovery, we
|
||||
% try to do this with 2sps EQ!
|
||||
@@ -123,7 +123,7 @@ Rx_tr_mf = Rx_synced_cell_tr_mf{1};
|
||||
% Rx_matched = Rx_matched.resample("fs_out",2*fsym);
|
||||
|
||||
[~,Rx_synced_cell,inverted,sequenceFound,sequenceStarts] = Rx_matched.tsynch("reference", Symbols, "fs_ref", fsym, "debug_plots", 1);
|
||||
Rx_matched_1 = Rx_synced_cell{1};
|
||||
Rx_matched_1 = Rx_synced_cell{11};
|
||||
|
||||
Rx_matched_original = Rx_synced_cell{1};
|
||||
Rx_matched_original.signal = resample(Rx_matched_original.signal,1,Kov);
|
||||
@@ -135,14 +135,15 @@ Time_Rec = 1;
|
||||
if Time_Rec
|
||||
% [Rx_Time_Rec, Timing_Error] = Timing_Recovery("modulation", 'PAM/PSK/QAM', "timing_error_detector",'Gardner (non-data-aided)','sps',Kov,'damping_factor',1,'normalized_loop_bandwidth',1e-4,'detector_gain',2.7).process(Rx_matched_1);
|
||||
|
||||
% [Rx_Time_Rec, Timing_Error_MG] = Godard_Timing_Recovery('mode',3,'num_blocks',1,'fft_length',length(Rx_matched_1),'sps',Kov,'rolloff',0.6,'mu',-0.2,'Ki',1e-4).process(Rx_matched_1);
|
||||
% [Rx_Time_Rec, Timing_Error_MG] = Godard_Timing_Recovery('mode',2,'num_blocks',1,'fft_length',length(Rx_matched_1),'sps',Kov,'rolloff',0.6,'mu',-0.2,'Ki',1e-4).process(Rx_matched_1);
|
||||
% Rx_Time_Rec = Rx_Time_Rec.resample('fs_in',Kov*fsym,'fs_out',fsym);
|
||||
|
||||
Rx_Time_Rec = MaxVar_Timing_Recovery('mode',0,'fsym',fsym,'fadc',Kov*fsym,'num_tau',Kov*128,'sps',Kov,'comp_signal',Rx_tr_mf,'comp_mode',0).process(Rx_matched_1);
|
||||
Rx_Time_Rec = MaxVar_Timing_Recovery('mode',0,'fsym',fsym,'fadc',Kov*fsym,'num_tau',Kov*2048,'sps',Kov,'comp_signal',Rx_tr_mf,'comp_mode',0).process(Rx_matched_1);
|
||||
|
||||
sps = 1;
|
||||
else
|
||||
Rx_Time_Rec = Rx_matched_1;
|
||||
|
||||
sps = 1;
|
||||
end
|
||||
|
||||
@@ -188,7 +189,7 @@ for our_signal = 1
|
||||
end
|
||||
% Rx_synced = Rx_Time_Rec;
|
||||
% Rx_synced = Rx_synced_cell{1};
|
||||
len_tr = 4096*2;
|
||||
len_tr = 4096*4;
|
||||
mu_ffe1 = 0.0001;
|
||||
mu_ffe2 = 0.0008;
|
||||
mu_ffe3 = 0.001;
|
||||
@@ -232,40 +233,41 @@ for our_signal = 1
|
||||
% end
|
||||
|
||||
%% -------------------- VNLE + MLSE --------------------
|
||||
% pf_ncoeffs = 4;
|
||||
% eq_v = EQ("Ne",[300, 0, 0],"Nb",[0, 0, 0], ...
|
||||
% "training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
% "K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
% "FFEmu",0,"plotfinal",0,"ideal_dfe",1, ...
|
||||
% 'weighted_DFE',0,'weighted_DFE_d_min',0.5,'weighted_DFE_mode','R2','weighted_DFE_I_mode',[5,0.5,0.6]);
|
||||
% % eq_v = FFE_DFE('ffe_order',300,'dfe_order',5,'len_tr',len_tr,'epochs_tr',5,'epochs_dd',5, ...
|
||||
% % 'ffe_mu_dd',mu_ffe,'ffe_mu_tr',0,'dfe_mu_dd',mu_dfe,'dfe_mu_tr',0.005,'sps',sps,'decide',0);
|
||||
% pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
% mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0,"eth_style",mapping_style).levels);
|
||||
%
|
||||
% [vnle_results, mlse_results] = vnle_postfilter_mlse(eq_v, pf_, mlse_, M, Rx_synced, Symbols, Bits, ...
|
||||
% "precode_mode", duob_mode, 'showAnalysis', 1, "postFFE", [], "eth_style_symbol_mapping", mapping_style);
|
||||
%
|
||||
% mlse_results.metrics.print
|
||||
% if our_signal
|
||||
% fprintf('Our Signal: %.1e \n',mlse_results.metrics.BER);
|
||||
% fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
% else
|
||||
% fprintf('Their Signal: %.1e \n',mlse_results.metrics.BER);
|
||||
% fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
% end
|
||||
pf_ncoeffs = 4;
|
||||
eq_v = EQ("Ne",[300, 0, 0],"Nb",[2, 0, 0], ...
|
||||
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
||||
"K",sps,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
||||
"FFEmu",0,"plotfinal",0,"ideal_dfe",0, ...
|
||||
'weighted_DFE',1,'weighted_DFE_d_min',0.5,'weighted_DFE_mode','I2','weighted_DFE_I_mode',[1,0.1,0.1], ...
|
||||
'PDFE_coefficient',0.01);
|
||||
% eq_v = FFE_DFE('ffe_order',300,'dfe_order',5,'len_tr',len_tr,'epochs_tr',5,'epochs_dd',5, ...
|
||||
% 'ffe_mu_dd',mu_ffe,'ffe_mu_tr',0,'dfe_mu_dd',mu_dfe,'dfe_mu_tr',0.005,'sps',sps,'decide',0);
|
||||
pf_ = Postfilter("ncoeff",pf_ncoeffs,"useBurg",1);
|
||||
mlse_ = MLSE("duobinary_output",0,'M',M,'trellis_states',PAMmapper(M,0,"eth_style",mapping_style).levels);
|
||||
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",100,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",11,"sps",sps, ...
|
||||
"traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
[vnle_results, mlse_results] = vnle_postfilter_mlse(eq_v, pf_, mlse_, M, Rx_synced, Symbols, Bits, ...
|
||||
"precode_mode", duob_mode, 'showAnalysis', 1, "postFFE", [], "eth_style_symbol_mapping", mapping_style);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
mlse_results.metrics.print
|
||||
if our_signal
|
||||
fprintf('Our Signal: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
fprintf('Our Signal: %.1e \n',mlse_results.metrics.BER);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
else
|
||||
fprintf('Their EQ: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
fprintf('Their Signal: %.1e \n',mlse_results.metrics.BER);
|
||||
fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
end
|
||||
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
% ml_mlse_equalizer = ML_MLSE("epochs_tr",100,"epochs_dd",1, ...
|
||||
% "len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",11,"sps",sps, ...
|
||||
% "traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
%
|
||||
% [ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
% if our_signal
|
||||
% fprintf('Our Signal: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
% fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
% else
|
||||
% fprintf('Their EQ: %.1e \n',ml_mlse_results.metrics.BER);
|
||||
% fprintf('Paper: %.1e \n \n',ber_in_paper);
|
||||
% end
|
||||
end
|
||||
@@ -0,0 +1,61 @@
|
||||
%%
|
||||
x = 225:10:285;
|
||||
averaging_over_signal_traces = 1;
|
||||
all_BER_plots = 0;
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_Optimal' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_2;
|
||||
idx_opt = BER.idx_opt;
|
||||
BER_num_signal_sweep_matrix = BER.BER_num_signal_sweep_matrix;
|
||||
disp(idx_opt)
|
||||
|
||||
BER_num_signal_sweep_matrix = BER_num_signal_sweep_matrix(((k-1)*7+1:k*7),:);
|
||||
|
||||
if averaging_over_signal_traces
|
||||
for i = 1:size(BER_values,2)
|
||||
BER_values(i) = mean(BER_num_signal_sweep_matrix(i,:));
|
||||
end
|
||||
end
|
||||
|
||||
if all_BER_plots
|
||||
figure;
|
||||
hold on
|
||||
for i = 1:size(BER_num_signal_sweep_matrix,1)
|
||||
plot(BER_num_signal_sweep_matrix(i,:))
|
||||
end
|
||||
hold off
|
||||
end
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
old_BER = [-1.5, -1.75, -2, -2.3, -2.6, -2.25, -1.95];
|
||||
old_BER = 10.^(old_BER);
|
||||
plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(221,2.2e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,3.3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,5.4e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(231,2.4e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
% title('BER for PAM-2', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
ylim([1e-4 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -0,0 +1,61 @@
|
||||
%%
|
||||
x = 225:10:285;
|
||||
averaging_over_signal_traces = 1;
|
||||
all_BER_plots = 0;
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Optimal' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_4;
|
||||
idx_opt = BER.idx_opt;
|
||||
BER_num_signal_sweep_matrix = BER.BER_num_signal_sweep_matrix;
|
||||
disp(idx_opt)
|
||||
|
||||
BER_num_signal_sweep_matrix = BER_num_signal_sweep_matrix(((k-1)*7+1:k*7),:);
|
||||
|
||||
if averaging_over_signal_traces
|
||||
for i = 1:size(BER_values,2)
|
||||
BER_values(i) = mean(BER_num_signal_sweep_matrix(i,:));
|
||||
end
|
||||
end
|
||||
|
||||
if all_BER_plots
|
||||
figure;
|
||||
hold on
|
||||
for i = 1:size(BER_num_signal_sweep_matrix,1)
|
||||
plot(BER_num_signal_sweep_matrix(i,:))
|
||||
end
|
||||
hold off
|
||||
end
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
old_BER = [-1.6, -1.85, -2.2, -2.45, -2.3, -2, -1.4];
|
||||
old_BER = 10.^(old_BER);
|
||||
plot(x, old_BER, '-o','LineWidth',1.75)
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', 'BER Paper', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(221,2.2e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,3.2e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(221,5.7e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(221,2.5e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Laser Bias Current [mA]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
% title('BER for PAM-2', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
ylim([3e-5 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -0,0 +1,59 @@
|
||||
%%
|
||||
x = 4:1:8;
|
||||
averaging_over_signal_traces = 1;
|
||||
all_BER_plots = 0;
|
||||
for k = 1:4
|
||||
BER = load('C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_4_Baud_Rate_Sweep_Optimal_' + string(k) + '.mat');
|
||||
BER_values = BER.BER_PAM_4;
|
||||
idx_opt = BER.idx_opt;
|
||||
BER_num_signal_sweep_matrix = BER.BER_num_signal_sweep_matrix;
|
||||
disp(idx_opt)
|
||||
|
||||
BER_num_signal_sweep_matrix = BER_num_signal_sweep_matrix(((k-1)*5+1:k*5),:);
|
||||
|
||||
if averaging_over_signal_traces
|
||||
for i = 1:size(BER_values,2)
|
||||
BER_values(i) = mean(BER_num_signal_sweep_matrix(i,:));
|
||||
end
|
||||
end
|
||||
|
||||
if all_BER_plots
|
||||
figure;
|
||||
hold on
|
||||
for i = 1:size(BER_num_signal_sweep_matrix,1)
|
||||
plot(BER_num_signal_sweep_matrix(i,:))
|
||||
end
|
||||
hold off
|
||||
end
|
||||
|
||||
figure(202120)
|
||||
plot(x, BER_values, '-o','LineWidth',1.75);
|
||||
hold on
|
||||
end
|
||||
|
||||
h1 = yline(2e-2, ':k', 'LineWidth',1.5);
|
||||
h2 = yline(3.8e-3,':b', 'LineWidth',1.5);
|
||||
h3 = yline(4.85e-3,':g', 'LineWidth',1.5);
|
||||
h4 = yline(2.2e-4,':r', 'LineWidth',1.5);
|
||||
|
||||
% Legende NUR für Kurven
|
||||
legend('FFE', 'FFE+PF+MLSE', 'DB', 'ML-MLSE', ...
|
||||
'Interpreter','latex', ...
|
||||
'Location','southwest', 'FontSize', 14)
|
||||
|
||||
% FEC Labels direkt im Plot
|
||||
text(3.2,2.3e-2,'o-FEC','Color','k','FontSize', 14, 'Interpreter','latex')
|
||||
text(3.2,3e-3,'HD-FEC','Color','b','FontSize', 14, 'Interpreter','latex')
|
||||
text(3.2,5.9e-3,'KP4+Hamming','Color','g','FontSize', 14,'Interpreter','latex')
|
||||
text(3.2,2.7e-4,'KP4','Color','r','FontSize', 14,'Interpreter','latex')
|
||||
|
||||
xlabel('Symbol Rate [GBd]', 'Interpreter','latex')
|
||||
ylabel('BER', 'Interpreter','latex')
|
||||
% title('BER for PAM-2', 'Interpreter','latex')
|
||||
|
||||
grid minor
|
||||
xlim([3 9])
|
||||
ylim([5e-7 5e-1])
|
||||
set(gca,'YScale','log')
|
||||
% beautifyBERplot
|
||||
hold off
|
||||
@@ -236,8 +236,8 @@ for our_signal = 1
|
||||
% end
|
||||
|
||||
%% -------------------- ML-based MLSE (L=2) --------------------
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",100,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",80,"sps",sps, ...
|
||||
ml_mlse_equalizer = ML_MLSE("epochs_tr",150,"epochs_dd",1, ...
|
||||
"len_tr",length(Rx_synced),"mu_dd",0.03,"mu_tr",0.03,"order",210,"sps",sps, ...
|
||||
"traceback_depth",256,"L",1,"delta",4,"adaptive_mu",0);
|
||||
|
||||
[ml_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
|
||||
|
||||
Reference in New Issue
Block a user