Fast Fourier Transformation Algorithm/Library for Motion Data in Processing? (REPOST)

432 Views Asked by At

I posted earlier about using Processing combined with the Leap Motion https://www.leapmotion.com/ in order to build an application that could detect hand tremor. I believe I will need to perform a FFT for this to work. Only one I know of in Processing is Minim but that is for sound data. I am fairly ignorant on this topic as of now (I have been watching youtube tutorials explaining how FFTs work all day I swear I'll be dreaming about it http://www.youtube.com/watch?v=TsMXQfnmOiQtonight) but from what I know so far I don't think Minim will work for my motion data.

So far I have used the Leap Motion api to record the following data into a csv file:

  • palmVelocity — The speed of the palm in millimeters per second.
  • palmPosition — The center of the palm measured in millimeters from
    the Leap origin.
  • palmNormal — A vector perpendicular to the plane formed by the palm of the hand. The vector points downward out of the palm.
  • direction — A vector pointing from the center of the palm toward the fingers.
  • Time - in milliseconds

From the little I have gained from the FFT tutorials and lurking stackoverflow, I believe this is all the data I need to do analysis (there are a bunch of other hand position data I could get too but I think these are all I need for this problem). So my specific questions are as follows:

  1. Do I need to do FFT in order to measure the changing hand movements to detect tremor (involuntary muscles movements usually caused by physical disabilities). Please explain why.
  2. The only FFT library in Processing is Minin that I know of, its designed for sound, so it will not work for my situation right?
  3. Recommend a library that could work for my situation.

Someone mentioned to me about Kiss FFT which is not audio-specific, but it's written in C which I would like to avoid at all cost lol (I'm already confused enough as it is).

Thanks in advance

1

There are 1 best solutions below

0
On
  1. I'm not sure if you have to run a FFT to detect tremor. Fourier transforms and autocorrelation functions are intimately related. You can get the same info about frequencies by looking at the autocorrelation function of your data, but I'm not sure that would be easier. Maybe - you wouldn't need to deal with complex numbers.

  2. I don't know.

  3. Have you looked into Apache Commons? I recommend the 2.2 library. I've heard the more recent version isn't as stable. I think after I downloaded the library to the libraries folder in Processing I had to rename it changing the dashes and dots to underscores and then create a folder titled "Library" within it, and then put the commons jar file in that.