Tennessee Technological University. Cookville, TN 38505, USA. Email: {zchen42, nguo, rqiu}@tntech.edu. AbstractâSpectrum sensing detects the availability ...
Demonstration of Real-time Spectrum Sensing for Cognitive Radio Zhe Chen, Nan Guo, and Robert C. Qiu Department of Electrical and Computer Engineering Center for Manufacturing Research Tennessee Technological University Cookville, TN 38505, USA Email: {zchen42, nguo, rqiu}@tntech.edu Abstract— Spectrum sensing detects the availability of the radio frequency spectrum in a real-time fashion, which is essential and vital to cognitive radio. The requirement for real-time processing indeed poses challenges on implementing spectrum sensing algorithms. Trade-off between the complexity and the effectiveness of spectrum sensing algorithms should be taken into consideration. In this paper, a fast Fourier transform (FFT) based spectrum sensing algorithm called FAR is introduced. It is the beauty of the algorithm that the decision variable is insensitive to noise level. Parameter selection for the algorithm is considered as well, toward minimizing computational complexity. A small form factor (SFF) software defined radio (SDR) development platform (DP) is employed to implement a spectrum sensing receiver with FAR algorithm. Performance of FAR algorithm is evaluated on the SFF SDR DP, and real-time spectrum sensing is demonstrated. FAR algorithm is friendly to hardware implementation and it is effective to detect signals at low SNR.
I. I NTRODUCTION Cognitive radio (CR) has been put forward to make efficient use of scarce radio frequency spectrum. It introduces “intelligence” beyond software defined radio (SDR). Spectrum sensing is the cornerstone of CR, which detects the availability of the spectrum for secondary users in the CR network. The effectiveness of spectrum sensing largely determines the overall spectrum utilization. A good spectrum sensing algorithm should offer high probability of detection (PD ) at low probability of false alarm (PF A ) for a wide range of signalto-noise ratio (SNR). However, from a practice perspective, the algorithm has to be implementation friendly, including acceptable computational complexity. Less computation means less power assumption, which is especially meaningful for battery-powered devices. There have been some techniques for spectrum sensing, such as energy detection, matched filter detection, cyclostationary feature detection, covariance-based detection, and wavelet-based detection [1], [2]. In addition to tremendous effort on theoretical investigation, work on hardware implementation has been reported as well. To date, the most widelyused platforms are from the universal software radio peripheral (USRP) product family [3] together with the GNU Radio software [4]. In this work, however, a much more sophisticated platform called small form factor (SFF) software defined radio (SDR) development platform (DP) [5] is employed. A fast Fourier transform (FFT) based spectrum sensing algorithm is proposed and implemented using this platform. The proposed
algorithm is called FAR denoting FFT-averaging-ratio, and its performance has been measured on the SFF SDR DP. Moreover, a real-time demonstration of spectrum sensing with presence of both controllable primary users (PUs) and secondary user (SU) is reported in this paper. There has been some related work reported. In [6], covariance based spectrum sensing with maximum-minimum eigenvalue detection is proposed. The algorithm is implemented and evaluated on a hardware prototype called whitespace device (WSD). In [7], an experimental platform named Berkeley Emulation Engine 2 (BEE2) together with energy detection using FFT is introduced. In [8], spectrum sensing using power spectral density (PSD) on the USRP platform is reported. In [9], the SFF SDR DP and the spectrum sensing using FFT and cyclostationary feature detection are introduced. However, the authors report that it is very difficult to implement the spectrum sensing algorithm in real-time. Moreover, no detailed results of performance evaluation is given in this paper. The major contributions and features of this paper in contrast to prior work are listed as follows. Firstly, the platform employed in our research is real-time oriented compared to some of those reported. Secondly, the FFT-based spectrum sensing algorithm FAR is more implementation-friendly. To have a decision threshold insensitive to noise level, FAR uses ratio formed from one or more blocks of received signal samples as a decision variable. Thirdly, the relationships between the length of FFT, the length of averaging and the SNR are experimentally investigated. Fourthly, both PD and PF A of the spectrum sensing algorithm are measured on hardware platform. Finally, a real-time demonstration of spectrum sensing with controllable PUs is reported. The rest of this paper is organized as follows. Section II describes FAR, the proposed spectrum sensing algorithm. Implementation work based on the SFF SDR DP is introduced in section III. Section IV reports the performance evaluation and real-time demonstration results. Finally, section V concludes this paper. II. FFT-AVERAGING -R ATIO (FAR) A LGORITHM S PECTRUM S ENSING
FOR
Aiming at hardware friendliness and effective detection, a blind spectrum sensing algorithm is proposed.
Input
Segmentation Segmentation
Output
Windowing
Ratio Computation
Thresholding
Fig. 1.
Finally, thresholding is applied to r(k) for k = 0, 1, . . . , N2 , and the decisions on channel states are made according to the following rule:
PSD Computation
FFT
r(k)
Averaging
A. Algorithm Description Figure 1 depicts FAR algorithm, where the input is baseband discrete-time signal sampled at frequency fs , and the output is a series of vectors of two-class decisions that represent the availabilities of the channels in each time slot. The input signal is in real numbers since the phase information is not required here. Firstly, in each time slot, a block of base-band signal samples are segmented into T frames in the segmentation module. Denote t-th frame of the input samples by xt (n), n = 0, 1, . . . , N −1, t = 0, 1, . . . , T −1, where N is the number of samples in a frame. Then the segmented frames are multiplied with a window function to get desired spectral shape: xw,t (n) = xt (n)w(n) (1)
After that, FFT is applied to the windowed frame. Note that xw,t (n) are real numbers and the frequency spectrum of xw,t (n): Xt (k) =
N −1 X
xw,t (n)e−j2πkn/N (2)
is symmetric, thus for each frame only N2 + 1 tones of Xt (k), k = 0, 1, . . . , N2 , t = 0, 1, . . . , T − 1, are required (assume N is even). These tones are separated by fs /N Hz. The PSD computation module follows the FFT module. Define Pt (k), the PSD of xw,t (n), as: 2
Pt (k) = |Xt (k)| , k = 0, 1, . . . ,
Pavg (k) =
1 T
t=0
Pt (k), k = 0, 1, . . . , N2
(4)
where the factor T1 is not actually required. Let Pm be the mean of Pavg (k) calculated across all frequency tones: N
Pm
2 2 X = Pavg (k) N +2
(5)
k=0
where, again, the factor N2+2 can be dropped without affecting performance. In order to be robust to the background noise level, the decision variable r(k) is formed as a ratio: r(k) =
Pavg (k) Pm ,
Pavg (k) − α · Pm
k = 0, 1, . . . , N2
occupied > < available
0
(8)
Decision results of channel states from multi-tones can be combined to make a joint decision. For instance, if K is a frequency set of interest, a joint decision for frequency tones k ∈ K can be formed as: ( T occupied, if k∈K {r(k) ≥ α} T JointDecision = (9) available, if k∈K {r(k) < α} T where denotes AND operation. B. Discussions
It is preferred that the decision threshold is independent of noise level once a false alarm rate PF A is given. Let σnt (k) be the noise at the output of the FFT module, where σ is a constant and nt (k) is a zero-mean additive white Gaussian noise (AWGN) with unit power. In noise-only case, the frequency tone strength indicator Pavg (k) can be expressed as: TP −1 2 (10) |σnt (k)| , k = 0, 1, . . . , N2 Pavg (k) = T1 which is a central χ2 random variable with T degrees of freedom. Obviously, it is a function of noise strength. However, in the noise-only case the ratio r(k) becomes 1 T
r(k) =
(6)
TP −1
2
N
1 T
=
|σnt (k)|
t=0
1 (N/2+1)T
N 2,
t = 0, 1, . . . , T − 1 (3) The PSDs of T consecutive frames are used for averaging, yielding: TP −1
(7)
t=0
n=0
k = 0, 1, . . . , N − 1, t = 0, 1, . . . , T − 1
α
where α is preset thresholds. For every N · T samples, N 2 + 1 tones over a fs /2 Hz frequency band are scanned. Alternatively, the decision rule can be rewritten as:
Flow chart of FAR algorithm.
n = 0, 1, . . . , N − 1, t = 0, 1, . . . , T − 1
occupied > < available
−1 2 TP P
k=0 t=0 TP −1
2
|σnt (k)| 2
|nt (k)|
t=0
(11)
N
1 (N/2+1)T
−1 2 TP P
|nt (k)|
2
k=0 t=0
N 2 which is independent of noise level! The above noise ratio is even more attractive since it tends to be insensitive to the parameters N and T ! As a mater of fact, if T is sufficiently large, the ratio approaches to constant 1. Thus, the threshold α in FAR algorithm can be determined solely based on PF A , and it tends to be insensitive to N and T , especially when T is sufficiently large. Computer simulation can help validate the conclusion drawn above and help choose the threshold α. Consider a simulation k = 0, 1, . . . ,
−3
4
x 10
Sine signal + AWGN (SNR = −20 dB) AWGN
3.5
Number of multiplications for FFT Number of required samples Relationship between N and T
4
x 10 7
3
6 5
Probability
2.5
4 3
2
2 1.5
1 0 100
1
2500
0.5
2000
50
1500 1000
0
0
2
4
Fig. 2.
6 8 10 12 Ratio of PSDpeak to PSDaverage
14
16
The threshold of FAR algorithm.
Length of averaging (T)
Fig. 4.
0
500 0
Length of FFT (N)
Length of FFT and length of averaging (SNR = -20dB).
5
10
Length of FFT (when length of averaging = 1) Length of averaging (when length of FFT = 128)
stant. Both of the required lengths increase approximately exponentially as SNR goes down. Given the above PD and PF A , at a SNR of -20 dB, it would need an averaging of 96 128-point-FFT frames to detect the noise-polluted sinusoidal signal, while, without averaging, it would need an FFT of 3584 points.
4
10
3
Length
10
2
10
1
10
0
10 −25
Fig. 3.
−20
−15
−10 SNR (dB)
−5
0
Length of FFT and length of averaging varying with SNR.
example with N = 2048 and T = 16. In this simulation, a pure AWGN or a sinusoidal signal with SNR of -20 dB are input to FAR algorithm. Since FAR algorithm is a tone detector, single-tone signal with noise used here is sufficient to study the detection performance, but the SNR level in single-tone case may not be comparable to a real-world situation. The probability density functions (PDFs) of the ratio are shown in Figure 2, where the dash-dot line represents a decision threshold. As expected, the pure-noise PDF (left curve) does not change with noise level and SNR. Next, how to choose parameters N and T ? These two parameters affect the complexity of hardware implementation (for example, computation requirements and size of memory), frequency resolution, time slot size and delay. It is difficult to obtain a precise closed-form solution, so computer simulations are borrowed here. Consider a sinusoidal signal with noise, PF A = 0.1 and PD = 0.9. Figure 3 shows required lengths against SNR, where for each curve, one of the two lengths keeps con-
In terms of computation requirement, an N -point FFT takes N2 log2 (N ) complex multiplications and N log2 (N ) complex additions [10]. Since multiplications consumes more resources, only the required number of complex multiplications for FFT is evaluated here. Using the same sinusoidal with noise simulation, further results for SNR=-20 dB, PF A = 0.1 and PD = 0.9 are provided in Figure 4. In Figure 4, the curve on the X-Y plane shows the relationship between N (the length of FFT) and T (the length of averaging); for different pairs of N and T , the two 3-D curves represent the required number of complex multiplications for FFT and the required number of samples (i.e., time slot size N · T ), respectively. It can be observed that N (or T ) is roughly inversely proportional to T (or N ); or equivalently, the required time slot size N · T is close to a constant. The local minima of the required number of complex multiplications are achieved at (N, T )=(512,9), (1024,4), (1536,2) and (2048,2). Interestingly, the required number of samples are achieved at the same (N, T ) pairs. These pairs are important in design optimization and let us denote them by set A. On the other hand, N · T , the required number of samples, determines the delay for decision output. In addition, the frequency resolution fs /N can be another constraint in system design. In summary, to select the values of N , T , and α, frequency resolution and typical SNRs in the working environment should be known, and also minimal PD and maximal PF A are required. Then search to form the set A for the given PD and PF A , and choose a pair of N and T from A. Finally, α is decided upon the given PF A .
SFF SDR DP RF
ADC
RF module
Fig. 5.
FPGA1
Data conversion module
FPGA2
DSP
Digital processing module
AWG
Attenuator
A sketch map of SFF SDR DP receiver.
SA
Fig. 7.
Fig. 6.
Power divider
Functional setup for performance evaluation.
The SFF SDR DP and the equipment.
III. I MPLEMENTATION OF S PECTRUM S ENSING SDR DP
ON
SFF
A receiver with FAR spectrum sensing algorithm is implemented in the SFF SDR DP. Figure 5 shows the sketch map of SFF SDR DP receiver. Three functional modules, i.e., radio frequency (RF) module, data conversion module, and digital processing module, constitute the SFF SDR DP [11]. The nominal noise figure of the RF module is 5 dB. Three are two Xilinx Virtex-4 field-programmable gate arrays (FPGAs) and one Texas Instruments (TI) TMS320DM6446 digital signal processor (DSP) on the SFF SDR DP. FAR algorithm is implemented on the DSP. In this implementation, the parameters of FAR algorithm are set to N = 128 and T = 16. For a better resolution in frequency domain, the rectangular window is employed as the window function. Figure 6 shows the SFF SDR DP development environment and the equipment used for this paper in the Wireless Networking Systems Lab at Tennessee Technological University. The SFF SDR DP is in the center of the photo, on the left side of the laptop computer. And two family radio service (FRS) handsets are in front of the SFF SDR DP. In the experiments, an arbitrary waveform generator (AWG) (Tektronix AWG7122B), a digital phosphor oscilloscope (DPO) (Tektronix DPO72004), and a spectrum analyzer (SA) (Rohde&Schwarz FSEM20) are used for performance evaluation and real-time demonstration.
Fig. 8.
Measured frequency spectrum of the recorded FRS signal.
power divider. Figure 8 shows the frequency spectrum of the recorded FRS signals, where the resolution bandwidth (RBW) is set to 500 Hz, the unit for the Y-axis is dBm, and the center frequency is 462.6 MHz. The transmitted FRS signal strength can be adjusted. The maximum PSD of the received signal measured in 1-kHz resolution bandwidth on the SA is used as an indicator in this experiment. Consider an FRS transmitter emitting 1 Watt power 10 miles away from the receiver, then the maximum PSD of the received FRS signal is in the order of -80 dBm/kHz, assuming free space propagation.
A. Performance Evaluation
Using this setup, the receiver operating characteristic (ROC) of FAR algorithm implemented on the SFF SDR DP is measured, as shown in Figure 9. It can be observed that the implemented FAR algorithm works well when the received maximum PSD is -121 dBm/kHz or above, and it almost stops functioning as the maximum PSD goes below -126 dBm/kHz.
In order to precisely evaluate the performance of FAR algorithm using real-time signals generated by the PU, a setup with coaxial cable connection shown in Figure 7 is adopted. The FRS signal is measured and recorded using the DPO, and the recorded signals are then transmitted by the AWG to both the SFF SDR DP and the SA through attenuators and a
Performance of PD and PF A versus received maximum PSD is given in Fig. 10. One can see that with PF A close to zero, the FAR algorithm on the SFF SDR DP can achieve a high PD when the maximum PSD is -121 dBm/kHz or above, noting that typical PSD of the received FRS signal is higher than our detection limit.
IV. E XPERIMENT
AND
R EAL -T IME D EMONSTRATION
In the experiment, the FRS handsets serves as PUs, while the SFF SDR DP acts as an SU. A 2-tone joint detection (9) is employed in performance evaluation.
SFF SDR DP
1
FRS
0.9
Power divider
0.8 −121 dBm/kHz −124 dBm/kHz −126 dBm/kHz
0.7
P
D
0.6
DPO
FRS
0.5 0.4
Fig. 12.
Functional setup for real-time demonstration.
0.2 0.1 0
0
0.2
0.4
0.6
0.8
1
PFA
ROC curves.
1 0.9 0.8 0.7 Probability
0.05
0
−0.05
Sensed Channel State
Fig. 9.
Amplitude of Rx Signal(V)
0.3
5
10
15
20 Time (s)
25
30
35
40
0
5
10
15
20 Time (s)
25
30
35
40
1 0.8 0.6 0.4 0.2 0
0.6
0
PFA
0.5
PD
0.4
Fig. 13.
Received signals and sensed channel states.
0.3 0.2
B. Real-Time Demonstration
0.1 0
−128
Fig. 10.
−126
−124
−122 −120 −118 Power (dBm/kHz)
−116
−114
−112
Probability of detection and probability of false alarm.
Calling each other PU2 (FRS)
14 ft
14 ft PU1 (FRS)
7 ft
In the demonstration, two FRS handsets (PUs) call each other, and one SFF SDR DP running FAR algorithm senses the spectrum in real-time. The experiment is conducted in an indoor environment. As illustrated in Figure 11, the separation between the two FRS handsets is 14 feet, and the SFF SDR DP is 7 feet and 14 feet away from the two FRS handsets, respectively. To monitor the actually received signal, the DPO is used together with the SFF SDR DP, and they both interface the channel with the same antenna through a power divider, as shown in Figure 12. The DPO records the channel data while the SFF SDR DP performs spectrum sensing at the same time. Figure 13 shows the channel waveform recorded by the DPO and the sensed channel states output from the SFF SDR DP, where “1” and “0” indicate the channel is occupied and available, respectively. From the observation, the sensed channel states perfectly match the recorded channel waveforms. V. C ONCLUSION
SU1 (SFF SDR DP)
Fig. 11.
A layoff for real-time demonstration.
FAR algorithm for spectrum sensing has been proposed and selection for major parameters of FAR algorithm has been discussed. FAR algorithm is designed to compromise between the performance and implementation complexity. In particular, FAR algorithm has a constant threshold feature which is greatly in favor of blind sensing. Spectrum sensing receiver with FAR algorithm has been implemented on the SFF SDR DP and tested as well. Moreover, a real-time demonstration of
spectrum sensing has been conducted, and very encouraging experiment results have been obtained, suggesting that FAR algorithm is indeed effective. ACKNOWLEDGMENT This work is funded by National Science Foundation through grants (ECCS-0901420), (ECCS-0821658), and (ECCS-0622125). R EFERENCES [1] S. Haykin, D. Thomson, and J. Reed, “Spectrum sensing for cognitive radio,” Proceedings of the IEEE, vol. 97, no. 5, pp. 849–877, May 2009. [2] T. Yucek and H. Arslan, “A survey of spectrum sensing algorithms for cognitive radio applications,” IEEE Communications Surveys & Tutorials, vol. 11, no. 1, pp. 116–130, March 2009. [3] Ettus Research LLC. [Online]. Available: http://www.ettus.com/ [4] GNU Radio. [Online]. Available: http://www.gnuradio.org/ [5] Lyrtech Incorporated. [Online]. Available: http://www.lyrtech.com/ [6] S. Oh, T. Le, W. Zhang, S. Ahmed, Y. Zeng, and K. Kua, “TV white-space sensing prototype,” Wireless Communications and Mobile Computing, vol. 9, no. 11, pp. 1543 – 1551, December 2008. [7] A. Tkachenko, D. Cabric, and R. Brodersen, “Cognitive radio experiments using reconfigurable BEE2,” in Proc. Asilomar Conference on Signals, Systems, and Computers, October 2006, pp. 2041–2045. [8] O. Mian, R. Zhou, X. Li, S. Hong, and Z. Wu, “A software-defined radio based cognitive radio demonstration over FM band,” in Proc. International Conference on Wireless Communications and Mobile Computing, June 2009, pp. 495 – 499. [9] Y. Tachwali, M. Chmeiseh, F. Basma, and H. Refai, “A frequency agile implementation for IEEE 802.22 using software defined radio platform,” in Proc. IEEE Global Telecommunications Conference, November 2008, pp. 1–6. [10] J. Proakis and D. Manolakis, Digital signal processing: principles, algorithms, and applications, 4th ed. Prentice Hall, 2006. [11] Lyrtech Incorporated, “Small form factor SDR evaluation module/ development platform users guide,” February 2010. [Online]. Available: http://www.lyrtech.com/