Saturday, April 23, 2011

Plot graphs: gnuplot

I am doing my final year project on network simulator. I had to plot my results in Ubuntu. I found "Gnuplot"; a free, command-driven, interactive, function and data plotting program. We can easily plot graphs of common functions like sine, cosine, sinc, and many more. We can also plot the tabulated data. Gnuplot on my terminal looks like as shown below.
figure: terminal window

Interesting feature about this program is that you don't have to define x-range, x-scale and y-scale. Just type "sin(x)" and you have plotted graph of sin(x). The ranges are suitably defined unlike Matlab, and other languages where you have to define x range from 0 to pi or something like that. I have plotted sin(x) and sin(x)/x as shown in figure below.

figure: plot of sine function
 figure: plot of sinc function

Important commands:
Create a title:                    > set title "title"
Put a label on the x-axis:   > set xlabel "xlabel"
Put a label on the y-axis:   > set ylabel "ylabel"
Change the x-axis range:   > set xrange [x1:x2]
Change the y-axis range:   > set yrange [y1:y2]
For notes and documentation, click here.

Monday, April 4, 2011

Free Space Propagation Model

In any wireless communication system power received by receiver and the path loss are important parameters to be considered. There are several models to calculate these parameters, but the general and easiest one is the free space propagation model. This model is able to calculate power received and path loss for far field. The mathematics of this model is Friss’s free equation which is as follows:
Pt is transmitted power. Pr is received power. Gt is gain of transmitter. Gr is gain of receiver. λ is wavelength. d is distance between transmitter and receiver. Similarly the path loss is 
I have created a Matlab GUI that calculates power received and path loss using above two formulas. It also plots them in dBm amplitude with respect to distance in x-axis. It looks like as follows:
figure: GUI of free space model

It takes input parameters as: Tx power (Pt), frequency (f), transmitter gain (Gt), Receiver gain(G­r) and distance(d). From calculation, it shows Rx power (Pr), path loss (PL) in dBm. It has graph scheme which plots graph of received power vs tx-rx distance and path loss vs tx-rx distance respectively.

Interested can download freespace.m and freespace.fig files, click here.
(Reference: Wireless Communication by Theodore S. Rappaport)

Visualization of Electromagnetic wave in MATLAB

Wave is imaginary and mysterious thing to us. Many of them are invisible and we even don’t know their pres...