Asked Mathworks support, sigstrength() power calculation has been reworked after version 2022Ra to incorporate phase calculations - now output of sigstrength() and packet-level simulation is identical.
Using sigstrength() for raytracing propagation model
13 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to run a ray tracing simulation for a simple ground reflection scenario. I have an STL file with a "floor" that is 1m wide (in y-direction) and 25m long (in the x-direction). I place a transmitter at the location [0.1;0.5;3]. I place 1000 receivers collinear with the transmitter, and at the same height:

clear all;clc;close all;
stlFile = '25m1m_floor.stl';
viewer = siteviewer('SceneModel',stlFile); % Required to link STL for ray tracing
tx = txsite('cartesian', 'AntennaPosition', [0.1;0.5;3], 'TransmitterFrequency', 900e6, 'TransmitterPower', 0.001);
numPointsX = 1000;numPointsY = 1;
x = linspace(0.1, 25, numPointsX); y = linspace(0.5, 0.5, numPointsY); [X, Y] = meshgrid(x, y);
Z = 3 * ones(size(X));
for j = 1:numPointsX
for i = 1:numPointsY
rxs(i,j) = rxsite('cartesian', 'AntennaPosition', [X(i,j); Y(i,j); Z(i,j)], 'CoordinateSystem', 'cartesian');
end
end
%To display the tx and rx in siteviewer
%{
show(tx,"ShowAntennaHeight",false);
for i = 1:numel(rxs)
show(rxs(i),"ShowAntennaHeight",false);
end
%}
pm = propagationModel('raytracing', 'Method', 'sbr', 'MaxNumReflections', 1,...
'SurfaceMaterial', 'concrete', 'CoordinateSystem', 'cartesian');
ss(1,:) = sigstrength(rxs,tx,pm);
packetLength = 33;
txPower = 0.01;
for j = 1:numPointsX
for i = 1:numPointsY
rx = rxs(i,j);
rays_out = raytrace(tx, rx, pm);
rays = rays_out{:};
[RSS(i,j), rxPower(i,j)] = calcRSSRays(rays,packetLength,txPower);
end
end
figure;plot(x,RSS);
hold;plot(x,ss);
function [RSS,rxPower] = calcRSSRays(rays,packetLength,txPower)
data = randi([0 3], packetLength, 1);
txPacket = sqrt(txPower)*pskmod(data, 4, pi/4);
rxPacket = zeros(1, packetLength);
pathGains = -[rays.PathLoss];
phaseShifts = [rays.PhaseShift];
pathGainsLinear = 10.^(pathGains / 10);
for s = 1:packetLength
E_ray = sqrt(pathGainsLinear) .* exp(-1j .* phaseShifts);
E_total = sum(E_ray * txPacket(s),"all");
rxPacket(s) = E_total;
end
rxPower = mean(abs(rxPacket).^2);
RSS = 10 * log10(rxPower./txPower);
end
The transmitter frequency is 900Mhz so the wavelength is around 0.33m. I've specified MaxNumReflections as 1, which I think should capture the ground reflection, and when I plot for one tx-rx pair, I can see that:

Since the tx and rx are all at the same height, I think I should get an RSS profile which decays with distance according to the power rule (i.e. 1/d^2), but with undulations where the ground reflected path interferes constructively and destructively with the line of sight ray.
However, when I plot the output from the sigstrength() function, there are no undulations. I've also tried calculating RSS from a packet-level simulation that I wrote, taking the rays output from the raytrace function - I think this is correct, because I do see the interference pattern in it:

Does anyone know if I've made a mistake in the ray-tracing/use of sigstrength()? Or is any further calculation required on it?
Or is this something to ask Mathworks support?
NOTE 1: Question editor doesn't recognize .stl file extension for upload, so I've changed the extension to .txt. Extension needs to be changed to .stl to run it.
NOTE 2: I posted this question earlier, but I've come up with a better version of the simulation, so I've deleted that one before any answers/comments were posted on it.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!