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