SINR calculation for UAV

7 次查看(过去 30 天)
Moe Lwin Nang Swe Zin
I am very new to using Matlab. so far I've deployed UAV,UE and created channel model. I'm stuck calculating sinr. I'm sure I implemented phase 1 and 2 wrong cuz I keep getting error. Here I do not consider linear beamforming technique as in the paper, just calc snr between MBS-UAV and sinr between UAV-UE. Can someone help me fix my implementation, please?
function RL = fun_sinr(env,RL)
RL.sinr = zeros(env.numUE,env.numFreq);
RL.snr = zeros(env.numUAV,env.numFreq);
RL.rate = zeros(env.numUE,1);
RL.rateBH = zeros(env.numUAV,1);
% MBS-UAV backhaul
signal = env.powerMBS.*reshape(RL.alpha_GtA(:,1,:),env.numUAV,env.numFreq).*RL.freqMBS(2:end,:);
for i = 1:env.numUAV
RL.snr(i,:) = signal(i,:) ./ env.noise;
end
RL.s = signal;
RL.ss = [];
RL.ii = [];
% UAV-UE access
for i = 2:env.numUE
ueCh = env.powerUAV.*reshape(RL.alpha_AtG(i,2:end,:),env.numUAV,env.numFreq).*RL.freqUAV;
crossInter = env.powerMBS.*reshape(RL.alpha_AtG(i,1,:),1,env.numFreq).*sum(RL.freqMBS,1);
RL.sinr(i,:) = ueCh(i-1,:) ./ (sum(ueCh([1:i-2 i:end],:),1) + crossInter + env.noise);
RL.ss = [RL.ss; ueCh(i-1,:)];
RL.ii = [RL.ii; sum(ueCh([1:i-2 i:end],:),1) + crossInter];
end
RL.rateAcc = log2(1+RL.sinr);
RL.rateBH = log2(1+RL.snr);
RL.accRate = sum(RL.rate,2);
RL.bhRate = sum(RL.rateBH,2);
RL.rate = RL.accRate;
RL.rate(2:end,1) = min(RL.rate(2:end,1),RL.bhRate);
RL.rate = RL.rate./10^6;
end

回答(1 个)

Aishwarya Shukla
Aishwarya Shukla 2023-3-30
It's difficult to debug your code without seeing the error message that you're getting. However, I can provide some general feedback on your code.
The variable ueCh is computed as follows:
ueCh = env.powerUAV.*reshape(RL.alpha_AtG(i,2:end,:),env.numUAV,env.numFreq).*RL.freqUAV;
This seems to assume that the UAV is transmitting to the UE, but in the next line, you use ueCh(i-1,:) as the signal power, which doesn't seem to make sense.
The variable crossInter is computed as follows:
crossInter = env.powerMBS.*reshape(RL.alpha_AtG(i,1,:),1,env.numFreq).*sum(RL.freqMBS,1);
This seems to assume that the MBS is transmitting to the UE, but in the previous line, you used ueCh to compute the signal power. You need to make sure that you're computing the interference power correctly.
The variable RL.rate is computed as follows:
RL.rate = sum(RL.rate,2);
RL.rate(2:end,1) = min(RL.rate(2:end,1),RL.bhRate);
This seems to assume that RL.rate is a 2D matrix, but it's actually a 1D vector. You should remove the sum function call.
Overall, I would recommend going through your code carefully and double-checking that you're using the correct variables and that you're computing the signal and interference powers correctly. You might also want to add some print statements to help with debugging.

类别

Help CenterFile Exchange 中查找有关 Array Geometries and Analysis 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by