Sum two different coverage models

12 vues (au cours des 30 derniers jours)
Barney
Barney le 8 Jan 2025
Is there a way to sum two different coverage outputs? I have two different transmitters and have plotted the output of each on the same coverage map. I notice that it appears to do the equivalent of a 'max hold' where the field patterns from the separate transmitters overlap. Is there a way to sum the field patterns from the separate transmitters? I realise that this would effectively assume zero phase diference at all points of interaction, but that suits what I am aiming to do.
So far I have tried converting the output of the coverage .Data to an array. This provides the lat, long, and dB output for each transmitter. What I can't work out is how to sum these arrays when the lat and long values are different (as the transmitters are in different locations). In an ideal world, I would then convert the summed arrays back into a coverage map of the result.
Any help much appreciated.
% horn antenna setup
tx_horn = horn("Height", 0.06, "Width", 0.16, "Length", 0.10, "FeedHeight", ...
0.04, "FeedWidth", 0.002, "FlareHeight", 0.216, "FlareLength", 0.15, ...
"FlareWidth", 0.266);
% transmitter array setup
f = 1.3e9; % Frequency
c = 299792458; % Speed of light
wl = c / f; % Wavelength
M = 2; % Number of elements on each row
N = 2; % Number of elements on each column
dy = 0.5 * wl; % Spacing between row elements (m)
dz = 0.5 * wl; % Spacing between column elements (m)
ura = phased.URA([N M], [dz dy], 'Element', tx_horn);
% transmitter setup
tx1 = txsite('Latitude', 52.36364, ...
'Longitude', -3.77767, ...
'TransmitterFrequency', f, ...
'Antenna', ura, ...
'AntennaHeight', 5, ...
'TransmitterPower', 50, ...
'AntennaAngle', 90);
tx2 = txsite('Latitude', 52.36369, ...
'Longitude', -3.78150, ...
'TransmitterFrequency', f, ...
'Antenna', ura, ...
'AntennaHeight', 5, ...
'TransmitterPower', 50, ...
'AntennaAngle', 90);
% coverage output
e_max = -20;
e_min = -60;
e_step = 1;
cov1 = coverage(tx1, 'close-in', 'SignalStrengths', e_min:e_step:e_max, 'ColorLimits', [e_min e_max]);
cov2 = coverage(tx2, 'close-in', 'SignalStrengths', e_min:e_step:e_max, 'ColorLimits', [e_min e_max]);
% convert to arrays for summing?
tx_array1 = table2array(cov1.Data);
tx_array2 = table2array(cov2.Data);
% What next?

Réponse acceptée

Walter Roberson
Walter Roberson le 8 Jan 2025
Déplacé(e) : Walter Roberson le 8 Jan 2025
You could probably extract the lat and long vectors from tx_array1 and tx_array2 and do scatteredInterpolant() to construct interpolating objects with interpolation method set to 'none'. After that would be a matter of inventing common query points. Then query each of the scattered interpolant objects at the common query points.
Now,
result = zeros(size(QUERY_RESULT1));
mask1 = isnan(QUERY_RESULT1);
mask2 = isnan(QUERY_RESULT2);
tmask = ~mask1 & ~mask2;
result(tmask) = QUERY_RESULT1(tmask) + QUERY_RESULT2(tmask);
tmask = ~mask1 & mask2;
result(tmask) = QUERY_RESULT1(tmask);
tmask = mask1 & ~mask2;
result(tmask) = QUERY_RESULT2(tmask);
%mask1 & mask2 is nan in both places. The output result for there should be
%0, which we already got by initializing the result array to 0.
  4 commentaires
Barney
Barney le 9 Jan 2025
Thanks Walter.
A couple of slight tweaks - I had used the table2array function to generate the tx_arrays, so consequently I can use round brackets rather than curly braces to set the lat and lon variables. Also, for my personal preference, I have reordered the variables in the surf plot to be as follows:
surf(LonQ, LatQ, result, 'edgecolor', 'none')
Thanks again for your help, I really appreciate it.
Walter Roberson
Walter Roberson le 9 Jan 2025
I don't know what I was thinking, putting the result before the other information !

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by