title: How can generate and receive 16 QAM signal in python?
body: <p>I want to plot a BER of 16-QAM, but after I ran the follows coding, showed an empty plot. The error bits and error probability doesn't decrease. <a href="https://i.stack.imgur.com/bJp6f.png" rel="nofollow noreferrer">The running result</a></p>
  <pre><code>for m in range (0, itr): 
      EbNodB = EbNodB_range[m]   
      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_filtered=y/h
      y_d = y_filtered-h
      errors = (x != y_d).sum()
      ber1[m] = errors / N
      print (&quot;EbNodB:&quot;, EbNodB)
      print (&quot;Error bits:&quot;, errors)
      print (&quot;Error probability:&quot;, ber1[m])
  </code></pre>