Energy Detection Using Estimated Noise Variance For Spectrum Sensing in Cognitive Radio Networks
Energy Detection Using Estimated Noise Variance For Spectrum Sensing in Cognitive Radio Networks
=
M
k
k M
x
1
2 1
) (
<
>
0
1
H
H
Fig. 1. Block diagram of a energy detector
x(t)
x
k
u
1525-3511/08/$25.00 2008 IEEE
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the WCNC 2008 proceedings.
711
noise power is known. However, they did not show how the
dynamic range can be derived or estimated. We believe our
analysis is more applicable to the practical spectrum sensing
problem: how can we set the threshold based on a real time
estimation of the noise power, so that we can still guarantee
the target probability of detection, or the probability of false
alarm?
The rest of the paper is organized as follows. In Section II,
we review the system model of energy detection using binary
hypothesis testing, and the CFAR and CDR principles in
spectrum sensing. In Section III, we present our model to
analyze the expected performance of energy detection based
on estimated noise variance. Section III also presents some
characteristics of our analytical model and how they impact
the performance of spectrum sensing. We give a simulation
example in Section IV and conclude the paper in Section V
with a summary.
II. SYSTEM MODEL
The goal of spectrum sensing is to determine if a licensed
band is currently used by its primary owner or not. This can be
formulated into a binary hypothesis testing problem [5]:
+
=
) ( ), ( ) (
) ( ), (
) (
1
0
occupied H k n k s
vacant H k n
k x , (1)
where the primary users signal, the noise, and the received
signal are denoted by s(k), n(k), and x(k) respectively. The
noise is assumed to be iid random process of zero mean and
variance of
2
n
, whereas the signal is also assumed to be iid
random process of zero mean and variance of
2
s
. The signal
to noise ratio is defined as the ratio of the signal variance to
the noise variance
2 2
/
n s
SNR = . (2)
The test statistic generated from the energy detector as
shown in Fig. 1 is
=
=
M
k
k
x
M
u
1
2
) (
1
(3)
Under both hypotheses H
0
and H
1
, the test statistic u is a
random variable whose probability density function (PDF) is
chi-square distributed. When M is sufficiently large, we can
approximate the PDF using Gaussian distribution:
1
4 2
0
4 2
), / 2 , (
), / 2 , (
~ ) (
H under M N
H under M N
u f
t t
n n
U
, (4)
where
2
t
is the total variance of signal plus noise, i.e.,
) 1 (
2 2 2 2
SNR
n s n t
+ = + = . (5)
For a given threshold , the probability of false alarm is given
by the Q function:
)
2 / /
( ) | (
2
2
0
M
Q H u prob P
n
n
fa
= > = . (6)
If the required probability of false alarm rate (P
fa
) is
predetermined, the threshold (
fa
) can be set accordingly by
)
2 /
) (
1 (
1
2
M
p Q
fa
n fa
+ = . (7)
Similarly, under hypothesis H
1
, we can derive the threshold in
order to achieve a target probability of detection at the
required signal level or SNR:
)
2 /
) (
1 )( 1 (
1
2
M
p Q
SNR
d
n d
+ + = . (8)
If the cognitive radio network is required to guarantee a
reuse probability of the unused spectrum, the probability of
false alarm is fixed to a small value (e.g., 5%) and the
detection probability should be maximized as much as
possible. This is referred to as constant false alarm rate
(CFAR) principle [4]. On the other hand, if the cognitive radio
is required to guarantee a non-interference probability to the
incumbent systems, the probability of detection should be
fixed to a high value (e.g., 95%) and the probability of false
alarm should be minimized as much as possible. This
requirement is referred to as the constant detection rate (CDR)
principle [4]. It can be seen from (7) and (8) that the derivation
of the threshold values for CFAR and CDR are similar, so the
analytical results derived by assuming CFAR based detection
can be applied to CDR based detection with minor
modifications and vice versa.
III. EXPECTED ENERGY DETECTOR PERFORMANCE USING
ESTIMATED NOISE VARIANCE
In Section II, we notice that the threshold values in (7) and
(8) are derived from the exact noise variance
2
n
. However, it
is very difficult to assume the exact knowledge of noise
variance will be available in practice. The total noise consists
of thermal noise, receiver noise, and environmental noise,
which can vary significantly from time to time. In this paper,
instead, we assume only an estimated noise variance
2
n
is
available to calculate the thresholds used in energy detection.
The practicality of performing real time noise estimation
can be justified with two examples. In one example, we can
assume the spectrum regulators still wants to reserve certain
channel for special applications, and secondary users are never
allowed to access this channel. In addition, this special
channel is rarely used and therefore can serve the purpose of
noise estimation. In United States, for example, channel 37
(from 608 to 614 MHz) is reserved for radioastronomy and is
used in very few occasions. In another example such as the
detection of DTV signal in US, it is helpful to detect the DTV
pilot signal which is a distinct narrow band spectral feature.
After performing the power spectral density (PSD) estimation
on the received signal, under low SNR assumptions, the noise
variance can be estimated from some frequency bin not
corresponding to the pilot frequency. In both examples, a
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the WCNC 2008 proceedings.
712
threshold can be derived from the estimated noise variance
based on CFAR or CDR requirement. Then the threshold is
compared with the detected energy from the channel of
interest or from the known pilot frequency bin, in order to
determine whether a signal is present.
In this section, we want to find out the answers to these two
important questions: 1) can we simply replace the exact noise
variance
2
n
in (7) and (8) with the estimated noise
variance
2
n
, i.e.,
)
2 /
) (
1 )( 1 (
),
2 /
) (
1 (
1
2
1
2
M
P Q
SNR or
M
P Q
d
n d
fa
n fa
+ + = + = ,(9)
and still achieve, at least asymptotically, the target probability
of false alarm or detection? 2) If not, what kind of
performance in terms realistic detection probability and
realistic false alarm probability can be expected, when the
threshold is selected using (9)?
A. Asymptotic Analysis
Denote Y as the estimated noise variance from the reference
channel (Ch
i
) known to be vacant using energy detection
method. Denote X as the energy detection result from the
channel of interest (Ch
j
). We assume the number of samples
used to estimate noise variance is the same as the number of
samples used to perform spectrum sensing, denoted by M.
This assumption helps us to give concise expressions and
insightful analysis in this paper. In practice, this assumption
might not hold strictly. However, the results shown in this
paper can be readily generalized to reflect the changes.
First, we consider CFAR based detection. Since we assume
H
0
is true when deriving the probability of false alarm, X and
Y should have the same PDF from (4) if M is sufficiently
large:
) / 2 , ( ~ ,
4 2
M N Y X
n n
. (10)
It can be seen that when M approaches infinity, both X and Y
converges to the true noise variance
2
n
. However, since we do
not know the true mean of X (i.e.,
2
n
), we have to use Y
(i.e.,
2
n
) as the estimate of the mean of X instead. Therefore
the variance of X should be calculated by
2 2 2
2
2
2
2
2 2 2
2 2 2 2
} 2 { } ) {( ) | var(
n n y x
Y Y X Y X
XY Y X E Y X E Y X X
= = + + + =
+ = = =
. (11)
So the PDF of X should actually be approximated by
) / 4 , ( ~
4 2
M N X
n n
, (12)
instead of
) / 2 , ( ~
4 2
M N X
n n
. (13)
When deriving (11), we include the condition of Y X = to
reflect the fact that we are using an estimate of the real mean
value. From (12) and (13), we can conclude that simply using
(9) to calculate the estimated threshold, will never achieve the
target probability of false alarm no matter how many samples
are averaged. Asymptotically, since the real variance is
approximately twice of the original variance (12), we have
)
2
) (
( ) |
(
1
fa
fa fa
P Q
Q M p
=
. (14)
The notations in (14), together with other notations to be
used in the rest of the paper, are described in Table I. We only
include the notations used in CFAR based detection to make
this paper more concise. The notations used in the CDR based
detection have d in the subscript and should have the similar
definitions as their counterparts used in CFAR based
detection.
The real probability of false alarm ( fa P ) is a function of
estimated threshold, whereas the estimated threshold (
fa
) is
determined by the number of samples being averaged (M).
Therefore, (14) is written in a manner to emphasize these
relationships.
TABLE I. SUMMARY OF NOTATIONS
Notation Definition
Pfa Target probability of false alarm
fa Threshold calculated using exact noise variance for CFAR
detector:
)
2 /
) (
1 (
1
2
M
P Q
fa
n fa
+ =
fa
Threshold calculated using estimated noise variance for CFAR
detector:
)
2 /
) (
1 (
1
2
M
P Q
fa
n fa
+ =
fa P
The expected probability of false alarm results from estimated
threshold
fa
Qfa The target system level probability of false alarm using OR
rule based cooperative sensing
fa
Q
The expected system level probability of false alarm using OR
rule based cooperative sensing
Using the derivation above on CDR based detection, a
similar formula can be given to asymptotically predict the real
probability of detection ( d P ) when the threshold is calculated
using (9):
)
2
) (
( ) |
(
1
d
d
d
P Q
Q M P
=
(15)
When M is not large enough, the asymptotic results in (14)
and (15) cannot accurately predict the expected probabilities
of the energy detection, with the threshold calculated from
estimated noise variance by (9). Therefore, an analytical
model is needed for the cases when M is moderate.
B. Analytical Model
Using the same notations of X and Y as in the asymptotic
analysis, the estimated noise variance (Y) is a random variable
itself, therefore the probability of false alarm or detection is
conditioned on one observation of the random variable, e.g., y.
For example, if CFAR based detection is used, the
probability of false alarm can be written as
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the WCNC 2008 proceedings.
713
), ( }
{
) 2 / / ) ( 1 (
1
x
x fa
M P Q y
fa
Q X prob
+
= > (16)
where
fa
+ +
. (17)
We use Q
a
(x, M) to denote the integration to compute the
expected probability, where ) (
1
fa
P Q x
= and M is the number
of samples being averaged. In (17), t is defined by
x x
y t / ) ( = . The closed-form expression of fa P is not
available, however, numerical results can be obtained. In Fig.
2, we display fa P as a function of M for ) 01 . 0 (
1
= Q x . We
can observe that when M goes to infinity, fa P converges
to ) 2 / (x Q . This observation matches our asymptotic
analysis in the previous subsection (14). In addition, when the
exact noise variance is known, t becomes zero in (17).
Evaluating (17) shows fa P equals P
fa
as expected. However,
when t is not zero, no matter how many samples are averaged
in the energy detection (M),
fa P can never converge to
P
fa
.
If CDR based detection is used, the results shown above
also apply except fa P and P
fa
are replaced by d P and P
d
respectively.
C. Characteristics of the Analytical Model
We study the characteristics of the analytical model, in
particular, the function Q
a
(x, M), and then analyze how these
2
We skip the derivation of (17) and the details in proving of the claims in
Section C. Instead of showing algebraic details, we want to emphasize the
numerical results and how they can be used in the spectrum sensing.
characteristics can affect the performance of spectrum sensing.
CLAIM 1: Consider the generalized form of Q
a
(x, M), given
by
+ + =
dt e y t x Q y x Q
t
a
2 /
2
1
2
)) 1 ( ( ) , (
. (18)
Then we claim:
1.1 when x>0, ) ( ) 1 , ( ) , ( x Q x Q y x Q
a a
=
1.2 when x<0, ) ( ) 1 , ( ) , ( x Q x Q y x Q
a a
=
1.3 when x=0, 5 . 0 ) ( ) , ( = = x Q y x Q
a
PROOF: Take the derivative of Q
a
(x, y) with respect to y, and
claims 1.1 and 1.2 can be proved by evaluating the derivative.
Claim 1.3 can simply be proved by plugging in x=0 into (17).
CLAIM 2: Consider again Q
a
(x,y) as shown in (18), then,
2.1 when x>0, Q
a
(x, y) is monotonically decreasing with
respect to y when y>0.
2.2 when x<0, Q
a
(x, y) is monotonically increasing with
respect to y when -1<y<0.
PROOF: Claim 2 can be proved by evaluating the derivative
of Q
a
(x, y) as in the proof of claim 1.
CLAIM 3: Consider Q
a
(x, M) as shown in (17), then,
3.1 when x>0, Q
a
(x, M) > Q
a
(x, ) > Q(x)
3.2 when x<0, Q
a
(x, ) < Q
a
(x, M) < Q(x)
3.3 given M
1
>M
2
, Q
a
(x, M
1
) < Q
a
(x, M
2
)
PROOF: We notice that Q
a
(x, M) is a special case of Q
a
(x, y)
where 2 / / M x y = . In this case, x and y should have the
same sign, therefore claim 3 can be proved by using claim 1
and claim 2.
Fig. 3 displays two numerical examples of Q
a
(x, y), where x
takes on a positive value and a negative value respectively.
The first two claims are clearly illustrated in Fig. 3, whereas
claim 3 can be observed from Fig. 2.
D. Applications to Spectrum Sensing
We consider first the non-cooperative spectrum sensing
scenario, i.e., only one radio performs the energy detection.
Generally, the probability of detection is required to be high
3 2.5 2 1.5 1 0.5 0 0.5 1 1.5 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Fig. 3 Characterization of Qa(x, y) as a function of y,
using two different valued x
variable y
Q
a
(
x
,
y
)
28 . 1 ) 9 . 0 (
1
= =
Q x
28 . 1 ) 1 . 0 (
1
+ = =
Q x
10
1
10
2
10
3
10
4
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
number of samples averaged (M)
P
r
o
b
a
b
i
l
i
t
y
o
f
f
a
l
s
e
a
l
a
r
m
) 01 . 0 (
1
= Q x
) , ( M x Q P
a
fa =
) 2 / (x Q
01 . 0 ) ( = x Q
Fig. 2. Characterization of Qa(x, M) as function of M
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the WCNC 2008 proceedings.
714
(e.g., P
d
>90%), whereas the probability of false alarm needs to
be low (e.g., P
fa
<10%). When CFAR based detection is used,
then 0 ) (
1
> =
fa
P Q x holds in this case. Therefore if the
threshold is calculated using (9) with estimated noise variance,
the expected probability of false alarm will be higher than the
target false alarm rate (claim 1). It helps to increase the
number of samples being averaged (M), however the target
false alarm rate cannot be achieved. In order to achieve the
target false alarm rate in practice, the threshold needs to be
raised. On the other hand, the detection probability will
decrease due to the raised threshold. Since we dont have
closed-form expressions for (17) and (18), a numerical method
is needed to calculate the correct threshold.
When CDR based detection is used, then 0 ) (
1
< =
d
P Q x
holds in this case. Based on claim 1 again, Q
a
(x, M) equals
Q(x) only when M x = is satisfied. When M=10, the
detection probability needs to be
9992 . 0 ) 10 ( ) ( = = = Q x Q P
d
. (19)
When M is larger, the probability of detection is even greater
than 0.9992. It is not likely an individual radio can achieve
such high detection rate without experiencing high false alarm
rate. Therefore, using (9) to set the threshold cannot achieve
the target probability of detection in general. In addition,
based on claim 3, the expected detection probability decreases
when we increase M. Increasing M, by averaging more
samples, can nonetheless help decrease the false alarm rate.
We need to decrease the threshold calculated by (9) to meet
the target detection probability, while keeping the false alarm
rate at an acceptable level.
We then consider the cooperative spectrum sensing that
uses OR fusion rule [6]. In cooperative sensing, the false
alarm rate or detection probability is measured at the system
level. In OR fusion rule, the system level false alarm rate (Q
fa
)
and the system level detection probability (Q
d
) are determined
by,
N
d d
N
fa fa
P Q
P Q
) 1 ( 1
) 1 ( 1
=
=
, (20)
where P
fa
and P
d
are, respectively, the radio level probability
of false alarm and detection, and N is the number of radios
participate in the cooperative sensing. In (20), the
measurements taken by each radio are assumed to be
independent from each other. Table II shows two cooperative
sensing examples based on CFAR principle, using target false
alarm rates of 10% and 1% respectively. The number of radios
participate in the sensing operation is 10. In both cases, we
calculate the threshold using (9) with the estimated noise
variance, where P
fa
is calculated based on (20) using the given
Q
fa
. Then we calculate the expected probabilities of false
alarm at the radio level (M is assumed to be infinity) and the
system level using (17) and (20). It can be seen that
fa
Q and
Q
fa
can differ by a factor of 13. Therefore the precision of the
threshold is very important in cooperative sensing using
CFAR based detection.
TABLE II. EXPECTED FALSE ALARM RATE VS. TARGET FALSE ALARM RATE
Q
fa
P
fa
fa P
fa
Q
fa fa
Q Q /
0.1 0.0105 0.0513 0.41 4.1
0.01 0.001 0.0145 0.136 13.6
If CDR based detection is used in cooperative spectrum
sensing, we notice the radio level detection probability can be
less than 0.5 when N is moderately large. For example, if Q
d
is
required to be 0.95, then P
d
is only required to be 0.26 if 10
radios are used in the cooperative spectrum sensing using OR
fusion rule. Then, different from the individual sensing
scenario, we note 0 ) (
1
> =
d
P Q x holds instead. Based on
claim 3,
d
P is expected to be higher than P
d
, and so is
d
Q compared with Q
d
. Since we are only required to achieve
the detection probability of Q
d
, the threshold calculated using
(9) is too conservative. We can therefore raise the threshold,
and the raised threshold can help minimize the probability of
false alarm.
IV. NEW THRESHOLD AND SIMULATION EXAMPLE
We define a new variable u that satisfies
d a
P M u Q = ) , ( . (21)
Then the new threshold, given by,
)
2 /
1 )( 1 (
2
M
u
SNR
n new
+ + = , (22)
can achieve the target probability of detection. We want to
express the new threshold in a similar form as used in the
original formula (9). To show the effectiveness of the new
threshold, we give two simulation examples of cooperative
sensing using CDR principle. In both simulations, we set Q
d
to
95% when SNR is -6dB. We change the number of radios
participate in the cooperative sensing between two
simulations. We use N=10 radios in one simulation, and N=25
radios in the other. The simulation compares the cooperative
sensing results using the old threshold resulted from (9) and
the new threshold resulted from (20) and (21). The simulation
results are displayed in Fig. 4. In both simulations, we can see
Q
d
is kept at the target 95% using the new threshold. As
pointed in Section III, the old threshold is set too
conservatively; therefore the resulted Q
d
is in fact greater than
95%. In addition, the Q
fa
resulted from the new threshold is
lower than the Q
fa
using the old threshold. Lower Q
fa
indicates
more spectrum sharing opportunities can be identified using
the new threshold setting method.
When we compare the system false alarm rates Q
fa
between
the two simulations, we notice when 25 radios are used in the
cooperative sensing, the resulted Q
fa
is lower than the Q
fa
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the WCNC 2008 proceedings.
715
resulted from 10 radios cooperation. In addition, the difference
between the Q
fa
resulted from the old threshold and the Q
fa
resulted from the new threshold is larger in the example of 25
radios cooperation than in the example of 10 radios
cooperation. This is because when the number of radios
increases, the required detection probability at the radio level
(P
d
) decreases if the system level detection probability is kept
the same. To simplify the analysis, we assume M approaches
infinity, then the expected probability of detection d P should
be ) 2 / ) ( (
1
d
P Q Q
, when the old threshold from (9) is used.
The function ) (
1
x Q