I am trying to simulate noise-filtering in a Doppler-shift radar. It should filter out objects moving below 25 m/s relative to the radar (approaching or moving away). There should be two ways of avoiding detection by the radar: if the object is moving in any direction but at a speed below 25 m/s OR moving at any speed but perpendicular to (or rather, circling) the radar. In both these cases the object’s radial velocity relative to the stationary radar should be below 25 m/s and thus fool the radar into filtering it out as noise. I know the objects position and velocity vector (2D and 3D). I am a complete idiot when it comes to math so I just cant get my head around this. Any help please?
Edit: Badly formed question. I want to get the true radial velocity relative to the radar and filter objects that are moving faster than 25 m/s but in a relative heading that would make the radial velocity towards the radar less than 25 m/s. One example would maybe be an object moving at 30 m/s and 45 degrees perpendicular to the radar would be filtered out but not if the object was moving at 300 m/s.
I don’t know any Lua, but since this is a purely mathematical question, mathematical pseudo-code should be enough.
Let
rbe the position of the radar,xbe the position of the object, andvbe the object’s velocity vector (in units of metres per second). All of these are two- or three-dimensional vectors, depending on whether you’re working in two or three dimensions.The velocity condition is pretty easy: Just take the norm of the velocity vector
vand compare it against your threshold of 25 m/s.To find out whether the object is circling the radar, compute the vector from the radar to the object, which is
x-r, and check whether it is perpendicular to the velocity vector; you do this by computing the scalar product, which becomes zero when the two vectors are perpendicular. In practice you would use a small threshold greater than zero to allow the two vectors to be slightly non-perpendicular.In pseduo-code, this becomes:
You’ll have to find out how to compute norms and scalar products in Lua (or, failing that, compute them yourself as described in the linked pages).
Answer to edited question (closure velocity)
The scalar product comes in handy for your modified question, too. You obtain the closure velocity as
Note that the result is signed — positive if the object is moving towards the radar, negative if it’s moving away from it. You would then do your noise filtering check like this:
So in a sense this modified test is even simpler than the original version.