# Practical Assessment of Energy-Based Sensing through Software Defined Radio Devices

Miguel Duarte, Antonio Furtado, M. Luis, Luis Bernardo, Rui Dinis, Rodolfo Oliveira

► To cite this version:

Miguel Duarte, Antonio Furtado, M. Luis, Luis Bernardo, Rui Dinis, et al. Practical Assessment of Energy-Based Sensing through Software Defined Radio Devices. Luis M. Camarinha-Matos; Nuno S. Barrento; Ricardo Mendonça. Technological Innovation for Collective Awareness Systems: 5th IFIP WG 5.5/SOCOLNET Doctoral Conference on Computing, Electrical and Industrial Systems, DoCEIS 2014, Costa de Caparica, Portugal, April 7-9, 2014. Proceedings, AICT-423, Springer, pp.525-532, 2014, IFIP Advances in Information and Communication Technology, 978-3-642-54733-1-10.1007/978-3-642-54734-8_58. hal-01274819

HAL Id: hal-01274819

https://inria.hal.science/hal-01274819

Submitted on 16 Feb 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Practical Assessment of Energy-based Sensing through Software Defined Radio Devices

Miguel Duarte¹, A. Furtado¹,², M. Luis¹,², L. Bernardo¹,², R. Dinis¹,², R. Oliveira¹,²

¹ CTS, Uninova, Dep.º de Eng.ª Electrotécnica, Faculdade de Ciências e Tecnologia, FCT, Universidade Nova de Lisboa, 2829-516, Caparica, Portugal

² IT, Instituto de Telecomunicações, Portugal

**Abstract:** The Cognitive Radio is a solution proposed for the increasing demand of radio spectrum. Usually cognitive radios are adopted by the non-license wireless users, which have a certain degree of cognition in order to only access to a given frequency band when the band is sensed idle. However, these bands and their use must be assessed, to avoid interfering with licensed users (primary users). The way to assess band's occupancy is by discerning between just noise or noise plus signal. In this paper, energy-based sensing (EBS) is considered through the use of a classical energy detector. The work proposes and describes an implementation of an energy detector using a software defined radio (SDR) testbed and, after computing the probability of detection and false alarm from a real set of samples obtained with the SDR devices, we successfully validate a theoretical model for the probabilities. EBS' performance is validated for several points of operation, i.e. for different signal-to-noise-ratio (SNR) values. These findings may be useful for building an EBS detector that defines its own decision threshold in real time given the target probabilities, since the formal probabilities are successfully validated. Moreover, our contribution also includes a detailed description of the implemented blocks using GNU Radio's open-source software development toolkit.

**Keywords:** Software Defined Radio, Energy Sensing, System Performance.

## 1 Introduction

Cognitive Radio (CR) has been proposed as an effective answer to alleviate the increasing demand for radio spectrum [1]. CR nodes, usually denominated Secondary Users (SUs) due to its non-licensed operation, must be aware of the activity of the licensed users, denominated Primary Users (PUs), in order to dynamically access the spectrum without causing them harmful interference.

Spectrum Sensing (SS) aims at detecting the availability of vacant portions (holes) of spectrum and has been a topic of considerable research over the last years [1]. It plays a central role in CR systems. The traditional SS techniques include Waveform-based sensing (WBS) [2], a coherent technique that consists on correlating the received signal with a priori known set of different waveform patterns; Matched Filter-based sensing (MFBS) [3], an optimal sensing scheme where the received signal is also correlated with a copy of the transmitted one; and Cyclostationarity-based sensing (CBS) [4], a technique that exploits the periodic characteristics of the
received signals, i.e., carrier tones, pilot sequences, etc. MFBS assumes prior
knowledge of the primary's signal, while WBS assumes that the received signal
matches with one of the patterns previously known. This means that these sensing
techniques are not feasible in some bands, where several communication technologies
may operate without a priori knowledge. On the other hand, CBS is impracticable for
signals that do not exhibit cyclostationarity properties.

Energy-based sensing (EBS) [5], [6] is the simplest spectrum sensing technique and its main advantage is related with the fact that it does not need any *a priori* knowledge of PU's signal. At the same time, it is well known that EBS can exhibit low performance in specific comparative scenarios [7], or when noise's variance is unknown or very large. EBS has been studied in several CR scenarios, namely on local and cooperative sensing schemes [1]. More recently, several EBS schemes adopting sub-Nyquist sampling have been proposed, which are advantageous in terms of the sensing duration [8].

This work evaluates the performance of the EBS technique in a real Software Defined Radio (SDR) platform. EBS’ theoretical probabilities of detection and false alarm are compared with practical ones obtained with the SDR system. The comparison indicates that the theoretical probabilities are successfully validated.

## 2 Relationship to Collective Awareness Systems

As it is well known, collective systems massively rely on communication that is most of the times supported by wireless links. Wireless communication technologies allow high level of device’s mobility, and are indicated for scenarios where mobility is required. Simultaneously, wireless technologies avoid the use of physical (wired) connections, being an effective solution for collective awareness systems relying on mobile players. As mentioned in the introduction, Cognitive Radio was proposed as a solution to alleviate the increasing demand for radio spectrum and, consequently, as more radio spectrum becomes available more wireless devices can be used. Consequently, CR will help the development of novel collective awareness systems by increasing the number of wireless devices that may access the network.

## 3 Energy-based Sensing

This work considers a cognitive radio network with a pair of PUs accessing the channel and a pair of SUs that access the channel in an opportunistic way. The considered scheme is similar with the one presented in [11]. SUs are equipped with a single radio transceiver. However, because SUs are unable to distinguish SUs and PUs' transmissions, SU's operation cycle includes the sensing and transmission periods, which facilitates the synchronization of the sensing task. Sensing and transmission period durations are represented by $T_S^{SU}$ and $T_D^{SU}$ respectively, as illustrated in Fig. 1.
<table><caption>Fig. 1. SU's frame structure representing SU's operation cycle.</caption><thead><tr><th colspan="3">T<sub>S</sub><sup>SU</sup></th><th colspan="3">T<sub>D</sub><sup>SU</sup></th></tr></thead><tbody><tr><td>1</td><td>...</td><td>N<sub>S</sub></td><td>N<sub>S</sub>+1</td><td>...</td><td>N<sub>T</sub></td></tr></tbody></table>

The SU's frame, $T_F^{SU} = T_S^{SU} + T_D^{SU}$, contains $N_T$ slots, where each slot duration is given by the channel sampling period adopted in the spectrum sensing task. The first $N_S$ slots define the sensing period duration, and the remaining ones ($N_S + 1$ to $N_T$) represent the transmission period duration. To distinguish between occupied and vacant spectrum bands, SU's sample the channel during the sensing period $T_S^{SU}$, and for each sample k two hypotheses can be distinguished

$$ \begin{aligned} \mathcal{H}_{00}: &x(k) = w(k) & k = 1, 2, \dots, N_S \\ \mathcal{H}_{11}: &x(k) = w(k) + s(k) & k = 1, 2, \dots, N_S, \end{aligned} \quad (1) $$

where $s(k)$ denotes the signal transmitted by the PUs, with distribution $N(\mu_s, \sigma_s^2)$. $w(k)$ is assumed to be a zero-mean variable with variance $\sigma_n^2 = 1$, representing additive Gaussian white noise. The received signal is given by

$$ Y \sim \begin{cases} \mathcal{N}(\mu_n, \sigma_n^2), & \mathcal{H}_{00} \\ \mathcal{N}(\mu_n + \mu_s, \sigma_n^2 + \sigma_s^2), & \mathcal{H}_{11} \end{cases} \quad (2) $$

Therefore, for a single SU, the probability of detection $P_D^{\mathcal{H}_{11}}$ and the probability of false alarm $P_{FA}^{\mathcal{H}_{00}}$ are represented by

$$ P_D^{\mathcal{H}_{11}} = \mathrm{Pr}(Y > \gamma | \mathcal{H}_{11}) = Q\left(\frac{\gamma - (\mu_n + \mu_s)}{\sigma_n^2 + \sigma_s^2}\right) \quad (3) $$

$$ P_{FA}^{\mathcal{H}_{00}} = \mathrm{Pr}(Y > \gamma | \mathcal{H}_{00}) = Q\left(\frac{\gamma - \mu_n}{\sigma_n^2}\right), \quad (4) $$

where $Q(.)$ is the tail probability of the standard normal distribution.

In the testbed L time samples are used to determine the fast Fourier Transform (FFT). The FFT is represented in L frequency bins and $Ns/L$ FFTs are computed during the sensing period ($T_S^{SU}$). During this period, the average energy received per sample, $Y_n$, is defined as

$$ Y_n = \frac{1}{Ns} \sum_{n=1}^{Ns/L} X_n, \quad (5) $$

where $X_n$ is the sum of the power of each individual FFT bin, given by

$$ X_n = \sum_{n=1}^{L} |x_n e^{-i2\pi k \frac{n}{L}}|^2, \quad k = 1, \dots, L. \quad (6) $$

The decisions performed in the testbed are according to the following conditions,

$$ \begin{aligned} C_0 &= 0, & \mathcal{H}_{11}|_{Y_n < \gamma} \\ C_1 &= 1, & \mathcal{H}_{11}|_{Y_n > \gamma} \end{aligned} \quad (7) $$
$$B_0 = 0, \quad \mathcal{H}_{00}|Y_n < \gamma$$

$$B_1 = 1, \quad \mathcal{H}_{00}|Y_n > \gamma,$$

where $C_1$ contributes for the measured probability of detection, while $B_1$ represents the case of false alarm.

# 4 System Implementation

## 4.1 Testbed

The EBS was implemented using the GR (GNURadio) software architecture [9] and the USRP (Universal Software Radio Peripheral) hardware platform [10]. These tools are compliant with the notion of SDR (Software Defined Radio), mostly due to their flexibility when it comes to DSP (Digital Signal Processing). This flexibility opens up options when dealing with Digital Signal Processing. In this case, a range of FFT sizes can be chosen, instead of a fixed one like in most DSP devices. This allows for a variation in the $N_s/N_T$ ratio.

The setup consisted of two USRP B100 devices connected to one computer. The USRPs are connected by a coaxial cable and two 30dB attenuators to achieve the desired signal-to-noise (SNR) values. One USRP implements a Primary User while the other behaves as the Secondary user, sensing for the presence of the first one. The basic blocks of the GR system are written in C++. These blocks link directly with the USRP and its FPGA. Python is used as a “glue” to connect these blocks and as a controller to the system flow (issuing start and stop commands). The script used to build the EBS was entirely written in python, also making use of python math library tools.

## 4.2 EBS Structure

A conventional EBS consists of a low pass filter, an A/D converter, a square-law device and an integrator (see Fig. 1). The detector model used in this work consists of an A/D converter followed by an L-Point FFT (6). The FFT provides the windowing needed to filter out unnecessary frequency bands. This data is then averaged (see Fig. 3), and the sensing output is determined according to $C_0/C_1$ or $B_0/B_1$ conditions (eq. (7)).

<figure><img src="image_2.png" /><figcaption>Fig. 2. Typical Energy-based Detector.</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig. 3. FFT Energy-Based Detector.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig. 4. GNURadio Blocks.</figcaption></figure>
## 4.3 Primary User Signal

The Primary signal is assumed to obey a Normal Distribution with higher amplitude than the noise distribution for sake of simplicity. The signal generation is achieved using the blocks in Fig.5.

<figure><img src="image_5.png" /><figcaption>Fig. 5. PU signal generator.</figcaption></figure>

# 5 Comparison Results

## 5.1 Calibration and Parameter Calculation

This subsection validates the noise $w(k)$ and PU's signal $s(k)$. The USRP's parameters used in the validation are shown in Table 1.

<table><caption>Table 1. USRP Configuration</caption><thead><tr><td>Freq. (GHz)</td><td>L</td><td>Sample Rate (Sps/s)</td><td>SU Gain (dB)</td><td>PU Gain (dB)</td><td>SNR (dB)</td><td>Primary Amplitude</td></tr></thead><tbody><tr><td>1.3</td><td>256</td><td>1,000,000</td><td>0</td><td>17</td><td>0.11</td><td>0.05</td></tr></tbody></table>

Noise ($w(k)$) and Signal plus Noise ($w(k) + s(k)$) signals were sampled during a 10 second interval. The histogram of the received energy is plotted in Fig. 6. In this figure the green curve approximates the noise distribution, while the red one approximates the noise plus signal distribution. Since the overlapping area of the approximate distributions is negligible, a decision threshold can be defined to identify the two conditions with low error.

<figure><img src="image_6.png" /><figcaption>Fig. 6. Histogram of Signal and Signal plus Noise data and respective normal approximations. P is the number of occurrences.</figcaption></figure>
## 5.2 Practical Probabilities

Taking the x-axis values of Fig. 6 as a hypothetical range for the decision threshold, the probabilities $P_D$ and $P_{FA}$ were computed from the conditions expressed in equation (7). Basically, $P_D$ was computed as the ratio of the number of times the condition $C_1$ was observed over the total number of decisions. $P_{FA}$ was similarly computed as the ratio of the number of times the condition $B_1$ was observed over the total number of decisions. These probabilities are shown in Fig. 7, where the achieved results are compared with the theoretical ones.

<figure><img src="image_7.png" /><figcaption>Fig. 7. Theoretical and practical probabilities $P_D$ and $P_{FA}$ ($T_S^{SU} = 0.512s$).</figcaption></figure>

As can be seen, the registered practical values approach the theoretical ones. This is, however, for a very long sensing period (512 ms). Fig. 8 shows the results achieved for a shorter sensing period ($N_s=512000$, which corresponds to $T_S^{SU} = 51.2ms$). In this case the practical results underperform the case of longer sensing period, but the practical results roughly follow the theoretical trend.

<figure><img src="image_8.png" /><figcaption>Fig. 8. Theoretical and Real Probabilities ($T_S^{SU} = 0.0512s$).</figcaption></figure>
## 5.3 Performance Evaluation

With the knowledge of the signal and noise statistics, a threshold can be defined so that the desired conditions (a certain pair of $P_D$ and $P_{FA}$) can be achieved. By inspecting the theoretical curves for the probabilities, a threshold was defined where the $P_{FA}$ was set to 5%. Since $P_{FA}$ only depends on noise power, and not on noise plus signal, its value should remain constant for any SNR value. $P_D$ does not follow the same rationale, since it depends on SNR (eq. (3)). The following test evaluates the detection performance for a fixed decision threshold (3.7E-07) and varying the SNR from -10 to 2 dB. Different sensing periods were also tested, from 0.0125s to 0.512s. The obtained results are shown in Fig 9.

<figure><img src="image_9.png" /><figcaption>Fig. 9. $P_D$ curve for SNR [-10,2] dB.</figcaption></figure>

As can be seen, the statistic test for sensing period durations longer than 0.05s start to be redundant, since they present almost the same performance. At 0dB we observe that the detector performance is high, and for $T_S^{SU} > 0.05$s the miss-detection probability is lower than 10%. Due to lack of space we do not present false alarm probabilities for the same scenario, but for sensing period durations longer than 0.05s we have observed that the false alarm probability is always lower than 5%, which confirms the expected performance for the adopted decision threshold.

## 6 Conclusions

In this work we have addressed the assessment of energy detection for cognitive radio systems. We started to characterize the performance of an energy detector through practical USRP devices. The theoretical performance was successfully validated
through practical results. For higher SNR values, the detection probability is high even for short sensing periods, achieving detection probabilities that approach 1. For lower SNR values a higher sensing time is required but even in these cases substantial performance can be achieved.

**Acknowledgments.** This work was partially supported by the Portuguese Science and Technology Foundation under the projects PTDC/EEA-TEL/115981/2009, PTDC/EEA-TEL/120666/2010, PTDC/EEI-TEL/2990/2012, PEst-OE/EEI/UI0066/2011, PEst-OE/EEI/LA0008/2011, SFRH/BD/68367/2010 and SFRH/BD/68367/2010.

**References**

1. T. Yucek and H. Arslan, "A survey of spectrum sensing algorithms for cognitive radio applications," *Communications Surveys Tutorials, IEEE*, vol. 11, pp. 116-130, First Quarter 2009

2. Zahedi-Ghasabeh, A. Tarighat, and B. Daneshrad, "Spectrum Sensing of OFDM Waveforms Using Embedded Pilots in the Presence of Impairments," *Vehicular Technology, IEEE Transactions on*, vol. 61, pp. 1208-1221, March 2012

3. A. Bouzegzi, P. Ciblat, and P. Jallon, "Matched Filter Based Algorithm for Blind Recognition of OFDM Systems," in *Proc. IEEE VTC 2008-Fall*, pp. 1-5, September 2008

4. A. Al-Habashna, O. Dobre, R. Venkatesan, and D. Popescu, "Cyclostationarity-Based Detection of LTE OFDM Signals for Cognitive Radio Systems," in *Proc. IEEE GLOBECOM 2010*, pp. 1-6, December 2010

5. H. Urkowitz, "Energy Detection of Unknown Deterministic Signals," *Proceedings of the IEEE*, vol. 55, pp. 523-531, April 1967

6. A. Ghasemi and E. S. Sousa, "Optimization of Spectrum Sensing for Opportunistic Spectrum Access in Cognitive Radio Networks," in *Proc. IEEE CCNC 2007*, pp. 1022-1026, January 2007

7. D. Bhargavi and C. Murthy, "Performance comparison of energy, matched-filter and cyclostationarity-based spectrum sensing," in *Proc. IEEE SPAWC 2010*, pp. 1-5, June 2010

8. Z. Tian and G. Giannakis, "Compressed Sensing for Wideband Cognitive Radios," in *Proc. IEEE ICASSP 2007*, vol. 4, pp. IV-1357-IV-1360, April 2007

9. GNURadio - Free Software Toolkit for SDR - http://www.gnuradio.org/

10. Ettus Research, http://www.ettus.com/, Dec. 2013

11. M. Luis, A. Furtado, R. Oliveira, R. Dinis and L. Bernardo, "Towards a Realistic Primary Users' Behavior in Single Transceiver Cognitive Networks," *IEEE Communications Letters*, vol.17, no.2, pp.309-312, February 2013