The Matlab/Octave script performs the following:
(a) Generation of random binary sequence
(b) Assigning group of 4 bits to each 16-QAM constellation symbol per the Gray mapping
(c) Addition of white Gaussian Noise
(d) Demodulation of 16-QAM symbols and
(e) De-mapping per decimal to Gray conversion
(f) Counting the number of bit errors
(g) Running this for each value of Eb/No in steps of 1dB.
For the discussion on the theoretical BER for 16QAM, please refer to the post
Krishna Sankar M (2021). 16QAM BER with Gray Mapping (https://www.mathworks.com/matlabcentral/fileexchange/20569-16qam-ber-with-gray-mapping), MATLAB Central File Exchange. Retrieved .
Dear @Krishna Pillai,
I really need your help on matlab code of Demapping 16QAM, in fact I implemented the code but the BER is very high. I would be grathful if you can help me. Thanks in advance
if nb_bit_per_symb == 4
if real(symb_RX_estimated(i)) ==-3
elseif real(symb_RX_estimated(i)) ==-1
elseif real(symb_RX_estimated(i)) ==1
if imag(symb_RX_estimated(i)) ==3
elseif imag(symb_RX_estimated(i)) ==1
elseif imag(symb_RX_estimated(i)) ==-1
% Code here the demapping function for 16QAM constellation with Gray
% coding (output: bit_RX)
@Paul: Thanks for the comment. Sure, I can add link to your code (with credits) in www.dsplog.com.
However, I would like to understand the equation prior. For a general M-QAM (M-even), the symbol error rate has an erfc() term and erfc^2() term.
And for ber, I just took the first term. Given the above understanding, I was unable to understand the equation which you have suggested. How have you converted the erfc^2() term to two erfc() terms? Kindly point me to a reference, if possible.
Thanks in advance.
Excellent tutorial. However, please be aware that the theoretical 16QAM BER as used in this program
is just an (albeit good) approximation, as you already indicated in your www.dsplog.com post.
The *exact* Gray-mapped 16QAM BER with AWGN is
as generated by entry nr. 19717 in the Mathworks File Exchange. The difference between the approximate theoretical BER and the exact BER gets significant for Eb/N0 below 0dB, being 27% at Eb/N0=-10dB and growing to 33% for Eb/N0=0 (or minus infinity in dB). The simulated 16QAM BER can be shown to deviate clearly from the approximate theoretical BER for Eb/N0<0dB, while it closely follows the exact theoretical BER for all values of Eb/N0.
Entry 19717 also produces exact BER values for Gray-mapped QPSK, 256QAM etc. and, further to over-all BER values, it also generates the different BER values for the different bit positions in 16QAM, 256QAM etc.
On the condition that the origin is clearly indicated, please feel free to use my entry nr. 19717 and its results on your site http://www.dsplog.com/.
Paul A.M. Buné
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!