## 3 Results and Discussion  
In Figures 3 and 4, examples of the captured signals for an athlete are reported. Figure 2: Example of the algorithm signals. In Figure 3, data related to two pool lengths of a swimming session are shown. The kicks are clearly recognizable as a regular repetition of a precise pattern. It is also possible to observe an intermediate period that does not present such regularity, relating to the athlete's change of direction. In Figure 4, the change of direction is observable as a change in the sign of the magnetometer \(x\)-axis signal. It is worth noting that this is independent of how the smartwatch was worn. Indeed, since the watch was fixed to the ankle through the st  
Figure 4: Example of the output of the \(x\)-axis of the magnetometer sensor during a training session (16 laps). Figure 3: Example of the output of the three-axes accelerometer sensor during two laps of a training session. In the boxes, examples of a kick event on the three axes are underlined. the sensor would only lead to an inversion of the signal sign without any change in the output of the algorithm. Detecting when an athlete finished a lap and started a new one was not directly related to the main purpose of this work, which is to present a new method for counting kicks during swimming training sessions. However, it can be useful to better analyze the data obtained and compute some parameters such as, for example, the error obtained in the count considering a predetermined distance (e.g., 100 m). The modified Fraden-Neuman algorithm was applied to all three accelerometer axes. In Figure 5, the result obtained from processing data shown in Figure 3 is reported. The blue line is the difference quotient \(y\_d(n)\). This was computed as the difference between subsequent samples of the signal \(y1(n)\) over the sampling time. The red crosses represent a detected kick. As it can be noted from a preliminary visual analysis, the \(x\)-axis resulted in a poor performance in recognizing kicks, whereas in the \(y\)-axis and \(z\)-axis the kicks were more likely to be detected. To evaluate the validity of the detection, the recorded videos were examined as they are considered the gold standard. The timing of the video footage was synchronized with the accelerometer raw data, and each kick detected by the algorithm was verified in the video. Moreover, the presence of a kick in the video not detected by the algorithm was also assessed. To evaluate the algorithm, performance, accuracy, sensitivity, and specificity were considered. Accuracy can be computed as:  
\[Acc=\frac{TPs+TNs}{TPs+TNs+FPs+FNs} \tag{3}\]  
where _TPs_ are the true positives, _TNs_ are the true negatives, _FPs_ are the false positives, and _FNs_ are the false negatives. _TPs_ refer to the case in which the algorithm detected a kick and the kick was present in the video, whereas TNs relate to the absence of kicks in the processed data and the video. Finally, _FPs_ and _FNs_ are kicks detected by the algorithm that are absent in the video, and kicks not detected by the algorithm but are present in the video, respectively. Figure 5: Example of processing with the modified Fraden–Neuman algorithm. Sensitivity (i.e., _TP_ rate) can be computed as:  
\[Sen=\frac{\textit{TPs}}{\textit{TPs}+\textit{FNs}} \tag{4}\]  
whereas the specificity (i.e., _TN_ rate) can be computed as:  
\[Spe=\frac{\textit{TNs}}{\textit{TNs}+\textit{FPs}} \tag{5}\]  
It is worth noticing that, due to the nature of the signals involved in the experiments, it was impossible to count the _TNs_. Indeed, the absence of a kick is a time interval without kick events, and it is impossible to be quantified in a number. For this reason, the specificity was excluded from the performance parameters evaluated. In Table 2, the accuracy and sensitivity were reported for each axis. As expected, the \(y\)-axis resulted in the best performance, whereas the \(x\)-axis and \(z\)-axis did not have sufficient accuracy, despite showing a high sensitivity.