Well what you have are a periodic string of acceleration readings from the device between (0-590 Hz), so by recording the values over a period of time, you are essentially plotting an acceleration-time graph, for the x direction.
So what you need your software to do iis start recording data at a specified time , and finish recording at another specified time . Then to get back to the distance travelled, you need to integrate twice between and .
Numerical integration is what pops to mind, (which would be very staightforward, knowing your fequency, and each of your acceleration values) but you'd need to integrate twice, so I'm not too sure there is a method for this.
All I can think is to somehow interpolate the points as a function (which I can see being difficult), and then calculate .
Maybe someone else knows of some better methods. (You might do well to ask about it on a programming forum)