MPI Simulations and stuff
This commit is contained in:
53
projects/MPI_Juni/tx_signal_curve.m
Normal file
53
projects/MPI_Juni/tx_signal_curve.m
Normal file
@@ -0,0 +1,53 @@
|
||||
function tx_signal_curve(wh,options)
|
||||
arguments
|
||||
wh
|
||||
options.DisplayName = '';
|
||||
end
|
||||
|
||||
M = wh.parameter.M.values(1);
|
||||
datarate = wh.parameter.datarate.values(1);
|
||||
sirs = wh.parameter.sir.values(1);
|
||||
mpi_len = wh.parameter.mpi_pathlen.values(1);
|
||||
laser_linewidths = wh.parameter.laser_linewidth.values(1);
|
||||
pn_key = wh.parameter.pn_key.values;
|
||||
vbias_rel = wh.parameter.vbias_rel.values;
|
||||
rop = wh.parameter.rop.values(1);
|
||||
clipfactor = wh.parameter.clipfactor.values;
|
||||
rrcalpha = wh.parameter.rrcalpha.values(1);
|
||||
|
||||
% Create the initial plot
|
||||
figure(4);
|
||||
cols = linspecer(numel(vbias_rel));
|
||||
cnt = 0;
|
||||
|
||||
for vb = vbias_rel
|
||||
|
||||
cnt = cnt+1;
|
||||
bers(:) = wh.getStoValue('ber',M,datarate,sirs,mpi_len,laser_linewidths,pn_key,vb,rop,clipfactor, rrcalpha);
|
||||
ers(:) = wh.getStoValue('er',M,datarate,sirs,mpi_len,laser_linewidths,pn_key,vb,rop,clipfactor, rrcalpha);
|
||||
dn = ['M: ',num2str(M),'; Rate: ',num2str(datarate),'; SIR ',num2str(sirs), 'dB; lw: ',num2str(laser_linewidths.*1e-6),' MHz'];
|
||||
|
||||
hold on; % Retain the plot so new points can be added without complete redraw
|
||||
% scatter(clipfactor,bers,"LineWidth",1,"Marker",".","DisplayName",string(dn),"MarkerEdgeColor",cols(cnt,:),'HandleVisibility','off');
|
||||
plot(clipfactor,bers,"LineWidth",1,"Marker","x",'LineStyle','--',"DisplayName",['Vbias factor: ',num2str(vb)],"Color",cols(cnt,:));
|
||||
yline(3.8e-3,'DisplayName','HD-FEC','HandleVisibility','off');
|
||||
set(gca,'yscale','log');
|
||||
grid on;
|
||||
ylim([1e-5,5e-1])
|
||||
|
||||
xlabel('Clip Factor');
|
||||
ylabel('Bit Error Rate (BER)');
|
||||
title(['Bit Error Rate vs. Clip Factor: ',dn]);
|
||||
|
||||
legend
|
||||
end
|
||||
|
||||
|
||||
% figure(10101)
|
||||
% y = vbias_rel;
|
||||
% x = clipfactor;
|
||||
% [X,Y] = meshgrid(x,y);
|
||||
% Z = bers;
|
||||
% contourf(X,Y,Z,30,'LineStyle','none');
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user