Additions:

- Correction of the weighted DFE function in EQ.m
- Some evaluation scripts for FSO Data
This commit is contained in:
magf
2026-02-09 13:04:20 +01:00
parent 58e72070d9
commit 3edd64d365
22 changed files with 759 additions and 186 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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')

View File

@@ -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

View File

@@ -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];
M = 4;
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

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,3 @@
run('evalscript_pam_2_opt')
run('evalscript_pam_4_opt')
run('evalscript_pam_4_baud_rate_sweep_opt')

View File

@@ -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);
@@ -170,20 +170,8 @@ function [BER, Channel_Alpha] = first_analysis_baud_rate_sweep(baud_rate, power,
fprintf('Paper: %.1e \n \n',ber_in_paper);
BER = mlse_results.metrics.BER;
% 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
elseif method == 3
%% -------------------- 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

View File

@@ -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,8 +94,12 @@ 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);
@@ -105,14 +111,22 @@ function BER_value = first_analysis_ber(current, power, num_pf_coeff, taps_ffe,
sps = Kov;
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);

View File

@@ -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
%% -------------------- 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);
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_mlse_results] = ml_mlse(ml_mlse_equalizer, M, Rx_synced, Symbols, Bits,"precode_mode",duob_mode,"eth_style_symbol_mapping",mapping_style);
[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',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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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);