Estimation of Distribution of Primary Channel Periods Based on Imperfect Spectrum Sensing in Cognitive Radio

Spectrum occupancy modeling plays an important role in improving the performance of Cognitive Radio (CR) systems, because most of the methods to improve Dynamic Spectrum Access (DSA) performance need to make assumptions about the channel periods’ distribution. However, Secondary Users (SUs) cannot directly observe the accurate channel periods’ distribution due to the sensing errors caused by noise, which will lead to inaccurate analysis of transmission efficiency or throughput. In this paper, we analyze the influence of different types of sensing errors on the observed channel periods, and establish the relationship between the Probability Mass Function (PMF) of idle periods under Imperfect Spectrum Sensing (ISS) and the results under Perfect Spectrum Sensing (PSS). In addition, we derive a closed-form expression for estimating the PMF of channel periods from the sensing results under ISS. Simulation results show that the proposed estimation method is more accurate than the existing methods, and is not affected by the sensing period, channel mean period and sensing error probability.


I. INTRODUCTION
With the rapid development of wireless communication technology, the scarcity of spectrum resources is becoming more and more serious. The traditional spectrum resource allocation strategy is usually static [1]. Spectrum is allocated to Primary Users (PUs) to ensure that the normal communication of PUs is not disturbed. Many radio spectrum measurements show that most of the radio spectrum resources allocated to PUs are not fully utilized in most of the time [2]. In addition, some studies show that spectrum occupancy varies greatly in different cities and is highly correlated with application scenarios [3]. Therefore, Dynamic Spectrum Access (DSA) technology based on the concept of Cognitive Radio (CR) is proposed to solve the problem of low utilization of spectrum resources [4].
The associate editor coordinating the review of this manuscript and approving it for publication was Pietro Savazzi .
To avoid too much interference to PUs, SUs are required to perform spectrum sensing on the primary channel periodically to observe the working state of the PU. When no sensing error occurs in the process of spectrum sensing, SU can achieve Perfect Spectrum Sensing (PSS). However, in practical applications, sensing errors usually occur in low Signal to Noise Ratio (SNR) scenarios, because the accuracy of sensing technology is affected by noise [5]. Therefore, the SU usually works in Imperfect Spectrum Sensing (ISS) scenarios due to sensing errors [6].
In recent years, some methods to improve the performance of CR systems have been proposed with considering the influence of ISS. In [7], the authors proposed a rule to search the optimal channel under ISS to maximize the SU's throughput. In [8], the authors analyzed the achievable the SU's reliable communication rate affected by sensing errors.
The SU's performance, such as transmission efficiency and throughput, is affected by the PU's activity mode [9]. VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ In [10], the authors assumed that the duration of channel idle and busy states follows the exponential distribution.
In addition, some literatures use continuous time Markov chains to model channel states [11]. However, many measurements show that it is unrealistic to use a specific distribution to accurately model the channel idle and busy periods in most scenarios [12]. Therefore, obtaining accurate channel statistics plays an important role in improving the performance of CR systems. In [13], the authors used Probability Mass Function (PMF) to model the spectrum occupancy.
In [14]- [16], the authors proposed some methods to estimate the channel mean period, which can accurately estimate the real channel mean period according to the sensing results under ISS. In [17], the authors analyzed the relationship between the observed results of channel statistics under PSS and the real statistics, and proposes a set of closed expressions to establish the relationship between the PMF of channel periods under PSS and the Cumulative Distribution Function (CDF) of channel periods.
In the existing literatures, there are many limitations in the methods to estimate the distribution of channel periods, which cannot be widely used in most scenarios. In [6], the authors proposed a closed-form expression to estimate the PMF of the channel periods, and the time required for calculation is negligible. However, this method ignores the influence of the sensing errors that occur at the edges of adjacent periods and assumes that each period may have an infinite number of the continuous sensing errors (i.e. the durations of all periods are infinite), resulting in low accuracy in many scenarios. In [18] and [19], the authors proposed some reconstruction algorithms with improved accuracy but long calculation time. In [20], the authors proposed a statistical information estimation method of primary channel based on deep learning, which has high accuracy, but has disadvantages of complex calculation and long training time. In addition, the computation time required by different methods was compared, and the results showed that the computation cost of closed-form expression is the lowest [20]. Therefore, we propose a closed-form expression to accurately estimate the PMF of the channel periods under ISS by fully analyzing the influence of different types of sensing errors on the channel periods. In addition, the accuracy of this method is evaluated in a variety of scenarios and compared with the methods in the existing literature. The Monte-Carlo simulation results show that the closed-form expression proposed in this paper has a significant improvement in accuracy and is applicable to a wider range of scenarios than the existing methods.
The contribution of this paper can be summarized as follows: 1) The influence of different types of sensing errors on idle period duration is analyzed. Missed detection occurring at the edges of adjacent periods can lead to longer observations, while false alarms can cause part of the idle periods to be split into shorter periods. 2) According to the different durations of the original periods, the theoretical value of the PMF of the idle periods under ISS is analyzed, and the estimation formula of the PMF of the idle periods under ISS is derived. 3) A closed-form expression is derived to accurately estimate the PMF of channel periods under PSS based on ISS sensing results, channel mean period, sensing error probability and sensing period. 4) The proposed estimation method is compared with the method in the existing literature through Monte-Carlo simulation. Simulation results show that the proposed method is superior to the estimation methods proposed in the existing literature, and can provide high accuracy estimation even with high sensing error probability, and is not affected by the sensing period. Therefore, this method is applicable to a wider range of scenarios. The rest of the paper is organized as follows: Section II introduces the system model; Section III analyzes the PMF of channel periods under ISS; Section IV introduces a method to estimate the PMF of channel periods under PSS; Section V provides the simulation results of the proposed method; Finally, the conclusions are drawn in Section VI.

II. SYSTEM MODEL
The energy detector can be used without prior knowledge of the PU and is simple in design [5]. Therefore, we assume that the SU uses the energy detector to perform spectrum sensing with T p as the sensing period. The SU's sensing result of the state of the primary channel is denoted as H i ( i = 0 for idle and i = 1 for busy). As shown in Figure 1, the channel period observed by SU under PSST i is approximately equal to the original period T i (i.e.,T i ≈ T i ). However, because CR system is affected by noise and other factors, SU is likely to have random sensing errors in spectrum sensing. As shown in Figure 2, a false alarm occurs in the process of spectrum sensing by SU, andT i represents the estimation of the original period under ISS. In practical applications, the sensing error probability generated by the energy detector can be calculated from the sensing time, SNR and decision threshold [21], [22]. Therefore, we assume that false alarm probability P f and missed detection probability P m can be obtained in CR systems.

III. THE PMF OF IDLE PERIODS UNDER ISS
Under ISS, false alarm will divide part of idle periodsT 0 into shorter periodsT 0 , while missed detection will generate extra idle periodsT 0 or observe part of idle periodsT 0 into longer periodsT 0 . Therefore, anyT 0 is likely to produce any T 0 due to the different types of sensing errors. According to the different durations ofT 0 , the SU observed that the idle period lasting k time slots (i.e.,T 0 = kT p ) can be divided into four specific cases: Case I: When the duration of the idle period under PSS is less than the sensing result under ISS (i.e.,T 0 < kT p ), SU must have missed detections in the spectrum sensing process, resulting in longer observed results.
As shown in Figure 3, if no false alarm occurs in the idle periodT 0 = kT p observed by SU under ISS, k − m times of missed detections occur at the edges of the two adjacent busy periods, so that the idle period under PSST 0 = mT p (m < k) is incorrectly observed asT 0 = kT p . The probability that no false alarm occurs in m consecutive slots and k − m missed detections occur at the edges of two adjacent busy periods is where i (i ∈ [0, k − m]) represents the number of continuous missed detections before the idle period, and k − m − i represents the number of continuous missed detections after the idle period. The number of channel periods under PSS is denoted asN p , and number of channel periods under ISS is denoted asN p , and the relationship betweenN p andN p is [14] whereN 0 andN 1 represent the total number of idle and busy slots observed under ISS respectively. In this case, the PMF of the idle periodT 0 = kT p is where β =N p /N p represents the ratio of the number of periods under PSS to the number of periods under ISS. The idle period under PSST 0 = mT p (m < k) may be affected by missed detections and false alarms, resulting in the idle period observed by SU under ISS isT 0 = kT p . As shown in Figure 4, no false alarm occurs in consecutive n (n < m) slots at the beginning or end of the idle period, a false alarm occurs in the adjacent idle slots, and continuous k − n missed detections occur at the edge of the adjacent busy period. As shown in Figure 5, when n = 0, the idle period observed under ISST 0 = kT p is caused by a false alarm at the edge of the idle period and the missed detections at the edge of the adjacent busy period. Therefore, n is in the range of [0, m − 1]. Therefore, the probability that idle period T 0 < kT p is incorrectly observed asT 0 = kT p caused by a  false alarm and missed detections is In this case, the PMF of the idle periodT 0 = kT p is Case II: The duration of the idle period under PSS is equal to the sensing result under ISS (i.e.,T 0 =T 0 ).
As shown in Figure 6, if the observed result of SU is not affected by sensing errors, the idle period observed under ISS T 0 = kT p is the same as the result under PSS. For a certain idle periodT 0 = kT p , the probability that no false alarm occurs in all slots within the period and no missed detection occurs at the edges of two adjacent busy periods is In this case, the PMF of the idle periodT 0 = kT p is False alarms lead to shorter duration of observed idle periods, and missed detections of adjacent periods lead to longer duration of observed idle periods. Therefore, when the duration of the idle period under PSS is equal to the sensing result under ISS (i.e.,T 0 =T 0 ), if the sensing result is affected by sensing errors, it must be affected by both missed detections and a false alarm, as shown in Figure 4. In this case, the PMF of the idle periodT 0 = kT p is Case III: WhenT 0 > kT p , if the idle period observed by SU under ISS isT 0 = kT p , it must be affected by false alarms.
As shown in Figure 4, no false alarm occurs in consecutive n slots at the beginning or end of the idle period, a false alarm occurs in the adjacent idle slots, and continuous k − n missed detections occur at the edge of the adjacent busy period. As shown in Figure 7, when n = k, the SU is only affected by a false alarm. Therefore, n is in the range of [0, k]. The probability that an idle periodT 0 > kT p is incorrectly observed asT 0 = kT p due to a single false alarm is In this case, the PMF of the idle periodT 0 = kT p is  The observed idle periodT 0 = kT p may also be caused by two false alarms within an idle periodT 0 = mT p , as shown in Figure 8. The probability of this situation (i.e., no false alarm occurs in consecutive k slots within the idle period, and false alarm occurs in adjacent slots) is The idle period contains at least two false alarms and k consecutive slots in which no false alarm occurs. Therefore, m is in the range of m ≥ k + 2. Therefore, the PMF of idle periodT 0 = kT p caused by two false alarms is Case IV: As shown in Figure 9, the idle period observed under the ISST 0 = kT p is due to missed detections within the busy periodT 1 = mT p . The probability of missed detections occurring in consecutive k slots within the busy period, and no missed detection occurring in adjacent slots is Idle periods caused by missed detections are more likely to occur as a single slot (i.e., k = 1), and it is unlikely that all slots of a busy period are missed detected. Therefore, this can happen for any busy periodT 1 . The PMF of the idle period T 0 = kT p caused by missed detections within the busy period is In combination with the above four cases, the final expression of the PMF of idle periods under ISST 0 = kT p is By substituting (3), (5), (7), (8), (10), (12) and (14) into (15), it can be derived that Equation (16) represents the theoretical value of the PMF of idle periods under ISS, and reflects the mathematical relationship between the PMF of idle periods under ISS and the PMF of idle periods under PSS. VOLUME 10, 2022

IV. ESTIMATION OF THE PMF OF THE IDLE PERIODS UNDER PSS
Equation (16) By substituting (17) into (10), it can be derived that Equation (18) represents the relationship between f III ,1 T 0 T 0 = kT p and fT 0 T 0 ≤ kT p . Similarly, by substituting (17) into (11), the relationship between f III ,2 T 0 T 0 = kT p and fT 0 T 0 ≤ kT p can be obtained that By substituting (18) and (19) into (15), the relationship between fT 0 T 0 = kT p and fT 0 T 0 ≤ kT p can be obtained that Equation (20) can be simplified as: where In practical applications, the PMF of idle periods under ISS fT (21)  Equation (25) represents a method to accurately estimate the PMF of idle periods under PSS based on ISS sensing results, channel mean period, sensing error probability and sensing period. The channel mean period can be obtained by the existing methods [14]- [16], and the sensing error probability and sensing period are related to the spectrum sensing method. Therefore, these parameters can be considered known. In addition, the PMF of the channel busy periods can be obtained by a similar procedure.

A. THE ACCURACY OF THE ESTIMATION OF THE PMF OF IDLE PERIODS UNDER ISS
To verify the accuracy of the analysis results of PMF of channel idle period under ISS in this paper, we compare the results in (16) with the results obtained through Monte-Carlo simulation. In practical applications, the durations of idle and busy periods follow the generalized Pareto distribution in most scenarios [12]. Therefore, we generate two groups of 10 6 random numbers subject to the generalized Pareto distribution (the location, scale and shape parameters are respectively µ i = 10, λ i = 30 and α i = 0.25), which are respectively the durations of the channel idle and busy periods T i . According to the selected sensing period T p , the generated periods T i is observed as the sensing results of idle and busy periods under PSS, and the PMF of primary channel periods under PSS fT 0 T 0 = kT p is calculated. According to the selected sensing error probability P f and P m , the uniformly distributed sensing errors are introduced into the sensing results under PSS to obtain the sensing results of the idle and busy periods under ISST i . Meanwhile, the simulation results of the PMF of idle periods under ISS fT 0 T 0 = kT p can be obtained. Figure 10 compares the theoretical value in (16) with the simulation results. It can be seen from the simulation results that the analysis results of the PMF of idle periods under ISS are consistent with the simulation results. As shown in Figure 11, the analysis results of the CDF of idle periods under ISS FT The accuracy of a distribution estimation can be evaluated by the Kolmogorov-Smirnov (KS) distance, which represents the maximum absolute difference between the estimated CDF F and the actual value F. The KS distance can be defined as D KS = sup F − F . If D KS = 0, the estimated value is consistent with the actual result. Therefore, we use KS distance to evaluate the accuracy of the proposed estimation method. In Figure 12, we analyze the accuracy of the proposed estimation of fT 0 T 0 = kT p when the SU is affected  by different sensing error probabilities. Simulation results show that, compared with the method in [6], the accuracy of the proposed estimation of fT 0 T 0 = kT p is significantly improved, and is not affected by the sensing error probability.

B. THE ACCURACY OF THE ESTIMATION OF THE PMF OF IDLE PERIODS UNDER PSS
To verify the accuracy of the estimated value of the PMF of idle periods under PSS in this paper, we use KS distance to evaluate the accuracy of (25). We assume that the mean idle period E (T 0 ) = 30 and the mean busy period E (T 1 ) = 25, and obey the generalized Pareto distribution. According to the selected sensing period T p , the generated periods T i is sensed as the sensing results of idle and busy periods under PSS, and the PMF of primary channel periods under PSS fT 0 T 0 = kT p is calculated. Then, according to the selected sensing error probabilities P f and P m , In Figure 13, different sensing periods are selected for simulation in this paper to analyze the influence of sensing periods on the accuracy of the estimation of the PMF of idle periods under PSS. As the sensing period increases, the KS distance between the PMF of the channel idle periods calculated directly and the actual value is getting smaller and smaller, which is due to the reduction of the total number of slots leading to the reduction of the total number of sensing errors. When the sensing error probability is low, the proposed method and the method in [6] both provide accurate results. However, when the sensing error probability is high, the proposed method can still maintain a low estimation error.  In Figure 14, we select different false alarm probabilities for simulation, and analyze the influence of false alarm probability on the accuracy of the estimation of the PMF of idle periods when sensing period T p = 5. With the increase of false alarm probability, the accuracy of direct calculation and the method in [6] gradually decreases. Simulation results show that the KS distance of the proposed method does not vary with the false alarm probability. Therefore, the accuracy of the proposed method is not affected by false alarm probability.
In order to analyze the influence of missed detection probability on the accuracy of the estimation of the PMF of idle periods under PSS, different missed detection probabilities are selected for simulation. As shown in Figure 15, with the increase of the missed detection probability, the error between the directly calculated result and the actual value is basically unchanged, and the accuracy of the estimation method proposed in this paper is not affected by the missed detection probability.
In order to analyze the influence of channel mean period on the accuracy of the estimation of the PMF of idle periods under PSS, we assume mean busy period E (T 1 ) = 25 and select different mean idle periods for simulation. As shown in Figure 16, when the sensing error probability is low, the proposed method in this paper and the method in [6] are not affected by the channel mean period and both provide accurate results. When the sensing error probability is high, the accuracy of the method in [6] is affected by the channel mean period, but the method proposed in this paper can still maintain high accuracy.
The above simulation results show that the proposed estimation method has higher accuracy compared with the methods in the existing literature and is not affected by the sensing period, false alarm probability, missed detection probability  and channel mean period. In practical applications, the primary channel mean period is uncertain, and the sensing error probability is affected by the SNR, and the sensing period usually needs to be reasonably selected to maximize the throughput [23]. Therefore, the proposed method can accurately estimate the PMF of the primary channel periods in a wider range of scenarios.

VI. CONCLUSION
Most of the methods to analyze and improve the performance of CR systems require the modeling of spectrum occupancy. However, in practical applications, the SU usually works in low SNR scenarios, and the sensing errors seriously affect the observed results of the distribution of channel periods. In this paper, the influence of sensing errors on the PMF of the primary channel periods is analyzed. This work has established the relationship between the PMF of the primary channel periods under PSS and ISS, channel mean period, sensing error probability and sensing period. In addition, this work has proposed a method to accurately estimate the PMF of the primary channel periods under PSS based on sensing results under ISS, channel mean period, sensing error probability and sensing period. Simulation results show that the closed-form expression proposed in this paper is more accurate than the existing literature, and is not affected by the sensing period and channel mean period. In addition, compared with the reconstruction algorithm and the estimation method based on deep learning, this method requires less calculation time and does not require any prior knowledge of the channel. This work will enable the SU to obtain the accurate distribution of the primary channel periods and improve the performance of CR systems, because many methods to improve the performance of CR systems require the modeling of channel busy and idle states. He is mainly engaged in the research and application of single photon detector, quantum detection radar, optical fiber sensing, and other fields. He has obtained the world's best performance at room temperature communication band single photon detector, visibility meter lidar based on single photon detector, 217km long distance fiber sensing time domain reflectometer, all-weather quantum key distribution in communication band, and atmospheric multi-parameter lidar system based on quantum detector.
XIANG GAO received the B.S. degree in electronic information science and technology from Shandong University, Weihai, China, in 2006, and the M.E. and Ph.D. degrees in communication engineering from the Korea University of Technology and Education, Cheonan, South Korea, in 2008 and 2012, respectively. He is currently a Lecturer and a Supervisor of master's students with Shandong University. His research interests include the Internet of Things technology, cognitive radio, and quantum communication. VOLUME 10, 2022