MPI Simulations and stuff
This commit is contained in:
46
projects/MPI_Juni/sir_curve.m
Normal file
46
projects/MPI_Juni/sir_curve.m
Normal file
@@ -0,0 +1,46 @@
|
||||
function sir_curve(wh,options)
|
||||
arguments
|
||||
wh
|
||||
options.DisplayName = '';
|
||||
end
|
||||
|
||||
M = wh.parameter.M.values(1);
|
||||
datarate = wh.parameter.datarate.values(1);
|
||||
sir = wh.parameter.sir.values;
|
||||
laser_linewidth = wh.parameter.laser_linewidth.values(1);
|
||||
pn_key = wh.parameter.pn_key.values;
|
||||
vbias_rel = wh.parameter.vbias_rel.values(1);
|
||||
rop = wh.parameter.rop.values(1);
|
||||
clipfactor = wh.parameter.clipfactor.values;
|
||||
rrcalpha = wh.parameter.rrcalpha.values(1);
|
||||
|
||||
cols = linspecer(numel(pn_key));
|
||||
|
||||
cnt = 0;
|
||||
for pnk = pn_key
|
||||
|
||||
cnt = cnt+1;
|
||||
bers = wh.getStoValue('ber',M,datarate,sir,laser_linewidth,pnk,vbias_rel,rop,clipfactor, rrcalpha);
|
||||
ers = unique(wh.getStoValue('er',M,datarate,sir,laser_linewidth,pnk,vbias_rel,rop,clipfactor, rrcalpha));
|
||||
|
||||
if 1 %isempty(options.DisplayName)
|
||||
dn = ['M: ',num2str(M),'; Rate: ',num2str(datarate),'; Vbias rel: ',num2str(vbias_rel), '; ER: ', num2str(ers)];
|
||||
else
|
||||
dn = options.DisplayName;
|
||||
end
|
||||
|
||||
% Create the initial plot
|
||||
figure(43);
|
||||
hold on; % Retain the plot so new points can be added without complete redraw
|
||||
plot(sir,bers',"LineWidth",1,"LineStyle","-","Marker",".","MarkerSize",10,"DisplayName",string(dn),'Color',cols(cnt,:));
|
||||
|
||||
end
|
||||
yline(3.8e-3,'DisplayName','HD-FEC');
|
||||
xlabel('Signal to Interference Ratio (dB)');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title('Bit Error Rate vs. SIR (MPI)');
|
||||
set(gca,'yscale','log');
|
||||
grid on;
|
||||
legend
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user