Wireless Communications Lab 1

ECE 6930

SS Deekshit Dosibhatla.,

Date: 1st Oct, 2001.

Fast Fading:

Plot the values of voltage for both polarizations on the same graph for each sector. The values of voltage for both polarizations for each sector are drawn below.

The above figure gives the plots between voltages and the number of points for both vertical and horizontal polarizations for all sectors in the order given in the excel sheet (s3, s1, s2, s4, s5, s6).

PDF graph of vertical polarization for all sectors :

The above graph shows the PDF’s of measured data, Raleigh Fading and Ricean Fading for vertical polarization for all the sectors given in the order in excel sheet(s3, s1, s2, s4, s5, s6).

Blue line = measured data;

Red line = Raleigh fading ;

Green line = Ricean fading;

PDF graph of horizontal polarization for all sectors :

The above graph shows the PDF’s of measured data, Raleigh Fading and Ricean Fading for horizontal polarization for all the sectors given in the order in excel sheet(s3, s1, s2, s4, s5, s6).

Blue line = measured data;

Red line = Raleigh fading ;

Green line = Ricean fading;

CDF graph of vertical polarization for all sectors :

The above graph shows the CDF’s of measured data, Raleigh Fading and Ricean Fading for vertical polarization for all the sectors given in the order in excel sheet(s3, s1, s2, s4, s5, s6).

Blue line = measured data;

Red line = Raleigh fading ;

Green line = Ricean fading;

CDF graph of horizontal polarization for all sectors :

The above graph shows the CDF’s of measured data, Raleigh Fading and Ricean Fading for horizontal polarization for all the sectors given in the order in excel sheet(s3, s1, s2, s4, s5, s6).

Blue line = measured data;

Red line = Raleigh fading ;

Green line = Ricean fading;

Distance Dependence (Large Scale Fading) :

The above graph shows the graph between the average of PL-PL(1) in dB on the y-axis and R, the distance, on the x-axis for different polarizations. Blue line indicates the vertical polarization of the averages for the LOS paths. The yellow line indicates the non-LOS paths in the vertical polarization and the magenta line indicates the horizontal polarization sector averages. The computation of the slopes of these curves gives the following.

Slope for the non-LOS vertical polarization sector averages = -0.54554663485213;

Slope for the horizontal polarization sector averages = -0.59638798336342;

Red line indicates the straight line for non-LOS paths in the vertical polarization after the curve fitting. Green line indicates the horizontal polarization sector averages straight line after fitting.

Matlab Program : wirelesslab1.m

% Wireless Communications Lab 1 :

format long;

allsect = load('allsect.m');

allsectvolt = 10.^(allsect/20);

allsectvoltsum = [0 0 0 0 0 0 0 0 0 0 0 0];

for n = 1:100

allsectvoltsum = allsectvoltsum+allsectvolt(n,:);

end

allsectvoltave = allsectvoltsum/100;

for i = 1:12

allsectvoltnorm(:,i) = allsectvolt(:,i)/allsectvoltave(i);

end

allsectvoltdb = 20*log(allsectvoltnorm);

for j = 1:12

for k = 1:20

m(k,j) = 0;

for i = 1:100

if allsectvoltdb(i,j) <= (k-12)

if allsectvoltdb(i,j) > (k-13)

m(k,j) = m(k,j)+1;

end

end

end

end

end

for j = 1:12

p(j) = 0;

for i = 1:100

if allsectvoltdb(i,j) <= -12

p(j) = p(j)+1;

end

end

end

for j = 1:12

q(j) = 0;

for i = 1:100

if allsectvoltdb(i,j) > 8

q(j) = q(j)+1;

end

end

end

pdf =[p;m;q];

for j = 1:12

for k = 1:22

cdf(k,j) = 0;

for i = 1:k

cdf(k,j) = cdf(k,j)+pdf(i,j);

end

end

end

%Raleigh Distribution:

vdb = -11:8;

v = 10.^(vdb/20);

vave = mean(v);

sigma = vave*sqrt(2/pi);

for i = 1:20

pdfraleigh(i) = (v(i)*exp(-v(i)^2/(2*(sigma^2))))/(sigma^2);

end

for i = 1:20

cdfraleigh(i) = 1-(exp(-v(i)^2/(2*(sigma^2))));

end

%Ricean Distribution:

k = 1;

for i = 1:20

z = sqrt(k*2*sigma^2)*v(i)/sigma^2;

pdfricean(i) = v(i)*exp(-(v(i)^2/2*sigma^2)-k)*besseli(0,z)/sigma^2;

end

pdfrice = pdf_ricean(v);

for i = 1:20

cdfricean(i) = quadl(@pdf_ricean,0,v(i));

end

caldbm = [-31.4 -33.4 -34.3 -32.9 -35.3 -33.4

-33.0 -33.4 -33.4 -30.2 -32.6 -34.7

-31.2 -30.3 -39.5 -29.7 -30.4 -32.3

-30.4 -31.0 -31.0 -31.6 -32.9 -32.2

-31.4 -32.9 -32.3 -32.5 -33.3 -32.2];

calmw = 10.^(caldbm/10);

calw = calmw/1000;

for j = 1:6

calwsum(j) = 0;

for i = 1:5

calwsum(j) = calwsum(j)+calw(i,j);

end

end

calwave = calwsum/5;

calmwave = calwave*1000;

caldbmave = 10*log(calmwave);

sub = caldbmave+14;

i = 1;

for k = 1:6

for j = i:i+1

pathloss(:,j) = allsect(:,j)-sub(k);

end

i = i+2;

end

pathlosssum = [0 0 0 0 0 0 0 0 0 0 0 0];

for n = 1:100

pathlosssum = pathlosssum+pathloss(n,:);

end

pathlossave = pathlosssum/100;

R1 = 26;

R2 = 30;

R3 = 50;

R4 = 64;

R5 = 80;

R6 = 104;

j = 1;

figure(1)

for i = 1:6

subplot(2,3,i)

plot(1:100,allsectvolt(:,j)');

hold on;

plot(1:100,allsectvolt(:,j+1)');

grid on;

j = j+2;

end

k = 1;

m = 2;

for i =1:2:12

figure(m)

subplot(2,3,k)

plot(1:22,pdf(:,i));

hold on;

plot(1:20,pdfraleigh*20,'r');

hold on;

plot(1:20,pdfrice*20,'g');

%axis([-11,8,0,20]);

grid on;

figure(m+1)

subplot(2,3,k)

plot(-12:9,pdf(:,i+1));

hold on;

plot(-11:8,pdfraleigh*20,'r');

hold on;

plot(-11:8,pdfrice*20,'g');

%axis([-11,8,0,20]);

grid on;

figure(m+2)

subplot(2,3,k)

plot(-12:9,cdf(:,i));

hold on;

plot(-11:8,cdfraleigh*100,'r');

hold on;

plot(-11:8,cdfricean*100,'g');

axis([-11,8,0,100]);

grid on;

figure(m+3)

subplot(2,3,k)

plot(-12:9,cdf(:,i+1));

hold on;

plot(-11:8,cdfraleigh*100,'r');

hold on;

plot(-11:8,cdfricean*100,'g');

axis([-11,8,0,100]);

grid on;

k = k+1;

end

figure(6)

plot([R1 R3],[pathlossave(3) pathlossave(1)]);

hold on;

plot([R2 R4 R5 R6],[pathlossave(5) pathlossave(7) pathlossave(9) pathlossave(11)],'y');

hold on;

plot([R1 R2 R3 R4 R5 R6],[pathlossave(4) pathlossave(6) pathlossave(2) pathlossave(8) pathlossave(10) pathlossave(12)],'m');

hold on;

plot([R2 R4 R5 R6],-0.54554663485213*[R2 R4 R5 R6]+34.46400335800934,'r');

hold on;

plot([R1 R2 R3 R4 R5 R6],-0.59638798336342*[R1 R2 R3 R4 R5 R6]+30.56850808740119,'g');

grid on;

[sl1 in1] = polyfit([R2 R4 R5 R6],[pathlossave(5) pathlossave(7) pathlossave(9) pathlossave(11)],1)

[sl2 in2] = polyfit([R1 R2 R3 R4 R5 R6],[pathlossave(4) pathlossave(6) pathlossave(2) pathlossave(8) pathlossave(10) pathlossave(12)],1)

Funtion : pdf_ricean.m

function [pdfrice] = pdf_ricean(v)

%this calculates the pdf of a ricean distribution

k = 1;

sigma = 0.58642;

z = (sqrt(2*k*sigma^2)/sigma^2).*v;

Io = besseli(0,z);

revsigma = 1/sigma^2;

revsigma2 = revsigma/2;

coeff = revsigma.*v;

expvalue = exp(-(revsigma2.*(v.^2)+k));

pdfrice = coeff.*expvalue.*Io;