我想绘制16 QAM的SNR与BER的关系图。在生成QAM信号时需要帮助
我尝试生成它,但是我不确定它是否正确
for n in range (0, itr):
EbNodB = EbNodB_range[n]
EbNo=10.0**(EbNodB/10.0)#antilog of SNR
x=(np.random.randn(4,16,1)*2-5)+ 1j*(np.random.randn(4,16,1)*2-5)#QAM
signal
h=np.sqrt(np.random.normal(0,1)**2+np.random.normal(0,1)**2)/np.sqrt(2)
#Magnitude of Rayleigh channel coefficient
noise_var = 1/sqrt(2*EbNo) #AWGN variance
noise=noise_var* randn(N) #AWGN noise
y = h*x + noise
y_d = y-h
errors = (x != y_d).sum()
ber[n] = errors / N
该图显示为空