Sunteți pe pagina 1din 6

ICCCCT-10

FPGA implementation of Spectrum Sensing based


on Energy detection for Cognitive Radio
S.Srinu, Samrat L. Sabat
School of Physics
University of Hyderabad
Hyderabad, 500046
Email: ph08pe02@uohyd.ernet.in.slssp@uohyd.ernet.in

Abstract-Spectrum sensing is a critical component of the


Cognitive Radio that detects the presence of primary user signal
in a channel. In this paper energy detection technique based
on Neyman-pearson criterion is used to detect the presence of

deterministic primary user (PU) signals in the channel. We have


considered three different kinds of modulated signal such as
BPSK, QPSK , DVB-T (2K mode) under additive white Gaussian
noise (AWGN) and Rayleigh fading channel environment as
specified in IEEE 802.22 standard for validating the algorithm.
The simulation result shows that the energy detector achieves the
desired probability of detection (Pd20.9) with probability of false
alarm (Pf:S:O.l) at low signal to noise ratio (SNR) up to -8dB for
QPSK and DVB-T modulated signal with sample size of 64. The
algorithm is also implemented in Xilinx Virtex2pro XC2VP30
(FFG896-7) Field Progranunable Gate Array (FPGA). Hardware
in loop (HIL) technique is used for verifying the algorithm in
FPGA. The implementation result reveals that the algorithm
fits into the Virtex2pro FPGA and can execute with operating
frequency between 110 to 138 MHz for different sample size of
primary user signals.

Index Terms-Cognitive Radio, Spectrum Sensing, Energy

detection, FPGA, Hardware Co-simulation.

I. INTRODUCTION
THE advent of new high data rate wireless applications,
as well as rapid development of existing wireless services,
leads to an increase in demand for additional bandwidth. On
the other hand, statistics shows that the utilization of spectrum
resources is at a very low level in terms of different dimensions
such as frequency, time, geographical space, code, angle and
signal polarization [1]. In the recent past Cognitive Radio
is emerged as a promising technology to balance between
spectrum congestion and spectrum under-utilization. Cognitive
radio uses the concept of dynamic spectrum access, in which
an unlicensed user termed as secondary user (SU) can use the
spectrum of a licensed user termed as primary user (PU) with a
constraint that it should not interfere to the power level of PU
[2]. The Main functions of CR are spectrum sensing, spectrum
management, spectrum sharing and spectrum mobility [3].
The objective of spectrum sensing is to detect activity of
the PU signal in a channel. Broadly, spectrum sensing can
be done in two ways i.e., passive techniques and active
techniques. The main disadvantages of passive technique is
that it takes more time for sensing a channel. To overcome the
problem of sensing time, active sensing techniques are more
popular [4]. Different signal processing techniques are being

978-1-4244-7770-8/10/$26.00 2010 IEEE

used for active sensing. The popular methods are based on


energy detection,matched filtering and cyclo-stationary feature
detection [5] [6]. According to the IEEE 802.22 standard, the
specified detection time should be less than or equal to 2sec
[7]. Matched filtering is an optimal way for signal detection in
communication systems. However it requires prior knowledge
of the licensed user signal which may not be available.
Energy detection is often used to determine the presence of
signals without prior knowledge of signal. However, limitation
for energy detection is the decision threshold is subject to
changing signal to noise ratio(SNR). This is one fundamental
limit for detection of weak signals below the SN Rwau.
SN Rwall defined as the minimum SNR threshold due to
noise uncertainty below which a detector unable to identify a
primary signal reliably regardless of sensing time [8]. Cyclo
stationary detection techniques is often used to determine the
presence of signals without prior knowledge and it can able
to discriminates the noise energy from the modulated signal
energy but it involves more computation intense operations.
In this paper we have studied and implemented energy
detection technique because of agile spectrum sensing [9].The
performance of this scheme is represented by two essential
parameters i.e., probability of detection (Pd) and probabillity
of false alarm (Pf). The design of detector often involves
constructing the solution to an optimization problem. We
used Neyman-Pearson detection, to fix Pf at some tolerable
level G, and maximize Pd constraint that Pf :s: G. Naymen
Pearson (NP) criterion leads to a likelihood ratio test identical
to that of bayesian detection, except that the threshold (..\)
is determined by the desired value of probability of false
alarm (Pf) [10]. In reacent past FPGAs are being popularly
used for signal processing applications because of parallel
processing,high speed, reconfiguration features and less power
dissipation compared to microprocessors (DSP Processoers).
In this paper enrgy detection technique is implemented in
Xilinx Vertex2pro XC2VP30 (FFG896-7C) FPGA [11]. The
primary user signal such as BPSK, QPSK and DVB-T(uses
64QAM) are observed for detection under the AWGN and
Rayleigh fading channel environment.
Rest of the paper is organized as follows: Section 2 presents
Energy detection algorithm for detecting the PU's signals.
Section3. presents simulation and hardware implementation
results followd by conclusions in section 4.

126

ICCCCT-10

r(t)

.. Band Pass
... Filter

Fig. l.

NO

>A

Hl

<A

HO

(3)

Where PI-des is the desired false alarm probability. and


are the shaping and sizing parameters and depends on the
number of samples to be detected and variance of the noise
respectively. yl(Ala,b) denotes the inverse of gamma function.
As Chi-square is the special case of gamma distribution, the
threshold value can be computed from gamma distribution.
The variance of noise w(n) computed as,
v

Energy detector paradigm

II. ENERGY DETECTION ALGORITHM


The fundamental problem of spectrum sensing in CR is to
discriminate between samples that contain only noise and the
samples contain signal information embedded with high noise
power. Energy detection can be performed in both time and
frequency domain.
Fig.l shows the block diagram representation of energy
detector based spectrum sensing. The received signal r(t)
is filtered by a band-pass filter to select the channel to be
scanned. Detector computes the energy of the received signal
by taking discrete time samples from NO Converter and
compares it with the predetermined threshold value (A) . The
objective of spectrum sensing is to discriminate between the
following two hypotheses HO (PU is absent) and HI (PU is
in operation) [12].

UnderHO : r(n)=w(n),
UnderHI : r(n)= hs(n) + w(n), n=0, I, 2, ..., N- 1.

P(rIH1)
]
IOg[
P(rIHo)

(1)

HO

Where P(r I HI), P(rIHo) are the probability density func


tions of HI and HO respectively.
Noise is assumed to be independent and identicaly dis
tributed with zero-mean and circularly symmetric complex
Gaussian with variance one such that it follows X u Chi-square
distribution and signal follows X u(2,) non central Chi-square
distribution with 2u degrees of freedom,under such conditions,
Eq.(I ) can be rewritten as [13],

N-I

H1

IIrl12=LIr[nW A
n=O

HO

N-l

1
L[w(n)- J1f
N n=O

where (J1) is the mean of the noise vector defined as

J1=E[w]=

N-I

1
Lw(n)
N n=O

Probability of detection and probability of false alarm are


computed for analysis purpose as [15],

Pd =p{y > V Hd =Qu h/2-Y, V':\)


PI =P{ Y> AIR}
0 =

r(u,A/2)
r(u)

(4)

(5)

Where , is the signal to noise ratio (SNR), = T. W is


the time bandwidth product, f(.) and f(.,.) are complete and
incomplete gamma functions and
is the generalized
Marcum Q-function
A high value of probability of misdetection (Pm), Pm =
1 - Pd would result in missing the presence of PU with
high probability, which in turn increases interference to the
primary user. On the other hand, a high Pf would result in low
spectrum utilization since false alarm decreases the probability
of successful detection of holes.
In the fading environment, the received signal energy and
SNR are location dependent. If the received signal does not
have any line of sight (LOS) component the amplitude of the
signal follows a Rayleigh distribution. For this case, Pf is
same for all locations, since it is independent of the SNR.
When the amplitude gain of the channel, h, varies due to the
fading. The probability of detection Pd varies with SNR as
[15]

Qu(.,.)

Where r[n] = [r(O), r(I), r(2), ..., r(N- 1)] is the signal
received by CR user is an N dimensional vector space over
R(r E RD) or C, N is the sample size, s(n) is licensed user
transmitted signal, w(n) is the additive white Gaussian noise
(AWGN) and h is the amplitude gain of the channel. The
optimal Neyman-Pearson test is to compare the log-likelihood
ratio with a predetermined threshold (A) given as,

(j2=E[w2]- (E[W])2=

Pd-fad =
Where f,(x)
under fading.

J Qu(, V':\)fl'

(x) dx

(6)

is the probability density function of SNR

III. SIMUL ATION RESULT S AND HARDWARE


IMPLEMENTATION

(2)

where Il rll is the norm of the received signal vector. In practice


the detector may not have the characteristics of the recieved
signal apriori.
The threshold (A) for a desired value of probability of false
alarm (Pf) is [14],

A.

Simulation results

The simulation and implementation of algorithm is carried


out for signals of lengths N=16, 32, 64,128 from transmitted
signals of primary users of different modulations such as
BPSK, QPSK and DVB-T(64QAM). The received signal is
filtered by a band-pass filter of band width 200 kHz and the

127

ICCCCT-10

time of observation is 160p,sec for BPSK and QPSK with


bit rate of 84kbps. DVB-T specification are given in table.1,
where the band width of the channel is 6MHz and the time
of observation for detection is 5.4p,sec for sample size of 64.
Detector computes the energy of the received signal in the
observed time period and compares it with a precomputed
threshold (oX) as Eq.(2). Threshold is determined by the desired
value of probability of false alarm (Pf) as Eqn.(3). The slope
of the curve of the ROC at a particular point is equal to the
value of the threshold required to achieve the Pd and Plat
that point [10] [16]. Noise is assumed to be independent and
identicaly distributed with zero-mean and circularly symmetric
complex Gaussian with variance one. But in practice it is
random. The bandwidth and time of observation of selected
channel for signal detection is taken such that the sample size
(N) is equal to 2u where u is time bandwidth product. The
algorithm is simulated for SNR range between -10dB to lOdB
in steps of 2dB. We computed the detection probability using
test statistic by 10000 iterations. The detection probability
is computed for different probability of false alarm (0.2025,
0.1089, 0.012). More approximation of the ROC curve is
possible with increasing the number of iterations.
TABLE I

DVB-T SPECIFICATIONS
Transmission mode
Number of carriers
Carrier frequency
Modulation
Channel Band width
Code rate
Guard interval ratio
Data rate
Observed Time

2k
1705
4. 8MHz
64 QAM
6MHz
2/3
114
3.732 - 23.751Mbps
5.4JLsec

The performance of detector is measured with probabil


ity of detection (Pd) and probabillity of false alarm (Pf).
Performance of energy detector for different values of SNR
and different sample size (N) of the received signal can
be characterized through Receiver operating characteristics
(ROC) curves.
The probability of detection is computed for different values
of SNR with constant probability of false alarm for BPSK,
QPSK and DVB-T signal. Figures 2,3 and 4 presents the Pd
vs SNR with different PI values for BPSK, QPSK and DVB-T
signals of sample saize 64 respectively. Figures 2-4 reveals that
as the SNR increases the probability of successful detection of
spectrum holes increases. As the PI value increases Pd also
increases for all the three types of signals. The energy detector
able to detect BPSK signals upto -2dB with PI=O.l, although
it detects with pd = 0.9 upto -5dB for PI=0.2. Fig.3 shows
that for QPSK signal the detector can detect the presence of
signal with probability of 0.9 upto -8dB with P 1=0.1. It also
reveals that for P1=0.2, detector performance increses upto
-lOdB. Fig.4 shows the simulated results for DVB-T signal.
It shows the same trend as for QPSK signal, fig-3. for DVB
T signal which is being popularly used in IEEE 802.22, the
detector is able to detect the presence of PU signal upto -8 dB

Graph blw snr vs Pd with different fixed Pta tor(BPSK) N=64

0.1 .
0

-1
- 0-----
- 5------0------5------10
snr(Eb/NO)

Fig. 2.
SNR Vs Pd of BPSK
(Pf=0.2025,0.I089,0.012 and N=64)

signal

under

AWGN Channel

SNR level with P1=0.1. In this case also detector performance


increases with increase of P1=0.2. The complementary ROC
curves which plots the probability of false alarm V s probability
of misdetection for a fixed value of sample size. Figure.5, 6
and 7 shows that as the sample size increases the probability
of misdetection decreases at SNR -8dB.From figure.7.we can
observe that the desired value of Pm at pf=0.12 with sample
size 64 but for same value of PI the Pm value is increases for
32 and further increases for 16 samples. figure 5 and 6 follows
the same trend. Figure 8 and 9 reveals that Rayleigh fading
degrades the performance of energy detector for the DVB-T
of sample size 16. Figure 8 gives the ROC curves at SNR OdB
with and without Rayleigh fading. The fading parameters in
the simulation are Doppler shift 1000Hz and bit rate 84kbps.
From the figure.9.due to Rayleigh fading the probability of
detection degrades approximately by 1db compared to the
signal with AWGN for different values of SNR with fixed
PI at 0.1089.
Table.2. Gives the SN Rwall for different primary users with
sample size of 16,32 and 64 by architecture. We observed
that the least SNR required to achieve the desired Pd and
PI values (Pf::;0.012 and Pd0.9) is -3dB for QPSK, DVB
T(64QAM) of sample size (N=64). For the case (Pf::;O.l and
Pd0.9) the SN Rwall observed at -8db for QPSK of sample
size 64 and for the case (Pf::;0.2 and Pd0.9) the least SNR
possible to detect primary user is -lOdB. Since the Q functions
is monotonically decreasing, it is evident that both Pd and
Pf decay to zero as threshold (oX) increases. There is also an
explicit relation between these two [10].
(7)
In order to increase Pd, we must also increase Pf. This
can be viewed for the latter case (Pf::;0.2 and Pd0.9), where
the SN Rwall is -lOdB the best case achieved. In practice the
desired values of probabilities for a detection technique were

128

ICCCCT-10

=C::;;:
:::
100 t:"""":"""""",,,,;:7:
Complementary ROC for BPSK at SNR=-SdB for different N

Graph b/w snr vs Pd with different fixed Pfa for(QPSK)N=64

0.9 .
O.S .
t:
0

ti
2
.,
'0
'"

..
:

'0

0.5

E
'0

fJ 0.4 .

:0
'"

.-

Ll

a.

Ll

0.3 .

a.

."

10-' . ........ , ... . .. .... . .


0.1
O L-________L-____________-L______

-10

-5

10

Probability of false alarm

snr(Eb/NO)

Fig. 3.
SNR Vs Pd of QPSK
(Pf=O.2025,O.I089,O.OI2 and N=64)

signal

under

AWGN Channel

Fig. 5. Complementary ROC curves for BPSK signal under AWGN Channel
(N=16,32,64 and ,),=-8dB )

Graph blw snr vs Pd with different fixed Pfa for(DVB-T) N=64

Complementary ROC for QPSK at snr--SdB

100 :=

0.9

t:
o

ti
2
.,
'"

'0

E
'0

'0

0.5 .

fJ 0.4

:0
'"
Ll

Ll

a.

0.3

a.

0.2
0.1
OL-______L-____________-L______

-10

-5

10

10'"

snr(Eb/NO)

10-'

10-3
Probability of false alamn

Fig. 4.
SNR Vs Pd for a DVB-T signal under AWGN Channel
(Pf=O.2025,O.I089,O.OI2 and N=64)

Fig. 6. Complementary ROC curves for QPSK signal under AWGN Channel
(N=16,32,64 and ,),=-8dB)

(Pf:::;O J and PdO.9).

threshold value and energy of the received signal. Decision


unit gives the status of primary user activity in the channel.
FPGA implementation of energy detection technique is
validated with PU's Transmitted signals under AWGN and
Rayleigh fading channel. Hardware in loop (HIL) technique
is used for verification of algorithm in FPGA. The HIL
simulation result matches with the MATLAB results. The re
source estimation for energy detection architecture based on 64
sample data requires 1641 slices, 3233 flip-flops, 1681 LUTs,
817 lOBs and 64 embedded multipliers. The results indicates
that resources utilization is minimal for this techniqie and
increases as the sample size of the received signal increases.
The algorithm works in the FPGA with operating frequency
range between 11OMHz-138MHz (maximum) for all above
mentioned licensed user signals of sample size 16, 32 and

B.

Hardware implementation

The hardware implementation of the algorithm is carried


out using Xilinx System Generator for DSP tools and Xil
inx Vertex-2pro XC2VP30 (FFG896-7C) FPGA [11]. The
Spectrum sensing architecture for FPGA implementation by
energy detection is shown in Fig 10. it has four major
blocks i.e., Energy computing block, noise variance computing
block,threshold and decision block. Received signal samples
are directly imported from MATLAB workspace to the Xilinx
System-Generator. The Energy unit computes the energy of
the received signal with different sample size(N). Noise vari
ance block calculates the variance of the noise. Threshold is
calculated using gamma function. Decision unit depends on

129

ICCCCT-10

Ol&l
Re$OlIce
Estm;a1Ot

sysaem
Generator

--,
-,---____

Energy

Energy unit

Threshold

L-___________._

Fig. 10.

H,--==
GoitewayOul1

Decision

Spectrum sensing architecture for FPGA implementation by Energy detection

SNR Vs Pd (DVB-T(16)), PfaO .1 0S 9 for AWGN, AWGN+RAYLEIGH FADING


1 -------,---=

+R
0.9 .
=;=

Complementary ROC for DVB- T with different sample size at snr-SdB


100 ==;;:;

O.S .
c
o

c
o

0.7

06

2
'"
"0
'"

'"
"0

'0

0.5 .

:g 0.4

E
'0

.0

:0
'"
.0

a.

0..

0.3 .

0.2 .
0.1
OL-_-L________-L__L-_
-8

-6

-4

-2

snr(Eb/NO)
Probability of false alarm

Fig. 7. Complementary ROC curves for DVB-T signal under AWGN Channel
(N=16,32,64 and ,""(=-SdB)

Fig. 9. SNR Vs Pd of DVB-T signal under AWGN(A) and AWGN+Rayleigh


fading ChanneI(A+R) (Pf=O.lOS9, N=16)
TABLE II
THE LEAST SNR REQUIRED FOR ARCHITECTURE TO ACHIEVE
DETECTION PROBABILITY (PD) Vs PROBABILITY OF FALSE ALARM
(PF)

ROC for DVB- T with different sample size at snr OdB


100 r--c"--""--"

Modulation type,(N)
BPSK 16
QPSKI6
DVB-T(64QAM)16
BPSK 32
QPSK32
DVB-T(64QAM)32
BPSK64
QPSK64
DVB-T(64QAM)64

c
o

'"
"0

'0

:0
'"
.0

0..

10-2
Probability of false alarm

Fig. S.
ROC(Pd Vs PC) curves of DVB-T signal under AWGN(A) and
AWGN+Rayleigh fading Channel(A+R) (N=16, ,""(=OdB)

PfO. OI2,SNR
7dB
5dB
6dB
5dB
5dB
IdB
2dB
-3dB
-3dB

PfO.lOS9,SNR
2dB
OdB
IdB
OdB
IdB
-3dB
-2dB
-SdB
-SdB

PfO.2,SNR
-ldB
-3dB
-2dB
-2dB
-2dB
-6dB
-5dB
-IOdB
-9db

64. The results show that the Energy Detector can achieve
the desired Pd and Pf values (Pf::;O.1 and Pd2:0.9) at low
SNR up to -I OdB for QPSK, DVB-T with sample size(N) of
64 and -8dB to achieve(Pf::;O.1 and Pd2:0.9). Table.3.explains
the maximum frequency that can be achieved by the detector
in the FPGA. As the sample size increases the frequency of
operation (sensing time increases) decreases. The best case

130

ICCCCT-10
TABLE III
MAXIMUM FREQUENCY THAT WORKS IN THE FPGA USING ENERGY
DETECTOR ARCHITECTURE FOR BPSK, QPSK, DVB-T (64QAM)
Modulation
BPSK,QPSK,DVB-T
BPSK,QPSK,DVB-T
BPSK,QPSK,DVB-T

Sample size(N)
16
32
64

Maximum frequency( MHz)


138.4
115.5
110.8

achieved at 138.4MHz for the input sample size of 16.


I V. CONCLUSION
In this paper energy detetion technique is used for detecting
BPSK, QPSK and DVB-T signals of different length and spec
ifications as specified by IEEE 802.22 standard. The results
indicate that as the sample size increases the performance of
the energy Detector also increases, but at the same time it
requires more resources. Due to Rayleigh fading the Probabil
ity of detection further devolves. The results discloses that our
detection algorithem can able to detect the DVB-T signal with
required 90% Pd and 10% Pf upto -8dB with sample size of
64. FPGA implementation of proposed detection technique can
reliably detect the PU's activity in the channel with operating
frequency between 110-138 MHz. The implementation of
Energy Detector architecture on Wrreless Access Research
Platform (WARP) board and Cooperative spectrum sensing
techniques are under development to increase the detection
probability.
ACKNOWLEDGMENT
REFERENCES
[1] T. Yucek and H. Arslan, "A survey of Spectrum Sensing Algorithms for
cr Applications first quarter 2009," University of South Florida, USA,
Tech. Rep., 2009.

[2] K. Larson(Chair), L. Cacciatore, T. Eng, J. Jackson, B. Luther, and


T. Magnire, "Fcc: Spectrum policy task force: Report of the interference
protection working group," Federal Communications Commission, Tech.
Rep., 2002.
[3] S. Haykin, "Cognitive radio: Brain-empowered wireless communica
tions," IEEE Journal on Selected Areas in Communications" vol. 23,
no. 2, pp. 201-219, Feb 2005.
[4] G. R. Faulhaber, "Deploying cognitive radio:economic, legal and policy
issues," International Journal of Communication" vol. 2, pp. 1114-1124,
Aug 2008.
[5] A. Huseyin, Cognitive Radio, Software defined radio, and Adaptive
wireless systems. Springer publication, 2007.
[6] Y. Zeng and Y. -C. Liang., "A review on spectrum sensing for cognitive
radio:cha1lenges and solutions," EURASIP Journal on Advances in
Signal Processing" vol. 138632, pp. 1-15, Oct 2009.
[7] K. C. Carlos and D. Birru., "Ieee 802.22:an introduction to the first
wireless standard based on cognitive radios;' IEEE journal of commu
nications" vol. I, no. I, pp. 38-47, April 2006.
[8] D. Oh and Y. Lee., "Energy detection based spectrum sensing for sensing
error minimization in cognitive radio networks;' International Journal
of Communication Networks and Information Security (IJCNIS)" vol. I,
no. I, pp. 1-5, April 2009.
[9] I. F. Akyildiz, W.-Y. Lee, M. C. Vuran, and S. Mohanty., "Next
generation/dynamic spectrum access/cognitive radio wireless networks:
A survey;' Computer Networks" vol. 50, no. 13, pp. 1114-1124, May
2006.
[10] S. Kay, Fundamentals of Statistical Signal Processing and Estimation
theory. Prentice Hall, 1998.
[11] www.xilinx.com. Xilinx University program Virtex-2pro Development
system, hardware reference manual. xilinx, 2001.
[12] P. Kimtho and T. Jun-Ichi, "Signal detection for analog and digital
tv signals for cognitive radio," IEICE Technical Report (Institute of
Electronics, Information and Communication Engineers), Tech. Rep.,
2006.
[13] H. Urkowitz, "Energy detection of unknown deterministic signals," in
IEEE Proceedings, vol. 55, no. 4, April 1967, pp. 523-531.
[14] W. Xia and W. Cheng., "Correlation-based spectrum sensing in cognitive
radio;' in IEEE Proceedings, University of Huazhong Science and
Technology, Wuhan , China, Sep 2009, pp. 67-72.
[15] A. Ghasemi and E. S. Sousa., "Collaborative spectrum sensing for
opportunistic access in fading environments;' in IEEE Proceedings,
Universityof Toronto, Toronto, Canada, Oct 2005, pp. 131-136.
[16] M. Barkat, Signal Detection and Estimation. Artech house publishing,
2005.

131

S-ar putea să vă placă și