stuff from PC
This commit is contained in:
61
run_loop.m
Normal file
61
run_loop.m
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
dc_mu = [0 0.001 0.1];
|
||||
sirloop = -25:1:0;
|
||||
lw_loop = [0e6:1e6:10e6];
|
||||
|
||||
ber = zeros(length(dc_mu),length(sirloop),length(lw_loop));
|
||||
ber_a1 = zeros(length(dc_mu),length(sirloop),length(lw_loop));
|
||||
|
||||
iterations=size(ber);
|
||||
|
||||
parfor ix = 1:numel(ber)
|
||||
|
||||
[u1,u2,u3] = ind2sub(iterations,ix);
|
||||
|
||||
BER = imddmodel(dc_mu(u1),sirloop(u2),lw_loop(u3));
|
||||
|
||||
ber(ix) = BER.ber;
|
||||
ber_a1(ix) = BER.ber_a1;
|
||||
|
||||
end
|
||||
|
||||
|
||||
hdfec = 3.8e-3.*ones(size(sirloop));
|
||||
|
||||
for dc = 1:size(ber,1)
|
||||
for lw = 1:size(ber,3)
|
||||
a = InterX([sirloop;ber(dc,:,lw)],[sirloop;hdfec]);
|
||||
thres(dc,lw) = -a(1);
|
||||
end
|
||||
end
|
||||
|
||||
contour(thres,'LineWidth',2);
|
||||
ylabel("DC Tap");
|
||||
xlabel("Linewidth in MHz");
|
||||
|
||||
yticks(1:length(dc_mu))
|
||||
yticklabels(dc_mu);
|
||||
|
||||
xticks(1:length(lw_loop));
|
||||
xticklabels(lw_loop*1e-6);
|
||||
|
||||
grid on
|
||||
|
||||
%
|
||||
% col = cbrewer2('Paired',12);
|
||||
% scatter(-1.*thres(1),thres(2),'MarkerEdgeColor',col(2*i,:),'LineWidth',6,'DisplayName',['DC tap ',num2str(dc_mu(i))]);
|
||||
%
|
||||
% figure(1)
|
||||
% hold on
|
||||
% for i = 1:length(dc_mu)
|
||||
% plot(-1.*sirloop,ber(i,:),"LineWidth",2,"Marker","o","MarkerSize",3,'Color',col(2*i,:),'DisplayName',['DC tap ',num2str(dc_mu(i))]);
|
||||
% plot(-1.*sirloop,ber_a1(i,:),"LineWidth",2,"Marker","o","MarkerSize",3,'Color',col(2*i-1,:),'DisplayName',['A1. Linewidth in MHz ',num2str(dc_mu(i)*1e-6)]);
|
||||
% end
|
||||
%
|
||||
% yline(3.8e-3,'LineWidth',2,'LineStyle','--','HandleVisibility','off');
|
||||
% set(gca,'yscale','log');
|
||||
% grid minor
|
||||
% legend
|
||||
% xlabel("SIR");
|
||||
% ylabel("BER");
|
||||
% title("BER for different SIR")
|
||||
Reference in New Issue
Block a user