Energy Detector with Baseband Sampling for Cognitive Radio: Real-Time Implementation


Cognitive radio (CR) is a technology that provides a promising new way to improve the efficiency of the use of the electromagnetic spectrum that available. Spectrum sensing helps in the detection of spectrum holes (unused channels of the band), and instantly move into vacant channels while avoiding occupied ones. An energy detector with baseband sampling for CR is presented with mathematical analyses for an additive white Gaussian noise (AWGN) channels. A brief overview of the energy detection based spectrum sensing for CR technology is introduced. Practical implementation issues on Texas Instruments TMS320C6713 floating point DSP board are presented. Novelties of this work came from a derivation of probability of detection and probability of false alarm for the baseband energy detector without including the sampling theorems and the associated approximation.

Share and Cite:

Abdulsattar, M. and Hussein, Z. (2012) Energy Detector with Baseband Sampling for Cognitive Radio: Real-Time Implementation. Wireless Engineering and Technology, 3, 229-239. doi: 10.4236/wet.2012.34033.

1. Introduction

The limited available spectrum and inefficiency in the use of the spectrum makes it necessary to establish the new communication model to benefit from the existing wireless spectrum professionally.

Mitola proposed a solution to the spectrum efficiency problem [1], where higher spectrum efficiency can be reached by dynamic spectrum access [2,3]. The concept of cognitive radio (CR) allows detecting the unused spectrum (spectrum holes) of the primary user (PU) in order for the secondary user (SU) to share the spectrum without harmful interference. The accuracy of detection is the most important factor that determines the performance of the CR. Since the concept of CR is still at the stage of being developed, there is no agreement on what kind of wireless technologies to employ for realizing it. Currently, there are three different techniques which are commonly used in signal processing techniques for spectrum sensing [4]: matched filter, cyclostationary feature detection and energy detection.

In [5], the matched filter also referred to as coherent detector, it can improve detection performance if the primary transmitted signal is deterministic and known a priori. This technique can be applied only when we choose to detect specific signals, and it is very accurate since it maximizes the SNR for the signal.

In [6,7], a signal is said to be cyclostationary if its mean and autocorrelation are a periodic function. Communication signals may have special statistical features. Feature detection denotes to extracting features from the received signal and performing the detection based on the extracted features. Cyclostationary feature detection can distinguish PU signal from noise, and used at very low signal to noise ratio (SNR) detection by using the information embedded in the PU signal that is not presented in the noise. The main drawback of this method is the complexity of calculation. Also, it must deal with all the frequencies in order to generate the spectral correlation function, which makes it a very large calculation. The benefit of feature detection compared to energy detection is that it typically allows differences among dissimilar signals or waveforms.

Energy detection (also denoted as noncoherent detection), is the signal detection mechanism using an energy detector (also known as radiometer) to specify the presence or absence of signal in the band. The most often used approaches in the energy detection are based on the Neyman-Pearson (NP) lemma. The NP detection criterion enlarges the probability of detection for a given probability of false alarm.

It is an essential and a common approach to spectrum sensing since it has moderate computational complexities, and can be implemented in both time domain and frequency domain [8,9]. In [10], to adjust the threshold of detection, energy detector requires knowledge of the power of noise in the band to be sensed. The signal is detected by comparing the output of energy detector with threshold which depends on the noise floor.

The TMS320C6713 kit was chosen as it provides a properly low cost access into the real-time implementation of energy detection algorithms. This DSP card has the following features: It evaluates 1350 million floating point operations per second (MIPS), a processor running at 225 MHz, programmed by C and assembly languages.

The paper is organized as follows: Section 2 describes detection techniques. Section 3 lists the main issues of previous works. Section 4 presents the baseband energy detector model. Section 5 drives probability equations for baseband energy detector over AWGN Channel. Section 6 describes how to generate noisy PU signal. Section 7 implemented using a DSP kit. Discussed in Section 8 presented. Finally, in Section 9 the conclusions are mentioned .

2. Detection Techniques

Fundamental to the theory of detecting the signal in noise is the theory of statistical decision, where the decision-making depends on the hypothesis testing. In binary hypothesis testing, the problem resides in defining a decision rule that indicates which of two hypotheses should be chosen: the null hypothesis () or the alternative hypothesis (). If the null and alternative hypotheses are defined in terms of signal(s), hypothesis (signal absent) and hypothesis (signal present).

In [11], the decision rule can be represented as


where is the threshold and is a function that depends on the measurements. If it exceeds the threshold, then is selected; otherwise, is decided. The aim of the detection theory is, hence, to design the most effective detector by definition and. Let be the observation vector and denote the joint probability density function (PDF) of these elements of observing y given that was true, is often referred to as the likelihood function of the observation vector y. Thus, we can define the is the likelihood ratio test (LRT) as


In [12], define two main approaches to test the hypothesis: NP and Bayesian. The method used depends on our readiness to merge previous knowledge about the probability of a different hypothesis. If we were able to assign prior probabilities to hypotheses, we can use the approach of Bayesian. However, in most detection problems we cannot say how probable an event is and we have used the NP approach instead.

2.1. Bayes Test

The aim of the Bayes test is to minimize the mean cost or “risk”, whose expression can be evaluated as [13]


where is the cost that denotes is accepted while is true, denotes the probability that we accept when is true. From this expression it is possible to derive the decision rule can be expressed as


the probability, is called a priori probability of. When the Bayes' test is the maximum aposteriori probability (MAP) test as shown


Also, when the MAP test is called maximum-likelihood (ML) test as shown


2.2. Neyman-Pearson Test

In [12], the NP test follows a different philosophy than that of the Bayes test. The NP test can be expressed in terms of the LRT as


where is the Lagrange multiplier and equals to value of detector threshold. is chosen to satisfy the constraint


where as defined as the type I error or probability of false alarm, which is the probability that the LRT is larger than the threshold when the observation is composed entirely of noise, level of significance. The detection is performed on the basis of a Constant False Alarm Rate (CFAR) i.e. The NP technique provides a threshold for detection subject to a constant. The probability of detection can be evaluated as


is the probability that the likelihood ratio is larger than the threshold when the observation is composed of the signal of interest and noise.

If the signal under hypothesis is assumed to be, and under is assumed to be can be evaluated as


taking logarithm, and removing all constants that are independent of vector, and merging with threshold, we obtain test as


Hence, the optimal detector, in the NP sense, is in this case the energy detector.

A test of the hypotheses which is optimal in the NP and Bayes test can be expressed as


3. Previous Works

Energy detector has been widely used for signal detection due to its simple circuit in practical implementation.

The most important preliminary work for the general analysis of energy detector was presented in the landmark paper [10], the authors proposed the model as shown in Figure 1.

In [10], his classic work was based on detection of a deterministic signal in an additive white Gaussian noise (AWGN), and exact noise variance is known a priori. The input signal is first passed through an ideal bandpass filter (BPF) with center frequency and bandwidth W, with transfer function


Figure 1. Classical model of energy detector.

where is the one-sided noise power spectral density, this normalizes it found convenient to compute the false alarm and detection probabilities using the related transfer function. After that the signal squared, and integrated in the observation interval T to produce a test statistic, is compared to a threshold. The receiver makes a decision that the target signal has been detected if and only if the threshold is exceeded.

In [14], the received signal of SU under the binary hypotheses testing can be represented as


where represents the hypothesis corresponding to “no signal transmitted”, and to “signal transmitted”, is the unknown deterministic transmitted signal, and assumed to be an AWGN with zero mean and variance is known a priori. The SNR is denoted as

where variance of signal and variance of noise. By using Shannon’s sampling formula, we can obtain the reconstructed noise signal



is the normalized function and

is the i-th noise sample. The test statistic under hypothesis as follows


If we take the BPF effect and simplify, the decision rule which is employed by the energy detector can be obtained as


The same approach can be applied under hypothesis when the signal is presented, by replacing each by where


The test statistic for both cases can be expressed as


where chi-square distribution with the degree of freedom (DOF), and noncentral chi-square distribution with the same number of DOF and a noncentrality parameter equal to. The probability of detection and probability of false alarm can be computed if by



In [15], present several classical models of energy detector, which can be used to evaluate the energy detector performance instead of using the accurate results. These models are easily available for theoretical analysis when one takes advantage of the energy detector for spectrum sensing [16].

In [17], Lehtomaki has done a lot of research work in signal detection based on the ideal energy detector. His main goal was to develop energy based detectors. Different possibilities for setting the detection threshold for a quantized total power energy detector are analyzed.

Energy detector has discussed the existence of signals with random amplitude and channel fading in [18] and [14]. The average probability of detection over a fading channel also derived.

The improved performance of the energy detector for random signals corrupted by Gaussian noise is derived. The derivation is based on a simple modification to the conventional energy detector in [10,14,18] by replacing the squaring operation of the signal amplitude with an arbitrary positive power operation [19].


In [20], in order to solve both the interference avoidance and the spectrum efficiency problem, an optimal spectrum sensing framework is based on the maximum a posteriori probability (MAP) energy detection and its decision criterion based on the primary user activities. The PU activities can be assumed as a two state birthdeath process, death rate and birth rate. Where each transition follows the Poisson arrival process meaning that the length of ON (Busy) and OFF (Idle) intervals of primary network are exponentially distributed. We can estimate the a posteriori probability as follows



where is the probability of the period used by primary users and is the probability of the idle period. From the definition of MAP detection, the detection probability and false alarm probability can be expressed as follows



where is a decision threshold of MAP detection.

4. Baseband Energy Detector Model

In practical implementation of the energy detector, transmission and sensing cannot be performed at the same time. Thus, during observation time, all CR users should stop their transmissions. Due to this hardware constraint, CR users should sense the spectrum cyclically with sensing period and transmission time, as described in Figure 2.

A large number of signal processing applications function in real-time systems. Because most signal processing is nowdays implemented with DSP methods, it is suitable for understanding EDs as discrete time (DT) systems. The input signal of the DT system is denoted by a sequence as


where is analogue continuous time signal that is sampled in order to produce the DT signal, the time index n is an integer, and is the sampling interval, which is reciprocal to the sampling frequency and is given by


A system model of energy detector with baseband sampling for CR can be shown in Figure 3.

In order to measure the energy of the received signal, the output signal of codec is squared and integrated over

Figure 2. Sensing and transmission structure for energy detector.

Figure 3. Energy detector with baseband sampling using a DSP kit.

the sensing interval. The sensing interval is usually assumed to be small enough so that the PU signal can span over the whole sensing interval. According to the Nyquist sampling theorem, the minimum sampling rate should be, where W is the highest frequency of the original signal, hence, the minimum sample size N collected by the energy detector can be represented as. In real-time equal to sampling frequency of the DSP card, hence as sensing time is chosen such that N is an integer


5. Baseband Energy Detector over AWGN Channel

In a binary hypothesis test, the received signal after codec can be given as


where N denotes the number of samples collected during the signal sensing period. The test statistic for the energy detector with predetermined threshold is defined as follows


When the received signal contains the noise only under hypothesis, the test statistic can be written as:


Since V is a square sum of N AWGN with zero mean, i.e., thus the distribution of the test statistic is a chi-square with N degrees of freedom (DOF) [21], can be evaluated as follows


where, is an integer, is the gamma function, which is defined as


From the definition of false alarm probability, the CR decides in favor of while the band is idle, thus, the false alarm probability can be expressed as



To solve this equation, we must apply some variable conversion for we get


(incomplete gamma functionis given by [22] , therefore (35) becomes


In [23, Equation (2.5), p. 24], the incomplete gamma function can be expressed as


based on (37), can be evaluated as


The same approach is applied when the signal of PU, is presented hence, the test statistic under hypothesis becomes


We can observe that V consists of two terms: a fixed (non-random) component and a noise component obey the Gaussian distribution. More specifically, V is a noncentral chi-square distribution with non-central parameter and N DOF, , in particular, the PDFs of V under hypothesis takes the form [21]


where is the n order modified Bessel function. The probability of detection is


The can be expressed in term of the generalized Marcum Q-function, which is defined as [21]


Where m is a nonnegative integer, and and are nonnegative real numbers. If we change variable of integration (41), v to x, where

, and letwe obtain


If i.e. the Marcum Q-function is difficult to calculate or to take its inverse, thus, we can use the central limit theorem (CLT), for the large number of sample, we can use the Gaussian distribution to approximate the chi-square distribution, under hypothesis, and non-central chi-square distribution, under hypothesis, thus, the CLT can therefore be employed to approximate the test statistic as Gaussian


If only AWGN is considered, and of energy detector can be derived in terms of the Q function as follows



where the

is standard Q-function [22]. The decision threshold is determined by the pdf of the noise only signal, thus, by using (44), we get


where denote the inverse Q-function [22].

In [20], should be kept as small and should be large as possible to avoid underutilization of transmission opportunities. Note that from (45) and (47), the and can be set even without the knowledge of the signal power. The curve represents the performance of the energy detector, which is called the receiver operating curve (ROC), for a given pair of and representing the point in the ROC. We can plot another curve give an energy detector performance, for a given it’s convenient to display the with. In addition to using the ROC curve for performance comparison, one can also resort to the so-called deflection coefficient [12], especially when the statistical properties of the signal and noise are limited to moments up to a given order. The deflection coefficient is defined as


6. Generating Received Signal

The energy detection is used when the CR knows the signal of PU (deterministic) or their probabilities (random). It requires a good model of PU signal and noise is accurately known.

In the process of implementing an energy detector with DSP processor, often we are stymied by the problem of getting a received noisy signal with required amount of SNR i.e. under. To obtain an expression for receiving signals, the PU signal is modeled as being deterministic, by definition of SNR, the variance of signal is



Thus, All we have to do is to scale the signal appropriately, the received signal expressed as


Also PU signal can be modeled as being random, the received signal takes the form of a zero mean Gaussian process with known variance

Most methods for generating white Gaussian noise are based on transformations or operations on white uniform noise. There are several algorithms to generate white uniform noise which is generated by generating a pseudo random number. In this paper, we focus on a particular class of generators suitable for real-time applications. Making choices among generators requires specific criteria. We used two criteria to choose a good generator, are the length of the generation as well as the short implementation period to fit with the real-time environment.

The most widely used techniques for generating pseudo random number have approximately uniform distribution. Such generators, introduced by D. H. Lehmer in 1951, which is known as the linear congruential method [24]


m is the nonzero modulus.

a is a multiplier.

c is an additive constant, The case of is called a mixed-congruential generator while is referred to as a multiplicative-congruential generator.

is the starting value, or seed.

is the operator means that is the residue from dividing by m.

If and are integers, then this technique will produce a sequence of integers with each integer in the range 0≤xn

In [25], many versions of linear congruential generators set the constant c to zero. The resulting multiplicative congruential generator is


Park and Miller give suitable choices for and, this yields a full period generator. The Park Miller generator was implemented using David G. Carta’s optimization which needs only 32 bit integer math, and no division.

The last two algorithms generating white uniform noise zero mean and variance equal to 1/12.

In this implementation, we present white Gaussian noise generator based on the CLT (Sum-of-uniforms) method. Therefore, approximation of a white Gaussian noise with zero mean and unit variance, can be gained by realizing the sum of 12 uniform random variables.

7. Implementation of Energy Detector on TMS320C6713

A PU transmitter and SU receiver for CR is implemented on a C6713 DSP board. Figure 4 shows the equipment used in this paper.

From (45-47), the energy detector is strongly depending on knowledge of noise power. Thus, accurate estimation of noise power plays an important role in performance of energy detector. We proposed the auxiliary energy detector connected to primary energy detector, which can be used for the detection process of noise power, give an accurate detection as noise power changes.

Figure 4. The TMS320C6713 and the equipment.

We determined the DSP card cycle numbers of the two algorithms evaluation units to be 392 and 279 respectively, due to this constraint, we are able to fit the algorithm 2 into the signal used under. Figure 5 shows the time domain plot of white Gaussian noise signal with zero mean and unit variance.

Two scenarios for signal under can be implemented, in (51) isa (deterministic) sinusoid signal generated using eight points a table lookup method as in Figure 6, or is random, thus,

Figure 5. Time domain representation of Gaussian noise.

Figure 6. Time domain and FFT of 10 kHz signal at 5 dB SNR.

as as in Figure 7.

We use the following implementation parameters: the PU signal, , and assume. The C6713 development board we used has sampling frequencies 8, 16, 32, 44, 1, 48 and are supported, , we select, and

Since we set the, this is to say that we observe test statistic under hypothesis for 100 times to yield 99 realizations of detections in theory. We change SNR from –20 dB to 0, and repeat the 100 observations for each to calculate the number of detections. Figure 8 represents 100 observations at –11 dB, = 96 kHz it has gotten 4 detections.

Figure 9 plots the versus SNR. can be expressed as [26]


we take the Fsa at four different values 8, 16, 32 and 96 kHz and and its number of samples 80, 160, 320 and 960 respectively. From the figure it is observed that the detection performance improved by increasing SNR and with increase samples point i.e. sampling frequency.

To ensure that the is accurately estimated, we will compare the theoretical value and the implementation results. The is calculated using the following formula [26]


Figure 10 illustrates the values of which are calculated for different values of SNRs at = 96 kHz. As we know that the estimated value of is 0.01, the

Conflicts of Interest

The authors declare no conflicts of interest.


[1] I. F. Akyildiz, W.Y. Lee, M. C. Vuran, and S. Mohanty, “Next generationdynamic spectrum access/cognitive radio wireless networks: a survey,” Computer Networks J. (Elsevier), vol. 50,Sept. 2006, pp. 2127–2159. doi:10.1016/j.comnet.2006.05.001
[2] S. Haykin, “Cognitive radio: brain-empowered wireless communications,”IEEE J. Select. Areas Com., vol. 23, no. 2, Feb. 2005, pp. 201–220. doi:10.1109/JSAC.2004.839380
[3] D. Cabric, S. M. Mishra, D. Willkomm, R. W. Brodersen, and A. Wolisz,“A cognitive radio approach for usage of virtual unlicensed spectrum,” in Proc. 14th IST Mobile and Wireless Commun. Summit, June 2005.
[4] W. Zhang, R. Mallik and K.Letaief, “Optimization of cooperative spectrum sensing with energy detection in cognitive radio networks,” IEEE Trans. Wireless Commun., vol. 8, Dec. 2009, pp.5761-5766.
[5] H. P. Zhiquan, Shuguang Cui and A. Sayed, “Collaborative wideband sensing for cognitive radios,” IEEE Signal Processing Magazine, vol. 25, no. 6, Nov. 2008, pp. 60–73. doi:10.1109/MSP.2008.929296
[6] D. Cabric, S.M. Mishra and R.W. Brodersen, “Implementation Issues inSpectrum Sensing for Cognitive Radios,” in Proc. Asilomar Conf. on Signals,Syst., and Comput., Pacific Grove, Nov. 2004, pp.772-776.
[7] W. A. Gardner, A. Napolitano, and L. Paura, “Cyclostationarity: Half a century of research,” Signal Processing, vol. 86, no. 4, Apr. 2006, pp. 639–697. doi:10.1016/j.sigpro.2005.06.016
[8] DanijelaCabric, ShridharMubaraq Mishra, and Bobert W. Brodersen, “ImplementationIssues in Spectrum Sensing for Cognitive Radios,”Berkeley Wireless Research Center,University of California, BerkeleyNov. 2004.
[9] PrzemystawPawetczak, GeardJ.M.Janssen, and R.Venkatesha Prasad, “PerformanceMeasures ofDynamic Spectrum Access Networks,”IEEE Global Telecomm. Conf. SanFrancisco, California, USA, 2006.
[10] H. Urkowitz, “Energy detection of unknown deterministic signals,” Proceedings of the IEEE, vol. 55, no. 4, 1967, pp. 523–531. doi:10.1109/PROC.1967.5573
[11] L. L. Scharf, “Statistical Signal Processing: Detection, Estimation and Time Series Analysis,” Addison-Wesley, Reading, 1991.
[12] S. M. Kay, “Fundamentals of Statistical Signal Processing: Detection Theory,” NJ: Prentice-Hall, 1st edition, 1998.
[13] H. V. Poor, “An Introduction to Signal Detection and Estimation, Springer,” New York, 1994.
[14] F. F. Digham, M. S. Alouini, and M. K. Simon, “On the energy detection of unknown signals over fading channels,” Commun., vol. 5, May 2003, pp. 3575-3579.
[15] R. F. Mills and G. E. Prescon, “A comparison of various radiometer detection models,”IEEE Transactions on Aerospace and Electronic Systems, vol. 32, no. 1,Jan. 1996, pp. 467-473. doi:10.1109/7.481289
[16] S. Ciftci and M. Torlak, “A comparison of energy detectability models for spectrum sensing,”Proc. of IEEE GLOBECOM , 2008, pp. 1-5.
[17] J. J. Lehtomaki, “Analysis of energy based signal detection,” A Doctoral Dissertation, University of Oulu, 2005.
[18] V. I. Kostylev, “Energy detection of a signal with random amplitude,” in Proc. ICC 2002, New York, ,May 2002, pp. 1606-1610.
[19] Y. Chen, "Improved energy detector for random signals in Gaussian noise," IEEE Trans. Wireless Commun., vol. 9,Feb. 2010, pp. 558-563. doi:10.1109/TWC.2010.5403535
[20] Won-YeolLee , I. F. Akyildiz, “Optimal spectrum sensing framework for cognitive radio networks,” IEEE Trans. Wireless Commun., vol.7, Oct. 2008,pp. 3845-3857.
[21] J. G. Proakis, “Digital communications,” fourth ed., McGraw-Hill, 2001.
[22] I. S. Gradshteyn and I. M. Ryzhik, “Table of Integrals, Series, and Products,” 7th ed. San Diego, CA: Academic, 2007.
[23] J. J. Lehtomaki, “The Detection and Correlation Modeling of Rayleigh Distribution Radar Signal,” A Master Dissertation, Air Force Institute of Technology, University of Air, 1992.
[24] Press William H., Teukolsky Saul A., VetterlingWilliam T., Flannery Brian P.,“Numerical Recipes in C,” UK: Cambridge University Press, 2002.
[25] Carta D. ‘Two Fast Implementations of the Minimal Standard Random Number Generator’, Communications of the ACM, vol. 33, no. 1, 1990, pp. 87-88. doi:10.1145/76372.76379

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.