我有100 SNR(信噪比),
SNR=[32.48873121,21.11297791,15.04042054,15.03765931,14.9860986,14.70063992,14.0914781,12.63557416,11.90471529,10.66141951,10.61423996,8.872149307,7.489301489,7.409686903,5.356321373,4.42000844,4.137654873,3.884999624,3.784549782,3.348447225,3.285491969,3.197460245,2.848888812,2.160133333,1.915260409,1.563950453,1.329209884,1.191461459,0.790756594,0.611525663,0.575573311,0.140882111,-0.036497656,-0.111073002,-0.258210049,-0.848790033,-1.25026649,-1.446774222,-2.080726269,-2.359212956,-2.516335413,-2.595010771,-3.063688167,-3.257431493,-3.283558882,-3.351236489,
-3.466831795,-3.665976748,-3.821897741,-4.51332461,-4.564700129,-4.718940301,-4.79394587,-4.85247625,-5.000716016,-5.129179148,-5.393944029,-5.499661228,-5.550047619,-5.671860615]
对于这个特定的SNR,我通过使用以下代码找到了BLER(块错误率):
SNR_L = [-8 -6 -4 -2];
L = [0.1231 0.0366 0.0082 0.0014];
logL=log10(L);
p=polyfit(SNR_L,logL,1);
semilogy(SNR_L,L,'k-s');
grid on;
for i=1:100
BLER(i)=p(1,2)+p(1,1)*SNR(i);
end
这里我使用的是从这段代码中找到的图表 - semilogy(SNR_L,L,'k-s')
。因为我正在使用polyfit和degree = 1然后我找到2个系数,比如y=a0+a1x
。所以要找到BLER我是使用此代码BLER(i)=p(1,2)+p(1,1)*SNR(i)
。当我发现100 SNR时,这就是为什么我最终使用for循环为相应的SNR找到100 BLER。
但是对于正SNR我无法得到正确的BLER。从我的观点来看,如果SNR很高,那么我将获得非常低的BLER但我得到高BLER。
答案 0 :(得分:0)
问题可能在于您正在混合plot
和semilogy
。如果执行以下操作,曲线将匹配:
plot(SNR_L,logL,'k-s');
hold on
plot(SNR,BLER);
注意,y轴是BLER的log10,而不是BLER。您可以使用
为BLER值标记轴set(gca,'yticklabel', 10.^get(gca,'ytick'))
见结果图。