wh = load('C:\Users\sioe\Documents\High_Speed_Measurement_2024\10km_bitrate_complete\20241030_170224_wh.mat'); wh = wh.obj; M_vals = wh.parameter.M.values; M_choose = M_vals(1); lambda_vals = wh.parameter.lambda.values; bitrate_vals = wh.parameter.bitrate.values; duobinary_vals = wh.parameter.duobinary.values; rop_atten_vals = wh.parameter.rop_atten.values; figure(177) for M_choose = [8] sgtitle(['PAM',num2str(M_choose)]) for l = 1:numel(lambda_vals) for b = 1:numel(bitrate_vals) cel = wh.getStoValue('ber_vnle',M_choose(1),lambda_vals(l),bitrate_vals(b),duobinary_vals(1),rop_atten_vals(1)); ber_vnle(b)=min(cel{1}); cel = wh.getStoValue('ber_vnle_mlse',M_choose(1),lambda_vals(l),bitrate_vals(b),duobinary_vals(1),rop_atten_vals(1)); ber_vnle_mlse(b)=min(cel{1}); cel = wh.getStoValue('ber_db',M_choose(1),lambda_vals(l),bitrate_vals(b),duobinary_vals(2),rop_atten_vals(1)); ber_db(b)=min(cel{1}); cel = wh.getStoValue('ber_db',M_choose(1),lambda_vals(l),bitrate_vals(b),duobinary_vals(3),rop_atten_vals(1)); ber_db_enc(b)=min(cel{1}); dcs_ = wh.getStoValue('dcs',M_choose(1),lambda_vals(l),bitrate_vals(b),duobinary_vals(2),rop_atten_vals(1)); end cols = linspecer(4); subplot(3,3,l) if M_choose == 4 lst = '-'; mkr = 'o'; hv = 'on'; elseif M_choose == 6 lst = '-'; mkr = 'x'; hv = 'on'; elseif M_choose == 8 lst = '-'; mkr = 'diamond'; hv = 'on'; end fsym_vals = floor( bitrate_vals*1e-9./log2(M_choose) ); hold on plot(bitrate_vals*1e-9,ber_db,'Color',cols(1,:),'Marker',mkr,'MarkerFaceColor','auto','DisplayName','DB pre','LineStyle',lst,'HandleVisibility',hv); plot(bitrate_vals*1e-9,ber_db_enc,'Color',cols(2,:)','Marker',mkr,'MarkerFaceColor','auto','DisplayName','DB enc','LineStyle',lst,'HandleVisibility',hv); plot(bitrate_vals*1e-9,ber_vnle,'Color',cols(3,:),'Marker',mkr,'MarkerFaceColor','auto','DisplayName','VNLE','LineStyle',lst,'HandleVisibility',hv); plot(bitrate_vals*1e-9,ber_vnle_mlse,'Color',cols(4,:),'Marker',mkr,'MarkerFaceColor','auto','DisplayName','VNLE+PF+MLSE','LineStyle',lst,'HandleVisibility',hv); % Continue with the rest of your plot settings yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off'); yline(2e-2, 'DisplayName', '20%', 'LineStyle', '--','LineWidth',1, 'HandleVisibility', 'off'); xlabel('Bitrate'); ylabel('Bit Error Rate (BER)'); title([num2str(lambda_vals(l)),' nm']); set(gca, 'yscale', 'log'); set(gca, 'Box', 'on'); grid on; grid minor; legend('Interpreter', 'none','Location','southwest'); ylim([1e-4,1e-1]); xlim([bitrate_vals(1)*1e-9,bitrate_vals(end)*1e-9]) end end