Simple FMCW radar prediction filtering

2 Ansichten (letzte 30 Tage)
Patrick Fiske
Patrick Fiske am 26 Mär. 2019
I am attempting to filter data collectred by an FMCW radar. The output of the radar is in a CSV format that provides me with columns of data for x and y coordinates, target number, frame, and velocity. Essentially the target number is the number of detected objects per frame. For example frame 1 is repeated down the column 8 times since there are 8 targets detected. Each target obviosly has its own x and y values that I will be using.
My goal is to define objects based on if the targets are within a certain distance. From here I want to only plot objects if they are within a certain radius on the next frame. I am attempting to do this by starting on frame 2 and referencing frame 1.
I am getting a plot and I can also plot circles around my designated objects independently in each frame. I want to be able to plots objects that are defined based on the previous frame. Essentially if a group of dots is following a path in the next frame, then classify this as an object and plot.
Thanks
data=csvread('exp5.csv');
fps = 10;
xRange = 2;
yRange = 3;
delay = 1/fps; %[s]
%Split csv into vector
x = data(:,4);
y = data(:,5);
frameNo = data(:,1);
tarTotal = data(:,2);
tarNo = data(:,3);
intensity = data(:,8);
intensityLOG = data(:,9);
velocity=data(:,8);
% previousframe=frameNo-1;
k = 1;
%delay loop to play back in real time
%define values for the first frame
frameNo(1)=1;
x(1)=-0.0840;
y(1)=0.0215;
for j = 2:max(frameNo) %go through each frame starting at the second frame
ok = k; %store k before loop
xs = zeros(tarTotal(k),1);
ys = zeros(tarTotal(k),1);
for i = 1:tarTotal(k)
scatter(x(k), y(k), 20, 'filled', 'k')
hold on
xlabel('X [m]')
ylabel('Y [m]')
xlim([-xRange,xRange])
ylim([0,yRange])
k = k+1;
xs(i) = x(k);
ys(i) = y(k);
end
for a = 1:size(xs) % define vector to hold points a
pointa = [xs(a) ys(a)];
for b = 1:size(xs) % define vector to hold points b
pointb = [xs(b) ys(b)];
if pointa == pointb % ignore points that are on top of each other or repeated
break;
else
dist(i) = abs(sqrt((pointb(1)-pointa(1))^2 + (pointb(2)-pointa(2))^2)); %calculate the distance between all the targets
end
end
end
if dist(j)<=0.5 % if the distance between objects is small enough, define an object
objectcenter = (pointa+pointb)/2;
predictdist(j)=dist(j)-dist(j-1); % attempting to relate the object centers between frames
elseif predictdist(j)<2 % if the object center in the next frame is close to the first frame, plot a circle around the object
viscircles(objectcenter,.1)
end
pause(delay)
clf
end

Antworten (0)

Kategorien

Mehr zu Measurement-Level Simulations 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!

Translated by