2

I want to plot the SNR vs BER plot for 16 QAM. I need help in generating QAM signal

I tried generating it but I'm not sure if it is right

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

The plot appears empty

idkman
  • 169
  • 1
  • 15
Abi rami
  • 21
  • 3
  • There is no decoder! How do you plan to calculate BER? You need to do some variant of minimum distance decoding (maximum likelihood detection) if you need to get meaningful BER. – learner Jan 02 '20 at 13:01

1 Answers1

0

You are missing a receive filter as you are introducing the channel as a distortion to your system without giving any compensation for that. A very simple way of compensating the channel is by assuming, that you know the channel at the receiver and simply divide the received symbol by the channel

y = h*x + noise 
y_filtered=y/h
y_d = y_filtered-h 

Note that there are other ways of compensating the channel (especially when you have more than one channel component per transmitting symbol).