## 3 Proposed Solution
### Forward Error Correction
\right] \tag{15}\]  
where \(D\) is constructed by combining a parity bits matrix and identity matrix in such a way that \(D_{(n-k)\times n}=P_{(n-k)\times k}^{T}\mid I_{(n-k)\times(n-k)}\) or \(D_{r\times n}=P_{r\times k}^{T}\mid I_{r\times r}\) where transpose \(P^{T}\) is the \(((n-k)xk)\) or \((r\times k)\) matrix and \(I\) is the identity matrix of \(((n-k)x(n-k))\) or \((r\times r)\) for \((n,k)\) codes. Thus, the parity check matrix \(D\) for \((7,4)\) block codes and the transpose of the parity check matrix, i.e., \(D^{T}\) will be  
\[D=\left[ \begin{array}{cccccc}1&1&1&0&1&0&0\\ 0&1&1&1&0&1&0\\ 1&1&0&1&0&0&1\end{array} \right]\quad,\quad D^{T}=\left[ \begin{array}{ccccc} 1&0&1\\ 1&1&1\\ 1&1&0\\ 0&1&1\\ 1&0&0\\ 0&1&0\end{array} \right]\]  
Let \(S\) be the error syndrome (where \(S=0\) or \(S\
eq 0\)), which is computed as \(S=C^{\prime}(D^{T})\). When the result of the syndrome is zero, i.e., \(S=0\), then no error has been detected and vice versa. Hence, the error bits can be corrected by altering their values from 0 to 1 or from 1 to 0 with non-zero syndrome detection. If the number of errors is beyond the code's error-correcting capacity but within the detection capability, the syndrome is said to indicate uncorrectable errors. The proposed code is designed in such a way that there is a one-to-one correspondence with an individual error of an \(E\) vector for each combination of syndrome bits. Thus, error correction can easily be achieved. It is also noticeable that the syndrome is purely a function of the error patterns and not the actual or transmitted codewords. For a single received word, it will be \(C^{\prime}\times D^{T}=E\times D^{T}\). This states that the received codeword entirely depends on the error pattern \(E\) if some codeword has been affected by errors. Suppose that there are no errors; then, \(E\times D^{T}\) will have a zero value, indicating the absence of errors. Otherwise, \(E\times D^{T}\) will result in a non-zero value indicating the presence of one or more errors. Finally, if the received codeword matches any valid codeword, the dataword is extracted by removing the parity bits to obtain the original data. Otherwise, an error(s) is detected and corrected. The pseudocode of the implemented FEC on the sender and receiver sides is given in Algorithm 1 and 2. ```
1: Construct a generator matrix \(L_{k\times n}\) by using identity matrix \(I_{k}\) and parity matrix \(P_{k\times r}\) as \(L=[I|P]\), where \(k=4\), \(n=7\) and \(r=3\)
2:while End of Data do
3: Extract the four encrypted information bits i.e., \(F_{x_{r}}F_{x+1},F_{x+2},F_{x+3},F_{x+4}\)
4: Multiply \(F\) with \(L\), such that:
5:\(C_{1}=F_{1}\times\left[ \begin{array}{c}l_{11}\\ l_{21}\\ \ldots\\ l_{k1}\end{array} \right],C_{2}=F_{2}\times\left[ \begin{array}{c}l_{12}\\ l_{22}\\ \ldots\\ l_{k2}\end{array} \right],\ldots,C_{n}=F_{n}\times\left[ \begin{array}{c}l_{1 \
}\\ \delta_{2n}\\ \ldots\\ l_{kn}\end{array} \right]\)
6: Construct \(C=(C_{1},C_{2},C_{3},\ldots,C_{n})\)
7: Send codeword \(C\) over the noisy channel
8: Move the value of \(x\) to next position
9:endwhile
```  
**Algorithm 1** Pseudocode of Implemented FEC Method: Source/Sender```
1: Construct a parity check matrix \(P_{r\times n}\) by using parity matrix \(P_{r\times k}\) and identity matrix \(I_{r}\) as \(D=[P|I]\), where \(r=3\), \(n=7\) and \(k=4\)
2: Take the transpose of Matrix \(D\) as \(D_{n\times r}^{T}\), i.e. \(D_{7\times 3}^{T}\)
3:while End of Codewords being received do
4: Take erroneous codeword \(C^{\prime}\)
5: Multiply \(C^{\prime}\) with \(D^{T}\), such that
6:\(S_{1}=C^{\prime}\times\left[ \begin{array}{c}d_{11}\\ d_{12}\\ d_{1n}\\ d_{1n}\end{array} \right],S_{2}=C^{\prime}\times\left[ \begin{array}{c}d_{21} \\ d_{22}\\ \ldots\\ d_{2n}\end{array} \right],\ldots,S_{n}=C^{\prime}\times\left[ \begin{array}{c}d_ {r1}\\ d_{r2}\\ \ldots\\ d_{m}\end{array}