Best sensor?

Apple Watch vs Polly?

Even a brachycephalic like Polly has an extraordinary sense of smell! She would be the first to tell you!!

 

That said, let's stick with tennis sensors for now. We've looked at tennis specific sensors so far, but the facts are clear that the glory days of tennis sensors appear to be passed. All the tennis sensors looked at are discontinued and nothing on the market has directly replaced them. Instead, the trend appears to towards using a camera phone to record matches.

 

But what about the Apple Watch? This would seem to have the same sensors and lots of people have them. I did find at least one tennis shot app, so this shows that it's at least worth a look.

Sensor Logger

This is a remarkable Apple Watch app, that allows for the convenient downloading of sensor data, both from your phone and watch. Highly Impressive. Be sure to check it out! Here are the column names of the downloaded data:


['time', 'seconds_elapsed', 'rotationRateX', 'rotationRateY',
      'rotationRateZ', 'gravityX', 'gravityY', 'gravityZ', 'accelerationX',
      'accelerationY', 'accelerationZ', 'quaternionW', 'quaternionX',
      'quaternionY', 'quaternionZ']

Here's a pairplot:

Quaternions!?!? You had me at hello!

I'm with you. Almost jumped out of my seat there! What's a quaternion you ask?

 

Copilot

A quaternion is a hypercomplex number system that extends the concept of complex numbers from two dimensions to three dimensions. It was first described by the Irish mathematician William Rowan Hamilton in 1843 and found applications in mechanics within three-dimensional space1. Quaternions are generally represented as

𝑎+𝑏𝑖+𝑐𝑗+𝑑𝑘a+bi+cj+dk

, where the coefficients

𝑎,𝑏,𝑐,𝑑a,b,c,d

are real numbers, and

1,𝑖,𝑗,𝑘1,i,j,k

are the basis vectors or elements1.They have practical uses in fields like computer graphics, computer vision, and magnetic resonance imaging, particularly for three-dimensional rotations1.Unlike complex numbers, quaternion multiplication is not commutative, making them a fascinating algebraic structure1. If you’d like to explore further, feel free to ask! 😊

Doesn't that conflict with something you said?

Honestly, it might...  Somewhere in this website I might have written that electrical engineering is the only field that uses complex numbers. I've definitely said that, because I've read that. But, that was a long time ago. I've heard some things about quaternions, but honestly don't know much about them. To me, they look like complex complex numbers! We have XYZ dimensions for rotation rate, gravity, acceleration. We have the same for quaternions as well, but we also have a W dimension!

 

And now, to realize that quaternions are lurking inside the Apple Watch! Well, you can see why I'm so excited! 

 

Are you thinking about what I'm thinking?

Calibration session!!

Let's propose a session of 100 strokes measured on the Zepp Universal sensor. First, a minute or two of volleys, none of which we recorded by the sensor. Then, 20 serves, alternating first and 2nd serves. Next, 10 smashes which register as serves on the Zepp sensor output. Then, 20 slices, alternating forehand and backhand. Then, bursts of alternating topspin strokes, finishing with 6 shots hit at maximum velocity. One serve may have been missed by the sensor, but every other stroke was counted correctly. Let's see how things stacked up!

Apple Watch pairplot

This won't help us much, but it gives us a starting point.

Babolat Pop Pairplot

Looks familiar

ZeppU Calculated fields pairplot

Remember, these are fields such as power, spin, and impact location

ZeppU Sensor fields pairplot

Raw sensor values

What have learned?

Nothing yet. But, there are some real differences between the 3 sensors. First off, the Pop sensor has 25 less strokes detected. This probably isn't surprising, as we have already seen that the Pop picks up less strokes. This is probably by design as it is ignoring weaker strokes. This may be because it picked up less strokes especially during the sliced strokes.

 

More significantly different is the Apple Watch data. There is much, much data because the Apple Watch is taking continuous readings, while the sensor only records readings upon impact. For that reason, let's first join the Zepp and Bab tables.

ZIQ PIQ line plot?

This might not look perfect, but I think this gives us what we are looking for. Remember, we are just using the PIQ as a reference level generator, while ZIQ is what the standard is. The ZIQ scores look reasonable. We see that serves are more spread out earlier in the session and alternate between 1st and 2nd serves as expected. Then there are some bursts of groundstrokes and the final 6 strokes do indeed look more powerful. Although the Pop strokes don't line up all that well and 8 didn't match up, we see overall confirmation of the overall session, so I think we can proceed with the ZIQ score that we developed earlier.

Here you go:

ZIQ by stroke

This is interesting. Now we can clearly see the alternation between the forehand and backhand slices. The backhand slice is higher rated, which is to be expected, as the forehand stroke is awkward. Overall, slice seems to be too highly rated. And, ZIQ did appear to increase when power was increased at the end of the session.

 

Let's move away from the calculated fields now, and look at raw sensor data:

Zepp U Time Plots

We have lots of signals that we don't really understand. Let's look the Zepp signals first. Remember, these start with "dbg"

 

Here's the Acc XYZ signals:

Gyro 1 and 2

Var 1, 2, 4 signals:

Sum gx, gy:

Sv Ax Ay:

Max Ax Ay

Min Max Az

Discussion

Remember this is what the sensors record at the point of impact. We can see that the sensors have very different inputs for the serves compared to the ground strokes. Distinct strokes are seen, and increasing the power for the last few shots definitely has an effect on the sensors. But, as before, it isn't obvious how the procesor is able to differentiate between forehands and backhands.

Apple Watch Time plots

Let's do something similar for the Apple Watch signals.

 

Rotation Rate XYZ

Acceleration XYZ

Gravity XYZ

Quaternion XYZW

Discussion

It's hard to get much out of the gravity and quaternion plots, but the accelerometer and gyro plots clearly reflect the calibration session. First, there are the volleys, which are low amplitude in the beginning, then starting with the serves, each serve is seen. The smashes appear to be similar, but lower in magnitude, and then different bursts for each groundstroke, along with a clear increase in power at the end.

Apple Watch vs Zepp U

The Zepp U records only upon contact while the Apple Watch continuously monitors its sensors. Let's see how acc compares:

 

Conclusion

This seems like a good approach. As you can see, the continuous data (in blue) from the Apple Watch has spikes that correspond well with the actual events sensed by the Zepp Universal sensor. This is accelerometer data and shows strong correlation between the sensors. This seems to prove that the Apple Watch sensors record similar data to the tennis sensors, and could be used as a very good tennis sensor on its own.

Further steps

We could stop here. But, let's think about a few more possible steps. First, let's try to understand what happens during each stroke. We'll zoom in and see what we find during each stroke. We have many different strokes, forehand and backhand volleys, then serves, then smashes, then groundstrokes and then finally harder groundstrokes (forehand and backhand.

Let's see what the signals look like on the same axis:

Gyro vs Accelerometer

Now we are starting to see something interesting. Remember, the blue signal is the Apple Watch accelerometer and the red signal it's gyroscope. The green line is the accelerometer impact registered by the Zepp Universal sensor. The Zepp signal is discrete because it only measures upon impact while the Apple Watch gyro and accelerometer are effectively continuous as the sensors sample at 100 Hz (100 times per second.)

 

The AW gyro signal seems to be a little stronger than the acc signal overall but overall they seem to track similar things. Let's zoom in...

Volleys

This is just the first section and doesn't register on the Zepp sensor. Tennis sensors are known to struggle with volleys, and this is a pretty clear inidcation of why.... There is some rhythmic activity here. It does seem like a peak detector (which does exactly what it sounds like) might be able to pick up a signal here. But, let's stick with what the Zepp sensor measured.

Serves

This is the first 20 shots, alternating 1st and 2nd serves. This is pretty well reflected in that the first serve is more powerful.

Single Serve

One single serve. Note how early the Zepp sensor registers and also note the complex vibrational signal after impact.

Smashes

10 smashes look very similar to serves, except less time elapses between each shot.

Groundstrokes

Alternating forehands and backhands

Power Groundstrokes

Last 6 shots hit at full power.

Single Groundstroke

Note that amplitudes are similar to the serve, but the vibrational responses have very different characteristics.

Let's bring back ZIQ!!

If you remember, ZIQ is based on PIQ which is a system that ranks tennis shots on three dimensions. ZIQ is a system that approximates that with 3 dimensions: Speed, Spin, and Position. Let's see how they stack up during the session.

 

Overall ZIQ:

Certainly interesting. The highest ZIQ scores are the serves, then the smashes and some of the groundstrokes. Interestingly, the most powerful groundstrokes are not necessarily the highest rated. I believe this is because the ZIQ seems to highly rate slices.

 

Let's see how ZIQ speed looks:

This looks pretty similar, but the smashes rate similarly to the serves here, while the slices don't rate as high.

 

Let's have a look at spin:

Pretty clear now that the smashes score lower here in spin, while we see how highly the slices rate on spin.

 

Position is our last measurement:

This uses an absolute value function to penalize distance away from center in both X and Y directions. There doesn't seem to be much stroke dependency with sweet spot contact.

 

We've come a long way! But, it's also obvious that we've only scratched the surface of what is possible with the Apple Watch.

 

Let's try peak detection now!

Sure! But, first can I get the code?

We need your consent to load the translations

We use a third-party service to translate the website content that may collect data about your activity. Please review the details in the privacy policy and accept the service to view the translations.