an interactive simulation for flat fading

6
1 An Interactive Simulation for Flat Fading P.Marichamy*, J.Senthilkumar and V.Vijayarangan ECE Dept., National Engineering College Kovilpatti -628 503, India. * Nizwa College of Technology, Sultanate of Oman Email: {pmarichamy, senvimjag, vijayvrangan} @yahoo.com Abstract Behavior of the Fading can be analyzed through computer simulation. In this paper, a computer simulation has been developed newly using both MATLAB and Visual Basic programming languages. MATLAB is used to simulate the fading phenomenon, whereas Visual Basic is used to create a visual user environment for interactive simulation. Further, the use of Visual Basic facilitates us to convert the developed simulation program into an executable package. The executable package has an advantage of carrying out the simulation on any Windows Operating System based machines without the requirement of MATLAB and Visual Basic. 1. Introduction Wireless mobile communications have become one of the most essential communication facilities of today. In mobile communication, a principle problem with the propagation environment is the rapid variation in received signal strength as the communicating parties move. Such rapid variation in received signal strength is termed as fading [1]. The presence of fading affects the QoS of the system. For a system to work properly, a thorough investigation on fading characteristics is required prior to design and installation. This investigation is possible by means of field observation and computer simulation. Simulation can be carried out using either traditional programming languages such as C/C++ [2] or special programming languages such as MATLAB [3]. MATLAB's ease of use relative to traditional programming languages has made it more attractive for use in academic and industrial software developments. The main objective of this paper is to develop a user-friendly interactive simulation program and to run the simulation on any Windows Operating System based machines without the requirement of the programming languages on which simulation was developed. In this paper MATLAB has been considered for its ease of use to develop a program for fading simulation. It’s built in GUI functions also can be utilized to have user-friendly visual environment for interaction. However, it doesn’t have the facility to create an executable package. Therefore, simulation cannot be performed on the computers which are not loaded with MATLAB software. To avoid this difficulty Visual Basic programming language has been considered along with the MATLAB. Visual Basic has a facility to create an executable package by linking MATLAB files. This executable package makes the simulation run on any Windows Operating System based machines without the requirement of MATLAB as well as Visual Basic languages. The paper is organized as follows: Section 2 briefly describes the flat fading mechanism and its representation in terms of probability density functions. A procedure to simulate flat fading using MATLAB has been explained in Section 3. In Section 4, the creation of visual user environment using Visual Basic for interaction is described. A procedure to convert the simulation program into a single executable package has been described in Section 5. Finally, conclusions are given in Section 6. 2. Fading In mobile environment, fading can be categorized into large-scale fading and small-scale fading. Large-scale fading represents the average signal power attenuation or path loss due to motion over large areas, whereas small scale fading represents the short-term fluctuation in the signal amplitude due to multipath. Small-

Upload: bonnugroho

Post on 18-Nov-2014

104 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: An Interactive Simulation for Flat Fading

1

An Interactive Simulation for Flat Fading P.Marichamy*, J.Senthilkumar and V.Vijayarangan

ECE Dept., National Engineering College Kovilpatti -628 503, India.

* Nizwa College of Technology, Sultanate of Oman Email: pmarichamy, senvimjag, vijayvrangan @yahoo.com

Abstract Behavior of the Fading can be analyzed through computer simulation. In this paper, a computer simulation has been developed newly using both MATLAB and Visual Basic programming languages. MATLAB is used to simulate the fading phenomenon, whereas Visual Basic is used to create a visual user environment for interactive simulation. Further, the use of Visual Basic facilitates us to convert the developed simulation program into an executable package. The executable package has an advantage of carrying out the simulation on any Windows Operating System based machines without the requirement of MATLAB and Visual Basic. 1. Introduction Wireless mobile communications have become one of the most essential communication facilities of today. In mobile communication, a principle problem with the propagation environment is the rapid variation in received signal strength as the communicating parties move. Such rapid variation in received signal strength is termed as fading [1]. The presence of fading affects the QoS of the system. For a system to work properly, a thorough investigation on fading characteristics is required prior to design and installation. This investigation is possible by means of field observation and computer simulation. Simulation can be carried out using either traditional programming languages such as C/C++ [2] or special programming languages such as MATLAB [3]. MATLAB's ease of use relative to traditional programming languages has made it more attractive for use in academic and industrial software developments. The main objective of this paper is to develop a user-friendly interactive simulation program and to run the

simulation on any Windows Operating System based machines without the requirement of the programming languages on which simulation was developed. In this paper MATLAB has been considered for its ease of use to develop a program for fading simulation. It’s built in GUI functions also can be utilized to have user-friendly visual environment for interaction. However, it doesn’t have the facility to create an executable package. Therefore, simulation cannot be performed on the computers which are not loaded with MATLAB software. To avoid this difficulty Visual Basic programming language has been considered along with the MATLAB. Visual Basic has a facility to create an executable package by linking MATLAB files. This executable package makes the simulation run on any Windows Operating System based machines without the requirement of MATLAB as well as Visual Basic languages. The paper is organized as follows: Section 2 briefly describes the flat fading mechanism and its representation in terms of probability density functions. A procedure to simulate flat fading using MATLAB has been explained in Section 3. In Section 4, the creation of visual user environment using Visual Basic for interaction is described. A procedure to convert the simulation program into a single executable package has been described in Section 5. Finally, conclusions are given in Section 6. 2. Fading In mobile environment, fading can be categorized into large-scale fading and small-scale fading. Large-scale fading represents the average signal power attenuation or path loss due to motion over large areas, whereas small scale fading represents the short-term fluctuation in the signal amplitude due to multipath. Small-

Page 2: An Interactive Simulation for Flat Fading

2

scale fading can be further classified as flat or frequency selective [1]. A received signal is said to undergo flat fading, if the mobile radio channel has a constant gain and a linear phase response over a bandwidth larger than the bandwidth of the transmitted signal. Under these conditions, the received signal has amplitude fluctuations due to the variations in the channel gain over time due to multipath. However, the spectral characteristics of the transmitted signal remain intact at the receiver. On the other hand, if the mobile radio channel has a constant gain and linear phase response over a bandwidth smaller than that of the transmitted signal, the transmitted signal is said to undergo frequency selective fading [4]. Main focus of this paper is to simulate the flat fading phenomenon. Major probabilistic models that characterize the flat fading are: Rayleigh Statistical Model, Rician Statistical Model and Nakagami model. 2.1 Rayleigh Fading Model The mobile antenna receives a number of reflected and scattered waves. If we assume that there is no direct path or line-of sight (LOS) component, the received signal s(t) due to unmodulated carrier can be expressed as [1].

)cos()(1

tc

N

tt tats φω +=∑

=

(1)

where N is the number of paths. The phase φt is a random variable, which depends on the varying path lengths. In the case of an unmodulated carrier, the transmitted signal at frequency is the transmitted signal frequency and at is the amplitude of the signal at the tth path. By incorporating the Doppler effect due to motion, the received signal s(t) can now be written as

(2) )cos()(1

idic

N

tt ttats φωω ++= ∑

=

where wd is the Doppler frequency due to motion. Now, the signal can be expressed interms of inphase and quadrature components as,

ttQttIts cc ωω sin)(cos)()( −= (3)

From the above equation, the envelope R of the received signal can be written as

[ ] [ ]22 )()( tQtIR += (4)

When N is large, the inphase and quadrature components will be Gaussian. The envelope R varies in time according to the Rayleigh distribution. The Rayleigh distribution function f(r) is given by

0,2

exp)( 22 ≥⎭⎬⎫

⎩⎨⎧−= rrrrf

σσ (5)

where r is the envelope amplitude of the received signal, and 2σ2 is the predetection mean power of the multipath signal. 2.2 Rician Fading Model The Rician distribution is observed when, in addition to the multipath components, there exists a direct path. In the presence of such a path, the transmitted signal given in eqn. (2) can be written as [1][3]

(6)

)cos()cos()(1

ttkttats dcdidic

N

tt ωωφωω ++++=∑

=

where the constant kd is the strength of the direct component, dω is the Doppler shift along the LOS path, and tdω are the Doppler shifts along the indirect paths. The envelope in this case has a Rician density function given by

0,2

exp)( 22

22

2 ≥⎟⎠⎞

⎜⎝⎛

⎪⎭

⎪⎬⎫

⎪⎩

⎪⎨⎧ +−= r

rkI

krrrf do

d

σσσ (7)

where Io( ) is the zeroth order modified Bessel function of the first kind. The cumulative distribution of the Rician random variable is given as

0,,1)( 2 ≥⎟⎠⎞

⎜⎝⎛−= rrk

QrF d

σσ (8)

where Q( , ) is the Marcum’s Q function. The Rician distribution is often described in terms of the Rician factor K, defined as the

Page 3: An Interactive Simulation for Flat Fading

3

ratio between the deterministic signal power (from the direct path) and the diffuse signal power (from the indirect paths). K is usually expressed in decibels as

⎟⎟⎠

⎞⎜⎜⎝

⎛= 2

2

10 2log10)(

σdk

dBK (9)

In equation (9), if kd goes to zero (or if 2222 22 σσ rkd << ), the direct path is

eliminated and the envelope distribution becomes Rayleigh, with K(dB) = - ∞. 2.3 Nakagami-m Model It is possible to describe both Rayleigh and Rician fading with the help of a single model using the Nakagami distribution [5]. The fading model for the received signal envelope, proposed by Nakagami, has the pdf given by

0,exp)(

2)(212

≥⎭⎬⎫

⎩⎨⎧

Ω−

ΩΓ=

rmrm

rmrf n

mm

(10)

where G(m) is the Gamma function, and m is the shape factor (with the constraint that m = ½)

[ ] 222

22

)(rErErEm

−= (11)

The parameter Ω controls the spread of the distribution and is given by

2rE=Ω (12)

The corresponding cumulative distribution function can be expressed as

⎟⎟⎠

⎞⎜⎜⎝

⎛Ω

= mmrPrF ,)(2

(13)

where P( , ) is the incomplete Gamma function. In the special case m = 1, Nakagami reduces to Rayleigh distribution. For m > 1, the fluctuations of the signal strength is lower compared to Rayleigh fading, and Nakagami tends to Rician.

3. MATLAB Simulation

The multipath faded signal has been simulated using MATLAB. From the simulation, the relationship between the number of paths and statistics of the received signal can be studied. The received signal at a given instant of time for a stationary receiver can be generated using the eqn.1. Generating the signal using eqn.2 allows the inclusion of Doppler effect due to user’s mobility. The path amplitudes are taken as Weibull-distributed random variables [3], which can be generated using the function weibrnd from the Statistics Toolbox. The two-parameter Weibull distribution allows the variation of the mean and variance of the scattering amplitudes. The phases are taken to be uniform in between 0 and 2π and this is generated using the function unifrnd from the Statistics Toolbox. The inphase and quadrature components, of the simulated signal has been obtained using the command demod( , , ,’qam’). Then the envelope of the received signal is obtained using eqn.4. Numerical values for the velocity of the mobile, carrier frequency and number of paths are entered as input for the simulation. Number of signal samples generated in a single iteration of simulation has been taken to be four times the carrier frequency. The variations in the received signal strength due to Rayleigh fading is shown in Fig.1. The generated samples are found to follow the Rayleigh distribution as expected after about 40 iterations. This trend is shown in Fig.2. Probability distribution curve of the simulated samples closely follows the theoretical Rayleigh distribution curve.

Page 4: An Interactive Simulation for Flat Fading

4

Fig.1 Rayleigh faded RF signal

Fig.2 Rayleigh distribution function of the received signal.

For the simulation of Rician distributed fading a direct path has to be considered. To incorporate the presence of direct path component the eqn.6 has been considered. A term without any random phase in the equation indicates the direct path component. Then the rest of simulation is similar to the case of Rayleigh fading. Simulation can also be run with different velocities to study the effect of motion. To use the above Simulation programs with the Visual Basic environment, the following preparations are required: i) The program files and functions are

converted into dynamic link library (dll) files using COM builder tool in the MATLAB.

ii) The above dll files and other supporting functions such as plotting graph are packaged as a single file using the package component tool. This package component tool is available in the component menu of the COM builder.

4. Visual Basic The Visual Basic Environment acts as a front end of this work. Better user inter-activeness has been added for Flat Fading studies. Animations for Rayleigh and Rician fading has also been included to give visual demonstration about the fading in a mobile environment. To get a Visual user environment visual forms are created for Rayleigh and Rician fading. The forms can be activated using the command Show. Fig.3 shows a form for Rayleigh fading. Text boxes are provided in the forms for entering the desired parameters. The values entered are converted to double format using the command CDbl and manipulations are done on these values. In the Visual Basic the necessary events (e.g: Buttons to view Rayleigh distribution, Rician distribution etc.,) are created using the GUI facility. Toolbars and Menubars are also created for user inter-activeness. The menus are created using Menu Editor. The event handling functions are invoked using the command Call, along with function name and input parameters. Based on the input values, simulation results are obtained. Help files are also have been created which give some basic information about fading. As an example, a help window showing several types of fading is shown in Fig.4. 5. Executable Package

Using the Package and Deployment Wizard in Visual Basic environment, all the developed files such as dll file, package component, animation files and help files are encapsulated into a single self extracting executable package. This package can be loaded on any Windows Operating System based machines and the simulation can be carried out. The steps that are required for the development of an executable package have been summarized below:

Page 5: An Interactive Simulation for Flat Fading

5

1. Write programs in MATLAB to simulate Fading phenomena.

2. Using the MATLAB COM builder tool convert the above program files into dll file. Then package this dll file along with other supporting files using Package Component tool.

3. Create forms and events in Visual Basic and link the dll file with it.

4. Using Visual Basic’s Package and Deployment Wizard facility, the files obtained in steps 2 and 3 are combined and converted into a single execution package.

Fig.4 A help window created using Visual

Basic References

[1] T. S. Rappaport, “Wireless Communi- cations - Principles and Practice”, IEEE Press, Inc. New York and Prentice Hall, Inc., New Jersey, 1996.

[2] Angeleri.E , Mazzei.L, Pegoretti.A, “Rayleigh fading simulation on PCs”, IEEE Region 10 Conference on Computer and Communication Systems, IEEE TENCON'90, pp.77-80, vol.1, 1990. [3] Gayathri S. Prabhu and P. Mohana Shankar, “Simulation of Flat Fading Using MATLAB for Classroom Instruction”, IEEE Transaction on Education, vol 45.1, February 2002.

Fig.3 An interactive form created for Rayleigh fading using Visual Basic.

6. Conclusions

[4] Dersch.U, Ruegg.R.J, “Simulations of the time and frequency selective outdoor mobile radio channel”, IEEE Tran. on Vehicular Technology, Volume: 42, pp.338-344, Aug.1993.

MATLAB programming has been used to simulate flat fading because of its ease of use. Further, for useful applications these MATLAB program files have been linked with Visual Basic programming through dynamic link library facility. The use of Visual Basic brings benefits in two ways: 1) provides better Visual user environment to input the fading parameters interactively, and 2) the developed programs can be converted into an executable package. The executable package thus obtained has been tested successfully on Windows operating system based machines without MATLAB and Visual Basic softwares.

[5] Beaulieu.N.C, Cheng.C, “An efficient procedure for Nakagami-m fading simulation”, IEEE Global Tele communications Conference, GLOBE COM '01, pp 3336-3342, Vol.6, 2001.

Page 6: An Interactive Simulation for Flat Fading

6