# Learning Swimming Techniques by Means of Real-Time Monitoring with Embedded Devices
## 3 Results  
This chapter focuses on data visualization, with time series analysis based on accelerometer readings from the MPU6050 sensor. A complete movement reading consists of 40 samples per axis (X, Y, Z), resulting in a total of 120 values per acquisition. In the resulting figures, the X-axis values are indexed from 0 to 40 (Acc-X), the Y-axis values from 41 to 80 (Acc-Y), and the Z-axis values from 81 to 120 (Acc-Z). The analyzed data consist of values recorded during the Training Routine, which are averaged to generate a reference series. These values are then compared with continuous readings obtained in the Vote Routine. The system evaluates similarity using the Pearson Correlation Coefficient (PCC) or Dynamic Time Warping (DTW), with similarity scores expressed as percentages. The percentage values for each algorithm are computed based on their respective possible output ranges, ensuring meaningful comparisons and interpretations. Testing is performed in a dryland environment, indoors. Figures 7 and 8 illustrate data collected from Device_2 (positioned below the elbow) during two dryland training sequences performed by the same subject (age: 31 years, height: 193 cm). Each training sequence consists of ten data acquisition series, labeled as Series1, Series2, Series3, [...], Series10. The analyzed movement is the front crawl swimming stroke, performed multiple times to capture motion data from the proposed sensing devices. The output data for Dynamic Time Warping (DTW) and Pearson Correlation Coefficient (PCC) are presented in Figures 9 and 10. The data were collected from the same subject who trained the system, as shown in Figures 7 and 8. Specifically, Figure 7 corresponds to Figure 9, while Figure 8 corresponds to Figure 10.  
For the output results, the Vote Routine was executed, during which over 100 front crawl strokes were performed. However, Figures 9 and 10 show only two representative results that better illustrate the differences between the algorithms. Including all 100 strokes in the graphs would obscure meaningful conclusions, making it difficult to interpret the results effectively. Figure 8: Training series for Device_2 in preparation for applying PCC. Figure 7: Training series for Device_2 in preparation for applying DTW. It is evident that the Dynamic Time Warping analysis in Figure 9 shows a 91% match with the orange graph and almost mirrors the blue graph (mean values). In comparison, the Pearson Correlation Coefficient in Figure 10 provides a 93% match, but it is noticeable that the orange graph does not follow the blue graph as closely as in the case of DTW. The movements that do not align with the pattern are represented by the gray lines in Figures 9 and 10. The matching percentages of 58% for DTW and 42% for PCC are considered unsatisfactory by the system, and these movements are marked as erroneous. The system applies a threshold, accepting only series with over 80% matching. The 'bad' movements are presented to illustrate the extent of differences required to produce the corresponding percentage values. It is challenging to visually compare DTW and PCC when the percentage values fall below 80%, as the data differences at these levels are less discernible. Therefore, the most relevant comparisons focus on data near 100%, representing near-perfect movements. This comparison highlights that DTW tends to penalize smaller differences between the two data series more significantly than PCC. For instance, a 2% difference between the  
Figure 10: Voting results for Pearson Correlation Coefficient. Figure 9: Voting results for Dynamic Time Warping. two outputs (DTW: 91% and PCC: 93%) is visible, with the corresponding differences highlighted on the graphs using a red brush (comparison available in Figure 11). Although DTW exhibits fewer deviations, its similarity percentage is 91%, while PCC, despite showing more deviations, achieves a higher similarity percentage of 93%. Why were the values rejected under 80%?