An Optimal Bit Allocation Scheme Based on Genetic Algorithm for Cooperative Spectrum Sensing in Cognitive Radio NetworksAn Optimal Bit Allocation Scheme Based on Genetic Algorithm for Cooperative Spectrum Sensing in Cognitive Radio Networks

In cooperative spectrum sensing (CSS), there are two ways for the secondary users (SU) to deliver their sensing data or local decisions to the information fusion center (FC): hard-decision (HD) and soft-decision (SD). In HD or SD, the number of bits transmitted by the SUs is always the same and static. However, considering the differences of different SUs in the environment, remaining energy, distances to the FC, and so on, the number of bits transmitted by different SUs should be different. Besides, the reliability of transmitted data by different SUs to the FC is also different. Therefore, this paper proposes an optimized bit allocation scheme based on the genetic algorithm (GA-BAS) for CSS in cognitive radio networks (CRNs). In the proposed scheme, the number of bits transmitted by each SU is different and would be allocated by the FC according to GA-BAS algorithm, and the FC would fuse the transmitted data by each SU with an allocated weight, which could represent the reliability of the SU. Firstly, a simple quantization scheme based on the sub-partitioning of the local decision space is designed to quantify the raw sensing data. Then, the objective function of the overall detection probability and the objective function of energy consumption about the number of allocated bits and the value of the allocated weight of each SU are derived. Finally, the number of allocated bits of each SU would be optimized by an improved genetic algorithm, and an overall decision rule would be given to obtain a global decision. Simulation results show that the proposed scheme (GA-BAS) gets a tradeoff between energy consumption and detection performance. In addition, the proposed algorithm achieves better detection performance, which is close to that of the equal gain combining scheme (EGC), but consumes less energy.


Introduction
In 1999, Doctor J. Mitola proposed the concept of cognitive radio (CR) for the first time [1]. The primary purpose of CR is to make full and efficient use of the precious radio spectrum [2]. To achieve high spectrum utilization, the spectrum allocation scheme changed in CRNs [3]. The SU can utilize the spectrum allocated to the primary users (PU) when the allocated spectrum is idle [4]. CR can be used to utilize the idle spectrum dynamically and is an important means to improve spectrum utilization, therefore, it has received widespread attention and has been studied widely. To avoid causing interference to PU, it is necessary and important to adopt spectrum sensing for the detection of the presence of the PU in a CRN [5,6]. When a PU is found accessing the spectrum, SUs must stop using this spectrum in time. Cooperative spectrum sensing (CSS) is proposed to improve the detection performance because spectrum sensing is not always reliable and real-time due to shadowing, fading, multipath, and time-diversity [7][8][9].
Energy detection, match filter, and cyclostationary detection are three important, efficient, and popular CSS methods [10]. Energy detection is easy to implement and has a simple calculation. Besides, it doesn't need any prior information of the primary signal. But noise uncertainty has a serious impact on it. Match filter has a good detection performance, but it needs all prior information of the primary signal. Cyclostationary detection has an optimal detection performance, but its algorithm is too complex. Because the energy detection method doesn't need to use any prior information of the primary signal and it's easier to apply than other methods. Therefore, this article uses energy detection.
Fusion systems are generally divided into three types, respectively, the centralized fusion system, the distributed fusion system and the hybrid fusion system [11][12][13]. Usually, there is a fusion center (FC) in a CRN. Firstly, each SU transmits its sensing data to the FC. Then, FC combines all received sensing information to make a final global detection decision according to some fusion methods and rules. In the centralized fusion system, the sensing information (original sensing data) perceived by SUs can be directly transmitted to the FC [14]. Researches show that the centralized data fusion system can obtain the best detection performance due to less information loss. However, the demand for the bandwidth of the detection system is high, because a large amount of information needs to be transmitted. At the same time, the centralized data fusion system consumes a lot of energy, which shortens the system's lifetime. Compared with the centralized data fusion system, the distributed data fusion system has advantages of higher reliability, smaller communication costs, stronger survivability, and shorter detection decision time. Therefore, the distributed data fusion system has attracted more attention in the research field and the CRN considered in this paper is a distributed data fusion system.
The distributed data fusion system in CRN is also different in information transmission according to the actual scenarios. There are mainly two ways for each SU to deliver its sensing data or local decisions to the FC: hard-decision (HD) and soft-decision (SD) [15]. In HD, each SU only transmits one decision value to the FC, which represents the local decision made by each SU. Bit 0 represents the absence of the PU and bit 1 represents the presence of the PU. In SD, unlike HD, each SU would quantize the raw data with the help of multi-bit quantization methods firstly and transmits more than 2 bits of information to the FC (Bits transmitted can represent the quantized information of the raw data). In HD or SD, however, the number of bits transmitted by the SUs is always the same and static. However, considering the differences of different SUs in the environment, remaining energy, distances to the FC, and so on, the number of bits transmitted by different SUs should be different. Besides, the reliability of transmitted data by different SUs to the FC is also different. At present, bit allocation algorithms are widely used in sensor networks, such as underwater wireless sensor networks, cognitive radio networks and so on [16][17][18]. Therefore, this paper proposes an optimized bit allocation scheme, by which the number of bits transmitted by each SU could be different and the FC would fuse the transmitted data with allocated weights.
Energy consumption is a very important problem that must be considered in a CRN with energy constraints. In a CRN, the energy consumption includes the energy for sensing, the energy for data processing and transmission, and the energy for information fusion, in which the energy for data transmission is the main energy consumption. Most approaches have been proposed to reduce the energy consumption of the system by reducing the transmitted data and shortening the transmission distances. Clustering is a popular and important method to reduce energy consumption by shortening the transmission distances. In addition, HD reduces energy consumption by decreasing the number of transmitted bits at the cost of detection performance. Compared with HD, SD consumes more energy because it transmits more bits to the FC [19]. The scheme proposed in this article would get a tradeoff between energy consumption and detection performance. Moreover, the algorithm proposed in this paper is compared with other algorithms (including the centralized fusion, the traditional hard fusion and the equal gain combination (EGC) [20] scheme) in terms of detection probability and energy consumption. The EGC algorithm is a soft decision fusion algorithm. The idea of the EGC algorithm is that each SU first makes a multi-bit local soft decision based on its detection signal. Then, the local decision is transmitted to the FC. Finally, FC uses the method of equal weight fusion and comparison to give the global decision result.
In this paper, we propose an optimized bit allocation scheme based on the genetic algorithm (GA-BAS) for CSS in CRNs. In the proposed scheme, the number of bits transmitted by each SU could be different and would be fused by the FC with an allocated weight. Firstly, a simple quantization scheme based on the sub-partitioning of the local decision space is designed to quantify the raw sensing data. Then, the objective function of the overall detection probability and the objective function of energy consumption about the number of allocated bits of each SU are derived. Finally, the number of allocated bits of each SU would be optimized by an improved genetic algorithm, and an overall decision rule would be given to obtain a global decision. In comparison with previous approaches, the novelty and contributions of this paper are summarized as follows:  A quantization scheme based on the sub-partitioning of the local decision space is designed to quantify the raw sensing data. The corresponding search can be conducted according to the quantization table in this paper.  Considering the differences of different SUs in the environment, remaining energy, distances to the FC, and the reliability of the SU and so on, an optimized bit allocation scheme combined with improved genetic algorithm for CSS in CRNs is presented, in which the number of allocated bits of each SU would be optimized.  The ultimate purpose of theoretical research is practical application. Therefore, the nonideal communication channel is taken into consideration. A target detection model under non-ideal channels is established.  Extensive numerical simulation experiments of GA-BAS algorithm are performed to demonstrate its advantages and disadvantages. Besides, comparisons with other methods, including the centralized fusion, the conventional hard fusion, the equal gain combining scheme (EGC), are analyzed by simulation results.
The remainder of this paper is organized as follows. The system model is introduced in Section 2. In Section 3, we introduce a simple quantization scheme based on the sub-partitioning of the local decision space, and a quantization table is also shown in this section. Section 4 derives two objective functions firstly, and then an optimized bit allocation scheme based on an improved genetic algorithm is proposed in this section. Simulation results and performance evaluations are presented in Section 5. Section 6 concludes this paper.

Materials
Let's assume that a CRN with a PU, SUs, and one FC. Besides, SUs are powered by batteries and have their initial energy.
denotes the th SU's initial energy, where ∈ {1, 2, … , }. Each SU performs local spectrum sensing to acquire data and then transmits the bits allocated by the FC according to the proposed bit allocation scheme to the FC. The FC combines all the received data with corresponding weights to make a final decision on the presence or absence of the PU.

Spectrum Sensing
The detection of the absence or presence of the PU can be regarded as a binary hypothesis problem, and it can also be called binary detection [21]. In a binary hypothesis testing problem, the test result is one of two possible hypotheses, in which 1 represents the presence of the PU and 0 represents the absence of the PU.
The received signal at the th SU under 0 and 1 can be expressed as (1) where ( ) represents the received data at time of the th SU, ( ) is the primary signal transmitted from the PU, ( ) is the additive white Gaussian noise (AWGN) of the th SU, and ℎ ( ) denotes the gain of the channel between the PU and the th SU. The gain of the channel describes the attenuation factor of the signal. Besides, it is assumed that channels corresponding to different SUs are independent.
When the PU does not exist but FC makes a final decision that the PU is present because of noise interference, it is called false alarm detection. When the PU exists and is detected by FC, it is called correct detection.

Energy Detection
The spectrum sensing techniques mainly include, match filter, cyclostationary detection and energy detection energy detection [22]. Compared with other detection methods, energy detection has the advantages of being easy to implement and not requiring any prior information of the detection signal. Therefore, this article uses energy detection.
By energy detection [23], the received data of the th SU after times of sampling can be obtained: where is the number of samples. To facilitate further analysis, we would make some assumptions here. In this paper, we assume that AWGN of each SU is the same, its mean value is 0 and its variance is 2 . Moreover, assume that the primary signal satisfies the independent and identically distribution, and let its mean value be 0 and its variance be 2 . Hence, according to the central limited theorem and literature [23], when is large enough, the test statistics follows: where is the ratio of the signal to the noise (SNR) and = 2 2 ⁄ , and ( , 2 ) is a normal distribution with mean value and the variance 2 .

Energy Consumption
In the proposed scheme, the energy consumption of all SUs must be considered, we have assumed that SUs are powered by batteries. Besides, the energy consumption of each SU mainly includes three parts: the sensing, the data quantization, and the data transmission [14].
The first part is the energy consumption for sensing. Let the energy consumption for the sensing of the th SU be , , then it can be expressed as: where , represents the power consumed by the th SU for signal detection, and is the time for signal detection.
The second part is the energy consumption for the data quantization. In this paper, the energy for the data quantization of each SU be a small constant. Because each SU would hold a quantization table after the first quantization, which will be introduced in Section 3. When the th SU obtain by energy detection, it would only need to look up the table according to the number of bits allocated by the FC to decide the quantized data and transmits it to the FC. Therefore, the energy for the data quantization of each SU be a small constant. Considering that it is a small constant and has no much effect on the whole energy consumption, we would not take it into the formulation.
The third part is the energy consumption for data transmission. , represents the energy consumption for the data transmission from the th SU to the FC by signal hop, and according to [24], it can be expressed as where represents the number of bits transmitted to the FC by the th SU and the value of which is decided by GA-BAS scheme, which will be introduced in Section 4. represents the energy consumed to receive or transmit one-bit data. and represent the gain of the signal amplification, the value of which depends on the model of the transmission amplifier. is the distance from the kth SU to the FC. and ℎ ℎ is a threshold of the distance. When < ℎ ℎ , namely when those SUs close to the FC, 2 represents the free space path loss, and when ≥ ℎ ℎ , namely those SUs away from the FC, 4 represents the multipath fading loss. To facilitate understanding, the network scenario of a CRN is shown in Figure 1. According to the expressions (4-5), the main energy consumed by the th SU in the whole CSS process can be expressed as Besides, the energy consumed by all SUs in a CRN can be expressed as It should be noted that when the sensing time is fixed and , of each SU is the same, the energy consumption of each SU or all SUs only depends on the number of transmitted bits and the distance to the FC. When the position of SUs and FC are fixed, then the distance is also a fixed value, and all energy consumption is only determined by the number of each SU's transmitted bits. For the definition of some main symbols of Section 2, please refer to Table 1. Table 1. Definitions of some of the major symbols in Section 2.

Symbol Definition
represents the initial energy of the th SU

1 Local Quantization Scheme Based on The Sub-partitioning of The Local Decision Space
If one SU is allocated to one bit or ( ≥ 2) bits by the FC according to the GA-BAS algorithm, which will be introduced in the next section, then the SU must quantize the raw sensing data with the help of quantization methods. In this paper, we proposed an easy local quantization scheme based on the sub-partitioning of the local decision space, which satisfies the Neyman-Pearson criterion [26]. Also, a quantization table can be maintained by each SU after the first quantization.
When the number of quantization bits is , = 2 is the number of quantization levels. The local test statistics would be compared with a set of quantization thresholds. Notice that, is obtained according to the square of the detection value, therefore must be greater or equal to 0. Let where φ (•) represents the quantization process at the th SU, ℎ , ∈ [0, ] denotes a binary codeword. Let , be the quantization data of the th SU and , be the inverse quantization data at the FC. When the FC receives the quantized data from the th SU, it would perform the inverse quantization process to obtain , . It is possible that , is not be equal to , due to the imperfect channels. Figure 2. The quantization schemes [25].
Firstly, we can get ℎ 2 ⁄ , according to the Neyman-Pearson criterion. Assume that is the given false alarm probability of the th SU under the Neyman-Pearson criterion, which can be represented by According to (3), satisfies ( 2 , 2 4 ⁄ ) under the hypothesis 0 . Therefore, when , = , the threshold 0 can be obtained and expressed as: where −1 ( ) is the inverse function of ( ), ( ) obeys the standard normal distribution.
is the central value among the quantization thresholds, therefore, the quantization range of the th SU is divided into two sub-ranges: [0, 0 ) and [ 0 , +∞). And the local decision space is partitioned into two exclusive regions, Ω 0 and Ω 1 , which If = 1, then the quantization rule is After obtaining ℎ 2 ⁄ , , we can get other quantization thresholds to the th SU according to where ( ) is the distribution function of , and satisfies ( 2 , 2 4 ⁄ ) under the hypothesis 0 and satisfies ((1 + ) 2 , 2(1 + ) 2 ⁄ ) under the hypothesis 1 according to (3). Also, , is the given false alarm under the Neyman-Pearson criterion and it can be replaced by here. , is the detection probability and can be given by: And ( ) can be expressed by the expression (15). Let ( 0 ) = ( 1 ) = 0.5, that is, there is no prior information of hypothesis 0 and 1 . The values of 0 ( 0 ) and 1 ( 0 ) can be obtained from the expressions (16) and (17), respectively.
Moreover, the value of , is the centroid of the region between interval [ ℎ −1, , ℎ , ], which can be calculated by expression (18).
At this time, both , and ℎ , of the th SU can be calculated.
According to (13), for a -bit quantization, the local decision space of the th SU would be partitioned into 2 subregions. Let us take as 2 for example.
When is 2, the local decision space of the th SU would be partitioned into four subregions. Let four subregions be Ω 00 , Ω 01 , Ω 10 , and Ω 11 respectively. The local decision space diagram is shown in Figure 3. And ℎ 1, is the threshold between Ω 00 and Ω 01 , ℎ 2, is the threshold between Ω 01 and Ω 10 , and ℎ 3, is the threshold between Ω 10 and Ω 11 . According to (10) and (13), the calculation steps of ℎ 1, , ℎ 2, and ℎ 3, are as follows.

Symbol Definition the number of quantization bits φ (•)
the quantization process at the th SU ℎ , a binary codeword the given false alarm probability of the th SU under the Neyman-Pearson criterion ( ) the distribution function of , false alarm , detection probability

The Optimized Bit Allocation Scheme
In this section, two functions, including the function of the overall detection probability and the function of the system's energy consumption, are derived. Then, the problem of finding the optimal bit allocation scheme will be transformed into the problem of multi-objective optimization. Finally, the number of allocated bits and the corresponding weights to each SU would be optimized by an improved genetic algorithm, and an overall decision rule would be given to obtain a global decision.

The Function of The Overall Detection Probability
Let = ( 1 , 2 , … , ) represent the allocated bit vector, in which represents the number of bits allocated to the th SU by the FC. Assume that the maximum of the number of bits allocated to each SU is , which would be decided by the system's bandwidth. Besides, let = ( 1 , 2 , … , ) represent the allocated weight vector, in which represents the value of the weight allocated to the th SU by the FC. At the same time, it is necessary to satisfy that the sum of weights allocated to all SUs is 1, namely ∑ =1 = 1.
According to the quantization scheme introduced in Section 3, we can get ℎ 2 ⁄ , = 0 , and the probability of mass function of , can be given by: where , represents the probability of the bit transmission error of the th SU. , , is the Hamming distance between ℎ , and ℎ , , and ℎ , is the -bit sequence corresponding to , . The sequence refers to the quantized bits in Table 3.
In the FC, the decision rule can be given by where is the threshold calculated with the help of the global false alarm probability at FC according to the Neyman-Pearson criterion. The method of solving the threshold can refer to the literature [27].
Then, the distribution of can be derived by using the convolution of the probability of mass functions of the discrete random variables as where , (•) represents the probability of mass function of the discrete random variable , and ∑ =1 = 1. When the number of bits and the value of weights is allocated to each SU, the probability of detection can be obtained by where is the randomization parameter.

The Function of The Energy Consumption
According to the expressions (4), (5), and (6) in the energy consumption model introduced in Section 2, the energy consumption of the th SU in a round of target detection can be given by , = , × + ( + /am ( 2 ) 2 ( ℎ ℎ , ) ), where /am is and ( 0 , ) is Assume that the location of the th SU is ( , ), then, all SUs' energy consumption in a round of target detection can be obtained by If , is same for all SUs, and can be represented by , then (26) can be simplified to

The GA-BAS Algorithm
The essence of the proposed algorithm in this paper is to solve multi-objective optimization, and the enumeration method is the optimal algorithm. Because it can exhaust every possible situation to find the global optimal solution. However, its complexity increases exponentially as and K change. This does not meet the real-time requirements of spectrum sensing in practical applications. At present, many intelligent algorithms are proposed to solve the target Optimization problem or the target Optimization problem with limited conditions, including Particle Swarm Optimization (PSO) [28], Ant Colony Algorithm (AG) [29], Genetic Algorithm (GA) [30] and so on. A large number of research results show that PSO algorithm is mainly applicable to the optimization of unimodal or nonpathological objective functions. Therefore, PSO algorithm is not applicable to the multi-objective optimization problem proposed in this paper. AG algorithm is a simulation optimization algorithm that simulates the foraging behavior of ant colonies. However, AG algorithm converges slowly. Compared with PSO algorithm and AG algorithm, GA algorithm is more likely to obtain a global optimal solution due to its unique process of crossover and mutation, which makes the population have a high diversity.
Different from the traditional GA algorithm, the GA-BAS algorithm proposed in this paper adopts integer coding in order to better accord with the proposed scheme. In terms of individual selection, we used the congestion degree proposed in literature [31] to calculate, which could better select the optimal individual. In addition, in order to enhance the richness of individuals, the uniform crossover operator of the traditional GA algorithm is improved in this paper, and the mutation position and probability of individuals are set reasonably. The GA-BAS algorithm designed in this paper is described as follows.
The idealized purpose of this paper is to find the optimal bit allocation plan to maximize the system's detection probability and minimize the system's energy consumption, which could be expressed mathematically by Here, according to the analysis of (31), we can convert the problem of finding the optimal bit allocation plan into a multi-objective optimization problem with a constraint. If more bits are allocated to each SU, the system's detection probability would be higher, but the whole system's energy consumption would be larger. Therefore, it is obvious that the two objectives of reducing the system's energy consumption and increasing the system's detection probability are contradictory. In this situation, there is usually not the best solution to satisfy each objective function at the same time.
Therefore, the solution found by some algorithms is usually called a non-dominated solution and is known as a Pareto solution. The set of several Pareto solutions obtained by some intelligent algorithms is called a Pareto optimal solution set. Compared with any solution outside the Pareto optimal solution set, solutions in this set could get a better result for one objective at least. And each solution in this the Pareto optimal solution set could not be comparable with the others. In this paper, we use the proposed GA-BAS algorithm to achieve better detection probability and verify that it has less energy consumption than some of other algorithms.
Assume that the maximum of the number of bits could be allocated to each SU is , namely ≤ for = 1, 2, … , . Theoretically, the enumeration method is the best method for the multiobjective optimization problem proposed in this paper, because it can compare all possible situations and find the Pareto optimal solution set. However, its complexity increases exponentially with and , which does not meet the requirement for real-time. In recent years, a genetic algorithm (GA) has been extensively adopted to solve multi-objective optimization problems. Because of the existence of crossing and mutating operations, GA has many advantages such as multi-directional and global search, fast search, and convergence, and so on. Therefore, we proposed an improved GA algorithm to solve the multi-objective optimization problem proposed in this paper. The specific steps are as follows.
The first step is coding. Considering that the value of allocated bits to each SU is an integer.
Therefore, integer coding is adopted and the coding number (0, 1, … . , ) represents the number of bits allocated to each SU. The weight allocated to each SU is a decimal, which is less than 1 and satisfies ∑ =1 = 1 . The weight of the th SU can be obtained and normalized, and the corresponding steps can refer to the expressions (30)(31). In order to ensure the coding consistency in this paper and optimize and , integer coding is also adopted for coding . Considering that we would optimize and , the length of an individual is 2 , in which the first half represents the possible solution of and the latter half represents the possible solution of .
The second step is initialization. According to the constraint made in the previous paragraph, the maximum number of allocated bits of each SU is . Then, two possible populations of , with set to 3 and K set to 6 are shown in Table 4. And can be calculated and normalized, referring to expressions (30)(31). Moreover, a possible solution is called an individual, and a vector includes several possible solutions is called a population. The third step is selection. Firstly, elimination principle, assuming that there are individual X and individual Y. If the value of each objective function of individual Y is less than or equal to the value of each objective function of individual X. Then individual Y will be marked as eliminated. Furthermore, secondly, considering that the two objectives of overall detection probability and whole system's energy consumption are contradictory, in this paper, a crowding distance calculation is cited [31]. According to the constraints to replace those different genes in the two-parent sequences. Table 5 is an example of the single-point crossover operator and the improved uniform crossover operator. In these two examples, let K be 12. It can be seen from Table 6  The fifth step is a mutation. The mutation operator will generate a new individual by randomly selecting a position in the parent sequence and randomly modifying its encoded value. The number of coding values participating in the mutation is determined by (33).
Where, mu is used as a custom parameter and the value of this parameter is set to 0.03. The ceil function is the rounding algorithm. If the former code number is 2, then the mutated code number would be 0, 1, or 3. In the last step, repeat the above steps until a given error or the maximum number of iterations is satisfied. For the definition of some main symbols of Section 4, please refer to Table 6. the Hamming distance between ℎ , and ℎ ,

Experiments
In this section, we will use the Monte Carlo method to numerically simulate the GA-BAS algorithm proposed in this chapter, and at the same time, analyze the simulation results. Suppose that the monitoring area is square (100m×100m). The number of local sensor nodes is 6, namely K=6. All local sensor nodes are deployed in this area and their locations are (0m, 0m) (20m, 30m), (50m, 100m), (70m, 10m), (70m, 50m) and (100m, 60m) respectively. The FC is at (50m, 50m). Besides, we make the th SU's probability of false alarm and the probability of error bit , in the imperfect channel be 0.2 and 0.05 respectively, and they are the same for each local sensor for convenience. When , = , the threshold 0 can be obtained and used to calculate the corresponding detection probability. Firstly, Figure 4 shows the theoretical curve and the simulated curve for the probability of detection as a function of SNR, from which we can find that the theoretical analysis is consistent with the extensive simulation results. obeys the standard normal distribution. According to the normally distributed Z-valued query table, we can get 0.2 ≈ 0.84. In addition, the corresponding confidence interval can be obtained as [25.30,34.69] in this case. Because the Centralized algorithm collects the most complete data, its detection performance is higher than that of other algorithms. In addition, Con/Hard algorithm collects the least data information and generally has the worst detection performance. Therefore, it is more meaningful to compare the detection probability between the proposed algorithm and the soft decision EGC algorithm. It can be intuitively found from the figure that although the detection performance of the algorithm proposed in this chapter is slightly lower than the EGC algorithm with 3 quantization bits, it is far superior to the EGC algorithm with 2 quantization bits. However, it can be seen from Figure 7 that the energy consumption of the algorithm proposed in this chapter is much lower than the EGC algorithm with a quantization bit number of 3, but it is like the EGC algorithm with a quantization bit number of 2.   Figure 7 shows the energy consumption of the GA-BAS algorithm, the Con/Hard algorithm, the EGC algorithm, and the Centralized algorithm. Assumed that the initial energy of each sensor node is 0.5J. And the number of local sensor nodes is 6, therefore, the initial total energy is 3J. After each round of testing, the overall energy is constantly decreasing. In Figure. 7, it can be seen from the figure that the Con/Hard algorithm has the smallest energy consumption and the Centralized algorithm has the largest energy consumption. This is because the Con/Hard algorithm transmits the smallest number of bits, and the Centralized algorithm transmits the most information. The energy consumption of the GA-BAS algorithm and the EGC algorithm with a local decision bit number of 2 is always less than the energy consumption of the EGC algorithm with a local decision bit number of 3, because in the GA-BAS algorithm, when is equal to 3, at most × bits are transmitted to the FC in every round of detection. There is almost no difference in energy consumption between the GA-BAS algorithm and the EGC algorithm with 2 local decision bits, but we can find that the GA-BAS algorithm has better detection performance than the EGC algorithm with 2 local decision bits. It should be noted that the curve shown in this figure is pseudo-linear (The curve is approximately linear). This is because the number of sensor nodes is small, and the difference in total transmitted bits is small. Therefore, when the abscissa is dense, the energy consumption curve tends to be linear.

Conclusions
This paper proposes an optimized bit allocation scheme based on the genetic algorithm for CSS in cognitive radio networks. In the proposed scheme, the number of bits transmitted by each SU is different and would be allocated by the FC according to GA-BAS algorithm, and the FC would fuse the transmitted data by each SU with an allocated weight, which could represent the reliability of the SU. Firstly, a simple quantization scheme based on the sub-partitioning of the local decision space is designed to quantify the raw sensing data. Then, the objective function of the overall detection probability and the objective function of energy consumption about the number of allocated bits and the value of the allocated weight of each SU are derived. Finally, the number of allocated bits of each SU would be optimized by an improved genetic algorithm, and an overall decision rule would be given to obtain a global decision. Simulation results show that the proposed optimal bit allocation scheme gets a tradeoff between energy consumption and detection performance. Furthermore, the algorithm could get a good detection performance, which is close to that of EGC but consumes less energy. At present, the algorithm has not been applied to real systems. The application of this algorithm in real systems is also one of the future tasks.

Declarations
Availability of data and materials Not applicable.

Figure 1
The network scenario of a CRN.

Figure 3
The sub-partitioning gure in the 2-bit decision case.  Comparison of energy consumption of different algorithms (SNR=-5dB).