DSPRelated.com
Forums

Advantages of Gray Coding for QAM

Started by Deamon January 6, 2011
>dvsarwate <dvsarwate@yahoo.com> wrote: >(snip) > >> But, since this *is* comp.dsp and both computers and >> dspissers use bits, suppose that we have the linear >> modulator described above, but have available as input >> two data bits (b0, b1). So we need to have a D/A >> converter to map the four possible bit values 00, 01, >> 10, 11 to 0, 1, 2, 3 which would then be the input to >> our 4-ASK linear modulator. > >In many cases the bits come out of a scrambler, and so have >no relation to the actual data bits. That would seem to me >to remove any possible value in discussing gray code.
Right, and a lot of QAM is differentially encoded, which can also makes things grayer... or is it less gray... well, less black and white. People love to point out that differential symbol encoding turns every symbol error into a pair of sequential symbol errors, but generally ignore the effects of the scrambler. Steve

steveu wrote:

>>dvsarwate <dvsarwate@yahoo.com> wrote: >>(snip) >> >> >>>But, since this *is* comp.dsp and both computers and >>>dspissers use bits, suppose that we have the linear >>>modulator described above, but have available as input >>>two data bits (b0, b1). So we need to have a D/A >>>converter to map the four possible bit values 00, 01, >>>10, 11 to 0, 1, 2, 3 which would then be the input to >>>our 4-ASK linear modulator. >> >>In many cases the bits come out of a scrambler, and so have >>no relation to the actual data bits. That would seem to me >>to remove any possible value in discussing gray code. > > > Right, and a lot of QAM is differentially encoded, which can also makes > things grayer... or is it less gray... well, less black and white. > > People love to point out that differential symbol encoding turns every > symbol error into a pair of sequential symbol errors, but generally ignore > the effects of the scrambler.
In practical modems, it doesn't matter if there is one residual error or if there is 100 errors; the ARQ mechanism has to work it anyway. So the scrambler, the mapping and the encoding don't make any difference as they are hidden behind TCM which corrects symbol errors rather then bit errors. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Jan 6, 12:44&#4294967295;pm, Deamon <persistence...@gmail.com> asked:

>does it mean &#4294967295;If I draw &#4294967295;graph of a 16QAM &#4294967295;gray coded and > uncoded &#4294967295;Probability of error of a 16 QAM against the SNR in dB then > the curves will be sperate then with gray coding having a very low > probaility of error &#4294967295;. Will this seperation be very significant for a > 16 QAM system
At high SNR, the BER of an optimally designed 16-QAM constellation is approximately 0.75Q(x) while the worst designed 16-QAM constellation has BER of approximately 1.25Q(x), where Q is the complementary standard Gaussian distribution function and x is an increasing function of the SNR. Because of the steep slope of the curve, the difference in SNR required to achieve a given BER is small. So, in a plot of BER on the y axis and SNR on the x axis on a logarithmic scale, the horizontal separation between the curves is small while the vertical separation approaches a constant value. A very small increase in SNR will give the same BER with a badly designed constellation as can be achieved with a well-designed constellation. The cost differential between implementing the best and the worst constellations is zero. So the question to consider is: do you want to implement the worst constellation rather than the best because a small increase in SNR will easily overcome the bad design? The cost of the additional SNR is nontrivial... Dilip Sarwate
On Fri, 7 Jan 2011 04:17:03 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>dvsarwate <dvsarwate@yahoo.com> wrote: >(snip) > >> But, since this *is* comp.dsp and both computers and >> dspissers use bits, suppose that we have the linear >> modulator described above, but have available as input >> two data bits (b0, b1). So we need to have a D/A >> converter to map the four possible bit values 00, 01, >> 10, 11 to 0, 1, 2, 3 which would then be the input to >> our 4-ASK linear modulator.
First I'd like to say that Dilip is helping me to not feel bad about disliking the whole idea of "linear" or "non-linear" modulators or modulation. In my experience those terms add more confusion than clarification, and are often misused, anyway.
>In many cases the bits come out of a scrambler, and so have >no relation to the actual data bits. That would seem to me >to remove any possible value in discussing gray code. > >-- glen
There's still a lot of value in discussing gray codes, because the bit-symbol mapping of a modulation scheme usually has a significant effect on its performance. That being said, it also usually has to be taken in the context of whatever FEC is used with it as well. When considering uncoded, TCM, BICM, or BICM-TC (TC = Turbo Code, or generally an iterative FEC decoder), the optimum mappings change significantly between those. Using a map intended for one in any of the others will result in degraded performance. So it does matter and I think discussion is useful, but the context is important. Eric Jacobsen Minister of Algorithms Abineau Communications http://www.abineau.com

dvsarwate wrote:


> At high SNR, the BER of an optimally designed 16-QAM constellation > is approximately 0.75Q(x) while the worst designed 16-QAM > constellation has BER of approximately 1.25Q(x)
IIRC the optimal 16-constellation is not a uniform square grid, and it is better then the trivial QAM-16 square by ~ 0.5 dB or so. VLV
On Jan 7, 11:09&#4294967295;am, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> dvsarwate wrote: > > At high SNR, the BER of an optimally designed 16-QAM constellation > > is approximately 0.75Q(x) while the worst designed 16-QAM > > constellation has BER of approximately 1.25Q(x) > > IIRC the optimal 16-constellation is not a uniform square grid, and it > is better then the trivial QAM-16 square by ~ 0.5 dB or so. > > VLV
My comments compare the 16-QAM square constellation with the best assignment of 4-bit nybbles to the 16 points versus the worst assignment, and don't discuss non-uniform grid constellations at all. With square constellations that differ only in how the nybbles are assigned to the constellation points, the implementations are identical except that the entries in the LUT are different in the two cases. The worst assignment requires a tad more SNR than the best to achieve the same BER. Is it worth leaving that on the table when it is trivial to change the LUT to get the best assignment and a reduced SNR at essentially zero cost? --Dilip Sarwate

dvsarwate wrote:

> On Jan 7, 11:09 am, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > >>dvsarwate wrote: >> >>>At high SNR, the BER of an optimally designed 16-QAM constellation >>>is approximately 0.75Q(x) while the worst designed 16-QAM >>>constellation has BER of approximately 1.25Q(x) >> >>IIRC the optimal 16-constellation is not a uniform square grid, and it >>is better then the trivial QAM-16 square by ~ 0.5 dB or so. >> >>VLV > > > My comments compare the 16-QAM square constellation with > the best assignment of 4-bit nybbles to the 16 points versus > the worst assignment, and don't discuss non-uniform grid > constellations at all. With square constellations that differ only > in how the nybbles are assigned to the constellation points, > the implementations are identical except that the entries in > the LUT are different in the two cases. The worst assignment > requires a tad more SNR than the best to achieve the same BER. > Is it worth leaving that on the table when it is trivial to change > the LUT to get the best assignment and a reduced SNR at > essentially zero cost?
Are you implying that the information is lost somehow through 1:1 mapping procedure? IMO the difference in BER only tells about the deficiency of the decoder. VLV
On Jan 7, 12:41&#4294967295;pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote:

> Are you implying that the information is lost somehow through 1:1 > mapping procedure? IMO the difference in BER only tells about the > deficiency of the decoder.
No *information* is lost in the mapping procedure. The differences in the BER between the best possible assignment of nybbles to 16-QAM and the worst possible assignment that I stated were based on the assumption that in both cases, the optimum decoder *for that signal set, i.e., that assignment of nybbles to constellation points* was used. I do not agree with your opinion that the BER difference is due to a deficiency in the decoder; the two decoders being compared are different, and each is optimum for its signal set. The poorer signal set *cannot* achieve a smaller BER by using a different decoder because the one on which I based my comparison is the optimum decoder for that signal set. No other decoder for that signal set can achieve a smaller BER. Since we are discussing signal constellations, I will take the liberty of parodying Shakespeare and write that the fault, dear Vladimir, is not in our stars, but in the way we are assigning bits to signal points..... --Dilip Sarwate
On 01/06/2011 09:21 PM, dvsarwate wrote:
> On Jan 6, 6:13 pm, Randy Yates<ya...@ieee.org> asked: > > >> What other kind of modulator could there possibly be, other than >> a "linear modulator," for QAM? QAM is a linear modulation, is it >> not? > > QAM is just the sum of two orthogonal ASK signals, and so > for simplicity, let's talk only of Amplitude Shift Keying (ASK), > and 4-ASK in particular. ... In the analog way of thinking > about these matters, ASK (more generally AM) is a linear > modulation meaning that the output scales as a linear function > of the input. For example, x(t) is mapped to x(t)cos(wt) by > the modulator, and 2x(t) is mapped to [2x(t)]cos(wt). So, > skipping the cos(wt) etc, we have in particular, a 4-ASK > linear modulator with analog input A that can take on one > of 4 values 0, 1, 2, 3 and MATLABi folks can express the > output as -3 + 2A to get that the corresponding outputs > are -3, -1, +1, +3. To put Descartes before the horse, > remember that -3+2A is a linear function of A. > > But, since this *is* comp.dsp and both computers and > dspissers use bits, suppose that we have the linear > modulator described above, but have available as input > two data bits (b0, b1). So we need to have a D/A > converter to map the four possible bit values 00, 01, > 10, 11 to 0, 1, 2, 3 which would then be the input to > our 4-ASK linear modulator. Easy peasy! The > two bits are a binary number, and we are done! But > this is the wrong thing to do. What we really ought to > be doing is map > > b0b1 A -3+2A > 0 0 --> 0 --> -3 > 0 1 --> 1 --> -1 > 1 1 --> 2 --> +1 > 1 0 --> 3 --> +3 > > OK, so this is Gray coding according to every one. > But, is it? I claim that what we are essentially doing, > without actually doing it, is the *inverse* of Gray > coding. Corresponding to 00, 01, 11, and 10, the > D/A converter must produce numbers 0, 1, 2, 3. > That is, the D/A converter that produces A from > b0b1 necessarily assumes that the bit pair is > ALREADY Gray-coded, and produces the correct > number A corresponding to the presumed Gray-coded > bit pair. NOBODY said that b0b1 are already > Gray-coded; they are just two bits we got from the > data source. We DON'T convert b0b1 from a > presumed standard binary encoding to a Gray > encoding. We TREAT the given data bits > b0b1 as a Gray-coded pair and use the value > that would be assigned to this bit pair by Gray > coding as the number A. In effect, we are > inverting a presumed Gray code to get A, and > all this because the powers that be insist that > ASK (and QAM) is a *linear* modulation. In > fact, ASK (and QAM) are properly designed > linear modulations only if the D/A converters > *assume* that their data inputs are already > Gray-coded, and produce the corresponding > integers as inputs to the modulators. No > explicit Gray coding is required in ASK or > QAM; only *inverting* a (presumed) Gray > coding to get the linearity so highly prized > by textbook authors and manual writers. > What we ought to be doing is not futz around > with words and concepts like Gray code and > linear modulation, but simply use a > LUT to map data inputs 00, 01, 11, 10 to > -3, -1, +1, +3 in a DSP processor (avoiding > MATLAB like the plague it is) and go from > there to the QAM constellation > > -3 -1 +1 +3 > > +3 0010 0110 1110 1010 > > +1 0011 0111 1111 1011 > > -1 0001 0101 1101 1001 > > -3 0000 0100 1100 1000 > > Hope this helps
Not really. I asked what kind of modulator there could be, other than a linear modulator, for QAM. Now maybe I missed it (I seem to be missing a lot lately...), but I don't see an answer to that question here. It also appears that Gray encoding is conflated with linear modulation. I don't see any relationship whatsoever between the two. This, too, I may have missed. Finally, I thought of Gray coding as simply a mapping of bits to symbols. You seem to be putting this intermediate A thingie in the mix (w = -3 + 2A, A = 0, 1, 2, 3). Now I know A and w are isomorphic in this context, so it doesn't really matter which one you use to represent the symbol, but why talk about both? So maybe I'm blind, but I don't see any of your points, Dilip. Do you know where I can find some of Jesus' spit? -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
On Jan 8, 5:05&#4294967295;pm, Randy Yates <ya...@ieee.org> wrote:

> I asked what kind of modulator there could be, other than a linear modulator, > for QAM. Now maybe I missed it (I seem to be missing a lot lately...), but I > don't see an answer to that question here.
All right, regardless of whatever else anyone may have told you, QAM **is not** a linear modulation scheme. (See Eric Jacobsen's comments re this matter too). There are 4 inputs to a 16-QAM transmitter with each input being restricted to have value 0 or 1, and the output is *not* a linear function of these 4 inputs, whether you take them singly or in pairs or collectively. If you nevertheless insist that 16-QAM is a linear modulation scheme, then please tell us what the output signal is for inputs (1,1,0,0) (0,0,1,1) (1,1,1,1) Now, prove that the third output of the three that I have asked you to provide is the sum of the first two outputs that you have provided us. After all, a linear scheme -- call it L for convenience -- should have the property L(x+y) = L(x) + L(y), no?
>Do you know where I can find some of Jesus' spit?
Huh? --Dilip Sarwate