You are on page 1of 4

Error-Correcting Codes for Dynamic Spectrum Allocation in Cognitive Radio Systems

Department of Electrical and Computer Engineering, University of British Columbia Vancouver, BC V6T 1Z4, Canada Email:{chrisn,huguesm,vijayb}
Abstract Cognitive radio is an innovative technology proposed to increase spectrum usage by allowing dynamic allocation of the unused spectrum in changing environments. Cognitive users monitor the spectrum and are allowed to use it as long as it does not interfere with the primary users to whom it has been licensed. In this paper, we describe how some well established tools from the elds of error-correcting codes and information theory can be applied to the opportunistic spectrum access problem in cognitive radio. More precisely, we describe simple channel models based on information theoretic analysis and demonstrate that common error-correcting coding techniques, specically low-density parity-check codes and insertion-deletion codes, can be used to solve this problem. Index Terms Cognitive radio, dynamic spectrum allocation, error-correcting codes.

Chris Nicola , Hugues Mercier and Vijay K. Bhargava

Fig. 1.

Two-switch model from [1]

I. I NTRODUCTION A challenging task for cognitive radio systems is to design efcient opportunistic spectrum access schemes. One way for cognitive users to communicate is to use an interference avoidance approach [1], meaning that the cognitive transmitter and receiver only use the available spectrum in which they dont detect primary user activity. Two difculties arise in this scenario. Firstly, the availability of the spectrum to the cognitive users depends on the activity of primary users and is therefore highly dynamic. Secondly, it is possible that the transmitter and the receiver have conicting information about the available spectrum at any given time due to factors like mobility, distance from the primary users, shadowing, etc. The channel models developed and described in this work are motivated by the two-switch channel model for dynamic and distributed spectrum allocation originally presented in [1]. There, the authors model the dynamic spectrum allocation problem as a channel with side-information [2], [3]. The model, illustrated in Fig. 1, has a switch for each cognitive user which is open if they detect a primary user. The switches require that the cognitive users avoid using a subcarrier channel whenever a primary user is detected. In this work we explore this further by implementing channel models motivated by this scheme. We describe two logical ways in which the cognitive users might approach this channel. In the rst approach, the cognitive transmitter always continues with its message, allowing bits to be lost when there are open switches; this can be thought of as an erasure channel. In the second approach,
This research was supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) under a Strategic Project Grant.

the transmitter stops sending information when it encounters an open switch until the next free (closed switch) subcarrier and then resumes the transmission. This requires that the cognitive receiver attempts to remain synchronized. In these models the detection capabilities of the transmitter and the receiver are not assumed to be ideal, nor are they necessarily matched. We dene a probability of detection failure and a probability of false alarm for each cognitive user. This gives us some insight into the effect spectrum sensing quality has on channel capacity and system performance. The rst model is represented by a noisy erasure channel where the noise is modeled by a binary symmetric channel (BSC). The erasures model the effect of the detection of a primary user by the receiver, while the BSC noise process is a simplistic model for the subcarrier channel itself when no primary user is operating. The second model is developed using the concept of an insertion-deletion channel. In this model, a detection mismatch between the cognitive transmitter and receiver results in either a bit insertion or deletion. If a primary user is detected in a subcarrier by the transmitter, it holds the bit to be sent for the next free subcarrier in the sequence. If the receiver also detects the primary user it stays in sync with the transmitter, however if it does not it assumes that a bit was sent and receives a random bit which is now inserted into the received sequence. Likewise, a deletion occurs if the transmitter senses a free subcarrier but the receiver senses a primary user there. That bit has then been deleted or is ignored by the receiver. The purpose of using these models is to introduce errorcorrecting coding techniques to the dynamic spectrum allocation problem. Both channel models are well known and can be approached using a variety of coding techniques. Specically we are considering LDPC codes and insertion-deletion codes. We begin with the noisy erasure model in Section II and then extend and improve on it to demonstrate that the switch at the receiver is not ideal in this case. Coding for this

1-4244-1449-0/07/$25.00 2007 IEEE


Fig. 3. Fig. 2. Noisy erasure channel

One-switch channel transitions

channel using LDPC codes is explored. Section III provides the framework for the insertion-deletion model as well as some background on insertion-deletion coding. Finally, we conclude with our thoughts on the signicance of these models and discuss briey our ongoing work in this area. II. O PPORTUNISTIC S PECTRUM ACCESS VIA E RASURE M ODELS A. Two-switch erasure model with binary symmetric noise Dynamic spectrum allocation by an individual cognitive radio in the presence of a primary user with priority use of the spectrum can be modeled using the two-switch model from [1] and seen in Fig. 1. The two switches model the detection of primary users at the transmitter T , and receiver R , and are represented by the random variables ST and SR . Each variable is a local estimate of the random variable S which is the actual event that a primary user is operating in the range of T and/or R . The transmitter is not only required to avoid transmitting in the presence of a primary user but we also assume that the primary user signal is much more powerful than the channel noise and will result in an near-total loss of information. This is modeled by changing the bit-error probability such that when S = 0 (no primary user present), the noise process of the channel is that of the BSC channel with probability of 1 error p0 = pBSC , and when S = 1, then p1 = 2 . e e The detection of the primary users by T and R is not assumed to be perfect. There is the possibility that they fail to detect an active primary user or that they falsely detect a primary user (false alarm) when none is active. The probabilities of failure at the transmitter and receiver are represented by:
s fT s fR

The noisy erasure channel is illustrated in Fig. 2. While the channel can be considered to have two separate states associated with S = 0 and S = 1, we can simplify this into the noisy erasure channel shown and express the values e and a as functions of the probabilities of primary user activity and the detection properties of T and R : a e
= = (1 (1
1 0 pS ) fR + pS 1 fR

pS )

where pS , Pr(S = 1): For this channel the capacity for uniform binary inputs is given by: C
= =

1 1 pS f R ; 2

1 0 f 2 T

0 1 fT pBSC



0 1 fR


where H () is the entropy function and h(x) = x log(x). This model, however simple, may not be optimal for this approach to the problem. We show below that it is possible for the receiver to further exploit the knowledge of the imperfect detection properties of T and R . B. One-switch alternative model The noisy erasure model for the two-switch channel can be considered one of the simplest models for the dynamic spectrum allocation problem in that it is merely a combination of two of the simplest and most well known binary input channels. We note, however, that the receiver may not be exploiting all of the information available from the channel and side-information. The effect of the switch at the receiver means that it assumes an erasure occurs whenever it detects a primary user. This does not consider the possibility that the primary user may have been detected incorrectly by the cognitive receiver. If the primary user detection is perfect at the receiver then there is no advantage to consider the output of the channel. However, we have imperfect detection of the primary user, and in this case the receiver can do better if it has an accurate knowledge s s of the probabilities of failed detection fR and fT . We consider a modication of the channel model which is illustrated in Fig. 3, where there are four possible channel outputs corresponding with the two binary output values for the channel Y and the two states of SR . This can be looked at as a one-switch model where there is only a switch at T .

1 a + H ([a ; 1 a ]) H ([e; a ; 1 e a ]) 1 a + h(1 a ) h(e) h(1 e a );

= =


T jS = s) T = sjS = s)

; :

Using this notation the probabilities of failed detection are 1 1 represented by fT and fR and the probabilities of false alarm 0 0 by fT and fR . These probabilities can be thought of as characteristics of the cognitive radios indicating the ability to detect primary user activity. Furthermore, the probability of failing to detect a primary user is directly related to the probability of interfering with it, so it is likely that there will be regulations governing how high that can be. It will be seen that these values have a direct effect on the capacity of the dynamic spectrum channel available to the cognitive radios in this model.


It is possible to compute the channel capacity in this case, and to do so we rst dene the probability of error conditioned on SR by pe sR , Pr X T= Y jSR = sR . More precisely, pe (0) pe (1)
= =

We write the initial log likelihood ratio (LR) as a function of the receiver variables Y and SR as follows: lr , Pr X Pr X

= 1 Y ; SR

1 0 1 0 P + pBSC 1 fT + fT P0j0 ; 2 1j0 2 ! 1 0 1 0 P1j1 + pBSC 1 fT + fT P0j1 : 2 2

(3) (4)

j = 0jY SR

We dene PSjSR P0j0 P0j1

, Pr

S = sjSR

= sR

and compute

with P1j0 = 1 P0j0 be subj j stituted into the equation of the channel mutual information, i.e., I X;Y ; SR

= =

0 pS ) 1 fR   0 1 (1 pS ) 1 f R + pS f R 0 (1 pS ) f R   0 1 (1 pS ) f R + pS 1 f R and P1 1 = 1 P0 1 . These can

; ;

which can be derived from the probability of error given the state detected at the receiver pe sR dened in the previous section. For the two-switch model presented earlier we have 1 that pe (1) = 2 , otherwise pe (0) = e=Pr SR = 0 with e taken from (2). The error probabilities for the one-switch model are given by (3) and (4). Aside from the initialization of the LRs there is no difference between decoding for this channel and decoding for any other memoryless channel. The standard SPA decoder described in [4] can be applied directly. III. O PPORTUNISTIC S PECTRUM ACCESS VIA S YNCHRONIZATION In this section, we explore how synchronization errorcorrecting codes can be used to solve the opportunistic spectrum access problem. As in Section II, we use several assumptions that allow us to model the problem in an intuitive albeit oversimplistic way. We assume that there are only two cognitive users: a transmitter T who wants to convey a message to a receiver R . The available bandwidth B is divided into s subcarriers, as shown in Fig. 4. The subcarriers can be used by both the primary and cognitive users, although the cognitive users are not allowed to transmit in a subcarrier used by a primary user. We also suppose that there is no interference between the subcarriers. Finally, we assume that the subcarriers transmit binary information error-free over the channels, and that the errors are only caused by the discrepancy of the available subcarriers between the secondary transmitter and receiver.
Cognitive User Cognitive User Cognitive User Cognitive User

H (X ) H X jY ; SR


= sR




h pe sR


1 pe sR

This gives us the capacity of the channel for a uniform input distribution. In the one-switch model the receiver does not assume that no useful information can be received from the channel when a primary user is detected. This is advantageous to R if it knows that the detection capabilities of both itself and of T are not ideal. If we assume that R has an accurate s s knowledge of the values for fR and fT , it is possible for the decoder to exploit this channel further by considering the output value Y . Without that knowledge the receiver may not be able to effectively exploit the information that might have actually been sent in the case of a false detection. It is worth noting, however, that the capacity gained by considering this model vs. the erasure model is modest unless both the primary user activity is fairly high (i.e., pS is large) and the probabilities of detection error are large. C. LDPC Decoding for Cognitive Radio We now derive the likelihood ratios and describe the basic approach to LDPC coding for this channel model. We can apply LDPC codes to both of the models described above to compensate for the BSC noise as the primary user activity. Belief propagation decoding based on the sum-product algorithm (SPA) [4] is typically used for decoding LDPC codes and can be applied to this channel in much the same way it would be applied to a normal BSC or erasure channel. There are two variables to consider for the decoder: the output of the channel Y and the state of the channel as observed by the receiver SR . These are used to compute the initial likelihood ratio for X.

Cognitive User

Cognitive User

Primary User

5 B

Primary User


Fig. 4.

Subcarriers used by primary and cognitive users

In order to illustrate our model, suppose that T wants to send the string 110011. It senses the spectrum and realizes for instance that the third, fourth, fth, and ninth subcarriers are being used by primary users. T then sends a bit on each free subcarrier, and the resulting usage of the bandwidth is 1 1 - - - 0 0 1 - 1. Suppose now that R senses that the second, third, fourth, fth, and ninth subcarriers are being used by primary users. It follows that the received bit for each


subcarrier is 1 - - - - 0 0 1 - 1, in other words the message 110011 is received as 10011. It follows that each primary user detected by R but not by T will result in a bit deletion. It has to be noted that R has side-information about the deletions, since they can only be located in the subcarriers detected as being used by primary users. As a second example, suppose that R senses a primary user on the second, third, and fourth subcarriers. It concludes that all the remaining subcarriers were used by T , thus the received message is 1 1 - - - 0 0 1 ? 1, where ? is a random bit. This means that each primary user only detected by T generates a random bit insertion at the receiving side. Unlike deletions, there is no side-information about the location of the insertions. A novel approach to solve this opportunistic spectrum access problem is therefore to use insertion-deletion errorcorrecting codes. The advantage of error-correcting codes over real-time reconciliation of the available spectrum between the cognitive transmitter and receiver is that as long as the discrepancy in the spectrum allocation is not larger than the error-correcting capability of the code, T can transmit on the available subcarriers. If the bandwidth used by primary users changes, then T adjusts the subcarriers it uses accordingly and does not need to alert R of the changes. Unfortunately, although there has been a lot of progress accomplished recently, codes capable of correcting deletions and insertions of bits are extremely challenging. One of the reasons is that insertions and deletions introduce synchronization errors, and as a result the tools developed for memoryless channels cannot be used. Consider for example the simplest deletion channel, for which each bit is either deleted with probability d or transmitted correctly with probability 1 d. The capacity of this channel is not known [5], and it goes without saying that the capacity of more general channels admitting deletion and insertion errors remains an open problem. Furthermore, although single-deletion errorcorrecting codes are well understood, it seems that the results cannot be extended for two or more deletions [6]. Most of the work on insertion-deletion codes is theoretical and the only codes having any chance of being used in practice either work for very low error rates [7] or can only correct a single error per block [8]. For clarity purposes, the model we propose is interferencefree and error-free. We now discuss both assumptions and explain why the model remains valid if they are relaxed. Firstly, we assume that there is little interference from the secondary users to the primary users. This is paramount to cognitive radio systems since cognitive users must not interfere with neighbouring primary transmissions, typically by using a lower transmit power. Secondly, we assume that there is no interference between the subcarriers used by T . This can be achieved by using orthogonal frequency division multiplexing (OFDM). Thirdly, we assume that there is no interference from the primary users in the subcarriers used by the cognitive users and that all the transmissions from T to R are error-free. This is of course unrealistic, however the interference to the cognitive users from the primary users can

be modeled as additive white Gaussian noise. Moreover, a code capable of correcting insertions and deletions can also correct substitutions of bits, since a substitution can be viewed as the deletion of a bit followed by the insertion of the opposite bit at the same position. Consequently, an interesting research problem is to construct good codes capable of correcting a small number of insertion and deletion errors while remaining robust against additive noise. IV. C ONCLUSION In this paper, we have developed models for which we can apply the techniques of error-correcting coding as a means of compensating for primary user activity in dynamic spectrum allocation applications. Using simple and well understood channel models has provided us with the tools and insight to develop practical approaches to design dynamic spectrum systems. The framework we have presented can be used for studying more complex channel models as well as implementing other types of error-correcting codes. The nature of the error-correcting decoding scheme indicates that an accurate estimation of the design parameters of the cognitive radios, especially the accuracy of their primary user detection, will be valuable to the decoder in effectively exploiting the capacity of the channel. It is a goal of this work to understand through simulations how much this knowledge (or lack thereof) will affect decoding. Ongoing work includes the design of insertion-deletion and irregular LDPC codes with good performance characteristics for these channel models and the simulation of these codes to provide performance benchmarks. Furthermore, we are also extending these simple channel models to include AWGN channels and more detailed modeling of the primary user detection. R EFERENCES
[1] S. A. Jafar and S. Srinivasa, Capacity limits of cognitive radio with distributed and dynamic spectral activity, IEEE Journal on Selected Areas in Comm., vol. 25, pp. 529537, April 2007. [2] C. E. Shannon, Channels with side information at the tranmitter, IBM J. Res. Develop, pp. 289293, October 1958. [3] T. M. Cover and M. Chiang, Duality between channel capacity and rate distortion with two-sided state information, IEEE Trans. Inform. Theory, vol. 48, pp. 16291638, June 2002. [4] F. R. Kschischang, B. J. Frey, and H. A. Loeliger, Factor graphs and the sum product algorithm, IEEE Trans. Inform. Theory, vol. 47, pp. 498 519, February 2001. [5] M. Mitzenmacher and E. Drinea, A simple lower bound for the capacity of the deletion channel, IEEE Trans. Inform. Theory, vol. 52, pp. 4657 4660, Oct. 2006. [6] N. J. A. Sloane, On single-deletion-correcting codes, in Codes and Designs (K. T. Arasu and . Seress, eds.), vol. 10 of Ohio State University Mathematical Research Institute Publications, pp. 273291, de Gruyter, 2002. [7] M. C. Davey and D. J. C. MacKay, Reliable communication over channels with insertions, deletions and substitutions, IEEE Trans. Inform. Theory, vol. 47, no. 2, pp. 687698, 2001. [8] Z. Liu and M. Mitzenmacher, Codes for deletion and insertion channels with segmented errors, in Proceedings of the 2007 IEEE International Symposium on Information Theory (ISIT), 2007. To appear.