Primary User Traffic Estimation for Dynamic Spectrum Access

# Primary User Traffic Estimation for Dynamic Spectrum Access

Wesam Gabran, Chun-Hao Liu, Przemysław Pawełczak, and Danijela Cabric Copyright© 2012 IEEE. Personal use of this material is permitted. However, permission to use this material for any other purposes must be obtained from the IEEE by sending a request to pubs-permissions@ieee.org.Wesam Gabran was with with the Department of Electrical Engineering, University of California, Los Angeles. He is currently with Broadcom Corporation, 5300 California Ave, Irvine, CA 92617, USA (email: wgabran@broadcom.com).Chun-Hao Liu and Danijela Cabric are with the Department of Electrical Engineering, University of California, Los Angeles, 56-125B Engineering IV Building, Los Angeles, CA 90095-1594, USA (email: {liuch37, danijela}@ee.ucla.edu).Przemysław Pawełczak is with the Fraunhofer Institute for Telecommunications, Heinrich Hertz Institute, Einsteinufer 37, 10587 Berlin, Germany (email: przemyslaw.pawelczak@hhi.fraunhofer.de).This work has been supported by the National Science Foundation under CNS grant 1117600 and the German Federal Ministry of Economics and Technology under grant 01ME11024.
###### Abstract

Accurate estimation of licensed channel Primary User’s (PU) temporal statistics is important for Dynamic Spectrum Access (DSA) systems. With accurate estimation of the mean duty cycle, , and the mean off- and on-times of PUs, DSA systems can more efficiently assign PU resources to its subscribers, thus, increasing channel utilization. This paper presents a mathematical analysis of the accuracy of estimating , as well as the PU mean off- and on-times, where the estimation accuracy is expressed in terms of the Cramér-Rao bound on the mean squared estimation error. The analysis applies for the traffic model assuming exponentially distributed PU off- and on-times, which is a common model in traffic literature. The estimation accuracy is quantified as a function of the number of samples and observation window length, hence, this work provides guidelines on traffic parameters estimation for both energy-constrained and delay-constrained applications. For estimating , we derive the mean squared estimation error for uniform, non-uniform, and weighted sample stream averaging, as well as maximum likelihood (ML) estimation. The estimation accuracy of the mean PU off- and on-times is studied when ML estimation is employed. Besides, the impact of spectrum sensing errors on the estimation accuracy is studied analytically for the averaging estimators, while simulation results are used for the ML estimators. Furthermore, we develop algorithms for the blind estimation of the traffic parameters based on the derived theoretical estimation accuracy expressions. We show that the estimation error for all traffic parameters is lower bounded for a fixed observation window length due to the correlation between the traffic samples. On the other hand, the impact of spectrum sensing errors on the estimation error of can be eliminated by increasing the number of traffic samples for a fixed observation window length. Finally, we prove that for estimating under perfect knowledge of either the mean PU off- or on-time, ML estimation can yield the same estimation error as weighted sample averaging using only half the observation window length.

## I Introduction

Spectrum sensing is the cornerstone of Dynamic Spectrum Access (DSA) [1] where Secondary Users (SUs) search for, and operate on, licensed spectrum that is temporarily vacant. The SUs have to sense for the presence of Primary (licensed) Users (PUs) on the targeted spectral bands before utilizing these radio resources. The PU channel utilization patterns are stochastic in nature [2]. Consequently, acquiring knowledge about the PU traffic statistics can improve the performance of SU channel selection algorithms, for example [3], and help in achieving more efficient resource allocation, for example [4], in DSA systems.

### I-a The Need for Accurate PU Traffic Estimation: an Example

The multi-channel Medium Access Control (MAC) protocol proposed in [5] is a good example for showing the importance of PU traffic parameters estimation. In the proposed MAC protocol, the SUs access PU channels opportunistically and sense the presence of PUs periodically. The sensing period for each channel is optimized to maximize the expected throughput by minimizing [5, Eq. (1)] which quantifies the sensing overhead (denoted by SSOH) and the missed channel access opportunities (denoted by UOPP). The optimal sensing period is derived as a function of the PU traffic parameters, specifically, the mean PU off-time, , and the mean PU duty cycle, . We show that when the PU traffic parameters estimation error increases, the performance of the proposed MAC protocol (measured in terms of UOPP and SSOH) deteriorates. The results of the investigation on the impact of the PU traffic parameters estimation error on this MAC protocol are presented in Fig. 1. We observe that as the deviations between the actual and estimated (i) mean PU off-time (Fig. 1(a)) and (ii) mean PU duty cycle (Fig. 1(b)) increase, the level of sensing overhead and missed opportunities, SSOH+UOPP, increase. For example, even when the estimation error in is only 15%, the resulting SSOH+UOPP exceeds the optimal value (i.e. having perfect estimates of PU traffic parameters) by almost 10%. Furthermore, we observe that inaccurately estimated has a more profound impact on the performance of the MAC protocol, than inaccurately estimated mean off-time.

### I-B Related Work

A large number of algorithms in DSA systems, considering all layers of the communication stack, assume perfect knowledge of the PUs’ traffic parameters, see for example [6, Sec. 2.1][7, Sec. II-B][8, Sec. II][9, Sec. III][10, Sec. 3.1][11, Sec. 3.2][12, Sec. II][13, Sec. II-A][14, Sec. III-A]. These parameters include the mean PU duty cycle, and the mean PU off-time and on-time. In reality, however, DSA systems need to periodically estimate the level of PU traffic before making any decisions on PU channel access. As DSA systems often cannot assume any a priori knowledge regarding the PU traffic parameters of the accessed channels, blind or semi-blind estimation methods of time-domain PU channel occupancy statistics need to be employed. Therefore, the issue of efficient estimation of traffic parameters of the PU, considering analytical models of the estimation process, started to gain attention from the research community. Recently published [15] is a good example of a DSA system where the need for the most accurate estimation of PU traffic is essential. Therein, a system which scavenges spectrum opportunities in the range of (0,400] milliseconds is introduced and implemented on the TelosB mote (TI MSP40 microcontroller, Chipcon CC2420 transceiver) operating on a 2.4 GHz range wireless sensor network testbed. One of the components of the designed channel access engine is the channel measurement and modeling component. Unfortunately, the paper does not discuss how to design such a module. Moreover, two designed channel access strategies: (i) Contiguous Secondary User Transmission and (ii) Divided Secondary User Transmission, rely strongly on the knowledge of PU traffic (denoted as “whitespace probability density function” by the authors). All PU traffic profiles were artificially generated beforehand and known to the channel access engine, which is an unrealistic assumption.

The most notable results dealing with analytical estimation of PU time-domain traffic parameters can be found in [5, 16, 17, 18]. For analytical tractability, all considered works assume that PUs have exponentially distributed off- and on-times. In [5] maximum likelihood estimation was adopted for estimating the mean PU off-time while sample stream averaging was used for estimating the mean PU duty cycle. Meanwhile in [16], Bayesian estimation was proposed for estimating the mean PU off- and on- times. Uniform traffic sampling was assumed for both [5] and [16]. On the other hand, the authors in [17, 18], using the notion of Fisher information, derived optimal traffic sampling schemes for estimating the mean PU off-time. They argued that for a fixed channel observation window and a fixed number of samples, random sampling outperforms uniform sampling. However, perfect knowledge of the mean PU duty cycle was assumed. Besides, no closed form expressions for the accuracy of the estimated mean PU off-time was derived and different random sampling schemes were evaluated only via simulations. Unfortunately, in all aforementioned works [5, 16, 17, 18], the estimation accuracy, measured in terms of the mean squared error (MSE) in the estimated parameters, was not quantified in a closed form. Moreover, the impact of spectrum sensing errors on the estimation accuracy was not studied analytically. In [19] the authors derived the bounds on the accuracy of the joint estimation of the arrival and departure rates of PUs. However, the authors assumed that the PU traffic is observed continuously, which is an assumption that is far from being practical as the PU traffic is sampled according to a discrete sampling process. Also, just like in earlier works, the impact of spectrum sensing errors in [19] was not considered.

In the context of our work we need to refer to other studies on PU traffic estimation. Specifically, [20] followed a different approach for estimating the PU channel usage statistics (i.e. its complete distribution) by using a combination of statistical distance metrics: kernel density estimation, goodness-of-fit testing (utilizing the Kolmogorov-Smirnov test), and Kullback-Leibler distance. To increase the complexity of the problem, cooperation between spatially separated DSA nodes was considered resulting in node-to-node variances in PU traffic observations. Unfortunately, no closed-form expressions for the PU traffic distribution estimation accuracy were presented. Only a heuristic estimator (in the form of the algorithm presented in Table I of [20]) was used. The proposed heuristic estimator is based on an example of a utility function. Moreover, the impact of spectrum sensing errors was not considered (however, errors due to fading and propagation characteristics were included).

Finally, [21, 22] considered the estimation of the PU channel state through randomized channel probing. These papers modeled the PU state estimation problem as an exploration/exploitation problem and based the analysis on multi-armed bandit formulation. The difference between these two papers lies in system model assumptions and new features that have not been considered in earlier works on multi-armed bandit problems for DSA, i.e. [21] considered spectrum sensing errors, while [22] considered PU state/channel fading correlation. We need to emphasize however that PU state estimation in [21, 22] has the following limiting features: (i) PU channel state estimation reduces to one parameter only (on or off time), (ii) the estimation process requires network feedback, e.g. via ACK/NACK, and (iii) the estimator does not collect statistics on the PU channel usage.

### I-C Our Contribution

In this work, we first consider the problem of estimating the mean PU duty cycle, . We derive the estimation MSE111In parameter estimation literature, the MSE is often used as a metric for the estimation accuracy for a number of reasons. The MSE is an intuitive metric that describes the average squared deviation of the estimated parameter from the actual value of the parameters. Moreover, the MSE accounts in the same manner for both positive and negative deviations. Finally, the MSE metric is mathematically tractable and can often be expressed in closed form, as opposed to the mean absolute error, or the error probability. Closed form expressions have the advantages of providing intuition regarding the results, and enabling incorporating other mathematical tools to analyze the results. in when sample stream averaging with uniform sampling is used. We extend our work to include non-uniform sampling as well as weighted averaging with uniform sampling. Moreover, we propose estimating using maximum likelihood estimation under uniform sampling, and derive the corresponding Cramér-Rao (CR) bound which provides a lower bound on the estimation error for unbiased estimators employing uniform sampling. Regarding the mean PU off- and on-times, we derive the CR estimation error bounds for both parameters under uniform sampling, and present the corresponding maximum likelihood estimators. All of the estimation error expressions presented in this work are formulated as functions of the total number of samples, which serves as a guideline for energy-constrained applications where the energy budget for sampling, and hence the total number of samples, is limited. We also quantify the relationship between the estimation error and the length of the observation window. This is important for delay-constrained applications, and when non-stationary traffic is considered, as it shows the compromise between the delay in learning the PU traffic parameters and the estimation error in the parameters. Besides, the effect of spectrum sensing errors on the estimation accuracy is studied analytically for the averaging estimators, while simulation results are used for the ML estimators of , and the mean PU off- and on-times. Finally, we use the resulting expressions to design algorithms for the blind estimation of the PU traffic parameters under a variety of constraints, and compare their performance against the derived theoretical bounds.

The paper is organized as follows. Section II presents the system model considered in this work. Expressions for the MSE in estimating the PU traffic parameters are derived in Section III (duty cycle) and Section IV (off- and on-time rate parameters). Two practical algorithms for estimating the PU duty cycle and mean off- and on-time are presented in Section V, while numerical results are given in Section VI. Finally, Section VII concludes the paper.

## Ii System Model

Following the model introduced in [5], we consider a single channel that is licensed to a single PU222Note that this, and other assumptions of [5], like, e.g., (i) introduction of (collaborative) spectrum sensing, (ii) listen-before-talk policy, (iii) scheduling of quiet periods, (iv) availability of the control channel, are standard and axiomatic in the DSA literature. Therefore our results are a natural extension of a well-established path in DSA research.. The PU traffic is assumed to be stationary over a sufficiently large time window with exponentially distributed off- and on-times333We are considering a continuous model as it is more general than a discrete one, encapsulating the discrete traffic case. Furthermore, discrete PU traffic models impose an implicit synchrony between the PU and DSA networks. This requires a priori knowledge of the PU properties, e.g. guard intervals or pilot symbols. An example of such operation is in [23], where the DSA system operates following the slot boundaries of a GSM system. To avoid such constricting requirements, we made as little assumptions on the PU properties as possible.. The probability density function of an exponentially distributed random variable, , is given as [24, Eq. (3.15)] , for and , otherwise, where is denoted by the rate parameter. With and , denotes the distribution of PU off- and on-times, respectively444Note that the assumption on the exponential distribution of off- and on-times is common in DSA literature, e.g., see recent examples of [25, 26, 27]; see also recent papers confirming the exponential distribution of time-domain utilization of certain licensed channels [2, 28, 29].. The mean PU off- and on-times are equal to the reciprocal of and , respectively. Besides, the duty cycle of the PU can be calculated as [24, Sec. 11.3] . Hence, , and are inter-dependent, where estimating any two of the three parameters is sufficient to completely estimate the PU traffic parameters.

In order to estimate the traffic parameters, the PU channel is sampled in order to acquire data regarding the state of the PU (on or off). For the considered system model, denote the total number of samples by . Denote the PU traffic samples by the vector where is the th traffic sample, and if the PU is active and , otherwise. Moreover, in the proposed model, we consider the general case where the spectrum sensing process is prone to errors. The sensing error is modeled in the form of false alarm and mis-detection probabilities, denoted by and , respectively. The sensing error is assumed to be independent for different traffic samples. The estimated PU traffic samples are denoted by the vector where is the th estimated traffic sample. It follows that if and no mis-detection error occurred, or and a false alarm error occurred. Similarly, if and a mis-detection error occurred, or and no false alarm error occurred. Furthermore, the inter-sample times are given by the vector where denotes the time between samples and . Finally, the total observation window length is denoted by , where .

Denote the PU state transition probability by , which corresponds to the probability that the PU state changes from state to state within time , where denotes that the PU is idle while denotes that the PU is active. The PU state transition probabilities were derived in [5, Sec. 6.1] as

 Prxy(t)= 1−u+ue−λftu, x=0,y=0, (1a) Prxy(t)= 1−Pr00(t), x=0,y=1, (1b) Prxy(t)= u+(1−u)e−λftu, x=1,y=1, (1c) Prxy(t)= 1−Pr11(t) x=1,y=0. (1d)

In this work is later used to derive the MSE in the estimates of , , and .

As remarked in Section I, estimators of and are analytically described in closed form in [5, 16, 17, 18]. However, a measure of the estimation error in and , was not given, noting that in [5, Sec. 6.2] only the asymptotic confidence interval for the estimates of and was presented. In the following sections, we propose new methods to estimate and we derive the MSE in the estimates of , , and .

## Iii Estimation of the Primary User Duty Cycle u

In this section, we analyze different methods for estimating the duty cycle, , of the PU. We first present an estimator based on averaging the traffic samples, labeled the averaging estimator, similar to the estimator presented in [5, 16, 17, 18]. In addition, we modify the estimator to the general case where the PU traffic samples are not uniformly sampled. Furthermore, as we observe that the estimation accuracy is bounded by the sample correlation, we propose two different estimation methods to alleviate the correlation effect. The first method is based on the weighted averaging of the traffic samples, labeled the weighted averaging estimator, and the second method is based on maximum likelihood (ML) estimation. For all three estimation methods, we derive expressions for the MSE in the estimates. Moreover, we derive the CR bound on the estimation error when using uniformly sampled traffic samples. The MSE expressions are presented as functions of the number of samples and the observation window length to serve as guidelines for traffic estimation in energy-constrained and delay-constrained systems, respectively.

### Iii-a The Averaging Estimator under Perfect Sensing

The averaging duty cycle estimator, , is defined as  [5, Sec. 6.1]

 ~ua=1NN∑n=1~zn. (2)

We first consider the case where the spectrum sensing errors can be ignored, i.e., , hence, . The impact of spectrum sensing errors on the estimation error is presented in the next section.

#### Iii-A1 The MSE in ~ua

The MSE in for samples can be defined as

 V~ua,N=E[~u2a]−u2, (3)

where denotes the expectation. The intuition behind (3) is as follows; the expectation is calculated over all possible values of resulting from all permutations of the traffic samples vector . Define as a vector containing all permutations of with , , defined as the th element of . Furthermore, define , , as the th traffic sample of , and define , i.e., the summation of all traffic samples of . Then, substituting (2) in (3) yields

 V~ua,N=1N22N∑n=1ζ2nPr(z=Zn|T)−u2, (4)

where denotes the probability of observing PU traffic sample sequence , for a given vector of sampling times . We then have the following corollary.

###### Corollary 1

The MSE of is given as

 V~ua,N=u(1−u)N+2u(1−u)N2N−1∑i=1N−i∑j=1i+j−1∏k=je−Tkλfu, (5)
###### Proof:

See the proof of (19). \qed

From Corollary 1 we obtain the subsequent corollary.

###### Corollary 2

The decrease in the MSE in with each extra sample, , is given as

 D~ua,N+1 =V~ua,N−V~ua,N+1 =(2N+1)(N+1)2V~ua,N−u(1−u)(N+1)2 ×(1+2N−1∑i=0N∏k=N−ie−Tkλfu). (6)
###### Proof:

Via elementary algebra. \qed

Corollary 2, as we will show in Section V, proves important in designing adaptive algorithms for the blind estimation of .

##### Remarks

The rightmost term of (5) represents the increase in the estimation error caused by the correlation between the traffic samples. As tends to infinity, this term tends to zero, hence, approaches , which is the MSE in estimating the duty cycle of an uncorrelated traffic sample sequence555Note that is the variance of a binomial distribution normalized by where the probability of success is set to  [30, Ch. 4].. This is attributed to the fact that the inter-sample time becomes large compared to the mean off- and on-times of the PU, hence, the correlation between the samples vanishes. The estimation error is a function of the traffic parameters, the number of samples, and the inter-sample time sequence. The optimal inter-sample time sequence that minimizes the estimation error for a given number of samples and a fixed total observation window length is derived in the next section.

#### Iii-A2 The Optimal Inter-Sample Time Sequence for Minimizing the MSE in ~ua

In this section, the MSE in is shown to be convex with respect to the inter-sample time sequence, . The optimal , denoted by , is derived, and the corresponding expression for the MSE in is presented. Expression (5) is proven to be convex by showing that the Hessian of , denoted by , is positive-semidefinite [31]. The proof of convexity is given in Appendix B.

The problem of minimizing with respect to can be written as:

 minimize V~ua,N(T)=u(1−u)N+2u(1−u)N2 ×N−1∑i=1N−i∑j=1i+j−1∏k=je−Tkλfu; (7) subject to −Tn≤0,n=1,2,⋯,N−1; (8) N−1∑n=1Tn=T. (9)

The optimization problem can be solved by Lagrangian duality [31] where the Lagrangian function can be expressed as

 LV(T,υ,μ) =V~ua,N(T)−N−1∑k=1υkTk +μ(N−1∑k=1Tk−T), (10)

where is the vector of the Lagrangian multipliers associated with inequalities (8) and is the Lagrangian multiplier associated with (9). As the optimization problem is convex, and the objective and constraint functions are differentiable, the optimal inter-sample time sequence, , satisfies the Karush-Kuhn-Tucker (KKT) conditions:

 −T∗n≤0, (11a) N−1∑k=1T∗k−T=0, (11b) υ∗nT∗n=0,υ∗n≥0, (11c) ∇V~ua,N(T∗n)−υ∗n+μ∗=0, (11d)

where and the superscript signifies optimality. Expression (11d) can be expressed as . The solution of the convex problem is first presented for the special case where , , i.e. when all samples have non-zero spacing in time. The solution is later expanded to include cases where for a set of , i.e. samples coincide in time implying that the sample is weighted by the number of coinciding samples.

For the case where , is given as follows. Denote and , then for and , and , otherwise, where

 Γ∗a=Γ∗b1−Γ∗b, (12a) 2T∗a+(N−3)T∗b=T, (12b) T>(N−3)uλflog2. (12c)

Equation (12a) is derived by simultaneously solving (11d) for and . Equation (12b) is derived from condition (11b). Condition (12c) is derived by setting in (12a) and (12b) and solving for . Expressions (12a) and (12b) can be shown to satisfy (11a)–(11d) but the proof is omitted for brevity. The solution for the optimization problem implies that as the length of the total observation window, , increases, the optimal inter-sample time sequence approaches uniform sampling. As decreases, remains uniform for samples to . However, the first and last inter-sample times are equal in length, and shorter in length than the rest of the inter-sample times. If is decreased to , and approach zero, i.e. the first two samples and last two samples coincide. This implies that the number of samples is decreased to and the first and last samples are weighted by two.

For the case where , can be equal to zero for where and . can be found by solving (11a)–(11d) where for and , otherwise. is derived as for , for and and , otherwise, where

 Γ∗a=Γ∗bk(1−Γ∗b), (13a) 2T∗a+^NT∗b=T, (13b) ^Nuλflogk+1k

where . Equation (13a) is derived by simultaneously solving (11d) for and . Equation (13b) is derived from condition (11b). The lower bound in (13c) is derived by setting in (13a) and (13b) and solving for . The upper bound in (13c) is based on the condition where the expression for can be derived for from (11d), using (13a), as . Again, (13a) and (13b) satisfy (11a)–(11d) , and the proof is omitted for brevity. The solution for the optimization problem implies that if falls in the boundary expressed in (13c), then the first and last samples are omitted, and the th and th samples are weighted by . Again, the middle inter-sample times are uniformly sampled and .

For the special case where and , all inter-sample times decrease to zero except for the middle interval, for even, or the middle two intervals, for odd. Accordingly, for even , for and , whereas for odd , for and . This can be shown to satisfy the KKT conditions (11a)–(11d).

Using the optimal inter-sample time sequence, the lower bound on the estimation error for the averaging estimator, , can be derived by substituting (13a) and (13b) in (5) yielding

 V∗~ua,N =2u(1−u)N2 ×(N2+Γ∗b+k(k−1)(1−Γ∗b)2(1−Γ∗b)2 +Γ∗b(N−2k)(1−Γ∗b)(1−Γ∗b)2), (14)

for where is chosen to satisfy (13c) and is found by solving (13a) and (13b)666For , for even , , and for odd , ..

##### Remarks

The optimal inter-sample time sequence, , is non-uniform where the first and last inter-sample times are shorter than the rest of the inter-sample times. Moreover, generally, the first and last samples have higher weights compared to the rest of the samples. This is attributed to the fact that the first and last samples are at the edges of the traffic sample sequence, hence, they have lower correlation with the rest of the traffic samples. However, as the total observation window length increases, the impact of the first and last samples on the overall estimation error decreases, and the gap between the estimation error for the optimal non-uniform sampling sequence and the uniform sampling sequence diminishes. Furthermore, is a function of , the very same parameter that is to be estimated, as well as a function of the mean PU departure rate, (or the mean PU arrival rate, , as equals ), which is not necessarily known by the traffic estimator. Hence, cannot be known a priori, yet can be used as a guideline in algorithm design for the blind estimation of the traffic parameters. For instance, apart from ‘weighting’ the first and last samples, is found to be an almost uniformly sampled sequence. Besides, the error expression given in (14) serves as a lower bound on the MSE in estimating using averaging for any inter-sample time sequence.

#### Iii-A3 The Averaging Estimator under Uniform Sampling

The work in [5, 16, 17, 18] considered estimating by averaging uniformly sampled traffic observations. In this section, we derive the MSE in under uniform sampling, denoted by . With constant inter-sample times, , . Substituting in (5), the MSE can be written as

 V~uua,N =2u(1−u)N2(N2+N−1∑i=1Γiu(N−i)) =2u(1−u)Γu(ΓNu−N(Γu−1)−1)N2(1−Γu)2 +u(1−u)N, (15)

where . Again, the leftmost part in the second equation of (15) accounts for the increase in estimation error caused by sample correlation. Intuitively, when the sample correlation is high, increasing in a fixed time window leads to an insignificant change in the estimation error. Formally, we obtain the following corollary.

###### Corollary 3

For a fixed observation window length, as the number of samples increases, the MSE error in estimating for uniform sampling approaches an asymptote , where

 V~uua,L=limN→∞V~uua,N=2u(1−u)η2(e−η+η−1), (16)

where .

###### Proof:

Via elementary algebra. \qed

Note that tends to 0 as the observation window length is increased. Using Corollary 3, the number of samples, , can be chosen such that the resulting error is above the asymptotic error (16) by a factor . Then can be evaluated by solving .

##### Remarks

When estimating by averaging uniformly sampled traffic samples, the estimation error is lower bounded. The lower bound is caused by sample correlation and can only be eliminated by increasing the total observation window length.

### Iii-B The Averaging Estimator under Imperfect Sensing

The analysis presented in Section III-A is extended here to include the effect of spectrum sensing errors on the estimation error. Introducing spectrum sensing errors to the averaging estimator expressed in (2) causes the estimator to become biased. The expected value of the estimator can be calculated as , where the expectation is calculated over all possible values of resulting from all permutations of the estimated PU traffic samples vector . Thus, the duty cycle can be calculated from where . Accordingly, we define the following unbiased estimator777Note that the estimator is not defined for the special case of . For , the denominator of the proposed unbiased estimator equals zero, and the expectation of the biased estimator can be expressed as , which is independent of . Hence, both estimators fail to estimate . On the other hand, note that does not correspond to any relevant practical sensing method. Typical values for the probability of false alarm and mis-detection are and , respectively, e.g., [32, Sec. VII-C][33, Sec. VI-A][34, 35][36, Sec. 6.6][37, Sec. IV-A].

 ~ua,s=11−Pf−Pm[−Pf+1NN∑n=1~zn], (17)

. Define as a vector containing all permutations of with , , defined as the th element of . Furthermore, define , , as the th traffic sample of . Thus, the MSE in for samples, denoted by can be expressed as

 V~ua,s,N=2N∑n=1S2nPr(~z=~Zn|T)−u2, (18)

where . We then have the following theorem.

###### Theorem 1

The MSE in is given as

 V~ua,s,N =2u(1−u)N2N−1∑i=1N−i∑j=1i+j−1∏k=je−Tkλfu+u(1−u)N +uPm(1−Pm)+(1−u)Pf(1−Pf)N(1−Pf−Pm)2, (19)

.

###### Proof:

See Appendix A. \qed

##### Remarks

Comparing (19) with (5), it is clear that the rightmost term of the right hand side of (19) models the increase in the estimation error caused by the spectrum sensing errors. Moreover, the leftmost term of the right hand side of (19) accounts for the estimation error caused by the sample correlation. Furthermore, unlike the impact of sample correlation on the estimation error, the effect of the spectrum sensing errors on the estimation error can be asymptotically eliminated by increasing . Besides, the increase in the estimation error attributed to the spectrum sensing errors is not a function of the inter-sample time sequence, . Accordingly, is convex with respect to , and the optimal that minimizes the MSE in is the same as that minimizes the MSE in that is derived in Section III-A2.

### Iii-C The Weighted Averaging Estimator under Perfect Sensing

In the previous sections, the PU duty cycle, , is estimated using equal weight averaging of the channel samples. The optimal inter-sample times were found to reach zero for some samples implying that weighting might improve the estimation accuracy. In this section, we propose a new estimator that averages weighted traffic samples to decrease the estimation error by alleviating the effect of sample correlation. For analytical tractability, uniform sampling is assumed with a constant inter-sample time denoted by .

We first present the special case where the spectrum sensing errors can be neglected, that is, , and . The effect of spectrum sensing errors on the estimation error is investigated in the next section. The estimator is defined as , where is the weight of sample . Then , thus, for the estimator to be unbiased, that is , the weights must satisfy the condition .

#### Iii-C1 The MSE in ~uw

The MSE in can be written as

 V~uw,N =E[(~uw−E[~uw])2] =E⎡⎣(N∑i=1wizi−E[N∑i=1wizi])2⎤⎦ =E⎡⎣(N∑i=1wizi)2⎤⎦−u2(N∑i=1wi)2 =uN∑i=1w2i+2∑i

The expression in (20) represents the correlation between and denoted by . Consider , , then

 Ri,i+j =E[zizi+j]=Pr{zi=1,zi+j=1} =Pr{zi=1,zi+j−1=1}Pr11(Tc) +Pr{zi=1,zi+j−1=0}Pr01(Tc) =Ri,i+j−1Pr11(Tc) +(u−Ri,i+j−1)Pr01(Tc). (21)

The initial condition for the recursive equation (21) is . Thus, solving equation (21) yields , where . Since the traffic samples have a constant mean and the correlation function is only related to the time difference between the samples, the samples follow a wide-sense stationary process888It is stated in [5] that the traffic samples follow a semi-Markov process. But given the condition of using a constant inter-sample time, it turns out to be a wide-sense stationary process. and . Substituting in (20) yields

 V~uw,N =uN∑i=1w2i+2N−1∑j=1N−j∑i=1wiwi+j[uΓjc+u2(1−Γjc)] −u2(N∑i=1wi)2 =(N∑i=1w2i+2N−1∑j=1ΓjcN−j∑i=1wiwi+j) ×u(1−u). (22)

Note that (22) matches (15) if constant weighting is assumed, i.e., .

#### Iii-C2 The Optimal Weighting Sequence

The optimal weighting sequence that minimizes the MSE in , denoted by , is derived in this section. According to the orthogonality principle, satisfies . Hence, , where , , and is the cross correlation vector . Since the traffic samples follow a wide-sense stationary process, is both symmetric and Toeplitz. The cross correlation vector, , can be written as . Normalizing the weights to get an unbiased estimator, the optimal weighting sequence is given by , where is a constant vector . Hence, the optimal weighting sequence can be expressed as and .

The MSE in when the optimal weighting sequence is used can be found by substituting in (22) yielding . Due to the correlation between the samples, for a given observation window length, the MSE in approaches an asymptote, denoted by , as increases. can be calculated as follows

 V∗~uw,L=limN→∞V∗~uw,N=u(1−u)1+λfT2u. (23)
##### Remarks

The derived optimal weighting sequence dictates that the first and last samples have to be multiplied by higher weights than the rest of the samples. This is because they are less correlated to the rest of the traffic samples and hence, hold more information. The optimal weighting sequence, however, depends on the actual value of which is obviously not known a priori. Thus, serves as a lower bound on the estimation error when weighted sampling is used. Besides, the accuracy of the estimate can be improved in an iterative manner where can be used to calculate an estimate of the optimal weighting sample, then the resulting weighting sequence can be used to improve the estimate of .

### Iii-D The Weighted Averaging Estimator under Imperfect Sensing

In this section, we consider the performance of the weighted averaging estimator considering spectrum sensing errors. The spectrum sensing errors cause the estimator to become biased, akin to the averaging estimator case presented in Section III-B. Accordingly, the bias can be eliminated by defining the following estimator

 ~uw,s=11−Pf−Pm[−Pf+N∑i=1~wi~zi], (24)

where is the weight of the estimated traffic sample . Hence, under the condition . To quantify the MSE in , we start by evaluating the correlation between the estimated traffic samples, , where

 ~Ri,i+j =E[~zi~zi+j] =Pr{~zi=1,~zi+j=1} =P2fPr{zi=0,zi+j=0}+Pf(1−Pm) ×[Pr{zi=0,zi+j=1}+Pr{zi=1,zi+j=0}] +(1−Pm)2Pr{zi=1,zi+j=1}. (25)

Recall from Section III-C1 that . It follows that , , and . Hence, substituting in (25) yields

 ~Ri,i+j =Ri,i+j(1−Pm−Pf)2 +2uPf(1−Pm−Pf)+P2f. (26)

Since, as in Section III-C1, the estimated samples follow a wide-sense stationary process, then . Hence, the variance of the proposed estimator can be expressed as

 V~uw,s,N =E[(~uw,s−u)2]=E[~u2w,s]−u2 =−u2+1(1−Pf−Pm)2 ×⎛⎝E[(N∑i=1~wi~zi)2]−2PfN∑i=1~wiE[~zi]+P2f⎞⎠ =−u2+