- DSP log - http://www.dsplog.com -

Softbit for 16QAM

Posted By Krishna Sankar On July 5, 2009 @ 10:05 pm In Modulation | 34 Comments

In the post on Soft Input Viterbi decoder [1], we had discussed BPSK modulation with convolutional coding and soft input Viterbi decoding in AWGN channel. Let us know discuss the derivation of soft bits for 16QAM modulation scheme with Gray coded bit mapping. The channel is assumed to be AWGN alone.

## Gray Mapped 16-QAM constellation

In the past, we had discussed BER for 16QAM in AWGN [2] modulation. The 4 bits in each constellation point can be considered as two bits each on independent 4-PAM modulation on I-axis and Q-axis respectively.

 b0b1 I b2b3 Q 00 -3 00 -3 01 -1 01 -1 11 +1 11 +1 10 +3 10 +3

Table: Gray coded constellation mapping for 16-QAM

Figure: 16QAM constellation plot with Gray coded mapping

## Channel Model

$y=c + n$, where

$c$ is the modulated coded sequence taking values in the alphabet

$\alpha_{16QAM}=\left{\pm 1+\pm 1j,\ \pm 1+\pm 3j,\\\pm 3 + \pm 3j,\ \pm 3+\pm 1j \right}$.

$n$is the Additive White Gaussian Noise following the probability distribution function,

$p(n) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{\frac{-(n-\mu)^2}{2\sigma^2}$ with mean $\mu=0$ and variance $\sigma^2 = \frac{N_0}{2}$.

## Demodulation

For demodulation, we would want to maximize the probability that the bit $b_m$ was transmitted given we received $y$ i.e $P(b_m|y)$. This criterion is called Maximum a posteriori probability (MAP).

Using Bayes rule [3],

$P(b_m|y) = \frac{P(y|b_m)p(b_m)}{p(y)}$.

Note: The probability that all constellation points occur are equally likely, so maximizing $P(b_m|y)$ is equivalent to maximizing $P(y|b_m)$.

## Soft bit for b0

The bit mapping for the bit b0 with 16QAM Gray coded mapping is shown below. We can see that when b0 toggles from 0 to 1, only the real part of the constellation is affected.

Figure: Bit b0 for 16QAM Gray coded mapping

When the b0 is 0, the real part of the QAM constellation takes values -3 or -1. The conditional probability of the received signal $y$ given b0 is 0 is,

$P(y|b_0=0) = \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}+3)^2}{2\sigma^2}} + \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}$.

When the bit0 is 1, the real part of the QAM constellation takes values +1 or +3. The conditional probability given b0 is zero is,

$P(y|b_0=1) = \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}-1)^2}{2\sigma^2}} + \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}$.

We can define a likelihood ratio that if

$b0=1,\mbox{ if } \frac{P(y|b_0=1)}{P(y|b_0=0)}\ge1$.

The likelihood ratio for b0 is,

$\frac{P(y|b_0=1)}{P(y|b_0=0)}=\frac{e^{\frac{-(y_{re}-1)^2}{2\sigma^2}} + e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}+e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}}$.

### Region #1 ($y_{re} < -2$)

When $y_{re} < -2$, then we can assume that relative contribution by constellation +3 in the numerator and -1 in the denominator is less and can be ignored. So the likelihood ratio reduces to,

$\frac{P(y|b_0=1)}{P(y|b_0=0)}\approx\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}}$.

Taking logarithm on both sides,

$\begin{array}{lll}\ln\left(\frac{P(y|b_0=1)}{P(y|b_0=0)}\right)&\approx&\ln\left(\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}}\right)\\&=&\frac{1}{2\sigma^2}(y_{re}+3)^2-(y_{re}-1)^2\\&=&\frac{1}{\sigma^2}4(y_{re}+1)\end{array}$.

### Region #2 ($-2\le y_{re} <0$), Region #3 ($0\le y_{re} <2$)

When $-2\le y_{re} <0$ or $0\le y_{re} <2$, then we can assume that relative contribution by constellation +3 in the numerator and -3 in the denominator is less and can be ignored. So the likelihood ratio reduces to,

$\frac{P(y|b_0=1)}{P(y|b_0=0)}\approx\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}$.

Taking logarithm on both sides,

$\begin{array}{lll}\ln\left(\frac{P(y|b_0=1)}{P(y|b_0=0)}\right)&\approx&\ln\left(\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}\right)\\&=&\frac{1}{2\sigma^2}(y_{re}+1)^2-(y_{re}-1)^2\\&=&\frac{1}{\sigma^2}2y_{re}\end{array}$.

### Region #4 ($y_{re}\ge 2$)

If $y_{re}\ge 2$, then we can assume that relative contribution by constellation +1 in the numerator and -3 in the denominator is less and can be ignored. So the likelihood ratio reduces to,

$\frac{P(y|b_0=1)}{P(y|b_0=0)}\approx\frac{ e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}$.

Taking logarithm on both sides,

$\begin{array}{lll}\ln\left(\frac{P(y|b_0=1)}{P(y|b_0=0)}\right)&\approx&\ln\left(\frac{ e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}\right)\\&=&\frac{1}{2\sigma^2}(y_{re}+1)^2-(y_{re}-3)^2\\&=&\frac{1}{\sigma^2}4(y_{re}-1)\end{array}$.

## Soft bit for b1

The bit mapping for the bit b1 with 16QAM Gray coded mapping is shown below. We can see that when b0 toggles from 0 to 1, only the real part of the constellation is affected.

Figure: Bit b1 for 16QAM Gray coded mapping

When the b1 is zero, the real part of the QAM constellation takes values -3 or +3. The conditional probability given b1 is zero is,

$P(y|b_1=0) = \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}+3)^2}{2\sigma^2}} + \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}$.

When the bit0 is 1, the real part of the QAM constellation takes values -1 or +1. The conditional probability given b1 is one is,

$P(y|b_1=1) = \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}+1)^2}{2\sigma^2}} + \frac{1}{\sqrt{2\pi \sigma^2}}e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}$.

We can define a likelihood ratio that if

$b1=1,\mbox{ if } \frac{P(y|b_1=1)}{P(y|b_1=0)}\ge 1$.

The likelihood ratio for b1 is,

$\frac{P(y|b_1=1)}{P(y|b_1=0)}=\frac{e^{\frac{-(y_{re}+1)^2}{2\sigma^2}} + e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}+e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}$.

### Region #1 ($y_{re} < -2$), Region#2 ($-2\le y_{re} <0$)

When $y_{re} < -2$ or $-2\le y_{re} <0$, then we can assume that relative contribution by constellation +1 in the numerator and +3 in the denominator is less and can be ignored. So the likelihood ratio reduces to,

$\frac{P(y|b_1=1)}{P(y|b_1=0)}\approx\frac{ e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}}$.

Taking logarithm on both sides,

$\begin{array}{lll}\ln\left(\frac{P(y|b_1=1)}{P(y|b_1=0)}\right)&\approx&\ln\left(\frac{ e^{\frac{-(y_{re}+1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}+3)^2}{2\sigma^2}}}\right)\\&=&\frac{1}{2\sigma^2}(y_{re}+3)^2-(y_{re}+1)^2\\&=&\frac{2}{\sigma^2}(y_{re}+2)\end{array}$.

### Region #3 ($0\le y_{re} <2$), Region #4 ($y_{re}\ge 2$)

If $0\le y_{re} <2$or $y_{re}\ge 2$, then we can assume that relative contribution by constellation -1 in the numerator and -3 in the denominator is less and can be ignored. So the likelihood ratio reduces to,

$\frac{P(y|b_1=1)}{P(y|b_1=0)}\approx\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}$.

Taking logarithm on both sides,

$\begin{array}{lll}\ln\left(\frac{P(y|b_1=1)}{P(y|b_1=0)}\right)&\approx&\ln\left(\frac{ e^{\frac{-(y_{re}-1)^2}{2\sigma^2}}}{e^{\frac{-(y_{re}-3)^2}{2\sigma^2}}}\right)\\&=&\frac{1}{2\sigma^2}(y_{re}-3)^2-(y_{re}-1)^2\\&=&\frac{2}{\sigma^2}(-y_{re}+2)\end{array}$.

## Summary

Note: As the factorÂ  $\frac{2}{\sigma^2}$ is common to all the terms, it can be removed.

The softbit for bit b0 is,

$\begin{array}{lllr}sb(b0) & = & 2(y_{re}+1), & y_{re} < -2 \\
& = & y_{re}, & -2 \le y_{re} < 2\\ & = & 2(y_{re}-1), & y_{re} > 2\end{array}$
.

The softbit for bit b1 is,

$\begin{array}{lllr}sb(b1) & = & y_{re}+2, & y_{re} \le 0 \\
& = & -y_{re} + 2, & y_{re} > 0\end{array}$
.

The softbit for bit b1 can be simplified to,

$\begin{array}{lllr}sb(b1) & = & -|y_{re}|+2, & \mbox{for all } y_{re}\end{array}$.

It is easy to observe that the softbits for bits b2, b3 are identical to softbits for b0, b1 respectively except that the decisions are based on the imaginary component of the received vector $y_{im}$.

The softbit for bit b2 is,

$\begin{array}{lllr}sb(b2) & = & 2(y_{im}+1), & y_{im} < -2 \\
& = & y_{im}, & -2 \le y_{im} < 2\\ & = & 2(y_{im}-1), & y_{im} > 2\end{array}$
.

The softbit for bit b3 is,

$\begin{array}{lllr}sb(b3) & = & -|y_{im}|+2, & \mbox{for all }y_{im}\end{array}$.

$2(y_{re}+1) \approx = y_{re}$ and

$2(y_{im}+1) \approx = y_{im}$,

This simplification avoids the need for having a threshold check in the receiver for sofbits b0 and b2 respectively.

## Reference

URL to article: http://www.dsplog.com/2009/07/05/softbit-16qam/

URLs in this post:

[1] Soft Input Viterbi decoder: http://www.dsplog.com/2009/01/14/soft-viterbi/

[2] BER for 16QAM in AWGN: http://www.dsplog.com/2008/06/05/16qam-bit-error-gray-mapping/

[3] Bayes rule: http://en.wikipedia.org/wiki/Bayes%27_theorem#Statement

[4] Simplified Soft-Output Demapper for Binary Interleaved COFDM with Application to HIPERLAN/2, Filippo Tosato1, Paola Bisaglia, HPL-2001-246 October 10th , 2001,: http://www.hpl.hp.com/techreports/2001/HPL-2001-246.pdf