figure(202120); clf; hold on set(gcf, 'WindowState', 'maximized'); x = 225:10:285; shift = 0.5; x = [x;x-shift;x+shift;x;x]; hErr = gobjects(1,4); % Errorbars -> für Legende hLine = gobjects(1,4); % Linien durch Mittelwerte (nicht in Legende) for k = 1:4 BER = load("C:\Users\magf\Desktop\Desktop\Projekte\FSO\Data\BER_PAM_2_Optimal" + string(k) + ".mat"); BER_all = BER.BER_num_signal_sweep_matrix; BER_traces = BER_all((k-1)*7+1:k*7,:); BER_min = zeros(1,7); BER_avg = zeros(1,7); BER_max = zeros(1,7); for l = 1:7 BER_min(l) = min(BER_traces(l,:)); BER_avg(l) = mean(BER_traces(l,:)); BER_max(l) = max(BER_traces(l,:)); end % Log-sicherer Floor yFloor = 1e-12; BER_min(BER_min <= 0 | isnan(BER_min) | isinf(BER_min)) = yFloor; BER_max(BER_max <= 0 | isnan(BER_max) | isinf(BER_max)) = yFloor; BER_max = max(BER_max, BER_min); % Errorbar-Parameter (asymmetrisch) y = BER_avg; yneg = BER_avg - BER_min; ypos = BER_max - BER_avg; % Errorbars (Punkt + Intervall) hErr(k) = errorbar(x(k,:), y, yneg, ypos, 'o', ... 'LineWidth', 2.75, 'MarkerSize', 8, 'CapSize', 10); % Gestrichelte Linie durch die Mittelwerte (gleiche Farbe) hLine(k) = plot(x(k,:), y, '--o', ... 'LineWidth', 2.75, ... 'MarkerSize', 8, ... 'Color', hErr(k).Color); end % Paper-Kurve old_BER = 10.^([-1.5, -1.75, -2, -2.3, -2.6, -2.25, -1.95]); hPaper = plot(x(k+1,:), old_BER, '-o', 'LineWidth', 2.75, 'MarkerSize', 8); % FEC-Linien yline(2e-2, ':k', 'LineWidth',1.2); yline(3.8e-3,':b', 'LineWidth',1.2); yline(4.85e-3,':g','LineWidth',1.2); yline(2.2e-4,':r', 'LineWidth',1.2); % FEC Labels (FontSize = 22) text(240, 2.3e-2,'o-FEC', 'Color','k','FontSize',22,'Interpreter','latex') text(222, 3e-3,'HD-FEC', 'Color','b','FontSize',22,'Interpreter','latex') text(221, 5.7e-3,'KP4+Hamming', 'Color','g','FontSize',22,'Interpreter','latex') text(232, 2.5e-4,'KP4', 'Color','r','FontSize',22,'Interpreter','latex') % Achsen set(gca,'YScale','log'); grid minor ylim([1e-4 5e-1]) % Schriftgrößen Achsen ax = gca; ax.FontSize = 22; ax.LabelFontSizeMultiplier = 1; xlabel('Laser Bias Current [mA]', 'Interpreter','latex', 'FontSize', 22) ylabel('BER', 'Interpreter','latex', 'FontSize', 22) % Legende: Errorbar-Handles verwenden (Marker + vertikale Linie in der Legende) lgd = legend([hErr(1) hErr(2) hErr(3) hErr(4) hPaper], ... {'FFE','FFE+PF+MLSE','DB','ML-MLSE','BER Paper'}, ... 'Interpreter','latex','Location','southwest'); lgd.FontSize = 22; % Figure-Style set(gcf, 'Color', 'w'); set(gcf, 'Renderer', 'painters'); hold off