lot of throughput doesn't shown
조회 수: 1 (최근 30일)
이전 댓글 표시
clc;
close all;
%common parameters
f=6; %Frequency band [GHz]
pt=33; %transmitter power[dBm]
pr=27; %Receiver power[dBm]
n=5; %Noise figure [dBm]
Amu=10; %The median attenuation relative to free space
gt=6; %Transmitter Antenna Gain [dBi]
gr_s=2; %Receiver Antenna Gain [dBi] (stations)
B=20; %Bandwidth [MHz]
L=0.3; %Connector loss [dB]
I=1; %Interference margin loss [dB]
rs_t=-89; %Transmitter Rx Sensitivity [dBm]
rs_s=-91 ; %Receiver Rx Sensitivity [dBm]
d=0:1:10; %The range of the distance between TX and RX
%Data from user
area_type =input ('Enter type of city (1 - urban, 2 - suburban, 3 - rural):','s');
ht=input('Enter the receiver antenna height 30m<hre<1000m : ');
hr=input('Enter the receiver antenna height 1m<hre<10m : '); % Mobile Antenna Height
% Okumura Propagation Model
Lf=32.44+20*log(f)+20*log(d); %Free Space Propagation Loss
Ght=20*log(ht/200); %Transmitter Antenna Height Gain Factor
if(hr<3) %Reciver Antenna Height Gain Factor
Ghr=20*log(hr/3);
else
Ghr=10*log(hr/3);
end
Garea=13;
L50=Lf+Amu-Ght-Ghr-Garea;
Rss=pt+gt+gr_s-L50-L;
SNIR=Rss/(n+I);
Throughput=B.*log2(1+(10.^(SNIR(end)/10)));
for r=1:10
L50=Lf+Amu-Ght-Ghr-Garea;
Rss=[Rss*(pt+gt+gr_s-L50(end)-L)];
SNIR=[SNIR*(Rss(end)/(n+I))];
Throughput=Throughput.*(B.*log2(1+(10.^(SNIR(end)/10))));
end
hold on;
figure (1)
subplot(2,2,1)
plot(d,L50,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('Propagation Path loss(dB)');
subplot(2,2,2)
plot(d,Rss,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('RSS');
subplot(2,2,3);
plot(d,SNIR,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('SNIR');
subplot(2,2,4);
plot(d,Throughput,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('Throughput');
hold off;
답변 (1개)
Siriniharika Katukam
2019년 11월 18일
Hi
The variable “Throughput” is defined in two ways in your code
Throughput=B.*log2(1+(10.^(SNIR(end)/10)));
Throughput=Throughput.*(B.*log2(1+(10.^(SNIR(end)/10))));
Make sure that you defined it properly. Moreover, this variable is a scalar since you used SNIR(end), hence it cannot be plotted unless it is an array of values.
댓글 수: 1
Stephen23
2019년 11월 18일
"hence it cannot be plotted unless it is an array of values."
Actually scalars can be plotted, but because the default LineSpec has no markers the points are not visible... but the points can certainly be plotted without error (i.e. the line objects will exist, even if they do not show in the axes).
참고 항목
카테고리
Help Center 및 File Exchange에서 Import, Export, and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!