Professional Documents
Culture Documents
Code:
global GOS city_area user_density SIR_min_dB sectorization_method;
%Defining the i value and number of sectors depending on the required sectorization
method
switch sectorization_method
case 0
i = 6;
sectors_number = 1;
case 60
i = 1;
sectors_number = 6;
case 120
i = 2;
sectors_number = 3;
end
N = [];
for i = 0:20
for k = 0:20
N(i+1,k+1) = i^2 + i*k + k^2;
end
end
M = sort(unique(reshape(N,1,[])));
% For loop to compare the calculated value with the allowed values of N
for i = 1:(length(M)-1)
if M(i) >= N_calculated
N_optimum = M(i); % returns the optimum value of the cluster size
break
end
end
%Solving the blocking probability equation in order to get the traffic intensity per sector
syms K A
A=solve((A^C_sector)/factorial(C_sector)==
GOS_Ratio*symsum(A^K/factorial(K),K,0,C_sector),A);
A_sector = double(A); %To convert complex output of the solve function to real
A_sector = A_sector(end); %Getting the most accurate value
A = A_sector * sectors_number; %Getting the traffic intensity per cell
%6) A plot for the MS received power in dBm versus the receiver distance from the BS.
d_BS = [0:0.1:R-1]; %array for the distance from the base station
for i=1:(length (d_BS))
Prx(i) = Ptx + Grx + Gtx – M - Hata_Model(i,hm,hb,fc);
end
%Function to calculate path loss for medium urban area using Hata model
function PL = Hata_Model (d,hm,hb,fc)
C_H = 0.8 + (1.1*log10(fc)-0.7)*hm - 1.56*log10(fc); %C_H = Antenna height correction
factor
PL = 69.55 + 26.16*log10(fc) - 13.82*log10(hb) - C_H + (44.9-6.55*log10(hb))*log10(d);
%General formula of Hata Model for Medium Urban Areas
end
Output:
1. Cluster Size.
2. Number of cells.
3. Cell radius.
Code:
city_area = 100;
GOS = 2;
user_density = 1400;
%1) Plot the cluster size versus 𝑆𝐼𝑅𝑚𝑖𝑛 with range from 1𝑑𝐵
𝑡𝑜 30 𝑑𝐵.
%Omni_direction
sectorization_method = 0;
%120 sectorization
sectorization_method = 120;
for SIR_min_dB = 0:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
Cluster_size_60(SIR_min_dB + 1) = N_optimum;
SIR_60(SIR_min_dB + 1) = SIR_min_dB;
end
figure(1);
subplot(3,1,2);
plot(Cluster_size_60,SIR_60);
grid on
xlabel('Cluster size');
ylabel('SIR_m_i_n (dB)');
title('120 Sectorization');
%60 sectorization
sectorization_method = 60;
%----------------------------------------------------------
SIR_min_dB = 19;
%Omni_direction
sectorization_method = 0;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_omni(GOS + 1) = number_of_cells;
traffic_intensity_omni(GOS + 1) = A;
GOS_omni(GOS + 1) = GOS;
end
figure(2);
subplot(3,1,1);
plot(number_of_cells_omni,GOS_omni);
grid on
xlim([70 140]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('Omnidirectional antenna');
figure(3);
subplot(3,1,1);
plot(traffic_intensity_omni,GOS_omni);
grid on
xlim([20 50]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('Omnidirectional antenna');
%120 sectorization
sectorization_method = 120;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_120(GOS + 1) = number_of_cells;
traffic_intensity_120(GOS + 1) = A;
GOS_120(GOS + 1) = GOS;
end
figure(2);
subplot(3,1,2);
plot(number_of_cells_120,GOS_120);
grid on
xlim([50 140]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('120 Sectorization');
figure(3);
subplot(3,1,2);
plot(traffic_intensity_120,GOS_120);
grid on
xlim([20 60]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('120 Sectorization');
%60 sectorization
sectorization_method = 60;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_60(GOS + 1) = number_of_cells;
traffic_intensity_60(GOS + 1) = A;
GOS_60(GOS + 1) = GOS;
end
figure(2);
subplot(3,1,3);
plot(number_of_cells_60,GOS_60);
grid on
xlim([25 60]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('60 Sectorization');
figure(3);
subplot(3,1,3);
plot(traffic_intensity_60,GOS_60);
grid on
xlim([60 140]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 19 dB');
ylabel('GOS in %');
title('60 Sectorization');
%----------------------------------------------------------
%3) At 𝑆𝐼𝑅𝑚𝑖𝑛 = 14𝑑𝐵 & user density= 1400 𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2
%(i) Plot the number of cells versus GOS (1% to 30%).
%(ii) Plot the traffic intensity per cell versus GOS (1% to
30%).
SIR_min_dB = 14;
%Omni_direction
sectorization_method = 0;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_omni(GOS + 1) = number_of_cells;
traffic_intensity_omni(GOS + 1) = A;
GOS_omni(GOS + 1) = GOS;
end
figure(4);
subplot(3,1,1);
plot(number_of_cells_omni,GOS_omni);
grid on
xlim([50 100]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('Omnidirectional antenna');
figure(5);
subplot(3,1,1);
plot(traffic_intensity_omni,GOS_omni);
grid on
xlim([20 50]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('Omnidirectional antenna');
%120 sectorization
sectorization_method = 120;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_120(GOS + 1) = number_of_cells;
traffic_intensity_120(GOS + 1) = A;
GOS_120(GOS + 1) = GOS;
end
figure(4);
subplot(3,1,2);
plot(number_of_cells_120,GOS_120);
grid on
xlim([20 50]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('120 Sectorization');
figure(5);
subplot(3,1,2);
plot(traffic_intensity_120,GOS_120);
grid on
xlim([70 150]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('120 Sectorization');
%60 sectorization
sectorization_method = 60;
for GOS = 1:1:30
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_60(GOS + 1) = number_of_cells;
traffic_intensity_60(GOS + 1) = A;
GOS_60(GOS + 1) = GOS;
end
figure(4);
subplot(3,1,3);
plot(number_of_cells_60,GOS_60);
grid on
xlim([25 60]);
ylim([1,30]);
xlabel('Number of Cells at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('60 Sectorization');
figure(5);
subplot(3,1,3);
plot(traffic_intensity_60,GOS_60);
grid on
xlim([60 140]);
ylim([1,30]);
xlabel('Traffic Intensity per cell at SIR_m_i_n = 14 dB');
ylabel('GOS in %');
title('60 Sectorization');
%----------------------------------------------------------
%Omni_direction
sectorization_method = 0;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_omni(j) = number_of_cells;
cell_radius_omni(j) = R;
user_density_omni(j) = user_density;
end
figure(6);
subplot(3,1,1);
plot(user_density_omni,number_of_cells_omni);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('Omnidirectional antenna');
figure(7);
subplot(3,1,1);
plot(user_density_omni,cell_radius_omni);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('Omnidirectional antenna');
%120 Sectorization
sectorization_method = 120;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_120(j) = number_of_cells;
cell_radius_120(j) = R;
user_density_120(j) = user_density;
end
figure(6);
subplot(3,1,2);
plot(user_density_120,number_of_cells_120);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('120 Sectorization');
figure(7);
subplot(3,1,2);
plot(user_density_120,cell_radius_120);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('120 Sectorization');
%60 Sectorization
sectorization_method = 60;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_60(j) = number_of_cells;
cell_radius_60(j) = R;
user_density_60(j) = user_density;
end
figure(6);
subplot(3,1,3);
plot(user_density_60,number_of_cells_60);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('60 Sectorization');
figure(7);
subplot(3,1,3);
plot(user_density_60,cell_radius_60);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 14 dB');
title('60 Sectorization');
%----------------------------------------------------------
SIR_min_dB = 19;
GOS = 2;
%Omni_direction
sectorization_method = 0;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_omni(j) = number_of_cells;
cell_radius_omni(j) = R;
user_density_omni(j) = user_density;
end
figure(8);
subplot(3,1,1);
plot(user_density_omni,number_of_cells_omni);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('Omnidirectional antenna');
figure(9);
subplot(3,1,1);
plot(user_density_omni,cell_radius_omni);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('Omnidirectional antenna');
%120 Sectorization
sectorization_method = 120;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_120(j) = number_of_cells;
cell_radius_120(j) = R;
user_density_120(j) = user_density;
end
figure(8);
subplot(3,1,2);
plot(user_density_120,number_of_cells_120);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('120 Sectorization');
figure(9);
subplot(3,1,2);
plot(user_density_120,cell_radius_120);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('120 Sectorization');
%60 Sectorization
sectorization_method = 60;
j=0;
for user_density = 100:20:2000
j = j + 1;
[number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning();
number_of_cells_60(j) = number_of_cells;
cell_radius_60(j) = R;
user_density_60(j) = user_density;
end
figure(8);
subplot(3,1,3);
plot(user_density_60,number_of_cells_60);
grid on
ylabel('Number of Cells');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('60 Sectorization');
figure(9);
subplot(3,1,3);
plot(user_density_60,cell_radius_60);
grid on
ylabel('Cell Radius');
xlabel('user density (users/km^2) at SIR_m_i_n = 19 dB');
title('60 Sectorization');
function [number_of_cells,N_optimum,R,A_sector,A,Ptx] =
Planning()
global GOS city_area user_density SIR_min_dB
sectorization_method;
switch sectorization_method
case 0
i = 6;
sectors_number = 1;
case 60
i = 1;
sectors_number = 6;
case 120
i = 2;
sectors_number = 3;
end
N = [];
for i = 0:20
for k = 0:20
N(i+1,k+1) = i^2 + i*k + k^2;
end
end
M = sort(unique(reshape(N,1,[])));
for i = 1:(length(M)-1)
if M(i) >= N_calculated % for loop to compare the
calculated value with the allowed values of N
N_optimum = M(i); % returns the optimum
value of the cluster size
break
end
end
%[A,k] = deal([]);
syms A k
eqn =
vpasolve(((A^C_sector/factorial(C_sector))/(symsum(A^k/(fac
torial(k)),k,0,C_sector)))== GOS_Ratio,A);
A_sector=real(double(eqn(imag(eqn) ==0)));
A_sector=A_sector(A_sector>0);
A = A_sector*sectors_number; %total traffic intensity per
cell
Rx_senstivity= -95 ;
% assume gain of Rx = 0 dB & gain of tx = 0 dB
Grx= 0 ; Gtx = 0;
% Assume fading margin is 5 dB
M = 5 ;
Ptx = Rx_senstivity+M+(Hata_Model (R,hm,hb,fc))-Grx-Gtx;
1) Plot the cluster size versus 𝑆𝐼𝑅𝑚𝑖𝑛 with range from 1𝑑𝐵 𝑡𝑜 30 𝑑𝐵.
Comment:
Sectorization results in a lower number of neighboring cells sharing the same frequency resources.
Therefore, this can reduce co-channel interference and improve SIR.
And, by increasing the cluster size in the same sectorization method the SIR is improved since it
is directly proportional to N.
Comment:
The GOS is a measure of the probability that a call will be blocked so by increasing the number of
cells, the traffic will be spread over a larger area and therefore, the GOS will decrease.
Moreover, sectorization decreases the number of co-interferers and this leads to decreasing the
probability that a call will be blocked due to increasing the number of channels.
(ii) Plot the traffic intensity per cell versus GOS (1%to 30%).
Comment:
The GOS is a measure of the probability that a call will be blocked, and the traffic intensity is a
measure of the amount of traffic that is being generated by users in a cellular network so as the
traffic intensity increases it is expected that the GOS increases because there are more users trying
to use the network, and there are fewer channels available.
They are directly related to each other through this formula:
And on sectorizing the cell, the traffic intensity will decrease as the total traffic intensity per cell
will be divided into different traffic intensities per sector.
3) At 𝑆𝐼𝑅𝑚𝑖𝑛 = 14𝑑𝐵 & user density= 1400 𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2
(i) Plot the number of cells versus GOS (1% to 30%).
Comment:
Here, we decreased the value of SIR to 14 dB instead of 19 dB in the previous question and this
leads to higher GOS which means higher call blocking probability since the quality will decrease
due to increasing interference.
By Sectorization the interference should be decreased and thus GOS will decrease.
(ii) Plot the traffic intensity per cell versus GOS (1% to 30%).
Comment:
Here, we decreased the value of SIR to 14 dB instead of 19 dB in the previous question and this
leads to higher GOS which means higher call blocking probability since the quality will decrease
due to increasing interference.
By Sectorization the interference should be decreased and thus GOS will decrease.
4) At 𝑆𝐼𝑅𝑚𝑖𝑛 = 14𝑑𝐵 & GOS= 2%,
(i) Plot the number of cells versus user density (100 to 2000
𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2)
Comment:
By increasing the user density, the traffic intensity increases and thus we need more cells to cover
the required area, so the number of cells increases.
Also, by increasing the user density the cell area decreases which in return will increase the number
of cells.
By sectorization the number of cells decreases since each cell is divided into sectors to decrease
interference and increase the number of channels.
(ii) Plot the cell radius versus user density (100 to 2000 𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2)
Comment:
By increasing the user density, the cell area decreases and thus decreasing the cell radius in an
exponential way since they are related to each other directly:
Cell Area =
Sectorization will decrease the interference but won’t affect the cell radius.
5) At 𝑆𝐼𝑅𝑚𝑖𝑛 = 19𝑑𝐵 & GOS= 2%,
(i) Plot the number of cells versus user density (100 to 2000
𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2).
Comment:
Here, we increased the value of SIR to 19 dB instead of 14 dB in the previous question and this
leads to better performance but won’t affect the relation between the user density and number of
cells.
By sectorization the number of cells decreases since each cell is divided into sectors to decrease
interference and increase the number of channels
(ii) Plot the cell radius versus user density (100 to 2000 𝑢𝑠𝑒𝑟𝑠/𝑘𝑚2).
Comment:
Here, we increased the value of SIR to 19 dB instead of 14 dB in the previous question and this
leads to better performance but won’t affect the relation between the user density and number of
cells.
Sectorization will decrease the interference but won’t affect the cell radius.
Procedures:
Part A:
First, we took the input from the user regarding the following parameters:
Grade of Service in %
City Area in 𝐾𝑚2
User Density in 𝑢𝑠𝑒𝑟𝑠/𝐾𝑚2
Minimum SIR in dB
Sectorization Method
Then we defined the given variables that we are going to use in our code.
Moreover, we decided the value of the number of interferers and number of sectors according to
the given sectorization method.
Then to calculate the number of cells and cell radius we need to calculate first the traffic intensity
per sector and per cell so we are going to divide the number of total channels we have by the
number of sectors multiplied by the cluster size we have just obtained to get the numbers of
channels in each sector and also convert the grade of service percentage to ratio such that we could
use it directly in our calculations.
Once we have the GOS and number of channels per sector we could solve the following equation:
to get the value of the traffic intensity per sector and
furthermore, to get the traffic intensity per cell we could
multiply the obtained number by the number of sectors.
The next step is using the calculated traffic intensity per cell to get the number of users by dividing
the total traffic intensity per cell to the user traffic intensity per cell, then by dividing the obtained
number of users by the user density which we took from the user we can get the cell area.
To get the number of cells we must divide the total city area taken from the user to the cell area.
Then we can calculate the radius cell from the area of the hexagonal cell formula:
Cell Area =
Another required part was calculating the transmitted power from the base station, so we used Hata
Model of medium urban areas to calculate the path loss.
After calculating the path loss, we used it in the equation of calculating the transmitted power:
𝑃𝑟𝑥 = 𝑃𝑡𝑥 − 𝑀 − 𝑃𝐿 + 𝐺𝑡𝑥 + 𝐺𝑟𝑥
Where,
Prx is the received power sensitivity.
Ptx is the transmitted power sensitivity.
M is the Fading Margin.
PL is the path loss calculated by Hata Model.
Gtx is the antenna gain of the transmitter in dB.
Grx is the antenna gain of the receiver in dB.
Finally, to plot the received power versus the distance from the BS we used the same formula
inside a for loop that is looping on different values of the distance to build an array of many values
that could be used in plotting.
Part B:
We used the same code of part A except for the plotting part and put it inside a function to be used
directly to return the values of the needed parameters to be plotted in this part. We also changed
the dependent variable as required before every question and plotted the output in the 3 cases of
no sectorization (omni-directional antenna), 1200 sectorization and 600 sectorization.