You are on page 1of 3

Code

clear all
clc
% What is i, j, C_ht, and d_ht in C_n and d_k?
i = 1; % Not defined yet
j = 1; % Not defined yet
C_ht = 1; % Not defined yet
d_ht = 1; % Not defined yet
threshold = [0:1:100];
errorblock = 0;
iteration = 500
T_Ant = 2;
R_Ant = 2;
v_shape = 0.85;
a_scale = 0.65;
M = 50;
L = 7;
% For channel h
h1 = 1/sqrt(2)*(randn(T_Ant,R_Ant)+j*randn(T_Ant,R_Ant));
Gamma = gamrnd(a,v);
z = sqrt(Gamma);
hG = z.*h;
h1 = abs(hG);
hG2 = norm (hG);
h=round(hG2);
G = M*v_shape+h+(1-v_shape)*i;
syms i n j k t
a0 = 1/(1-v_shape);
C0 = a0^t;
at = ((-1)^t)/(factorial(t)*(1-v_shape+t));
C_n = (1/(n*a0)) * symsum((t*i-h+t)*at*C_ht, t, 1, h) %for h>=1
b0 = 1/(1-v_shape);
d0 = b0^t;
bt = ((-1)^t)/(factorial(t)*(1-v_shape+t));
d_k = (1/(n*b0)) * symsum((t*j-h+t)*bt*d_ht, t, 1, h) %for h>=1
P = (L-1)*M*v_shape+h+(1-v_shape)*j;
C1 = -1-2*G-P;
C2 = G+P;
for threshold=0:1:100
% First
Sum1 = ((factorial(M))/(factorial(i)*factorial(M-i))) * (gamma(1 -
v_shape)^(M-i)) * ((-1)^i);
S1 = symsum(Sum1, i, 0, M)
Sum1R = round(S1);
% Second
Sum2 = (C_n * ((v_shape)/(a_scale*M))^((1+G)/2));
S2 = (C0*((v_shape)/(a_scale*M))^((1+G)/2)) + symsum(Sum2, n, 1, 100)
Sum2R = round(S2);
% Third
Sum3 = ((factorial((L-1)*M))/(factorial(j)*factorial(((L-1)*M)-j))) *
(gamma(1 - v_shape)^((L-1)*M-j)) * ((-1)^j);
S3 = symsum(Sum3, j, 0, (L-1)-M)
Sum3R = round(S3);
% Fourth
Sum4 = d_k * ((v_shape)/(a_scale*(L-1)*M))^((1+P)/2) * threshold^(G/2);
S4 = (d0*((v_shape)/(a_scale*(L-1)*M))^((1+P)/2) * threshold^(G/2)) +
symsum(Sum4, k, 1, 100)
Sum4R = round(S4);
% Fifth
Sum5 = (-1)*((threshold*v_shape*M)/a_scale)^(G/2) * (1-(v_shape/(L-1)))^(-G-
P);
% Sixth
Sum6 = ((v_shape*(L-1)*M)/a_scale)^(C1/2) *
((cosd(C2*180)*gamma(C2)*sind(G*180))/pi)
% Outage Probability
P_SIR_less_than_T(s) = Sum1R*Sum2R*Sum3R*Sum4R*Sum5*Sum6;
end
% plot(threshold, P_SIR_less_than_T)
Ambiguities

It is not clear as to what do “i”, “j”, “ch-t” and “dh-t” denote in the
equations of cn and dk, respectively. This is because both “i” and “j”
must be summed with respect to “t” (included in their respective
summations), and “n” and “k”, respectively (included in the closed form
expression of P(SIR<τ)).

All three equations have been included below:


P.S: I could not get the plots yet because the values of “i”, “j”, “ch-t” and
“dh-t” are not defined.

You might also like