SPECTRUM SENSING PERFORMANCE ANALYSIS A Degree's Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Javier Jiménez Gil In partial fulfilment of the requirements for the degree in TELECOMMUNICATION SYSTEMS ENGINEERING Advisor: Margarita Cabrera Bean Barcelona, June 2014
1 Abstract The ever-increasing demand for higher data rates in wireless communications in the face of limited or underutilized spectral resources has motivated the introduction of cognitive radio. The main idea of Cognitive Radio is to exploit underutilized spectral resources by reusing this spectrum in an opportunistic manner. Primary or licensed users are the owners of the licensed spectrum while the secondary or unlicensed users transmit and receive signals only when they detect that the primary users are inactive. By means of Spectrum Sensing the secondary users must decide if the licensed users are inactive or not, in order to know if they can use the spectrum. For this reason it is so important to develop and improve effective methods of Spectrum Sensing, because if the secondary users are detecting that the primary ones are inactive but really they are not, the communications of the unlicensed users could interfere with the communications of the licensed one, and it is crucial to avoid this situations. Also another undesirable situation (but not as crucial as the one above) could be that the secondary users are detecting that the primary users are active but really they are not, thus the secondary users will be wasting the unused spectrum. In order to evaluate the quality of the different methods of Spectrum Sensing, in this degree thesis different methods are applied over OFDM signals in order to compute the analytical and simulated ROC curves of each method and to compare them.
2 Resum La creixent demanda de velocitats de transmissió cada cop més elevades, en presencia de recursos espectrals limitats o infrautilitzats, ha motivat l’introducció de ràdios cognitives. La idea principal de la Ràdio Cognitiva consisteix en explotar els recursos espectrals infrautilitzats mitjançant la reutilització oportunista d’aquests. Els usuaris primaris o usuaris amb llicència son els propietaris de l’espectre mentre que els usuaris secundaris o usuaris sense llicència només poden transmetre o rebre senyals quan detecten que els usuaris primaris es troben inactius y l’espectre està lliure. Mitjançant el censat o detecció de l’espectre (Spectrum Sensing) els usuaris secundaris han de decidir si els usuaris amb llicència es troben o no inactius, per tal de saber si poden utilitzar o no l’espectre. Per tot això es tan important el desenvolupament i millora de mètodes de censat de l’espectre efectius, perquè si per exemple els usuaris secundaris detectessin que els usuaris amb llicència es troben inactius quan en realitat no, les seves respectives senyals es podrien interferir, i es molt important evitar aquests tipus de situacions. També es podria donar el cas oposat (encara que no es tan important com el cas anterior) de que els usuaris secundaris detectessin que l’usuari principal es troba actiu quan en realitat no, llavors els usuaris secundaris estarien desaprofitant l’espectre lliure. Per portar a terme l’anàlisi de la qualitat dels diferents mètodes de censat de l’espectre, es calcularan i compararan les corbes ROC analítiques i simulades de cada mètode, aplicant els mateixos sobre senyals OFDM.
3 Resumen La creciente demanda de velocidades de transmisión más elevadas, en presencia de los recursos espectrales limitados o infrautilizados, ha motivado la introducción de radios cognitivas. La idea principal de la Radio Cognitiva consiste en explotar los recursos espectrales infrautilizados mediante la reutilización oportunista de estos. Los usuarios primarios o usuarios con licencia son los propietarios del espectro mientras que los usuarios secundarios o usuarios sin licencia solo pueden recibir o transmitir señales cuando detectan que los usuarios primarios están inactivos y el espectro está libre. Mediante el censado o detección del espectro (Spectrum Sensing) los usuarios secundarios han de decidir si los usuarios con licencia se encuentran inactivos o no, para saber si pueden o no utilizar el espectro. Por todo esto es tan importante el desarrollo y mejora de métodos de censado del espectro efectivos, porque si los usuarios secundarios detectasen que los usuarios con licencia están inactivos cuando en realidad no lo están, sus respectivas señales podrían interferirse, y es crucial evitar este tipo de situaciones. También se podría dar el caso contrario (aunque no es tan importante como el caso anterior) de que los usuarios secundarios detectasen que el usuario principal está activo cuando realmente no lo está y en consecuencia estarían desperdiciando el espectro libre. Para llevar a cabo el análisis de la calidad de los diferentes métodos de censado del espectro, se calcularán y compararán las curvas ROC analíticas y simuladas de cada método, aplicando estos sobre señales OFDM.
4 Acknowledgements The project is carried out at the TSC department (Theory of Signal and Communications) of the UPC, but all the supervision and advice have been given by the work supervisor: Margarita Cabrera. Also the main initial ideas of the project and some of the methods have been provided by her, so I would like to thank her and the University for the help and the opportunity to work in this project.
5 Revision history and approval record Revision Date Purpose 0 27/06/2014 Document creation 1 09/07/2014 Document revision DOCUMENT DISTRIBUTION LIST Name e-mail Javier Jiménez Gil
[email protected] Margarita Cabrera Bean
[email protected] Written by: Reviewed and approved by: Date 27/06/2014 Date 09/07/2014 Name Javier Jiménez Gil Name Margarita Cabrera Bean Position Project Author Position Project Supervisor
6 Table of contents Abstract ................................................................................................................................. 1 Resum .................................................................................................................................. 2 Resumen .............................................................................................................................. 3 Acknowledgements .............................................................................................................. 4 Revision history and approval record................................................................................... 5 Table of contents .................................................................................................................. 6 List of Figures ....................................................................................................................... 7 List of Tables ........................................................................................................................ 8 1. Introduction .................................................................................................................... 9 2. Background ................................................................................................................. 11 2.1. Basics on Spectrum Sensing and problem formulation ...................................... 11 2.2. Orthogonal Frequency Division Multiplexing (OFDM) ........................................ 12 3. Project development and results ................................................................................ 14 3.1. OFDM signal generation ...................................................................................... 14 3.2. Basic methods ..................................................................................................... 16 3.3. Methods based on the cyclic prefix (CP) of the signal ........................................ 22 3.4. Methods based on the pilot of the signal ............................................................. 27 3.5. Methods based on the combination of cyclic prefix and pilot ............................. 31 3.6. Methods comparison ........................................................................................... 33 3.7. Introducing realistic conditions ............................................................................ 34 4. Budget ......................................................................................................................... 40 5. Conclusions and future development ......................................................................... 41 Bibliography ........................................................................................................................ 43 Glossary .............................................................................................................................. 44
7 List of Figures Figure 1: Project breakdown structure with the different tasks and subtasks. 10 Figure 2: Channel model and the Spectrum Sensing hypothesis. 11 Figure 3: Comparison between a conventional multicarrier modulation and an OFDM modulation. 12 Figure 4: Frame structure in DVB-T signals. 13 Figure 5: Example of the power PDF of an OFDM signal with pilot tones. 14 Figure 6: Model for the N samples of the received OFDM signal. 14 Figure 7: Example of received data samples for different τ, for Nc = 2, Nd = 4 and K = 2. 16 Figure 8: ROC Matched Filter Plot. 17 Figure 9: ROC Matched Filter with unknown h Plot. 18 Figure 10: ROC CFAR matched subspace detector Plot. 19 Figure 11: ROC Energy Detector Plot. 20 Figure 12: ROC Neyman-Pearson Plot. 24 Figure 13: ROC CP based MS Plot. 26 Figure 14: ROC Pilot based MF using the maximum Plot. 29 Figure 15: ROC Combined CP & Pilot based MS Plot. 32 Figure 16: ROC MF, MF with unknown h, CFAR and ED Plot. 33 Figure 17: ROC CP based, Pilot based and Pilot & CP combined in the unsynchronized case Plot. 34 Figure 18: MF with noise power error Plot. 35 Figure 19: CP based with noise power error Plot. 35 Figure 20: MF with time-variable channel Plot. 36 Figure 21: CP based with time-variable channel Plot. 37 Figure 22: MF with frequency selective channel Plot. 38 Figure 23: CP based with frequency selective channel Plot. 38 Figure 24: Right CP based with frequency error Plot. Left MF with frequency error Plot. 39
8 List of Tables Table 1: Basic methods comparison table for 64 IIFT points and different SNRs. 21 Table 2: Basic methods comparison table for 256 IIFT points and different SNRs. 22 Table 3: Improvement of the detection probability in the unsynchronized case when the CP increases at SNR = -10 dB and IFFT points = 64. 26 Table 4: Methods based in the cyclic prefix comparison table for SNR = -5, -10 and -15 dB, PFA = 0.05 and IFFT points = 64. 27 Table 5: Improvement of the detection probability in the unsynchronized case when the pilot percentage increases at SNR = -10 dB and IFFT points = 64. 30 Table 6: Methods based in the cyclic prefix comparison table for SNR = -5, -10 and -15 dB, PFA = 0.05 and IFFT points = 64. 30 Table 7: Improvement of the detection probability in the unsynchronized case when the pilot and CP percentages increase at SNR = -10 dB and IFFT points = 64. 32 Table 8: Method based in the cyclic prefix and the pilot tones comparison table for SNR = -5, -10 and -15 dB and IFFT points = 64. 33 Table 9: Comparison table of the degradation of the algorithms for different frequency errors. 39
15 In [2] a detailed description of the OFDM signal generation is presented by means of a vector-matrix model. The number of samples of the CP (Nc) and the number of pilots, can be fixed before creating the signal. The maximum number of samples of the CP would be the number of samples of the OFDM symbol (Nc ≤ Nd). But a main problem in Spectrum Sensing is that in practice one cannot know exactly when to start the detection. That is, the secondary user receiver is not synchronized to the transmitted signal that has to be detected. Let be the synchronization mismatch, in other words the time when the first sample is observed. That is, = 0 corresponds to perfect synchronization. We assume that the transmitted signal consists of an infinite sequence of OFDM symbols, so that detection can equivalently start within any symbol. Then, it is only useful to consider synchronization mismatches within one OFDM symbol, that is in the interval 0 ≤ < Nc+Nd. In a perfectly synchronized case ( = 0) we would observe a number (K) of complete OFDM symbols, in order to fully exploit the structure of the signal. Without loss of generality, we assume that the total number of samples in the vector x is N = K(Nc +Nd). This implies that x will in general (when > 0) contain samples from K+1 OFDM symbols, as shown in Figure 2. In order to include this problem into our signal model, the OFDM symbols have to be multiplied by a synchronization matrix. Let qi be the ith OFDM symbol (the output of the IFFT operation) of length Nd. An OFDM symbol si is then obtained by repeating the last Nc elements of qi at the beginning of the symbol. This operation can be written in matrix form as: ii s Uq (6) Where: Nc Nd Nc Nc Nd 0I UI (7) Here 0n×m denotes the n×m all-zero matrix, and In denotes the n × n identity matrix. In a perfectly synchronized scenario ( = 0) we only need to consider samples from OFDM symbols 1, . . .,K. In all other cases (τ = 1, . . .,Nc + Nd − 1), the received signal x will contain samples from symbols 2, . . .,K and from parts of symbols 1 and K+1. Thus, we let the generated data q consist of K+1 data blocks, although x only consists of K(Nc+Nd) samples. That is, we let q = [q1T q2T. . . qK+1T]T be a vector of length (K+1)Nd, consisting of the data that correspond to K + 1 OFDM symbols. Furthermore, let T be the following block-diagonal matrix, where the “diagonal” consists of K+1 instances of the matrix U: ( 1)( ) ( 1)K Nc Nd K Nd U 0 0 0 U 0 T 0 0 U (8) Finally, the received signal s can be written as: s Tq (9) Where Tτ is the K(Nc + Nd) × (K + 1)Nd matrix obtained by deleting the first rows and the last Nc +Nd − rows of T. The results of these operations for different values of the synchronization can be seen in the next figure:
16 Figure 7. Example of received data samples for different τ, for Nc = 2, Nd = 4 and K = 2. Obtained from [2]. The energy of the generated signal s is defined: H s EE ss (10) In the simulations the QAM symbol sequence has been generated of unitary energy, so usually s EN . In this section the structure of the generated OFDM signal has been presented. Next sections are dedicated to explain and apply the different Spectrum Sensing methods and algorithms working with this signal. 3.2. Basic methods The basic methods consist in four different strategies which do not take advantage of the structure of the OFDM signal (CP and pilot), so these algorithms could be also applied in other type of signals. These methods are the most idealistic ones because in all of them (except the Energy Detector) the secondary user makes the assumption that the complete signal s is perfectly known. The noise power σw2 is also assumed to be known. a. Matched Filter: The Matched Filter (MF) is a classical method in which the noise power and the signal of the primary user s are assumed to be known. Furthermore, no channel attenuation or rotation is present on the transmission path; this is 1h . The primary user signal detection problem can be raised as the following test of hypothesis: 2 0 2 1 : : 0, : : , w w C C yI y s I (11) This is a very common hypothesis testing problem of uncommon means and common covariances [6]. After some algebra, the real valued log-likelihood ratio may be expressed as the following statistic test:
17 2 H 21 2 Re w t y s y s (12) The statistical test is distributed as a real Gaussian random variable. If the Signal to Noise Ratio is defined as: 2 s w Ed N N SNR (13) Then, the statistical test distribution can be formulated as: 0 1 : ,2 : ,2 t d d t d d y y (14) Finally, for a given threshold , the analytical error probabilities depend on the SNR through defined parameter d and the number of processed samples N (the description of the Q-function can be found in the annex 1): 2 2 , , d FA d d MD d P d N Q P d N Q (15) Figure 8 shows the results obtained applying the MF over an OFDM signal using different Signal to Noise Ratios and different number of IFFT-points. The percentages of pilot and CP are irrelevant because this method does not exploit these characteristics of the OFDM signal: Figure 8. ROC Matched Filter Plot. Signal modulated in QPSK. Left IFFT points=64 (N=64). Right IFFT points=256 (N=256). Red lines represent analytical ROC characteristics and blue lines are obtained by simulation. Each graphic has been computed using num. frames=1 and SNR=-20, -15 and -10 dB. b. Matched Filter with unknown channel coefficient: In this subsection the same method that in the previous one is applied but introducing a realistic condition: the coefficient of the channel (h) is unknown. The coefficient h is 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: Matched Filter False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 ROC: Matched Filter False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical
18 modelled as a complex scalar value obtained randomly. As the channel is constant, it can be considered invariable in time. Now the alternative 1: 0h is tested versus the null hypothesis 0: 0h . This is a particular case of the matched subspace detector described in [6], but taking into account that the signal subspace is given by the one-dimensional vector s, it can be named matched filter instead of matched subspace. Given that 0h if and only if 20hd , the measurement may be normalized with the unitary signal vector 1 s Es , and the resulting statistical test is: 2 2 2 HH 22 H 1 ww s s E E t s s y y Py y s P ss (16) Doing some algebra, the statistical test distributions are obtained: 2 02 2 2 12 :0 2 t t h d y y (17) They result Chi-square distributions (see annex 2 for major explanation on this distributions) with 2 degrees of freedom and in the case of 1 , a non-centrality parameter of 22h d . Finally, from the PDF distributions, the analytical error probabilities can be computed. The error probabilities depend on the SNR through the defined parameter d, which was described above: 2 0 2 1 2 11 1 1 , 1 ( ) 1 ,2 1 ,2 , 2) ,( FA M chi chi D T hd T PF P d F Q Q h d CC (18) Figure 10 shows the results obtained applying the MF with unknown channel coefficient over an OFDM signal using different Signal to Noise Ratios and different number of samples Nd. The percentages of pilot and CP are irrelevant because this method does not exploit these characteristics of the OFDM signal: 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: MF with unknown channel coefficient h False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: MF with unknown channel coefficient h False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical
19 Figure 9. ROC Matched Filter with unknown h Plot. Signal modulated in QPSK. Left IFFT points=64 (N=64). Right IFFT points=256 (N=256). Red lines represent analytical ROC characteristics and blue lines are obtained by simulation. Each graphic has been computed using num. frames=1 and SNR=-20, -15 and -10 dB. |h|=1 for the analytical curves. c. CFAR matched subspace detector: In this method it is assumed that the only parameter that is known by the secondary user is the signal s. Neither the coefficient of the channel h nor the noise power σw2 are known by the secondary user, so the algorithm has to incorporate an estimator of the noise power: 2 H H 2 HHH s tE s s ys y Py yy I P y y y y s (19) This statistical test normalizes the energy resolved in the subspace 1 s Es with an estimation of the noise power. Since ty is the ratio of two independent Chi-squared random variables, it becomes with a constant of a Snedecor's F distribution (see annex 3): 0 2,2 2 2 1 2,2 2 :0 :2 N N tF t F h d y y (20) The results are shown in the figure 11 and as it can be seen the sensing accuracy and the quality of this method is a bit worse than in the previous cases, due to the ignorance of both the noise power and the channel coefficient. Figure 10. ROC CFAR matched subspace detector Plot. Signal modulated in QPSK. Left IFFT points=64 (N=64). Right IFFT points=256 (N=256). Red lines represent analytical ROC characteristics and blue lines are obtained by simulation. Each graphic has been computed using num. frames=1 and SNR=-20, -15 and -10 dB. |h|=1 for the analytical curves. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: CFAR False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 ROC: CFAR False Alarm Probability Miss Detection Probability ROC Simulated ROC Analytical
20 d. Energy Detector: The Energy Detector (ED) is a test that is usually used when, unlike the subsections above, the signal s is unknown. The only parameter that is assumed to be known is the noise power σw2. The detection problem can be solved as a common mean and uncommon covariances measurements case. This means that the signal can be modeled as zero-mean noise: 2 0 22 1 :, :, s w E w N C Ch y 0 I y 0 I (21) Applying the log-likelihood ratio (1) and simplifying it the ED test is obtained: 2 H 1 w t y y y (22) Finally a central Chi-squared distribution is obtained for both hypotheses, and with a given threshold , the error probabilities depend on the SNR through defined parameter d and the number of processed samples N: 2 00 2 11 , ( ) 1 ,2 , ( ) 2, , 1chi T chi T FA MD CNP N F P d N F CN 2 0 2 2 1 1 2 || 2 d h N N (23) Figure 12 shows the results obtained applying the ED, as it can be seen the quality of this algorithm is quite worse than the previous ones. This is because the secondary user does not know the signal: Figure 11. ROC Energy Detector Plot. Signal modulated in QPSK. Left IFFT points=64 (N=64). Right IFFT points=256 (N=256). Red lines represent analytical ROC characteristics and blue lines are obtained by simulation. Each graphic has been computed using num. frames=1 and SNR=-20, -15 and -10 dB. |h|=1 for the analytical curves. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: Energy Detector False Alarm Probability Miss Detection Probability ROC Simmulated ROC Analytical 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1ROC: Energy Detector False Alarm Probability Miss Detection Probability ROC Simmulated ROC Analytical
21 The proposed model in (21) fulfils better for low SNR scenarios. If we assume that the primary user signal is not correctly modeled as a zero mean Gaussian process the distribution when the alternative hypothesis is in force could be expressed as: 2 1:, w C y s I (24) Now the miss detection probability can be computed as: 22 ( , , ) 1 , 1 2 , 2 d MD N N P d N Q h Q d h (25) This last model has not been simulated because the previous one was considered better, especially in low SNR scenarios. e. Basic methods comparison: In order to see the differences of sensing accuracy between the different basic methods, the next tables show the detection probabilities of each method for a fixed value of false-alarm probability (0.05 is a standard accepted value of false-alarm probability). SNR (dB) Method PFA PD (analytical) PD (simulated) -20 MF 0.05 0.352 0.3523 MF unknown h 0.05 0.1875 0.1843 CFAR 0.05 0.1848 0.1799 ED 0.05 0.0605 0.0608 -15 MF 0.05 0.7276 0.7281 MF unknown h 0.05 0.5082 0.5005 CFAR 0.05 0.5008 0.4936 ED 0.05 0.0883 0.0867 -10 MF 0.05 0.990714 0.99027 MF unknown h 0.05 0.95681 0.95403 CFAR 0.05 0.95312 0.94578 ED 0.05 0.2251 0.2251 Table 1. Basic methods comparison table for 64 IFFT points and different SNRs (N=64). . In this project has been considered that the algorithms are reliable when they present a 0.95 D P , and when they present a D P below this threshold they can be considered useless. Therefore, the detection probabilities which pass this threshold have been marked in yellow colour in table 1 and 2.
22 SNR (dB) Method PFA PD (analytical) PD (simulated) -20 MF 0.05 0.8126 0.8218 MF unknown h 0.05 0.6141 0.6033 CFAR 0.05 0.6117 0.6078 ED 0.05 0.0719 0.0705 -15 MF 0.05 0.997826 0.9981 MF unknown h 0.05 0.98596 0.9856 CFAR 0.05 0.98575 0.9843 ED 0.05 0.1416 0.1401 -10 MF 0.05 0.9999999 1 MF unknown h 0.05 0.9999999 1 CFAR 0.05 0.9999999 1 ED 0.05 0.5337 0.5327 Table 2. Basic methods comparison table for 256 IFFT points and different SNRs (N=256). In tables 1 and 2 can be checked that as higher is the number of samples in the signal vector s, better is the performance of the algorithms. The MF and CFAR methods work very well, even at low SNR scenarios (with SNR = -15 dB, in the case of N = 256, the MF, MF with unknown channel coefficient and the CFAR methods maintain a PD over 0.9). However, the Energy Detector requires a higher number of samples in the signal vector (much more than 256) or a better SNR. In the best case shown in the table 2 for the ED, with a relatively high SNR of -10 dB, the PD is only 0.5327. 3.3. Methods based on the cyclic prefix (CP) of the signal The methods in this section were developed to take advantage of one part of the structure of the OFDM signals: the cyclic prefix. So in this case the secondary user should know the number of samples of the OFDM symbols and also the quantity of CP samples (Nd and Nc), but the problem of the synchronization ( ), which was explained in the section 3.1, continues existing. Also the noise power 2 w and signal power 2 s have to be known (or estimated). In any case the coefficient of the channel h is known. This section can be divided in two parts: the optimal Neyman-Pearson detector and the pilot based matched subspace. Both the synchronized case (known ) and the unsynchronized one (unknown ) are described in the two parts. a. Optimal Neyman-Pearson detector: This algorithm was obtained from [2]. - Unsynchronized case: The optimal Neyman-Pearson test is the log-likelihood ratio test in(1): 0 1 | log | opt p tp y yy (26)
23 As in all the previous cases, under the hypothesis 0 only the Gaussian noise is considered: 2 0:, w C y 0 I 2 2 02 1 || || exp NN ww p y y (27) Under the hypothesis 1 the received vector contains an OFDM signal plus noise, and the first sample is received at time . When is unknown by the secondary user, we model it as a random variable, and obtain the marginal distribution: 1, ,C y 0 Q 1 1 1 1 0 | | , cd NN p P p yy (28) Taking into account that 22H ws Q I TT and modelling 1 |P like uniformly distributed between [0, Nc + Nd - 1], the optimal NP test results: 11 0 2 22 1exp det log 1 || || exp cd NN H N cd opt NN ww NN t y Q y Q yy (29) And applying some algebra, a simplified expression is found: 12 1 2 0 11 log exp log det cd NN N Hw opt w c d tNN y y Q I y Q (30) As it can be seen, the optimal test is a weighted average of all possible synchronization cases (0 ≤ ≤ Nc + Nd - 1). There appears to be no closed-form expression for the distribution of this test statistic, so the analytical expressions cannot be calculated, only can be tested empirically. - Synchronized case: For the synchronized case, the value of is known (this does not mean that = 0), so 1 |P has not to be modelled as a uniformly distributed variable. Applying this, the synchronized statistical test is: 21 2 1 log det NH w synch w t y y Q I y Q (31) - Results: In figure 13 (left) the obtained results for the optimal NP test using different cyclic prefixes are presented, in order the check the improvement of the algorithm when the CP percentage increases. When there is no CP (CP=0%), the optimal NP detector behaves as the Energy Detector in subsection 3.2.d. Figure 13 (right) shows the comparison between the synchronized case and the unsynchronized one for different SNR scenarios:
24 Figure 12. ROC Neyman-Pearson Plot. Signal modulated in QPSK. Left num. frames = 1, IFFT points = 64, SNR = -10 dB and CP = 0, 0.25, 0.5, 0.75,1 (N = 64, 80, 96, 112 and 128). Right num frames = 1, IFFT points = 64, SNR = -10, -5, 0 dB and CP = 0.25 (N=80). b. CP based matched subspace: The algorithm described in this subsection is equivalent to the previous one synchronized. From the test given in (30) a matched subspace detector can be derived. It is assumed that the secondary user perfectly knows the noise power 2 w , the length of the data sequence in each OFDM symbol Nd, the length of the CP Nc (Nc ≤ Nd), and the synchronization parameter is only known the OFDM signal detector is developed assuming that the PU signal lies in a signal subspace produced by the repetition of data in the Cyclic Prefix (CP). The signal vector can be described using the following matrix structure: p s Tq V Λ I q (32) Where the matrix T contains cd N K N N rows and d KN columns. In (32) the svd factorization of matrix T is used. The left-singular vectors matrix V is directly computed from matrix T column by column with the difference that columns containing two nonzero elements are normalized by its norm 2 and the rightsingular vectors matrix results equal to identity matrix of dimension p , where rankp T . - Synchronized case: The alternative 1: 0h is tested versus the null hypothesis 0: 0h , and following the model in [6] the statistical test obtained is: 22 2 HH 22 H ww t s s y y P y y V P V V (33) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Neyman-Pearson detector comparison for different CP CP=0% CP=25% CP=50% CP=75% CP=100% 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability NP comparison of synch/unsynch Synchronized Unsynchronized
31 3.5. Methods based on the combination of cyclic prefix and pilot In this section, the methods which take advantage of the CP and the methods which take advantage of the pilot of the signal are combined in order to improve the sensing accuracy in the detection of the primary user signal. As in sections above, it can be differentiated between the synchronized case and the unsynchronized one. - Synchronized case: Combining the signal structures defined in (32) and in (38), the received signal can be modelled as: 1 1 0 11 : : 1 p d d p d p p pp rr pp h svd H H I V V s y s w yw q s s s T q s T s T s V v ΛI v I V V s (45) As it can be seen, the matched signal subspace applied in this case is the combination of the CP subspace (section 3.2.b) and the pilot subspace (section 3.3). The augmented matrix p Vv is a svd decomposition of the signal subspace generated by matrix p Ts . The resulting statistical test is: 2 H H 2 wpp t y y V v V v y (46) Which follows a chi-square distribution under both hypothesis 1 and 0 : 2 0 2 2 2 2 1 2 2 :0 p p t t h d y y (47) With 2 2 H 2 wp d Vv s From these distributions, the analytical error probabilities can be obtained: 2 0 2 111 ( ) 1 ,2 2 1 ,2 2 ,( ,) 1 1 1 , FA M chi chi p T d T D h p P C p CF P d F Q h p Qd (48) - Unsynchronized case: As in the previous unsynchronized cases, the suboptimal maximum algorithm is applied for all the possible values of : 2 H H 2 max wpp t y y V v V v y (49)
32 - Results: Figure 18 (left) shows the obtained results for the combined CP and Pilot based test using different cyclic prefixes and pilot percentages, in order the check the improvement of the algorithm when they increase. Figure 18 (right) shows the comparison between the synchronized case, the unsynchronized one and the analytical curves for different SNR scenarios: Figure 15. ROC Combined CP & Pilot based MS Plot. Signal modulated in QPSK. Left num frames = 1, IFFT points = 64, SNR = -10 dB, CP = 0, 0.25, 0.5, 0.75, 1 and Pilot = 0.1, 0.25, 0.4, 0.5, 0.6 (total num. samples = 64, 80, 96, 112 and 128). Right num frames = 1, IFFT points = 64, SNR = -10, -5, 0 dB, Pilot = 0.25 and CP = 0.25 (total num. samples = 80). |h| = 1 for the analytical curves. As it can be seen, there is not as improvement as expected when using the combination of CP and pilot tones, only a little bit comparing when only the CP is used. In the next tables can be seen some data taken from the figures: CP & Pilot combined method CP percentage (%) Pilot carriers percentage (%) PFA PD 0 10 0.05 0.2028 25 25 0.05 0.2275 50 40 0.05 0.2615 75 50 0.05 0.3092 100 60 0.05 0.3 Table 7. Improvement of the detection probability in the unsynchronized case when the pilot and CP percentages increase at SNR = -10 dB and IFFT points = 64 (N = 64, 80, 96, 112 and 128). 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Combined CP & Pilot for different pilot percentages and CP Pilot=10% CP=0% Pilot=25% CP=25% Pilot=40% CP=50% Pilot=50% CP=75% Pilot=60% CP=100% 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Combined CP & Pilot based MS comparison of synch/unsynch Synchronized Analytical Unsynchronized
33 SNR (dB) Combined Pilot & CP PFA PD (analytical) PD (simulated) 0 Synchronized 0.05 0.99999 1 Unsynchronized 0.05 - 1 -5 Synchronized 0.05 0.92554 0.9072 Unsynchronized 0.05 - 0.8369 -10 Synchronized 0.05 0.2815 0.2706 Unsynchronized 0.05 - 0.2299 Table 8. Method based in the cyclic prefix and the pilot tones comparison table for SNR = 0, -5 and -10 dB, CP = 0.25, Pilot percentage = 0.25 and IFFT points = 64 (N = 80). In table 8 it can be seen that this method present better results that the other ones, even in the SNR scenario of -5 dB the detection probabilities are quite good ( 0.9 D P ). However, the disadvantage is that both the pilot structure and the Cyclic prefix of the OFDM signal s have to be completely known by the secondary user, and this is not always possible. 3.6. Methods comparison In this section different comparisons between all the algorithms tested before in different conditions are shown. First, a comparison between all the basic methods, although it is already known that the Matched Filter is the one which has the best sensing accuracy (also it is the most unrealistic one): Figure 16. ROC MF, MF with unknown h, CFAR and ED Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64 and SNR = -10 dB (N = 64). Left analytical curves with |h| = 1 and right simulated curves. The methods based in a full knowledge of the signal s (MF, MF with unknown h and CFAR) have very high detection probabilities, while the ED which is the opposite case (no knowledge about the transmitted signal, only about the noise power) needs high SNR to achieve acceptable detection probabilities. 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 False Alarm Probability Miss Detection Probability Basic methods analytical comparison MF MF unknown h CFAR ED 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 False Alarm Probability Miss Detection Probability Basic methods simulated comparison MF MF unknown h CFAR ED
34 A comparison between the different intermediate methods, with partial knowledge of some characteristics of the OFDM signal (CP, pilot or both), is presented in figure 17: Figure 17. ROC CP based, Pilot based and Pilot & CP combined in the unsynchronized case Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, CP = 0.25 and Pilot = 0.25 (N = 80). Left SNR = -5 dB and right SNR = -10 dB. In the unsynchronized case the worst method results the pilot based one, which is even worse than the ED, and the best is, as it was expected, the combination of CP and pilot, but the improvement respect the CP based method remains moderately low. 3.7. Introducing realistic conditions Along this entire project, some unrealistic assumptions have been done in the development of the different algorithms and methods, that is why this section is dedicated to introduce realistic conditions. The realistic conditions have been tested for the MF algorithm, because is one of the most idealistic methods and it is easy to observe the degradation when the different realistic conditions are introduced, and also in the CP based matched subspace method, in order to see what happens when the real conditions are introduced in a non-idealistic method. In order to not isolate the study of the effect produced on the algorithm performance by each realistic condition, no more of one realistic effect has been introduced at the same time. The main realistic conditions that can be introduced are the following: a) Ignorance of the noise power σw2. b) Time-variant channel. c) Frequency-variant channel. d) Frequency error in the subcarriers. One subsection has been dedicated to each one of these realistic effects: 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Intermediate methods comparison: unsynchronized case CP based Pilot based CP & Pilot Combined 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Intermediate methods comparison: unsynchronized case CP based Pilot based CP & Pilot Combined
35 a. Ignorance of the noise power: The noise power 2 w is assumed to be known in all the methods developed previously, except in the CFAR, which estimates it. In a real situation, the noise power is difficult to be exactly known, and usually it has to be estimated. Since the estimators have bias and deviation, sometimes the estimated noise power 2 w includes a little error in respect to the real noise power 2 w . In order to model this effect, the ROC curves can be simulated using a noise power with a little error ( 2 w ∓5%). Figure 18. MF with noise power error Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64 and SNR = -10 dB (N = 64). Right graphic is a zoomed version of the left one. Figure 19. CP based MS with noise power error Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, CP = 25% and SNR = -10 dB (N = 80). Right graphic is a zoomed version of the left one. As it can be seen in figures 18 and 19, for low estimation errors in the noise power 2 w , the effect of this error is negligible because the variation of PD is almost unperceivable. For example, with an error of 20% (which is a high estimation error), the maximum variations of PD (fixing the PFA to 0.05) respect to the analytical curve (which is 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: MF with error in the estimation of the noise power Analytical without error Simulated without error Simulated with error +/- 5% Simulated with error +/- 10% Simulated with error +/- 20% 0.04 0.045 0.05 0.055 0.06 0.065 0.07 0.09 0.095 0.1 0.105 0.11 0.115 False Alarm Probability Miss Detection Probability Realistic conditions: MF with error in the estimation of the noise power Analytical without error Simulated without error Simulated with error +/- 5% Simulated with error +/- 10% Simulated with error +/- 20% 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with error in the estimated noise power Analytical without error Simulated without error Simulated with +/-5% error Simulated with +/-10% error Simulated with +/-20% error 0.03 0.04 0.05 0.06 0.07 0.08 0.72 0.73 0.74 0.75 0.76 0.77 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with error in the estimated noise power Analytical without error Simulated without error Simulated with +/-5% error Simulated with +/-10% error Simulated with +/-20% error
36 calculated with the correct 2 w ) is of 0.00372 in the MF algorithm and 0.0112 in the CP based algorithm. b. Time-variant channel: One of the most important assumptions done in this project, as it is explained in subsection 2.1, consists in considering that the channel is time invariant, which means that the channel coefficient h, although it is unknown in most of the methods), does not vary in the sensing time (N samples). But this assumption depends on the coherence time of the channel and it is necessary to model how the behaviour of the different algorithms changes if the channel is time varying. This variation has been modelled in this project as follows: 12 1 2 1 0, 2 1 0, 11 : 2 : h n s n w n h n h j n n y (50) The parameter (0 < < 1) allows to increase or decrease the variation of the channel. For low values of , the coefficient hn has a small variation respect to the previous value of the coefficient 1hn . However, if the value of is high, the coefficient hn is almost random in respect to the previous coefficient 1hn . The simulations have been carried out for low values of , in order to simulate a slow variation of the channel coefficient in respect to the sesing time: Figure 20. MF with time-variable channel Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64 and SNR = -10 dB (N = 64). Right graphic is a zoomed version of the left one. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: MF with time-variable channel Analytical |h|=1 Simulated h invariant = 0 Simulated h variant = 10e-4 Simulated h variant = 10e-3 Simulated h variant = 10e-2 0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25 False Alarm Probability Miss Detection Probability Realistic conditions: MF with time-variable channel Analytical |h|=1 Simulated h invariant = 0 Simulated h variant = 10e-4 Simulated h variant = 10e-3 Simulated h variant = 10e-2
37 In figure 24 it can be checked that the simulated curve for an invariant channel presents the best results and fits the analytical curve, and for low values of (10-4,103) the curves hardly worsen. But for higher values of (10-2 or more), the degradation of the algorithm is notable. So it can be concluded that in channels with little variations (low values of ), the approximation to an invariant channel is correct. In figure 21 the same effect in the CP based algorithm can be observed: Figure 21. CP based MS with time-variable channel Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, CP = 25% and SNR = -10 dB (N = 80). Right graphic is a zoomed version of the left one. c. Frequency-variant channel: Similarly to subsection 2.7.b, the channel can also be selective in frequency. This means that the frequency impulse response Hf of the channel does not have to be equal for all the subcarriers of the OFDM signal. This characteristic depends on the Coherence Bandwidth; if the bandwidth of the subcarriers of the signal is narrower than the Coherence Bandwidth of the channel, the channel is considered flat and it does not have variations in frequency. But in the opposite case, if the OFDM signal bandwidth is wider than the Coherence Bandwidth, the impulse response is enlarged in time, with a non-zero delay spread. One way to model this effect consists in creating a channel with an echo: 0,1 0 1 ,1: h n s n s n w n h yn j (51) This is equivalent to consider a frequency selective impulse response: 2 H1j fT fe (52) The parameter allows controlling the amplitude of the echo. For the following simulations, low values of have been used: 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with time-variable channel Analytical |h| = 1 Simulated h invariant = 0 Simulated h variant = 10e-4 Simulated h variant = 10e-3 Simulated h variant = 10e-2 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.72 0.73 0.74 0.75 0.76 0.77 0.78 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with time-variable channel Analytical |h| = 1 Simulated h invariant = 0 Simulated h variant = 10e-4 Simulated h variant = 10e-3 Simulated h variant = 10e-2
38 Figure 22. MF with frequency selective channel Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64 and SNR = -10 dB (N = 64). Right graphic is a zoomed version of the left one. Figure 23. CP based MS with frequency selective channel Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, CP = 25% and SNR = -10 dB (N = 80). Right graphic is a zoomed version of the left one. As it can be observed the variations of the curves in both methods are unremarkable, even for high values of α (10e-2). d. Frequency error in the subcarriers: Usually a little error on the carrier frequency synchronism is present at the SU receiver, causing a subcarrier frequencies deviation effect and provoking a mismatch between the CP and Pilot received subspace ant the one considered in the detection terminal. Obviously this effect could affect the detection. A synchronism error in frequency can be modelled: 2j fn y n hs n e w n (53) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: MF with frequecy selective channel Analytical flat channel Simulated flat channel Simulated = 10e-4 Simulated = 10e-3 Simulated = 10e-2 0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25 False Alarm Probability Miss Detection Probability Realistic conditions: MF with frequecy selective channel Analytical flat channel Simulated flat channel Simulated = 10e-4 Simulated = 10e-3 Simulated = 10e-2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with frequecy selective channel Analytical flat channel Simulated flat channel Simulated = 10e-4 Simulated = 10e-3 Simulated = 10e-2 0.03 0.04 0.05 0.06 0.07 0.08 0.72 0.73 0.74 0.75 0.76 0.77 0.78 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with frequecy selective channel Analytical flat channel Simulated flat channel Simulated = 10e-4 Simulated = 10e-3 Simulated = 10e-2
39 In figure 24 the MF and CP based MS algorithms performance is presented: Figure 24. Right CP based MS with frequency error Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, CP = 25% and SNR = -10 dB (N = 80). Left MF with frequency error Plot. Signal modulated in QPSK, num frames = 1, IFFT points = 64, and SNR = -10 dB (N= 64). As it can be seen, the synchronism error effect is not negligible when an error f greater than 0.005 is generated, given that the algorithms performance begins to degrade too much. For example with an error 0.02f , the algorithms are almost useless. In table 9 the degradation of D P can be checked: Δf Method PFA PD 0 MF 0.05 0.9516 CP based 0.05 0.2519 0.005 MF 0.05 0.9279 CP based 0.05 0.2264 0.01 MF 0.05 0.7694 CP based 0.05 0.1861 0.015 MF 0.05 0.438 CP based 0.05 0.1478 Table 9. Comparison table of the degradation of the algorithms for different frequency errors. In fact, one of the main disadvantages of the OFDM systems is their susceptibility to errors in frequency, and in Spectrum Sensing of OFDM signals, the same problem occurs. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: MF with frequecy error Analytical without error Simulated without error Simulated with error f = 0.005 Simulated with error f = 0.01 Simulated with error f = 0.015 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 False Alarm Probability Miss Detection Probability Realistic conditions: CP based with frequecy error Analytical without error Simulated without error Simulated with error f = 0.005 Simulated with error f = 0.01 Simulated with error f = 0.015
40 4. Budget In this project any prototype has been designed and built, and the only software that has been used is Matlab. The cost of a Matlab license goes from 35€ of the student version to 69€ of a more complete version. The number of dedicated hours to this project has been around 2 hours per day since the beginning of the project, and 4-5 hours per day the last period (July). The total number of dedicated hours is near 300 hours.