There is no mention that the communications toolbox is required. The files will not run as-is, for MATLAB doesn't recognize filenames which begin with a number. Rename the files! Also, why use scripts? Finally, please pre-allocate your variables instead of growing them in a FOR loop. This makes your code unbearably slow.
@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é