Spectrum Sensing using ANFIS and Comparison with Energy Detection Method

DOI : 10.17577/IJERTV4IS080705

Download Full-Text PDF Cite this Publication

Text Only Version

Spectrum Sensing using ANFIS and Comparison with Energy Detection Method

Jigyasa Nayak M.Tech (ECE) IGDTUW

New Delhi, India

Kanchan Sharma Assistant Professor (ECE) IGDTUW

New Delhi, India

Abstract Energy detection is one of the most popular method for cooperative spectrum sensing. Energy detection can be done by two basic methods:

  1. Data Fusion

  2. Decision Fusion

    In this paper prime focus is on decision fusion in which detection probabilities and false alarm probabilities are calculated with the help of k-out of-n fusion rule. In cooperative spectrum sensing, secondary users report to the fusion center with sensing results based on primary user activity. The fusion rule can be OR, AND or Majority rule which in general is termed as k-out of-n fusion rule. In this paper ANFIS (Adaptive Neuro Fuzzy Inference System) to show the improvisation in terms of minimization in Bit Error Rate has been used. This paper also shows the comparison between spectrum sensing using Energy detection and spectrum sensing using ANFIS .Results can be improvised by raising number of iterations as it trains the system in better manner.

    KeywordsANFIS, Spectrum Sensing, MATLAB, Data Fusion, Energy detection, Cooperative network, Decision fusion


      Spectrum (Radio Bandwidth) is a very costly and limited resource which is not fully utilized by the primary users as either not the fully allocated bandwidth is utilized or consumption of the BW varies i.e. used for a given time period. Such spectral under-utilization has motivated cognitive radio technology which has built-in radio environment awareness and spectrum intelligence [5]. CR gives an opportunity to unlicensed users or secondary users or cognitive users to access unused but licensed band, for which the activities of primary users are firstly analyzed in order to determine spectrum holes or white spaces. Sensing has to be accurate so as to avoid interference whereas reliable sensing of spectrum is not sure due to many reasons like multipath fading, shadowing and hidden terminal problem. Cooperative spectrum sensing has thus been introduced for quick and reliable detection [1][4].

      There are many spectrum sensing techniques like matched filter detection, cyclostationary feature detection and energy detection. The most common method is Energy detection. The key parameters are probability detection and false alarm probability detection. On the basis of these

      parameters errors are calculated. Then Energy detection takes place by comparing the energy with the defined threshold. If the energy of the signal is more than threshold the signal presence would be indicated by Pd and if energy is lesser than the threshold signal absence would be indicated by Pf. And here just detection of the probabilities and calculating the errors has been made. This error information is not being transmitted back. So the performance is not so good. This can be improvised with the help of ANFIS.

      ANFIS: Adaptive Neuro Fuzzy Inference System which is also very popular from the name neuro fuzzy is the combination of merits of both the ANN (Artificial Neural Network) and Fuzzy systems. For example the ANN models are very efficient in adapting and learning, but on the other hand, they have some negative attributes, they are black box [6]. Fuzzy logic is well known for its best transformation of ambiguity of human thinking into computable data. The derivation of if-then rules and corresponding membership functions depends, a lot, on the a priori knowledge about the system [7].

      The ANFIS can be trained by using a hybrid learning algorithm. In the forward pass the algorithm uses least squares method to identify parameters on the final layer. In the backward pass the errors are propagated backward and it can take place with the help of two modes.

      1. Online training: Parameters are to be updated after each Input/output pair.

      2. Offline learning: Updated formula is based on the derivative of overall error w.r.t

      With the same approach of BPN the results using energy detection have been compared and computed and improvisation has been made using ANFIS.


      Let say a primary signal x(t) is transmitted through a channel with gain denoted by g, then the received signal will be y(t)

      y(t) = w(t) :Ho (1)

      gx(t)+w(t) :H1

      y(t) will follow two cases. First case when the signal is absent and second when the signal is present by a general hypothesis Ho and H1 respectively.

      Ho – Signal absent H1 – Signal present

      w(t) is the white Gaussian noise.

      1. Energy Detector over AWGN channel

        The received signal is first passed through a band pass filter having bandwidth W and output is then squared and integrated over a time period T to get the test statistic. The test statistic is compared with a predefined threshold value [8]. The probabilities of false alarm (Pf) and detection (Pd) can be evaluated as Pr ( |H0) and Pr ( |H1) respectively to yield [9]

        has been performed in MATLAB. The benefit of using MATLAB is that it is easy to use, widely used by scientist and engineers and contains all mathematical libraries. MATLAB based ANFIS system is shown in Figure 1. Working procedure of proposed approach is given in Figure 3. The brief explanation of the block is as follow:

        1. Data Preparation: For any of the learning method to work pre-defined data is required. Here an nx3 matrix having 1st column as detection probability, 2nd column as false probability and 3rd column as error rate for 20000 iteration. The 3rd column is use as an target for training of the system.

          The above data is taken after running the probabilistic model for 20000 of iteration and stored the detection probability ,false probability and error rate for all the iteration. The stored data is then concatenated in an array and used for training and fuzzy logic designing.

          Pf = (,/2)



        2. Load Training Data: Since the simulation is performed in MATLAB so ANFIS system require training data to

          Pd Qu (2, ) (3)

          Where u=WT, is SNR i.e. =Es|h|2/N0, the power budget primary user has is denoted by Es, the uth order generalized Marcum-Q function is denoted by Qu (.,.), the gamma function is denoted by (.) while the upper incomplete gamma function is denoted by (.,.).

      2. Energy Detector using ANFIS

      Since the model used for energy detection is probabilistic and due to its probabilistic nature probability of false alarm increase. To remove this ambiguity a rule based model having adaptability to learn with new samples is required. Either fuzzy can be used to remove the ambiguity and Artificial Neural Network (ANN) for learning mechanism. However fuzzy rulebook designing mechanism is manual. It dont have adaptability to change with the new sets of data while on another side ANN will work on the tuned data of fuzzy.

      Or, ANFIS a self-tuned, adaptation capability with backpropagation and hybrid learning method can be used. In our proposed approach ANFIS is used due to its major advantages. ANFIS contains sugeno fuzzy model as well as backpropagation and hybrid learning algorithm. Detailed ANFIS architecture is given in Figure 4. Figure depicts five distinct layers. All having different functionalities. All nodes in the 1st layer is an adaptive node having a node function µAi(x) for i=1, 2 and µBi(x) for i=3, 4. The membership function is:

      µA(x) = 1


      ai,bi and ci are the parameters and is called as premise parameters. 2nd layer is just multiplying all the incoming signals. The 3rd layer is used to find the ratio of rulets firing strength to the sum of all ruletss firing strength and hence it is called normalized firing strength [10]. Like 1st layer the 4th layer also have adaptive nodes having node function Pi where is incoming normalized firing strength from 3rd layer whereas

      Pi=fx+gy+h where f,g and h are consequent parameters. While 5th layer has a fixed which just calculates the sum of all signals.

      The major advantage of using learning based mechanism is that it easily controls the out of bound data. Since all simulation

      perform the operation and generate the .fis file. In some case when data is in large amount then 70% of the data use for training and rest 30% for checking.

      1. Select Method for FIS Generation: In this section either user defined fuzzy system can be select or selection can be made from Grid Partition and Sub. Clustering. The later help us to design the adative fuzzy system.

      2. Enter Number of Membership: Now the ANFIS system asks for the no. of memberships and types of membership. Which generates the automatic fuzzy system.

      3. Choose optimization method: For better training of network optimization method is required. In proposed approach back propagation optimization method is used while hybrid method can also be use.

      4. Set Epochs: Epochs is maximum time limit to perform the training. Once epochs completes, the training will automatically stop. Epochs would never be consider as a base for better training. In some of the case more number of epochs gives better output while in some cases it fails. In proposed approach the system trained for 1000 epochs.

      5. Train Network: After initilizing the above parameters the netwrok starts training.

      6. Store fis file: Once the training is completed store the

      .fis file either into the workspace or in the current working directory.


      The secondary users in the system will act as a relay node for the fusion center, which is called as cognitive relay. So here the role of the secondary user is to amplify the signal and send it to the fusion center.

      1. Cooperative Network

        In the starting days cooperative network becomes very popular from the name virtual MIMO (Multi Input Multi Output). The n no. of cognitive relays (named r1, r2 rn) in the system makes it virtual MIMO as shown in the Figure 2. The working procedure of the system is divided into the phases. In the first phase the cognitive relays used in the system only listen to the primary user. While in the next phase instead of taking hard decision about the presence and absence of signal it will amplify the signal and sent it to the fusion center. Since the assumed channel is orthogonal so fusion center will receive the independent signals from the cognitive relays. The received signal is then compare with the pre-defined threshold using energy detector.

        Figure 1: MATLAB based ANFIS system


        Data Preparation

        Load Training Data

        Select Method for FIS Generation

        Enter Number of Membership

        Choose Optimization Method

        Set Epochs

        Train Network

        Store .fis file

        Figure 3: Flowchart of ANFIS



        P F



        relay link P: Primary User

        ——– direct link ri: ith cognitive relay F: fusion center

        Figure 2: Multi Cognitive Relay Network

        Figure 4: Detailed ANFIS architecture

      2. k-out-of-n Rule

        In the absence or presence of primary activities each cognitive relay will make its own decision. That one bit decision {0 for absence and 1 for presence of primary activity} is fetched to the fusion center, which in turn will make cooperative decision

        on the primary activity. The decision device will work on k- out of n rule. The fusion center decides the presence of primary activity where k indicates the no. of relays and when k=1, k=n, k=n/2, the k-out of n rule will represent OR, AND or majority rule respectively.

        1. Channel without errors: If the channels are error free then probability of false alarm and detection can be written as


          = ( )P (1 )


        2. Channel with errors: Practically the channels are not perfect, errors can take place while making a decision which is subsequently transferred by the CRs. Thus overall false alarm and detection probabilities with error can be defined as


      = ( )(p. ) (1 . )


      Where can be replaced by f for false alarm and d for detection


      This section provides the simulated as well as analytical results of both the techniques i.e. without ANFIS and with ANFIS and compare the results for various conditions. Analytical results as well as modeling results in the same figure for both the cases has been shown. Analytical and Modeling results without ANFIS is shown in Figure 5. Figure depicts both the analytical and modeling results for n=5 is almost same.

      While in case of simulation with ANFIS as shown in Figure 6 It is easily visible in the figure that the modeling result for n=5 is better than the analytical result. Graph is plotted between varying threshold and Total Error rate. The modeling or the simulation has been performed for 20000 iteration for n=5 while it can simulate for other values of n and for different values of n ANFIS performs better than the probabilistic model.

      Figure 5: Analytical and Modeling results without ANFIS

      Figure 6: Analytical and Modeling results with ANFIS


      Detailed study has been done for cooperative spectrum sensing for data fusion and decision fusion. To modify the result a noble technique is proposed i.e. ANFIS and as expected it improves the result. k-out-of-n generalized rule is used to implement the model. Involvement of multiple relays or the cooperative network has many advantages but due to its multi involvement channel detection time increase. So here recommend is to include CSI (channel state information) to check which is performing well. The system will automatically choose those path having best last three CSI, if more than one have same CSI then system will select any path randomly.


  1. G. Ganesan and Y. Li, Cooperative spectrum sensing in cognitive radio,

    part I: two user networks, IEEE Trans. Wireless Commun., vol. 6, no. 6,

    pp. 22042213, June 2007.

  2. G. Ganesan and Y. Li, Cooperative spectrum sensing in cognitive radio,

    part II: multiuser networks, IEEE Trans. Wireless Commun., vol. 6, no. 6, pp. 22142222, June 2007.

  3. R. Fan and H. Jiang, Optimal multi-channel cooperative sensing in cognitive radio networks, IEEE Trans. Wireless Commun., vol. 9, no. 3, pp. 11281138, Mar. 2010.

  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, no. 12, pp. 57615766, Dec. 2009.

  5. S. Haykin, Cognitive radio: brain-empowered wireless communications, IEEE J. Sel. Areas Commun., vol. 23, no. 2, pp. 201 220, Feb. 2005.

  6. M. Bilgehan, "Comparison of ANFIS and NN modelsWith a study in

    critical buckling load estimation", Applied Soft Computing, 2011, vol.11, pp. 3779-3791.

  7. M. KangaraniFarhani and S. Mehralian Comparison Between Artificial Neural Network and Neuro-Fuzzy for Gold Price Prediction, 13th IEEE Iranian Conference on Fuzzy Systems 2013.

  8. H. Urkowitz, Energy detection of unknown deterministic signals, Proc. IEEE, vol. 55, no. 4, pp. 523531, Apr. 1967.

  9. F. F. Digham, M. S. Alouini, and M. K. Smon, On the energy detection of unknown signals over fading channels, in Proc. IEEE Int. Conf.Commun., May 2003, pp. 35753579.

  10. A.O. Cruz, ANFIS: Adaptive Neuro-Fuzzy Inference System

Leave a Reply