How is sigstrength in the Antenna toolbox sorting the signal strength outputs?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am using the Longley-Rice model from the Antenna toolbox.
I want to compute the signal strength received for a thousand of receiver sites from a thousand of emitter sites.
I noticed that when I compute the signal strength individually for each couple receiver/emitter it does not give the same results than when I do it for vectors of receivers. The order of signal strength is not the same.
My assumption is that MATLAB is sorting the receivers in a specific way (by distance from emitters maybe?). However it is not specified anywhere.
If anyone knows how the function sigstrength is sorting the observation and if there is a way in order to keep the initial order in input.
I assume that it is the same for emitters. I have here to therefore use two loops which takes very long and I would love to do it by just keeping two vectors of emitters and receivers.
Below are my two codes (1) with the two loops, (2) with only one loop, using vectors of receivers.
(1) With two loops
data = readtable('data.csv');
pm = propagationModel('longley-rice');
max=height(data);
mat=NaN(max,129);
% loop over the list of emitters
for n = 1:max;
lat=data.lat_antenna(n);
lon=data.lon_antenna(n);
haat=data.haat(n);
fq=data.freq(n)*10^6;
power=data.min_power(n)*10^3;
tx = txsite('Name','MathWorks', ...
'Latitude',lat, ...
'Longitude',lon, ...
'Antenna',design(dipole,fq), ...
'AntennaHeight', haat , ... % Units: meters
'TransmitterFrequency',fq, ... % Units: Hz
'TransmitterPower', power ); % in
% number of receivers
maxi=data.counti(n);
% loop over receivers
for j= 1: maxi;
my_field = strcat('lat_market',num2str(j));
rxLocation=data.(my_field)(n);
my_field = strcat('lon_market',num2str(j));
ryLocation=data.(my_field)(n);
rx = rxsite('Latitude', rxLocation, ...
'Longitude', ryLocation, ...
'Antenna', design(dipole,tx.TransmitterFrequency));
mat(n,j)=sigstrength(rx,tx,pm);
end
end
(2) With only one loop, using vectors of receivers
data = readtable('data.csv');
pm = propagationModel('longley-rice');
max=height(data);
mat=NaN(max,129);
for n = 1:max;
lat=data.lat_antenna(n);
lon=data.lon_antenna(n);
haat=data.haat(n);
fq=data.freq(n)*10^6;
power=data.min_power(n)*10^3;
tx = txsite('Name','MathWorks', ...
'Latitude',lat, ...
'Longitude',lon, ...
'Antenna',design(dipole,fq), ...
'AntennaHeight', haat , ... % Units: meters
'TransmitterFrequency',fq, ... % Units: Hz
'TransmitterPower', power ); % in
%number of receivers around
maxi=data.counti(n);
rxLocations = [];
for j= 1: maxi;
my_field = strcat('lat_market',num2str(j));
rxLocations(j)=data.(my_field)(n);
end
ryLocations = [];
for j= 1: maxi;
my_field = strcat('lon_market',num2str(j));
ryLocations(j)=data.(my_field)(n);
end
rxs = rxsite('Latitude', rxLocations, ...
'Longitude', ryLocations, ...
'Antenna', design(dipole,tx.TransmitterFrequency));
ss=sigstrength(rxs,tx,pm);
for j=1:maxi;
mat(n,j)=ss(j);
end
end
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Wireless Communications finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!