SDR Based Energy Detection Spectrum Sensing in Cognitive Radio for Real Time Video Transmission

,


Introduction
According to spectrum, survey conducted by the Federal Communication Commission (FCC) has indicated that the actual licensed spectrum is not utilized properly for various time, frequency, and geographical locations [1].Also the demand of allocating and using the radio frequency spectra is rapidly growing due to increasing number of wireless applications [2].An unlicensed user or secondary user may utilize this band when licensed user is absent.To encourage the proficient use of spectrum, concept of cognitive radio (CR) has been proposed in [3].CR fundamentals and the challenges involved in dynamic spectrum allocation and sharing in CR are discussed in [4].CR allows opportunistic usage of frequency bands that are not used by licensed users.Thus, CR relies on efficient spectrum sensing to detect vacant spectrum bands.Also deployment of new wireless devices and applications has increased more expensive hardware structure to be dealt with these types of signal processing.So, this requires reconfigurable hardware platforms.A best solution to these problems is SDR platforms.GNU radio along with SDR provides the cost effective and flexible platform.A major challenge for SDR is to equal the proficiencies of purely hardware solutions while providing intelligence that software can offer.The employment of GNU radio and Universal Software Radio Peripheral (USRP) for developing software based wireless transmission system, that is, SDR, is discussed in [5].CR is having the capability to optimally adapt their operating parameters according to the trades of the surrounding radio environment.CR can detect the spectrum white space, that is, a portion of frequency band that is not being used by the primary users (licensed users) and utilize the same for secondary user (SU) transmission.But when licensed users start using the spectrum again, CR can detect their activity through spectrum sensing and hold the transmission generated due to secondary user's transmission.Moreover, the ability of CR to identify and exploit the unused spectrum band allows them to coexist with inheritance radio systems, improving spectrum utilization without impairing the primary users (PU).So mainly CR comprises two types of users.First one is PU who has the license to use the given frequency band and second one is SU who is not a licensed user of the given frequency band but can use band whenever it is vacant.As soon as the PU or licensed user returns to the frequency band, SU has to vacate it and find another vacant frequency band.To detect whether a frequency band is unoccupied or not, SU needs to perform spectrum sensing.So sensing is identified as the key aspects of a CR which means a CR must be able to identify the unused spectrum band.Competencies of CR are combined with SDR.SDR enhances the functionality of CR through smart mechanism using GNU radio that would automatically reconfigure the radio parameters and senses the spectrum.There are various detection techniques available for spectrum sensing.The momentous amount of study is performed on spectrum sensing for CR based system in [6].Energy detection constitutes a favored approach for spectrum sensing in CR due to its simplicity and applicability.The traditional energy detection technique [7], which is based upon fixed threshold, is sensitive to noise uncertainty which is unavoidable in practical cases.So in this paper, an efficient energy detector is proposed for optimum CR performance.In the proposed scheme, under a practical scenario, some parameters are measured and these parameters are used to calculate the threshold of energy based sensing method.The purpose of thresholds calculation is to maximize the probability of detection (  ) and minimize the probability of false alarm ( FA ).Theoretical analysis and simulation results show the efficiency of the proposed scheme in comparison to the traditional energy detection method with less increase in complexity.
Also data traffic in air has increased beyond limit which develops the growing demand for the transfer of data, images, and video using the same medium which is used for voice transmission.So for testing instead of random data real time video signal is transmitted and at the receiver CR based energy detection of this video signal is done.This video signal is acting as a primary user and energy detector is able to detect the availability of this video signal on given frequency by setting parameter detection output.
Most research currently emphasizes on spectrum sensing in CR, but theoretical detection algorithms are not enough.As discussed in [8], SDR is an important convenient base technology for the future context-sensitive, adaptive, and learning radio units referred to as CRs.SDR requires the blending of software-based signal processing and the enabling hardware components.The overview of the criteria for such platforms and the current state of development and upcoming trends in this area are presented in [9].
A hardware test platform is required to test and check the performances of the CR.This problem can be resolved using emergent technology of SDR which gives easiness in the implementation process by replacing the hardware by soft ware in addition to cost effectiveness.Several benefits like faster execution time and extensibility to meet new requirements are given by SDR.
A large number of experimental SDR platforms are available to support individual research projects [10].GNU radio [11] is one of the most popular and an interesting software platform for radio network which is introduced by Blossom.It is a free software toolkit for building software radio and is compatible with SDR kits [12].The whole GNU radio project is available under GNU license which does not limit free use of GNU radio components in research projects.This GNU radio project contains a large library of functions written in C++/python language for the SDR system and the library of several basic components for implementing basic functions of a digital radio receiver.Moreover, GNU radio is designed to work with an inexpensive hardware device.
For testing of the above project SDR-Lab kits having transmit and receive frequency range of 0.4-4 GHz are used.The SDR-LAB is a powerful software programmable hardware transceiver.
To support high date rate and good spectral efficiency are the requirements in the case of transmitting multimedia data.Gaussian Minimum Shift Keying (GMSK) is a modulation scheme which proves to be effective in wireless scenario.GMSK is derived from Minimum Shift Keying (MSK) which replaces the rectangular pulse with a sinusoidal pulse.This method will apply Gaussian filter for pulse-shaping.A Gaussian-shaped impulse response filter has an advantage that it generates a signal with low side lobes and narrower main lobe than the rectangular pulse.As it uses Gaussian filter for pulseshaping, this modulation is called GMSK modulation.The relationship between the premodulation filter bandwidth, , and the bit period,   , defines the bandwidth of the system.Global System for Mobile Communications (GSM) designers used a   = 0.3.This compromises between a bit error rate and an out-of-band interference since the narrow filter increases Intersymbol Interference (ISI) and reduces the signal power [13].The GMSK modulation has been preferred for video transmission in wireless communication because it compromises between spectrum efficiency, complexity, and low spurious radiations which lessen the possibilities of adjacent channel interference.
The paper is organized as follows.Section 2 contains system outline.Section 3 considers theoretical aspects of energy based spectrum sensing.In Section 4 we investigate energy based spectrum sensing method on SDR for detection of primary user's presence and its implementation issues.Section 5 is dedicated to theoretical analysis and numerical calculation of threshold.Section 6 presents the results from energy detector sensing method.Finally, conclusions and future scope are presented in Section 7.

System Outline
A block diagram of the CR-GMSK system considered in this article is shown in Figure 1.The cognitive engine is responsible for making intellectual decisions and configuring the radio and physical layer (PHY) parameters.The transmission prospects are identified by the decision unit based on the information from the policy engine, as well as local and network spectrum sensing data.As far as the PHY layer is concerned, CR can communicate with various radio-access technologies in the environment, or it can improve the quality of communication depending on the environmental characteristics, by simply changing the configuration parameters of the GMSK system and the SDR interface.Note that spectrum sensing and detection is done on single carrier frequency.
The overall block diagram of transmitter and receiver for energy based spectrum sensing is shown in Figure 2. The input to the system is a real time video captured by webcam and modulated by GMSK.It is processed through the code written in python language using GNU radio software.After this processing it is transmitted wirelessly on 1.234 GHz frequency using a SDR-LAB device.The receiver is tuned to transmitted frequency.Transmitted signal is received by another SDR-LAB Trans receiver which hands over the incoming information to the GNU radio software which has two parts; one is GMSK demodulation used for detection of video signal and another is energy based spectrum sensing which gives detection output along with signal to noise ratio (SNR) calculations.We are trying to display the received video and simultaneously trying to detect the white spaces at this frequency using energy based spectrum sensing.Testing is done by switching the video transmission on and off.Project setup with SDR-Lab with Laptop is shown in Figure 3.One SDR connected to laptop is acting as transmitter and the other is acting as receiver.

Theoretical Aspects of Energy Based Spectrum
Energy detection is the simple spectrum sensing method because it is easy to implement and requires no prior knowledge about the primary signal.Let us assume the hypothesis model of the received signal given by the following: Here () is the primary user's signal to be detected at the local receiver of a secondary user, () is the additive white Gaussian noise, and ℎ is the channel gain from the primary user's transmitter to the secondary user's receiver. 0 is a null hypothesis which means there is no primary user present in the band, while  1 means the primary user's presence.The detection statistics of the energy detector can be defined as the average energy of  observed samples () and is given by The decision regarding the occupancy of the spectrum is given by comparing the detection statistics with a predetermined threshold (). FA , the probability of false alarm, and   , the probability of detection, are two probabilities which are used to characterize the performance of the detector. FA denotes the probability that the test decides  1 , while it is actually  0 given by denotes the probability that the test correctly decides  1 , given by A good detector should ensure a high detection probability   and a low false alarm  FA , or it should optimize the spectrum usage efficiency.The efficiency of energy detector based spectrum sensing can be improved by the development of various approaches.An efficient energy detector is proposed in which under a practical scenario some parameters are measured and these parameters are used to calculate the threshold for this system.Design of this energy detection uses a squaring device followed by an integrator, the output of which gives the decision variable.This variable is then compared with a threshold and if it is above the predefined threshold, then the result of the detector specifies that a PU is present.An energy detector sets a threshold according to the noise floor and compares it with the energy of the data stream in input.The input signal selects the required bandwidth by a band pass filter; then it is sampled.The digital implementation of this method uses the Fast Fourier Transform (FFT), so the absolute value of the samples is squared and integrated over the observation band.Finally, according to a comparison between the output of the integrator and threshold, the presence or absence of the primary user can be detected.The block diagram of this method is given in Figure 4.

Energy Based Spectrum Sensing on SDR
The GNU radio based transmitter flow graph shown in Figure 5 is designed to transmit a real time video signal which is acting as a PU.The modulation used for the transmission for this video signal is GMSK.This wirelessly transmitted signal is received by the GNU radio based receiver shown in Figure 6.The design of the receiver flow graph is done as per the block diagram shown in Figure 4. To measure the signal energy, selected band data is sampled with stream to vector, complex to mag blocks which perform the task of squaring and averaging.Further it is compared with a predefined threshold.The sensing method gives the output of PU signal detection by setting output flag named detection output and calculation of SNR with an assumption that no user other than PU is present on the channel.SU transmission is decided based on the detection output flag status of the PU.

Transmitter Side Implementation.
The flow graph of transmitter is shown in Figure 5.The process which is followed for the implementation and execution firstly opens the terminal window using keyboards ctrl + alt + T. Type GNU radio companion (GRC) in opened window.In untitled GRC window, double click on the option block.Set the parameters for the flow graph.And open the other block named variable in flow graph and set the sample rate value.Generate a flow graph as per shown in Figure 5 of Tx video, by simply putting already generated GNU blocks in GNU radio companion window.To transmit a live video from webcam, input to the GMSK modulator block is fed through File Sink.To specify the rate at which the frames are to be transmitted and their size, create a new shell file Video tx.sh in home folder.This file when executed will create a queue of First In First Out (FIFO) type to transmit data.Execute this file later on.Open the file operators category and double click on file source.
Set the address and arrange the overall flow-graph to complete video transmitting section of GMSK modulator.Now execute the Shell File Video tx.sh and then execute this flow graph by pressing F6.

Receiver Side Implementation.
The flow graph of receiver is shown in Figure 6.The process which is followed for the    implementation and execution on receiver side is creating a file called Video rx.sh in the home folder with instructions to generate queue to receive the data in FIFO manner and store the received video with extension filename.ts.Then open a terminal window using Ctrl + alt + T. At the receiver side terminal, type gnuradio-companion.Then double click on options block set the parameters and close the properties window.Open the other block named variable in flow graph and set the sample rate value as 16.Arrange all the blocks and logically connect them as per the flow graph as shown in Figure 6.
Then open another command prompt and type the following command after the $ sign./Videorx.sh.
Execute the flow graph by pressing F6.Receiver side flow graphs have added blocks required for demodulation as well as the implementation of energy sensing based spectrum sensing as per the block diagram shown in Figure 4.

Theoretical Analysis and Numerical Calculations of Threshold
To decide the threshold value for energy based spectrum sensing for flow graph shown in Figure 6 is another challenging task.So there is a necessity to carry out the theoretical analysis and numerical calculations based on the practical conditions.The essence of energy based spectrum sensing is a binary hypothesis testing problem.Theoretical analysis is done for the same as follows: where (), (), and () are the received signals at CR nodes, transmitted signals at primary nodes, and white noise samples, respectively.The above two hypotheses are taken to decide the signal is present or not.The () noise is assumed to be additive white Gaussian noise (AWGN) with zero mean and is a random process.The signal to noise ratio is where  power is signal power and  power is noise power.The energy detection algorithm is semiblind detection under the assumption of absolutely no deterministic knowledge about the signal ().Let us assume that we know only the average power of the signal.The optimal detector is the correlation detector [14].The decision model is where () is decision variable and  is the threshold.If the noise variance is completely known then from Central Limit Theorem, the following approximation can be made where  is the average signal power,  are the number of samples, and  2  is the noise variance.N() symbol is used for approximation.The energy detector decides  1 if If  is large, then () can be approximated by a Gaussian random variable since it is the sum of  independent, although not identically distributed, random variables.Thus, we need only to find out first two movements to characterize the detection performance.To do so where  = ∑ −1 =0  2 ()/ 2 = / 2 .This is because under  1 And hence mean of ()/ is ()/.Using the properties of chi-squared random variables we have FA , the probability of false alarm, and   , the probability of detection, are given by where (⋅) is the standard Gaussian complementary Cumulative Distribution Function (CDF) and   is the threshold which is .
Rearranging and multiplying and dividing by √ 2 Taking  −1 of  FA in (13), Putting ( 18) in ( 16), modified equation of   is where  −1 (⋅) is the inverse standard Gaussian complementary CDF.The last approximation is valid for large .Finally we have This equation will be recognized as the performance of the Neyman-Pearson detector.Thus, threshold formula for the energy detector based on the probability of the false alarm  FA is derived as given in Under the practical condition some parameters are measured and these parameters are used to calculate the threshold of the project.The gain of the RF signal and energy of the signal are selected as 10 and 0.0364, respectively.Also number of samples are taken as 150000.The variance is calculated as per (22): = 0.0336.
The threshold calculated in (25) is set in flow graph of receiver side energy based spectrum sensing for detection of video signal.

Results of Energy Detection Method
The energy detection spectrum sensing in cognitive radio is implemented efficiently with GNU Radio and SDR-LAB kit for the real time video signal acting as a primary user.The input real time video captured by webcam is modulated by GMSK.This processing is done on transmitter side in GNU radio.The detection algorithm is implemented in GNU radio on receiver side as per the the block diagram shown in Figure 4. Initially transmitted frequency is set at 1.2345 GHz but we can also adaptively change the frequency of transmission.This transmitted video signal is received by another SDR-LAB transreceiver which is tuned to transmitter, processed using GNU radio and GMSK demodulated.It is also played using VLC media player simultaneously.The same received video signal is also given to energy based spectrum sensing blockset designed using GNU radio software.The code is written in python.The threshold calculated in (25) of Section 5 is used in the threshold block of GNU radio receiver side flow graph for the detection of the real time video signal.
Energy based spectrum sensing block gives the output of video signal detection in the form of flag named detection output.The SNR and energy of signal are also measured on receiver side for the transmitted video signal with the help of energy detector spectrum sensing method.If video is present energy of the signal becomes higher than the threshold and detected output becomes one.But if the signal transmission stops then the energy of the signal becomes less than threshold and detected output becomes zero.Here video signal is acting as primary user.This shows successful implementation of energy based detector which detects the primary user's presence on given frequency by setting the detection output.Fast Fourier Transforms (FFT) and scope plots are used to observe the signals at each point.Initially the working of only energy detector is also tested under noise condition with no signal; results clearly show that noise is detected as no signal present by the detection output flag in Figure 7. Figure 8 shows the results when video transmission stops with status of detection output and energy of the signal.The detection output and the energy of the signal becomes zero as transmission of video stops, while Figure 9 shows the result of energy detector when the video transmission is going on.The detector output is one and energy of received signal is measured at the output when the video transmission is going on. Figure 10 shows the FFT plot specifying amplitude  in decibel (dB) versus frequency (KHz) at 1.23 GHz.The received signal is represented with FFT plot in GUI of GNU radio companion.The results of the energy detector are tested and verified by varying the distance between transmitter and receiver from one to ten meters.

Conclusion and Future Scope
GNU radio based innovative approach has been designed for detection of transmitted live video using energy based spectrum sensing of CR and implemented on SDR platform.Transmitted signal is modulated with GMSK and energy detector is implemented successfully with averaging blocks.In conclusion, this work has produced a significant amount of theoretical and algorithmic results for energy detector; moreover, the SDR implementation along with GNU radio offers a set of tools that allow the creation of a realistic CR system with real time spectrum sensing capabilities.So we have successfully designed and implemented CR based communication system for real time video transmission.
Future work focuses on experimentation of same spectrum sensing techniques for improving the performance in cognitive radio and also finding out the one which is more suitable to work in wireless environment.Further this can be extended for simultaneous transmission of multiple signals and use of multiple frequency bands.Also this work will be quite helpful for implementation of real time projects such as traffic control which can use this spectrum sensing method  for wireless transmission and detection of traffic video signals data from multiple signal posts to one master check post.This can be further transferred to control unit which will use this information for controlling the traffic.So decisive aim of this system is design and implementation of CR based traffic control system for real time video transmission.

Figure 3 :
Figure 3: Project setup for transmitter and receiver of energy based spectrum sensing.

Figure 4 :
Figure 4: Block diagram of energy based spectrum sensing.

Figure 5 :
Figure 5: Transmitter flow graph for video transmission designed using GNU radio.

Figure 6 :
Figure 6: Receiver side flow graph for video reception and detection of signal designed using GNU radio.

Figure 7 :
Figure 7: Energy based detector output is zero under only noise no signal condition.

Figure 8 :
Figure 8: Energy based detector output is zero as the transmission stops.

Figure 9 :
Figure 9: Energy based detector output is one as the transmission starts.