# Polar Codes and a M-ary Modulation-Based OFDM-PLC System
## 4 High-Order QAM and APSK Modulation and Demodulation
### QAM Soft Demodulation  
Due to noise interference during channel transmission, the modulation constellation will deviate from its original coordinates, and an effective decision must be made to correctly demodulate the signal. Based on (18), at time \(t\) corresponding to a certain QAM modulation symbol \(S(t)=I(t)+jQ(t)\), the received signal \(r(t)\) is:  
\[r(t)=h(t)S(t)+\text{g}(\text{t}) \tag{19}\]  
where \(h(t)\) is the channel gain, and \(g(t)\) is the impulse noise with total noise power \(\sigma^{2}\). At time \(t\), the received signal \(r(t)\) contains the QAM modulation symbol \(S(t)\), and the error probability of a certain constellation symbol \(s\) is given by:  
\[P[r(t)|S(t)=s]=\frac{1}{\sqrt{2\pi\sigma^{2}}}\text{exp}\left(-\frac{\left|r( t)-h(t)\cdot s\right|^{2}}{2\sigma^{2}}\right) \tag{20}\]  
Figure 4: 16 QAM constellation mapping. By selecting \(g(t)=h(t)g_{0}(t)\), then \(r(t)=h(t)[S(t)+g_{0}(t)]=h(t)y(t)\), and (20) can be simplified as follows:  
\[P[r(t)|S(t)=s]=\frac{1}{\sqrt{2\pi\sigma^{2}}}\text{exp}\left(-\frac{h^{2}(t)|y (t)-s|^{2}}{2\sigma^{2}}\right) \tag{21}\]  
To obtain LLR for each bit of the received symbol \(r(t)\), the LLR of the \(i\)-th bit of a symbol in a QAM mapping can be defined as:  
\[LLR(b_{i})=\text{log}\left(\frac{P(r(t)|b_{i}=0)}{P(r(t)|b_{i}=1)}\right) \tag{22}\]  
By simplifying using [PERSON] formula, for \(M^{\prime}\) QAM modulation symbols, the arrangement of 0 bits in the \(i\)-th symbol is in the first half of the \(M^{\prime}\) modulation symbols and the arrangement of 1 bit is in the second half, expressed as:  
\[LLR(b_{i})=\text{log}\left(\frac{\sum_{j=1}^{M^{\prime}}s_{i}S_{i,j}^{(0)}P(r (t)\mid y(t)-s)}{\sum_{j=\frac{M^{\prime}}{2}+1}^{M^{\prime}}s_{i}S_{i,j}^{(1 )}P(r(t)\mid y(t)-s)}\right) \tag{23}\]  
The symbols \(S_{i,j}\) are linearly processed according to the \(I,Q\) branches, where \(S_{I,i}^{(0)}\), \(S_{I,i}^{(1)}\) are the modulation symbols for the \(i\)-th bit in the \(I\) branch when it is 0 and 1, respectively, and \(S_{Q,i}^{(0)}\), \(S_{Q,i}^{(1)}\) are the modulation symbols for the \(i\)-th bit in the \(Q\) branch when it is 0 and 1, respectively. Then, the LLR of the \(i\)-th bit \(b_{I,i}\) in the \(I\) branch of the received symbol \(r(t)\) is given by:  
\[LLR(b_{I,i})=\text{log}\left(\frac{\sum_{j=1}^{\frac{\sqrt{M}}{2}}\text{exp} \left(-\frac{h^{2}\big{|}y_{i}-S_{I,i}^{(0)}\big{|}^{2}}{2\sigma^{2}}\right)} {\sum_{j=1}^{\frac{\sqrt{M}}{2}}\text{exp}\left(-\frac{h^{2}\big{|}y_{i}-S_{I, i}^{(1)}\big{|}^{2}}{2\sigma^{2}}\right)}\right) \tag{24}\]  
By substituting (21) into (24), we obtain:  
\[LLR(b_{I,i})=\text{log}\left(\frac{\sum_{j=1}^{\frac{\sqrt{M}}{2}}\text{exp} \left(-\frac{h^{2}\big{|}y_{i}-S_{I,i}^{(0)}\big{|}^{2}}{2\sigma^{2}}\right) }{\sum_{j=1}^{\frac{\sqrt{M}}{2}}\text{exp}\left(-\frac{h^{2}\big{|}y_{i}-S_{ I,i}^{(1)}\big{|}^{2}}{2\sigma^{2}}\right)}\right) \tag{25}\]  
Similarly, the LLR of the \(i\)-th bit \(b_{Q,i}\) in the \(Q\) branch of the received symbol \(r(t)\) can be obtained as:  
\[LLR\big{(}b_{Q,i}\big{)}=\text{log}\left(\frac{\sum_{j=1}^{\frac{\sqrt{M}}{2} }\text{exp}\left(-\frac{h^{2}\big{|}y_{i}-S_{Q,i}^{(0)}\big{|}^{2}}{2\sigma^{2 }}\right)}{\sum_{j=1}^{\frac{\sqrt{M}}{2}}\text{exp}\left(-\frac{h^{2}\big{|} y_{i}-S_{Q,i}^{(1)}\big{|}^{2}}{2\sigma^{2}}\right)}\right) \tag{26}\]  
Finally, the correct bit decision values for the \(i\)-th bit in the \(I\), \(Q\) branches of \(r(t)\) can be obtained by applying (27) to (25) and (26), respectively:  
\[\left\{ \begin{array}{l}b_{I,i}=0,\;if\;LLR(b_{I,i})\geq 0\\ b_{I,i}=1,\;if\;LLR(b_{I,i})<0\\ b_{Q,i}=0,\;if\;LLR\big{(}b_{Q,i}\big{)}\geq 0\\ b_{Q,i}=1,\;if\;LLR\big{(}b_{Q,i}\big{)}<0\end{array} \right.