## 4 Implementation of the LHM-N Model
### The TCM Encoder Implementation  
The TCM encoder is represented by \((n,k,m)\) convolutional code parameters; where \(n\) is the output, \(k\) is the input, and \(m\) is the memory register. The coding rate \(R\) is configured as \(k/n\). For example, \(R=2/3\) means 2 input message streams and 3 coded output bit streams. This model considers (3,2,3) convolutional code, wherein \(z1,z2\), and \(z3\) represent the three memory registers, and \(R=2/3\). The constraint length \(L\) is determined by \(m+k\). Figure 5 depicts a coding rate of a 2/3 TCM encoder, in which the coded bit stream is mapped by the QAM mapper to the QAM modulator. Hence, the convolutional code equation is given by,  
\[y(i)=u(i)G \tag{15}\]The output \(y(i)\) is dependent on the input \(u(i)\) and on the previous input \(u(i-1),u(i-2),u(i-3),\cdots\cdots\), where \(i\) denotes the passing time, and \(G\) is the generator matrix. Now, considering \(k=2,n=3\), and \(m=3\) as in our case of \(R=2/3\) for the 16 QAM signal, here, the input bits u(i) are transformed into the output vectors \(y(i)=(y1(i),y2(i),y3(i))\) by the following encoding equation:  
\[y(i)=\begin{cases}(y1(i)=u(i)+u(i-3),\\ y2(i)=u(i)+u(i-1)+u(i-2),\\ y3(i)=u(i)+u(i-1)+u(i-2)+u(i-3))\end{cases} \tag{16}\]  
From the above encoder, it can be seen that i needs to remember the three previous input bits \(u(i-1),u(i-2)\) and \(u(i-3)\). The contents of the three memory bits juxtapose the encoding function. Thus, at any time i, the encoder is in a previous state or new state designated by the state vector \(s(i)\).  
\[s(i)=(s1(i),s2(i),s3(i)=u(i-1),u(i-2),u(i-3)) \tag{17}\]  
The convolution code can be encoded with a polynomial generator \(G\). The matrix representation of a polynomial generator \(G\) is given by  
\[G=\left[\begin{array}{cccc}g_{0}^{(1)}&g_{0}^{(2)}&\cdots&g_{0}^{(n)}\\ g_{1}^{(1)}&g_{1}^{(2)}&\cdots&g_{1}^{(n)}\\ g_{2}^{(1)}&g_{2}^{(1)}&\cdots&g_{2}^{(n)}\\ \vdots&\vdots&\ddots&\vdots\\ g_{m}^{(1)}&g_{m}^{(2)}&\cdots&g_{m}^{(n)}\end{array}\right] \tag{18}\]  
where \(gi=(g_{0}^{(1)}g_{0}^{(2)}\cdots g_{0}^{(n)})\), \(0\leq i\leq m\). The generator \(g(i)\) is the polynomial connection and can be represented in binary or octal format. It can also be represented in the transform domain, \(D\) (delay operator) form, which is given by the following convolutional code equation as  
\[y(D)=u(D)G(D) \tag{19}\]  
thus, the polynomial generator matrix in a D-transform domain is given as,  
\[G(D)=\left[\begin{array}{cccc}g_{0}^{(1)}(D)&g_{0}^{(2)}(D)&\cdots&g_{0}^{( n)}(D)\\ g_{1}^{(1)}(D)&g_{1}^{(2)}(D)&\cdots&g_{1}^{(n)}(D)\\ g_{2}^{(1)}(D)&g_{2}^{(1)}(D)&\cdots&g_{2}^{(n)}(D)\\ \vdots&\vdots&\ddots&\vdots\\ g_{m}^{(1)}(D)&g_{m}^{(2)}(D)&\cdots&g_{m}^{(n)}(D)\end{array}\right] \tag{20}\]  
A particular TCM code (n, k, m) parameter can be encoded by many polynomial generators \(g_{i}\). Not all polynomial generators are good. Hence, \(g(i)\) depends on the number  
Figure 5: TCM Encoder with QAM Mapper.  
of trellis states and \(d_{free}^{2}\) to give a good asymptotic coding gain for GT. The number of trellis states is depicted by \(2^{m}\). For example, in our case of the \(16-QAM\) (3,2,3) TCM encoder parameters, the trellis state is 8. The \(d_{free}^{2}\) is estimated by the smallest Euclidian distance of a coded symbol sequence to the all-zero symbol sequence. The TCM asymptotic coding gain of GT is given by  
\[G_{T}=10 log[((d_{free}^{2})/(d_{(min_{u})}^{2}))(E_{(s_{u})}/E_{s})] \tag{21}\]  
where \(d_{free}^{2}\) is the squared free distance of the TCM encoder and \(d_{(min_{u})}^{2}\) is the squared minimum Euclidian distance of the uncoded scheme; \(E_{(s_{u})}\) and \(E_{s}\) are the symbol energy of the uncoded scheme and TCM encoder, respectively. Table 1 illustrates optimal polynomials generators/connections \(g_{(i)}\) in octal (base 8) format with the associated parameters for a good TCM encoder.