Adaptive Rate-Compatible Non-Binary LDPC Coding Scheme for the B5G Mobile System

This paper studies an adaptive coding scheme for B5G (beyond 5th generation) mobile system-enhanced transmission technology. Different from the existing works, the authors develop a class of rate-compatible, non-binary, low-density parity check (RC-NB-LDPC) codes, which expresses the strong connection between the algebra-based and graph-theoretic-based constructions. The constructed codes can not only express rate-compatible (RC) features, but also possess a quasi-cyclic (QC) structure that facilitates the encoding implementation. Further, in order to achieve the code rate-adaptive allocation scheme, the authors propose using the K-means++ clustering algorithm to cluster different channel environments, considering various factors that affect channel characteristics. Finally, in order to present the advantages of the adaptive coding scheme, the authors construct a coding scheme for image transmission. The numerical results demonstrate that the developed code can obtain better waterfall performance in a larger code rate range, which is more suitable for data transmission; the adaptive coding transmission scheme can obtain higher reconstructed image quality compared to the fixed code rate-coding scheme. Moreover, when considering unequal error protection (UEP), the proposed scheme can further improve the reconstructed image quality.


Introduction
With the advent of the 5G communication era, the demand for wireless communication is still strong, and the increased spectrum and power resources are insufficient. Therefore, new transmission technology needs to be updated to achieve rapid growth of the wireless communication capacity [1,2]. The B5G mobile system performs well in terms of wireless coverage and user experience. To overcome the challenge, one should improve the error-correcting, anti-jamming, and efficient transmission capabilities for B5G. Among the communication technologies for error correction and detection, channel coding can significantly improve the reliability of communication systems and ensure efficient transmission-this has become one of the focuses among the communication technologies [3][4][5][6][7][8][9].
In order to achieve significant improvements with key performance parameters, the channel-coding technique for B5G should have features such as large coding gain, low-complexity, low-latency, high-throughput, and flexible code parameters [10,11]. The conventional single channel-coding schemes can hardly meet all of the requirements of B5G. The B5G system will select different channel-coding schemes for different scenarios and serves to meet the corresponding technical requirements.
For the B5G mobile system, the channel-coding scheme for a high data rate is pursued; however, the wireless channel environment is time-varying and fading. High-data-rate signals are prone

The Construction of RC-NB-LDPC Codes
In this section, we first briefly review a general matrix-theoretic method for constructing QC-LDPC codes based on superposition. Then, we develop a class of RC-NB-LDPC codes based on masking and puncturing techniques.

QC-LDPC Codes and Superposition Construction
The check matrix H corresponding to a class of quasi-cyclic LDPC codes can be expressed by . . . I(P 1n ) I(P 21 ) I(P 22 ) . . . I(P 2n ) . . . where I P ij (1 ≤ i ≤ m, 1 ≤ j ≤ n) is a b × b-dimensional circulant matrix, and is referred to as the circulant permutation matrix [35]. This matrix can be obtained by rotating each row vector of a b × b-dimensional unit matrix P ij element to the right, and P ij ∈ {0, 1, 2, · · · , b − 1, ∞}. Herein, P ij = 0 means that I P ij is a unit matrix, and P ij = ∞ means that I P ij is a zero matrix. For any i, j, replacing the circulant permutation matrix I P ij in the check matrix H by value P ij , one can obtain a new matrix P, referred to as the circulation coefficient-matrix [36], which is shown by H ij = 0 when P ij = ∞ and H ij = 1; otherwise, for any i, j, one can obtain the corresponding base matrix H b , which is given by where H ij ∈ {0.1}, (1 ≤ i ≤ m, 1 ≤ j ≤ n). Thus, if we obtain a small m × n base matrix H b and a set of b × b circulant permutation matrices, we can construct an m × n array H of b × b matrices by replacing each 1-entry in H b by a circulant permutation matrix and each 0-entry by a zero matrix. This replacement of entries in H b by the circulant permutation matrices and/or zero matrices expands the matrix H b into a mb × nb sparse matrix H.

The Construction of RC-NB-LDPC Codes
Most methods for constructing LDPC codes can be classified into two general categories: the algebraic-based and the graph-theoretic-based constructions [36]. This paper combines these two methods to construct the RC-LDPC codes, as shown in Figure 1.
Appl. Sci. 2019, 9,909 4 of 29 as well as the adversarial capabilities and goals; in Section 3, we analyze the adversarial attack methods in training stage and testing stage, respectively. In Section 4, we sort out the applications of adversarial attack technologies in four fields, including computer vision, natural language processing, cyberspace security, and physical world. In Section 5, we conclude the existing defense methods against adversarial attacks. We conclude in Section 6.

Adversarial Samples and Adversarial Attack Strategies
In this section, we mainly introduce the adversarial samples and the adversarial attack strategies, including the causes and characteristics of adversarial samples, as well as the capabilities and goals of the adversarial attacks.

Adversarial Example (AE)
Szegedy et al. [6] firstly proposed the concept of adversarial samples, which are constructed by adding tiny perturbations that could not be recognized by human eyes to the input samples of the model, and caused the adversarial images to be misclassified by the target model with high confidence. Suppose there is a machine learning model M and an original sample x that can be classified correctly, i.e., M(x) = y true ; by adding a slight perturbation to x, the adversary could construct an adversarial sample x which is similar to x but can be misclassified by M, i.e., M(x ) = y true . Figure 1 shows the adversarial process [15]. The model considers the original image as a "panda" (57.7%). Indeed, the image added a tiny perturbation is classified as a "gibbon" by the same model (99.3%), while the human eyes cannot identify the difference (Image Credit: Goodfellow et al. [15]).

Causes of Adversarial Examples
Researchers have proposed some explanations for the existence of adversarial samples. Some [58] believe that the reason is the over-fitting or under-regularization of the model led to the insufficient generalization ability that learning models predict unknown data, while others [21] consider that the adversarial samples are caused by the extreme nonlinearity of the deep neural network. However, Goodfellow et al. [15] added perturbation to the input of a regularization model and a linear model which has enough dimensions, and demonstrated that both models' effectiveness of defending adversarial attacks were not significantly improved.
Goodfellow et al. [15] believe that the cause of adversarial samples is the linear behavior in high dimensional space. In a high dimensional linear classifier, each input feature is normalized, so that slight perturbation for one dimension of each input will not change the overall prediction of the classifier, while small perturbations to all dimensions of the inputs will lead to effective change. As is shown in Figure 2, the score of class "1" is increased from 5% to 88% by adding or subtracting 0.5 from The best-known graph-theoretic-based construction method is the progressive edge-growth (PEG) algorithm [37,38]. The goal of this algorithm is to construct a graph that adds one edge each time and maximizes the local girth. Therefore, the PEG algorithm is a greedy algorithm for constructing a Tanner graph with a large girth. In this paper, we use the PEG algorithm to construct a small base matrix for future research.
The algebraic-based methods for constructing LDPC codes have been developed using mathematical tools such as finite geometries [39], finite fields [40], and combinatorial designs [41,42]. In general, Algebraic LDPC codes have much lower error-floors than randomly constructed LDPC codes. Most of the algebraic constructions involve several key ingredients including the circulant permutation matrix, masking matrix, and superposition operation [43]. In this paper, the key operations for constructing RC-NB-LDPC codes are described as follows.

• Mask operation
The masking technique can selectively mask some sub-circulant matrixes in order to reduce the density of non-zero elements in the check matrix H, so that fewer small cycles or longer girth could Sensors 2019, 19, 1067 5 of 28 be obtained. Moreover, the performance of the LDPC code is improved. Through selecting a suitable masking matrix, we can obtain any rate code according to the same base matrix.
The masking technique can be described as special matrix product operations [44]. We assume a masking matrix H m = m ij as a binary matrix with size of m × n, then the definition of the product of H m and H is shown as (4).
In Equation (4), when m i,j = 1, m i,j A s ij = A s ij and when m i,j = 0, m i,j A s ij = 0. We define H b as the base matrix and H as the masked matrix. If H m and H b are sparse matrices, then H is also a sparse matrix. In addition, sub-matrices in H can be replaced with zero arrays of the same size by using the masking technique, which can reduce the density of non-zero elements in GF(q). Thus, a sparser matrix H degrades the probability of small cycles.
When constructing LDPC codes, if we obtain the degree distributions λ(x) and ρ(x) of the variable node and the check node, then we can obtain the check matrix H. We assume that the corresponding degree distribution of code words with code rate r and code length n are λ(x) and ρ(x); if the masking matrix H m obeys the same degree distribution, the masked check matrix H will also obey the same distribution.

• Puncture operation
The puncturing technique is the most common rate adaptive technique [24,45,46], the implementation process of which first selects a high rate mother code with excellent performance, then punctures the check bit in the code word, thus deleting a number of columns in the check matrix, resulting in a low rate code word. The high rate QC-LDPC code may be used at higher SNR. On the contrary, when the channel environment is poor, a low rate QC-LDPC code may be used, thereby improving the average effectiveness of the communication system. Using the puncturing technique to change the degree distribution of the masking matrix, an adaptive-rate LDPC code can be obtained. Since the dimension of the masking matrix is much smaller than the check matrix of the QC-LDPC code, it can greatly reduce the hardware complexity of the rate-adaptive communication system.
The NB-LDPC code defined on the finite field GF(q) has q = 2 m elements; the mapping relationship is as follows: We refer to (x 0 , . . . , x m−1 ) ∈ F m 2 as a binary mapping of the symbol X ∈ F q . The NB-LDPC code can be mapped into binary code for transmission in a channel. Therefore, the NB-LDPC code can be punctured at both the symbol level and bit level.
For example, for 8-ary LDPC codes, the degree distribution function is λ(x) = 1/3x + 2/3x 3 , The bit-level puncturing algorithm is intuitively represented by Figure 2. The masking technique can selectively mask some sub-circulant matrixes in order to reduce the density of non-zero elements in the check matrix H , so that fewer small cycles or longer girth could be obtained. Moreover, the performance of the LDPC code is improved. Through selecting a suitable masking matrix, we can obtain any rate code according to the same base matrix.
The masking technique can be described as special matrix product operations [44]. We assume a masking matrix = In Equation (4) [24,45,46], the implementation process of which first selects a high rate mother code with excellent performance, then punctures the check bit in the code word, thus deleting a number of columns in the check matrix, resulting in a low rate code word. The high rate QC-LDPC code may be used at higher SNR. On the contrary, when the channel environment is poor, a low rate QC-LDPC code may be used, thereby improving the average effectiveness of the communication system. Using the puncturing technique to change the degree distribution of the masking matrix, an adaptive-rate LDPC code can be obtained. Since the dimension of the masking matrix is much smaller than the check matrix of the QC-LDPC code, it can greatly reduce the hardware complexity of the rate-adaptive communication system.
The NB-LDPC code defined on the finite field   G F q has 2 m q  elements; the mapping relationship is as follows: We refer to   can be mapped into binary code for transmission in a channel. Therefore, the NB-LDPC code can be punctured at both the symbol level and bit level.
For example, for 8-ary LDPC codes, the degree distribution function is   The bit-level puncturing algorithm is intuitively represented by Figure 2. • The circulation coefficient-matrix is designed using an algebraic-based method The circulation coefficient-matrix of size m × n is designed using an algebraic-based method, assuming that GF(q) is a finite field containing q elements, α is a primitive of GF(q), and all elements in GF(q) can be represented as a form of α power, i.e., α −∞ , α 0 , α 1 , . . . , α q−2 , where 0 = α −∞ , α 0 = 1. S 1 = α i 0 , α i 1 , . . . , α i m−1 and S 2 = α j 0 , α j 1 , . . . , α j n−1 are two subsets of GF(q), where i k , j l ∈ {0, 1, . . . , q − 2}, 0 ≤ k < m, 0 ≤ l < n. Based on the closeness of the computation of the finite field, a finite field matrix on GF(q) can be constructed from S 1 and S 2 .The specific construction method is given by . .
In summary, the steps of constructing the RC-NB-LDPC codes are as follows: 1.
Construct a matrix H b of size m × n based on the PEG algorithm as the base matrix.

2.
Construct a matrix H m of size m × n based on the random construction as the mask matrix.

3.
Mask and puncture the base matrix H b .

4.
Calculate a circulation coefficient-matrix P of size m × n using an algebraic-based method and generate the circulant permutation matrices. 5.
Superposition operation. Replacing the entries in H b by the circulant permutation matrices and/or zero matrices expands the matrix H b into a mb × nb sparse matrix H.

Design and Implementation of the RC-NB-LDPC Code
The check matrix of the RC-NB-LDPC code has a QC structure, so the coding algorithm can adopt the QC-structured fast-coding method. The FPGA implementation based on the QC-structured fast-coding method will be described in detail below.

Matrix of RC-NB-LDPC Codes
The fast-coding method uses the special structure of the QC-LDPC code for encoding, so the check matrix and the generator matrix need to be set. The structure of the check matrix is shown in Figure 3. The base matrix size is 4 × 16, and the check matrix is divided into 64 blocks, and the size of each block matrix is 48 × 48. The numbers in the above matrix represent the element coefficients of the current matrix, and the matrix with a coefficient of 0 is the all-zero matrix. The numbers in the below matrix represent the circulant coefficients of the current matrix, and a coefficient of 0 indicates that the current matrix is not shifted.
Since the check matrix of the NB-QC-LDPC code has a QC structure, the generator matrix also has a QC structure. The generation matrix is as shown in Figure 4. The right side of the matrix is a unit matrix of size 576 × 576, and each G i,j on the left side is a circulant of size 48 × 48. Therefore, the entire matrix can be stored by simply storing the first row of each G i,j matrix, greatly reducing resource usage. The source symbol is multiplied by the matrix of its corresponding code rate to obtain the coding result. Since the right side of the matrix is a unit matrix, it is only necessary to calculate the result of multiplying the source symbol by the G i,j , and then stitching the source symbol to obtain the final coding result. The source symbol and G i,j are encoded to obtain a check sequence, wherein G i,j is divided into four columns, which can be encoded simultaneously by four channels, so that the coding efficiency can be improved four-fold.

Encoder Architecture
The encoder-coding block diagram is shown in Figure 5. It is divided into three parts. The input buffer part is used to buffer the information transmitted by the upper level and output the data when the encoding part is needed. The second part is the encoding part, which is used to calculate the encoding result and output the calculation result to the output buffer module. The output buffer part is used to store the encoding result and the communication with the downstream module.   G is divided into four columns, which can be encoded simultaneously by four channels, so that the coding efficiency can be improved four-fold.

Encoder Architecture
The encoder-coding block diagram is shown in Figure 5. It is divided into three parts. The input buffer part is used to buffer the information transmitted by the upper level and output the data when the encoding part is needed. The second part is the encoding part, which is used to calculate the encoding result and output the calculation result to the output buffer module. The output buffer part is used to store the encoding result and the communication with the downstream module.

Encoder Architecture
The encoder-coding block diagram is shown in Figure 5. It is divided into three parts. The input buffer part is used to buffer the information transmitted by the upper level and output the data when the encoding part is needed. The second part is the encoding part, which is used to calculate the encoding result and output the calculation result to the output buffer module. The output buffer part is used to store the encoding result and the communication with the downstream module. G is divided into four columns, which can be encoded simultaneously by four channels, so that the coding efficiency can be improved four-fold.

Encoder Architecture
The encoder-coding block diagram is shown in Figure 5. It is divided into three parts. The input buffer part is used to buffer the information transmitted by the upper level and output the data when the encoding part is needed. The second part is the encoding part, which is used to calculate the encoding result and output the calculation result to the output buffer module. The output buffer part is used to store the encoding result and the communication with the downstream module.  The hardware structure of the NB-QC-LDPC code encoder is shown in Figure 6, which includes an input module, an encoding module, and an output module. The hardware structure of the NB-QC-LDPC code encoder is shown in Figure 6, which includes an input module, an encoding module, and an output module. In addition to buffering the source symbol function passed by the previous level, the input module also completes the cross-clock domain operation of the data. Furthermore, according to the currently input code rate information, the source symbol is truncated into a sequence of corresponding lengths, so that the coding module performs coding. Therefore, the input module mainly includes a fifo module and a corresponding control module. When the "encoding_over" signal of the encoding module is high, it indicates that the encoding module has been encoded, and can receive a new source frame.
The coding module is a core module of the NB-LDPC encoder, and its function is to perform a matrix multiplication operation on the source information and the generation matrix in the Galois field to obtain a coding result. The coding module mainly includes an operation module, a RAM storage module and a corresponding control module.
The output module mainly performs the function of storing the encoded result and communicating with the downstream module. The encoding module inputs the encoding result to the output module. When the "out_ready" signal is high, it indicates that the next level has been prepared for reception, and the encoding result may be output; otherwise, the output module temporarily stores the encoding result. When the output module is full, the output "in_ready "signal is turned low, indicating that new data cannot be accepted. Therefore, the output module mainly contains the fifo module and the corresponding control module.

Coding Module
The coding module is the core module of the encoder. The block diagram of the structure is shown in Figure 7. It includes the SSRAA (serial shift register accumulator unit) operation module, the source information cache module, the parallel-to-serial conversion module, the output module and the control module.  In addition to buffering the source symbol function passed by the previous level, the input module also completes the cross-clock domain operation of the data. Furthermore, according to the currently input code rate information, the source symbol is truncated into a sequence of corresponding lengths, so that the coding module performs coding. Therefore, the input module mainly includes a fifo module and a corresponding control module. When the "encoding_over" signal of the encoding module is high, it indicates that the encoding module has been encoded, and can receive a new source frame.
The coding module is a core module of the NB-LDPC encoder, and its function is to perform a matrix multiplication operation on the source information and the generation matrix in the Galois field to obtain a coding result. The coding module mainly includes an operation module, a RAM storage module and a corresponding control module.
The output module mainly performs the function of storing the encoded result and communicating with the downstream module. The encoding module inputs the encoding result to the output module. When the "out_ready" signal is high, it indicates that the next level has been prepared for reception, and the encoding result may be output; otherwise, the output module temporarily stores the encoding result. When the output module is full, the output "in_ready "signal is turned low, indicating that new data cannot be accepted. Therefore, the output module mainly contains the fifo module and the corresponding control module.

Coding Module
The coding module is the core module of the encoder. The block diagram of the structure is shown in Figure 7. It includes the SSRAA (serial shift register accumulator unit) operation module, the source information cache module, the parallel-to-serial conversion module, the output module and the control module. The hardware structure of the NB-QC-LDPC code encoder is shown in Figure 6, which includes an input module, an encoding module, and an output module. In addition to buffering the source symbol function passed by the previous level, the input module also completes the cross-clock domain operation of the data. Furthermore, according to the currently input code rate information, the source symbol is truncated into a sequence of corresponding lengths, so that the coding module performs coding. Therefore, the input module mainly includes a fifo module and a corresponding control module. When the "encoding_over" signal of the encoding module is high, it indicates that the encoding module has been encoded, and can receive a new source frame.
The coding module is a core module of the NB-LDPC encoder, and its function is to perform a matrix multiplication operation on the source information and the generation matrix in the Galois field to obtain a coding result. The coding module mainly includes an operation module, a RAM storage module and a corresponding control module.
The output module mainly performs the function of storing the encoded result and communicating with the downstream module. The encoding module inputs the encoding result to the output module. When the "out_ready" signal is high, it indicates that the next level has been prepared for reception, and the encoding result may be output; otherwise, the output module temporarily stores the encoding result. When the output module is full, the output "in_ready "signal is turned low, indicating that new data cannot be accepted. Therefore, the output module mainly contains the fifo module and the corresponding control module.

Coding Module
The coding module is the core module of the encoder. The block diagram of the structure is shown in Figure 7. It includes the SSRAA (serial shift register accumulator unit) operation module, the source information cache module, the parallel-to-serial conversion module, the output module and the control module.  The SSRAA operation module completes the coding operation process, and the four sets of SSRAA operation modules work in parallel, which improves the coding efficiency. The parallel-serial Sensors 2019, 19, 1067 9 of 28 conversion module converts the verification sequence encoded by the four parallel SSRAA circuits into a serial form for sequential output. The source information cache module is used to store the source sequence. The output module mainly completes the output of the encoded result.
After the processing of the upper input module, the input data of the encoding module is a piece of truncated source information, and the data length corresponds to the current encoding rate. At the time of data entry, the SSRAA module is also constantly calculating the check sequence. When a piece of information is entered, the SSRAA module also completes the calculation of the check sequence. The output of the encoded result is then performed, and the state machine of the output module is shown in Figure 8. The SSRAA operation module completes the coding operation process, and the four sets of SSRAA operation modules work in parallel, which improves the coding efficiency. The parallel-serial conversion module converts the verification sequence encoded by the four parallel SSRAA circuits into a serial form for sequential output. The source information cache module is used to store the source sequence. The output module mainly completes the output of the encoded result.
After the processing of the upper input module, the input data of the encoding module is a piece of truncated source information, and the data length corresponds to the current encoding rate. At the time of data entry, the SSRAA module is also constantly calculating the check sequence. When a piece of information is entered, the SSRAA module also completes the calculation of the check sequence. The output of the encoded result is then performed, and the state machine of the output module is shown in Figure 8. After the encoding is completed, the state machine jumps from the original IDLE state to the SRTART state and begins reading the encoded result. In the READ_CHECK state, the output module reads the parallel-converted 192-bit check sequence from the parallel-to-serial conversion module and then jumps to the READ_INFORMATION state. In the READ_INFORMATION state, the output module reads the source information of the corresponding length from the information cache module according to the code rate information of the current frame, and completes the output of the encoded result. The state machine then jumps back from the OVER state to the IDLE state, waiting for the encoding of the next frame to complete.

SSRAA Module
The encoder of the QC-LDPC code can be completed by the SSRAA circuit, and its implementation structure is shown in Figure 9. After the encoding is completed, the state machine jumps from the original IDLE state to the SRTART state and begins reading the encoded result. In the READ_CHECK state, the output module reads the parallel-converted 192-bit check sequence from the parallel-to-serial conversion module and then jumps to the READ_INFORMATION state. In the READ_INFORMATION state, the output module reads the source information of the corresponding length from the information cache module according to the code rate information of the current frame, and completes the output of the encoded result. The state machine then jumps back from the OVER state to the IDLE state, waiting for the encoding of the next frame to complete.

SSRAA Module
The encoder of the QC-LDPC code can be completed by the SSRAA circuit, and its implementation structure is shown in Figure 9.
The multiplication and addition operations in the encoding of the NB-LDPC code are operations of the Galois field. For an 8-ary LDPC code, each symbol consists of three bits. The addition of the Galois field is essentially a bitwise XOR operation, as shown in the right part of Figure 10. The multiplication of the Galois field is designed by the looking-up table method, as shown in the left part of Figure 10. First, the input data din1 and din2 are respectively looked up in the ROMA, the result is added in the eight-element domain, and the addition result is checked in the ROMB. The result is the multiplication of din1 and din2 in GF (8). The multiplication and addition operations in the encoding of the NB-LDPC code are operations of the Galois field. For an 8-ary LDPC code, each symbol consists of three bits. The addition of the Galois field is essentially a bitwise XOR operation, as shown in the right part of Figure 10. The multiplication of the Galois field is designed by the looking-up table method, as shown in the left part of Figure 10. First, the input data din1 and din2 are respectively looked up in the ROMA, the result is added in the eight-element domain, and the addition result is checked in the ROMB. The result is the multiplication of din1 and din2 in   8 GF .

Complexity Analysis
The coding complexity is shown in Table 1. Since the check matrix construction algorithm for constructing the QC-LDPC code based on the masking and puncturing technique has a quasi-cyclic structure, an encoding method of a quasi-cyclic code with low coding complexity can be employed. From the perspective of coding complexity，adopting the QC-encoding algorithm, only needs to   The multiplication and addition operations in the encoding of the NB-LDPC code are operations of the Galois field. For an 8-ary LDPC code, each symbol consists of three bits. The addition of the Galois field is essentially a bitwise XOR operation, as shown in the right part of Figure 10. The multiplication of the Galois field is designed by the looking-up table method, as shown in the left part of Figure 10. First, the input data din1 and din2 are respectively looked up in the ROMA, the result is added in the eight-element domain, and the addition result is checked in the ROMB. The result is the multiplication of din1 and din2 in   8 GF .

Complexity Analysis
The coding complexity is shown in Table 1. Since the check matrix construction algorithm for constructing the QC-LDPC code based on the masking and puncturing technique has a quasi-cyclic structure, an encoding method of a quasi-cyclic code with low coding complexity can be employed.

Complexity Analysis
The coding complexity is shown in Table 1. Since the check matrix construction algorithm for constructing the QC-LDPC code based on the masking and puncturing technique has a quasi-cyclic structure, an encoding method of a quasi-cyclic code with low coding complexity can be employed. From the perspective of coding complexity, adopting the QC-encoding algorithm, only needs to multiply O (L − J) 2 p times in GF(q), and there is no need to add operations throughout the coding process-J and L are the number of rows and columns of the mask matrix H m , respectively, and p is the dimension of the sub matrix. Linear complexity coding is achieved when high-speed coding is employed. The coding complexity calculation of the random construction algorithm of the NB-LDPC code check matrix consists of two parts: one is to Gaussian eliminate the check matrix into the structure of the lower triangular matrix, that is, pre-process the check matrix; the operation complexity is O(n 3 ), where n is the code length. The other part is that the coding complexity is O(n 2 ). This is because the coding complexity of the coding algorithm depends on the sparsity of the generator matrix. Let the average column weight of the generator matrix be w; approximately, wn multiplication operations and (w − 1)n sub-operations in GF(q) are required throughout the encoding process. Although the check matrix of a NB-LDPC code is very sparse, its generator matrix is not sparse. Usually, the ratio of w and n is a non-negligible constant, which often makes the coding complexity proportional to the square of its code length. From the hardware storage capacity of the check matrix, when storing the matrix with this construction algorithm, only one p × p unit array I, one J × L non-binary coefficient matrix Gc J×L , and one J × L circulation coefficient matrix S J×L are stored. However, to construct a parity check matrix of the same size using a random construction method, it is necessary to store a p × J × p × L check matrix. The hardware storage resource is largely saved compared with the storage of the complete NB-LDPC code check matrix. In addition, the masking and puncturing techniques are used to overcome the shortcomings of the search time when the NB-LDPC code of the long code length is randomly constructed. This is because the dimension of the masking matrix H m is a small constant compared to a randomly constructed matrix. It is easy to construct a check matrix of the NB-LDPC code of the given degree distribution, λ(x) and ρ(x), with the row weight and the column weight.
In the rate-adaptive communication system, the NB-LDPC code of the appropriate code rate is selected according to the channel environment for encoding. Most of the actual communication systems require real-time performance. Improving the effectiveness of the communication system and the speed of hardware processing are two effective ways. With adaptive-rate technology, the average effectiveness of the communication system can be improved. The puncturing of the masking matrix can greatly improve the speed of the hardware processing. Let the masking matrix H m be a binary matrix of J × L and the matrix H be a non-binary matrix of m × n, where m = p × J, n = p × L. For example, if J = 8, L = 16, the mother code rate is r = 1/2, and the puncturing code rate is r m = 3/4. To delete the check bits in H, 4 × p check bits need to be deleted. However, for the check matrix constructed by the algorithm based on masking and puncturing techniques, only 4 check bits of the masking matrix H m need to be deleted. The processing speed of the hardware is increased by p times. Obviously, the longer the codeword, that is, the larger the p value, the more the processing speed of the hardware is improved, thereby greatly improving the real-time performance of the communication system.

Channel Clustering Based on the K-Means++ Algorithm
Wireless signals are susceptible to the effect of a variety of physical factors during transmission, such as signal source position, obstacles, antenna gain, transmit power, and so on. In order to ensure the validity and reliability of information transmission, it is necessary to change the transmission code rate according to different channel conditions. We usually use channel estimation techniques to judge the quality of channel states. However, the channel estimation algorithm with computational complexity would reduce the effectiveness of the communication system.
With the rise of machine learning, more simple and effective methods are used to reduce the complexity [6,31,32]. The clustering algorithm is an important unsupervised learning algorithm in machine learning. Because of its flexibility, rapid classifications based on different similarities of data are widely used in various technical fields [47,48].
The partition-based clustering algorithm is one of the most commonly used algorithms. Usually, the method based on distance division is used to divide the objects with approximate characteristics into the same cluster. The distances of objects in the same cluster are as close as possible. The distance between objects in different clusters is as far as possible. Partition-based clustering algorithms often need to enumerate the possibilities of all categories in order to obtain an optimal solution.

Channel Environment Clustering Based on the K-Means++ Algorithm
The k-means algorithm is one of the most common partition-based clustering algorithms. K-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. The k-means algorithm is simple and flexible, but sensitive to outliers and isolated points.
In addition to the impact of the physical factors, the number of users under the same hotspot, as well as the user usage behavior (occupied bandwidth), will have an impact on the actual available channel state. In this paper, we abstract these influencing factors into data vectors and form the data vectors into a sample set, and then cluster them with the k-means algorithm.
We assume that the inputs are the sample set D = {x 1 , x 2 , . . . , x m }, the cluster number k, the maximum number of iterations N, and the output is cluster partition C = {C 1 , C 2 , · · · C k }. The k-means algorithm flow is as follows:
(d) If all cluster center vectors have not changed, go to step 3.
The k-means algorithm is sensitive to the initially selected cluster center, and the position selection of the k initial cluster centers has a great influence on the final clustering result. Therefore, it is necessary to select the appropriate k cluster centers. The k-means++ algorithm randomly initializes the cluster center, which is the optimization of the k-means algorithm.
The optimization strategy of k-means++ for initializing the cluster center is as follows: According to the process of the algorithm, different initial clustering centers may result in different results. In this paper, we select the k-means++ algorithm in order to optimize the initial clustering center. The k-means++ algorithm is an improvement of the k-means algorithm. Try to choose the k-measuring point distance as the initial cluster center. The specific steps are as follows: 1.
Randomly select sample data from the data set as the first cluster center µ 1 in k clusters.

2.
Calculate the distance D(x) between the data sample x i in the dataset and the nearest cluster center. D(x) = argmin x i − µ r 2 , r = 1, 2, · · · , k selected 3.
According to the value of D(x), select a new data point in the remaining sample data as a new cluster center. The larger the D(x), the greater the probability of being selected; 4.
Repeat steps 2 and 3 until k cluster centers are selected; 5.
Implement the standard k-means algorithm by using the k centers as the initial cluster centers.

Complexity Optimization of the End-to-End Distortion Model Based on the Clustering Algorithm
Traditional rate allocation schemes often need to traverse all combinations of coding parameters to achieve adaptive-rate allocation by iterating all combinations. In this paper, the clustering algorithm is introduced to quickly cluster the channel environment to obtain the channel-coding scheme, so as to achieve the goal of adaptive-rate allocation. Compared with the traditional scheme, the proposed method can effectively reduce the computational complexity.
The joint source channel-coding design based on rate allocation is to obtain the optimal video reconstruction quality through bit allocation between the channel and the source in the case of limited bandwidth and channel interference. A block diagram of the bit allocation strategy for joint source channel coding is shown in Figure 11. channel-coding scheme, so as to achieve the goal of adaptive-rate allocation. Compared with the traditional scheme, the proposed method can effectively reduce the computational complexity.
The joint source channel-coding design based on rate allocation is to obtain the optimal video reconstruction quality through bit allocation between the channel and the source in the case of limited bandwidth and channel interference. A block diagram of the bit allocation strategy for joint source channel coding is shown in Figure 11. In the joint source channel-coding system, end-to-end distortion is one of the important means to measure the quality of the system. The performance of the transmission system is measured by calculating the mean square error between the reconstructed video image and the original video image at the encoder end. The end-to-end distortion model is derived below.
Therefore, the estimated end-to-end distortion of the decoder can be expressed as: It can be seen that the end-to-end distortion can be represented by the sum of the three items   If an error occurs in a reference frame or a referenced module, the distortion is propagated to the corresponding frame or pixel with reference to it. Error concealment refers to the distortion Figure 11. The bit allocation strategy for joint source channel coding.
In the joint source channel-coding system, end-to-end distortion is one of the important means to measure the quality of the system. The performance of the transmission system is measured by calculating the mean square error between the reconstructed video image and the original video image at the encoder end. The end-to-end distortion model is derived below.
First, define the pixel in the n th frame as i, and the pixel of the reference frame re f is j. Let f i n be the original value of the pixel, letf i n and f i n be the reconstructed values of the encoder and decoder, respectively, and letr i n be the reconstructed residual of the encoder, i.e.,f i n =f i re f +r i n . If the current pixel is lost at the decoder side, it will copy the pixels of the (n − 1) th frame. Assuming that the transmission error rate is p, the pixel value of the reconstructed image can be expressed by: Therefore, the estimated end-to-end distortion of the decoder can be expressed as: It can be seen that the end-to-end distortion can be represented by the sum of the three items d s (n, i), d ep (re f , j) and d ec (n, i), where d s (n, i) represents source distortion, d ep (re f , j) represents error propagation distortion from the reference frame, and d ec (n, i) represents error concealment distortion. Error propagation distortion refers to the use of predictive coding in HEVC coding. If an error occurs in a reference frame or a referenced module, the distortion is propagated to the corresponding frame or pixel with reference to it. Error concealment refers to the distortion caused by the recovery of errors or lost modules generated by transmissions in the channel using temporal or spatial correlation. Usually, in the time domain, the motion-compensated content of the previous frame is used to replace the lost portion of the current frame, and the spatial correlation is used to recover the lost portion in the spatial domain.
Since d s (n, i) can be obtained by source-encoded parameters at the encoder side, end-to-end distortion mainly depends on the calculation of d ep (re f , j) and d ec (n, i). The result shown in Equation (9) can be obtained by calculating d ec (n, i): As can be seen from the above formula, d ec (n, i) consists of two items, d ec_o (n, i) and d ep (n − 1, k), where d ec_o (n, i) represents the mean square error between the original image and the encoder-side error-coded pixels, called the original error concealment distortion. d ec_o (n, i) can also be obtained by parameter calculation on the encoder side.
It can be seen that d ep (n − 1, k) in Equation (9) and d ep (re f , j) in Equation (8) represent error propagation distortion. The calculation method of d ep (n, i) is as shown in: It can be seen that d ep (n, i) consists of three parts, where d ec_r (n, i) represents the reconstructed image and the error concealment distortion at the encoder end, which is called reconstructed error concealment distortion. The expression d ec_r (n, i) can be obtained by parameter calculation at the decoder end. Therefore, A is mainly generated by the error propagation distortion of its reference frame and the previous frame. In addition, since the first frame in the video sequence is usually an intra-coded frame, the value d ep of the first frame can be directly obtained without considering error propagation and the values d ep s of the remaining frames can be recursively calculated by Equation (10) on a frame-by-frame basis. In the end-to-end distortion model, the end-to-end distortion of the current frame is obtained by referring to the error propagation distortion of the previous frame, and the subsequent frame is updated by the error propagation distortion of the current frame.
Therefore, from the above analysis, the end-to-end distortion estimation is related to the selection of source-coding, channel-coding, and reference frames.
According to the derivation of the end-to-end distortion estimation method, in the JSCC algorithm based on the rate allocation, in order to select the optimal rate allocation strategy, it is necessary to comprehensively consider the parameters of the source, the channel and the like, so it will be introduced. There is a large number of iterative calculations, so how to choose an effective means to reduce the computational complexity is also a problem worth studying.
Since the end-to-end distortion of the video transmission system is related to the source-coding parameters, the channel-coding parameters, and the reference frame, let S denote the set of all source-coding options, C denote the set of all channel-coding options, and M denote the set of all reference frames. The candidate parameters of the source-coding, channel-coding, and reference frame are u, r, re f , respectively. A system description that minimizes distortion at the decoder is shown in: min The traditional JSCC algorithm is based on the principle of minimizing end-to-end distortion as a scheme for selecting a code rate allocation. It is often necessary to traverse all combinations of coding parameters, and the worst case computational complexity is O(|S| × |C| × |M|). However, the JSCC scheme based on rate allocation proposed in this paper divides the selection method of the parameter combination into two steps. Firstly, the channel environment is estimated by the clustering algorithm, that is, the code rate r(k) of the channel coding can be obtained by simple clustering before encoding, and then the obtained channel-coding parameters are brought into the minimum end-to-end distortion estimation to obtain the source-coding parameters and the choice of the best reference frame. In the worst case, the computational complexity is O(|S| × |M|). In addition, in practice, since not all of the source-coding options can be used in any of the FCC coding modes of the channel-coding candidate set C, the computational complexity may be even lower.

Design and Performance Simulation of the Adaptive RC-NB-LDPC Coding Scheme
This section presents the simulation results, which are described in three parts. The first part presents the performance comparison of the constructed RC-NB-LDPC codes with the DVB-S2 short codes. The second part presents the clustering results by the k-mean++ algorithm. The third part presents the advantages of the adaptive coding scheme in compressed image processing.

Design, Analysis, and Simulation of RC-NB-LDPC Codes
The multi-rate LDPC scheme of DVB-S2 is a typical paradigm of the LDPC codes applied in communication standards, which is designed with full consideration of business diversity requirements and has good adaptability. It supports 11 code rates from 1/4 to 9/10, in both normal and short FEC frame modes. The use of ACM is another significant feature of DVB-S2, which provides more accurate channel protection and dynamic connection adaptability for specific receiving terminals according to specific propagation conditions. While improving the original channel transmission capacity, it greatly expands the service range and directly improves network coverage and the user transmission rate. This provides a reference for the ultimate user experience of B5G in the future.
In this section, we first discuss the construction method of RC-NB-LDPC codes, and some parameters such as code length and code rate all refer to the DVB-S2 standard [49]. In addition, we analyze the decoding threshold of the LDPC code by using the EXIT chart [50]. Finally, we simulate the BER performance of the proposed LDPC codes.

Design of RC-NB-LDPC Codes
The LDPC code in the DVB-S2 standard has two kinds of code length, 64800-bit long code, and 16200-bit short-code, and 11 and 10 code rates are specified for long-code and short-code, respectively. The information bit length, check bit length and code-word length of the LDPC code in the DVB-S2 standard are fixed and cannot be arbitrarily selected. Regardless of long-code or short-code, they have the same code-word length and different information n bit length, respectively. Table 2 shows the specific parameters of six typical rates of short-code in the DVB-S2 standard. Through density evolution optimization analysis, the distribution of variable node degrees for all rate designs is (2,3,4), which can achieve excellent waterfall performance. On the finite fields, the designed mother matrix rate is 7/8, the size is 4 × 32, and the expansion factor is p = 127. The RCNBQC-LDPC code matrix is designed based on the concealment puncturing technique, and other sub-rate matrixes are obtained from the mother matrix. The particular design is shown in Figure 12. Each time the four columns of the matrix of the current rate are deleted, the number of columns at the same time as 2, 3, and 4 is reduced by 1, 2, and 1. The above process makes the designed matrix of each rate have a superior degree distribution, and the structure is similar, so that codec is simple to implement. The specific parameters of the designed code are shown in Table 3. 7/9 (  4/5) 12600 (1, 2, 3) (1, 3599, 12600)/16200 37/45 (  5/6) 13320 (1,2,3,13) (1, 2879, 12960, 360)/16200 (1, 2, 5)/8 Figure 12. RC-LDPC base matrix scatter diagram.

EXIT Chart Analysis of RC-NB-LDPC Codes
The Extrinsic-Information-Transfer (EXIT) chart technique is a graphical tool for estimating the decoding threshold of the LDPC code, which is based on Gaussian approximation and can provide intuitive information for the dynamics and convergence of iterative decoding [50]. The EXIT chart is based on the principle that Variable-Node Processors (VNPs) and Check-Node Processors (CNPs) work together and iteratively make bit decisions, with each half-iteration improving the performance metrics. For VNP and CNP, we can obtain the transfer curve of the input metrics and

EXIT Chart Analysis of RC-NB-LDPC Codes
The Extrinsic-Information-Transfer (EXIT) chart technique is a graphical tool for estimating the decoding threshold of the LDPC code, which is based on Gaussian approximation and can provide intuitive information for the dynamics and convergence of iterative decoding [50]. The EXIT chart is based on the principle that Variable-Node Processors (VNPs) and Check-Node Processors (CNPs) work together and iteratively make bit decisions, with each half-iteration improving the performance metrics. For VNP and CNP, we can obtain the transfer curve of the input metrics and output metrics. The transfer curve of VNP depends on the SNR of the channel. Since the output metric of a processing unit is the input metric of its neighboring processing unit, we can draw two transfer curves in the same coordinate system, with the abscissa and ordinate of a processing unit being exchanged. Such a graph can help predict the code set and decoding threshold for a given variable node and check node degree distribution: the decoding threshold is the signal-to-noise ratio at the focal point of the VNP and CNP transfer curves, which impede the convergence of the two processing units.
The LDPC decoder can be thought of as a bipartite graph. Its parity relationship corresponds to the check nodes. The transmission code-word corresponds to the left n variable nodes. If there is an edge between the i check node and the j variable node in the bipartite graph, the element H i,j in the corresponding check matrix is a non-zero element. The decoding process of the LDPC code is as follows: first, the channel information is used to calculate the initialization information, and then the information between the check node and the variable node is iteratively updated until the information is successfully decoded or the algorithm reached the maximum number of iterations.
As is shown in Figure 13, the mutual information amount of the channel message is represented by I ch , the input mutual information amount of VND is represented by I av , the output mutual information amount is represented by I ev , the input mutual information amount of CND is represented by I ac , and the output mutual information amount is represented by I ec .
processing units.
The LDPC decoder can be thought of as a bipartite graph. Its parity relationship corresponds to the check nodes. The transmission code-word corresponds to the left n variable nodes. If there is an edge between the i check node and the j variable node in the bipartite graph, the element , i j H in the corresponding check matrix is a non-zero element. The decoding process of the LDPC code is as follows: first, the channel information is used to calculate the initialization information, and then the information between the check node and the variable node is iteratively updated until the information is successfully decoded or the algorithm reached the maximum number of iterations.
As is shown in Figure 13, the mutual information amount of the channel message is represented by ch I , the input mutual information amount of VND is represented by av I , the output mutual information amount is represented by ev I , the input mutual information amount of CND is represented by ac I , and the output mutual information amount is represented by ec I . Figure 13. Block diagram of the LDPC decode algorithm.
We assume that the degree distribution is   , while a regular LDPC code rate is . When the noise variance is  (corresponding SNR is Eb/N0) on the AWGN channel, the two EXIT functions are:

Simulation of RC-NB-LDPC Codes
This section performs performance simulation and analysis of the RC-NB-LDPC code. The parameters are as follows: the decoding algorithm is a Mixed-LOG-FFT-BP decoding algorithm, the maximum number of iterations is 20, the modulation mode is BPSK, and the channel is an AWGN channel. Monte Carlo simulation was performed and the following results were obtained. Figures 15 and 16 simulate the bit error rate (BER) performance of the RC-NB-LDPC codes with different code rates. As can be seen from the figure, the constructed LDPC code achieves better waterfall performance in a larger code rate range. Moreover, the constructed RC-NB-LDPC code

Simulation of RC-NB-LDPC Codes
This section performs performance simulation and analysis of the RC-NB-LDPC code. The parameters are as follows: the decoding algorithm is a Mixed-LOG-FFT-BP decoding algorithm, the maximum number of iterations is 20, the modulation mode is BPSK, and the channel is an AWGN channel. Monte Carlo simulation was performed and the following results were obtained. Figures 15 and 16 simulate the bit error rate (BER) performance of the RC-NB-LDPC codes with different code rates. As can be seen from the figure, the constructed LDPC code achieves better waterfall performance in a larger code rate range. Moreover, the constructed RC-NB-LDPC code achieves a performance gain of about 0.2-0.5 dB compared to the LDPC code in the DVB-S2 standard. Figure 17 simulates the frame error rate (FER) performance of the RC-NB-LDPC codes with different code rates. It can be seen that the RC-NB-LDPC code achieves better anti-interference performance in a larger code rate range.
performance in a larger code rate range. Figure 18 simulates the average number of iterations of the RC-NB-LDPC code with a code rate of 1/2. As can be seen from the figure, the higher the

Simulation of the Channel Clustering Algorithm
In this section, we combine the physical factors that affect the state of the wireless channel with the channel bandwidth to form a training sample. The physical factors in the wireless channel are

Simulation of the Channel Clustering Algorithm
In this section, we combine the physical factors that affect the state of the wireless channel with the channel bandwidth to form a training sample. The physical factors in the wireless channel are

Simulation of the Channel Clustering Algorithm
In this section, we combine the physical factors that affect the state of the wireless channel with the channel bandwidth to form a training sample. The physical factors in the wireless channel are represented by the signal-to-noise ratio (SNR), and the value range is [0, 4.5] dB. The transmission bandwidth is [1000, 8000] KHz. The training sample data set consists of a data set that conforms to a Gaussian distribution and contains 2000 data points. The k-means++ algorithm is used to cluster data, and k = 3.The clustering result is shown in Figure 10.
The data points with different symbols in Figure 19 indicate different categories. It can be seen that a series of unordered channel data is divided into three categories by the clustering algorithm. represented by the signal-to-noise ratio (SNR), and the value range is [0, 4.5] dB. The transmission bandwidth is [1000, 8000] KHz. The training sample data set consists of a data set that conforms to a Gaussian distribution and contains 2000 data points. The k-means++ algorithm is used to cluster data, and 3 k  .The clustering result is shown in Figure 10.
The data points with different symbols in Figure 19 indicate different categories. It can be seen that a series of unordered channel data is divided into three categories by the clustering algorithm. Figure 19. Clustering of simulated wireless channel conditions.

The Design of the Adaptive RC-LDPC Coding Scheme
In this section, we take the image transmission as an example, and propose a rate-compatible LDPC coding scheme based on channel clustering, as shown in Figure 20. The basic process of the program is divided into three parts: 1. Channel clustering Using the data set composed of different channel environment parameters and user usage behavior as training data, the k-means++ algorithm is used to divide the wireless channel situation into k different classes.
2. Rate allocation In this section, we take the image transmission as an example, and propose a rate-compatible LDPC coding scheme based on channel clustering, as shown in Figure 20. The basic process of the program is divided into three parts: represented by the signal-to-noise ratio (SNR), and the value range is [0, 4.5] dB. The transmission bandwidth is [1000, 8000] KHz. The training sample data set consists of a data set that conforms to a Gaussian distribution and contains 2000 data points. The k-means++ algorithm is used to cluster data, and 3 k  .The clustering result is shown in Figure 10.
The data points with different symbols in Figure 19 indicate different categories. It can be seen that a series of unordered channel data is divided into three categories by the clustering algorithm. Figure 19. Clustering of simulated wireless channel conditions.

The Design of the Adaptive RC-LDPC Coding Scheme
In this section, we take the image transmission as an example, and propose a rate-compatible LDPC coding scheme based on channel clustering, as shown in Figure 20. The basic process of the program is divided into three parts: 1. Channel clustering Using the data set composed of different channel environment parameters and user usage behavior as training data, the k-means++ algorithm is used to divide the wireless channel situation into k different classes.

Channel clustering
Using the data set composed of different channel environment parameters and user usage behavior as training data, the k-means++ algorithm is used to divide the wireless channel situation into k different classes. We use the set partitioning in hierarchical trees (SPIHT) algorithm as the image compression algorithm. The SPIHT algorithm has extremely low computational complexity and high-quality recovery characteristic and breaks the boundary between coding efficiency and complexity in traditional coding algorithms [51]. It makes reasonable use of multi-resolution characteristics after wavelet decomposition and has good coding performance. The higher compression rate causes the output code stream to be very sensitive to channel errors. Therefore, the worst one of each channel class is selected as the basis for designing the code rate allocation, ensuring that under all channel conditions in the channel class, the compressed code stream is transmitted as accurately as possible. A corresponding code rate allocation scheme is designed according to the worst channel condition in each cluster.

Encode and update the cluster center
When the image is transmitted in the wireless channel, the code rate allocation scheme is adaptively adjusted by the clustering of the current channel data, and the corresponding source and channel coding are performed by using the code rate allocation scheme. Finally, the real-time data of the channel at this time is used as training data to update the cluster center.

Image quality evaluation
We evaluate the performance of the transmission scheme by comparing the quality of the reconstructed image with the original image. The evaluation methods include subjective evaluation and objective evaluation.
Subjective evaluation is a direct and important evaluation method for subjective judgment by observing and comparing the difference between the reconstructed image and the original image. However, in practice, individual differences in observers are likely to cause subjective bias. Moreover, subjective evaluation often requires many labor and material resources, and it is impossible to perform real-time detection.
The objective evaluation method usually uses the error between the reconstructed image and the original image to measure the quality of the reconstructed image.
where f (i, j) and f (i, j) represent the pixel values of the original image and the reconstructed image at (i, j), respectively, and M × N is the size of the image. MSE reflects the quality of image restoration. It can be seen that the smaller the MSE value, the smaller the deviation between the reconstructed image and the original image, and vice versa. The formula for calculating PSNR is: PSNR = 10 log 10 255 MSE (17) PSNR and MSE are essentially the same. The larger the PSNR value, the smaller the deviation between the restored image and the original image, and vice versa. PSNR is often viewed as a quality metric and MSE as a distortion metric.

Reconstructed image quality simulation
In this paper, we select the "Lena" 512 × 512 grayscale image as the test image. The source-coding method is the SPIHT algorithm, the channel-coding method is rate-compatible LDPC code, and the channel model is the AWGN channel. We select three different channel conditions as test conditions. The specific parameters of the channel are shown in Table 5. We performed a performance analysis comparison of the following three transmission schemes: • Scheme 1, the fixed-rate transmission scheme. That is, the channel coding uses a fixed code rate of 3/4 for three types of test channels in this paper.
• Scheme 2, the adaptive-rate transmission scheme. That is, after channel clustering, the corresponding rate is selected for each type of test channel. Corresponding to three types of test channels, the coding rates used in this paper are 1/2, 4/5, and 7/8, respectively.
• Scheme 3, the adaptive-rate transmission scheme with UEP. According to different parts of the code stream that have different effects on image recovery, we adopt different levels of the channel protection mechanism, that is, the high-level protection for the important code stream and the low-level protection for the secondary code stream. Corresponding to the three types of test channels, the coding rate groups in this paper are (1/2, 3/4), (2/3, 5/6) and (3/4, 7/8), respectively.
The scheme affects the different degrees of the restored image according to different parts of the code stream, adopts different levels of channel protection mechanisms, protects the important code stream to a high degree, and protects the secondary code stream to a low degree to achieve different degrees of differentiation.
In this paper, the PSNR of the reconstructed image is chosen as the criterion for evaluating image quality. The simulation results are shown in Table 6. The "fail" in the table indicates that the decoding is unsuccessful or the reconstructed image quality is extremely poor due to severe error. In order to ensure the correctness of the results, we repeat the transmission process 50 times and take the average result. As shown in Table 6, with the fixed bit rate scheme, in the case of poor channel conditions, a decoding failure occurs. This is because the fixed bit rate employed does not provide sufficient channel protection under poor conditions. For image compression streams, if the error occurs at a critical location and there is no error retransmission or other means of recovery, it will result in decoding failure or poor reconstructed image quality.
It can also be seen that compared to scheme 1, scheme 2 achieves an average gain of about 2 dB. The reason is that scheme 2 adopts different code rates according to different channel conditions. When the channel condition is poor, low code rate coding is used to enhance channel protection. When the channel environment is good, high code rate coding is used to improve the overall efficiency of the system.
In addition, by comparing the data of scheme 2 and scheme 3, we can also see that since scheme 3 adopts UEP, the reconstructed image quality can be further improved compared with scheme 2, and the PSNR of the reconstructed image can obtain an average of about 0.5 dB.
At an image compression ratio of 0.5, Figure 21 shows reconstructed images obtained by using the three different schemes under the conditions of the channel environment of Class 2. Image (a) is the original image, and image (b), image (c) and image (d) are reconstructed images using the three schemes, respectively. We can see that the image quality of image (b), image (c) and image (d) is sequentially improved. Moreover, image (d) and the original image (a) are almost identical. At an image compression ratio of 0.5, Figure 21 shows reconstructed images obtained by using the three different schemes under the conditions of the channel environment of Class 2. Image (a) is the original image, and image (b), image (c) and image (d) are reconstructed images using the three schemes, respectively. We can see that the image quality of image (b), image (c) and image (d) is sequentially improved. Moreover, image (d) and the original image (a) are almost identical.

Conclusions
For the B5G mobile system, this paper first proposed a construction method of the RC-NB-LDPC code, which is realized by combining masking and puncturing technology. The RC-LDPC code constructed by the method has an easy hardware implementation of the check matrix structure and better waterfall performance in a larger code rate range. Compared with the LDPC codes in the DVB-S2 standard, the RC-NB-LDPC codes achieved a performance gain of about 0.2-0.5dB, which is suitable for data transmission. Then, according to the influencing factors of the wireless channel, this paper proposed using the k-means++ algorithm to cluster the wireless channel environment to obtain the code rate allocation scheme. Finally, this paper took compressed image transmission as an example, applied the clustering algorithm to the fast classification of channel

Conclusions
For the B5G mobile system, this paper first proposed a construction method of the RC-NB-LDPC code, which is realized by combining masking and puncturing technology. The RC-LDPC code constructed by the method has an easy hardware implementation of the check matrix structure and better waterfall performance in a larger code rate range. Compared with the LDPC codes in the DVB-S2 standard, the RC-NB-LDPC codes achieved a performance gain of about 0.2-0.5 dB, which is suitable for data transmission. Then, according to the influencing factors of the wireless channel, this paper proposed using the k-means++ algorithm to cluster the wireless channel environment to obtain the code rate allocation scheme. Finally, this paper took compressed image transmission as an example, applied the clustering algorithm to the fast classification of channel environment, combined the characteristics of the SPIHT code stream structure, and studied the problem of compressed image transmission in the wireless channel. In the process of transmitting the compressed image code stream, the proposed adaptive-rate transmission scheme can effectively utilize the limited bandwidth resources of the channel to ensure reliable transmission of image information, and obtain higher reconstructed image quality than the fixed code rate-coding scheme. Further enhancements can be obtained by combining the UEP strategy. Through simulation, the adaptive-rate transmission scheme can achieve a performance improvement of about 2 dB over the fixed-rate transmission scheme. Moreover, using the adaptive-rate transmission scheme with UEP, the PSNR of the reconstructed image can be additionally increased by about 0.5 dB on average. This paper only provides an adaptive channel-coding scheme, but the other advanced source-coding techniques can be used to further design a better joint source channel-coding scheme. In addition, channel-coding technology can be combined with modulation, power control and other technologies to design a more complete adaptive transmission scheme.