Keywords

1 Introduction

Research in wireless communication has become an increasingly important topic in twenty-first century with aggravated demand for high data rates, electronic, and communication gadgets across the globe. However the available spectrum is limited due to the static assignment policy. It has been observed by the telecom regulatory bodies that the spectrum has been greatly underutilized most of the time [1].

CR is an existing technology that has sparked intense interest in recent years among research communal. It has a profound impact in wireless communication with the increase in competition for usage of available spectrum. Finding the vacant spectrum band and its usage by SUs while providing adequate protection to PUs is the chief concept of this technology [2, 3]. Thus, Spectrum Sensing (SS) plays a key role. It is one of the most important functionalities of CR. Research has been done on SS techniques by various researchers [4, 5] studying pros and cons of each technique. However, Energy Detection (ED) technique is used in this paper due to its simplicity and ease. Moreover, it is the most commonly used and popular technique with no prior information requirement of PU. Liang et al. [6] in formulated sensing-tradeoff problem using this technique. In CRNs, main focus is to protect PU, i.e., maximize Pd with constraint on Pf. The authors’ further investigated tradeoff problem for low SNR regimes of-15 dB.

An improved ED spectrum sensing scheme based on past history of sensing results (average of test statistics) while preserving same level complexity and application as that of conventional scheme has been proposed by M. L. Benitez and F. Casadevall in [7]. The authors evaluated performance improvement and observed lesser time between two consecutive sensing events for same Pd and Pf. There are three main factors of sensing performance, i.e., channel between PU transmitter and SU, sensing time and detection threshold that have been considered in [8]. The expression for average Pd is derived which is further used by authors’ to optimize detection threshold in terms of SNR. However, the local SS is deteriorated with practical wireless phenomenon like multipath fading and shadowing. Hence, an active technique for improving detection performance by exploiting spatial diversity comes into consideration and has been beautifully presented by I. F. Akyildiz in [9]. In practice, detection performance needs consideration of these practical phenomenon and Cooperative Spectrum Sensing (CSS) takes the power of mitigating these effects.

In this presented paper, simulation model in ED is developed and studied using MATLAB Simulink environment, taking into account optimal threshold and SNR conditions. These are important parameters which needs to be taken care for efficient sensing unlike [6, 7]. Further, the designed model has been extended to CSS with cooperation of five SUs. The paper deals with PU activities at different time intervals for these techniques.

2 The Energy Detection Study

Signal detection in CRN is a binary hypothesis problem and can be represented

$$ Y\left( n \right) = W\left( n \right):H_{0} . $$
(1)
$$ Y\left( n \right) = h X\left( n \right) + W\left( n \right):H_{1} , $$
(2)

where Y(n) is signal samples received at the detector deciding presence or absence of PU, W(n) is AWGN, h is the channel gain, X(n) is PU signal samples at the detector. The detector has to choose one of the hypothesis depending on the test statistics. Energy of the sensed signal is estimated, termed as test statistics using [3].

$$ T\left( Y \right) = \frac{1}{N}\sum\limits_{n = 1}^{N} {\left( {Y\left[ n \right]} \right)^{2} } . $$
(3)

where N = fs is sample size,is sample time and fs is sampling frequency. T(Y) is compared with λ to conclude a decision. The threshold [6] and decision statistics can be given as

$$ \lambda = \frac{{\frac{{Q^{ - 1} \left( {Pf} \right)}}{\sqrt N } + 1}}{\text{SNR}}. $$
(4)
$$ Z = \left\{ \begin{aligned} T\left( Y \right) \le\uplambda:H_{0} \hfill \\ T\left( Y \right) >\uplambda:H_{1} \hfill \\ \end{aligned} \right.. $$
(5)

Each SU will either detect presence of PU signal or will detect its absence. If decision statistics, i.e., Z is larger than λ PU exists else does not exist.

3 Simulink

Simulink has been used by numerous researchers for designing and simulating models of multidomains. It is assimilated with Matlab, allowing incorporation of MATLAB algorithms into models [10, 11].

3.1 Vital Subsystem for Spectrum Sensing

The hierarchy of a model includes subsystems. A subsystem contains a subset of blocks within the main model. The subsystems that are vital for SS Simulink model are PU and SU signal [12, 13] (Fig. 1).

Fig. 1
figure 1

Subsystem for SU signal

Fig. 2
figure 2

Simulink model for ED technique

White Gaussian noise is added to signal by AWGN channel. The input signal may be real or complex and accordingly produces output signal. S-function blocks (User-Defined Functions block) have been used for spectrum energy and optimal threshold calculation. Matlab algorithm has been written in these blocks and has been further added to the Simulink model. This is how own function blocks are created in Simulink with MATLAB code in the background. S-functions are compiled as MEX files using mex utility. Further, relational operator block has been used to compare signal’s energy with threshold.

3.2 Energy Detection Simulation Model

The model has been developed using blocks of Simulink and by creating subsystems as shown in Fig. 3. Digital clock block is needed when current simulation time is required within a discrete system. The sample time needs to be adjusted. The Abs block outputs absolute value of input. The Buffer block adjusts input sequence to smaller or larger frame size, frame-based processing is performed. Input’s data of each column is redistributed producing different frame size’s output. Slower frame rate output means an input signal is buffered to a larger frame size or vice versa (Fig. 2).

Fig. 3
figure 3

Simulink model for CSS

In ED, sampling frequency needs to be at least twice the center frequency in order to satisfy Nyquist criteria. Here, real and estimated activity of PU have been determined by using user-defined block.

3.3 Cooperative Spectrum Sensing Simulation Model

Performance of local SS by individual SU degrades in attendance of fading and shadowing. Thus, researchers have proposed CSS to combat the effects of fading and shadowing [14, 15] in practical wireless scenarios. In his Simulink model five SUs have been taken into consideration to conclude a global decision.

Here, individual decision about the presence/absence of PU is taken by each SU while the global or final decision is taken at the fusion center. In this paper, AND decision rule has been used at the fusion center. CSS takes into account spatial characteristics of each SU.

4 Results and Investigations

The simulation results shown below quantify the real and estimated PU activity for the used techniques, i.e., ED and CSS. The Simulink models have been designed considering optimal threshold and SNR conditions. The PU activity have been modeled randomly as ON/OFF activity corresponding to 1 (presence) and 0 (absence) respectively.

The white gaps within blue bands is when the algorithm missed to detect PU activity due to noise. The performance has been evaluated at 10 dB SNR in Figs. 4 and 5.

Fig. 4
figure 4

PU real activity for energy detection technique at 10 dB SNR

Fig. 5
figure 5

Estimated PU activity for energy detection technique at 10 dB SNR

The results are fine as ED performs well for high and moderate SNR conditions as shown in Table 1. So, low SNR condition has been taken for further investigation and the results have been demonstrated in Figs. 6, 7 and Table 2.

Table 1 PU real and estimated activity at 10 dB SNR for ED
Fig. 6
figure 6

PU real activity for energy detection technique at −10 dB SNR

Fig. 7
figure 7

Estimated PU activity for energy detection technique at −10 dB SNR

Table 2 PU real and estimated activity at −10 dB SNR for ED

However, from Figs. 6, 7 and Table 2, it becomes clear that this detection algorithm fails at low SNR, thus giving rise for need of more accurate detectors like cyclostationary- or entropy-based detectors to perform well in low SNR conditions.

The designed Simulink model refreshes after every 3 s for each value of SNR. Afterwards, a new SNR floor is selected and probability of detection is estimated for the previous SNR value.

From Fig. 8 it can be clearly observed that the technique works well for moderate and high SNR conditions and for low SNR values it is deteriorating constantly. Further, CSS simulation results for PU activity considering five SUs have been shown in Figs. 9, 10. For simplicity, AND decision rule has been used at fusion center to reach a global decision.

Fig. 8
figure 8

Pd versus SNR curve for energy detection technique

Fig. 9
figure 9

PU real activity for cooperative spectrum sensing at 10 dB SNR

Fig. 10
figure 10

Estimated PU activity for cooperative spectrum sensing at 10 dB SNR

CSS aids in accurate detection of PU signal considering spatial characteristics. The above Table 3 shows the real and estimated PU activities at 10 dB SNR.

Table 3 PU real and estimated activity for CSS

5 Conclusions

In this paper, Simulink model for ED and CSS scheme have been designed. Users own block has been designed for optimal threshold calculation, where MATLAB algorithm has been written in the background (MATLAB editor window). Thus, making it convenient for implementing whole concept of the specified technique. Further, investigations have been performed for high and low SNR conditions. Optimal threshold and Signal to Noise Ratio (SNR) conditions have been considered providing more accurate results. It can be concluded that ED technique works well for high SNR conditions while for low SNR conditions it fails. Moreover, the model has been extended for CSS with cooperation of five SUs. Matlab Simulink can be used to simulate modules of CRN and further the concept can be implemented for real scenarios.