simulate radar ghosts due to multipath return -凯发k8网页登录
this example shows how to simulate ghost target detections and tracks due to multipath reflections, where signal energy is reflected off another target before returning to the radar. in this example you will simulate ghosts with both a statistical radar model and a transceiver model that generates iq signals.
motivation
many highway scenarios involve not only other cars, but also barriers and guardrails. consider the simple highway created using the driving scenario designer (automated driving toolbox) app. for more information on how to model barriers see the (automated driving toolbox) example. use the helpersimplehighwayscenariodsd
function exported from the driving scenario designer to get the highway scenario and a handle to the ego vehicle.
% set random seed for reproducible results rndstate = rng('default'); % create scenario using helper [scenario, egovehicle] = helpersimplehighwayscenariodsd();
to model the detections generated by a forward-looking automotive radar, use the radardatagenerator system object™
. use a 77 ghz center frequency, which is typical for automotive radar. generate detections up to 150 meters in range and with a radial speed up to 100 m/s.
% automotive radar system parameters freq = 77e9; % hz rgmax = 150; % m spmax = 100; % m/s rcs = 10; % dbsm azres = 4; % deg rgres = 2.5; % m rrres = 0.5; % m/s % create a forward-looking automotive radar rdg = radardatagenerator(1, 'no scanning', ... 'updaterate', 10, ... 'mountinglocation', [3.4 0 0.2], ... 'centerfrequency', freq, ... 'hasrangerate', true, ... 'fieldofview', [70 5], ... 'rangelimits', [0 rgmax], ... 'rangeratelimits', [-spmax spmax], ... 'hasrangeambiguities',true, ... 'maxunambiguousrange', rgmax, ... 'hasrangerateambiguities',true, ... 'maxunambiguousradialspeed', spmax, ... 'referencerange', rgmax, ... 'referencercs',rcs, ... 'azimuthresolution',azres, ... 'rangeresolution',rgres, ... 'rangerateresolution',rrres, ... 'targetreportformat', 'detections', ... 'profiles',actorprofiles(scenario)); % create bird's eye plot and detection plotter function [~,detplotterfcn] = helpersetupbep(egovehicle,rdg); title('free space (no multipath)'); % generate raw detections time = scenario.simulationtime; tposes = targetposes(egovehicle); [dets,~,config] = rdg(tposes,time); % plot detections detplotterfcn(dets,config);
this figure shows the locations of the detections along the target vehicle as well as along the side of the barrier. however, detections are not always so well-behaved. one phenomenon that can pose considerable challenges to radar engineers is multipath. multipath is when the signal not only propagates directly to the intended target and back to the radar but also includes additional reflections off objects in the environment.
multipath reflections
when a radar signal propagates to a target of interest it can arrive through various paths. in addition to the direct path from the radar to the target and then back to the radar, there are other possible propagation paths. the number of paths is unbounded, but with each reflection, the signal energy decreases. commonly, a propagation model considering three-bounce paths is used to model this phenomenon.
to understand the three-bounce model, first consider the simpler one-bounce and two-bounce paths, as shown in these figures.
one-bounce path
the one-bounce path propagates from the radar (1) to the target (2) and then is reflected from the target (2) back to the radar. this is often referred to as the direct or line-of-sight path.
two-bounce paths
in this case, there are two unique propagation paths that consist of two bounces.
the first two-bounce path propagates from the radar (1) to a reflecting surface (3), then to the target (2) before returning to the radar (1). because the signal received at the radar arrives from the last bounce from the true target, it generates ghost detections along the same direction as the true target. because the path length for this propagation is longer, it appears at a farther range than the true target detections.
the second two-bounce path propagates from the radar (1) to the target (2), then to the reflecting surface (3) before returning to the radar (1). in this case, the ghost detections appear on the other side of the reflecting surface as the radar receives the reflected signal in that direction.
notice that the path length for both two-bounce paths is the same. as a result, the measured range and range rate for these paths will be the same as well.
three-bounce path
the three-bounce path reflects off the barrier twice. this path never propagates directly to the target or directly back to the radar. the three-bounce ghost detections appear on the other side of the reflecting surface as the radar receives the reflected signal in that direction. additionally, it has the longest propagation path of the three-bounce paths and therefore has the longest measured range of the three paths. this path corresponds to a mirror reflection of the true target on the other side of the barrier.
model ghost target detections
set the hasghosts
property on the radardatagenerator
to model the detections generated from these three-bounce paths.
% enable ghost target model release(rdg); rdg.hasghosts = true; % generate raw detections time = scenario.simulationtime; tposes = targetposes(egovehicle); [dets,~,config] = rdg(tposes,time); % plot detections detplotterfcn(dets,config); title('simple multipath environment');
this figure reproduces the analysis of the three propagation paths. the first two-bounce ghosts lie in the direction of the target at a slightly longer range than the direct-path detections. the second two-bounce and three-bounce ghosts lie in the direction of the mirrored image of the target generated by the reflection from the barrier.
ghost tracks
because the range and velocities of the ghost target detections are like the range and velocity of the true targets, they have kinematics that are consistent for a tracker that is configured to track the true target detections. this consistency between the kinematics of real and ghost targets results in tracks being generated for the ghost target on the other side of the barrier.
set the targetreportformat
property on radardatagenerator
to tracks
to model the tracks generated by a radar in the presence of multipath.
% output tracks instead of detections release(rdg); rdg.targetreportformat = 'tracks'; rdg.confirmationthreshold = [2 3]; rdg.deletionthreshold = [5 5]; filterinitializationfcn = 'initcvekf'; % constant-velocity ekf % create a new bird's eye plot to plot the tracks [bep,trkplotterfcn] = helpersetupbep(egovehicle,rdg); title('simple multipath environment'); % run simulation restart(scenario); scenario.stoptime = 7.5; while advance(scenario) time = scenario.simulationtime; tposes = targetposes(egovehicle); % generate tracks [trks,~,config] = rdg(tposes,time); % filter out tracks corresponding to static objects (e.g. barrier) dyntrks = helperkeepdynamicobjects(trks, egovehicle); % visualize dynamic tracks helperplotscenario(bep,egovehicle); trkplotterfcn(dyntrks,config); end
this figure shows the confirmed track positions using square markers. the tracks corresponding to static objects (for example a barrier) are not plotted. notice that there are multiple tracks associated with the lead car. the tracks that overlay the lead car correspond to the true detection and the first two-bounce ghost. the tracks that lie off of the road on the other side of the guardrail correspond to the second two-bounce and three-bounce ghosts.
the track velocities are indicated by the length and direction of the vectors pointing away from the track position (these are small because they are relative to the ego vehicle). ghost detections may fool a tracker because they have kinematics like the kinematics of the true targets. these ghost tracks can be problematic as they add an additional processing load to the tracker and can confuse control decisions using the target tracks.
model iq signals
in the previous free-space and multipath simulations in this example, you used measurement-level radar models to generate detections and tracks. now, use the radartransceiver
system object to generate time-domain iq signals. create an equivalent radartransceiver
directly from the radardatagenerator
.
the statistical radar has the following range and range-rate (doppler) parameters which determine the constraints for the waveform used by the radartransceiver
.
rgmax = rdg.rangelimits(2) % m
rgmax = 150
spmax = rdg.rangeratelimits(2) % m/s
spmax = 100
compute the pulse repetition frequency (prf) that will satisfy the range rate for the radar.
lambda = freq2wavelen(rdg.centerfrequency); prf = 2*speed2dop(2*spmax,lambda);
compute the number of pulses needed to satisfy the range-rate resolution requirement.
rrres = rdg.rangerateresolution
rrres = 0.5000
dopres = 2*speed2dop(rrres,lambda); numpulses = 2^nextpow2(prf/dopres)
numpulses = 512
prf = dopres*numpulses
prf = 1.3150e 05
confirm that the unambiguous range that corresponds to this prf is beyond the maximum range limit.
rgumb = time2range(1/prf)
rgumb = 1.1399e 03
re-set some properties of the radardatagenerator
for better comparison to iq results from the radartransceiver
.
release(rdg); % set the range and range-rate ambiguities according to desired prf and % number of pulses rdg.maxunambiguousrange = rgumb; rdg.maxunambiguousradialspeed = spmax; % set the statistical radar to report clustered detections to compare to % the iq video from the radar transceiver. rdg.targetreportformat = 'clustered detections'; rdg.detectioncoordinates = 'body';
construct the equivalent radartransceiver
directly from the radardatagenerator
. by default, the radartransceiver
uses a unit-gain rectangular antenna pattern with azimuth and elevation beamwidths equal to the azimuth and elevation resolutions of the radardatagenerator
. to simulate a radar with a transmit pattern that covers the desired field of view, first set the azimuth resolution of the radardatagenerator
equal to the field of view.
azres = rdg.azimuthresolution;
rdg.azimuthresolution = rdg.fieldofview(1);
% construct the radar transceiver from the radar data generator
rtxrx = radartransceiver(rdg)
rtxrx = radartransceiver with properties: waveform: [1x1 phased.rectangularwaveform] transmitter: [1x1 phased.transmitter] transmitantenna: [1x1 phased.radiator] receiveantenna: [1x1 phased.collector] receiver: [1x1 phased.receiverpreamp] mechanicalscanmode: 'none' electronicscanmode: 'none' mountinglocation: [3.4000 0 0.2000] mountingangles: [0 0 0] numrepetitionssource: 'property' numrepetitions: 512 rangelimitssource: 'property' rangelimits: [0 150] rangeoutputport: false timeoutputport: false
% restore the desired azimuth resolution for the statistical radar
rdg.azimuthresolution = azres;
the statistical radar emulates the use of a uniform linear array (ula) to form multiple receive beams, as needed to achieve the specified azimuth resolution. the number or elements required is determined by the radar's azimuth resolution and wavelength, and can be found with the beamwidth2ap
function.
numrxelmt = ceil(beamwidth2ap(rdg.azimuthresolution,lambda,0.8859)/(lambda/2))
numrxelmt = 26
attach a ula to the receive antenna of the radartransceiver
.
elmt = rtxrx.receiveantenna.sensor;
rxarray = phased.ula(numrxelmt,lambda/2,'element',elmt);
rtxrx.receiveantenna.sensor = rxarray;
generate iq samples
use the helper3bounceghostpaths function
to compute the three-bounce paths for the target and sensor positions from the multipath scenario.
restart(scenario);
tposes = targetposes(egovehicle);
% generate 3-bounce propagation paths for the targets in the scenario
paths = helper3bounceghostpaths(tposes,rdg);
use the radartransceiver
to generate the baseband sampled iq data received by the radar.
time = scenario.simulationtime; % current simulation time xcube = rtxrx(paths,time); % generate iq data for transceiver from the 3-bounce path model
range and doppler processing
the received data cube has the three-dimensions: fast-time samples, receive antenna element, and slow-time samples.
size(xcube)
ans = 1×3
64 26 512
use the phased.rangedopplerresponse
system object to perform range and doppler processing along the first and third dimensions of the data cube.
rngdopproc = phased.rangedopplerresponse( ... 'rangemethod','matched filter', ... 'doppleroutput','speed', ... 'propagationspeed',rtxrx.receiveantenna.propagationspeed, ... 'operatingfrequency',rtxrx.receiveantenna.operatingfrequency, ... 'samplerate',rtxrx.receiver.samplerate); mfcoeff = getmatchedfilter(rtxrx.waveform); [xrngdop,rggrid,rrgrid] = rngdopproc(xcube,mfcoeff);
beamforming
use the phased.phaseshiftbeamformer
system object to form beams from the receive antenna array elements along the second dimension of the data cube.
azfov = rdg.fieldofview(1); anggrid = -azfov/2:azfov/2; bmfwin = @(n)normmax(taylorwin(n,5,-60)); beamformer = phased.phaseshiftbeamformer( ... 'direction',[anggrid;0*anggrid],... 'sensorarray',rtxrx.receiveantenna.sensor, ... 'operatingfrequency',rtxrx.receiveantenna.operatingfrequency); xbfmrngdop = xrngdop; [nr,ne,nd] = size(xbfmrngdop); xbfmrngdop = permute(xbfmrngdop,[1 3 2]); % nr x nd x ne xbfmrngdop = reshape(xbfmrngdop,[],ne); xbfmrngdop = beamformer(xbfmrngdop.*bmfwin(ne)'); xbfmrngdop = reshape(xbfmrngdop,nr,nd,[]); % nr x nd x nb xbfmrngdop = permute(xbfmrngdop,[1 3 2]); % nr x nb x nd
use the helperplotbeamformedrangedoppler
function to plot the range-angle map from the beamformed, range, and doppler processed data cube.
helperplotbeamformedrangedoppler(xbfmrngdop,rggrid,anggrid,rtxrx);
the local maxima of the received signals correspond to the location of the target vehicle, the guardrail, and the ghost image of the target vehicle on the other side of the guardrail. show that measurement-level detections generated by radardatagenerator
are consistent with the peaks in the range-angle map generated by the equivalent radartransceiver
.
use the helperplaystatandiqmovie
function to compare the measurement-level detections and iq processed video for the duration of this scenario.
helperplaystatandiqmovie(scenario,egovehicle,rtxrx,rdg,rngdopproc,beamformer,bmfwin);
multipath ground bounce
multipath ghost detections can be used at times to see objects in the road that would otherwise not be detected by the radar due to occlusion. one example is the detection of an occluded vehicle due to multipath off of the road surface. use the helpergroundbouncescenariodsd
function to create a scenario where a slower moving vehicle in the same lane as the ego vehicle is occluded by another vehicle directly in front of the radar.
[scenario, egovehicle] = helpergroundbouncescenariodsd; ax3d = helperradarchaseplot(egovehicle);
the yellow car is occluded by the red car. a line of sight does not exist between the blue ego car's forward looking-radar and the yellow car.
viewloc = [scenario.actors(2).position(1)-10 -10]; chaseplot(egovehicle,'viewlocation',viewloc,'viewheight',0,'viewyaw',40,'parent',ax3d);
multipath can pass through the space between the underside of a car and the surface of the road.
reuse the radardatagenerator
to generate ghost target detections due to multipath between the vehicles and the road surface. use the helperroadprofiles
and helperroadposes
functions to include the road surface in the list of targets modeled in the scenario to enable multipath between the road surface and the vehicles.
release(rdg); rdg.rangerateresolution = 0.5; rdg.fieldofview(2) = 10; rdg.targetreportformat = 'detections'; tprofiles = actorprofiles(scenario); rdprofiles = helperroadprofiles(scenario); rdg.profiles = [tprofiles;rdprofiles]; % create bird's eye plot and detection plotter function [bep,detplotterfcn] = helpersetupbep(egovehicle,rdg); [ax3d,detchaseplotterfcn] = helperradarchaseplot(egovehicle,rdg); camup(ax3d,[0 0 1]); pos = egovehicle.position [-5 -5 0]; campos(ax3d,pos); camtarget(ax3d,[15 0 0]); % generate clustered detections time = scenario.simulationtime; tposes = targetposes(egovehicle); rdposes = helperroadposes(egovehicle); poses = [tposes rdposes]; [dets,~,config] = rdg(poses,time); % plot detections dyndets = helperkeepdynamicobjects(dets,egovehicle); detplotterfcn(dyndets,config);
the detection from the occluded car is possible due to the three-bounce path that exists between the road surface and the underside of the red car.
% find the 3-bounce detection from the occluded car i3 = find(cellfun(@(d)d.objectattributes{1}.bouncepathindex,dyndets)==3); det3 = dyndets{i3}; % plot the 3-bounce path between the radar and the occluded car ibnctgt = find([poses.actorid]==det3.objectattributes{1}.bouncetargetindex); itgt = find([poses.actorid]==det3.objectattributes{1}.targetindex); pos = [rdg.mountinglocation;poses(ibnctgt).position;poses(itgt).position] egovehicle.position; hold(ax3d,'on'); plot3(ax3d,pos(:,1),pos(:,2),pos(:,3),'r-*','linewidth',2); campos([-6 -15 2]); camtarget([17 0 0]);
this figure shows the three-bounce path as the red line. observe that a bounce path between the radar and the occluded yellow car exists by passing below the underside of the red car.
% show bounce path arriving at the occluded yellow car
campos([55 -10 3]); camtarget([35 0 0]);
this figure shows the three-bounce path arriving at the occluded yellow car after bouncing off of the road surface.
summary
in this example, you learned how ghost target detections arise from multiple reflections that can occur between the radar and a target. an automotive radar scenario was used to highlight a common case where ghost targets are generated by a guardrail in the field of view of the radar. as a result, there are four unique bounce paths which can produce these ghost detections. the kinematics of the ghost target detections are like the detections of true targets, and as a result, these ghost targets can create ghost tracks which can add additional processing load to a tracker and may confuse control algorithms using these tracks. the radartransceiver
can be used to generate higher-fidelity iq data that is appropriate as input to detection and tracking algorithms.
% restore random state
rng(rndstate);
supporting functions
helperkeepdynamicobjects
function dynrpts = helperkeepdynamicobjects(rpts,egovehicle) % filter out target reports corresponding to static objects (e.g. guardrail) % % this is a helper function and may be removed or modified in a future % release. dynrpts = rpts; if ~isempty(rpts) if iscell(rpts) vel = cell2mat(cellfun(@(d)d.measurement(4:end),rpts(:)','uniformoutput',false)); else vel = cell2mat(arrayfun(@(t)t.state(2:2:end),rpts(:)','uniformoutput',false)); end vel = sign(vel(1,:)).*sqrt(sum(abs(vel(1:2,:)).^2,1)); egovel = sign(egovehicle.velocity(1))*norm(egovehicle.velocity(1:2)); gndvel = vel egovel; % detection speed relative to ground isstatic = gndvel > -4 & ... greater than 4 m/s departing and, gndvel < 8; % less than 8 m/s closing speed dynrpts = rpts(~isstatic); end end
normmax
function y = normmax(x) if all(abs(x(:))==0) y = ones(size(x),'like',x); else y = x(:)/max(abs(x(:))); end end