Gradient-Based Threshold Adaptation for Energy Detector in

IEEE COMMUNICATIONS LETTERS, VOL. 15, NO. 1, JANUARY 2011
19
Gradient-Based Threshold Adaptation for
Energy Detector in Cognitive Radio Systems
Deepak R. Joshi, Student Member, IEEE, Dimitrie C. Popescu, Senior Member, IEEE,
and Octavia A. Dobre, Senior Member, IEEE
Abstract—Cognitive Radio (CR) systems have been proposed
to enable flexible use of the frequency spectrum in future
generations of wireless networks. These are expected to detect
spectrum bands that are not actively used by licensed (primary)
users and provide unlicensed (secondary) users access to these
bands. In this context it is important for the CR systems to
promptly react to changes in the operating environment and to
adapt to the changing patterns of spectrum use. This motivates
the work presented in this paper, which studies adaptation of
the detection threshold for energy-based spectrum sensing in
dynamic scenarios under constraints imposed on the probabilities
of missed detection and false alarm.
Index Terms—Cognitive radio, energy detector, threshold
adaptation.
I. I NTRODUCTION
C
OGNITIVE radio represents an emerging technology
designed to enable dynamic access to the frequency
spectrum under the condition that no harmful interference be
caused to the incumbent licensed users of the spectrum [1]. CR
systems are expected to enable reuse of licensed frequencies
through efficient and reliable sensing of the electromagnetic
environment, which includes estimation of the spectrum used
by licensed radio systems that operate as Primary Users (PU).
Various methods have been proposed for spectrum sensing
in CR systems, which include the multitaper method [2], the
use of pilot signals and matched filtering [3], cyclostationaritybased methods [4]–[6], and the use of polyphase filter banks
[7]. These methods have been developed and investigated in
static scenarios, where the spectrum usage and background
noise statistics do not vary in time. However, in practical systems, spectrum usage changes in time as the number of active
transmissions and/or their corresponding parameters change,
while the background noise varies due to temperature changes,
ambient interference, etc. This motivates the work presented
in this letter, which studies energy-based spectrum sensing in
dynamic scenarios and proposes a gradient-based algorithm
for sensing threshold adaptation. We note that energy detection
is a suitable spectrum sensing technique when the CR has no
knowledge on the active PU signals [8] and its applicability
will be enhanced when an adaptive sensing threshold that
changes in dynamic scenarios is employed.
The rest of the paper is organized as follows: in Section II
we introduce the system model and formally state the problem.
Manuscript received April 20, 2010. The associate editor coordinating the
review of this letter and approving it for publication was R. Nabar.
D. R. Joshi and D. C. Popescu are with the Department of Electrical
and Computer Engineering, Old Dominion University, 231 Kaufman Hall,
Norfolk, VA 23529 (e-mail: {djosh002, dpopescu}@odu.edu).
O. A. Dobre is with the Faculty of Engineering and Applied Science,
Memorial University of Newfoundland, 300 Prince Phillip Dr., St. John’s,
NL, A1B 3X5, Canada (e-mail: [email protected]).
Digital Object Identifier 10.1109/LCOMM.2010.11.100654
x(t)
RF front
end
CR front end
Fig. 1.
Average
M
samples
||2
ADC
x(n)
y(n)
Threshold
H \ H1
0
Y
Threshold
Adaptation
Block diagram of energy detector system for spectrum sensing.
In Section III we discuss how the variance of the PU signal and
of the background noise are estimated from the noisy signal
received by the CR. In Section IV we present a gradient-based
sensing threshold adaptation procedure and we formally state
the proposed algorithm, which is illustrated with numerical
results obtained from simulations in Section V. We present
final remarks and conclusions in Section VI.
II. S YSTEM M ODEL AND P ROBLEM S TATEMENT
We consider spectrum sensing using the energy detector, which is described schematically in Fig. 1 [3]. After
performing the front end processing along with the analog
to digital conversion (ADC), the received signal is expressed
as
𝑥(𝑛) = 𝑠(𝑛) + 𝑣(𝑛),
(1)
with 𝑠(𝑛) being the active radio signal at the location of
the CR system, and 𝑣(𝑛) the additive white Gaussian noise
(AWGN) corrupting the active signal with zero mean and
variance 𝜎𝑣2 . Under the assumption of non-coherent detection,
the samples of the active radio signal 𝑠(𝑛) may also be
modeled as a Gaussian random process with variance 𝜎𝑠2 [3].
We note that both 𝜎𝑠2 and 𝜎𝑣2 are estimated from the received
signal 𝑥(𝑛), as it will be described in Section III.
The decision statistic for the energy detector is expressed
as the time average [3], [8]
𝑦(𝑛) =
𝑛
∑
∣ 𝑥(𝑖) ∣2 .
(2)
𝑖=𝑛−𝑀
This provides information on the active signal spectrum at
time instant 𝑛 and can be used for detecting the presence of
active PU in the tested spectrum band.
A binary hypothesis testing is performed to identify the
presence of active PU: at a given time instant 𝑛 the frequency
band is considered to be vacant if only noise is detected, while
the band is considered to be occupied by an active PU if a
PU signal and noise are detected. Thus, the following binary
hypothesis testing is performed at time instant 𝑛 to determine
whether the frequency band is used by an active PU [3], [8]
c 2011 IEEE
1089-7798/11$25.00 ⃝
ℋ0 : 𝑥(𝑛) = 𝑣(𝑛)
ℋ1 : 𝑥(𝑛) = 𝑠(𝑛) + 𝑣(𝑛),
(3)
20
IEEE COMMUNICATIONS LETTERS, VOL. 15, NO. 1, JANUARY 2011
where the hypotheses ℋ0 and ℋ1 respectively indicate the
absence and presence of the PU signal in the received signal.
The decision rule is given by
ℋ1
𝑦(𝑛) ⋛ 𝛾(𝑛),
(4)
ℋ0
where 𝛾(𝑛) is the sensing threshold. The probability of
detecting an active PU signal expressed in terms of the
complementary error function, erfc(⋅), is [3]
[
]
𝛾(𝑛) − 𝑀 𝜎 2
1
√
𝑃𝑑 [𝛾(𝑛)] = Pr [𝑦(𝑛) > 𝛾(𝑛)∣ℋ1 ] = erfc
,
2
2𝜎 2 𝑀
(5)
where 𝜎 2 = 𝜎𝑣2 + 𝜎𝑠2 is the variance of 𝑥(𝑛). Further, the
probability of missed detection of an active PU signal is
𝑃𝑚𝑑 [𝛾(𝑛)] = 1 − 𝑃𝑑 (𝛾(𝑛)),
(6)
and the probability of false alarm is [3]
[
]
𝛾(𝑛) − 𝑀 𝜎𝑣2
1
√
𝑃𝑓 𝑎 [𝛾(𝑛)] = Pr[𝑦(𝑛) > 𝛾(𝑛)∣ℋ0 ] = erfc
.
2
2𝜎𝑣2 𝑀
(7)
The performance of energy-based spectrum sensing at any
time instant 𝑛 depends on the values of 𝑃𝑚𝑑 and 𝑃𝑓 𝑎 both of
which are functions of the sensing threshold 𝛾(𝑛). We note
that a large 𝑃𝑚𝑑 implies a higher chance that the CR will not
detect the presence of a PU transmission, whereas a low 𝑃𝑓 𝑎
implies a better chance for the CR system to occupy the band
of interest. We also note that, due to the strict monotonicity
of the erfc(⋅) function, fixing one of these probabilities will
result in a threshold value 𝛾 which will imply a unique value
for the other one. Thus, in order to be able to optimize the
sensing threshold, both 𝑃𝑚𝑑 and 𝑃𝑓 𝑎 should be considered
and we combine them into a single criterion – the spectrum
sensing error ℰ – defined as
ℰ[𝛾(𝑛)] = (1 − 𝛿)𝑃𝑚𝑑 [𝛾(𝑛)] + 𝛿𝑃𝑓 𝑎 [𝛾(𝑛)],
(8)
where 0 < 𝛿 < 1 is a given constant weighting the probability
of missed detection relative to that of false alarm.
Our goal in this paper is to study the optimization of
the sensing threshold, 𝛾(𝑛), which minimizes the spectrum
sensing error (8) under constraints imposed on 𝑃𝑚𝑑 and 𝑃𝑓 𝑎 ,
and to propose an algorithm for adaptation of 𝛾(𝑛) in dynamic
scenarios in which the variances of the active signal 𝜎𝑠2 and/or
noise 𝜎𝑣2 change in time.
III. VARIANCE E STIMATION
In order to estimate the variances of the PU signal and
of the background noise, we model the signal received by
the CR using an AR model of order 𝑝 [9] whose parameters
are estimated using a least squares procedure [10]. The noise
variance 𝜎𝑣2 is estimated first as discussed in [11] and then,
using the fact that the PU signal 𝑠(𝑛) and background noise
𝑣(𝑛) are uncorrelated, the estimate of the PU signal variance
is obtained as 𝜎𝑠2 = 𝜎 2 − 𝜎𝑣2 .
We assume that the uncontaminated PU signal 𝑠(𝑛) follows
a 𝑝-th order AR model [9] with transfer function
1
].
𝐻(𝑧) = [
(9)
∑𝑝
1 + 𝑗=1 𝑎𝑗 𝑧 −𝑗
The coefficients 𝑎𝑗 satisfy the set of Yule-Walker equations
𝑝
∑
𝑎𝑖 R𝑠 (∣𝑗 − 𝑖∣) = −R𝑠 (𝑗), 𝑗 > 0,
(10)
𝑖=1
with R𝑠 (𝑗) as the autocorrelation coefficients of the uncontaminated signal 𝑠(𝑛), which are related to the autocorrelation
coefficients R𝑥 (𝑗) of the noisy signal 𝑥(𝑛) as [10], [11]
R𝑠 (0) = R𝑥 (0) − 𝜎𝑣2 ,
R𝑠 (𝑗) = R𝑥 (𝑗), 𝑗 > 0.
(11)
Based on (10) and (11) the estimate of the noise variance, 𝜎
ˆ𝑣2 ,
is given by [11]
[∑
]
∑𝑝
𝑝
𝑎𝑗 {R̂𝑥 (𝑗) + 𝑖=1 𝑎𝑖 R̂𝑥 (∣𝑗 − 𝑖∣)}
𝑗=1
∑𝑝
𝜎
ˆ𝑣2 =
,
(12)
2
𝑗=1 𝑎𝑗
where, R̂𝑥 (𝑗) are estimates of the autocorrelation coefficients
of the noisy signal 𝑥(𝑛) obtained from an overdetermined
set of 𝑞 > 𝑝 high order Yule-Walker equations using a least
squares procedure [10].
IV. DYNAMIC T HRESHOLD A DAPTATION
Using the sensing error ℰ[𝛾(𝑛)] in (8) the optimum threshold value is implied by the constrained optimization problem
min ℰ[𝛾(𝑛)] subject to
𝛾(𝑛)
𝑃𝑚𝑑 [𝛾(𝑛)] ≤ 𝛼 and 𝑃𝑓 𝑎 [𝛾(𝑛)] ≤ 𝛽,
(13)
where 𝛼 and 𝛽 are the maximum values allowed for the
probabilities of missed detection and false alarm, respectively.
We note that the constrained optimization problem (13) can
be solved using the Lagrange multipliers method. For this we
form the Lagrangian function
𝐿(𝛾, 𝜆1 , 𝜆2 ) = ℰ[𝛾(𝑛)] − 𝜆1 {𝑃𝑚𝑑 [𝛾(𝑛)] − 𝛼}
(14)
−𝜆2 {𝑃𝑓 𝑎 [𝛾(𝑛)] − 𝛽} ,
where 𝜆1 and 𝜆2 are the Lagrangian multipliers. In order to
find the necessary conditions for the optimal solution of the
constrained minimization problem (13), we take the partial
derivatives of the Lagrange function (14) with respect to 𝛾, 𝜆1 ,
and 𝜆2 , respectively, and after some algebraic manipulation we
obtain them as follows:
[ (
)2 ]
𝛾(𝑛)−𝑀𝜎𝑣2
√
exp − 2𝜎2 𝑀
𝜆1 + 𝛿 − 1
𝑣
[ (
−
(15)
)2 ] = 0,
2
𝜆2 − 𝛿
√
exp − 𝛾(𝑛)−𝑀𝜎
2𝜎2 𝑀
[
]
𝛾(𝑛) − 𝑀 𝜎 2
1
√
1 − 𝛼 − erfc
≥ 0,
2
2𝜎 2 𝑀
[
]
𝛾(𝑛) − 𝑀 𝜎𝑣2
1
√
erfc
− 𝛽 ≥ 0.
2
2𝜎𝑣2 𝑀
(16)
(17)
In order to find the optimal sensing threshold value we use an
iterative method in which we randomly initialize the threshold
with 𝛾(0), and then adapt it using the gradient-based update
𝛾(𝑛 + 1) = 𝛾(𝑛) − 𝜇∇ℰ(𝑛),
(18)
JOSHI et al.: GRADIENT-BASED THRESHOLD ADAPTATION FOR ENERGY DETECTOR IN COGNITIVE RADIO SYSTEMS
0.8
0.7
Scenario 3
SNR −3 dB
Pmd = 0.091
Pfa = 0.014
Threshold
0.6
0.5
0.4
0.3
0.2
Scenario 1
SNR 0 dB
Pmd = 0.058
Pfa = 0.030
Scenario 2
SNR 3 dB
P = 0.035
md
P = 0.033
fa
0.1
0
Fig. 2.
100
200
300
400
500
600
Number of iterations
700
800
900
Dynamic threshold adaptation.
where 𝜇 is a suitably chosen step size and the gradient ∇ℰ(𝑛)
is calculated as
[ (
)2 ]
𝛾(𝑛) − 𝑀 𝜎𝑣2
−𝛿
√
√
exp −
∇ℰ(𝑛) =
2𝜎𝑣2 𝜋𝑀
2𝜎𝑣2 𝑀
[ (
[
]
)2 ]
(1 − 𝛿)
𝛾(𝑛) − 𝑀 𝜎 2
√
√
+ (1 − 𝛿) +
. (19)
exp −
2𝜎 2 𝜋𝑀
2𝜎 2 𝑀
The gradient-based update (18) can also be used in dynamic
scenarios to adapt the optimal threshold value to changes in
𝜎𝑠2 and/or 𝜎𝑣2 , and represents the main step of the proposed
algorithm for threshold adaptation, formally stated below:
Algorithm 1 Threshold Adaptation for Energy Detector-based
Spectrum Sensing
1: INPUT step size 𝜇, tolerance 𝜖, and threshold value 𝛾(0).
2: Calculate the average energy of the received signal using
equation (2).
3: Calculate unbiased estimate of the autocorrelation coefficients {R̂𝑥 (𝑗)} from observed noisy signal.
4: Compute the AR parameters using a least squares procedure as discussed in [10].
5: Calculate an estimate of 𝜎𝑣2 using equation (12).
6: Calculate the variance 𝜎 2 of the received signal 𝑥(𝑛) and
determine the variance of the PU signal 𝜎𝑠2 = 𝜎 2 − 𝜎𝑣2 .
7: while [𝛾(𝑛) − 𝛾(𝑛 − 1) > 𝜖] do
8:
Calculate gradient ∇ℰ(𝑛) using (19).
9:
Calculate threshold 𝛾(𝑛) using gradient update (18).
10:
Check the constraints conditions.
11: end while
12: OUTPUT optimal threshold value 𝛾 ∗ = 𝛾(𝑛) .
V. S IMULATIONS AND N UMERICAL R ESULTS
In order to illustrate the proposed algorithm we performed
simulations in a dynamic scenario where the signal-to-noise
(SNR) ratio of the active PU signal to the background noise
changes in time. The simulation parameters are: the probability
constraints 𝛼 = 0.1 and 𝛽 = 0.2, 𝛿 = 0.5, the gradient
21
constant 𝜇 = 0.5, the AR model order parameters 𝑝 = 2 and
𝑞 = 78, and the algorithm tolerance 𝜖 = 10−3 . Simulation
results are plotted in Fig. 2, and they show how the proposed
algorithm dynamically adjusts the sensing threshold when the
SNR changes in time. We start with initial SNR = 0 dB
(scenario 1), for which the algorithm adjusts the threshold
to the optimal value of about 0.29. At time instant 200 the
SNR changes to 3 dB (scenario 2) and the algorithm adapts
the threshold to new optimal value of approximately 0.12. At
time instant 400 the SNR changes again such that in scenario 3
we have SNR = −3 dB. Once again the algorithm adapts
the sensing threshold, this time to its new optimal value of
about 0.62. The 𝑃𝑚𝑑 and 𝑃𝑓 𝑎 values corresponding to these
threshold values are also shown in Fig. 2.
We note that the value of the sensing threshold is lower
for higher SNR and higher for lower SNR. We also note that,
as it is the case in general with gradient-based algorithms,
convergence of the proposed algorithm depends on the step
size 𝜇 which may be adjusted to achieve desired convergence
speed.
VI. C ONCLUSIONS
In this letter we have studied the optimization of the sensing
threshold for energy detectors under constraints imposed on
the probabilities of missed detection and false alarms. We
have also proposed a gradient-based algorithm for threshold
adaptation in dynamic scenarios, in which the active PU signal
and/or the background noise variances change in time. The
proposed algorithm is illustrated with numerical examples
obtained from simulations, which confirm its effectiveness in
optimizing the sensing threshold, as well as in adapting it in
dynamic scenarios.
R EFERENCES
[1] W. Krenik, A. M. Wyglinsky, and L. Doyle, “Cognitive radios for
dynamic spectrum access,” IEEE Commun. Mag., vol. 45, no. 5, pp.
64–65, May 2007.
[2] S. Haykin, D. J. Thomson, and J. H. Reed, “Spectrum sensing for
cognitive radio,” Proc. IEEE, vol. 97, no. 5, pp. 849–877, May 2009.
[3] D. Cabric, “Cognitive radios: system design perspective,” Ph.D. dissertation, University of California, Berkeley, 2007.
[4] M. Ŏner and F. Jondral, “On the extraction of the channel allocation
information in spectrum pooling systems,” IEEE J. Sel. Areas Commun.,
vol. 25, no. 3, pp. 558–565, Apr. 2007.
[5] O. A. Dobre, S. Rajan, and R. Inkol, “Joint signal detection and
classification based on first-order cyclostationarity for cognitive radios,”
EURASIP J. Advances in Signal Process., July 2009.
[6] C. Spooner, W. A. Brown, and G. K. Yeung, “Automatic radio-frequency
environment analysis,” in Proc. 34th Annual Asilomar Conference on
Signals, Systems, and Computers, vol. 2, Pacific Grove, CA, Oct. 2000,
pp. 1181–1186.
[7] B. Farhang-Boroujeny and R. Kempter, “Multicarrier communication
techniques for spectrum sensing and communication in cognitive radios,” IEEE Commun. Mag., vol. 46, no. 12, pp. 80–85, Apr. 2008.
[8] H. Urkowitz, “Energy detection of unkown deterministic signals,” Proc.
IEEE, vol. 55, pp. 523–531, Apr. 1967.
[9] H. Ketterer, F. Jondral, and A. H. Costa, “Classification of modulation
schemes using time-frequency methods,” in Proc. ICASSP’99, vol. 5,
Phoenix, AZ, May 1999, pp. 2471–2474.
[10] J. A. Cadzow, “Spectral estimation: an overdetermined rational model
equation approach,” Proc. IEEE, vol. 70, no. 9, pp. 907–939, Sep. 1982.
[11] K. K. Paliwal, “Estimation of noise variance from the noisy AR signal
and its application in speech enhancement,” IEEE Trans. ASSP, vol. 36,
no. 2, pp. 292–294, Feb. 1988.