Okay, so I am trying to address a biological problem here. I have asked a variant of this question here, but I was not able to get to solving it.

The question:

Four objects are vibrating constantly with some variable frequency and amplitude. I have the X-Y coordinates of the objects w.r.t time. Now, I want to find if there is any correlation between the objects movements.

Also, if there is any correlation between the movement of an object with itself w.r.t time.

I am not sure what to do, I have absolutely no idea about the mathematics involved, but can try to understand what needs to be done.

Thanks! A

  • $\begingroup$ This question is very low quality. Use "cross-correlation" for object to object. use "auto-correlation" for object with itself. But this question is very low quality. You can search for what is correlation. $\endgroup$
    – acs
    Sep 20, 2015 at 21:52
  • 3
    $\begingroup$ For what it's worth, I thought the question was fine. $\endgroup$
    – Jim Clay
    Sep 20, 2015 at 22:35
  • $\begingroup$ i'm more concerned about the quality of answers. i also think the question is okay as it is and that Jim answered it adequately. $\endgroup$ Sep 21, 2015 at 1:40

1 Answer 1


Since you have the x/y position for each object it should be fairly straightforward. Call the position of each $p_1(t)$ through $p_4(t)$. Subtract the mean from all of them since it sounds like you only care about their movement, not their position.

Once you have done that it should be a fairly simple matter of cross-correlating the position functions. If the vibration frequencies don't change with time you will only get a strong cross-correlation if the vibration frequencies of the two objects are either the same or quite close to each other.

  • $\begingroup$ I wonder, Jim, if user1599497's vibrations are in 1-dimension only (like a plucked guitar string) or are the vibrations fluctuating in 2-dimensions (like the x/y position of a bee flying around in a room). This sounds like a fun problem. $\endgroup$ Sep 21, 2015 at 4:44
  • $\begingroup$ @Jim Clay: Thanks! I have calculated eucledian distance and angle of movement, using the most frequent position of the object as reference. Now I am trying to calculate if the movements (based on eucledian distance) are corelated, and if the direction of motion is also corelated. That is easy. But I need to corelate both together, how do I do that? I was suggested to use eucledian distance and angle as complex number pair and then find the correlation. But I am not sure how to do that in python. Also, can we find anything other than pearson's corealtion factor? $\endgroup$
    – C.M
    Sep 21, 2015 at 9:49
  • $\begingroup$ @Richard Lyons: its a 2D motion. Its actually 3-D, but I am discounting the third dimension for sake of simplicity for now. I am stuck with this for few months now. :( I would be highly grateful to you guys if you can help me solve this. :) $\endgroup$
    – C.M
    Sep 21, 2015 at 9:54
  • $\begingroup$ @C.M I think that is straightforward if you do it as complex data. The "real" portion of the movement vector would be the x-axis movement, the "imaginary" portion of the vector would be the y-axis movement. Then just do a complex cross-correlation. The normalized magnitude of the cross-correlation will tell you how strong it is, and the angle of the complex peak will tell you the relative angle between their movements. $\endgroup$
    – Jim Clay
    Sep 21, 2015 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.