Getting High-Frequency Tennis Motion Data from Apple Watch

Photo by Isaac Smith on Unsplash

Getting High-Frequency Tennis Motion Data from Apple Watch

Part 2: Real Motion Data from Apple Watch and Quick Analysis

In the Part 1, I've demonstrated how high-frequency motion data can be collected during a tennis session using the sample app. In this part, I'll provide a sneak peak into the data and try to extract some high-level learnings.

How I Collected Data

I play tennis once a week, so once I made the app, I was able to quickly take it to the real world to obtain the sensor data. I'm right-handed, so, for better accuracy, I wore the watch on the right wrist even though I usually wear it on the left. As my iPhone app only keeps the data in memory and there should be established connection between the counterpart apps, I had to keep my phone in the pocket. Only during the session I realized that the iPhone app has to be in the foreground, otherwise the WatchConnectivity messages are not delivered. I made several recordings, each of them represented a single rally. On average, the warm-up rallies were 6-8-shot long.

Accelerometer Data

For a typical rally, its accelerometer file would be about 1–1.5 Mb. Here is a sample file from that warm-up session that represents roughly a 19-second series with 15651 readings – remeber, it's a 800 Hz sensor!

Here is a simple line-chart visualization of the acceleration measured in Gs across all the three axes:

We can clearly see the spikes just before and after the shot, with Z-axis showing the highest amplitude. Z-axis is orthogonal to the watch screen surface, that's why it's no surprise that it gets the largest acceleration when the wrist moves towards the ball. I just didn't expect that the racquet acceleration can reach 30G! Y is pointing from the bottom to the top edge of the watch, and X is basically the continuation of the digital crown, that's why it shows the least amount of movement.

A single shot close-up is also interesting (how acceleration is thrown back and forth over a tiny period of time):

Rotation Data

The gyroscope data is similar to the accelerometer one, but here it's radians per second for each axis. It shows similar peaks around the same timestamps, however, its readings are 4x less frequent:

Interestingly, the X axis shows higher amplitude than Z here, and each axis has a distinct pattern. As X is the digital crown axis, higher values here may mean more spin that comes from the wrist.

Conclusion and What's Next

This was just my first tennis session with this app, and my main goal was to see if it actually works as expected and the data has some actual meaning even if presented as a simple line chart. Now, I clearly see a correlation between the line and its correspoding shots – for example, higher amplitude seems to mean a higher ball speed. I plan to eventually extract more useful information from the raw data – such as shot frequency, time to contact, distinguishing backhand vs forehand vs volley, approximate ball speed and so on. To start, I could try to apply a median filter and then find local peaks.

In addition, here are the ideas for improvements that I'm going to make to the app to be able to better analyze the data in the future sessions (not sure if all of them are feasible and quick to build but they should definitely help):

  • Persist data onto disk on the watch during the session and transmit it as a large file – to avoid having to keep the iPhone app nearby and active.

  • Preview the line charts right on the iPhone.

  • Put the accelerometer and the gyroscope data onto the same timeline.

  • Add a way to map the data recording to the actual rally – maybe by shooting the video of the practice on the counterpart iPhone and then synchronize it with the motion data.

I'm curious what you think can be done with this raw data. Please do share your suggestions in the comments!