DESIGN AND IMPLEMENTATION OF SEQUENCE DETECTION ALGORITHMS FOR DYNAMIC SPECTRUM ACCESS NETWORKS A Thesis Submitted to the Graduate School of the University of Notre Dame in Partial Fulfillment of the Requirements for the Degree of Master of Science in Electrical Engineering by Zhanwei Sun, J. Nicholas Laneman, Director Graduate Program in Electrical Engineering Notre Dame, Indiana April 2010
104
Embed
DESIGN AND IMPLEMENTATION OF SEQUENCE …jnl/pubs/zsun-ms-nd-2010.pdf · sequence detection algorithms, the complete forward algorithm and the complete ... f for any detector leads
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
2.3 Two realizations of energy detection. a) Implementation with ana-log pre-filter and square-law device. b) Implementation using FFTmagnitude squared and averaging . . . . . . . . . . . . . . . . . . 13
2.4 Typical TX and RX path for a software radio . . . . . . . . . . . 22
and the complete forward-backward algorithm with an infinitely long sensing win-
dow, giving a tradeoff between sensing performance and sensing delay/complexity.
Figure 3.5 illustrates the difference between CFA, CFPB and the general forward-
backward algorithm based upon sensing window.
3.4 Comparison to Energy and Coherent Detection
In this section, we introduce a new limitation of standard energy and coherent
detection. The first part of this section is not really something new, but we review
39
energy detection and coherent detection and discuss their threshold selection to
the problem of minimizing the detection risk given the cost factors. This is done
by relating their thresholds to that of the proposed weighted forward-backward
algorithm in an extreme case. In the second part, we then introduce the new
fundamental limitation which we call the risk floor.
We start our discussion from the extreme case in which there is no state change
within one sensing window. This condition corresponds to a scenario in which
the transition probabilities p01 = p10 = 0. Therefore, αt(i)βt(i) in the weighted
sequence detection algorithm simplifies to:
αt(0)βt(0) = π0
T∏τ=1
fY |S(yτ |0) = π0fY |S(y|0) (3.28)
αt(1)βt(1) = π1
T∏τ=1
fY |S(yτ |1) = π1fY |S(y|1), (3.29)
where fY |S(y|0) and fY |S(y|1) are joint probability density functions of the whole
received signal Y = (Y1, Y2, · · · , YT ) in a sensing window given the PU state is OFF
and ON, respectively. The result is independent of time index t. Therefore, the
comparison between the two risks Rt(0) and Rt(1) is equivalent to the following
decision rule
π0(C10 − C00)fY |S(y|0)0
≷1π1(C01 − C11)fY |S(y|1), (3.30)
which can be alternatively written as
fY |S(y|0)
fY |S(y|1)
0
≷1εs, (3.31)
where εs = [π1(C01−C11)]/[π0(C10−C00)]. The result corresponds to the classical
40
likelihood ratio test for minimizing the risk function [18]. Let A be the ON-
decision region for a detector. An ON-decision region is a subset of all possible
outcomes y in which the detection algorithm declares channel to be in ON state.
In general, the false alarm and detection probabilities for a given detector are
Pf =
∫AfY |S(y|0)dy, (3.32)
Pd =
∫AfY |S(y|1)dy, (3.33)
respectively. We use the term “decision region” exclusively for the case in which
there is no state change in a sensing window for the weighted forward-backward
algorithm, since only in this case will the detector make the same decision for
every symbol in the block, i.e., it is a block decision rather than a sequence of
individual decisions. For energy detection and coherent detection which make a
single decision for each block, the term “decision region” always makes sense. The
ON-decision region AS for the weighted sequence detection algorithm is obvious
from Equation (3.31).
3.4.1 Threshold for Energy Detection and Coherent Detection
If the signal and the noise process both follow zero-mean identical indepen-
dent Gaussian distributions, weighted forward-backward algorithm is equivalent
to energy detection for the extreme case in which it is guaranteed no state change
occurs in a sensing window. To see this, let εs be the threshold for the weighted
sequence detection and εe be the threshold for energy detection. εs and εe are cho-
sen such that they give the same false alarm probabilities P f . The ON-decision
41
region for energy detection is [5]
AE =
{y
∣∣∣∣ 1
T
T∑t=1
|yt|2 > εe(Pf )
}. (3.34)
On the other hand, for weighted sequence detection
fY |S(y|0)
fY |S(y|1)=
∏Tt=1 fY |S(yt|0)∏Tt=1 fY |S(yt|1)
=
∏Tt=1
1√2πσ2
0
e− y2t
2σ20
∏Tt=1
1√2πσ2
1
e− y2t
2σ21
, (3.35)
where σ20 = σ2
w and σ21 = σ2
w + σ2x. Therefore, the log-likelihood ratio test is
lnfY |S(y|0)
fY |S(y|1)= T ln
σ1
σ0
−(
1
2σ20
− 1
2σ21
) T∑t=1
y2t , (3.36)
and the ON-decision region for the weighted forward-backward algorithm can be
simplified to
AS =
{y
∣∣∣∣ 1
T
T∑t=1
|yt|2 > 2σ20σ
21
σ21 − σ2
0
(lnσ1
σ0
− 1
Tln εs(Pf )
)}, (3.37)
where σ20 = σ2
w and σ21 = σ2
w + σ2x. Since the ON-decision region for sequence
detection and energy detection are both T -dimensional balls, one should be a
subset of the other in the T -dimensional space, and for the same false alarm
probabilities, they should be identical, which in turn gives
εe(Pf ) =2σ2
0σ21
σ21 − σ2
0
(lnσ1
σ0
− 1
Tln εs(Pf )
). (3.38)
Therefore, the detection probabilities are the same as well.
Although Equations (3.34, 3.37, 3.38) show the decision regions for energy
42
detection and weighted forward-backward algorithm are the same under the con-
cerned condition, the importance of these equations goes beyond this. Since
εs = [π1(C01−C11)]/[π0(C10−C00)], Equation (3.38) essentially relates the thresh-
old for energy detection to the cost factors for missed detections and false alarms
and results in an optimal threshold in the sense of minimizing the detection risk.
Compared to the often-used Gaussian approximation according to central limit
theorem for∑T
t=1 |yt|2/T [5], here we provide an accurate computation for the
optimal threshold for energy detection that minimizes the expected cost. As stan-
dard energy detection does not consider the PU’s channel access pattern, it always
uses the threshold derived above to minimize the detection risk given the received
signal power, noise power and cost factors.
It is also worth noting that the proposed sequence detection algorithms we
derived in Section 3.2 depend on accurate knowledge of the distribution of the
observed symbols given the channel state as well as the channel state transition
probabilities. These parameters are not easily known in practice. However, for
one thing, these parameters can be estimated by the Baum-Welch algorithm [17],
which we will study in our future work. For another, if the conditional pdf cannot
be obtained anyway, we can integrate energy detection and the sequence detection
algorithms by dividing the whole sensing window into a sequence of sub-windows
and applying Gaussian approximation to the test statistics of each sub-window
according to central limit theorem. The test statistics is generated by averaging
the received power in each sub-window and is exactly the same as the test statistics
for energy detection. But we are not really implementing energy detection on a
sub-window basis since no final decision is made for each sub-window. We just
want to collect the raw test statistics without comaring it to any threshold. In
43
this way, we cannot only implement the proposed sequence detection algorithms
with insufficient statistics, but also reduce the computational complexity. The
expense of this integration of energy detection and sequence detection algorithms
is an increasing granularity and possible sensing delay.
Another scenario can arise if the PUs spare a certain amount of energy to
transmit pilot signals. For simplicity, we assume the PU always transmits 1 with
normalized signal power when it is occupying the channel. Therefore, in a similar
way, the threshold for coherent detection εc can be shown to relate to that of the
sequence detection by
εc(Pf ) =1
2+σ2w
Tln εs(Pf ). (3.39)
3.4.2 Risk Floor For Energy Detection
For the weighted forward-backward algorithm that minimizes the detection
risk, we expect the risk to decrease continuously with increasing SNR. However,
for energy detection, there exists a certain risk level that it cannot surpass even
with an arbitrarily large SNR. We call this limit the risk floor. The risk floor is
caused by finite PU dwell time. We will provide an approximation for the risk
floor in this section and validate its existence by simulation in the next chapter.
We start with a theorem that essentially states that even one ON state sample
in a sensing window can trigger the energy detector to make an ON decision with
high probability if the SNR is large.
Theorem: Suppose the PU follows a certain spectrum access pattern and its
dwell time is finite. If the optimal threshold εe in (3.38) that minimizes the
44
detection risk for the given four cost factors is applied for energy detection, then
P
(1
T|Xτ +Wτ |2 > εe
)→ 1, as SNR→∞, (3.40)
where τ is any time instant within a sensing window. Without loss of generality,
let σ20 = σ2
w = 1. Define SNR=10 log10(σ2x/σ
2n) = 20 log10 σx. For high SNR,
εe = 2
(lnσx − 1
Tlnπ1(C01 − C11)
π0(C10 − C01)
)=
ln 10
10SNR− 2εs
T. (3.41)
Therefore,
P
(1
T|Xτ +Wτ |2 > εe
)≈ P
(1
T|Xτ |2 > εe
)= 2P (Xτ >
√εeT )
= 2Q
(√ ln 1010T · SNR− 2εs
10SNR
10
)→ 1 (3.42)
as SNR →∞ for fixed T and εs. Furthermore,
P
(1
T
T∑t=1
|Yt|2 > εe
)> P
(1
T|Xτ +Wτ |2 > εe
)→ 1 (3.43)
as SNR →∞ as well if Yτ = Xτ +Wτ is an ON state sample.
This theorem implies that for high SNR, a sensing window with even one ON
state sample will lead to an ON decision. Obviously, the probability of missed
detection goes to zero and the risk is dominated by false alarm, which can be
either of the two types illustrated in Figure 3.6. Note that type II may not be
called a false alarm since it makes a correct decision for the channel’s future
45
Sensing Window
Sensing Window
PU Inactive / Channel OFFPU Active / Channel ON
(a)
(b)
Figure 3.6. Two cases leading to false alarms for energy detection whenthe PU state changes during a sensing window.
state by declaring the channel is ON. However, for simplicity, we assume the SU
continuously senses the spectrum without transmitting and the decision is made
for the current block or symbol. Therefore, the ON decision for the whole block
leads to false alarms for the first part of the sensing window in which the channel
is still OFF as shown in the figure.
We will only consider the case in which the window length T � min{E[L0],E[L1]}since things get even worse when T is comparable to E[L0] and E[L1] as we
will see in the numerical results. Type I corresponds to the case in which the
channel changes from state ON to OFF in a sensing window. The condition
T � min{E[L0],E[L1]} guarantees that the probability of multiple channel state
46
changes during one sensing window is negligible in computing the channel state
change probability in a sensing window. The symbol risk for type I false alarm is
RI = π1C01
T−1∏t=1
(P (L1 = t) · T − t
T
)= π1C01
(1− 1− pT11
Tp10
). (3.44)
Similarly, the symbol risk for type II false alarm is
RII = π0C10
T−1∏t=1
(P (L0 = t) · t
T
)= π0C10
(1− pT00
Tp01
− pT−100
). (3.45)
Thus, we approximate the risk floor of energy detection by
RF ≈ RI +RII. (3.46)
Intuitively, false alarms are caused primarily by randomness and confusion in the
primary signal and noise for low SNR, and they are dominated by channel state
changes for high SNR. Since the risk floor results from not considering channel
state changes, it can be shown in a similar way that the risk floor arises for coherent
detection as well. Numerical results verifying the existence of this risk floor are
provided in the following chapter.
47
CHAPTER 4
NUMERICAL RESULTS
This chapter provides numerical results demonstrating the improved perfor-
mance that the new sequence detection algorithms exhibit over energy and coher-
ent detection. For simplicity, we assume the SU continuously senses the spectrum
and never transmits.
4.1 Sequence Detection versus Energy and Coherent Detection
We first consider a specific realization in which some proposed sequence de-
tection algorithms and energy detection are applied. We focus our discussion on
the low SNR scenario in which a large sensing window is likely to be required.
Let E[L0] = 2000 and E[L1] = 1000, which give state transition probabilities
p01 = 0.0005 and p10 = 0.001. The signal and noise variance are set so that SNR
= −10 dB. In Figure 4.1, we plot the detection probability versus sensing window
length T for a fixed false alarm probability P f = 0.1. The result for CFA is in-
dependent of T and is provided for comparison. The simulation leads to several
important conclusions.
First, if T � min{E[L0],E[L1]}, which implies that the probability of chan-
nel state change within a sensing window is relatively small, the performance of
the weighted sequence detection algorithm, non-overlapping energy detection and
48
1 1.5 2 2.5 3 3.5 4 4.5 50.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
log10
(T)
P d=1−
P m
Sliding Energy DetectionComplete Forward AlgorithmBlock Energy DetectionWeighted Forward−Backward
Figure 4.1. Detection performance and sensing window length.E[L0] = 2000, E[L1] = 1000, SNR=-10dB, P f = 0.1, C01 = 1, C10 = 1.
overlapping energy detection are very similar. However, if the length of the sens-
ing window is comparable to the average length of an ON/OFF period, the effect
of state changes in a sensing window comes into play and the performance of en-
ergy detection is seriously affected since it does not account the PU dwell time.
On the other hand, the performance of the weighted sequence detection algorithm
continues to improve with increasing window length. The performance does not
degrade since the algorithm itself takes possible state change into consideration.
Second, for both overlapping and non-overlapping energy detection, there is an
49
optimal window length T ∗ that gives the best detection probability P ∗d for a fixed
P f , given SNR and the PU’s channel access statistics. If the window length ex-
ceeds T ∗, the detection performance degrades because the energy detector groups
observations from multiple PU states. Although no theoretical analysis is provided
here, we call this limitation of energy detection (and coherent detection in the next
example) the window length limitation. It is anther limitation for spectrum sens-
ing performance besides the well-known SNR-wall [6]. It implies that not every
desired operating point (Pf , Pm) is achievable even with the noise power perfectly
known (no SNR wall) since the sensing window cannot be arbitrarily long. More
interestingly, the proposed sequence detection algorithms cannot achieve arbitrar-
ily large detection probability either, even with infinite window length. On the
contrary, the detection probability corresponding to a given false alarm probabil-
ity approaches a limit as T becomes large as shown in the figure. This implies that
PHY layer detection methods are performance limited by the PU’s channel access
Figure 5.2. Pilot structure and half-pilot-size sensing window.
In fact, the PU is not actually silent in an OFF period. Instead, it simply
sends all zeros to the USRP to transmit. This “fake” OFF signal generation in
the demonstration is a result of certain limitations both from the software and from
the USRP. From the software point of view, although the sleep function in python
can be used to generate the OFF period, it is not precise and therefore hard to be
fit into a Markov model whose transition probabilities are known precisely. From
61
the hardware point of view, the time for the USRP to switch from “transmitting”
to “silent” (and vice versa) is significant and may be much longer than the time
to transmit a packet.
After the pilots transmission, the PU begins to access the channel in a Markov
chain modeled way, as shown in Figure 5.3. Specifically, the number of packets
in an ON state and an OFF state follow geometric distributions with parameters
p10 and p01, respectively. The entire transmission structure of the PU is shown in
Figure 5.3.
One period of ON-OFF pilot sequence
· · · · · · · · · · · ·
n pilot repeat pilot periods Markov chain modeled transmission
Figure 5.3. PU’s channel access structure.
5.3 Spectrum Analysis, Modeling and Learning by Secondary User
To implement any detector, the SU needs to know at least the received SNR.
We can certainly estimate this parameter offline and feed them into the software
engine of the SU. However, this is not preferable in practice because, for one thing,
both the noise power and the received signal power are subject to change and the
offline estimation may become outdated very soon, and for another, we want the
62
detectors to be as intelligent as possible. In our framework, the SU will estimate
TABLE 5.1
Implementation parameters for wireless system
Variable name Value Definition
s payload 1980 size of payload (in bytes)
s redundancy 20 size of preamble, access code, header, CRC andUSRP pad in total (in bytes)
ns pilot tx 160000 number of samples in an ON/OFF pilot sequencein the transmitter
ns pilot rx 160000 number of samples in an ON/OFF pilot sequencein the receiver
ns packet tx 32000 number of samples in a packet in the transmitter
ns packet rx 32000 number of samples in a packet in the receiver
ns win 32000 number of samples in a sensing window
n packet in pilot 5 number of packets in each ON/OFF pilot period
n pilot repeat 5 how many times the ON-OFF pilot sequence re-peats before the Markov transmission
n E ON 10 Expected number of packets in an ON state
n E OFF 10 Expected number of packets in an OFF state
interp 128 FPGA interpolation factor on the transmitter
decim 64 FPGA decimation factor on the receiver
bit per symbol 1 bit per symbol
sample per symbol 2 sample per symbol
63
the received SNR based on the PU’s pilot signals. In order to do so, it should
first detect the starting point of the pilot transmission. The software engine of
the SU also needs to be robust enough to differentiate any bursty variation in
noise (background) from the real pilot transmission to avoid a false declaration.
Therefore, the software engine of the SU is implemented in three states (modes):
• PROBING.
• TRACKING.
• SENSING.
A flow graph showing how the software engine of the SU works in our experi-
mental framework is illustrated in Figure 5.4. We will discuss the functionalities
of each state in detail in the following parts of this section.
64
InP
RO
BIN
Gst
ate:
stor
eda
ta,
InT
RA
CK
ING
stat
e:st
ore
data
,co
mpu
teco
rrel
atio
n,co
unt
mat
ched
patt
erns
InSE
NSI
NG
stat
e:se
ndda
tato
sens
ing
engi
neco
mpu
teco
rrel
atio
n
Cor
rela
tion
exce
eds
cert
ain
thre
shol
d?ti
me,
num
ber
ofm
atch
ed
thre
shol
d?
Aft
ertr
acki
ngen
ough
patt
erns
exce
eds
Pre
pare
for
trac
king
:se
tst
ate
toT
RA
CK
ING
,se
tst
ate
toSE
NSI
NG
,se
tst
ate
toP
RO
BIN
G,
begi
nes
tim
atin
gsi
gnal
pow
eran
dsy
nchr
oniz
ing
poin
t
Upd
ate
nois
epo
wer
and
corr
elat
ion
thre
shol
d
Pre
pare
for
prob
ing:
Pre
pare
for
sens
ing:
chan
gew
indo
wle
ngth
,se
tsi
gnal
and
nois
epo
wer
and
thre
shol
dcl
ear
trac
king
hist
ory,
upda
tetr
acki
ngth
resh
old
SUst
ate
Yes
Yes
No
No
Inco
min
gse
nsin
gda
ta
Sens
ing
resu
lt
PR
OB
ING
TR
AC
KIN
GSE
NSI
NG
Fig
ure
5.4.
Flo
wgr
aph
ofth
ese
lf-a
dap
tive
cogn
itiv
esp
ectr
um
sensi
ng
engi
ne.
65
5.3.1 SU in PROBING State
The primary goal of the PROBING mode is to find the starting point of the
primary transmission. Along the way, the SU has to estimate the power level when
the PU is not transmitting. Therefore, the SU has three tasks to accomplish in
the PROBING mode:
• Estimate the noise power. This is done by using half-pilot-size power esti-
mator and cumulative moving average algorithm.
• Continuously update the correlation threshold based on the noise power
and variation. This threshold is to be used by the correlator to declare the
starting point of the primary transmission.
• Pass recent data to the correlator. If the correlation exceeds certain thresh-
old, declare the start of the primary transmission and leave PROBING mode
to TRACKING mode. Otherwise, continue probing.
The power estimator is actually implemented as an energy detector (only
collects samples and generates test statistics without comparing to any thresh-
old) with a half-pilot-size sensing window. Half-pilot-size means that the window
length of the power estimator is half of the size of an ON (or OFF) pilot sequence
(in samples). Note that all the energy detectors in this thesis are implemented by
type (a) as shown in Figure 2.2.2. Though the SU is not synchronized with the
PU, a half-pilot-size sensing window will not mix up samples from different states
for every other sensing window. In fact, if the PU is transmitting pilot signals, the
samples collected by the four consecutive windows must be from: mixed-state, all-
ON-state, mixed-state, all-OFF-state, with the order of appearance fixed in this
way. This is illustrated in Figure 5.2. The only exception occurs when the SU
66
is coincidentally synchronized with the PU. In this case, the samples in the four
consecutive windows should be from: all-ON-state, all-ON-state, all-OFF-state,
all-OFF-state. It still fits the pattern of alternating between all-ON-state and
all-OFF-state for every other window. Therefore, we only make discussion based
on the general case in which mixed-state windows exists with the realization that
the results apply to the special case as well.
Let Yt be the SU’s received sample at time t. Let Zn be the n-th output of the
half-pilot-size power estimator. Zn can be computed by
Zn =1
L
nL∑t=(n−1)L+1
|Yt|2, (5.4)
where L = ns pilot rx/2 is the number of samples of a half-pilot-size sensing
window. Since the ADC rate at the receiver is 64M samples per second, the
DAC rate at the transmitter is 128M samples per second, the decimation rate at
the receiver is decim, and the interpolation rate at the transmitter is interp, the
relationship between ns pilot tx and ns pilot rx is
ns pilot rx64Mdecim
=ns pilot tx
128Minterp
, (5.5)
which leads to
ns pilot rx =ns pilot tx
2· interpdecim
. (5.6)
Let µz,n and σ2z,n be the estimation of the mean and the variance of Zn, re-
spectively. Note that µz,n is also the estimation of the noise power σ2w if there
is no primary transmission. By cumulative moving average, µz,n and σ2z,n can be
67
updated iteratively by
µz,n =(n− 1)µz,n−1 + Zn
n(5.7)
σ2z,n =
(n− 1)σ2z,n−1 + (Zn − µn)2
n(5.8)
The correlator shown in Figure 5.5 is the key element in both the PROBING
and the TRACKING modes. If the SNR is very low, it is impossible to mark the
starting point of the primary transmission from the power level only, especially
when the signal and noise power levels are not known a priori.
All ON Mixed All OFFMixed All OFF MixedMixed All OFFAll ON
Correlator
Incoming sensing data sequence
!1 +1
· · · · · ·
0 0
+
A sensing window
Figure 5.5. Correlator for half-pilot-size power estimator.
In the following we briefly discuss how the correlator works in finding the
starting point as well as tracking the PU in pilot transmission. Let Rn be the
68
output of the correlator at the n-th window. Obviously,
Rn = Zn − Zn−2. (5.9)
Therefore, if there is no primary transmission,
E[R] = 0, (5.10)
Var[R] = 2σ2z . (5.11)
After the PU starts to transmit the pilot signal, suppose Zk is the output of the
first all-ON-state window. In this case, Zk−2 must be the output of an all-OFF-
state window as discussed before. For consistency, let σ2x be the power of the
received signal from the PU. Therefore,
E[Rk] = E[Zk]− E[Zk−2] = (σ2x + σ2
w)− σ2w = σ2
x (5.12)
Hence, if Rn exceeds a certain level, the SU can declare the start of the pilot
transmission. Let µr,n and σ2r,n be the estimation of mean and variance of R at
the n-th window, respectively. µr,n and σ2r,n can be computed in the same way as
in Equations (5.7, 5.8). In our demonstration, the declaration rule is set to be
Rn > ασr,n−2. (5.13)
where α is a tunable, which is set to be 10 initially and will increase by one every
time a false declaration is made.
The reason to use σr,n−2 instead of σr,n or σr,n−1 in Equation (5.13) is obvious
since with high probability a mixed-state window will be included in computing
69
σr,n and σr,n−1, which makes the estimation inaccurate.
5.3.2 SU in TRACKING State
Since the noise may be subject to certain variations and other unintended
signals may occasionally appear, the PROBING mode is likely to give a false
declaration from time to time. The leading goal of the TRACKING mode is
to confirm the primary transmission. The TRACKING mode always follows the
PROBING mode after the SU declares the start of the primary transmission. The
TRACKING mode has three tasks to accomplish:
• Further decide whether the declaration from the PROBING mode is reliable
or not (the PU actually starts transmission or not).
• Estimate the received signal power from the PU, and, along with the esti-
mated noise power, set threshold for energy detector.
• Roughly synchronize the SU with the PU.
It is worth noting that we are talking about a very week synchronization here
because by synchronization, we can estimate the probabilities of false alarm and
missed detection from the PU’s activity report and the SU’s sensing report. This
is done by separate Matlab function afterwards.
Further confirmation of the PU’s transmission is done by analyzing the fol-
lowing 4(n pilot repeat− 2) outputs of the correlator after the PROBING mode
declares the start of the PU’s transmission. If the output matches either of the two
patterns shown in Figure 5.6, the PU’s transmission is finally confirmed. Similar to
the PROBING mode, we use the outputs from the correlator to find the matched
pattern instead of using the raw test statistics. For low SNR, due to noise variation
70
and other uncertainties, neither pattern is always perfectly matched. Therefore,
we assign a matched factor β to form the threshold for pattern tracking. In our
software code, β is set to be 80%. This is to say, as long as 80% of the data
in these 4(n pilot repeat − 2) outputs matches a particular pattern, the primary
transmission is confirmed.
All OFF SamplesMixed Samples Mixed Samples All On Samples All OFF SamplesMixed Samples
All On Samples All OFF SamplesMixed Samples Mixed Samples All On Samples All OFF SamplesMixed Samples
Incoming sensing data sequence
DeclaringPU start
Trackingfrom here
DeclaringPU start
Trackingfrom here
All OFF SamplesAll OFF Samples
All OFF Samples
Pattern I: Declaring from a mixed-state-sample window
Pattern II: Declaring from an all-ON-state-sample window
Figure 5.6. Two matched patterns in the TRACKING mode
Similar to estimation of the noise power, the power level of the ON state is
estimated by the cumulative moving average of the outputs of all the all-ON-state
windows. The synchronization point is estimated by the two types of mixed-state
windows since along with the estimated power levels of ON state and OFF state,
they provide a rough estimation of how many samples are mixed from each state.
71
The SU then skips a suitable number of samples (part of the SU’s last pilot period)
and start real spectrum sensing (SENSING mode) afterwards.
It can be deduced from the above discussion that the first period of pilot
sequence serves to mark the starting point of the primary transmission, the fol-
lowing n pilot repeat − 2 periods of pilot sequence are utilized to finally confirm
the presence of the PU as well as to estimate the signal power and synchronization
point, and the last period of pilot sequence is simply ignored so that the SU can
synchronize with the PU.
The combination of the half-pilot-size power estimator (energy detector) and
the correlator provides a robust way of finding the starting point of the primary
transmission as well as estimating the received SNR. It works reasonably well even
for SNR as low as -20 dB when the related parameters are set as in Table 5.1.
5.3.3 SU in SENSING State
After tracking the PU’s pilot signal, the SU enters SENSING mode. In this
mode, the SU will be able to choose from different sensing schemes with different
parameters (such as window length). Two different detectors will be discussed in
the following section. The sensing result is then recorded in a text file to enable
the estimation of Pm and Pf , and thereafter, the detection risk.
5.4 Implementation of Energy Detection
We implement several energy detectors in this section that differ in window
length. For simplicity, the window length is assigned to be either divisor or multi-
ple of a packet size. The performance of these detectors are compared by plotting
the detection risk. To enable fair comparison, all the detectors are invoked to
72
work for the same transmission.
The result shown in Figure 5.7 is for a scenario in which the SNR is around -10
dB. Other parameters are defined as in Table 5.1. The cost factors are assigned
as C01 = 10 and C10 = 1, i.e., missed detections are 10 times more costly than
false alarms. The average channel ON time and OFF time are both 10 packets
length. The threshold of the energy detectors are set assuming that the test
statistics follows a Gaussian distribution with mean and variance generated from
the estimates in the TRACKING mode. The experimental result clearly shows
that if the window length exceeds a certain level, the performance of the energy
detector degrades. This result confirms the window length limitation for energy
detection discussed in Chapter 3.
Note again that the probabilities of missed detections and false alarms in com-
puting the risk are just rough estimation since the SU and the PU are not fully
synchronized. However, in giving a sense how varying window length will affect
the sensing performance, this estimation is enough. If further steps are taken, e.g.,
the SU makes real cognitive transmission if the channel is sensed to be free, the
probability of missed detection can be estimated from the bit error rate (BER)
of the PU and the SU. The probability of false alarm, however, is still hard to
estimate.
5.5 Implementation of Sequence Detection
Because of the variability of the real wireless systems, we change the implemen-
tation setup to a calibrated wired system as shown in Figure 5.8. This is because
the received signal in a wireless environment is not Gaussian due to fading and
time variation. Its distribution, which is critical to implement the sequence de-
73
0 5 10 15 200.35
0.4
0.45
0.5
0.55
0.6
0.65
0.7
Window length (in packets)
Ris
k
Figure 5.7. Risk level for energy detectors with different sensing windowlength.
74
Figure 5.8. System setup.
tection algorithms, are very hard or even impossible to estimate. To see this,
Figure 5.9 and Figure 5.10 illustrate the power level of an OFF and an ON pe-
riod, respectively, in a wireless environment, respectively. We can see from these
figures that neither distribution is perfectly Gaussian. In fact, they are chang-
ing in an unknown bursty manner. On the contrary, Figure 5.9 and Figure 5.10
illustrate the power level of an OFF and an ON period in a calibrated wired
environment, respectively. It can be seen from these figures that they are approx-
imately Gaussian and their distributions can be estimated in the TRACKING
mode as discussed above. We use attenuators to reduce the received signal power
in the wired environment in order not to overload the USRP receiver.
75
0 500 1000 1500 2000 2500 3000400
450
500
550
Sensing windows
pow
er le
vel
400 420 440 460 480 500 520 5400
50
100
150
200
250
300
Figure 5.9. Noise power and its histogram in a wireless environment.
76
0 500 1000 1500450
500
550
600
650
Sensing windows
pow
er le
vel
460 480 500 520 540 560 580 600 620 6400
20
40
60
80
100
Figure 5.10. Received signal power and its histogram in a wirelessenvironment.
77
0 100 200 300 400 500 600 700 800 900 100011.4
11.5
11.6
11.7
11.8
11.9
12
Sensing windows
pow
er le
vel
11.4 11.5 11.6 11.7 11.8 11.9 120
20
40
60
80
Figure 5.11. Noise power and its histogram in a wired environment.
78
0 100 200 300 400 500 600 700 800 900 100022.4
22.6
22.8
23
23.2
23.4
23.6
Sensing windows
pow
er le
vel
22.4 22.6 22.8 23 23.2 23.4 23.60
20
40
60
80
100
Figure 5.12. Received signal power and its histogram in a wiredenvironment.
79
Sub-windows
Windows
Samples
Figure 5.13. Divide a sensing window into several subwindows
Due to computational limitations, we implemented a complete forward se-
quence detector as well as a complete forward partial backward sequence detector
based upon a sub-window structure, as shown in Figure 5.13. To elaborate, the
average power in each sub-window (as Zn in Section 5.3.1) is used as the input (as
Yt in Section 3.2) to the sequence detection algorithms and the sensing decision
is made per sub-window. We also use a discrete version of the proposed sequence
detection algorithms for the sake of reducing computation complexity.
Since we change our system setup from wireless to wired, we also change some
of the implementation parameters. The new parameters for implementing the
sequence detection algorithms are defined as in Table ??.
TABLE 5.2
Implementation parameters for the calibrated wired system
Variable name Value Definition
80
TABLE 5.2
Continued
Variable name Value Definition
ns pilot tx 1600 number of samples in an ON/OFF pilot sequencein the transmitter
ns subwin 1600 number of samples in a sub-window
n packet in pilot 5 number of packets in each ON/OFF pilot period
n pilot repeat 5 how many times the ON-OFF pilot sequence re-peats before the Markov transmission
n E ON 10 Expected number of packets in an ON state
n E OFF 10 Expected number of packets in an OFF state
lB 1 backward window length of CFPB
C01 10 cost factor for a miss detection
C10 1 cost factor for a false alarm
81
−10 −9 −8 −7 −6 −5 −40.95
1
1.05
1.1
1.15
1.2
1.25
SNR (dB)
Ris
k
Energy DetectionCFACFPB (l
B=1)
Figure 5.14. Estimated detection risks of energy detection, completeforward sequence detection algorithm and complete forward partial
backward sequence detection algorithm.
In Figure 5.14, the experimental performance of the CFA and CFPB detectors
are compared with a traditional energy detector that does not take memory into
account. It can be seen that by exploiting the memory in the PU’s channel access
pattern, CFA and CFPB outperform the traditional energy detection algorithm.
The experimental results also confirm the fact that CFPB does better than the
CFA. However, due to certain limitations to be discussed below, we can only
implement the CFPB with the backward length to be only one sub-window.
82
5.6 Practical Issues
The situation in the real world is never as ideal as is modeled in theory. The
hardware has certain limitations as well. Therefore, the way the implementation
framework is built and its performance is restricted and severely affected by these
non-ideal factors.
5.6.1 USRP Limitations
The hardware USRP has several limitations that shape how the software code
is implemented. We will discuss the three most relevant limitations in this sub-
section.
5.6.1.1 Switch Time
The hardware’s switch time from one state to another, for example, from
silent to sensing or from sensing to transmitting, is significant and is therefore
not negligible. If the ON state and OFF state of the PU are relatively short, the
channel state may transfer from one state to another during the USRP’s state
transition, which makes the sensing result before the USRP’s state transition
outdated.
Therefore, instead of setting the PU to the real “silent” state for an OFF
period, we simply let the USRP transmit all zeros. In this way, we generate
a bursty PU whose transmission time exhibits certain Markov property without
any FPGA configuration.
83
5.6.1.2 USRP Overrun
USRP overrun (uO) is unique for the software receiver. USRP overrun indi-
cates that the host PC is not keeping up with received data from USRP. Samples
are dropped because they are not read in time. Basically, USRP overrun occurs
if the the software code is doing too much processing per sample. In practice,
however, the software code does not need to be too complicated to incur a USRP
overrun. This imposes an limit on the computation complexity for the spectrum
sensing algorithm the SU uses in each period. One way to avoid USRP overrun
is to use greater decimation factor. Even so, the weighted sequence detection al-
gorithm with a long backward window is difficult to implement without incurring
any USRP overrun. Note that the forward probabilities can be calculated along
the way as every sample is received.
The counterpart to USRP overrun is USRP underrun (uU). USRP underrun
indicates that the PC is spending too much time processing the data and is not
sending data to the USRP fast enough. As simple as a Markov chain generator,
which just counts the number of transmitted samples in the current state until
the current length is achieved and then transitions to the other state, if not coded
carefully, will incur USRP underrun very frequently. The final software code for
Markov chain generating block at the primary transmitter is optimized in code
efficiency so as to avoid USRP underruns.
5.6.1.3 Sampling Offset
The nominal ADC rate and DAC rate are 64M and 128M samples per second,
respectively. However, sampling frequency offset exists at both ends. We call
the sampling frequency offset caused by the USRP the hardware sampling offset.
84
All ON All OFF
n periods of ON-OFF pilot sequence
4n + 1 half-pilot-size windows
Mixed Mixed All ON All OFFMixed Mixed· · · · · ·· · · · · ·PU
SU(expected)
Figure 5.15. Sampling frequency offset causes pattern mismatch andestimation errors.
Another more harmful sampling offset is caused by the software code, which we
call the software sampling offset (In fact it is not actually “sampling” offset, but
“processing” offset). If the SU does “too much” work in one period, the time to
run these codes accounts and the host PC starts to lag behind the USRP. This
will eventually cause an USRP overrun after a certain amount of time. However,
it may take much longer time to observe an USRP overrun than to transmit the
entire pilot signal, which makes the SU unaware of this sampling offset. Sampling
offset will affect the tracking process of the SU fundamentally since the expected
pattern of all-ON-state window → mixed-state window→ all-OFF-state window
→ mixed-state window in the pilot signal will be violated as shown in Figure 5.15.
Even if the mismatches are within the tolerance level, the estimation of the power
level of an ON state may be incorrect since the estimation is made by averaging
across different types of windows. Therefore, the sampling offset imposes an upper
limit on the transmission time of the PU’s pilot signal for the SU to track. The
sampling offset also has great impact on the estimation of probabilities of false
alarm and missed detection.
Though it cannot be precisely determined, the sampling frequency offset can
85
be roughly estimated from the practical observation by intentionally transmitting
the pilot signal in high SNR. Since hardware sampling offset is trivial compared
to the software sampling offset, and the software sampling offset is determined by
the amount of work the software engine done in each period, one way to reduce the
sampling offset is to minimize the average number of calculations in each period.
Note that the software sampling offset in essence is a precursor to USRP overrun,
but is more influential since it can render the estimation result wrong without
being noticed.
5.6.2 Deviation of Real World from Ideal Modeling
5.6.2.1 Imperfect Estimation
In order to implement the soft input sequence detection algorithms, the SU
needs to know the exact distribution of the primary signal and the noise. In prac-
tice, neither the noise nor the primary signal are ideally Gaussian and estimating
their distribution is fairly involved. As mentioned in the previous chapter, one
possible solution is to divide a whole sensing window into several sub-windows
and use a Gaussian approximation for the test statistics of each sub-window, as
shown in Figure 5.13. The mean and variance of the power in each sub-window
can be estimated. But note that they are imperfect estimation as well and the es-
timation error may prevent the sequence detection algorithm from outperforming
the traditional energy detection. Another solution is to quantize the observation
to make it discrete and estimate the emission probabilities from each state. How-
ever, all these solutions increase the number of calculations in each period and a
sub-window with size smaller than 100 samples will cause great software sampling
offset.
86
5.6.2.2 Bursty Interference From Unknown Sources
In practice, the false alarms and missed detections are not randomly dis-
tributed among the observations. Most of the time these two types of errors
show up in a bursty fashion. This violates the conditionally independent assump-
tion in (3.4) and makes the detection problem more involved. Moreover, false
alarms occur more often than it is supposed to be in theory. This is reasonable
since interference from other distant unknown source may appear from time to
time.
5.6.2.3 Variation in Noise and Channel Fading
From the experimental observation, the noise power of a given frequency band
is not constant, but changing slowly around a certain level. The good point is that
the “coherence time” of the noise power is much longer than the coherence time
of the fading. Therefore, its effect can be neglected. The fading of the channel,
however, cannot be neglected. We make the primary users whole transmission
smaller than the channel coherence time, therefore the estimated SNR would not
go outdated and the estimation of false alarm and missed detection probabilites
would make sense as the threshold is chosen based upon the received SNR.
87
CHAPTER 6
CONCLUSIONS AND FUTURE WORK
Dynamic spectrum access, and cognitive radio more generally, are promising
solutions to the spectral crowding problem that introduces the opportunistic usage
of frequency bands that are not efficiently utilized by licensed users. Spectrum
sensing is the key functionality to enable dynamic spectrum access. Traditional
PHY layer sensing schemes such as energy detection do not consider the primary
user’s channel access pattern. In this work, we propose several new PHY layer
spectrum sensing schemes that exploit Markov memory of the primary user’s ac-
cess pattern. These new schemes take a sequence detection structure and therefore
are called sequence detection algorithms for spectrum sensing. Our algorithms are
based on the Viterbi algorithm and the forward-backward algorithm, which are
well-known in the channel coding literature. The latter algorithms allow differ-
ent cost factors to be assigned to different types of detection errors, i.e., missed
detections and false alarms.
Two advanced sequence detection algorithms for spectrum sensing are pro-
posed in this work. The complete forward algorithm (CFA) makes the decision
only for the current time instant, based only on the forward probabilities. The
complete forward partial backward algorithm (CFPB) provides a tradeoff between
sensing performance and sensing delay and computation complexity by computing
a few backward probabilities.
88
In comparing the performance of the proposed sequence detection algorithms
with the traditional PHY layer schemes, we observe new fundamental limitations
for energy detection and coherent detection. The risk floor is a risk level that the
traditional sensing schemes cannot pass below even with arbitrarily large SNR.
The window length limitation sets an upper limit on the window length before
performance of a traditional PHY layer detector degrades. These two limitations
both result from the PU’s finite dwell time in accessing the channel. Numerical
results show the advantage of the sequence detection algorithms as well as the
limitations for traditional PHY layer detection algorithm.
Another important contribution of this work is the practical implementation
of the above-mentioned spectrum sensing schemes as well as the self-adaptive
learning by the secondary user. For many practical reasons arising from the hard-
ware and software limitations, we implement a version of the complete forward
sequence detection algorithm for a calibrated wired system and show its advantage
over energy detection through several sets of preliminary experimental results.
Many extensions can be pursued from this foundation. First, a slightly modi-
fied version of the sequence detection algorithm can be made to predict the channel
state for the next time instant/subwindow/window. We expect this sequence pre-
diction algorithm to be important in a real cognitive radio system. Second, we
can extend the sequence detection algorithm to more complicated cognitive sys-
tems in which multiple secondary users exist or multiple frequency bands are to
be sensed. Third, we can expand upon learning the environment and the primary
user’s channel access pattern using the Baum-Welch algorithm [17].
There are several possible improvements for the SDR experimentation as well.
The most direct extension is to find an applicable way to implement a real and
89
robust sequence detection algorithm given all the constraints from hardware and
software. Another direction is to expand the cognitive system and let the sec-
ondary user really transmit after detecting a spectrum hole. This corresponds to
a real dynamic spectrum access system in which primary and secondary receivers
exist.
90
BIBLIOGRAPHY
1. S. Haykin, “Cognitive radio: brain-empowered wireless communications,”IEEE J. Select. Areas Commun., vol. 23, Feb. 2005.
2. J. Mitola, “Cognitive radio for flexible mobile multimedia communications,” inProc. IEEE Int. Workshop Mobile Multimedia Communications, 1999, pp. 310.
3. Q. Zhao, Swami, A, “A Survey of Dynamic Spectrum Access: Signal Processingand Networking Perspectives,” IEEE International Conference on Acoustics,Speech and Signal Processing, 2007.
4. A. Ghasemi, E. S. Sousa,“Spectrum Sensing in Cognitive Radio Networks: Re-quirements, Challenges and Design Trade-offs,” IEEE Communications Maga-zine, April 2008.
5. D. Cabric, A. Tkachenko, and R. W. Brodersen, “Spectrum Sensing Measure-ments of Pilot, Energy and Collaborative Detection,” Proc. of IEEE MilitaryCommunications Conference, Oct. 2006.
6. A. Sahai, N. Hoven, R. Tandra, “Some Fundamental Limits on Cognitive Ra-dio,” Proc. of Allerton Conference, Monticello, Oct 2004.
7. C. Ghosh, C. Cordeiro, D. P. Agrawal, and M. B. Rao, “Markov Chain Exis-tence and Hidden Markov Models in Spectrum Sensing,” IEEE PerCom 2009,pp. 1 - 6, Mar. 2009
8. H. Kim and K. G. Shin, “Efficient Discovery of Spectrum Opportunities withMAC-Layer Sensing in Cognitive Radio Networks,” IEEE Transactions on Mo-bile Computing, Vol. 7, No. 5, pp 533-545, May 2008
9. D. Cabric, S. M. Mishra, and R. W. Brodersen, “Implementation Issues in Spec-trum Sensing for Cognitive Radios,” Proc. Asilomar Conf. Signals, Systems,and Computers, pp. 772-776, Nov. 2004.
10. Y. C. Liang, Y. Zeng, E. Peh, and A. Hoang, “Sensing-throughput tradeofffor cognitive radio networks,” IEEE Trans. Wireless Commun., Vol. 7, No. 4,pp. 1326-1337, Apr. 2008.
91
11. N. B. Chang, and M. Liu, “Optimal Channel Probing and TransmissionScheduling for Opportunistic Spectrum Access,” IEEE/ACM Transactions onNetworking, Vol. 17, No. 6, Dec 2009.
12. X. Y. Wang, A. Wong, and P. Ho, “Extended Knowledge-Based ReasoningApproach to Spectrum Sensing for Cognitive Radio,” IEEE Transactions onMobile Computing, Vol. 9, 2010.
13. S. Huang, X. Liu, and Z. Ding, “Optimal Sensing-Transmission Structure forDynamic Spectrum Access,” IEEE InfoCom 2009.
14. Q. Zhao, L. Tong, and A. Swami, “Decentralized Cognitive MAC for DynamicSpectrum Access,” Proc. IEEE Int’l Symp. Dynamic Spectrum Access Networks(DySPAN ’05), pp. 224-232, Nov. 2005.
15. S. Huang, X. Liu, and Z. Ding, “Optimal Transmission strategies for DynamicSpectrum Access in Cognitive Radio Networks,” IEEE Transactions on MobileComputing, Vol. 8, No. 12, Dec 2009
16. G. D. Forney, “The Viterbi algorithm,” Proceedings of the IEEE, Vol. 61, pp.268-278, Mar. 1973.
17. L. R. Rabiner, “A Tutorial on Hidden Markov Models and Selected Applica-tions in Speech Recognition,” Proceedings of the IEEE, Vol. 77, pp. 257 - 286,Feb. 1989.
18. H. L. Van Trees, Detection, Estimation, and Modulation Theory part I, J.Wiley & Sous Inc., 1968.
19. G. D. Brushe, R. E. Mahony, and J. B. Moore, “A Soft Output Hybrid Algo-rithm for ML/MAP Sequence Estimation,” IEEE Transactions on InformationTheory, Vol. 44, No. 7, Nov 1998.
20. I. Akyildiz, W. Lee, M. Vuran, and S. Mohanty, “Next Generation/ DynamicSpectrum Access/Cognitive Radio Wireless Networks: A Survey,” ElsevierComputer Networks, Vol. 50, 2006, pp. 2127-2159.
21. Q. Zhao, and B. M. Sadler, “A Survey of Dynamic Spectrum Access: SignalProcessing, Networking, and Regulatory Policy,” IEEE Sig. Processing, May2007.
22. P. D. Sutton, K. E. Nolan, L. E. Doyle,“Cyclostationary Signature Detectionin Multipath Rayleigh Fading Environments,” IEEE CrownCom, pp. 408 - 413,2007
92
23. W. A. Gardner, “Measurement of Spectral Correlation,” IEEE Trans. Acoust.,Speech, Signal Processing, vol. 34, Oct. 1986.
24. P. De, “New methods for sensing bandlimited signals in Cognitive Radio,”IEEE Vehicular Technology Conference, pp. 1916 - 1920, 2007.
25. Y. Zeng, Y. Liang, “Eigenvalue based Spectrum Sensing Algorithms for Cogni-tive Radio,” IEEE Transactions on Communications, Vol. 57, pp. 1784 - 1793,2009.
26. S. M. Mishra, A. Sahai, and R. W. Broderson, “Cooperative sensing amongcognitive radios,” In IEEE International Conference on Communications, Vol.4, pp. 1658-1663, 2006.
27. G. Ganesan, and Y. Li, “Cooperative spectrum sensing in cognitive radio,part I: Two user networks,” IEEE Trans. Wireless Commun., pp. 2204 - 2213,June 2007.
28. F. Digham, M. Alouini, and M. Simon, “On the energy detection of unknownsignals over fading channels,” in Proc. IEEE Int. Conf. Commun., vol. 5, Seat-tle, Washington, May 2003, pp. 35753579.
29. P. Isomaki, N. Avessta, “An Overview of Software Defined Radio Technolo-gies,” TUCS Technical Report. No 652, December 2004 IEEE CommunicationsMagazine, Apr. 2008.
30. J. Ma, Y. Li, “Soft Combination and Detection for Cooperative SpectrumSensing in Cognitive Radio Networks,” IEEE GlobeCom, pp. 3139 - 3143 Dec.2007.
31. C. Sun, W. Zhang, K. Ben Letaief, “Cooperative Spectrum Sensing for Cog-nitive Radios under Bandwidth Constraints,” IEEE Wireless Communicationsand Networking Conference, pp. 1 - 5, 2007.
32. H. Arslan, Cognitive Radio, Software Defined Radio, and Adaptive WirelessSystems, Springer 2007
33. “Gnu radio.” http://gnuradio.org/trac/wiki.
34. “Ettus USRP.” http://www.ettus.com/
35. “Basic GNU Radio.” https://radioware.nd.edu/documentation/
93
This document was prepared & typeset with pdfLATEX, and formatted withnddiss2ε classfile (v3.0[2005/07/27]) provided by Sameer Vijay.