% filename = "C:\Users\sioe\Documents\High_Speed_Measurement_2024\bias_testing\PAM4_b2b_bias_sweep_20241023_130342_wh.mat"; % % a = load(filename); % wh = a.obj; v_bias_vals = wh.parameter.vbias.values; awg_vpp_vals = wh.parameter.awg_vpp.values; precomp_amp_max_vals = wh.parameter.precomp_amp_max.values; rop_atten_vals = wh.parameter.rop_atten.values; PAM = wh.parameter.M.values(1); m = wh.getStoValue('m',v_bias_vals(1),awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),PAM); ber_ffe= []; ber_mlse= []; rop_measured= []; pd_in_measured= []; rop_measured = []; cnt = 0; for PAM = wh.parameter.M.values cnt = cnt+1; ber_ffe(cnt,:) = wh.getStoValue('ber_ffe',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),PAM)'; ber_mlse(cnt,:) = wh.getStoValue('ber_mlse',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),PAM); rop_measured(cnt,:) = wh.getStoValue('rop',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),PAM); pd_in_measured(cnt,:) = wh.getStoValue('pd_in',v_bias_vals,awg_vpp_vals(1),precomp_amp_max_vals(1),rop_atten_vals(1),PAM); end figure(2024) for i = 1:3 [bestber,bestindex] = min(ber_ffe(i,:),[],'all'); [awg_pos,v_bias_pos]=ind2sub(size(ber_ffe(i,:)),bestindex); bestawgvpp=awg_vpp_vals(awg_pos); bestvbias=v_bias_vals(v_bias_pos); disp(['Best Vpp: ',num2str(bestvbias),' V; Best Vpp AWG: ',num2str(bestawgvpp),' V' ]); hold on a = scatter(rop_measured(i,:),ber_ffe(i,:),'Marker','+','DisplayName',['PAM ',num2str(wh.parameter.M.values(i))]); a.DataTipTemplate.DataTipRows(1).Label = 'P_{out}'; a.DataTipTemplate.DataTipRows(2).Label = 'BER'; a.DataTipTemplate.DataTipRows(2).Format ='%.1e'; a.DataTipTemplate.DataTipRows(3).Label = 'Vbias'; a.DataTipTemplate.DataTipRows(3).Value = v_bias_vals; a.DataTipTemplate.DataTipRows(3).Format = 'auto'; end % Continue with the rest of your plot settings yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off'); xlabel('Measured MZM Output Power (dBm)'); ylabel('Bit Error Rate (BER)'); title('Bit Error Rate vs. ROP'); set(gca, 'yscale', 'log'); set(gca, 'Box', 'on'); grid on; grid minor; legend('Interpreter', 'none');