RELIABLE COMMUNICATIONS AT FREQUENCIES BANDS ABOVE 25 GHz IN
THE TROPICS
FAIZAH BINTI ABU BAKAR
A project report submitted in partial fulfillment of the requirements for the award of the degree of
Master of Engineering in Electrical (Electronic & Telecommunication)
Faculty of Electrical Engineering
Universiti Teknologi Malaysia
MAY 2008 i
To my beloved family especially my husband, Muzamir bin Isa and my daughters,
Zahirah binti Muzamir and Sakinah binti Muzamir iii
iv
ACKNOWLEDGEMENT
First and foremost, all praise to Allah for giving me strength and opportunity to finish my master’s study and to be able to prepare this thesis till the end. My sincere appreciation to my supervisor, Professor Dr. Tharek Abdul Rahman for his guidance, thought and encouragement. Many thanks also to Associate Professor Dr. Mohd Wazir bin Mustafa for helping us, Kulim’s students a lot in our study time.
Especially to my husband and my children, thank you for your support and patience. Without you standing beside me through ups and downs, I would not make it till the end. To all my family especially my parents and my parents in law, thank you very much for all your kind help and support.
Last but not least, to all my friends at UTM and UniMAP, thank you.
May Allah bless all of you.
v
ABSTRACT
The use of frequencies in the higher bands could tap upon the large spectrum available for communication use. However, it suffers greater propagation losses, making them unsuitable for long range communication. In addition, heavy tropical rain further reduces the reliability of the link and additional link budget has to be set aside for rain fade in order to improve its reliability. Rain attenuation model that has been used widely is currently base on ITU-R model. It gives same rain rate for all places in
Malaysia. However, previous study in Malaysia conducted by researchers in UTM shows that rain rate is not the same for different places in Malaysia. It is localized where some places experience heavier rainfall compared to other places. Hence, the
ITU-R model does not give an accurate prediction of rain attenuation in Malaysia, where the attenuation is supposed to be localized base on the data of the rain rate. This project is aimed to develop a computer program in order to predict localized rain attenuation.
The analysis of calculation to produce rain attenuation is done. The best reduction factor model is chosen to get the most accurate result. Then, the planning is done, followed by the design phase. The most challenging part, which is the development of the program, is done next. To verify the program built, it is tested by entering significant inputs and the outputs are analyzed. As a result, a computer program to predict rain attenuation in
Peninsular Malaysia is successfully built. The results produced by the program are compared to the ITU-R model of rain attenuation. The differences are calculated and the outcome shows that ITU-R model is not suitable to be used as a rain attenuation method in Malaysia.
vi
ABSTRAK
Penggunaan frekuensi di jalur lebih tinggi membolehkan spektra yang lebih lebar digunakan untuk komunikasi. Walau bagaimanapun, ia mengalami kehilangan perambatan yang lebih banyak, menjadikan ia tidak sesuai untuk komunikasi jarak jauh.
Hujan yang lebat di kawasan tropika lebih memburukkan lagi keadaan dan tambahan bajet laluan harus disediakan untuk memperbaiki kebolehpercayaan isyarat. Model pelemahan hujan yang digunakan secara meluas sekarang adalah model daripada ITU-R.
Ia memberikan kadar hujan yang sama bagi semua tempat di Malaysia. Walau bagaimanapun, kajian mendapati kadar hujan adalah terhad kepada kawasan yang kecil dan semua kawasan tersebut mengalami kadar hujan yang berlainan. Dengan ini, model
ITU-R tidak memberikan telahan yang tepat bagi nilai pelemahan hujan di Malaysia kerana satu-satu bacaan hanya terhad kepada satu kawasan kecil sahaja. Projek ini bertujuan untuk membangunkan program simulasi untuk menganggarkan tahap pelemahan hujan di satu-satu kawasan yang terhad. Perkara pertama yang dilakukan ialah menganalisa kiraan untuk mendapatkan tahap pelemahan hujan. Kemudian, model faktor pengurangan yang terbaik dipilih untuk mendapatkan hasil yang tepat. Selepas itu, perancangan yang rapi dilakukan untuk menjayakan program ini, diikuti dengan fasa merekabentuk. Bahagian yang paling sukar iaitu membangunkan program menggunakan perisian MATLAB dilakukan setelah fasa rekabentuk selesai. Untuk mengesahkan kebolehpercayaan keluaran progam ini, ia diuji dengan memberikan masukan-masukan yang sesuai dan keluarannya dianalisa. Hasil akhir yang diperolehi ialah satu program untuk menganggar tahap pelemahan hujan di Semenanjung Malaysia telah berjaya dibangunkan. Keluaran-keluaran yang dihasilkan oleh program ini telah dibandingkan dengan keluaran daripada model pelemahan hujan ITU-R. Perbezaan-
vii perbezaan nilai dikira dan didapati model pelemahan hujan yang telah dibangunkan ini lebih tepat untuk digunakan di Malaysia.
1 viii
TABLE OF CONTENTS
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENTS iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS viii
TABLES xi
FIGURES xii
LIST OF ABBREVIATIONS xiii
LIST OF SYMBOLS xiv
LIST OF APPENDICES xv
INTRODUCTION 1
1.1.1 Effects of High Frequencies to 1-3
1.1.2
Effects of Rain to Electromagnetic 3-4
Wave in High Frequencies
2 RAIN ATTENUATION PREDICTION 8
2.1.1 Rain Attenuation Calculation for 8-10
LOS (Terrestrial) microwave path
Factor ix
2.2 Some Models of Rain Attenuation
Prediction
12
Model
METHODOLOGY
20
4 RESULTS AND ANALYSIS
27
4.6 Additional Features of the Program 37
x
Rain Attenuation
Analysis Results 38
4.8.1 Comparison of the Output of RAPS1 39-40
5
REFERENCES
APPENDIX A -E
4.8.2
Comparison of the Output of RAPS1 41-43 with Results Produced Utilizing
ITU-R Reduction Factor but Using the Local Data Rain
CONCLUSION AND PROPOSED FUTURE
44
WORKS
Future
49-91
46-48
LIST OF TABLES
4.1
4.2
2.1
4.3
4.4
4.5
Some of frequency dependent coefficient to calculate specific attenuation
Comparison between output from RAPS1 and ITU-R model of rain attenuation at 26 GHz
15
Example of program output at three different locations in 37
Peninsular Malaysia
39
Comparison between output from RAPS1 and ITU-R model of rain attenuation at 38 GHz
39
Comparison of the output of RAPS1 with results produced utilizing ITU-R reduction factor at 26 GHz
Comparison of the output of RAPS1 with results produced utilizing ITU-R reduction factor at 26 GHz
41
42 xi
xii
LIST OF FIGURES
FIGURE NO.
1.2
TITLE PAGE
3.1
3.2
3.4
4.2
4.3
4.5
4.7
4.8
4.10
Rain rate (mm/h) exceeded for 0.01% of the average year
6 design 21
Flow Chart of the Methodology 22 message 35
LIST OF ABBREVIATIONS
MHz, MHz - Mega xiii
ITU-R - International Telecommunication Union Radio Section
MATLAB - Matrix
LIST OF SYMBOLS d , l , L length f , F - frequency
Ls - Loss
λ - wavelength c - speed of light
γ
R k , α - functions of frequency for ITU model d eff
, L eff - effective path length r - reduction
A
0.01
- rain attenuation exceeded for 0.01% of time
A p - rain attenuation exceeded for p% of time p percentage p w
R p,
R
-
- worst-month time percentage rain rate in millimeter per hour at p% probability e - natural p1 - modified probability of occurrence xiv
LIST OF APPENDICES
B
APPENDIX
Window
Generated 48-54
MATLAB Self Generated Code for Main Working 55-72
Window
D
E
MATLAB Code Associated with ‘Calculate and 80-87
Plot’ Pushbutton of Main Working Window
MATLAB Code for Hoplength Window 88-90 xv
CHAPTER 1
INTRODUCTION
This chapter covers the literature review and the significance of this project. It also tells about the outline of this thesis.
1.1.1 Effect of High Frequencies to Electromagnetic Wave
Since communication at lower frequencies is getting congested, the use of frequencies in higher spectrum band is currently in demand by the designers. Higher bands provide wider spectrum for communication but in contrast it suffer greater propagation loss. This can be easily determined by the below mathematical formula for free space loss:
Ls = 32 .
45 + 20 log dkm + 20 log fMHz
Higher bands from 1 GHz to 300 GHz are call microwave. Microwave is form of electromagnetic energy and can be described with the term of radio frequency or RF.
RF emission and associated phenomena can be discussed in terms of energy, radiation or fields. In term of radio wave propagation, we can define radiation as the propagation of
2 energy through space in the form of waves or particles [1]. Figure 1.1 below illustrated radiation as waves of electric and magnetic energy moving together through space.
Figure 1.1 Electromagnetic wave
Electromagnetic energy can be characterizes by a wavelength and a frequency.
The wavelength is the distance covered by a complete electromagnetic wave cycle, while the frequency is the number of electromagnetic waves passing a given point in a second. Electromagnetic waves travel through space at the speed of light. The wavelength and frequency of an electromagnetic wave are inversely related by a simple mathematical formula given below:
λ = f c
where:
λ = wavelength c = speed of light f = frequency
The speed of light in a given medium does not change, resulting in shorter wavelength for high frequency electromagnetic waves. Hence, when operating at high
3 frequencies, rain becomes a major obstacle as it will scatter the signals when the size of the raindrops is larger than the waves. To make it worse, places experiencing heavy rainfall will suffer greater interference and consequently degrading the signal or waves.
1.1.2
Effect of Rain to Electromagnetic Wave in High Frequencies
When it comes to tropical countries like Malaysia, Indonesia and Thailand, the losses become higher because of heavy rain. It can degrade the radio wave propagation at frequencies 10 GHz and above [2]. To be more specific, propagation of radio waves through the atmosphere above 10GHz involves not only free space loss and loss due to rain, but other factors listed below also contribute to the additional loss [3]: i) The gaseous of the homogeneous atmosphere due to resonant and
nonresonant polarization mechanism. ii) The inhomogeneties in the atmosphere iii) The particles due to fog, mist and haze (includes dust, smoke and salt
particles in the air)
Earlier approach to deal with rain is on a basis of rainfall given in millimeters per hour. This was usually done with rain gauges, using collected rain averaging over a day or even periods of days. However, for path design above 10 GHz, such statistic are not sufficient where designers may want path availability better than 99.9% and do not want to design using conservative procedures.
A researcher, Hogg, suggests that the use of high speed rain gauges with outputs ready available in computer analysis [3]. These gauges can provide minute by minute analysis of the fall rate, unlike the conventional type of gauges. But it is desirable to have several years’ statistics for a specific path to provide necessary and accurate
4 information on fading caused by rainfall that will determine the parameters such as LOS repeaters, size of antenna and so on.
Realizing the importance of this rainfall data, a large body of information on point rainfall and rain rates has been accumulated since 1940 [3]. This information shows a great variation of short-term rainfall rates from one geographical location to another.
Researchers in countries experiencing heavy rain especially in South East Asia countries including Malaysia have been doing active research regarding rain and its effect to communication system for the past 10 years. The tropical climate makes the research topic relevant to get a better quality of communication in microwave bands throughout the country.
1.2
Problem Statement
Rain attenuation model that has been used worldly is currently base on ITU model. It gives same rain rate for all places in Malaysia. It classified Malaysia under P climatic region where the rain rate for 0.01% of the year (R
0.01
) is given as 145 mm/h
[3], [5], [6]. The latest ITU Recommendation notes peninsular Malaysia experiences
120 mm/h rain rate and West Malaysia 100 mm/h for 0.01% of the year [7]. Figure 1.2 shows the latest rain rates in Malaysia and in its neighbours given by ITU.
However, previous study in Malaysia conducted by researches in UTM shows that rain rate is not the same for different places in Malaysia. It is localized where some places experience heavier rainfall compared to other places.
5
Therefore, the ITU-R model does not give an accurate prediction of rain attenuation in Malaysia, where the attenuation is supposed to be localized base on the data of the rain rate
1.3
Research Objectives
In accordance with active researches in rain that are being done in Malaysia and its relationship with communication, this project is aimed to develop a computer program in order to predict localized rain attenuation for terrestrial microwave links in
Peninsular Malaysia. This program will be based on given data. Once the program has been developed, the result from that simulation of the program is compared with ITU-R rain attenuation model.
This thesis consists of five chapters. Chapter 1, which is this chapter, covers the literature review, the significance of this project and the outline of this thesis.
Chapter 2 gives a brief theory of rain attenuation prediction methods. This includes rain attenuation calculation for terrestrial microwave path, path length reduction factor models and rain attenuation models that are widely used nowadays. Comparison between those models is also done and the reasons why the appropriate models are chosen to complete this project are stated.
In Chapter 3, all the methodology adopted in making this project a success is explained. The phases of methodology are written one by one and are also explained
6 briefly. A little bit of the MATLAB software that is used to build the program is also mentioned and explained.
Chapter 4 covers the results obtained from this project. The results include the program visual design, implementation, testing and user guide to use the program.
Analysis of the results is also done by comparing them with the output from ITU-R model.
Conclusion about the research and the results obtained is discussed in Chapter 5.
It also covers the proposed future works that can be implemented by future researchers to further enhance this project.
7 tude Lati
Figure 1.2 Rain rate (mm/h) exceeded for 0.01% of the average year
CHAPTER 2
RAIN ATTENUATION PREDICTION
This chapter covers brief theory of rain attenuation prediction methods and the models used worldwide.
2.1
Rain Attenuation Calculation
The most used method today for calculating rain attenuation was developed by the International Telecommunications Union Radio Section [1]. There are however many other methods, such as Crane model and methods that are more suitable for specific climates.
2.1.1 Rain Attenuation Calculation for LOS (Terrestrial) Microwave Paths
All measurements when rainfall is discussed are in millimeters per hour of rain and are point rainfall measurements. Previously in chapter 1, it is already known that heavy downpour rain will damage the radio transmission above 10 GHz. Rain is naturally cellular and has limited coverage. One thing that must be addressed is whether the entire hop is in the same heavy rain for the whole period of rain. Rainfall that is light enough (usually less than 2 mm/h) is usually widespread in character and the path
9 average is the same as the local value. Heavier rain happens in convective storm cells that are typically 2-6 km across and often embedded in larger regions measured in tens of kilometers [8]. Thus for short hops (2-6 km) the path average rainfall rate will be the same as the local rate. However, for longer paths it will be reduced by the ratio of the path length on which it is raining to the total path length.
From ITU-R for terrestrial microwave links, the rain attenuation calculation is given as below:
A = γ R .
L .
r
where:
γ R = Specific attenuation
L = Path length r = Reduction factor
The specific attenuation γ R (db/km) is obtained from the rain rate using the power law relationship:
γ R = kR
α
where:
R = rain rate at p% probability level k , α = frequency dependant ITU-R regression coefficients
10
Values and α are determined as functions of frequencies, F (GHz) in the range from 1 to 1000 GHz. Their values also depend on polarization chosen to calculate the attenuation, either horizontal or vertical.
The path length L can be calculated by knowing the geographical positions of the twos stations (transmitter and receiver) [9] [10] [11].
The reduction factor r can be chosen from models provided by a number or researchers as explained in the next part.
2.1.1.1
Path Length Reduction Factors
As what has been shown earlier, there is a reduction factor that must be included and counted in the calculation of rain attenuation. This reduction factor is used to account the inhomogenity of rain along the propagation path. It is multiplied with the actual path length to obtain the effective path length:
L eff
= Lxr
where:
L r
= actual path length
= reduction factor
The reduction factor r depends on the spatial distribution of rain rate and account for the horizontal variations of rain along a propagation path. There are several models proposed by a number of researcher regarding the reduction factor. Among the models
11 are Lin model, Moupfouma model, Assis model, Dissanayake and Allnutt model and as well as ITU-R model [12].
Rain rate and rain attenuation data collected from two different locations in
Malaysia have been used to investigate the various models proposed for the path length reduction factor [12]. Based on the preliminary results, the ITU-R predictions are much lower than the measured attenuation, and Moupfouma model has been found to produce good results [12].
Based on results from the research done, Moupfouma model is used as a reduction factor in this project as it is recommended for the Malaysian region.
2.1.1.2
Moupfouma Model As a Reduction Factor [13]
The reduction factor suggested by Moupfouma is given by: r =
1 + 0 .
03
1
P
0 .
01
− β l m
with m ( F , l ) = 1 + ψ ( F ) log e l
and
ψ ( F ) = 1 .
4 X 10 − 4 F 1 .
76
where:
F = Frequency in GHz
β coefficient is given as a result of best fit by:
12
β = 0.45, for 0.01
≤ P (percent) ≤ 0.01
β = 0.6, b) For l ≥ 50 km for 0.01
≤ P (percent) ≤ 0.1
β = 0.36,
β = 0.6, for 0.01
≤ P (percent) ≤ 0.01 for 0.01
≤ P (percent) ≤ 0.1
The effective path length reflects the spatial inhomogenity. Its frequency dependence which appeared here in the reduction coefficient r results from both the nonuniformity of the rain along the radio path link, and the nonlinear dependence of the specific attenuation rain rate.
2.2 Some Models of Rain Attenuation Prediction
2.2.1 ITU-R Model of Rain Attenuation [14]
The prediction procedure below by ITU is considered valid in all parts of the world and may be used for estimating the long-term of rain attenuation. It is valid at least for frequencies up to 40 GHz and path length up to 60 km:
Step 1 : Obtain the rain rate R
0.01
exceeded for 0.01% of the time (with an integration of
13
1 min). If this information is not available from local sources of long-term
measurements, an estimate can be obtained from the information given in
Recommendation ITU-R P.837.
Step 2 : Compute the specific attenuation, γ
R
(db/km) for the frequency, polarization and
rain rate of interest. The specific attenuation is using the power-law
relationship and its computation is as below:
γ R = kR
α
where k
R
,
= rain rate at p% probability
α = functions of frequency, f (GHz) in the range 1 to 1000 GHz.
Values of k and α are given in Table 2.1.
It should be noted that horizontally polarized waves suffer greater attenuation
than vertically polarized waves because larger raindrops are generally shaped as
oblate spheroids and are aligned with the vertical rotation axis [3]. The letter h
and v notates horizontal and vertical polarizations, respectively.
Step 3 : Compute the effective path length, d eff
, of the link by multiplying the actual
path length d by a distance factor r . An estimate of this factor is given by:
where, for R
0 .
01
≤ 100mm/h: r =
1 +
1 d d
0 d o
= 35 e − 0 .
015 R
0 .
01
14
For R
0 .
01
≥ 100mm/h, use the value 100 mm/h in place of R
0 .
01
.
Step 4 : An estimate of the path attenuation exceeded for 0.01% of the time is given by:
A
0 .
01
= γ R .
d eff
= γ R .
d .
r dB
where d = path length r = reduction factor
Step 5 : For radio links located in latitudes and equal to or greater than 30° (North or
South), the attenuation exceeded for other percentages of time p in the range
0.001% to 1% may be deduced from the following power law:
A p
A
0 .
01
= 0 .
12 p − ( 0 .
546 + 0 .
043 log
10 p )
This formula has been determined to give factors of 0.12, 0.39, 1 and 2.14 for
1%, 0.1%, 0.01% and 0.001% respectively, and must be used only within this
range.
Step 6 : For radio links located at latitudes and below 30° (North or South), the
attenuation exceeded for other percentages of time p in the range 0.001% to 1%
may be deduced from the following power law:
A p
A
0 .
01
= 0 .
07 p − ( 0 .
855 + 0 .
139 log
10 p )
This formula has been determined to give factors of 0.07, 0.36, 1and 1.44 for
1%, 0.1%, 0.01% and 0.001% respectively, and must be used only within this
15
range.
Step 7 : If worst-month statistics are desired, calculate the annual time percentages p
corresponding to the worst-month time percentages p w
using climate
information specified in Recommendation ITU-R P.841. The values of A
exceeded for percentage of the time p on an annual basis will be exceeded for
the corresponding percentages of time p w
on a worst-month basis.
16
Table 2.1 Some of frequency dependent coefficient to calculate specific attenuation
Frequency
(GHz) k
H
α
H k
V
α
V
25 0.1571 0.9991 0.1533 0.9491
26 0.1724 0.9884 0.1669 0.9421
27 0.1884 0.9780 0.1813 0.9349
28 0.2051 0.9679 0.1964 0.9277
29 0.2224 0.9580 0.2124 0.9203
30 0.2403 0.9485 0.2291 0.9129
31 0.2588 0.9392 0.2465 0.9055
32 0.2778 0.9302 0.2646 0.8981
33 0.2972 0.9214 0.2833 0.8907
34 0.3171 0.9129 0.3026 0.8834
35 0.3374 0.9047 0.3224 0.8761
36 0.3580 0.8967 0.3427 0.8690
37 0.3789 0.8890 0.3633 0.8621
38 0.4001 0.8816 0.3844 0.8552
39 0.4215 0.8743 0.4058 0.8486
40 0.4431 0.8673 0.4274 0.8421
41 0.4647 0.8605 0.4492 0.8357
42 0.4865 0.8539 0.4712 0.8296
43 0.5084 0.8476 0.4932 0.8236
44 0.5302 0.8414 0.5153 0.8179
45 0.5521 0.8355 0.5375 0.8123
46 0.5738 0.8297 0.5596 0.8069
47 0.5956 0.8241 0.5817 0.8017
48 0.6172 0.8187 0.6037 0.7967
49 0.6386 0.8134 0.6255 0.7918
50 0.6600 0.8084 0.6472 0.7871
51 0.6811 0.8034 0.6687 0.7826
52 0.7020 0.7987 0.6901 0.7783
53 0.7228 0.7941 0.7112 0.7741
17
2.2.2
Crane Model
The Crane models, that is after Robert K. Crane is popular for space earth links.
He first presented his work on prediction of the effect of rain on satellite communication system in 1977. However, the Crane models also have terrestrial models. Actually, there are three versions of Crane models; the global Crane model , the two-component
Crane model and the revised two-component model [1].
The method below is used to predict the attenuation by rain on terrestrial propagation path. As a first step, the rain climate region of the end points of the path has to be determined. Calculating the outage is an iterative process that is based on the calculation of the attenuation.
For 22.5 km,
A = α R p
β
⎡
⎢
⎣
⎛
⎜⎜ e μβ d
μβ
− 1 ⎞
⎟⎟
−
⎛
⎜⎜ b β e c β x c β
⎞
⎟⎟
+
⎛
⎜⎜ b β e c β d c β
⎞
⎟⎟
⎤
⎥
⎦ dB
A = α R p
β
⎛
⎜⎜ e
μβ d
μβ
− 1 ⎞
⎟⎟
dB
μ , , and c can be calculated as follows: c x
=
μ = ln
( )
/ x b = 2 .
3 R
0 .
026 −
= 3 .
8 − 0 .
6 p
− 0
0 .
03
.
17 ln ln
R p
( )
where d = path length in kilometres
18
R p
= rain rate in millimeters per hour, determine from Crane tables e
α
= natural logarithm (log
, β
2.71828
)
= regression coefficients obtained from the table and interpolated if
necessary
First, it is necessary to determine the rainfall rate required to produce attenuation equal to the thermal fade margin. After that, determine the percent of the year this rain is exceeded. This value represents the annual two-way rain outage time for the path and is calculated using the rainfall statistics for the required geographic region.
If d
0
= 22.5 km and a modified probability of occurrence p 1: p 1 = p (22.5/ d )
2.2.3
Comparison of ITU-R and Crane Models
The ITU-R model consists of simple equations whereas the Crane model requires solution of more complex equation to obtain the path-averaged rain rate and a representation of the path profile by exponential functions. Furthermore, Crane’s derivations are overly empirical, sometimes hard to understand and difficult to extend
[1].
Crane model predicts a larger attenuation than the ITU-R model. However, this does not mean that the model’s prediction is not accurate. The Crane method is used mainly in United States while the ITU-R model is used more widely around the world.
It is in users hand to choose between Crane model and ITU model. What is important to remember is the more conservative method does not necessarily have to be more
19 accurate and on the other hand, more conservative method of calculation can lead to more expensive network design [1].
In this project, the ITU model will be used to develop the computer program to predict rain attenuation in Peninsular Malaysia except for its reduction factor because of its simpler way of calculation and has been used by researchers in Malaysia for quite some time, proving its accurateness.
CHAPTER 3
RESEARCH METHODOLOGY
This chapter explains the methodology adopted in making this project a success.
3.1
Phases of Methodology
This research methodology is separated into four phases to ensure the objectives are achieved. These separations contribute to a more arranged work of this project.
3.1.1
Analysis of Calculation
This project involves mainly on calculation of rain attenuation. As discussed in previous chapter, rain attenuation calculation includes specific attenuation and reduction factor. These two main things contribute to the result of attenuation due to rain. The overall calculations need to be understood and the best reduction factor has to be chosen to be implemented in this computer program development.
21
3.1.2
Planning
To achieve the objectives of this project, a good plan on steps to design the program is done. In this phase, a few milestone is marked by dividing the project into two parts, mainly designing and developing the program.
3.1.3
Design Phase
This phase is the most important as this project is mainly on building a computer program to predict rain attenuation. In this phase, all the consideration is made such as how the program is going to operate, what are the files needed to be associated with the program,, what are the output of the program, (examples: graphs and values) and how the interface will look like. The basic outline of the design is as figure 3.1.
3.1.4 Development and Testing Phase
After the design is done, the program is then developed using MATLAB 7.0.
The development process is ended with testing to ensure the result come out as expected and perform as designed.
1. Specific attenuation
2. Path length
3. Reduction factor
Calculation
• Rain attenuation
• Hop length
•
• Power received
Link budget diagram,
Results
Legend
Graphical User Interface (GUI)
Behind the GUI
Figure 3.1 Program design k, α coefficients file rain rate file
Files associated
22
23
Start
Literature review
Analysis of calculations
Planning
Program Design
Program
Development &
Testing
No
Ok?
Yes
Done
Figure 3.2 Flow Chart of the Methodology
3.2 Introduction to MATLAB
MATLAB (short for MATrix LABoratory) is a special-purpose computer program optimized to perform engineering scientific calculations. It started life as a program designed to perform matrix mathematics, but over the years it has grown into a flexible computing system capable of solving essentially any technical problems.
24
The MATLAB program implements the MATLAB language, and provides a very extensive library of predefined functions to make technical programming tasks easier and more efficient. This extremely wide variety of functions makes it much easier to solve technical problems in MATLAB than in other language such as Fortran and C.
Figure 3.3 Screenshot of MATLAB
MATLAB has many advantages compared to conventional computing language for technical problems solving [15]. Among them are:
1.
Ease of use
MATLAB is very easy to use. The programs may be easily written and modified with the built-integrated development environment, and debugged with MATLAB debugger.
25
2.
Platform independence
MATLAB is supported on many different computer systems, providing a large measure of platform independences. Programs written in MATLAB can migrate to new platforms when the needs of the user change.
3.
Predefined function
MATLAB comes complete with an extensive library of predefined functions that provide tested and prepackaged solutions to many basic technical tasks.
In addition to the large library of functions built into the basic MATLAB language, there are many special-purpose toolboxes available to help solve complex problems in specific areas.
4.
Device-Independent Plotting
Unlike other computer languages, MATLAB has many integral plotting and imaging commands. The plots and images can be displayed on any graphical output device supported by the computer on which MATLAB is running.
5.
Graphical User Interface
MATLAB includes tools that allow a programmer to interactively construct a graphical user interface (GUI) for his or her program. With this capability, the programmer can design sophisticated data analysis programs that can be operated by relatively inexperienced user. Figure 3.3 shows the screenshot of guide.
26
Figure 3.4 Screenshot of guide
MATLAB is chosen to develop this simulator because its program can handle calculation very well and it is associated with Graphical User Interface (GUI) that is going to be used in this project.
CHAPTER 4
RESULTS AND ANALYSIS
This chapter covers the results obtained from this project. The results include the program visual design, implementation, testing and user guide to use the program.
Analysis of the results is also done by comparing them with the output from ITU-R model.
4.1
Introduction
A computer program in MATLAB has been developed to predict attenuation due to rainfall based on the data rain from previous research in UTM. The program is uploaded with rain rate statistic proposed by Chebil [15] for 99 locations in Peninsular
Malaysia. These locations are shown in Figure 4.1.
This program is built using MATLAB GUIs 7.0 (guide). It is called RAPS1 where RAPS stands for Rain Attenuation Prediction Software. It can be used to predict rain attenuation for terrestrial microwave links in Peninsular Malaysia.
28
Figure 4.1 Locations of rain rate collected
4.2
Visual Design
This program has been designed to have two windows; introductory window and main working window.
The introductory window has two push buttons, ‘Yes’ and ‘No’. If the user wants to proceed predicting rain attenuation, he has to click ‘Yes’. Otherwise, he has to click ‘No’.
29
Figure 4.2 Introductory window
The main working window is divided into two parts. The rain attenuation prediction portion is at the left hand side and the link analysis tool is at the right hand side. There are five pushbuttons at the window. They are: a) ‘Predict’ pushbutton b) ‘Calculate and Plot’ pushbutton c) ‘Reset’ pushbutton d) ‘Help’ pushbutton e) ‘Exit’ pushbutton
The main working window also contains thirty three static edit text boxes where text is written in it, twelve edit text boxes for the latitude and longitude of station A and
B, a pop up menu to choose type of polarization (horizontal or vertical), an edit text box to put desired frequency and two edit text boxes to display the predicted rain attenuation and calculated hoplength.
Another three edit text boxes at the main working window are for a user to enter value of power transmitted, transmitter gain and receiver gain. One edit text box to display calculated value of power received at the receiver is also there.
30
Figure 4.3 Main working window
4.3
Implementation
After the visual has been designed, all the components are required to be linked with the code or callbacks to make them perform their specific task. As for the introductory window, the ‘Yes’ pushbutton is linked to the main working window while the ‘No’ pushbutton is linked to the ‘close’ callback.
At the main working windows, there are five pushbuttons. Their specific task is as follows: a) The ‘Reset’ pushbutton is linked with callback to clear the edit text boxes b) The ‘Help’ pushbutton is linked with callback to display Help window c) The ‘Exit’ pushbutton is linked with callback to close the program
31 d) The ‘Predict’ pushbutton is linked with callback that does a number of job before displaying the result e) The ‘Calculate and Plot’ pushbutton is linked with callback that does the same job as ‘Predict’ pushbutton’s callback, but it has additional task before the result is shown
The code linked with the ‘Predict’ pushbutton performs these following tasks before it can display the results: i) Loads the rain data file and the coefficient file ii) Read the user’s data fed in the edit text boxes of latitude and longitude for both station A and B iii) Base on the latitude and longitude entered by the user, this program searches for the nearest location out of 99 locations where rain data is available. After obtaining the rain rates for station A and B, the rain rates are compared and the highest of two is considered for rain attenuation prediction iv) In case where the desired frequency entered by the user is no available in the file uploaded, this program calculates regression coefficient k and
α using ITU-R defined interpolation method v) The hop length is calculated by this program through the geographical position of the two stations, that is the latitude and longitude of both stations. A separate function, ‘Hoplength’ has been defined to calculate the path length. vi) This program then calculates the rain attenuation and displays the results.
The hop length calculated is also displayed.
Example of outputs displayed when the ‘Predict’ pushbutton is clicked after all the necessary values have been entered is as figure 4.4.
32
Figure 4.4 Example of output (1)
The code linked with the ‘Calculate and Plot’ pushbutton performs the same tasks as the code linked with ‘Predict’ pushbutton, except that it has additional tasks: i) Based on gain of transmitter, gain of receiver and power transmitted values entered by the user, this code calculates the power received at the receiver side. ii) It then plots the power level diagram and displays the plotted graph and also the power received at the receiver.
Example of outputs displayed when the ‘Calculate and Plot’ button is clicked after all the necessary values are entered is as figure 4.5.
33
Figure 4.5 Example of output (2)
4.4
Program Limitations
This program that has been built has some limitations. It can only run on
Windows 95, 98 and XP. The frequency range that is valid for calculation is from 1
GHz to 50 GHz only. In addition, the maximum path length that can be considered by this software in predicting the rain attenuation is up to 58 kilometers only. It is in line with the outcome from Moupfouma [6] where it says that predictions derived for path length up to 58 kilometers are in good agreement with the experimental data.
Furthermore, this program can only predict rain attenuation in Peninsular Malaysia since the data rain available is just for that particular part of Malaysia.
34
4.5
Program User Guide
For a user that wants to use this program, he needs to have installed MATLAB
7.0 in his computer or laptop. The program need all the files listed below to be resided in the ‘work’ directory of MATLAB 7.0: i) RAPS1.fig ii) RAPS1.m iii) Projek2c.fig iv) Projek2c.m v) Hoplength.m vi) raindata.mat vii) coefficient.mat
RAPS1.fig and RAPS1.m are figure files. They contain the actual graphical user interface that have been created. RAPS1.m and Projek2c.m contains the code to load the figures and the callbacks for each element in the figure. The Hoplength.m file contains code for hop length function which is to calculate path length between Station A and
Station B. The fraindata.mat holds rain data for Peninsular Malaysia whereas the coefficient.mat file holds ITU regression coefficient.
To use this program, a user has to type RAPS1 in MATLAB command window.
The introductory window will appear. The user has to click ‘Yes’ to proceed using the software or ‘No’ if he wants to exit the program.
If ‘Yes’ button is clicked, the main working window will be displayed. The user can continue using the program by entering the necessary values and by clicking the necessary pushbuttons.
35
If a user entered invalid information or made mistakes, this program can guide him through an ‘Error’ message box indicating the error. Among the ‘Error’ message boxes that might appear are as Figure 4.6, Figure 4.7, Figure 4.8 and Figure 4.9 below.
In case a user wants to know how to use this program, he can click the ‘Help’ button and a ‘Help’ message box will appear. The ‘Help’ message box is as Figure 4.10.
Figure 4.6 ‘Error’ message box (1)
Figure 4.7 ‘Error’ message box (2)
Figure 4.8 ‘Error’ message box (3)
Figure 4.9 ‘Error’ message box (4)
36
Figure 4.10 ‘Help’ message box
37
4.6
Additional Features of the Program
This program is added with some additional feature to give users extra useful information. A user can view power level diagram by entering the value of power transmitted and gain of transmitter and receiver. With this feature, additional link budget for rain fade can be prepared to improve the reliability of the signals that is going to be transmited.
4.7
Example of Program Output For Predicted Rain Attenuation
This program has been run to predict rain attenuation at three different locations in Peninsular Malaysia. The locations chosen are Johor Bahru, Jelebu and Sitiawan.
The rain rate at Johor Bahru is 120.3572 mm/h while at Sitiawan is 103.575 mm/h. The rain rate at Jelebu is 96.4741 mm/h, where Jelebu is the most dry place in Malaysia.
Table 4.1 shows the output predicted by RAPS1 for these three locations.
From the table, the path length chosen is from 2.74 kilometers to 3.69 kilometers.
These path lengths are chosen according to the suitability of wireless communication in millimeter waves.
38
Table 4.1 Example of program output at three different locations in Peninsular Malaysia
Location Rain rate
Path
Rain Attenuation (dB) length 26 GHz 38 GHz
(R
0.01
in mm/h) (km) V H V H
Johor
Bahru 120.3572 2.96 41.0 55.5 62.1 73.3
3.51 47.9 64.7 72.2 85.3
Jelebu 96.4741 2.74 31.0 41.4 47.8 56.2
3.66 40.2 53.7 61.9 72.6
Sitiawan 103.5760 2.76 33.7 45.3 51.7 60.9
3.69 43.7 58.6 66.7 78.5
4.8
Analysis of the Results
The results obtained from RAPS1 program are compared to the results from
ITU-R model. The comparison is done in two parts. First comparison is done by comparing the outcome of RAPS1 with the results from ITU-R model of rain attenuation where the rain rate of 120 mm/h is used by the model. Second comparison is done by differentiating the results from RAPS1 with the results produced utilizing ITU-R reduction factor but using the local rain rate from this project
39
4.8.1 Comparison of the Output of RAPS1 with Results from ITU-R Model of
Rain Attenuation
This firs part of comparison is done to show the differences of the outputs between RAPS1 ITU-R model of rain attenuation. The comparison done is shown as
Table 4.2 and Table 4.3 below.
From Table 4.2, we can see that at 26 GHz, the percentage of differences is between 0.6% to 23.2% for Vertical polarization with and 2.9% to 26.7% for Horizontal polarization. At 38 GHz, the range of differences is between 0.8% to 22.6% for Vertical polarization and 0.4% to 22.6% for Horizontal polarization.
Obviously from these tables, the differences are quite large. Although in numbers, The ITU-R model gives slightly less attenuation due to rain, but it is not reliable due to the rain rates used by it do not represent the actual data. This will certainly affect the reliability of communication here in Malaysia, where communication designers may under estimate the rain attenuation when they want to design their circuits.
40
Table 4.2 Comparison between output from RAPS1 and ITU-R model of rain attenuation at 26 GHz
Location
Rain Attenuation (dB) at 26
GHz
Path length RAPS1 ITU-R
% of difference
(km) V H V H V H
Johor
Bahru 2.96 41.0 55.5 32.8 42.3 20.0 23.8
3.51 47.9 64.7 36.8 47.4 23.2 26.7
Jelebu 2.74 31.0 41.4 31.2 40.2 0.6 2.9
3.66 40.2 53.7 38.3 49.4 4.7 8.0
Sitiawan 2.76 33.7 45.3 31.0 40.0 8.0 11.7
3.69 43.7 58.6 38.1 49.1 12.8 16.2
Table 4.3 Comparison between output from RAPS1 and ITU-R model of rain attenuation at 38 GHz
Location
Path length
Rain Attenuation (dB) at 38
GHz
RAPS1 ITU-R
% of difference
(km) V H V H V H
Johor
Bahru 2.96 62.1 73.3 49.8 58.9 19.8 19.6
3.51 72.2 85.3 55.9 66.0 22.6 22.6
Jelebu 2.74 47.8 56.2 47.4 56.0 0.8 0.4
3.66 61.9 72.6 58.2 68.8 6.0 5.2
Sitiawan 2.76 51.7 60.9 47.1 55.6 8.9 8.7
3.69 66.7 78.5 57.9 68.3 13.2 13.0
41
4.8.2
Comparison of the Output of RAPS1 with Results Produced Utilizing ITU-R
Reduction Factor but Using the Local Rain Rate
The second comparison is done to show the significance of using Moupfouma model of path length reduction factor instead of reduction factor of ITU-R model. The comparisons for both at 26 GHz and 38 GHz are shown in Table 4.4 and Table 4.5.
From Table 4.4, it is clear that at 26 GHz, rain attenuation is lower when reduction factor from ITU-R model is used. It goes the same behavior when rain attenuation is predicted at 38 GHz, as shown in Table 4.5. The percentage of differences varies from 19.8% to 27.5% for attenuation at 26 GHz and from 19.5% to 23.6% for attenuation at 38 GHz.
These outcomes is in line with the research using experimental data by Islam
[12] where it says that the ITU-R predictions are much more lower than the measured attenuation. Consequently, the comparison clearly indicates that the percentages of differences are logical enough and should be noted by communication designers here in
Malaysia.
Table 4.4 Comparison of the output of RAPS1 with results produced utilizing ITU-R reduction factor at 26 GHz
Rain Attenuation (dB) at 26 GHz
% of difference
Location
Path length Rain rate
(R0.01 in
RAPS1
Using ITU-R reduction factor
(km)
Johor
3.51 47.9 64.7 36.9 47.6 23.0 26.4
3.66 40.2 53.7 31.2 39.8 22.4 25.9
Sitiawan 2.76 103.5760 33.7 45.3 27.0 34.6 19.9 23.6
3.69 43.7 58.6 33.2 42.5 24.0 27.5
42
Table 4.5 Comparison of the output of RAPS1 with results produced utilizing ITU-R reduction factor at 38 GHz
Location
Johor
Path length Rain rate
(R0.01 in
Rain Attenuation (dB) at 38 GHz
RAPS1
Using ITU-R reduction factor
% of difference
(km)
3.51 72.2 85.3 56.0 66.1 22.4 22.5
3.66 61.9 72.6 48.3 56.8 22.0 21.8
Sitiawan 2.76 103.5760 51.7 60.9 41.5 48.9 19.7 19.7
3.69 66.7 78.5 51.0 60.0 23.5 23.6
43
CHAPTER 5
CONCLUSION AND PROPOSED FUTURE WORKS
This chapter concludes the research and the results obtained. It also covers the proposed future works that can be implemented by future researchers to further enhance this project.
5.1
Conclusion
The objectives of this project are successfully achieved where the program to predict rain attenuation is built using MATLAB 7.0. Besides using local data rain obtained from previous research in UTM, this program uses Moupfouma model as its reduction factor which is recommended to be used to calculate rain attenuation in
Malaysia.
The simulated results obtained from this program are reliable as it shows the accurateness of rain attenuation prediction. The accuracy of the results is supported by the experimental data done by researches here in Malaysia [12]. These results can be referred by communication designers to design reliable communication circuits in
Malaysia, particularly in Peninsular Malaysia.
45
5.2
Proposed Future Works
The usage of Moupfouma model as a reduction factor is based on outcome from a research in year 2000. Rain rate and rain attenuation data collected from two different locations in Malaysia have been used for the experiment by the researchers. If it is possible, the research on reduction factor has to be done for further verification on the effectiveness of the Moupfouma model to be used in Malaysia.
This program also can be upgraded to predict rain attenuation in East Malaysia as well. This however requires data rain of that particular region to be collected first. If this can be done, then this program is hundred percent reliable to be used in Malaysia.
46
REFERENCES
1.
Lehpamer, H. Microwave Transmission Networks Planning, Design, and
Deployment. United States: McGraw-Hill. 2004.
2.
Yunjiang Liu; Guoce Huang; Shunchun Zhen. Performance Analysis of Ka-
Band Satellite Channel Capacity in the Presence of Rain Attenuation.
Proceedings of the Microwave and Milimeter Wave Technology, 2004.
ICMMT 4th International Conference. 18-21 Aug. IEEE. 2004. 175-177.
3.
Freeman, R.L. Radio System Design for Telecommunications. United States:
John Wiley & Sons. 1997.
4.
Khajepiri, F.; Ghorbanii, A.; Amindavar, H. A new method for estimating rain attenuation at high frequencies. Proceedings of the 9th International
Seminar/Workshop on Direct and Inverse Problems of Electromagnetic and
Acoustic Wave Theory,2004. 11-14 Oct. IEEE. 2004. 43-46
5.
Yagasena, A.; Hassan, S.I.S. Worst-month rain attenuation statistics for satellite Earth link design at Ku-band in Malaysia. Proceedings TENCON
2000. Volume 24-27 Sept.IEEE. 2000. 122-125.
6.
Rec. ITU-R PN.837-1. Characteristic of precipitation for propagation modeling. PN Series Volume. ITU. Geneva. 1994.
47
7.
Rec. ITU-R P.837-4. Characteristics of precipitation for propagation modeling. ITU. Geneva. 2003.
8.
Crane, K.R. Prediction of the Effects of Rain on Satellite Communication
Systems. Proceedings of the IEEE, Vol. 65, No.3. IEEE. 1977. 456-474.
9.
MR. PC+ (1995). “Microwave radio path calculations plus”, Version 2.4,
Harris Corporation, Farinon Division.
10.
Bernhardsen, Tor. Geographic Information Systems, An Introduction. John
Wiley & Sons, Inc. Norway. 2001.
11.
Worboys,M, Duckham, M. GIS A Computing Perspective. CRC Press.
US.2004.
12.
Islam, M.R.; Tharek, A.R.; Chebil, J. Comparison between path length reductionfactor models based on rain attenuation measurements in Malaysia.
Asia Pacific Microwave Conference. 3-6 Dec. IEEE. 2000. 1556-1560.
13.
Moupfouma, F. Improvement of a rain attenuation prediction method for terrestrial microwave links. IEEE Transaction on Antennas and Propagation
[legacy, pre-1988] Volume 32. Dec 1984. IEEE. 1368-1372.
14.
Rec. ITU-R p.530-12. Propagation data and prediction methods required for the design of terrestrial line-of-sight systems. ITU. Geneva. 2007.
15.
Chebil J. Rain Rate and Rain Attenuation Distribution For Microwave
Propagation Study in Malaysia. Ph.D. Thesis. Faculty of Electrical
Engineering,University of Technology Malaysia (UTM). 1997
48
16.
Chapman, S.J. MATLAB ® Programming for Engineers. Second Edition.
Canada: Brooks/Cole. 2002.
APPENDIX A
MATLAB Self Generated Code for Introductory Window function varargout = RAPS1(varargin)
% RAPS1 M-file for RAPS1.fig
% RAPS1 by itself, creates a new RAPS1 or raises the
% existing singleton*.
% H = RAPS1 returns the handle to a new RAPS1 or the handle to
% the existing singleton*.
% RAPS1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RAPS1.M with the given input arguments.
% RAPS1('Property','Value',...) creates a new RAPS1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before RAPS1_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to RAPS1_OpeningFcn via varargin.
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
49
% Edit the above text to modify the response to help RAPS1
% Last Modified by GUIDE v2.5 25-Mar-2002 12:19:15
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @RAPS1_OpeningFcn, ...
'gui_OutputFcn', @RAPS1_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []); if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1}); end if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else
gui_mainfcn(gui_State, varargin{:}); end
% End initialization code - DO NOT EDIT
% --- Executes just before RAPS1 is made visible. function RAPS1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to RAPS1 (see VARARGIN)
% Choose default command line output for RAPS1 handles.output = 'Yes';
50
% Update handles structure guidata(hObject, handles);
% Insert custom Title and Text if specified by the user
% Hint: when choosing keywords, be sure they are not easily confused
% with existing figure properties. See the output of set(figure) for
% a list of figure properties. if(nargin > 3)
for index = 1:2:(nargin-3),
if nargin-3==index, break, end
switch lower(varargin{index})
case 'title'
set(hObject, 'Name', varargin{index+1});
case 'string'
set(handles.text1, 'String', varargin{index+1});
end
end end
% Determine the position of the dialog - centered on the callback figure
% if available, else, centered on the screen
FigPos=get(0,'DefaultFigurePosition');
OldUnits = get(hObject, 'Units'); set(hObject, 'Units', 'pixels');
OldPos = get(hObject,'Position');
FigWidth = OldPos(3);
FigHeight = OldPos(4); if isempty(gcbf)
ScreenUnits=get(0,'Units');
set(0,'Units','pixels');
ScreenSize=get(0,'ScreenSize');
51
set(0,'Units',ScreenUnits);
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
FigPos(2)=2/3*(ScreenSize(4)-FigHeight); else
GCBFOldUnits = get(gcbf,'Units');
set(gcbf,'Units','pixels');
GCBFPos = get(gcbf,'Position');
set(gcbf,'Units',GCBFOldUnits);
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2]; end
FigPos(3:4)=[FigWidth FigHeight]; set(hObject, 'Position', FigPos); set(hObject, 'Units', OldUnits);
% Show a question icon from dialogicons.mat - variables questIconData
% and questIconMap load dialogicons.mat
IconData=questIconData; questIconMap(256,:) = get(handles.figure1, 'Color');
IconCMap=questIconMap;
Img=image(IconData, 'Parent', handles.axes1); set(handles.figure1, 'Colormap', IconCMap); set(handles.axes1, ...
'Visible', 'off', ...
'YDir' , 'reverse' , ...
'XLim' , get(Img,'XData'), ...
52
'YLim' , get(Img,'YData') ...
);
% Make the GUI modal set(handles.figure1,'WindowStyle','modal')
% UIWAIT makes RAPS1 wait for user response (see UIRESUME) uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = RAPS1_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure varargout{1} = handles.output;
% The figure can be deleted now delete(handles.figure1);
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) handles.output = get(hObject,'String');
% Update handles structure guidata(hObject, handles);
53
% Use UIRESUME instead of delete because the OutputFcn needs
% to get the updated handles structure. uiresume(handles.figure1);
% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) handles.output = get(hObject,'String');
% Update handles structure guidata(hObject, handles);
% Use UIRESUME instead of delete because the OutputFcn needs
% to get the updated handles structure. uiresume(handles.figure1);
%close(handles.figure1);
% --- Executes when user attempts to close figure1. function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) if isequal(get(handles.figure1, 'waitstatus'), 'waiting')
% The GUI is still in UIWAIT, us UIRESUME
uiresume(handles.figure1); else
54
% The GUI is no longer waiting, just close it
delete(handles.figure1); end
% --- Executes on key press over figure1 with no controls selected. function figure1_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Check for "enter" or "escape" if isequal(get(hObject,'CurrentKey'),'escape')
% User said no by hitting escape
handles.output = 'No';
% Update handles structure
guidata(hObject, handles);
uiresume(handles.figure1); end if isequal(get(hObject,'CurrentKey'),'return')
uiresume(handles.figure1); end
55
APPENDIX B
MATLAB Self Generated Code for Main Working Window function varargout = Projek2c(varargin)
% PROJEK2C M-file for Projek2c.fig
% PROJEK2C, by itself, creates a new PROJEK2C or raises the existing
% singleton*.
% H = PROJEK2C returns the handle to a new PROJEK2C or the handle to
% the existing singleton*.
% PROJEK2C('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PROJEK2C.M with the given input arguments.
% PROJEK2C('Property','Value',...) creates a new PROJEK2C or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Projek2c_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Projek2c_OpeningFcn via varargin.
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
56
% Edit the above text to modify the response to help Projek2c
% Last Modified by GUIDE v2.5 15-Feb-2008 14:36:40
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Projek2c_OpeningFcn, ...
'gui_OutputFcn', @Projek2c_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []); if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1}); end if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else
gui_mainfcn(gui_State, varargin{:}); end
% End initialization code - DO NOT EDIT
% --- Executes just before Projek2c is made visible. function Projek2c_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Projek2c (see VARARGIN)
% Choose default command line output for Projek2c handles.output = hObject;
57
% Update handles structure guidata(hObject, handles);
% UIWAIT makes Projek2c wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = Projek2c_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure varargout{1} = handles.output; function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
58
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
59
% --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
60
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit6 as text
% str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
61
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit7 as text
% str2double(get(hObject,'String')) returns contents of edit7 as a double
% --- Executes during object creation, after setting all properties. function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
62
end function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as text
% str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9 as text
% str2double(get(hObject,'String')) returns contents of edit9 as a
63
% --- Executes during object creation, after setting all properties. function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit10 as text
% str2double(get(hObject,'String')) returns contents of edit10 as a double
% --- Executes during object creation, after setting all properties. function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
64
end function edit11_Callback(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit11 as text
% str2double(get(hObject,'String')) returns contents of edit11 as a double
% --- Executes during object creation, after setting all properties. function edit11_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit12 as text
% str2double(get(hObject,'String')) returns contents of edit12 as a double
% --- Executes during object creation, after setting all properties.
65
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end
% --- Executes on selection change in popupmenu1. function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
%To read polarity from popupmenu
% --- Executes during object creation, after setting all properties. function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
66
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit13 as text
% str2double(get(hObject,'String')) returns contents of edit13 as a double
% --- Executes during object creation, after setting all properties. function edit13_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles)
67
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) function edit14_Callback(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit14 as text
% str2double(get(hObject,'String')) returns contents of edit14 as a double
% --- Executes during object creation, after setting all properties. function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end
68
function edit16_Callback(hObject, eventdata, handles)
% hObject handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit16 as text
% str2double(get(hObject,'String')) returns contents of edit16 as a double
% --- Executes during object creation, after setting all properties. function edit16_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end
% --- Executes on key press over figure1 with no controls selected. function figure1_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes when user attempts to close figure1. function figure1_CloseRequestFcn(hObject, eventdata, handles)
69
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure delete(hObject); function edit17_Callback(hObject, eventdata, handles)
% hObject handle to edit17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit17 as text
% str2double(get(hObject,'String')) returns contents of edit17 as a double
% --- Executes during object creation, after setting all properties. function edit17_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit18_Callback(hObject, eventdata, handles)
% hObject handle to edit18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit18 as text
70
% str2double(get(hObject,'String')) returns contents of edit18 as a double
% --- Executes during object creation, after setting all properties. function edit18_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit19_Callback(hObject, eventdata, handles)
% hObject handle to edit19 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit19 as text
% str2double(get(hObject,'String')) returns contents of edit19 as a double
% --- Executes during object creation, after setting all properties. function edit19_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit19 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white');
71
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit20_Callback(hObject, eventdata, handles)
% hObject handle to edit20 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit20 as text
% str2double(get(hObject,'String')) returns contents of edit20 as a double
% --- Executes during object creation, after setting all properties. function edit20_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit20 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER. if ispc
set(hObject,'BackgroundColor','white'); else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end
% --- Executes on button press in pushbutton4. function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton6. function pushbutton6_Callback(hObject, eventdata, handles)
72
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
73
74
APPENDIX C
MATLAB Code Associated with ‘Predict’ Pushbutton of Main Working Window
load raindata;
load coefficient;
%To read and convert string to number for latitude of station A
A1=findobj(gcbf,'Tag','edit1');
Lat1a=str2double(get(A1,'string')); u1=[Lat1a];
A2=findobj(gcbf,'Tag','edit2');
Lat2a=str2double(get(A2,'string')); u2=[Lat2a];
A3=findobj(gcbf,'Tag','edit3');
Lat3a=str2double(get(A3,'string')); u3=[Lat3a];
%To read and convert string to number for logitude of station A
A11=findobj(gcbf,'Tag','edit4');
Long1a=str2double(get(A11,'string')); u11=[Long1a];
A22=findobj(gcbf,'Tag','edit5');
Long2a=str2double(get(A22,'string')); u22=[Long2a];
A33=findobj(gcbf,'Tag','edit6');
Long3a=str2double(get(A33,'string')); u33=[Long3a];
%To read and convert string to number for latitude of station B
B1=findobj(gcbf,'Tag','edit7');
Lat1b=str2double(get(B1,'string')); v1=[Lat1b];
B2=findobj(gcbf,'Tag','edit8');
Lat2b=str2double(get(B2,'string')); v2=[Lat2b];
B3=findobj(gcbf,'Tag','edit9');
Lat3b=str2double(get(B3,'string')); v3=[Lat3b];
%To read and convert string to number for logitude of station B
B11=findobj(gcbf,'Tag','edit10');
Long1b=str2double(get(B11,'string')); v11=[Long1b];
B22=findobj(gcbf,'Tag','edit11');
Long2b=str2double(get(B22,'string')); v22=[Long2b];
75
76
B33=findobj(gcbf,'Tag','edit12');
Long3b=str2double(get(B33,'string')); v33=[Long3b];
%Conversion of Latitude and Longitude of both station to decimal degree
Lata=(((Lat3a./60)+Lat2a)./60)+Lat1a;
LatA=round(20*Lata);
Longa=(((Long3a./60)+Long2a)./60)+Long1a;
LongA=round(20*Longa);
Latb=(((Lat3b./60)+Lat2b)./60)+Lat1b;
LatB=round(20*Latb); if
Longb=(((Long3b./60)+Long2b)./60)+Long1b;
LongB=round(20*Longb);
((Lata<1.4|Lata>6.6)|(Longa<99.6|Longa>104.3)|(Latb<1.4|Latb>6.6)|(Longb<99.6|Lon gb>104.3)) errordlg('Error,Latitude and Longitude must be between (1.5-5.4) and (99.8-103.9) in decimal degree.Please reenter new value','Error') return end
%To read frequency entered fr=findobj(gcbf,'Tag','edit13'); fre=get(fr,'string'); freq=str2double(fre); d=[freq];
77 if(isempty(d)|freq<1|freq>50) errordlg('Value of frequency entered invalid. Valid range is between 1-50 GHz.','Error') return end
%To read either vertical or horizontal pol=findobj(gcbf,'Tag','popupmenu1'); val=get(pol,'Value'); switch val
case 1
i=1;
case 2 i=2; end
%ITU-R interpolation in case the desired frequency entered is not in the list a=exp(interp1(log(f_itu),log(alist(:,i)),log(freq))); b=interp1(log(f_itu),blist(:,i),log(freq));
%To find the estimated rain rate
[XI,YI]=meshgrid(1.5:0.05:6.4,99.8:0.05:103.9);
ZI=griddata(x,y,z,XI,YI,'nearest');
[k,j]=find(round(20*XI)==LatA&round(20*YI)==LongA); y=[k,j];
78
[l,m]=find(round(20*XI)==LatB&round(20*YI)==LongB); g=[l,m]; if (isempty(y)|isempty(g)) errordlg('The Latitude and Longitude box cannot be left out empty,please put numeric 0 if the value for any box is zero.','Error') return end
Rainrate1=ZI(k(1),j(1));
Rainrate2=ZI(l(1),m(1)); if (Rainrate1>Rainrate2)
Rs=Rainrate1; else
Rs=Rainrate2; end if (isempty(Rs)) errordlg('Sorry, this program cannot predict rain attenuation for this location. Please check the Latitude and Longitude values.','Error') return end
%Go to Hop Length function
Hoplength=hoplength(Lata,Longa,Latb,Longb);
HL=Hoplength; if (HL>58)
errordlg('The maximum path length allowable is 58 km. This program cannot be proceeded.','Error'); return end
%To calculate reduction factor base on Moupfouma's formula psi=1.4*(10^-4)*(freq^1.76); em=1+(psi*(logm(HL))); if (HL<50)
rf=1./(1+((0.03)*(1^-0.45)*(HL^em))); else
rf=1./(1+((0.03)*(1^-0.36)*(HL^em))); end
%To calculate overall predicted rain attenuation
Pred_att=a*(round(Rs).^b)*HL*rf;
%To display the result of predicted rain attenuation qHndl=findobj(gcbf,'Tag','edit14'); q=get(gcbo,'string'); q=Pred_att; set(qHndl,'string',sprintf('%.1f',q));
%To display the result of hop length lHndl=findobj(gcbf,'Tag','edit16'); l=get(gcbo,'string');
79
l=HL; set(lHndl,'string',sprintf('%3.2f',l)); format short; clear A1 Lat1a A2 Lat2a A3 Lat3a A11 Long1a A22 Long2a A33 Long3a clear B1 Lat1b B2 Lat2b B3 Lat3b B11 Long1b B22 Long2b B33 Long3b clear Lata LatA Longa LongA Latb LatB Longb LongB clear pol var x_str Polar fr fre freq a b clear i j l m Rainrate1 Rainrate2 Rs Pred_att Hoplength clear 1Hndl1qHndl q Hl ZI
80
81
APPENDIX D
MATLAB Code Associated with ‘Calculate and Plot’ Pushbutton of Main Working
Window
%To read power transmit, transmitter gain and receiver gain entered
P1=findobj(gcbf,'Tag','edit17');
PT=str2double(get(handles.edit17,'string'));
P2=findobj(gcbf,'Tag','edit18');
GT=str2double(get(handles.edit18,'string'));
P3=findobj(gcbf,'Tag','edit19');
GR=str2double(get(handles.edit19,'string'));
load raindata;
load coefficient;
%To read and convert string to number for latitude of station A
A1=findobj(gcbf,'Tag','edit1');
Lat1a=str2double(get(A1,'string')); u1=[Lat1a];
A2=findobj(gcbf,'Tag','edit2');
Lat2a=str2double(get(A2,'string'));
u2=[Lat2a];
A3=findobj(gcbf,'Tag','edit3');
Lat3a=str2double(get(A3,'string')); u3=[Lat3a];
%To read and convert string to number for logitude of station A
A11=findobj(gcbf,'Tag','edit4');
Long1a=str2double(get(A11,'string')); u11=[Long1a];
A22=findobj(gcbf,'Tag','edit5');
Long2a=str2double(get(A22,'string')); u22=[Long2a];
A33=findobj(gcbf,'Tag','edit6');
Long3a=str2double(get(A33,'string')); u33=[Long3a];
%To read and convert string to number for latitude of station B
B1=findobj(gcbf,'Tag','edit7');
Lat1b=str2double(get(B1,'string')); v1=[Lat1b];
B2=findobj(gcbf,'Tag','edit8');
Lat2b=str2double(get(B2,'string')); v2=[Lat2b];
B3=findobj(gcbf,'Tag','edit9');
82
Lat3b=str2double(get(B3,'string')); v3=[Lat3b];
%To read and convert string to number for logitude of station B
B11=findobj(gcbf,'Tag','edit10');
Long1b=str2double(get(B11,'string')); v11=[Long1b];
B22=findobj(gcbf,'Tag','edit11');
Long2b=str2double(get(B22,'string')); v22=[Long2b];
B33=findobj(gcbf,'Tag','edit12');
Long3b=str2double(get(B33,'string')); v33=[Long3b];
%Conversion of Latitude and Longitude of both station to decimal degree
Lata=(((Lat3a./60)+Lat2a)./60)+Lat1a;
LatA=round(20*Lata);
Longa=(((Long3a./60)+Long2a)./60)+Long1a;
LongA=round(20*Longa);
Latb=(((Lat3b./60)+Lat2b)./60)+Lat1b;
LatB=round(20*Latb);
Longb=(((Long3b./60)+Long2b)./60)+Long1b;
LongB=round(20*Longb);
83
84 if
((Lata<1.4|Lata>6.6)|(Longa<99.6|Longa>104.3)|(Latb<1.4|Latb>6.6)|(Longb<99.6|Lon gb>104.3)) errordlg('Error,Latitude and Longitude must be between (1.5-5.4) and (99.8-103.9) in decimal degree.Please reenter new value','Error') return end
%To read frequency entered fr=findobj(gcbf,'Tag','edit13'); fre=get(fr,'string'); freq=str2double(fre); d=[freq]; if(isempty(d)|freq<1|freq>50) errordlg('Value of frequency entered invalid. Valid range is between 1-50 GHz.','Error') return end
%To read either vertical or horizontal pol=findobj(gcbf,'Tag','popupmenu1'); val=get(pol,'Value'); switch val
case 1
i=1;
case 2 i=2; end
85
%ITU-R interpolation in case the desired frequency entered is not in the list a=exp(interp1(log(f_itu),log(alist(:,i)),log(freq))); b=interp1(log(f_itu),blist(:,i),log(freq));
%To find the estimated rain rate
[XI,YI]=meshgrid(1.5:0.05:6.4,99.8:0.05:103.9);
ZI=griddata(x,y,z,XI,YI,'nearest');
[k,j]=find(round(20*XI)==LatA&round(20*YI)==LongA); y=[k,j];
[l,m]=find(round(20*XI)==LatB&round(20*YI)==LongB); g=[l,m]; if (isempty(y)|isempty(g)) errordlg('The Latitude and Longitude box cannot be left out empty,please put numeric 0 if the value for any box is zero.','Error') return end
Rainrate1=ZI(k(1),j(1));
Rainrate2=ZI(l(1),m(1)); if (Rainrate1>Rainrate2)
Rs=Rainrate1; else
Rs=Rainrate2; end if (isempty(Rs)) errordlg('Sorry, this program cannot predict rain attenuation for this location. Please check the Latitude and Longitude values.','Error') return end
%Go to Hop Length function
Hoplength=hoplength(Lata,Longa,Latb,Longb);
HL=Hoplength; if (HL>58)
errordlg('The maximum path length allowable is 58 km. This program cannot be proceeded.','Error'); return end
%To calculate reduction factor base on Moupfouma's formula psi=1.4*(10^-4)*(freq^1.76); em=1+(psi*(logm(HL))); if (HL<50)
rf=1./(1+((0.03)*(1^-0.45)*(HL^em))); else
86
rf=1./(1+((0.03)*(1^-0.36)*(HL^em))); end
%To calculate overall predicted rain attenuation
Pred_att=a*(round(Rs).^b)*HL*rf; qHndl=findobj(gcbf,'Tag','edit14'); q=get(gcbo,'string'); q=Pred_att;
LS=32.45+(20*log10(freq*1000))+(20*log10(HL));
PR=PT+GT+GR-LS-q;
PHndl=findobj(gcbf,'Tag','edit20');
P=get(gcbo,'string');
P=PR; set(PHndl,'string',sprintf('%.1f',P)); axes(handles.axes4);
%h=axes('XColor',[1 1 1],'YColor',[1 1 1]); x=[1 2 3 4 5]; y=[PT (PT+GT) (PT+GT-LS) (PT+GT-LS-q) (PT+GT-LS-q+GR)]; plot(x,y,'-or','LineWidth',2) set(handles.axes4,'XMinorTick','on') text(1,PT,'\ PT','HorizontalAlignment','left') text(2,(PT+GT),'\ PT+GT','HorizontalAlignment','left') text(3,(PT+GT-LS),'PT+GT-LS \','HorizontalAlignment','right') text(4,(PT+GT-LS-q),'PT+GT-LS-LR \','HorizontalAlignment','right') text(5,(PT+GT-LS-q+GR),'PT+GT-LS-LR+GR \','HorizontalAlignment','right')
87
title('POWER LEVEL DIAGRAM','Color','w'); xlabel('BLOCKS','Color','w'); ylabel('POWER LEVEL (dBm)','Color','w');
88
APPENDIX E
MATLAB Code for Hoplength Function function Hlength=Hoplength(Lata,Longa,Latb,Longb)
Lat_list=[0 1 2 3 4 5 6 7]';
Am_list=[-1.490273 -1.490274 -1.490275 -1.490277 -1.490281 -1.490285 -1.490289 -
1.490295]';
Bm_list=[0.002949 0.002949 0.002946 0.002941 0.002935 0.002927 0.002917
0.002906]';
%To calculate the difference between Lata and Longa and Latb and Longb format long; delta_phi=abs(3600*(Lata-Latb)); delta_gamma=abs(3600*(Longa-Longb)); if(Lata>Latb)
phi=Latb; else
phi=Lata; end phiem=phi+delta_phi/(2*3600);
89
%Calculation with conversion from degree to radian if(delta_gamma==0&delta_phi==0)
sumone=log10(cos((pi/180)*phim))+log10(eps); elseif(delta_gamma==0&delta_phi~=0)
sumone=log10(cos((pi/180)*phiem)); else
sumone=log10(cos((pi/180)*phiem))+log10(delta_gamma); end xx=fix(Lata); nn=find(Lat_list==xx);
Log_Am=Am_list(nn);
Log_Bm=Bm_list(nn); if(delta_gamma==0&delta_phi==0)
Azisum=Log_Bm+log10(cos((pi/180)*phiem))+log10(eps); elseif(delta_gamma==0&delta_phi~=0)
Azisum=Log_Bm+log10(cos((pi/180)*phiem)); else
Azisum=Log_Bm+log10(cos((pi/180)*phiem))+log10(delta_gamma); end if(delta_phi==0)
Azidiff=Azisum-log10(eps); else
Azidiff=Azisum-log10(delta_phi);
Cot_w=10.^(Azidiff); ww=acot(Cot_w);
90
zz=cos(ww); if(zz==0)
diffone=sumone-Log_Am-log10(eps); else
diffone=sumone-Log_Am-log10(zz); end
%Final result for hoplength
HL=(10.^(diffone))/1000; format short;
Hlength=HL; clear delta_phi delta_gamma phi phiem sumone clear xx nn Log_Am Log_Bm Azisum Azidiff Cot_w clear ww diffone HL end
91