95
A Simulator for Cognitive Radio DENNIS SUNDMAN Master’s Degree Project Stockholm, Sweden XR-EE-KT 2008:004

A Simulator for Cognitive Radio

Embed Size (px)

Citation preview

Page 1: A Simulator for Cognitive Radio

A Simulator for Cognitive Radio

DENNIS SUNDMAN

Master’s Degree ProjectStockholm, Sweden

XR-EE-KT 2008:004

Page 2: A Simulator for Cognitive Radio

1

Page 3: A Simulator for Cognitive Radio

Abstract

The goal of this thesis is to produce a simulator for cognitive radio.The licensed frequency spectrum is getting filled with customers. If

the trend continues, there will soon not be any frequencies left to use fornew wireless data transmission applications. However, it has been shownthat although many frequencies are bought, in reality they are not alldeployed. As an attempt to exploit this, the technique of cognitive radiohas been proposed. Cognitive radios are radio devices that are clever andcan listen to the surrounding. They “sense” for different frequency bandsand if they find any that is unoccupied they adjusts their inner parametersto transmit/receive with this frequency. This technique could be used fora wide range of wireless radio applications.

A problem is that sometimes a radio device is located in a radio-shadow, for example behind a concrete wall. It will then believe thatthe shadowed frequency is “free”, and hence use that one. What thenhappens is of course that the device causes interference to the surroundingenvironment.

The simulator in this project is built in order to simulate what couldhappen if we just allowed these cognitive users to transmit freely in reality.

The biggest task of the thesis is to develop the simulator, where theother part is to evaluate it with some realistic values.

Conclusions drawn from the final tests are that although the simulatoritself is a bit simple and might not simulate reality perfectly, it seems thatcognitive users could be introduced in the digital television transmissionsystem. Doing the same for the mobile phone communication systemwould however, without some adjustments, cause too much interference.

2

Page 4: A Simulator for Cognitive Radio

Contents

1 Introduction 61.1 Digital communication systems . . . . . . . . . . . . . . . . . . . 61.2 What is cognitive radio? . . . . . . . . . . . . . . . . . . . . . . . 6

1.2.1 Frequency spectra . . . . . . . . . . . . . . . . . . . . . . 61.2.2 Cognitive radio - The use of frequency spectra holes . . . 81.2.3 Wireless Sensor Network (WSN) . . . . . . . . . . . . . . 8

1.3 Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.4 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.4.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . 101.5 Basic outline of the thesis . . . . . . . . . . . . . . . . . . . . . . 10

2 Theory 112.1 Cellular network . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.1.1 Base stations . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.2 The hexagon . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.3 Antenna diagram . . . . . . . . . . . . . . . . . . . . . . . 122.1.4 Reuse factor . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.2 Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 10’th percentile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4 Three different communication systems . . . . . . . . . . . . . . . 14

2.4.1 Digital-TV communication system . . . . . . . . . . . . . 142.4.2 Mobile phone communication system . . . . . . . . . . . . 152.4.3 Satellite communication system . . . . . . . . . . . . . . . 16

3 Simulator 163.1 H system object . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2 H cell object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.3 Base station object . . . . . . . . . . . . . . . . . . . . . . . . . . 193.4 Antenna object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.5 User object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.5.1 Primary user . . . . . . . . . . . . . . . . . . . . . . . . . 193.5.2 Secondary user . . . . . . . . . . . . . . . . . . . . . . . . 20

3.6 IT++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.7 Reliability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.7.1 Line of primary users with interference . . . . . . . . . . . 213.7.2 Line of secondary users . . . . . . . . . . . . . . . . . . . 233.7.3 Change of interference for a primary user . . . . . . . . . 25

4 Results 274.1 General introduction . . . . . . . . . . . . . . . . . . . . . . . . . 274.2 General conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Verification of a paper - TV system . . . . . . . . . . . . . . . . . 28

4.3.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 294.3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 29

3

Page 5: A Simulator for Cognitive Radio

4.3.3 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . 294.3.4 System calibration . . . . . . . . . . . . . . . . . . . . . . 304.3.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.3.6 Influence of secondary users . . . . . . . . . . . . . . . . . 304.3.7 Conclusions of our results . . . . . . . . . . . . . . . . . . 314.3.8 Comments on the simulation and model . . . . . . . . . . 31

4.4 Running a simulation on the GSM net . . . . . . . . . . . . . . . 324.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 324.4.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 334.4.3 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . 334.4.4 System calibration . . . . . . . . . . . . . . . . . . . . . . 334.4.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.4.6 Influence of secondary users . . . . . . . . . . . . . . . . . 354.4.7 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.4.8 Possible improvements . . . . . . . . . . . . . . . . . . . . 36

4.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5 Future work 36

6 Summary and conclusions 38

7 Appendix A 40

8 Appendix B 42

9 Appendix C 44

10 Appendix D 46

4

Page 6: A Simulator for Cognitive Radio

5

Page 7: A Simulator for Cognitive Radio

1 Introduction

1.1 Digital communication systems

There exist many different communication systems, for example the mobile-phone, the digital TV and different satellite systems. All these have their goodsides and their bad sides. Cognitive users could be implemented in many dif-ferent of these systems. We will in this thesis mainly focus on the cellularconstruction, see Section 2.1.

1.2 What is cognitive radio?

1.2.1 Frequency spectra

When talking about the “Frequency spectra”, one usually refers to the widerange of signals being licensed and used for different sort of radio communi-cation. The reason for these licenses are that if many people used the samefrequencies for different applications these applications would cause heavy in-terference to each other. The actual spectra of physically good frequencies (forradio communication) is soon completely bought up. This can be seen by look-ing at Figure 1. This one is taken from the United States, but it looks similarin all modern countries.

Figure 1: Frequency plan from the US.

In Figure 2, you see the common notion for different frequencies. The lowerfrequencies are interesting because their propagation properties are very good.Low frequencies are good in penetrating different objects, which means thatthey can go through walls, roofs, concrete, etc. The higher frequency, the worse

6

Page 8: A Simulator for Cognitive Radio

Designation FrequencyELF, extremely low frequency 3Hz to 30HzSLF, superlow frequency 30Hz to 300HzULF, ultralow frequency 300Hz to 3000HzVLF, very low frequency 3kHz to 30kHzLF, low frequency 30kHz to 300kHzMF, medium frequency 300kHz to 3000kHzHF, high frequency 3MHz to 30MHzVHF, very high frequency 30MHz to 300MHzUHF, ultrahigh frequency 300MHz to 3000MHzSHF, superhigh frequency 3GHz to 30GHzEHF, extremely high frequency 30GHz to 300GHz

Figure 2: Frequencies.

propagation. At super-high frequencies, not even a line-of-sight with the trans-mitter assures good transmission performance (basically due to the air that isnot as clean as vacuum). Just considering the physical propagation propertiesof different frequencies makes you believe that lower frequencies yields “better”signals. But just because the propagation is good, does not mean that the datarate is good. In fact, higher data rates are possible with higher frequencies dueto the fact that during a given amount of time we have more periods of thewave at higher frequencies. Because of this, different applications will requiredifferent physical properties of the radio wave. If the data rate is not so im-portant, but propagation is, you certainly need a lower frequency and the otherway around. Of course the poor data rate in low frequency bands can also becompensated by choosing a wider band. Most systems are compromises.

However, practical measurements have shown that although the spectra ofavailable frequencies is more or less bought up, at specific locations, a majorityof frequencies are not used at all [1]. This can easily be seen in Figure 3, whichshows measurements made at Berkeley from some suburban area.

Figure 3: Frequency use.

The idea of cognitive radio is to find means to use these “gaps” or “holes” in

7

Page 9: A Simulator for Cognitive Radio

the frequency spectra and do something useful of the frequencies floating aroundunused.

1.2.2 Cognitive radio - The use of frequency spectra holes

In an attempt to find a way to use the “holes”, one has come up with the term“Cognitive radio”. This word was first coined by Joseph Mitola in an articlefrom 1992 [1]. However, after working more with the concept, he suggest, in hisDissertation [2], the following definition:

“The term cognitive radio identifies the point in which wireless personal digi-tal assistants (PDAs) and the related networks are sufficiently computationallyintelligent about radio resources and related computer-to-computer communi-cations to:

a) detect user communications needs as a function of use context, and

b) to provide radio resources and wireless services most appropriate to thoseneeds.”

So cognitive radio is the name of a technique where different sorts of wirelesscommunication devices somehow work dynamically and change frequencies andother parameters over time. We will in this report use the term “cognitiveradio” alongside “secondary user”, having the same meaning.

This may sound a bit like science fiction, but with today’s modern technol-ogy, we can actually construct these radio devices, i.e. transmitters and receiversthat can operate on a quite wide range of different frequencies.

There are many ways in which this could work. Sensing the surroundingcan be made immediately, meaning that the cognitive user itself searches thefrequency spectra and looks for frequency holes. This is the method that will beimplemented in the simulator constructed in this thesis. However, the sensing ofthe surrounding environment is in reality quite hard, sensors can only measurethe energy of a wide frequency range and they show a poor performance forlow SNR’s [3]. By low performance we refer to high possibility of mis-detection.This has not been taken into account in this project. Instead the devices areoptimal in the sense that they can feel all frequencies in all SNR’s.

1.2.3 Wireless Sensor Network (WSN)

There are also other options for detection. For example something called Wire-less Sensor Network (WSN). Here the idea is that one construct a sensor networkthat constantly analyzes the frequency spectrum and provides this informationto potential secondary users. This would mean that the secondary user connectsto the sensor network and checks for free frequencies in the desired region.

A special case of the Wireless Sensor Network would be to let the secondaryusers form the sensor network by sharing information concerning the the fre-quency spectrum among their neighbors. They will then form an ad-hoc net-

8

Page 10: A Simulator for Cognitive Radio

work. This implies that we will be able to do a better decision if more secondaryusers are present within the radius of our communication.

All these different techniques have their pros and cons. What will be inves-tigated in this thesis is not the WSN, nor is it the ad-hoc network. We will herefocus on the simplest case of cognitive radio, where each device is responsiblefor sensing its own environment without help of any additional information.

Problems that could theoretically be solved using a Wireless Sensor Networkare:

• Shadowing of a single sensor. If a single sensor is in a radio shadow of acertain frequency, this will not cause any problem to the main system ifthe WSN can tell it which frequencies should be occupied.

• Improved robustness and agility. The improved sensing over a wider areamakes the bad sensing in poor SNR less problematic. Also, if the sensingof a device is broken, this will still not cause too much problem if there isa WSN around that can give directions.

1.3 Benefits

As always in the modern world, benefits often lie within the economical bound-aries. If we could use cognitive radio, we would be able to:

• Make use of the most suitable frequency for the purpose of our transmis-sion.

• Be able to “re-use” many frequencies and therefore extend the existingwireless communication systems.

• If the frequencies are not going to run out, prices on the licensed spectrumwill naturally drop, which in end will yield better consumer prices.

• Cognitive radio provides new business models. A service provider couldbe a manager for the resources.

1.4 Problem statement

Cognitive radio seems to be a promising concept. However, it still needs toprove its feasibility. As a first step we must realize that few, in fact none, ofthe current radio devices out on the market are cognitive radios. Therefore,the introduction of the secondary users must happen without these “old” radiodevices being interfered, and if they are interfered, we would have to find a wayof pricing this interference in the primary system.

Many papers have been written on this topic, but few have taken the ap-proach in this thesis. We will create a big-scaled simulator, simulating radiotraffic for certain frequencies in environments the size of cities or big country-sides. The simulator will be constructed with the cognitive radio and cellular

9

Page 11: A Simulator for Cognitive Radio

construction models in mind. To make the final work easily expandable we willuse object-oriented techniques.

As one part of this thesis is focused on the construction of this simulatorand of showing that it works, the other part is focused on trying to run a some-what realistic simulation setup. In the paper “Cognitive Radio in a FrequencyPlanned Environment: Can it Work?”, by Erik Larsson and Mikael Skoglund,it is concluded that:

“If a reasonable size of the cognitive operation area is desired (say 25% of thenetwork size), then the aggregate cognitive user power MP must be 1-2 orders ofmagnitude less than the primary power P0. For example, if there are M = 100cognitive users, then each of them must transmit with a power less than -35 dBbelow P0. This is not impossible if P0 is of the order of kW (TV broadcast-ing, for example) and P is in the order of a few hundred mW (sensor node, orWLAN card, for instance).” [4]

What this basically means is that secondary users can not exist everywherein the network. They must transmit with a power much less than the ones ofoperating base stations in the area and they also conclude that this would bepossible with a TV net.

Hence we will try to set up a similar system and then introduce secondaryusers trying to confirm their statement.

1.4.1 Preliminaries

Some knowledge that could be good to refresh before you go deep into this thesisare the following:

• Object oriented programming languages. The biggest challenge in thisproject was to actually construct the simulator, and in order to understandhow this is done, a basic knowledge about object-oriented programminglanguages is required.

• Basic geometry knowledge.

• The work in this report is based on results from [4], reading this reportfirst is suggested but not required.

1.5 Basic outline of the thesis

In this thesis you will, after this introductory chapter, find a section describingbasic theory deployed in the project. This will be kept rather basic and not gotoo much into details. In this chapter you will also find a basic description ofthe fundamentals of some different wireless communication systems.

After this you will find the simulator chapter (chapter 3), where we in generalterms describe how the computer program itself is built up. You will in theend of this chapter also find three different simulator runs which will show the

10

Page 12: A Simulator for Cognitive Radio

functionality of the code. Also note that we in Appendix D have attached acode-manual generated by doxygen.

In chapter 4 you will find our attempt to put the simulator in a more realisticperspective. We have used the result of other researchers to verify their resultsand also draw new conclusions of problems/possibilities with cognitive radios.

In the very end we have suggested a list of future work that could be donein the same topic followed by references.

2 Theory

2.1 Cellular network

The characteristics of a cellular network is that the base stations are placedin a pattern that is best reassembled with a hexagonal grid. The main reasonfor this is that it is easiest to produce a base station with constant gain in alldirections. To represent this in a model, it is obvious that the hexagon is theone closest to a circle of all symmetric tilings available, see Figure 4. This is,maybe not surprisingly, also the most common tiling found in nature (think ofa bee’s nest).

Figure 4: The three tilings; triangle, square and hexagon, respectively.

2.1.1 Base stations

The only thing taken for granted about the base stations in a cellular system isthat they are placed in a cellular grid (and even this is, in practice, not alwayssymmetric). They can have many types of antennas, such as sector antennas(different antenna sectors cowering the cell), omni antennas (one antenna ele-ment with constant gain) and beam forming antennas. In this report we willmostly talk about the sector and omni antennas. In Figure 5, you can seeone hexagonal cell with an omni-directional and one sectored base station, alsoshowing two different antenna diagrams.

2.1.2 The hexagon

When working with hexagonal cells you soon notice that there is a demandingneed to know the geography of the cell. The symmetry of the hexagon makes itpossible to get all the necessary sizes from the cell by just storing one variable.In the program, the radius defined in the picture is the variable that is stored,and it is stored in such a way that the cell itself does not know its own size.You can see a definition of sizes in the hexagon as shown in Figure 6.

11

Page 13: A Simulator for Cognitive Radio

Figure 5: An omnidirectional base station and a sectored one with three sectors.

Figure 6: A hexagon.

As described in [5], the important sizes can be calculated as follows:h = sin(30◦) · sr = cos(30◦) · sb = s+ 2 · ha = 2 · rObserve that the radius r is not the same as b/2, i.e. a 6= b.

2.1.3 Antenna diagram

All antennas are characterized by a so-called antenna diagram. The antennadiagram is a way of describing the gain going out from the antenna in differentangles (both horizontally and vertically). We will here only talk about antennadiagrams with no height, i.e. vertically constant. In the simulations found inthis report we will restrict ourselves to a constant gain also in the horizontalplane. Again, look at Figure 5 for antenna diagram examples.

12

Page 14: A Simulator for Cognitive Radio

2.1.4 Reuse factor

A cellular network is built in a way so that all frequencies in use are beingdeployed in a repetitive way. The cluster size (also sometimes called reusefactor) is a term to measure this. It works as:

N = i2 + i · j + j2 (1)

Where N is the actual cluster size. i and j explain how the reuse is located. Bylooking at Figure 7, starting at (0, 0), i is the number of steps you go in all ofthe directions 30◦, 90◦, 150◦, 210◦, 270◦ or 330◦ from the starting node. Whenthose steps are walked, turn 60◦ either to the right or left from the first directionand continue j steps in this way. When finished, place the same frequency inthe cell you got to as you had in the one you started from.

Figure 7: Closeup of the grid with coordinates (k,l)

2.2 Propagation

When a signal is transmitted from an antenna, it has a certain gain or strength.However, as it propagates through space it will decrease as a function of distancefrom the transmitting antenna. It will also be affected by objects, such asbuildings, cars, etc., which may yield a shadowing effect. It can due to reflectionsalso become stronger due to additive interference. This can be modeled in many

13

Page 15: A Simulator for Cognitive Radio

ways. One of these models is the distance-dependent log normal shadow fading,which is the one used here, see Equation 2.2.

ρ(x) = x−α · 10χ/10 (2)

α is the path loss exponent and will model the distance-dependent part ofthe equation. This is in a typical crowded city set to about 4. In vacuum, freespace, line-of-sight this would be 2.

χ is the random part of the equation and this variable will be distributed asN(0, σ), where σ is the standard deviation of the log normal fading [dB]. Thiswould in a typical city be about 6, and in free space 0. This is the part thatmodels the shadowing (in case 10χ/10 < 1) and additive interference (10χ/10 >1).

This model will be used to describe all signal propagation, interfering signalsand primary signals.

2.3 10’th percentile

The 10’th percentile in a cumulative function is the spot at 10 percent in thegraph. We will use a graph with the nr. of users (in %) on the y-axis (inlogarithmic scale) and cumulatively the SNIR on the x-axis. This will give usa cumulative probability density function showing the probability for a user tohave more than a certain SNIR. The 10’th percentile is of particular importancebecause most manufacturers construct their communication systems in such away that at least 90% of the users have a SNIR high enough for satisfyingconnection. This in turn, of course, leads to 10% of the users having unsatisfyingconnection. In this thesis we will only encounter cases where the limit for “good”connection is placed at 10 dB. This is also the order of magnitude commonlyapplied in practical implementations.

2.4 Three different communication systems

2.4.1 Digital-TV communication system

The following introduction is mainly taken from [6] and teracoms’ web page [7].What we refer to as a typical TV system in this text is basically the one appliedin Sweden.

The Digital-TV ground net is built in a cellular pattern. It is a broadcastingnet where all information is sent from the base stations and received at the TV-antennas most people have at home. The base stations placed in the hexagonalgrid are normally quite big base stations, located at high towers or hills. Thesecan, due to radio-shadows and such not cover the entire area by themselves.Instead there are also smaller “helping” base stations placed here and there tosupport this backbone of transmitters. In Figure 8 this is pictured (taken fromthe web page of teracom).

14

Page 16: A Simulator for Cognitive Radio

Figure 8: A real world map from teracom’s web page, showing the area ofStockholm with surroundings. The yellow triangles are smaller base stations.

Characteristics for the television communication system is that the receivingantennas often are directed and located in such a way that they have line of sightor close to line of sight propagation to the transmitting base station. Directedantennas are something that is not (yet) implemented in the cognitive radiosimulator, why we have to do some approximations when implementing thissystem.

Typical transmission strengths for the big base stations are in orders oftenths to hundreds of kW. These have a coverage area of tenths of km. InSection 4.3 you will find a simulator test run for a TV-system.

2.4.2 Mobile phone communication system

The following introduction is mainly taken from [8] and [9].The mobile communication system is built as a cellular network, see 2.1. The

base stations are generally categorized in three different classes, macro cells,micro cells and pico cells. The macro cells has a range of several kilometersand are often deployed on the country-side. They transmit with a strength of10-100 Watts depending on circumstances. These base stations are placed insteel lattice towers and are normally easily discoverable. The micro- and pico-cells however are not so easy to see. Normally these are placed in the moreurban areas as in cities. They have a much smaller range of coverage from afew hundred meters up to a kilometer and their transmission strengths varies

15

Page 17: A Simulator for Cognitive Radio

normally between one up to a couple of Watts. These base stations are easilydisguised as building features.

Each base station has antennas that are either panel-shaped sector antennasor pole-shaped omni antennas. In the case of sector-antennas there is a biggerpossibility to limit the range of transmissions and control which frequencies arebeing deployed in what direction. The omni-antennas however transmit andreceive equally in all directions.

Normally you would find the different sizes and different deployments ofantennas used at the same time covering the same area, particularly in populatedcities. Handovers between base stations are something that happens when yougo with your mobile away from the coverage area of one base station to another.Then the first base station hands over the connection of your call to the otherone. This is not made without an effort and different technologies are appliedto make it easier. One of these are the so called umbrella cells which in citiesare layered above the “normal” system. This grid is made with much biggercells and is constructed to handle the calls of mobile devices traveling at highspeeds, such as connections with devices in cars, trains and even bicycles.

2.4.3 Satellite communication system

The following introduction is mainly taken from [10].Satellites have been used for communication since Sputnik I first left the

ground in October 1957. However, as with all communication devices the tech-nology has gone from simple to more and more complex.

A satellite can be placed on different distances from earth. The most com-mon ones are the Low Earth circular Orbits (LEO) closest to us, with a distanceranging 600-1500 km. After that there are the Medium circular Earth Orbits(MEO) with altitudes 8000-11 000 km and at last the GeoStationary Orbit(GSO) at about 40 000 km.

The satellites can rotate in different speeds and different patterns, from beingstationary over one place (moving synchronized with earth) to moving at higheror lower velocities.

This sort of system is something that at the moment is not well simulatedin the simulator described in this thesis.

In this thesis we present a simulator that can simulate cellular or close tocellular communication systems. However, according to [10], we will probablysee more of the spatial frequency reuse (which is the characteristic feature ofa cellular net) even amongst satellites in the future and when this happens itcould be interesting to make an extension of the work in this report.

3 Simulator

When constructing this simulator a programming language had to be chosen.It had to be object-oriented, but also big enough to make it interesting to thepublic. That left us with java, c++ and c#. A very nice tool is a library called

16

Page 18: A Simulator for Cognitive Radio

IT++. This library contains many statistical and signal-processing tools beingof great help when developing mathematical software, see Section 3.6. IT++ isa c++ library so this was the deciding factor.

The simulator is built up around some main objects. These objects are:H system, H cell, Base station, User and Antenna, and they will in the following bedescribed into more detail. There are also other objects, mainly for supportingthese. In Figure 9 you see an UML class diagram showing how they are allconnected. For a more detailed description, look at Appendix D.

3.1 H system object

The H system class is quite heavy. It “has” all the other objects and also a lotof the logic for different equations/calculations. You may think of this class as“The World” of which everything exists and where all the rules are set.

One of the most important job being done by the H system is the managementof the grid. This includes placing cells in a clever way, but also managing theselection of frequencies for primary as well as secondary users. The hexagonalgrid is the one deployed in modern cellular constructions and will therefore alsobe used here.

However, computationally it is not so easy to work with hexagonal grids. Alldata types in a computer are built with the regular cartesian coordinate systemin mind. If one is to use the hexagonal tiling some extra-work has to be done.There is a need to walk around in the grid to do calculations of different sortand the grid has to be stored in an efficient way.

Think of a matrix as a grid with square tilings. Then imagine that everysecond row is shifted half a cell. This would be something similar to how a brick-wall is normally constructed. Then you can place the center of each matrix-square in the center of each hexagonal-cell. So keeping that image in mind, itis no problem to apply a regular matrix or a Cartesian coordinate system toarrange the cells. The result should be something like Figure 7, that we sawearlier. In the case of this simulator the coordinates of the system is constructedto reassemble the cartesian coordinate system rather than a matrix. The (0,0)cell will always be somewhere close to the center of the system and we will seeboth positive and negative numbers.

The H system also contain other logic and information, for example it helpswith deciding what frequency each user/secondary user will connect/transmitwith. It is no use to describe all this here, instead have a look at the code itselffor more details.

3.2 H cell object

The H system grid is built up with nodes of H cells. These are what one couldcall un-intelligent, meaning that they have no real logic functions implemented.They have 1, 3 or 6 Base station objects, depending on what is chosen in theconfiguration file. This allows us to create base stations with sectored transmis-sion, as described in Section 2.1.1. The cell itself knows its position as of where

17

Page 19: A Simulator for Cognitive Radio

Figure 9: UML class diagram for the simulator

18

Page 20: A Simulator for Cognitive Radio

in the virtual matrix grid it is located (k,l), see Figure 7. However, it does notknow its position as of x/y or not even its own radius. However, using the builtin functions get x(double radius) and get y(double radius), the actual position iscalculated from the grid.

3.3 Base station object

The Base station object is always placed in the middle of the cell. It has anAntenna, which has a span of transmission and an angle of direction. Thoseantenna variables are configurable through member functions in the Base station.

There can be 1 Base station in the cell, but also 3 or 6 of them. Each willof course have its own Antenna. In practice it is more common to use three basestations in the cells than one. It seems that three base stations per cell willcause less interference to the system than one.

3.4 Antenna object

Each Base station has an antenna object, which can be thought of as an antennaelement. The antenna object has, as previously mentioned a span of trans-mission, variable transmission rate in each angle, but no position. In a moreadvanced system it would be possible to implement the Antenna also in primaryand secondary users in the system. For implementation of an antenna diagram,the Antenna is where you would like to place it.

3.5 User object

The user object has two types of constructors. One for constructing a “sending”device (secondary) and another to construct a “receiving” device (primary).The reason is simply that there is a need to construct both of these types. Byplacing them in the same object, the possibility to implement a “dynamic” (bothsending and transmission) device would, if needed, be very straight-forward.

3.5.1 Primary user

What is interesting to know about the primary user is:

• It is connected to a base station.

• It has a position.

The primary users are placed uniformly random according to Figure 10.Observe that the user can not come too close to the base station (which normallyapplies in reality as well).

In Figure 10, nodes is a c++ std::vector. Hence, nodes.size() returns the sizeof the vector, nodes.at(<index>) returns the node at a certain index. The com-mand randu() is a function from the library IT++, giving a uniformly randomvariable between 0 and 1. Also observe that the primary user can not be locatedexactly on the base station.

19

Page 21: A Simulator for Cognitive Radio

1: for every user do

2: int node = nodes.size() * randu();

3: double x const = nodes.at(node).get x();

4: double y const = nodes.at(node).get y();

5: double x = 0;

6: double y = 0;

7: while get distance(0,0,x*width*2, y*width*2) < radius*0.1 do

8: x = randu() - 0.5;

9: x = randu() - 0.5;

10: end while

11: end for

12: place user at(x + x*width*2, y + y*height*2);

Figure 10: Pseudo code for user placement.

3.5.2 Secondary user

The secondary user is not connected to any base station. However, it has afrequency with which it transmits. The frequency is chosen in such way that itsenses all available frequencies and chooses the frequency that at the momentis “weakest”. This implies optimal spectrum sensing.

It is constructed from the same object as the primary user, but with anotherconstructor than the later.

3.6 IT++

IT++ [11] is a library containing tools for math and signal processing, but alsotools for easy connectivity with matlab. It is an open-source library which isdeveloped by many people and based on c++. In this simulator we use functionsand classes repeatedly in the code. We particularly use the tools for readingand writing files to matlab, to easily plot data and also calculate statistics. Ifyou are interested in this library, just go to the homepage [11] and you can readmore.

3.7 Reliability

A very justified question right now is weather all this really works or not? Inan attempt to answer this we have set up three simulator test-runs. The codesfrom the test-runs can all be found in Appendix A, B and C.

• In the first test-run we try to show that the primary users connect to theappropriate base station. By letting a user move its way through a setup,we can see how it will change the base station to which it is connected.We have also introduced a secondary user in this setup, to show that theprimary user using the same frequency experience a small interference andthose of another frequency are unaffected.

• In the second test-run we show that the secondary users chose a frequencythat causes as little interference as possible. This means in reality that

20

Page 22: A Simulator for Cognitive Radio

they are supposed to, in some sense, use the frequency of the base stationfurthest aways.

• In the third test-run we show how the distance between a primary userand a secondary user affect the strength of the interference.

3.7.1 Line of primary users with interference

In this test we try to show the reliability of the primary users.We have placed a line of primary users according to Figure 11. This can be

illustrated as a single user walking its way through the cells. What you see inthis picture are seven base stations placed in a typical fashion. The hexagonalgrid shows where the borders for each base station lies. The circle around thebase stations show the antenna diagram currently in use. The round small dotsare primary users and the diamond dot up in the right corner is the secondaryuser. The colors are put there to make it easier to see which frequency the basestations and the different users employ. A green dot indicates that the userhas connected to the green base station. We can clearly see that each user hasconnected to the base station that is located closest to it.

Also note that there are no users placed directly on top of the base station.This is just because it in reality cannot happen.

You can find the code for this program in Appendix B.

Figure 11: Walking primary user

The output from a typical test run is as follows (this is also the run that ispainted in the picture):

21

Page 23: A Simulator for Cognitive Radio

dennis@dennis-laptop simulator $ ./puser walk

Simulator program for cognitive radio.

Secondary user frequency: 104

Primary users from bottom left up to top right:

DL frequency: 104;

Signal strength: 0.338613;

Interference: 2.12103e-06;

DL frequency: 104;

Signal strength: 0.0900384;

Interference: 4.38612e-05;

DL frequency: 104;

Signal strength: 0.00421271;

Interference: 3.37021e-05;

DL frequency: 100;

Signal strength: 0.150852;

Interference: 0;

DL frequency: 100;

Signal strength: 0.43175;

Interference: 0;

DL frequency: 101;

Signal strength: 0.0910177;

Interference: 0;

DL frequency: 101;

Signal strength: 0.234449;

Interference: 0;

DL frequency: 101;

Signal strength: 1.8719;

Interference: 0;

cell frequency: 100; at: (0, 0)

cell frequency: 101; at: (17.3205, 10)

cell frequency: 102; at: (17.3205, -10)

cell frequency: 103; at: (0, -20)

cell frequency: 104; at: (-17.3205, -10)

cell frequency: 105; at: (-17.3205, 10)

cell frequency: 106; at: (0, 20)

22

Page 24: A Simulator for Cognitive Radio

3.7.2 Line of secondary users

When introducing the secondary users, these should take the frequency of thebase station located furthest away. Of course we have to account for the shadowfading, and since neighboring cells far away yield similar strengths, the shadow-ing effect will be big.

Figure 12: A walking secondary user

In order to better explain the behavior of the system, we have set up threehistograms. You can find them in Figure 13. On the X-axis we see the frequen-cies and on the Y-axis how many times the secondary user decide to use thisfrequency.

In the first graph we can see the third secondary user, going from left toright in Figure 12. Obviously this user is placed at an equal distance from basestation with frequency 106 and 102. Accordingly, it should select these twofrequencies with equal probability (the same goes for 103 and 105). This isclear in the picture. The base station located furthest away, i.e. the one whichin average should have the weakest signal-strength should be the most favorablechoice most of the times, which is also clear. We also notice that some timesthe secondary user selects the frequencies being used by 100, 103 and 105. Thisis of course also because of the shadowing, but happens rather seldom.

In the second graph, we have instead decided to look at the secondary userbeing placed in the center of cell using 100 as frequency. Clearly by Figure 12,all other base stations are located at the same distance from this point, so thesecondary user should choose all these frequencies with equal probability. Thisis also what we see. Because it is placed on top of the base station using 100 asfrequency, this will most likely always yield a very strong signal and hence the

23

Page 25: A Simulator for Cognitive Radio

user will never (very seldom) choose this frequency.In the third, most colorful graph, what we see are all the users. Instead of

just showing one “bar” at each frequency, we see 17 bars. Each bar representsone user and the bars are ordered in such a way that the bar most to the right(at each frequency) correspond to the result of the user located most to theright in Figure 12.

Comparing Figure 13 with Figure 12, some interesting obsevrations can bemade. For example, in Figure 12, cell 103 and 105 as well as 106 and 102 shouldhave the same distributions. Cell 104 and 101 should have complementarydistributions, as well as 105 and 102, and 106 and 103. This is all confirmed inFigure 13.

24

Page 26: A Simulator for Cognitive Radio

Figure 13: Histogram. Observe that the colors in this picture are independentfrom those in Figure12

3.7.3 Change of interference for a primary user

Let us look at a setup where a primary user is walking through an environmentwith two interfering users. By printing a graph, that shows the interference at

25

Page 27: A Simulator for Cognitive Radio

each position and put it straight below the environment-picture, see Figure 14,we try to illustrate that the interference works.

Figure 14: A primary user walking horizontally through a cell with two interfer-ing secondary users. Observe that the standard deviation in the random termis set to 0, hence no “ripples” in the curve. Also note that the two interferingusers are placed different distance from the X-axis, hence the two peaks in theInterference graph are of different magnitude.

Again looking at Figure 14, there are clearly two peaks visible. The graphlooks pretty much as one could expect, with greater interference closer to asecondary user. Observe that we turned off the random factor in the propaga-tion function (putting the deviation to 0). This means that there will be no

26

Page 28: A Simulator for Cognitive Radio

shadowing at all, which gives a realistic model for free-space propagation.One should also take into consideration that in reality we would exclusively

work with systems of more than one frequency reuse. So the primary userswould never have to come this close to the secondary users, unless the secondaryuser happens to be in a very bad radio-shadow, of course. To illustrate how asimilar run would look with the standard deviation set to for example 6, whichcorresponds to a typical city scenario, look at Figure 15.

4 Results

4.1 General introduction

In [4], E. Larsson and M. Skoglund set up something similar to a simulator. Thedifference is that they do not consider an entire system, but instead just onecell (and the 6 surrounding “reuse-cells”). Besides that the system is very sim-ilar, with distance-dependent path-loss and log-normal shadow fading definedin the same way to model obstacles. They introduce some different radiuses toillustrate where secondary users are allowed to communicate. This is of coursenot an entirely realistic assumption since the secondary user never really knowswhere it is located geographically, but instead only can measure signal strengthfrom possible base stations. It would be possible to achieve the same sort ofconclusion by introducing signal to noise thresholds. The difference is that in-stead of having a real distance, we then would have to work with SNRs, whichwill vary, due to the shadowing. E. Larsson and M. Skoglund use their radiusesto decide where, how and if secondary users are allowed. We have simplifiedthis drastically by just saying that the secondary users are allowed everywhere.This will have the drawback that the system will suffer a theoretical higherinterference disturbance.

4.2 General conclusion

The general conclusions that can be drawn from these tests are:

• The test-results from the simulator corresponds well to what is expectedfrom earlier publications, here specifically with [4] taken into considera-tion.

• Simulating a real world system is complex and one will always have tomake assumptions. In the TV-system case this was particularly obvious.

• Secondary users can be implemented in the TV-system.

• Secondary users can not be implemented in the mobile phone system.

27

Page 29: A Simulator for Cognitive Radio

Figure 15: A primary user walking horizontally through a cell with two inter-fering secondary users. Observe that since the shadowing term χ ∼ N(0, 6),shadowing will lead to amplification as well as attenuation. Here, in contra-diction to the previous example, the interfering users are placed at the samedistance from the X-axis.

4.3 Verification of a paper - TV system

An interesting task for this simulator would be to let it verify the paper byErik Larsson and Mikael Skoglund [4]. If their calculations are correct and thesimulator is working properly we would get similar answers as they.

28

Page 30: A Simulator for Cognitive Radio

4.3.1 Conclusion

This simulator is not optimal for running a real-world simulation as that in-cludes base stations of different sizes. When running a test run of the backbone(i.e. ignoring the small helping base stations and only focus on the big ones),you could easily introduce secondary users transmitting at very strong powerswithout any measurable losses in primary system.

4.3.2 Introduction

In [4] it is stated that it would be possible to introduce a digital communicationsystem when the strengths are such as in the digital television system. We willassume that this is the case and try to model a working digital-TV system.When it is up and running we will introduce the secondary users transmittingwith the power strengths suggested by E. Larsson and M. Skoglund. Then wewill try to observe how much interference the secondary users cause.

4.3.3 Assumptions

We have to decide a bunch of variables. A quick look at the configuration filefor the simulator tell us what sort of variables we have to define. A dump:

ideal basestation strength:?

reuse factor:?

step radius:?

cell radius:?

cell split:?

primary users:?

secondary user transmit power:?

secondary users:?

The reuse factor (cluster size) will be set to 16, to start with. Step radiuswill be set to 2, which means we will have a total of 7 clusters of size 16. Cellsplit will be set to 1, we only want one base station in each cell.

Realistic values for the cell radius and the ideal basestation strength can befound in “Digital-TV via mark, satellit och kabel” [6]. A typical value for theUHF band (300MHz to 3GHz) is 40 kW (for UHF) in Sweden. Combine this gainwith the antenna-amplification and you will get about 1000 kW of transmission.However, as of today we are only using digital television in Sweden and thatoperates in 12 dB less power gain, i.e. 62.5 kW. The typical transmission radiusfor this set-up would be approximately 10 km.

TV-systems are a bit different from the system we have built in this sim-ulator, therefore think of this system as a system similar to the TV net. Thepropagation, see Section 2.2, between the base station and primary user (i.e.TV-transmitter and your TV-antenna at home) would have almost free-space,line-of-sight. Therefore we have chosen the propagation from base station toprimary and secondary users to have α (path loss exponent) set to 2.4 and χ to

29

Page 31: A Simulator for Cognitive Radio

have a standard-deviation of 2 [dB]. Now this is not a perfect model, as the tele-vision system normally have directed receiving antennas. The primary user tosecondary user path loss exponent and standard-deviation is set to the default4, 6 respectively.

4.3.4 System calibration

We assume, as in [4], that within the system we are working with noise-to-interference ratios within [-10 to +10] dB. Therefore we adjust the noise levelto be in average the same as the interference for the primary users. Accordingto [6], a typical TV-broadcast system has to have a receiving SNR of about 10[dB]. We have calibrated the system so as about 90% of the users have a SNRof 10 dB or better.

After calibrating the system, we get the following configuration file:

ideal basestation strength:62500

reuse factor:16

step radius:2

cell radius:9000

cell split:1

primary users:10000

secondary user transmit power:0

secondary users:0

4.3.5 Results

The resulting system looks like Figure 16, which shows the cells represented byhexagons, the base stations placed as stars in the center of each cell and primaryusers represented as dots.

The cumulative probability density function for the SNIR of this system canbe found in Figure 17.

4.3.6 Influence of secondary users

When introducing the secondary users, we noticed that the graph turns outexactly the same as Figure 17. With the suggested strengths (see Section 1.4),we get no difference what so ever on the primary system. When increasingthe secondary users transmission strength up to the same strengths as the basestations we still get no interference. Showing a figure of this is useless as theyall look exactly like Figure 17. The reason for this is that:

• The propagation function has a much bigger path loss exponent (due tomuch worse placement) set between the secondary and primary users thanthe one used between base stations and primary users.

• The reuse factor is set to 16 (which had to be used to achieve the requiredproperties), which means there are many different frequencies and the

30

Page 32: A Simulator for Cognitive Radio

Figure 16: The hexagonal system with primary users as dots and base stationsas stars.

reuse of each frequency will be placed spatially very far away from eachother.

4.3.7 Conclusions of our results

When running a test run of the backbone (i.e. ignoring the small helping basestations and only focus on the big ones), you could easily introduce secondaryusers transmitting at very strong powers without any measurable losses in theprimary system.

4.3.8 Comments on the simulation and model

A valid question now would be if the results achieved in this test run are reallyrepresentative for reality. To the commonly big TV-antennas in your home,directed to the appropriate base station and placed outside you would probablyhave a good connection even in a noisy environment, as is the case here.

We have assumed that the base stations are perfectly placed in a hexagonalgrid and that the distances are big. This would probably correspond to the mainbase stations (“backbone”) in a real environment (see for example the frequencymaps from [7] in Figure 8). However, the net is also layered with smaller basestations transmitting at less strength and with smaller distances. If you wereconnected with one of those you would probably be much easier interfered with

31

Page 33: A Simulator for Cognitive Radio

Figure 17: The cumulative probability density function for the SNIR of thissystem.

the secondary net and also have worse propagation properties due to not asgood placement of the smaller base stations.

The conclusion has to be that in order to fully simulate the TV-net the sim-ulator would need additional improvements with directed antennas and multiplesystem grids. We would also need more insight of real world characteristics ofthe system.

4.4 Running a simulation on the GSM net

We will here, just as in Section 4.3, run a similar test but this time on thecellular network of the GSM net.

4.4.1 Introduction

In a modern society, the frequencies used by the GSM and similar systems arehighly interesting because of their good physical properties, see Section 1.2.1.It is therefore interesting to consider the possibility of introducing secondaryusers in this band. The common belief (for example [4], [12]) is that this is hardto manage.

32

Page 34: A Simulator for Cognitive Radio

4.4.2 Conclusion

It seems that introducing secondary users in the primary system of a GSM netwould not be possible. This is due to bad propagation properties between basestation and primary users and too small distances in the urban areas.

4.4.3 Assumptions

We assume a simplification of the cellular GSM system where all base stationsare of the same size and use the same transmit power. This is something similarto what you will find in high-density populated areas. We will also assume thatthey are all transmitting omnidirectional.

4.4.4 System calibration

This test is much simpler to run than the previous (TV). The main reason forthis is that we will not have to introduce different propagation parameters fordifferent propagation path’s, but instead just assume that all propagation areset to α = 4 and χ ∼ N(0, 6) (see Section 2.2).

Besides that, we set the parameters as:ideal basestation strength:1.6

cluster size:7

step radius:3

cell radius:300

cell split:1

primary users:10000

secondary user transmit power:0

secondary users:0

After running this one time, we set the internal noise floor for the users tobe in the order of the interference, to get noise-to-interference in magnitudes ofabout 0 dB (in real systems chosen somewhere between -10 and 10 dB).

4.4.5 Results

The system looks as in Figure 18. As noticed here we have changed the stepradius to 3, because the cluster size is smaller in this case than in the previousand we still want to cover a reasonable big area. This could be thought of as abig neighborhood in the city, but also an entire city of smaller size.

Before the introduction of the secondary users, the cumulative pdf looks asFigure 19, where what is above the 10’th percentile is the important part.

33

Page 35: A Simulator for Cognitive Radio

Figure 18: A picture of the system with primary users.

Figure 19: The cumulative probability density function for the SNIR of theGSM system.

34

Page 36: A Simulator for Cognitive Radio

4.4.6 Influence of secondary users

We change the last two lines in the configuration file to introduce the secondaryusers:... secondary user transmit power:0.016

secondary users:10000

10000 secondary users in a system with 10000 primary users may seem quitea lot. Therefore we have run the simulation for 0, 100, 1000, 5000 and 10000secondary users as well, only changing the last line of the configuration file. Thecorresponding graphs are placed in the same diagram (Figure 20). It is obviousthat each secondary user added to the system contributes to a decrease in thenetwork performance.

Figure 20: The cumulative probability density function for the SNIR of theGSM system after introduction of secondary users. From left to right we seethe graph produced by 10000, 5000, 1000, 100 and 0 secondary users.

The secondary users are transmitting at a power of 0.016 W. This is about1/10 of modern base stations transmission effect of your home wifi system. Thiswould theoretically then give a transmission range of up to approximately 6-8meters, suitable for wireless devices for your computer, mobile phone, etc.

35

Page 37: A Simulator for Cognitive Radio

4.4.7 Discussion

As we can see in Figure 20 we go from 90% of the users with good enoughconnection (SNR of 10 dB) to 61% (10000 secondary users). This means thatinstead of 10% of the users talking in their mobile having some sort of troublewith the connection we get 39%. This is obviously not acceptable. However, wealso see that when having as few as 100 secondary users, the overall networksuffers very little loss in performance. The general conclusion would be thatsecondary users in the GSM net should not be allowed. However, if the marketis strong for these frequencies we could probably allow some secondary users(up to about 1% of the amount of primary users), to a high price and high cost.

4.4.8 Possible improvements

Is there anything we could do to improve the results? Obvious things would belike increasing base station strengths, decreasing cell sizes, increasing reuse factoror make use of cell splitting. The base stations are probably already transmit-ting at the highest allowable value and to relocate all the base stations in a citywould probably be very expensive. What could rather be done is be to increasethe reuse factor and split the cells in multiple sectors. This would mean that theprimary service provider have to upgrade their already existing base stations aswell as buying more frequencies to use in their system. To illustrate this, wechanged the following parameters of the worst system run (the one with 10000secondary users):... cluster size:14

... cell split:3

...

The resulting graph turns out as Figure 21. Obviously we get another 9% oftotal amount of users back, which is an improvement of 9/39 = 23%. Althoughthese changes are some that could be done by the primary system, it is ques-tionable if the provider is ready to actually do them. It does however show thatthere are many parameters playing a role in the final performance and outcomeof the system and all of these parameters have to be taken into account.

4.5 Conclusion

It seems this simulator works as expected. It is however not at the momentoptimized to simulate the television net. This is also not completely surprisingas it was first built to simulate cellular networks more similar to the one of theGSM net.

5 Future work

A technical list of things that could be implemented in the simulator for betteruse in the future:

36

Page 38: A Simulator for Cognitive Radio

Figure 21: The cumulative probability density function for the modified system,showing the graph of 10000 users.

• Finalize the implementation of antenna diagrams. Both at transmitterand receiver.

• Implement thresholds for sensing in low SNR environments.

• Implement tool-kits for different sorts of user placement and secondaryuser placement.

• Would it be possible to dynamically generate an operational system where“main” base stations are placed together with helping ones (as in theTV-case in this report) in such a way as to achieve a certain coveragepercentage?

• Implement functionality for layered networks.

• Implement features from Wireless Sensor Networks.

• Implement the functions of ad-hoc networks.

It would also be interesting to run simulations for different sort of areas.It would be interesting to see how cognitive radios implemented in rural areas,i.e. the countryside perform. Cognitive radios would here probably be mostlydeployed for scientific use in measurement equipment, for example in differentsensor network technologies.

37

Page 39: A Simulator for Cognitive Radio

6 Summary and conclusions

In this thesis we have seen the development of a simulator constructed to dosimulations on cellular networks. It has been constructed with the particulargoal to model the interference an introduction of cognitive users will have onthe primary system.

We have seen how this simulator can be built up in an object-oriented pro-gramming environment, with the specific objects being described in detail. Wehave also shown that the simulator actually does what it is supposed to do withvarious test, giving pictures and graphs. In the later parts of the report we alsodemonstrated how changes in parameters, such as cluster-size and sectorizingin the base stations can easily be made and effect our results.

In the end we have put the simulator to a real test by trying to emulatedifferent reality scenarios. It has been seen that the concept of cognitive radioscould be implemented in communication systems similar to the TV-system, butprobably not, with today’s technology, in the GSM-system.

References

[1] R. W. Brodersen, A. Wolisz, D. Cabric, S. M. Mishra, and D. Willkomm,“Corvus: A cognitive radio approach for usage of virtual unlicensed spec-trum,” 2004.

[2] J. Mitola, “Cognitive radio: An integrated agent architecture for softwaredefined radio,” Ph.D. dissertation, KTH, Royal Institute of Technology,Sweden, 2000.

[3] R. Tandra and A. Sahi, “Fundamental limits on detection in low snr undernoise uncertainty,” WirelessCom, June 2005.

[4] E. G. Larsson and M. Skoglund, “Cognitive radio in a frequency plannedenvironment: Some basic limits,,” 2007.

[5] J. Modzel, http://www.codeproject.com/useritems/hexagonal part1.asp.

[6] M. Rojne, Digital-TV, via mark, satellit och kabel, 2nd ed. Studentlitter-atur, 2006.

[7] Teracom webpage, http://www.teracom.se/.

[8] Health Protection Agency, http://www.hpa.org.uk/radiation/understand/information sheets/mobile telephony/base stations.htm.

[9] T. S. Rappaport, Wireless Communications: Principles and Practice.Prentice hall ptr, 2001.

[10] L. S. Golding, “Satellite communications systems move into the twenty-firstcentury,” 1998.

38

Page 40: A Simulator for Cognitive Radio

[11] IT++ - A c++ library, http://itpp.sourceforge.net/.

[12] N. Hoven and A. Sahai, “Power scaling for cognitive radio.”

39

Page 41: A Simulator for Cognitive Radio

7 Appendix A

This is the code generating a walking primary user and how it is affected by thetwo secondary users:#include <iostream>#include <itpp/itbase.h>#include <fstream>#include <string>

#include "h_system.h"#include "h_cell.h"#include "drawing.h"

using namespace std;using namespace itpp;using namespace sim;

int main(){H_system hsys;cout << "Simulator program for cognitive radio.\n";hsys.set_reuse(0);hsys.set_steps(1);double radius = 10.0;hsys.set_cell_radius(radius);hsys.set_cell_split(3);hsys.set_ideal_BS_strength(100.0);hsys.set_cells();hsys.set_suser_txp(100.0);hsys.set_nf(1);

double start_x = 0;double start_y = 0;for(double r = -radius-radius/10; r <= radius+radius/10; r+=(radius+radius/10)/90){hsys.place_user_at(start_x + r, start_y);}

// Place a malicious secondary user in the top right corner.//hsys.set_susers(2);hsys.place_secondary_user_at(start_x - 3*radius/4, start_y + radius/2);// hsys.place_secondary_user_at(start_x + 3*radius/4, start_y - radius/2 - radius/10);

cout << "\nSecondary user frequency: " << hsys.secondary_users.at(0).get_tx_freq();

cout << "\nPrimary users from bottom left up to top right: \n";

for(int i = 0; i < hsys.users.size(); i++){cout << "DL frequency: " << hsys.users.at(i).BS->get_tx_freq() << ";\n";cout << "Signal strength: " << hsys.get_signal(&hsys.users.at(i)) << ";\n";cout << "Interference: " << hsys.get_interference(&hsys.users.at(i)) << ";\n\n";}

cout << "\n";

for(int i = 0; i<hsys.nodes.size(); i++){cout << "cell frequency: " << hsys.nodes.at(i).get_freq(0) << "; at: (" << hsys.nodes.at(i).get_pos(radius).get_x() << ", " << hsys.nodes.at(i).get_pos(radius).get_y() << ")\n";}

hsys.display_sys();hsys.wo_sni("sni.txt");

return 0;

}

40

Page 42: A Simulator for Cognitive Radio

41

Page 43: A Simulator for Cognitive Radio

8 Appendix B

The code for placing 7 base stations and see how the primary users connect tothe right base station.#include <iostream>#include <itpp/itbase.h>#include <fstream>#include <string>#include "h_system.h"#include "h_cell.h"#include "drawing.h"

using namespace std;using namespace itpp;using namespace sim;

int main(){H_system hsys;cout << "Simulator program for cognitive radio.\n";hsys.set_reuse(7);hsys.set_steps(1);double radius = 10.0;hsys.set_cell_radius(radius);hsys.set_cell_split(1);hsys.set_ideal_BS_strength(100.0);hsys.set_cells();hsys.set_suser_txp(100);

double start_x = -radius*3*cos(pi/6);double start_y = -radius*3*sin(pi/6);for(double r = radius/2; r < 6*radius; r+=radius/2){hsys.place_user_at(start_x + r*cos(pi/6), start_y + r*sin(pi/6));}

// remove the three ones at top of the base stationhsys.users.erase(hsys.users.begin() + 9, hsys.users.begin() + 10);hsys.users.erase(hsys.users.begin() + 5, hsys.users.begin() + 6);hsys.users.erase(hsys.users.begin() + 1, hsys.users.begin() + 2);

// Place a malicious secondary user in the top right corner.hsys.place_secondary_user_at(start_x + 6*radius*cos(pi/6), start_y + 6*radius*sin(pi/6));

cout << "\nSecondary user frequency: " << hsys.secondary_users.at(0).get_tx_freq();

cout << "\nPrimary users from bottom left up to top right: \n";

for(int i = 0; i < hsys.users.size(); i++){cout << "DL frequency: " << hsys.users.at(i).BS->get_tx_freq() << ";\n";cout << "Signal strength: " << hsys.get_signal(&hsys.users.at(i)) << ";\n";cout << "Interference: " << hsys.get_interference(&hsys.users.at(i)) << ";\n\n";}

cout << "\n";

for(int i = 0; i<hsys.nodes.size(); i++){cout << "cell frequency: " << hsys.nodes.at(i).get_freq(0) << "; at: (" << hsys.nodes.at(i).get_pos(radius).get_x() << ", " << hsys.nodes.at(i).get_pos(radius).get_y() << ")\n";}

hsys.display_sys();

42

Page 44: A Simulator for Cognitive Radio

return 0;

}

43

Page 45: A Simulator for Cognitive Radio

9 Appendix C

The code where a line of secondary users are placed, to show that they chosethe same frequency as the base station “furthest” away.

#include <iostream>#include <itpp/itbase.h>#include <fstream>#include <string>

#include "h_system.h"#include "h_cell.h"#include "drawing.h"

using namespace std;using namespace itpp;using namespace sim;

int main(){

cout << "Simulator program for cognitive radio.\n";mat data;for(int k=0; k<20000; k++)

{// cout << k;H_system hsys;hsys.set_reuse(7);hsys.set_steps(1);double radius = 10.0;hsys.set_cell_radius(radius);hsys.set_cell_split(1);hsys.set_ideal_BS_strength(100.0);hsys.set_cells();

hsys.set_users(1,1);

// Place a line of secondary users. Lets say 6 in each cell, going in direction 3 at 195 degrees and 3 in 15 degrees.double start_x = -radius*3*cos(pi/6);double start_y = -radius*3*sin(pi/6);for(double r = radius/3; r < 6*radius; r+=radius/3)

{hsys.place_secondary_user_at(start_x + r*cos(pi/6), start_y + r*sin(pi/6));

}

// cout << "\nSecondary users from bottom left up to top right have frequencies: ";vec v1;for(int i = 0; i < hsys.secondary_users.size(); i++)

{//stringstream t;//t << hsys.secondary_users.at(i).get_tx_freq();//string t2;//t >> t2;//temp.append(t2);//temp.append(" ");v1.ins(i,hsys.secondary_users.at(i).get_tx_freq());

}

data.append_row(v1);

//cout << "\n";

/*for(int i = 0; i<hsys.nodes.size(); i++){

cout << "cell frequency: " << hsys.nodes.at(i).get_freq(0) << "; at: (" << hsys.nodes.at(i).get_pos(radius).get_x() << ", " << hsys.nodes.at(i).get_pos(radius).get_y() << ")\n";

44

Page 46: A Simulator for Cognitive Radio

} */}

//hsys.display_sys();

// Declare the it_file classit_file ff;

// Open a file with the name "it_file_test.it"ff.open("suser_walk.it");

// Put the variable a into the file. The Name("a") tells the file class// that the next variable shall be named "a".ff << Name("data") << data;

// Force the file to be written to disc. This is useful when performing// iterations and ensures that the information is not stored in any cache// memory. In this simple example it is not necessary to flush the file.ff.flush();

// Close the fileff.close();

return 0;

}

45

Page 47: A Simulator for Cognitive Radio

10 Appendix D

In the following pages you will find the code manual generated by doxygen fromcomments out of the code.

46

Page 48: A Simulator for Cognitive Radio

Referen e ManualGenerated by Doxygen 1.5.1Fri De 21 12:39:39 2007

Page 49: A Simulator for Cognitive Radio
Page 50: A Simulator for Cognitive Radio

Contents1 Namespa e Index 11.1 Namespa e List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Hierar hi al Index 32.1 Class Hierar hy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Class Index 53.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Namespa e Do umentation 74.1 sim Namespa e Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Class Do umentation 95.1 sim::Antenna Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95.2 sim::Base_station Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . 125.3 sim::�gure Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.4 sim::H_ ell Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.5 sim::H_system Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.6 sim::pos Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.7 sim::Primitive_devi e Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . 325.8 sim::propagation Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345.9 sim::User Class Referen e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Page 51: A Simulator for Cognitive Radio
Page 52: A Simulator for Cognitive Radio

Chapter 1Namespa e Index1.1 Namespa e ListHere is a list of all do umented namespa es with brief des riptions:sim (Namespa e sim is used as a ontainer for the entire simulator ) . . . . . . . . . . . 7

Page 53: A Simulator for Cognitive Radio

2 Namespa e Index

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 54: A Simulator for Cognitive Radio

Chapter 2Hierar hi al Index2.1 Class Hierar hyThis inheritan e list is sorted roughly, but not ompletely, alphabeti ally:sim::Antenna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9sim::�gure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16sim::H_ ell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17sim::H_system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21sim::pos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29sim::Primitive_devi e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32sim::Base_station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12sim::User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37sim::propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Page 55: A Simulator for Cognitive Radio

4 Hierar hi al Index

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 56: A Simulator for Cognitive Radio

Chapter 3Class Index3.1 Class ListHere are the lasses, stru ts, unions and interfa es with brief des riptions:sim::Antenna (An antenna ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9sim::Base_station (A Base_station (p. 12) is a devi e that an transmit and re eive ) 12sim::�gure (The �gure lass is a "drawing" obje t ) . . . . . . . . . . . . . . . . . . . . 16sim::H_ ell (Hexagonal ell ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17sim::H_system (Hexagonal system ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21sim::pos (A helper lass for easy position handling ) . . . . . . . . . . . . . . . . . . . . 29sim::Primitive_devi e (A primitive devi e ontains one or many antennas ) . . . . . 32sim::propagation (A propagation lass is an obje t that is used as model for real worldradio propagation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34sim::User (A user is a devi e that an transmit and re ieve ) . . . . . . . . . . . . . . . 37

Page 57: A Simulator for Cognitive Radio

6 Class Index

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 58: A Simulator for Cognitive Radio

Chapter 4Namespa e Do umentation4.1 sim Namespa e Referen eNamespa e sim is used as a ontainer for the entire simulator.Classes� lass AntennaAn antenna.� lass Base_stationA Base_station (p. 12) is a devi e that an transmit and re eive.� lass propagationA propagation lass is an obje t that is used as model for real world radio propagation.� lass posA helper lass for easy position handling.� lass �gureThe �gure lass is a "drawing" obje t.� lass H_ ellHexagonal ell.� lass H_systemHexagonal system.� lass Primitive_devi eA primitive devi e ontains one or many antennas.� lass UserA user is a devi e that an transmit and re ieve.

Page 59: A Simulator for Cognitive Radio

8 Namespa e Do umentationFun tions� double abs1 (double x)4.1.1 Detailed Des riptionNamespa e sim is used as a ontainer for the entire simulator.Its main purpose is to group the important fun tions together and let me implement my ownversions of ommonly named fun tions.

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 60: A Simulator for Cognitive Radio

Chapter 5Class Do umentation5.1 sim::Antenna Class Referen eAn antenna.#in lude <antenna.h>Publi Member Fun tions� Antenna ()Create an antenna with unspe i�ed Power.� Antenna (double txp, double d, double s)Constru t an antenna with an ideal transmit power and a dire tion and a span.� ∼Antenna ()The destru tor.� void set_tx_pwr (double tx)Set the transmit Power.� double get_tx_pwr (double angle)Get the transmit Power.� void set_angle (double dir)Set the dire tion of the antenna.� double get_angle (void)Get the dire tion of transmission.� void set_span (double s)Set the span-width of the antenna.� double get_span (void)Get the span-width of the Antenna (p. 9).

Page 61: A Simulator for Cognitive Radio

10 Class Do umentation� double a_diagram (double angle)The antenna diagram.� void print_antenna (double x, double y, �gure &f)A fun tion writing values to the �gure f that an be written to a �le and viewed as a pi ture inmatlab.5.1.1 Detailed Des riptionAn antenna.The antenna obje t is reated mostly for future use. With this lass it will be easy to implementso�sti ated antenna diagrams and sidelobe fun tions. For the moment hovewer these are rathersimple.5.1.2 Constru tor & Destru tor Do umentation5.1.2.1 Antenna::Antenna (double txp, double d, double s)Constru t an antenna with an ideal transmit power and a dire tion and a span.Parameters:txp The ideal transmission power.d The dire tion of the antenan.s The span of the antenna.5.1.3 Member Fun tion Do umentation5.1.3.1 void Antenna::set_tx_pwr (double tx)Set the transmit Power.Parameters:tx The transmit power.5.1.3.2 double Antenna::get_tx_pwr (double angle)Get the transmit Power.Returns:The transmit power.5.1.3.3 void Antenna::set_angle (double dir)Set the dire tion of the antenna.Parameters:dir dire tion in radians. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 62: A Simulator for Cognitive Radio

5.1 sim::Antenna Class Referen e 115.1.3.4 double Antenna::get_angle (void)Get the dire tion of transmission.Returns:The dire tion in radians5.1.3.5 void Antenna::set_span (double s)Set the span-width of the antenna.Parameters:the span in radians.5.1.3.6 double Antenna::get_span (void)Get the span-width of the Antenna (p. 9).Returns:The span in radians.5.1.3.7 double Antenna::a_diagram (double angle)The antenna diagram.Currently not in use. Could be developed to form an antenna diagram.Parameters:The angle.Returns:The gain between 0 to 1 to be multiplied with a gain.5.1.3.8 void Antenna::print_antenna (double x, double y, �gure & f)A fun tion writing values to the �gure f that an be written to a �le and viewed as a pi ture inmatlab.Parameters:x The x- oordinate of where to start.y The y- oordinate of where to start.f The �gure where to write the information.The do umentation for this lass was generated from the following �les:� antenna.h� antenna. ppGenerated on Fri De 21 12:39:39 2007 by Doxygen

Page 63: A Simulator for Cognitive Radio

12 Class Do umentation5.2 sim::Base_station Class Referen eA Base_station (p. 12) is a devi e that an transmit and re eive.#in lude <base_station.h>Inheritan e diagram for sim::Base_station::sim::Base_station

sim::Primitive_device

Publi Member Fun tions� Base_station ()A onstru tor to onstru t an empty base station.� Base_station (pos &position, double txp, int tfq)A onstru tor to reate a base station with a uniform transmission spe trum.� Base_station (pos &position, double txp, int tfq, double angle, double span)A onstru tor to reate a base station with limited transmission angle and span.� ∼Base_station ()The destru tor.� void set_tx_freq (int txf)Set the transmission frequen y of the base station.� int get_tx_freq (void)Get the transmit power.� void set_span (double s)Set the span of transmission range.� double get_span (void)Get the span of the transmission range.� void set_angle (double a)Set the angle of transmission.� double get_angle (void)Get the angle of transmission.� void set_tx_pwr (double pwr)Set the transmit power.� double get_tx_pwr (double angle) Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 64: A Simulator for Cognitive Radio

5.2 sim::Base_station Class Referen e 13Get the transmit power in a ertain angle.� double get_tx_pwr (void)Get the transmit power.� void draw_antenna_diagram (void)Draw information on erning the antenna and transmission to stdout.� void print_basestation (�gure &f)A fun tion writing ne essary information to the �gure f, in order to make pi tures in matlab.5.2.1 Detailed Des riptionA Base_station (p. 12) is a devi e that an transmit and re eive.It has one antenna obje t and also short- uts to rea h the antenna obje ts span and dire tions.5.2.2 Constru tor & Destru tor Do umentation5.2.2.1 Base_station::Base_station (pos & position, double txp, int tfq)A onstru tor to reate a base station with a uniform transmission spe trum.Parameters:pos The position of the base station.txp The transmission power of the base station.tfq The transmission frequen y of the base station.5.2.2.2 Base_station::Base_station (pos & position, double txp, int tfq, doubleangle, double span)A onstru tor to reate a base station with limited transmission angle and span.Transmission is from angle to angle + span.Parameters:pos The position of the base station.txp The transmission power of the base station.tfq The transmission frequen y of the base station.angle The angle of the transmission start.span The span of the transmission view.5.2.3 Member Fun tion Do umentation5.2.3.1 void Base_station::set_tx_freq (int txf)Set the transmission frequen y of the base station.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 65: A Simulator for Cognitive Radio

14 Class Do umentationParameters:txf set the transmit frequen y5.2.3.2 int Base_station::get_tx_freq (void)Get the transmit power.Returns:The transmit frequen y.5.2.3.3 void Base_station::set_span (double s)Set the span of transmission range.Parameters:s the span in radians.5.2.3.4 double Base_station::get_span (void)Get the span of the transmission range.Returns:The span in radians.5.2.3.5 void Base_station::set_angle (double a)Set the angle of transmission.The transmission range will be angle to angle + span.Parameters:a The angle in radians.5.2.3.6 double Base_station::get_angle (void)Get the angle of transmission.The transmission range is angle -> angle+span.Returns:The angle in radians. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 66: A Simulator for Cognitive Radio

5.2 sim::Base_station Class Referen e 155.2.3.7 void Base_station::set_tx_pwr (double pwr)Set the transmit power.Parameters:pwr The transmit power.5.2.3.8 double Base_station::get_tx_pwr (double angle)Get the transmit power in a ertain angle.Parameters:angle The angle of requested transmission gain.Returns:The gain.5.2.3.9 double sim::Base_station::get_tx_pwr (void)Get the transmit power.DEPRICATED.Returns:The ideal onstant gain.5.2.3.10 void Base_station::draw_antenna_diagram (void)Draw information on erning the antenna and transmission to stdout.DEPRICATED.5.2.3.11 void Base_station::print_basestation (�gure & f)A fun tion writing ne essary information to the �gure f, in order to make pi tures in matlab.Parameters:f The �gure obje t.See also:�gure (p. 16).The do umentation for this lass was generated from the following �les:� base_station.h� base_station. ppGenerated on Fri De 21 12:39:39 2007 by Doxygen

Page 67: A Simulator for Cognitive Radio

16 Class Do umentation5.3 sim::�gure Class Referen eThe �gure lass is a "drawing" obje t.#in lude <drawing.h>Publi Member Fun tions� int write (std::string s)� int write_ ells (std::string s)� int write_antennas (std::string s)� int write_users (std::string s)� int write_susers (std::string s)� int write_BS (std::string s)� int write_sni (std::string s)Publi Attributes� itpp::mat ant_span1_x� itpp::mat ant_span1_y� itpp::mat signal� itpp::mat noise� itpp::mat interferen e� itpp::mat ant_dia_x� itpp::mat ant_dia_y� itpp::mat BS_pos_x� itpp::mat BS_pos_y� itpp::mat ell_border_x� itpp::mat ell_border_y� itpp::mat P_user_x� itpp::mat P_user_y� itpp::mat S_user_x� itpp::mat S_user_y� itpp::mat SNIR5.3.1 Detailed Des riptionThe �gure lass is a "drawing" obje t.Other obje ts an store information in it that an later be written to a �le by the �gure obje titself. This �le in turn is made in su h a way that it an be read my matlab (and/or o tave) andgraphs an be made for realization.The do umentation for this lass was generated from the following �le:� drawing.hGenerated on Fri De 21 12:39:39 2007 by Doxygen

Page 68: A Simulator for Cognitive Radio

5.4 sim::H_ ell Class Referen e 175.4 sim::H_ ell Class Referen eHexagonal ell.#in lude <h_ ell.h>Publi Member Fun tions� H_ ell ()A onstru tor for an empty ell.� H_ ell (int k, int l, double radius, int split, int nr, double bs_strength)Another onstru tor, for a ell with attributes.� ∼H_ ell ()The destru tor.� int get_k (void)Get the oordinate for the horizontal axis ("x").� int get_l (void)Get the oordinate for the verti al axis ("y").� bool get_even (void)Get even.� int get_freq (double angle)Get frequen y.� double get_tx_pwr (double angle)Get the transmit power.� void generate_basestations (int split, int nr, double radius, double bs_strength)Generate the basestation within the ell.� void print_ ell (double radius, �gure &f)A fun tion that writes ell information to a �gure.� pos get_pos (double radius)Get the position of the ell.� Base_station ∗ get_bs (double angle)A fun tion to get a pointer to the base station working in a ertain angle.5.4.1 Detailed Des riptionHexagonal ell.This obje t is simple but also important. It has 1, 3 or 6 Base_stations and knows its position inthe hexagonal grid (k,l).Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 69: A Simulator for Cognitive Radio

18 Class Do umentation5.4.2 Constru tor & Destru tor Do umentation5.4.2.1 H_ ell::H_ ell (int k, int l, double radius, int split, int nr, doublebs_strength)Another onstru tor, for a ell with attributes.Parameters:k the "x-position" in the virtual matrixl the "y-position" in the virtual matrixx the a tual x- oordinatey the a tual y- oordinatenr the basestation-number, ie a substitute for frequen y5.4.3 Member Fun tion Do umentation5.4.3.1 int sim::H_ ell::get_k (void) [inline℄Get the oordinate for the horizontal axis ("x").Returns:The k- oordinate.5.4.3.2 int sim::H_ ell::get_l (void) [inline℄Get the oordinate for the verti al axis ("y").Returns:The l- oordinate.5.4.3.3 bool sim::H_ ell::get_even (void) [inline℄Get even.Returns true if the ell is an even ell.Returns:1 if the node is an even one.5.4.3.4 int H_ ell::get_freq (double angle)Get frequen y.Sin e the ell has 1, 3 or 6 base stations with di�erent transmission frequen ies, you have to supplywith the angle to where you are interested. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 70: A Simulator for Cognitive Radio

5.4 sim::H_ ell Class Referen e 19Parameters:angle The angle in whi h you are interested of freque y.Returns:The frequen y of the basestation in this ell in the dire tion of the angle.5.4.3.5 double H_ ell::get_tx_pwr (double angle)Get the transmit power.Sin e the transmission power is di�erent in di�erent dire tions from the ell, you have to supplywith the angle.Parameters:angle The angle of interest.Returns:The transmission gain in requested angle.5.4.3.6 void H_ ell::generate_basestations (int split, int nr, double radius, doublebs_strength)Generate the basestation within the ell.This is a " onstru tor fun tion". Should it be made private?Parameters:split The number of base stations in the ell.nr The number of this ell.radius The radius of the ell.bs_strength The ideal base station strength.5.4.3.7 void H_ ell::print_ ell (double radius, �gure & f)A fun tion that writes ell information to a �gure.Parameters:radius The radius of the ell.f The �gure where you want to store the information.5.4.3.8 pos H_ ell::get_pos (double radius)Get the position of the ell.Parameters:radius The radius of the ells.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 71: A Simulator for Cognitive Radio

20 Class Do umentationReturns:pos The position.5.4.3.9 Base_station ∗ H_ ell::get_bs (double angle)A fun tion to get a pointer to the base station working in a ertain angle.Parameters:angle The angle of interestReturns:A pointer to the base station working in requested angle.The do umentation for this lass was generated from the following �les:� h_ ell.h� h_ ell. pp

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 72: A Simulator for Cognitive Radio

5.5 sim::H_system Class Referen e 215.5 sim::H_system Class Referen eHexagonal system.#in lude <h_system.h>Publi Member Fun tions� H_system ()Create a blank obje t.� ∼H_system ()The destru tor.� int get_reuse (void)Get the reuse fa tor.� int set_reuse (int n)Set the reuse fa tor.� int get_steps (void)Get the steps.� int set_steps (int s)Set the steps.� double get_ ell_radius (void)Get the radius of all ells.� int set_ ell_radius (double r)Set the radius of all ells.� int get_ ell_split (void)Get the ell split.� int set_ ell_split (int e)Set the ell split.� int set_ideal_BS_strength (double s)Set the ideal transmission strength at the base station [W℄.� double get_ideal_BS_strength (void)Get the ideal base station strength [W℄.� int set_ ells (int r, int st, double rad, int sp, double str)You an set and pla e the ells with this " ell onstru or ommand".� int set_ ells (void)If you have set all the variables on erning the ell, you an pla e them with this method.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 73: A Simulator for Cognitive Radio

22 Class Do umentation� int get_user_ ount (void)Get the number of users.� int set_users (int nr, double nf)Set the users.� int set_nf (double n)Set the noise �oor for all users.� double get_nf (void)Get the noise �oor for the users of the system.� int get_suser_ ount (void)Get the number of se ondary users.� int set_susers (int nr)Set the se ondary users.� int set_suser_txp (double txp)Set the se ondary-user transmit power.� double get_suser_txp (void)Get the se ondary-user transmit power.� void display_sys (void)A fun tion produ ing an all.txt ontaining variables for drawing the system in matlab.� int wo_users (std::string �lename)A fun tion to print only the users NOT IN USE.� int wo_ ells (std::string �lename)A fun tion to print only the ells NOT IN USE.� int wo_sni (std::string �lename)Write the variables signal, noise and interferen e to a �le.� double get_interferen e (User ∗u)Return the interferen e an User (p. 37) experien e.� void pla e_user_at (double x, double y)Pla e a user at a given x, y oordinate.� void pla e_se ondary_user_at (double x, double y)Pla e a se ondary user at a given x, y oordinate.� double get_signal (User ∗u)Get the signal-strength a primary user is experien ing.� void reate_blob_of_p_users (double size, pos p, double nr_of_usrs)Create a blob of users spread gaussianus. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 74: A Simulator for Cognitive Radio

5.5 sim::H_system Class Referen e 23Publi Attributes� std::ve tor< User > se ondary_usersA ve tor ontaining the se ondary users.� std::ve tor< H_ ell > nodesA ve tor ontaining the hexagonal ells.� std::ve tor< User > usersA ve tor ontaining the primary users.5.5.1 Detailed Des riptionHexagonal system.This is the main obje t whi h is a ontainer for all other obje ts. It also ontains a mathemati alfun tions and advan ed algorithms for pla ing primary and se ondary users, base stations, h_ ellsand mu h more.5.5.2 Constru tor & Destru tor Do umentation5.5.2.1 H_system::H_system ()Create a blank obje t.Remember that you have to set the values before you an do anything with it.5.5.3 Member Fun tion Do umentation5.5.3.1 int H_system::get_reuse (void)Get the reuse fa tor.Returns:The reuse fa tor (N = i∗i + i∗j + j∗j).5.5.3.2 int H_system::set_reuse (int n)Set the reuse fa tor.Parameters:n The reuse fa tor (N = i∗i + i∗j + j∗j).Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 75: A Simulator for Cognitive Radio

24 Class Do umentation5.5.3.3 int H_system::get_steps (void)Get the steps.The steps are the "radius" of the system. 1 means 1 transmitting antenna at ea h frequen y. 2means 7 transmitting antennas at ea h frequen y. This is how many times you pla e the "group"of h_ ells times 7. The size of the group is the same value as the reuse fa tor, so reuse 7 means 7 ells in one group, if then steps is set to 2, you will pla e 7 ∗ 2 ∗ 7 ells.Returns:The number of steps. Normally 1, 2 or 3.5.5.3.4 int H_system::set_steps (int s)Set the steps.The steps are the "radius" of the system. 1 means 1 transmitting antenna at ea h frequen y. 2means 7 transmitting antennas at ea h frequen y. This is how many times you pla e the "group"of h_ ells times 7. The size of the group is the same value as the reuse fa tor, so reuse 7 means 7 ells in one group, if then steps is set to 2, you will pla e 7 ∗ 2 ∗ 7 ells.Parameters:s Number of steps.5.5.3.5 double H_system::get_ ell_radius (void)Get the radius of all ells.Returns:The radius.5.5.3.6 int H_system::set_ ell_radius (double r)Set the radius of all ells.Parameters:r The radius.5.5.3.7 int H_system::get_ ell_split (void)Get the ell split.This is in how many se tors ea h ell is divided into.Returns:The ell split value (1, 3 or 6). Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 76: A Simulator for Cognitive Radio

5.5 sim::H_system Class Referen e 255.5.3.8 int H_system::set_ ell_split (int e)Set the ell split.This is in how many se tors ea h ell is divided into.Parameters:e The ell split value (1, 3 or 6).5.5.3.9 int H_system::set_ideal_BS_strength (double s)Set the ideal transmission strength at the base station [W℄.Parameters:s The strength [W℄.5.5.3.10 double H_system::get_ideal_BS_strength (void)Get the ideal base station strength [W℄.Can be seen as the power put into the base station.Returns:The strength [W℄.5.5.3.11 int H_system::set_ ells (int r, int st, double rad, int sp, double str)You an set and pla e the ells with this " ell onstru or ommand".Parameters:r The ell reuse fa tor.st The number of steps of the system.rad The ell radius.sp The ell split.str The strength of the BS in ell.See also:set_ ells() (p. 25).5.5.3.12 int H_system::set_ ells (void)If you have set all the variables on erning the ell, you an pla e them with this method.See also:set_ ells(int r, int st, double rad, int sp, double str) (p. 25).Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 77: A Simulator for Cognitive Radio

26 Class Do umentation5.5.3.13 int H_system::get_user_ ount (void)Get the number of users.Returns:The number of users in the system.5.5.3.14 int H_system::set_users (int nr, double nf)Set the users.Pla e the required number of users.Parameters:nr The number of users.nf The noise-�oor of the users.5.5.3.15 int H_system::set_nf (double n)Set the noise �oor for all users.Must be done before set_users() (p. 26).Parameters:n The noise �oor.5.5.3.16 double H_system::get_nf (void)Get the noise �oor for the users of the system.Returns:The noise �oor.5.5.3.17 int H_system::get_suser_ ount (void)Get the number of se ondary users.Returns:The number of se ondary users.5.5.3.18 int H_system::set_susers (int nr)Set the se ondary users.Parameters:nr The number of se ondary users to put in the system.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 78: A Simulator for Cognitive Radio

5.5 sim::H_system Class Referen e 275.5.3.19 int H_system::set_suser_txp (double txp)Set the se ondary-user transmit power.Parameters:txp transmit power.5.5.3.20 double H_system::get_suser_txp (void)Get the se ondary-user transmit power.Returns:The transmit power.5.5.3.21 int sim::H_system::wo_sni (std::string �lename)Write the variables signal, noise and interferen e to a �le.Parameters:�lename The �lename to whi h the information will be written.5.5.3.22 double H_system::get_interferen e (User ∗ u)Return the interferen e an User (p. 37) experien e.Returns:the interferen e.5.5.3.23 void H_system::pla e_user_at (double x, double y)Pla e a user at a given x, y oordinate.Parameters:x the x oordinatey the y oordinate5.5.3.24 void H_system::pla e_se ondary_user_at (double x, double y)Pla e a se ondary user at a given x, y oordinate.Parameters:x the x oordinatey the y oordinateGenerated on Fri De 21 12:39:39 2007 by Doxygen

Page 79: A Simulator for Cognitive Radio

28 Class Do umentation5.5.3.25 double H_system::get_signal (User ∗ u)Get the signal-strength a primary user is experien ing.Returns:signal strength.5.5.3.26 void H_system:: reate_blob_of_p_users (double size, pos p, doublenr_of_usrs)Create a blob of users spread gaussianus.Parameters:size The size of the blob.p The position of the enter of the blob.nr_of_usrs The number of users in the blob.The do umentation for this lass was generated from the following �les:� h_system.h� h_system. pp

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 80: A Simulator for Cognitive Radio

5.6 sim::pos Class Referen e 295.6 sim::pos Class Referen eA helper lass for easy position handling.#in lude <div.h>Publi Member Fun tions� pos ()A onstru tor reating an empty pos.� pos (double x1, double y1)A onstru tor reating a pos out of two doubles.� pos ( onst pos &p)A onstru tor reating a new pos with the same oordinates as another pos.� void set_pos (pos p)Set this pos to the same as another pos.� void set_x (double t)Set the x- oordinate of this pos.� void set_y (double t)Set the y- oordinate of this pos.� double get_x (void) onstGet the x- oordinate of this pos.� double get_y (void) onstGet the y- oordinate of this pos.� double get_distan e_to (pos p) onstGet the distan e to another pos.� double get_angle_to (pos p) onstGet the angle to another pos.5.6.1 Detailed Des riptionA helper lass for easy position handling.With this lass it is easy to get distan es and angles to other positions.5.6.2 Constru tor & Destru tor Do umentation5.6.2.1 sim::pos::pos (double x1, double y1) [inline℄A onstru tor reating a pos out of two doubles.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 81: A Simulator for Cognitive Radio

30 Class Do umentationParameters:x1 the x oordinate of the pos being reated.y1 the y oordinate of the pos being reated.5.6.2.2 sim::pos::pos ( onst pos & p) [inline℄A onstru tor reating a new pos with the same oordinates as another pos.Parameters:p the pos whi h will be opied into this pos.5.6.3 Member Fun tion Do umentation5.6.3.1 void sim::pos::set_pos (pos p) [inline℄Set this pos to the same as another pos.Parameters:p the pos whi h will be opied into this pos.5.6.3.2 void sim::pos::set_x (double t) [inline℄Set the x- oordinate of this pos.Parameters:t the x- oordinate.5.6.3.3 void sim::pos::set_y (double t) [inline℄Set the y- oordinate of this pos.Parameters:t the y- oordinate.5.6.3.4 double sim::pos::get_x (void) onst [inline℄Get the x- oordinate of this pos.Returns:the x- oordinate. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 82: A Simulator for Cognitive Radio

5.6 sim::pos Class Referen e 315.6.3.5 double sim::pos::get_y (void) onst [inline℄Get the y- oordinate of this pos.Returns:the y- oordinate.5.6.3.6 double pos::get_distan e_to (pos p) onstGet the distan e to another pos.Parameters:p the pos to whi h you want to get the distan e.Returns:the distan e.5.6.3.7 double pos::get_angle_to (pos p) onstGet the angle to another pos.The angle is al ulated FROM the urrent pos.Parameters:p the pos to whi h the urrent pos will refer to when omputing the angle.The do umentation for this lass was generated from the following �les:� div.h� div. pp

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 83: A Simulator for Cognitive Radio

32 Class Do umentation5.7 sim::Primitive_devi e Class Referen eA primitive devi e ontains one or many antennas.#in lude <primitive_devi e.h>Inheritan e diagram for sim::Primitive_devi e::sim::Primitive_device

sim::Base_station sim::UserPubli Member Fun tions� Primitive_devi e ()A onstru tor.� Primitive_devi e (pos &position)A onstru tor.� virtual ∼Primitive_devi e ()The destru tor.� void set_pos (pos position)Set the position X-wise.� pos get_pos (void)Get the position X-wise.5.7.1 Detailed Des riptionA primitive devi e ontains one or many antennas.5.7.2 Constru tor & Destru tor Do umentation5.7.2.1 sim::Primitive_devi e::Primitive_devi e () [inline℄A onstru tor.Create a Primitive devi e with nothing spe i�ed.5.7.2.2 Primitive_devi e::Primitive_devi e (pos & position)A onstru tor.Use this onstru tor if you know the devi e's position.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 84: A Simulator for Cognitive Radio

5.7 sim::Primitive_devi e Class Referen e 335.7.2.3 Primitive_devi e::∼Primitive_devi e () [virtual℄The destru tor.This one is virtual be ause the Primitive_devi e (p. 32) is inherited by other lasses.5.7.3 Member Fun tion Do umentation5.7.3.1 void Primitive_devi e::set_pos (pos position)Set the position X-wise.Parameters:x The X-axis position as a double.5.7.3.2 pos Primitive_devi e::get_pos (void)Get the position X-wise.Returns:The X-axis position.The do umentation for this lass was generated from the following �les:� primitive_devi e.h� primitive_devi e. pp

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 85: A Simulator for Cognitive Radio

34 Class Do umentation5.8 sim::propagation Class Referen eA propagation lass is an obje t that is used as model for real world radio propagation.#in lude <div.h>Publi Member Fun tions� propagation ()A onstru tor to onstru t an unspe i�ed propagation.� propagation (double pl, double dev)A onstru tor spe ifying the parameters of the propagation.� double lsf (double d)A distan e-dependent lognormal shadow-fading fun tion using the internal path loss and deviationto al ulate the fa tor whi h yields the signal redu tion.� void set_path_loss_exp (double p)Set the path loss exponent.� void set_deviation (double d)Set the standard deviation.� double get_path_loss_exp (void)Get the path loss exponent.� double get_deviation (void)Get the standard deviation.� ∼propagation ()The destru tor.5.8.1 Detailed Des riptionA propagation lass is an obje t that is used as model for real world radio propagation.5.8.2 Constru tor & Destru tor Do umentation5.8.2.1 sim::propagation::propagation () [inline℄A onstru tor to onstru t an unspe i�ed propagation.See also:the other propagation (p. 34) onstru tors Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 86: A Simulator for Cognitive Radio

5.8 sim::propagation Class Referen e 355.8.2.2 sim::propagation::propagation (double pl, double dev) [inline℄A onstru tor spe ifying the parameters of the propagation.Parameters:pl the path loss exponent, the parameter de iding how the signal strength will de rease asdistan e in rease.dev a random fa tor in the propagation, in rease for more randomness, ie more shadowing.5.8.3 Member Fun tion Do umentation5.8.3.1 double sim::propagation::lsf (double d) [inline℄A distan e-dependent lognormal shadow-fading fun tion using the internal path loss and deviationto al ulate the fa tor whi h yields the signal redu tion.Parameters:distan e the distan e between the two obje ts.Returns:a value between 0-1 whi h is to be multipli ated with a power, yielding a "at another pla e"transmission strength.5.8.3.2 void sim::propagation::set_path_loss_exp (double p)Set the path loss exponent.Parameters:p the path loss exponent to be stored.5.8.3.3 void sim::propagation::set_deviation (double d)Set the standard deviation.Parameters:d the deviation to store.5.8.3.4 double sim::propagation::get_path_loss_exp (void)Get the path loss exponent.Returns:the path loss exponent in this lass.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 87: A Simulator for Cognitive Radio

36 Class Do umentation5.8.3.5 double sim::propagation::get_deviation (void)Get the standard deviation.Returns:the standard deviation applied.The do umentation for this lass was generated from the following �le:� div.h

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 88: A Simulator for Cognitive Radio

5.9 sim::User Class Referen e 375.9 sim::User Class Referen eA user is a devi e that an transmit and re ieve.#in lude <user.h>Inheritan e diagram for sim::User::sim::User

sim::Primitive_device

Publi Member Fun tions� User ()A onstru tor to onstru t an User (p. 37) with unspe i�ed parameters.� User (sim::pos position, double nf)A onstru tor to onstru t an User (p. 37) with pre-spe i�ed parameters.� User (sim::pos position, double nf, double txp, Base_station ∗bs)A onstru tor to onstru t an User (p. 37) with a transmit power.� User (sim::pos position, double nf, double txp, int tx_freq)The onstru tor to onstru t a se ondary user.� ∼User ()The destru tor.� double get_noise_�oor (void)Get the noise �oor.� void set_noise_�oor (double nf)Set the noise �oor.� void set_tx_pwr (double pwr)Set the transmission power.� double get_tx_pwr (void)Get the transmission power.� void set_tx_freq (int freq)Set the transmission frequen y.� int get_tx_freq (void)Get the transmission frequen y.� void print_user (�gure &f)Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 89: A Simulator for Cognitive Radio

38 Class Do umentationWrite user-related information to the �gure.� void print_suser (�gure &f)Write se ondary user related information to the �gure.� int get_bs_k (void)DEPRICATED.� int get_bs_l (void)DEPRICATED.� void set_bs_k (int k)DEPRICATED.� void set_bs_l (int l)DEPRICATED.� double get_interferen e (void)Get the interferen e this user su�ers.� void set_interferen e (double i)Set the interferen e of this user.� void add_interferen e (double i)Add to interferen e.Publi Attributes� Base_station ∗ BSA pointer to the base station this user is onne ted to.5.9.1 Detailed Des riptionA user is a devi e that an transmit and re ieve.5.9.2 Constru tor & Destru tor Do umentation5.9.2.1 User::User (sim::pos position, double nf)A onstru tor to onstru t an User (p. 37) with pre-spe i�ed parameters.Parameters:position the position of the user.nf the noise �oor this user is experien ing. Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 90: A Simulator for Cognitive Radio

5.9 sim::User Class Referen e 395.9.2.2 User::User (sim::pos position, double nf, double txp, Base_station ∗ bs)A onstru tor to onstru t an User (p. 37) with a transmit power.Parameters:position the position of the user.nf the noise �oor this user is experien ing.txp the transmit power this user is uniformely transmitting with.∗bs a pointer to the base station this user is going to onne t to.5.9.2.3 User::User (sim::pos position, double nf, double txp, int tx_freq)The onstru tor to onstru t a se ondary user.Parameters:position the position of the user.nf the noise �oor this user is experien ing.txp the transmit power this user is uniformely transmitting with.tx_freq the transmit frequen y of this user.5.9.3 Member Fun tion Do umentation5.9.3.1 double User::get_noise_�oor (void)Get the noise �oor.Returns:the noise �oor.5.9.3.2 void User::set_noise_�oor (double nf)Set the noise �oor.Parameters:nf a double spe ifying the noise �oor in W.5.9.3.3 void User::set_tx_pwr (double pwr)Set the transmission power.Parameters:pwr the transmission power.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 91: A Simulator for Cognitive Radio

40 Class Do umentation5.9.3.4 double User::get_tx_pwr (void)Get the transmission power.Returns:the transmission power.5.9.3.5 void User::set_tx_freq (int freq)Set the transmission frequen y.Parameters:freq the transmiossion frequen y to use.5.9.3.6 int User::get_tx_freq (void)Get the transmission frequen y.Returns:the frequen y.5.9.3.7 void User::print_user (�gure & f)Write user-related information to the �gure.This is used for generation of the output�le that is editable through matlab.Parameters:f the �gure in whi h this information is to be stored.5.9.3.8 void User::print_suser (�gure & f)Write se ondary user related information to the �gure.This is used for generation of the output�le that is editable through matlab.Parameters:f the �gure in whi h this information is to be stored.5.9.3.9 double sim::User::get_interferen e (void) [inline℄Get the interferen e this user su�ers.Observe that this parameter has to be set before it an be get.Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 92: A Simulator for Cognitive Radio

5.9 sim::User Class Referen e 41Returns:the interferen e.See also:H_system (p. 21).5.9.3.10 void sim::User::set_interferen e (double i) [inline℄Set the interferen e of this user.Observe that this has to be al ulated somewhere else.See also:H_system (p. 21).5.9.3.11 void sim::User::add_interferen e (double i) [inline℄Add to interferen e.Parameters:i the interferen e to add to the already existing interferen e variable.5.9.4 Member Data Do umentation5.9.4.1 Base_station∗ sim::User::BSA pointer to the base station this user is onne ted to.Be areful not to s rew up the Base_station (p. 12).The do umentation for this lass was generated from the following �les:� user.h� user. pp

Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 93: A Simulator for Cognitive Radio

Index∼Primitive_devi esim::Primitive_devi e, 32a_diagramsim::Antenna, 11add_interferen esim::User, 41Antennasim::Antenna, 10Base_stationsim::Base_station, 13BS sim::User, 41 reate_blob_of_p_userssim::H_system, 28draw_antenna_diagramsim::Base_station, 15generate_basestationssim::H_ ell, 19get_anglesim::Antenna, 10sim::Base_station, 14get_angle_tosim::pos, 31get_bssim::H_ ell, 20get_ ell_radiussim::H_system, 24get_ ell_splitsim::H_system, 24get_deviationsim::propagation, 35get_distan e_tosim::pos, 31get_evensim::H_ ell, 18get_freqsim::H_ ell, 18get_ideal_BS_strengthsim::H_system, 25get_interferen esim::H_system, 27

sim::User, 40get_ksim::H_ ell, 18get_lsim::H_ ell, 18get_nfsim::H_system, 26get_noise_�oorsim::User, 39get_path_loss_expsim::propagation, 35get_possim::H_ ell, 19sim::Primitive_devi e, 33get_reusesim::H_system, 23get_signalsim::H_system, 27get_spansim::Antenna, 11sim::Base_station, 14get_stepssim::H_system, 23get_suser_ ountsim::H_system, 26get_suser_txpsim::H_system, 27get_tx_freqsim::Base_station, 14sim::User, 40get_tx_pwrsim::Antenna, 10sim::Base_station, 15sim::H_ ell, 19sim::User, 39get_user_ ountsim::H_system, 25get_xsim::pos, 30get_ysim::pos, 30H_ ellsim::H_ ell, 18H_system

Page 94: A Simulator for Cognitive Radio

INDEX 43sim::H_system, 23lsf sim::propagation, 35pla e_se ondary_user_atsim::H_system, 27pla e_user_atsim::H_system, 27pos sim::pos, 29, 30Primitive_devi esim::Primitive_devi e, 32print_antennasim::Antenna, 11print_basestationsim::Base_station, 15print_ ellsim::H_ ell, 19print_susersim::User, 40print_usersim::User, 40propagationsim::propagation, 34set_anglesim::Antenna, 10sim::Base_station, 14set_ ell_radiussim::H_system, 24set_ ell_splitsim::H_system, 24set_ ellssim::H_system, 25set_deviationsim::propagation, 35set_ideal_BS_strengthsim::H_system, 25set_interferen esim::User, 41set_nfsim::H_system, 26set_noise_�oorsim::User, 39set_path_loss_expsim::propagation, 35set_possim::pos, 30sim::Primitive_devi e, 33set_reusesim::H_system, 23set_spansim::Antenna, 11

sim::Base_station, 14set_stepssim::H_system, 24set_suser_txpsim::H_system, 26set_suserssim::H_system, 26set_tx_freqsim::Base_station, 13sim::User, 40set_tx_pwrsim::Antenna, 10sim::Base_station, 14sim::User, 39set_userssim::H_system, 26set_xsim::pos, 30set_ysim::pos, 30sim, 7sim::Antenna, 9a_diagram, 11Antenna, 10get_angle, 10get_span, 11get_tx_pwr, 10print_antenna, 11set_angle, 10set_span, 11set_tx_pwr, 10sim::Base_station, 12Base_station, 13draw_antenna_diagram, 15get_angle, 14get_span, 14get_tx_freq, 14get_tx_pwr, 15print_basestation, 15set_angle, 14set_span, 14set_tx_freq, 13set_tx_pwr, 14sim::�gure, 16sim::H_ ell, 17generate_basestations, 19get_bs, 20get_even, 18get_freq, 18get_k, 18get_l, 18get_pos, 19get_tx_pwr, 19H_ ell, 18Generated on Fri De 21 12:39:39 2007 by Doxygen

Page 95: A Simulator for Cognitive Radio

44 INDEXprint_ ell, 19sim::H_system, 21 reate_blob_of_p_users, 28get_ ell_radius, 24get_ ell_split, 24get_ideal_BS_strength, 25get_interferen e, 27get_nf, 26get_reuse, 23get_signal, 27get_steps, 23get_suser_ ount, 26get_suser_txp, 27get_user_ ount, 25H_system, 23pla e_se ondary_user_at, 27pla e_user_at, 27set_ ell_radius, 24set_ ell_split, 24set_ ells, 25set_ideal_BS_strength, 25set_nf, 26set_reuse, 23set_steps, 24set_suser_txp, 26set_susers, 26set_users, 26wo_sni, 27sim::pos, 29get_angle_to, 31get_distan e_to, 31get_x, 30get_y, 30pos, 29, 30set_pos, 30set_x, 30set_y, 30sim::Primitive_devi e, 32∼Primitive_devi e, 32get_pos, 33Primitive_devi e, 32set_pos, 33sim::propagation, 34get_deviation, 35get_path_loss_exp, 35lsf, 35propagation, 34set_deviation, 35set_path_loss_exp, 35sim::User, 37add_interferen e, 41BS, 41get_interferen e, 40get_noise_�oor, 39

get_tx_freq, 40get_tx_pwr, 39print_suser, 40print_user, 40set_interferen e, 41set_noise_�oor, 39set_tx_freq, 40set_tx_pwr, 39User, 38, 39Usersim::User, 38, 39wo_snisim::H_system, 27

Generated on Fri De 21 12:39:39 2007 by Doxygen