GOLF SPEED MEASUREMENT
Use the A1 radar sensor to measure the efficiency of your golf swing. By measuring the speed of the club head and ball during the golf swing, you can calculate your smash factor, SF, which is a common measurement among golfers to keep track on the efficiency of their swing.
To implement this proof of concept, we used the following hardware:
To compensate for the small radar cross section (RCS) of the golf ball, we also used a Fresnel (FZP) lens
Raspberry Pi, version 3B or later (we used 3B for this setup)
PC running Exploration Tool
In our demo, the sensor was placed approximately 90 cm right behind the ball, pointed against it slightly tilted upwards. The sensor was rotated such that the H-plane (wide half-power beamwidth (HPBW)) is vertical, making the beam narrow in the horizontal axis.
To try out the feasibility of using a radar sensor integrated in a mobile phone, we put the sensor behind gorilla glass in a mobile phone mock up which was placed on the ground as seen in the video above. However, in order to more easily get a good result, we recommend using an FZP lens as listed above.
In order to be able to measure the speed of both the golf ball and the club head, which are both moving very fast, we need to measure at a high update rate and at the same time make sure to get a good signal-to-noise ratio (SNR). To achieve this, we used the experimental speed detector available in the Exploration Tool. On line 68 of sparse_speed.py we replaced the default configuration with the following code:
config = configs.SparseServiceConfig()
config.profile = "profile_5"
config.sampling_mode = "A"
config.range_interval = [1.02, 1.02]
config.sweeps_per_frame = 512
config.hw_accelerated_average_samples = 30
With these settings, the sensor is configured to measure at a specific point on a fixed distance from the sensor, with an unlimited update and sweep rate, using profile 5.
For the signal processing, we did something similar to what's done in the example sparse_speed.py module in the Python Exlporation Tool.
The basic idea is to find the speed of the club and ball by looking for peaks in the frequency spectrum of the data. To reduce noise variance, we used Welch's method of averaged periodograms to obtain a (modified) periodogram. We used that in conjunction with zero-padding to interpolate the spectrum, allowing us to get a more accurate estimate.
A data frame from the sensor comes in a matrix with the shape (num_sweeps, num_depths), in this case (512, 1). The frames were squeezed to remove the depth dimension, leaving us with a time-series vector with length 512. In Python, with the help of SciPy – a Python-based ecosystem of open-source software for mathematics, science, and engineering – we can get the modified periodogram as follows:
freqs, periodogram = signal.welch(
fs=sweep_rate, # obtained from the "session info"/metadata
nfft=2048, # unnecessarily high but nice for visualization
nperseg=256, # cutting the data into 3 segments
noverlap=256 // 2, # 50% overlap
return_onesided=True, # we only need the one-sided spectrum since we have real data
After this, we applied simple noise normalization by dividing with the mean of a few top frequency bins, as in sparse_speed.py. Having this normalized periodogram, we manually put in a detection threshold and found the frame of interest, and then manually determined which peaks correspond to the ball and club. In a real application, we would need to write some decision algorithm to do this automatically.
In the figure above, you can clearly see the peaks corresponding to the ball and club head. In the case of this particular swing, the club speed was 40 m/s and the ball speed 57 m/s, resulting in a smash factor of 1,43.
TRY IT ON YOUR OWN AND GET IN TOUCH
To build your own version of this setup, order the XR112 radar sensor board, XC112 connector board and LH112 lens kit from Digi-Key. Combined with a Raspberry Pi and our Exploration Tool you can play around with this and many other use cases. Or why not try implementing the golf speed measurement using the XM122 IoT module, which enables a battery-driven wireless implementation?
To get started, head over to our Developer site where you find software downloads, get started guides and more. If you want to learn more about radar technology and Acconeer's pulsed coherent radar (PCR), check out our Radar Sensor Introduction.
If you try this, or work on something else, we'd love to hear about your project! Please get in touch with us on firstname.lastname@example.org.