Lab4:
1. Write a program to calculate the signal interference ratio (SIR) in the
forward link, and repeats it by randomly changing the position of the MS. After a number of simulations, use the simulated results to draw the histogram of the SIR (S=I). Try to obtain histograms with different path loss exponent n and cluster size N. Conclude your results.
The co-channel interference in the forward link can be characterized in figure 1. A MS will be interfered by the co-channel base station. In our simulation, we consider the 18 co-channel cell, including 6 cells in the first loop and 12 cells in the second, no matter what the cluster size N is.
Figure 1 forward link co-channel interference
(1) Firstly, we should randomly choose the position of the MS in the cell. Since
the cell is hexagon which is hard to handle we cut and paste it into a square. As we can see in figure 2, the center of the coordination is the center of the cell. The square we choose is ABCD. We then randomly choose a pair of x and y as the coordinate of MS. If MS locates in triangle 1 we cut and paste it to triangle 3 and if it locates in triangle 2 we move it to triangle 4. We assume the range of the base station is 0.1 as radius of cluster is 1. For the MS who located within this area, we change its distance to be 0.1 as it is too close to the base staion.
.学习帮手.
.专业整理.
Figure 2 randomly choose the position of MS in a cell Matlab code: RandPOS.m function [z] = RandPOS(m)
%******** get random value of x,y within a square *****% x = 1.5*rand(m,1)-1;
y = sqrt(3)*rand(m,1)-0.5*sqrt(3);
%******** use for loop to cut the square into a hexagon *****% for k=1:m
if x(k)>-1 && x(k)<-0.5 && y(k)>(1+x(k))*sqrt(3) x(k)=x(k)+1.5; y(k)=y(k)-sqrt(3)/2;
elseif x(k)>-1 && x(k)<-0.5 && y(k)<-(1+x(k))*sqrt(3) x(k)=x(k)+1.5; y(k)=y(k)+sqrt(3)/2; end
%******** if the MS is too nearly to the base station ******% if sqrt(x(k)^2+y(k)^2)<0.1 x(k)=0.1; y(k)=0; end end z=x+j*y;
(2) Secondly, we should calculate the coordinate of co-channel base station. As
we know the cluster size N we can calculate the (i, j) pair by the formulaN=
.学习帮手.
.专业整理.
i2+i∗j+j2.
Matlab code: ClusterN.m function [ii,jj] = ClusterN(N) for a = 0:sqrt(N) for b = 0:sqrt(N) if a^2+b^2+a*b == N ii = a; jj = b; end; %end if end; %for jj
end;
(3) Taking N=7 as example, we can calculate the coordinate by referring to figure
3. According to the value of I j pair and angles in the figure we can get the coordinate of the first loop by the formula: location(k)=
√3×(i
j×+j×()
3×k−1×e6
pi
pi
+j×
j×+j×()
3×k), e6where k=1, 2….6. The second loop can
pipi
be calculated by the first loop. There are two kinds of second loop co-channel
base station. One can be calculated by double the coordinate of the first loop points. The other can be done by adding coordinates of adjacent first loop point as it is the diagnose of a parallelogram. Examples of those two kinds of points, point 1 and 2, can be found in figure 3
double the coordinate of the first loop points diagnose of a parallelogram
Figure 3 calculate coordinate of co-channel base station by I J pair .学习帮手.
.专业整理.
Matlab code: AdjCel.m function [CelLoc] = AdjCel(N) [ii,jj] = ClusterN(N)
CelLoc = zeros(18,1)+j*zeros(18,1);
CelLoc(1) = sqrt(3)*( ii*exp(j*pi/6) + jj*exp(j*pi/6+j*pi/3)); for k=2:6
CelLoc(k) = CelLoc(k-1)*(0.5+sqrt(3)/2*j); end; for i = 1:6
CelLoc(2*i+5) = CelLoc(i)+CelLoc(i); CelLoc(2*i+6) = CelLoc(i)+CelLoc(i+1); end;
CelLoc(18) = CelLoc(6)+CelLoc(1);
(4) Now we have coordinates of MS and co-channel base station, so we can calculate
SIR by the formula SIR=∑18(dms)−n
−n
i=1(dbsi)
, where dms stands for the distance from
MS to the center while dbsi stands for the distance from the co-channel base station to the MS. We simulated it 100000 times.
Matlab code: clear all close all
N = input('the cluster size N ='); n = input('the path loss exponent n =') M = 100000;
MSPos = RandPOS(M); CelLoc = AdjCel(N); ds = (abs(MSPos)).^-n;
ditemp1 = abs(MSPos*(ones(18,1))'-ones(M,1)*CelLoc'); ditemp2 = ditemp1.^-n; di = ditemp2*ones(18,1); SIR = 10*log(ds./di); hist(SIR,[-20:250]) title('Histogram'); xlabel('SIR(dB)'); ylabel('numbers of MS');
(5) Rsults:
We will simulate the SIR of the co-interference of the forwarding link with different cluster size ‘N’ and path lose exponent ‘n’ and plaint the histogram of each condition. To make a comparison, we chose two group of n
.学习帮手.
.专业整理.
and N as:
When n=3.6, we let N=1,3,4,7,12. When N=7, we let n=2,3,3.5,4.
Figure 5 histogram of SIR while N=1, n=3.6 ()−n . d0 is the range of the base station.
d0d
If the random MS is too nearly to the base station, d .学习帮手. .专业整理. Figure 6 histogram of SIR while N=3, n=3.6 Figure 7 histogram of SIR while N=4, n=3.6 .学习帮手. .专业整理. Figure 8 histogram of SIR while N=7, n=3.6 Figure 9 histogram of SIR while N=12, n=3.6 .学习帮手. .专业整理. Figure 10 histogram of SIR while N=7, n=2 Figure 11 histogram of SIR while N=7, n=3 .学习帮手. .专业整理. Figure 12 histogram of SIR while N=7, n=3.5 Figure 13 histogram of SIR while N=7, n=4 We can see from the histogram that the average SIR increase with N increase. Since the distance between the cluster and the co-interference cell is larger when N is larger, so the co-interference is smaller. For a constant cluster size N, the SIR is larger as the path lose exponent becomes larger. Since when n is changing, the co-interference power is reduced much more than the signal power. Even though the system will lose more power, the SIR is becomes larger. .学习帮手. .专业整理. 2. Write a program to calculate the SIR in the reverse link, and repeats it by randomly changing the positions of the MSs. ( Note that the interferences in the reverse link are generated by co-channel MSs and is different from the interference in the forward link. ) After a number of simulations, use the simulated results to draw the histogram of the SIR. Try to obtain histograms with different path loss exponent n and cluster size N. Conclude your results. The co-channel interference in the reverse link can be characterized in figure 4. A BS will be interfered by the co-channel MS. In our simulation, we consider the 18 co-channel cell, including 6 cells in the first loop and 12 cells in the second, no matter what the cluster size N is. .学习帮手. .专业整理. Figure 14 reverse link co-channel interference The procedure is pretty much the same as forward link we talked about early. Firstly we randomly choose the position of MSs in the target cell and co-channel cells. In order to doing this we can use the randPOS function in forward link. The coordinates of MSs can be calculated by adding it to coordinates of co-channel base station. Then we calculate the SIR by formula SIR=∑18(dbs)−n −ni=1(dmsi) where dbs stands for the distance between the target BS and MS while dmsi stands for the distance from the co-channel MS to the center. Matlab code: % Reverse Link close all clear all N = input('the cluster size N ='); n = input('the path loss exponent n ='); M = 100000; MSPos = RandPOS(M); CelLoc = AdjCel(N); pos=ones(18,M); for i=1:18 pos(i,:)=RandPOS(M); end .学习帮手. .专业整理. IntMS = pos'+ones(M,1)*CelLoc'; ds = (abs(MSPos)).^-n; ditemp = (abs(IntMS)).^-n; di = ditemp*ones(18,1); SIR = 10*log(ds./di); hist(SIR,-20:150) title('pdf of SIR'); xlabel('SIR(dB)'); ylabel('pdf'); We will simulate the SIR of the co-interference of the forwarding link with different cluster size ‘N’ and path lose exponent ‘n’ and plaint the histogram of each condition. As what we did for the forward link. To make a comparison, we chose two group of n and N as: When n=3.6, we let N=1,3,4,7,12. When N=7, we let n=2,3,3.5,4. The result is : Figure 15 histogram of SIR while N=1, n=3.6 .学习帮手. .专业整理. Figure 16 histogram of SIR while N=3, n=3.6 Since we have removed the base station when generate the random position of MS. when distance of MS ≤ 0.1, we let it to be point (0.1, 0) . ✓ For the forward link, there is largest value SIR when it is 0.1 and it is a constant. ✓ For the reverse link, when the randomly MS is at (0.1,0), but the MS on the co-interference cell is also randomly, so the SIR of this situation is not a constant largest value. It is a group of largest value. Figure 17 histogram of SIR while N=4, n=3.6 .学习帮手. .专业整理. Figure 18 histogram of SIR while N=7, n=3.6 Figure 19 histogram of SIR while N=12, n=3.6 .学习帮手. .专业整理. Figure 20 histogram of SIR while N=7, n=2 Figure 21 histogram of SIR while N=7, n=3 .学习帮手. .专业整理. Figure 22 histogram of SIR while N=7, n=3.5 Figure 23 histogram of SIR while N=7, n=4 We can see from the histogram that the performance of reverse link is just like the forward link. the average SIR increase with N increase. Since the distance between the cluster and the co-interference cell is larger when N is larger, so the co-interference is smaller. For a constant cluster size N, the SIR is larger as the path lose exponent becomes larger. Since when n is changing, the co-interference power is reduced much more than the signal power. Even though the system will lose .学习帮手. .专业整理. more power, the SIR is becomes larger. .学习帮手. 因篇幅问题不能全部显示,请点此查看更多更全内容