-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerateMeasurments.m
18 lines (17 loc) · 1.02 KB
/
generateMeasurments.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
%generate measurements
measurements = cell(multiObjectDynamicModel.totalTimeSteps,1);
%generate object detections
for i = 1:length(objectTrajectory)
for timeStep = objectTrajectory(i).birthTime:objectTrajectory(i).endTime
if rand < multiObjectMeasurementModel.detectionProbability
objectDetection = mvnrnd((multiObjectMeasurementModel.observationMatrix*objectTrajectory(i).stateSequence(:,timeStep-objectTrajectory(i).birthTime+1))',multiObjectMeasurementModel.measurementNoiseCovariance)';
measurements{timeStep} = [measurements{timeStep} objectDetection];
end
end
end
%generate clutter
for timeStep = 1:multiObjectDynamicModel.totalTimeSteps
numClutter = poissrnd(multiObjectMeasurementModel.PoissonClutterRate);
clutterMeasurements = multiObjectMeasurementModel.rangeOfInterest(:,1) + (multiObjectMeasurementModel.rangeOfInterest(:,2)-multiObjectMeasurementModel.rangeOfInterest(:,1)).*rand(2,numClutter);
measurements{timeStep} = [measurements{timeStep} clutterMeasurements];
end