{"id":1749,"date":"2012-05-21T07:50:49","date_gmt":"2012-05-21T07:50:49","guid":{"rendered":"http:\/\/www.raymaps.com\/?p=1749"},"modified":"2022-05-31T08:33:42","modified_gmt":"2022-05-31T08:33:42","slug":"m-qam-in-awgn","status":"publish","type":"post","link":"https:\/\/www.raymaps.com\/index.php\/m-qam-in-awgn\/","title":{"rendered":"M-QAM Bit Error Rate in AWGN"},"content":{"rendered":"<p style=\"text-align: justify;\">Quadrature Amplitude Modulation has been adopted by most wireless communication standards such as WiMAX and LTE. It provides higher bit rates and consequently higher spectral efficiencies. It is usually used in conjunction with Orthogonal Frequency Division Multiplexing (OFDM) which provides a simple technique to overcome the time varying frequency selective channel.<\/p>\n<p style=\"text-align: justify;\">We have previously discussed the formula for calculating the bit error rate (BER) of QAM in AWGN. We now calculate the same using a simple Monte Carlo Simulation.<\/p>\n<pre lang=\"matlab\">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% FUNCTION THAT CALCULATES THE BER OF M-QAM IN AWGN\n% n_bits: Input, number of bits\n% M: Input, constellation size\n% EbNodB: Input, energy per bit to noise power spectral density\n% ber: Output, bit error rate\n% Copyright RAYmaps (www.raymaps.com)\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\nfunction[ber]= QAM_AWGN(n_bits, M, EbNodB)\n\n% Transmitter\nk=log2(M);\nEbNo=10^(EbNodB\/10);\nx=transpose(round(rand(1,n_bits)));\nh1=modem.qammod(M);\nh1.inputtype='bit';\nh1.symbolorder='gray';\ny=modulate(h1,x);\n\n% Channel\nEb=mean((abs(y)).^2)\/k;\nsigma=sqrt(Eb\/(2*EbNo));\nw=sigma*(randn(1,n_bits\/k)+1i*randn(1,n_bits\/k));\nr=y+w';\n\n% Receiver\nh2=modem.qamdemod(M);\nh2.outputtype='bit';\nh2.symbolorder='gray';\nh2.decisiontype='hard decision';\nz=demodulate(h2,r);\nber=(n_bits-sum(x==z))\/n_bits\nreturn\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n<\/pre>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/www.raymaps.com\/wp-content\/uploads\/2012\/05\/64_QAM_Constellation_AWGN.bmp\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2206\" src=\"http:\/\/www.raymaps.com\/wp-content\/uploads\/2012\/05\/64_QAM_Constellation_AWGN.bmp\" alt=\"64-QAM Constellation in AWGN\"><\/a><\/p>\n<p style=\"text-align: justify;\">The above function basically has three inputs and one output. The inputs are the number of bits to be passed through the channel, the size of the constellation and the signal to noise ratio in dB. The output is the bit error rate (BER). The simulation can be divided into three section namely the transmitter, the channel and the receiver. In this simulation we have used Gray coding which gives us about a dB of improvement at low to medium signal to noise ratio.<\/p>\n<figure id=\"attachment_1750\" aria-describedby=\"caption-attachment-1750\" style=\"width: 546px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.raymaps.com\/index.php\/m-qam-in-awgn\/mqam_awgn\/\" rel=\"attachment wp-att-1750\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1750\" title=\"M-QAM Bit Error Rate in AWGN\" src=\"http:\/\/www.raymaps.com\/wp-content\/uploads\/2012\/05\/MQAM_AWGN.jpg\" alt=\"M-QAM Bit Error Rate in AWGN\" width=\"546\" height=\"427\" srcset=\"https:\/\/www.raymaps.com\/wp-content\/uploads\/2012\/05\/MQAM_AWGN.jpg 546w, https:\/\/www.raymaps.com\/wp-content\/uploads\/2012\/05\/MQAM_AWGN-300x234.jpg 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/a><figcaption id=\"caption-attachment-1750\" class=\"wp-caption-text\">M-QAM Bit Error Rate in AWGN<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">As seen above the BER obtained through our simulation matches quite well with the BER obtained through the theoretical formula. Each additional bit per symbol required about 2dB extra in signal to noise ratio to achieve the same bit error rate.<\/p>\n<p style=\"color: #333333;\">Lastly we explain some of the terms used above.<\/p>\n<p style=\"color: #333333;\"><strong>AWGN<\/strong><\/p>\n<p style=\"color: #333333; text-align: justify;\">All wireless receivers suffer from thermal noise which is a function of absolute temperature and bandwidth of the receiver. This noise is added to the received signal and makes detection of weak signals a major challenge. Just to given you an idea typical GSM receivers have a noise floor of -113 dBm. Therefore, if the received signal has a power of -100 dBm we get a signal to noise ratio (SNR) of 13 dB. In simulation this noise is usually modeled as a Gaussian Random Process. It is additive, as opposed to channel impairments which are multiplicative and has a flat spectrum (thus called White Noise).<\/p>\n<p style=\"color: #333333; text-align: justify;\"><strong>Gray Coding<\/strong><\/p>\n<p style=\"color: #333333; text-align: justify;\">When using QAM modulation, each QAM symbol represents 2,3,4 or higher number of bits. That means that when a symbol error occurs a number of bits are reversed. Now a good way to do the bit-to-symbol assignment is to do it in a way such that no neighboring symbols differ by more than one bit e.g. in 16-QAM, a symbol that represents a binary word 1101 is surrounded by four symbols representing 0101, 1100, 1001 and 1111. So if a symbol error is made, only one bit would be in error. However, one must note that this is true only in good signal conditions. When the SNR is low (noise has a higher magnitude) the symbol might be displaced to a location that is not adjacent and we might get higher number of bits in error.<\/p>\n<p style=\"color: #333333;\"><strong>Hard Decision<\/strong><\/p>\n<p style=\"color: #333333; text-align: justify;\">The concept of hard decision decoding is important when talking about channel coding, which we have not used in the above simulation. However, we will briefly explain it here. Hard decision is based on what is called \u201cHamming Distance\u201d whereas soft decision is based on what it called \u201cEuclidean Distance\u201d.&nbsp;Hamming Distance is the distance of a code word in binary form, such as 011 differs from 010 and 001 by 1. Whereas the Euclidean distance is the distance before a decision is made that a bit is zero or one. &nbsp;So if the received sequence is 0.1 0.6 0.7 we get a Euclidean distance of 0.8124 from 010 and 0.6782 from 001. So we cannot make a hard decision about which sequence was transmitted based on the received sequence of 011. But based on the soft metrics we can make a decision that 001 was the most likely sequence that was transmitted (assuming that 010 and 001 were the only possible transmitted sequences).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quadrature Amplitude Modulation has been adopted by most wireless communication standards such as WiMAX and LTE. It provides higher bit rates and consequently higher spectral efficiencies. It is usually used in conjunction with Orthogonal Frequency Division Multiplexing (OFDM) which provides a simple technique to overcome the time varying frequency selective channel. We have previously discussed the formula for calculating the bit error rate (BER) of QAM in AWGN. We now calculate the same using a simple Monte Carlo Simulation. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FUNCTION THAT CALCULATES THE BER OF M-QAM IN AWGN % n_bits: Input, number of bits % M: Input, constellation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,81,18,219,15],"tags":[77,34,27],"class_list":["post-1749","post","type-post","status-publish","format-standard","hentry","category-berp","category-fundamentals","category-lte","category-modulation","category-wimax","tag-awgn","tag-ber","tag-qam"],"_links":{"self":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/1749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/comments?post=1749"}],"version-history":[{"count":27,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/1749\/revisions"}],"predecessor-version":[{"id":4245,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/1749\/revisions\/4245"}],"wp:attachment":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/media?parent=1749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/categories?post=1749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/tags?post=1749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}