Given the times at which certain an object passes multiples of a fixed distance, what's a good algorithm to calculate the current speed of the moving object?
the data stream might look like this :
(time, distance)
(0,0)
(4,5)
(9,10)
(14,15)
(20,20)
(25,25)
(29,30
(35,35)
(41,40)
..
so how can I tell how fast the object is moving at time t=42,43,44 etc... ?
Now, the easiest way is to sum the distance travelled between the last n data points and divide by the time taken.
another way, would be to get the instaneneous velocities at each point and use a moving average filter using the last n data point.
but, what would be a better way of doing this? the above data is basically all I'll have, I don't know what the total distance 'travelled' would be.
the scenario is pretty similiar to measuing file transfer rates, are there good file transfer speed measurement algorithms that I can adapt for this scenario?
also, should this be posted in highly technical instead?
edit:
this is not HW
the data stream might look like this :
(time, distance)
(0,0)
(4,5)
(9,10)
(14,15)
(20,20)
(25,25)
(29,30
(35,35)
(41,40)
..
so how can I tell how fast the object is moving at time t=42,43,44 etc... ?
Now, the easiest way is to sum the distance travelled between the last n data points and divide by the time taken.
another way, would be to get the instaneneous velocities at each point and use a moving average filter using the last n data point.
but, what would be a better way of doing this? the above data is basically all I'll have, I don't know what the total distance 'travelled' would be.
the scenario is pretty similiar to measuing file transfer rates, are there good file transfer speed measurement algorithms that I can adapt for this scenario?
also, should this be posted in highly technical instead?
edit:
this is not HW