Research Article: SDR Based Energy Detection Spectrum Sensing in Cognitive Radio For Real Time Video Transmission
Research Article: SDR Based Energy Detection Spectrum Sensing in Cognitive Radio For Real Time Video Transmission
Research Article: SDR Based Energy Detection Spectrum Sensing in Cognitive Radio For Real Time Video Transmission
Research Article
SDR Based Energy Detection Spectrum Sensing in
Cognitive Radio for Real Time Video Transmission
Received 10 December 2017; Revised 10 March 2018; Accepted 20 March 2018; Published 29 April 2018
Copyright © 2018 Rupali B. Patil et al. This is an open access article distributed under the Creative Commons Attribution License,
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Cognitive radio is a budding approach which helps to address the imminent spectrum crisis by dynamic spectrum allocation
and support the increased data traffic with an intelligent mechanism of Software Defined Radio (SDR). SDR avoid the frequent
modifications in the hardware structure with the use of software defined protocols. The main novelty of the paper is an effective
implementation of CR using energy based spectrum sensing method which is done on GNU radio for real time transmission of
video as a primary user. From evaluation results, one can see that the proposed system can indicate the frequency band occupancy
by setting the detection output. Detection output changes to one with start of video transmission. Motivation behind this work
is design of a spectrum sensing method which is best suited for detection of white spaces during the transmission of video as a
primary user on SDR platform.
1. Introduction that software can offer. The employment of GNU radio and
Universal Software Radio Peripheral (USRP) for developing
According to spectrum, survey conducted by the Federal software based wireless transmission system, that is, SDR, is
Communication Commission (FCC) has indicated that the discussed in [5]. CR is having the capability to optimally adapt
actual licensed spectrum is not utilized properly for various their operating parameters according to the trades of the
time, frequency, and geographical locations [1]. Also the surrounding radio environment. CR can detect the spectrum
demand of allocating and using the radio frequency spectra is white space, that is, a portion of frequency band that is not
rapidly growing due to increasing number of wireless applica- being used by the primary users (licensed users) and utilize
tions [2]. An unlicensed user or secondary user may utilize the same for secondary user (SU) transmission. But when
this band when licensed user is absent. To encourage the pro- licensed users start using the spectrum again, CR can detect
ficient use of spectrum, concept of cognitive radio (CR) has their activity through spectrum sensing and hold the trans-
been proposed in [3]. CR fundamentals and the challenges mission generated due to secondary user’s transmission.
involved in dynamic spectrum allocation and sharing in Moreover, the ability of CR to identify and exploit the unused
CR are discussed in [4]. CR allows opportunistic usage of spectrum band allows them to coexist with inheritance radio
frequency bands that are not used by licensed users. Thus, systems, improving spectrum utilization without impairing
CR relies on efficient spectrum sensing to detect vacant the primary users (PU). So mainly CR comprises two types
spectrum bands. Also deployment of new wireless devices of users. First one is PU who has the license to use the given
and applications has increased more expensive hardware frequency band and second one is SU who is not a licensed
structure to be dealt with these types of signal processing. user of the given frequency band but can use band whenever
So, this requires reconfigurable hardware platforms. A best it is vacant. As soon as the PU or licensed user returns to the
solution to these problems is SDR platforms. GNU radio frequency band, SU has to vacate it and find another vacant
along with SDR provides the cost effective and flexible plat- frequency band. To detect whether a frequency band is unoc-
form. A major challenge for SDR is to equal the proficiencies cupied or not, SU needs to perform spectrum sensing. So
of purely hardware solutions while providing intelligence sensing is identified as the key aspects of a CR which means
2 Modelling and Simulation in Engineering
a CR must be able to identify the unused spectrum band. For testing of the above project SDR-Lab kits having
Competencies of CR are combined with SDR. SDR enhances transmit and receive frequency range of 0.4–4 GHz are used.
the functionality of CR through smart mechanism using The SDR-LAB is a powerful software programmable hard-
GNU radio that would automatically reconfigure the radio ware transceiver.
parameters and senses the spectrum. There are various detec- To support high date rate and good spectral efficiency are
tion techniques available for spectrum sensing. The momen- the requirements in the case of transmitting multimedia data.
tous amount of study is performed on spectrum sensing Gaussian Minimum Shift Keying (GMSK) is a modulation
for CR based system in [6]. Energy detection constitutes scheme which proves to be effective in wireless scenario.
a favored approach for spectrum sensing in CR due to its GMSK is derived from Minimum Shift Keying (MSK) which
simplicity and applicability. The traditional energy detection replaces the rectangular pulse with a sinusoidal pulse. This
technique [7], which is based upon fixed threshold, is sen- method will apply Gaussian filter for pulse-shaping. A Gaus-
sitive to noise uncertainty which is unavoidable in practical sian-shaped impulse response filter has an advantage that it
cases. So in this paper, an efficient energy detector is proposed generates a signal with low side lobes and narrower main lobe
for optimum CR performance. In the proposed scheme, than the rectangular pulse. As it uses Gaussian filter for pulse-
under a practical scenario, some parameters are measured shaping, this modulation is called GMSK modulation. The
and these parameters are used to calculate the threshold of relationship between the premodulation filter bandwidth,
energy based sensing method. The purpose of thresholds cal- 𝑊, and the bit period, 𝑇𝑏 , defines the bandwidth of the
culation is to maximize the probability of detection (𝑃𝐷) and system. Global System for Mobile Communications (GSM)
minimize the probability of false alarm (𝑃FA ). Theoretical designers used a 𝑊𝑇𝑏 = 0.3. This compromises between a bit
analysis and simulation results show the efficiency of the pro- error rate and an out-of-band interference since the narrow
posed scheme in comparison to the traditional energy detec- filter increases Intersymbol Interference (ISI) and reduces the
tion method with less increase in complexity. signal power [13]. The GMSK modulation has been preferred
Also data traffic in air has increased beyond limit which for video transmission in wireless communication because
develops the growing demand for the transfer of data, images, it compromises between spectrum efficiency, complexity,
and video using the same medium which is used for voice and low spurious radiations which lessen the possibilities of
transmission. So for testing instead of random data real time adjacent channel interference.
video signal is transmitted and at the receiver CR based en- The paper is organized as follows. Section 2 contains sys-
ergy detection of this video signal is done. This video signal tem outline. Section 3 considers theoretical aspects of energy
is acting as a primary user and energy detector is able to based spectrum sensing. In Section 4 we investigate energy
detect the availability of this video signal on given frequency based spectrum sensing method on SDR for detection of pri-
by setting parameter detection output. mary user’s presence and its implementation issues. Section 5
Most research currently emphasizes on spectrum sensing is dedicated to theoretical analysis and numerical calculation
in CR, but theoretical detection algorithms are not enough. of threshold. Section 6 presents the results from energy detec-
As discussed in [8], SDR is an important convenient base tor sensing method. Finally, conclusions and future scope
technology for the future context-sensitive, adaptive, and are presented in Section 7.
learning radio units referred to as CRs. SDR requires the
blending of software-based signal processing and the ena-
bling hardware components. The overview of the criteria for 2. System Outline
such platforms and the current state of development and
upcoming trends in this area are presented in [9]. A block diagram of the CR-GMSK system considered in this
A hardware test platform is required to test and check article is shown in Figure 1. The cognitive engine is respon-
the performances of the CR. This problem can be resolved sible for making intellectual decisions and configuring the
using emergent technology of SDR which gives easiness in radio and physical layer (PHY) parameters. The transmission
the implementation process by replacing the hardware by soft prospects are identified by the decision unit based on the
ware in addition to cost effectiveness. Several benefits like information from the policy engine, as well as local and net-
faster execution time and extensibility to meet new require- work spectrum sensing data. As far as the PHY layer is con-
ments are given by SDR. cerned, CR can communicate with various radio-access tech-
A large number of experimental SDR platforms are avail- nologies in the environment, or it can improve the quality
able to support individual research projects [10]. GNU radio of communication depending on the environmental charac-
[11] is one of the most popular and an interesting software teristics, by simply changing the configuration parameters of
platform for radio network which is introduced by Blossom. the GMSK system and the SDR interface. Note that spectrum
It is a free software toolkit for building software radio and is sensing and detection is done on single carrier frequency.
compatible with SDR kits [12]. The whole GNU radio project The overall block diagram of transmitter and receiver
is available under GNU license which does not limit free use for energy based spectrum sensing is shown in Figure 2.
of GNU radio components in research projects. This GNU The input to the system is a real time video captured by
radio project contains a large library of functions written in webcam and modulated by GMSK. It is processed through the
C++/python language for the SDR system and the library of code written in python language using GNU radio software.
several basic components for implementing basic functions After this processing it is transmitted wirelessly on 1.234 GHz
of a digital radio receiver. Moreover, GNU radio is designed frequency using a SDR-LAB device. The receiver is tuned
to work with an inexpensive hardware device. to transmitted frequency. Transmitted signal is received by
Modelling and Simulation in Engineering 3
Subcarrier assignment
DAC
Spectrum
COGNITIVE RADIO
Sensing
Decision Unit
Radio configuration
Policy Local Spectrum
Engine Sensing
Synchronization
ADC
Figure 2: Overall block diagram transmitter and receiver for energy based spectrum sensing.
another SDR-LAB Trans receiver which hands over the video and simultaneously trying to detect the white spaces at
incoming information to the GNU radio software which has this frequency using energy based spectrum sensing. Testing
two parts; one is GMSK demodulation used for detection of is done by switching the video transmission on and off.
video signal and another is energy based spectrum sensing Project setup with SDR-Lab with Laptop is shown in
which gives detection output along with signal to noise ratio Figure 3. One SDR connected to laptop is acting as transmit-
(SNR) calculations. We are trying to display the received ter and the other is acting as receiver.
4 Modelling and Simulation in Engineering
Threshold
Definition
Comparison
Filter Mean
and ADC
FFT | |2 Value
with
Threshold
Figure 5: Transmitter flow graph for video transmission designed using GNU radio.
Figure 6: Receiver side flow graph for video reception and detection of signal designed using GNU radio.
6 Modelling and Simulation in Engineering
implementation and execution on receiver side is creating a where 𝐷(𝑦) is decision variable and 𝛾 is the threshold. If the
file called Video rx.sh in the home folder with instructions noise variance is completely known then from Central Limit
to generate queue to receive the data in FIFO manner and Theorem, the following approximation can be made
store the received video with extension filename.ts. Then open
4
a terminal window using Ctrl + alt + T. At the receiver 𝑦 2𝜎𝑛
side terminal, type gnuradio-companion. Then double click 𝐷( ) = N (𝜎𝑛2 , ),
𝐻0 𝑁
on options block set the parameters and close the properties
window. Open the other block named variable in flow graph (8)
2 2
and set the sample rate value as 1𝑒6. Arrange all the blocks 𝑦 2 (𝑃 + 𝜎𝑛 )
𝐷 ( ) = N (𝑃 + 𝜎𝑛2 , ),
and logically connect them as per the flow graph as shown in 𝐻1 𝑁
Figure 6.
Then open another command prompt and type the where 𝑃 is the average signal power, 𝑁 are the number of
following command after the $ sign./Video rx.sh. samples, and 𝜎𝑛2 is the noise variance. N() symbol is used for
Execute the flow graph by pressing F6. Receiver side flow approximation. The energy detector decides 𝐻1 if
graphs have added blocks required for demodulation as well
as the implementation of energy sensing based spectrum 𝑁−1
sensing as per the block diagram shown in Figure 4. 𝑇 (𝑥) = ∑ 𝑥2 (𝑛) > 𝛾. (9)
𝑛=0
5. Theoretical Analysis and Numerical If 𝑁 is large, then 𝑇(𝑥) can be approximated by a Gaussian
Calculations of Threshold random variable since it is the sum of 𝑁 independent,
although not identically distributed, random variables. Thus,
To decide the threshold value for energy based spectrum we need only to find out first two movements to characterize
sensing for flow graph shown in Figure 6 is another challeng- the detection performance. To do so
ing task. So there is a necessity to carry out the theoretical
analysis and numerical calculations based on the practical 2
𝑇 (𝑥) {𝑥 (𝑛) under 𝐻0
conditions. The essence of energy based spectrum sensing is 𝑇 (x) = = { 2 (10)
𝜎2 𝑥 under 𝐻1 ,
a binary hypothesis testing problem. Theoretical analysis is { (𝜆)
done for the same as follows:
where 𝜆 = ∑𝑁−1 2 2 2
𝑛=0 𝑠 (𝑛)/𝜎 = 𝜖/𝜎 .
This is because under 𝐻1
{𝑤 (𝑛) under 𝐻0
𝑦 (𝑛) = { (5)
𝑥 + 𝑤 (𝑛) under 𝐻1 ,
{ (𝑛)
𝑁−1
(𝑠 (𝑛) + 𝑤 (𝑛)) 2
𝑇 (𝑥) = ∑ ( ). (11)
𝑛=0 𝜎
where 𝑦(𝑛), 𝑥(𝑛), and 𝑤(𝑛) are the received signals at CR
nodes, transmitted signals at primary nodes, and white noise And hence mean of 𝑥(𝑛)/𝜎 is 𝑠(𝑛)/𝜎. Using the properties of
samples, respectively. The above two hypotheses are taken to chi-squared random variables we have
decide the signal is present or not. The 𝑤(𝑛) noise is assumed
to be additive white Gaussian noise (AWGN) with zero mean 𝐸 (𝑇 (𝑥) ; 𝐻0 ) = 𝑁,
and is a random process. The signal to noise ratio is
𝐸 (𝑇 (𝑥) ; 𝐻1 ) = 𝜆 + 𝑁,
(12)
𝑆power var (𝑇 (𝑥) ; 𝐻0 ) = 2𝑁,
SNR = , (6)
𝑁power
var (𝑇 (𝑥) ; 𝐻1 ) = 4𝜆 + 2𝑁.
where 𝑆power is signal power and 𝑁power is noise power. 𝑃FA , the probability of false alarm, and 𝑃𝐷, the probability of
The energy detection algorithm is semiblind detection detection, are given by
under the assumption of absolutely no deterministic knowl-
edge about the signal 𝑥(𝑛). Let us assume that we know only 𝛾 /𝜎2 − 𝑁
the average power of the signal. The optimal detector is the 𝑃FA = 𝑄 ( ), (13)
√2𝑁
correlation detector [14]. The decision model is
𝛾 /𝜎2 − (𝜆 + 𝑁)
𝑃𝐷 = 𝑄 ( ), (14)
{ 1 𝑛−1 √4𝜆 + 2𝑁
{
{ ∑ 𝑦 (𝑛) 𝑥 (𝑛) > 𝛾 under 𝐻1
{
{ 𝑁 𝑛=0
𝐷 (𝑦) = { 𝑛−1 (7) where 𝑄(⋅) is the standard Gaussian complementary Cumu-
{1
{ lative Distribution Function (CDF) and 𝛾 is the threshold
{
{ ∑ 𝑦 (𝑛) 𝑥 (𝑛) < 𝛾 under 𝐻0 ,
{ 𝑁 𝑛=0 which is 𝛾𝑁.
Modelling and Simulation in Engineering 7
Rearranging 𝑃𝐷 Put 𝜎2 in
𝛾 /𝜎2 − 𝑁
𝑄−1 (𝑃FA ) = 𝑄−1 (𝑄 ( )) , (17) 6. Results of Energy Detection Method
√2𝑁
The energy detection spectrum sensing in cognitive radio is
−1 𝛾 /𝜎2 − 𝑁 implemented efficiently with GNU Radio and SDR-LAB kit
𝑄 (𝑃FA ) = ( ). (18)
√2𝑁 for the real time video signal acting as a primary user.
The input real time video captured by webcam is modu-
Putting (18) in (16), modified equation of 𝑃𝐷 is lated by GMSK. This processing is done on transmitter side in
GNU radio. The detection algorithm is implemented in GNU
√2𝑁𝑄−1 (𝑃FA ) − 𝜆 radio on receiver side as per the the block diagram shown in
𝑃𝐷 = 𝑄 ( ), Figure 4. Initially transmitted frequency is set at 1.2345 GHz
√4𝜆 + 2𝑁
(19) but we can also adaptively change the frequency of trans-
𝑄−1 (𝑃FA ) − √𝑁/2 (𝜆/𝑁) mission. This transmitted video signal is received by another
𝑃𝐷 = 𝑄 ( ), SDR-LAB transreceiver which is tuned to transmitter, pro-
√1 + 2 (𝜆/𝑁) cessed using GNU radio and GMSK demodulated. It is also
played using VLC media player simultaneously. The same
where 𝑄−1 (⋅) is the inverse standard Gaussian complemen- received video signal is also given to energy based spectrum
tary CDF. The last approximation is valid for large 𝑁. Finally sensing blockset designed using GNU radio software. The
we have code is written in python. The threshold calculated in (25) of
Section 5 is used in the threshold block of GNU radio receiver
𝑁𝜆
𝑃𝐷 = 𝑄 (𝑄−1 (𝑃FA ) − √ ), side flow graph for the detection of the real time video signal.
2 𝑁 Energy based spectrum sensing block gives the output of
(20) video signal detection in the form of flag named detection
𝜆2 output. The SNR and energy of signal are also measured
𝑃𝐷 = 𝑄 (𝑄 (𝑃FA ) − √
−1
). on receiver side for the transmitted video signal with the
2𝑁
help of energy detector spectrum sensing method. If video
is present energy of the signal becomes higher than the
This equation will be recognized as the performance of the threshold and detected output becomes one. But if the signal
Neyman-Pearson detector. Thus, threshold formula for the transmission stops then the energy of the signal becomes
energy detector based on the probability of the false alarm less than threshold and detected output becomes zero. Here
𝑃FA is derived as given in video signal is acting as primary user. This shows successful
implementation of energy based detector which detects the
𝛾 = [(𝑄−1 (𝑃FA ) × √2𝑁) + 𝑁] × 𝜎2 . (21) primary user’s presence on given frequency by setting the
detection output. Fast Fourier Transforms (FFT) and scope
Under the practical condition some parameters are measured plots are used to observe the signals at each point. Initially
and these parameters are used to calculate the threshold of the working of only energy detector is also tested under noise
the project. The gain of the RF signal and energy of the signal condition with no signal; results clearly show that noise is
are selected as 10 and 0.0364, respectively. Also number of detected as no signal present by the detection output flag in
samples are taken as 150000. The variance is calculated as per Figure 7. Figure 8 shows the results when video transmission
(22): stops with status of detection output and energy of the signal.
The detection output and the energy of the signal becomes
1 𝑁−1 2 zero as transmission of video stops, while Figure 9 shows the
𝜎2 = ∑ 𝑥 (𝑛) , (22) result of energy detector when the video transmission is going
𝑁 𝑛=0
on. The detector output is one and energy of received signal
0.0364 is measured at the output when the video transmission is
𝜎2 = = 242.67 × 10−9 . (23) going on. Figure 10 shows the FFT plot specifying amplitude
150000
8 Modelling and Simulation in Engineering
Figure 7: Energy based detector output is zero under only noise no signal condition.
in decibel (dB) versus frequency (KHz) at 1.23 GHz. The re- of theoretical and algorithmic results for energy detector;
ceived signal is represented with FFT plot in GUI of GNU moreover, the SDR implementation along with GNU radio
radio companion. The results of the energy detector are tested offers a set of tools that allow the creation of a realistic CR sys-
and verified by varying the distance between transmitter and tem with real time spectrum sensing capabilities. So we have
receiver from one to ten meters. successfully designed and implemented CR based communi-
cation system for real time video transmission.
7. Conclusion and Future Scope Future work focuses on experimentation of same spec-
trum sensing techniques for improving the performance in
GNU radio based innovative approach has been designed cognitive radio and also finding out the one which is more
for detection of transmitted live video using energy based suitable to work in wireless environment. Further this can be
spectrum sensing of CR and implemented on SDR platform. extended for simultaneous transmission of multiple signals
Transmitted signal is modulated with GMSK and energy and use of multiple frequency bands. Also this work will be
detector is implemented successfully with averaging blocks. quite helpful for implementation of real time projects such as
In conclusion, this work has produced a significant amount traffic control which can use this spectrum sensing method
Modelling and Simulation in Engineering 9
Rotating Advances in
Machinery Multimedia
The Scientific
Engineering
Journal of
Journal of
Hindawi
World Journal
Hindawi Publishing Corporation Hindawi
Sensors
Hindawi Hindawi
www.hindawi.com Volume 2018 http://www.hindawi.com
www.hindawi.com Volume 2018
2013 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
Journal of
Control Science
and Engineering
Advances in
Civil Engineering
Hindawi Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
Journal of
Journal of Electrical and Computer
Robotics
Hindawi
Engineering
Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
VLSI Design
Advances in
OptoElectronics
International Journal of
International Journal of
Modelling &
Simulation
Aerospace
Hindawi Volume 2018
Navigation and
Observation
Hindawi
www.hindawi.com Volume 2018
in Engineering
Hindawi
www.hindawi.com Volume 2018
Engineering
Hindawi
www.hindawi.com Volume 2018
Hindawi
www.hindawi.com www.hindawi.com Volume 2018
International Journal of
International Journal of Antennas and Active and Passive Advances in
Chemical Engineering Propagation Electronic Components Shock and Vibration Acoustics and Vibration
Hindawi Hindawi Hindawi Hindawi Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018