# Blind Recognition of Forward Error Correction Codes Based on Recurrent Neural Network
## 3 The Proposed Approach
### Data Generation  
In the experiment, we use MATLAB to generate data sets of four different coding types. It is assumed that the information in receiving end has been successfully demodulated and perfect frame synchronization has been achieved. Hence, we consider using the BPSK modulation stream at the receiver of the AWGN channel. In the paper, four kinds of FEC codes are used, including LDPC codes and Turbo codes which can be close to the channel capacity. The LDPC codes is a kind of common linear block code, it is characterized by the sparsity of the test matrix of LDPC codes. LDPC code is a block code whose checksum matrix contains only a small number of non-zero elements. It is the sparsity of the check matrix that ensures both the decoding complexity and the minimum code distance increase linearly with the code length. The code itself is indistinguishable from any other block code except that the check matrix is sparse. Turbo codes, also known as cascaded convolutional codes, are based on the combination of recursive system convolutional codes and interleaved techniques. In the paper, the Turbo encoder is set to a fixed size and the initial states of the Recursive System Convolution (RSC) encoder are all zeros. In addition, these two codes, we also recognize BCH code and convolutional code. The BCH codes is a kind of linear block codes, it has strong error-correcting ability, convenient construction, simple coding and decoding and its performance is close to the theoretical value under short and medium code length. Compared with the linear block codes, the convolutional codes are different in that the codes of the current moment are not only related to the information elements of the current moment, but also related to the input information elements of previous moments. The correlation between the code sets makes the convolutional codes have better performance under the condition of the same bit rate and device complexity.  
The work in the article covers the most common codes in the literature, including the following code types:  
Block codes: BCH codes, Turbo codes, LDPC codes.  
Convolutional codes: 1 bit input, 2 bits output and constraint length M = 5 to 8.  
The block codes are usually expressed as the form \((n,k)\), where \(k\) represents the information bits, \(n\) represents the total length of the block codes and \(r=n-k\) representsthe length of the monitor bits. Under the condition of \(GF(2)\), a group of block codes \(C\) can generate a total \(2^{k}\) of different code words. The expression is:  
\[C=(c_{0},c_{0},\ldots,c_{k-1}) \tag{3}\]  
In this paper, we use the coding structure and parameters recommended by the consultative committee for space data systems (CCSDS)standard to generate the training and test data sets of LDPC codes and Turbo codes. LDPC codes set consists of three code parameters defined in [31], block length 1024, rate R = 1/2, 2/3, 4/5. The Turbo codes set consists of four parameters defined in block length 1784 and bit rate R = 1/2, 1/3, 1/4 and 1/6. BCH selects four code words, which are B (6,3), B (7,4), B (12,8) and B (15,11). The parity matrix is taken from [32].  
In this paper, \((n,k,N_{0})\) is used to describe the convolutional code, where \(k\) is the number of bits at the input end, \(n\) is the number of bits at the output end and \(N_{0}\) is the length of the coding constraint. Standard rate 1/2 convolutional codes and different constraint lengths are considered as candidate codes, with constraint lengths ranging from 5 to 8. The octal representation of the different code generation polynomials is shown in Table 1.