Is the following method of calculating SINR correct

조회 수: 5 (최근 30일)
Syed
Syed 2017년 5월 5일
댓글: omar th 2022년 1월 19일
Hi all,
I am trying to implement device-to-device discovery technique. I have written a code for that purpose. I am a bit unsure about the way I have calculated SINR. Can someone spare some moments and let me know if I am right or not?
The following is the code: Loof for the comments of interference vector in particular.
%%constant / parameters
freq = 2e9; wavelength = (3e8)/freq;
Noise_dB = -121; %dB Noise = 10^(Noise_dB/10);
SINR_th = 2.5;
N_RB = 44; % Number of resrouce blocks
N_Time_slots = 64; % Number of time slots. Total Resources = N_RB * N_Time_slots
Pmax = -7;%dB (23 dBm)
Rd = 500; % Radius of cirular region aroung device
tagged_user = 0 + 0i;
tic;
N_devices = 100;
% There are 'N_devices' devices in total,
%Transmit power of 'N_devices-1' devices.
Pt = ones(1, N_devices-1)*Pmax;
users_pos = gen_d2d_devices(tagged_user, N_devices-1, Rd);
DUE_pos = [real(users_pos); imag(users_pos)]';
d = abs(users_pos); %Since location of tagged user is at origin
D = d./1000; % meters to KM, since the formula below uses distance in km
PL = 135.5 + 40*log10(D);
Pr = zeros(1, N_devices-1);
discovered_devices = zeros(1,N_devices-1);
%Discovery periods from 1 -> tot_of_disctime
for td = 1:tot_of_disctime
% RB allocation => Frequency + 1j*time
RA_a = randi([1,N_RB], 1, N_devices) + randi([1,N_Time_slots], 1, N_devices).*1i;
RA1 = RA_a(1);
RA_a(1) = [];
Pr = Pt - PL;
%dB to linear scale
Pr_a = 10.^(Pr/10);
%Interference vector
I = zeros(1, N_devices-1);
%Making Interference vector: All devices that transmit in the same RB interfere
for ii=1:N_devices-1
for jj = 1 : N_devices-1
if(ii == jj)
continue
else
if(RA_a(ii) == RA_a(jj))%if(RA(ii) == RA(jj))
I(ii) = I(ii) + Pr_a(jj);
else
continue;
end
end
end
end
%Total Received power, including Interference.
PrA = Pr_a + I;
%Calculate SINR
SINR = PrA ./ (Noise + I);
valid_devices = 10*log10(SINR)>SINR_th;
%half duplexing
SameBTUFRAME = imag(RA1) == imag(RA_a);
discovered_devices = discovered_devices | and(valid_devices,not(SameBTUFRAME));
Discovery_ratio(td) = sum(discovered_devices) / (N_devices-1);
end
mean_discovery1 = mean(Final_discovery1);

답변 (1개)

Raman Kaur
Raman Kaur 2018년 10월 5일
Hi Did this work? i am also working on Sinr..Please help
  댓글 수: 3
Rishab Jolly
Rishab Jolly 2018년 10월 9일
What is "gen_d2d_devices" function doing here? Please provide me the code of that function. I need to calculate SINR
omar th
omar th 2022년 1월 19일
@Syed please, would you share your code of sinr with us if it is worked ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by