## 1 Introduction  
The production of lightweight, low-cost, and widespread inertial sensors suitable to be embedded in wearable devices has led to their systematic use to monitor, in an unobtrusive way, human posture and motion in several fields such as assisted living [1, 2, 3, 4, 5, 6], fitness tracking [7, 8], and sports [9]. In the latter, the study of human body movements had great improvements in research, allowing the measurement of performance [10, 11, 12]. Several sports have successfully taken advantage of the use of inertial sensors, i.e., gyroscopes, accelerometers, and magnetometers, often included in a unique device identified as the inertial measurement unit (IMU) [13]. First applications of these technologies in swimming date back to the early 2000s when arm stroke motion and fatigue were monitored with a triaxial accelerometer and gyroscope attached to the wrist joint of the swimmers [14]. Since then, several studies reported in the literature have supported coaches in comprehensive monitoring of the performance of their athletes to develop and refine a training model. For example, in [15] numerous kinematic variables related to propulsion, posture, efficiency, and duration/rate of motion in four main swimming phases (wall push-off, glide, stroke preparation, and swimming) were extracted from an IMU attached to the sacrum. AnIMU worn on the wrist or the upper-back was used to discriminate among the different swimming styles in [16; 17], whereas in [18] the type of stroke and wall push-offs were detected by deriving pitch and roll angles from an accelerometer mounted on the swimmer's goggles. In [19], a systematic review of the research studies investigating the use of IMU technology for swimming analysis was presented. As it can be seen, several studies centered on the stroke count, stroke rate, stroke phase, acceleration patterns, distance per stroke, stroke identification, lap time, lap count, acceleration, and velocity. However, few researchers have investigated the utility of inertial sensors to quantify kick count. Evidence shows that kick count should be considered during swimming, especially in freestyle, in which high acceleration and velocity can be achieved by adjusting the swim stroke/kick rate [20]. Particularly, the higher kicking favors buoyancy, hydrodynamics, and speed during swimming. In addition, the information on kick counting can allow coaches to define training programs that condition the legs properly to meet the demands of kicking during the competition. Evaluating a swimmer's kick is difficult when observing above water, due to the water turbulence and mass of white water associated when kicking. Moreover, developing and testing an automated algorithm can be useful, such as by integrating this feature into an embedded system that is able to automatically count the kicks during the training sessions and give direct and rapid feedback to the athletes and coaches. In the literature, few papers have reported a system capable of automatically counting kicks. In [21] the validity and reliability of the kick count through a gyroscope were evaluated. In this case, four gyroscopes were exploited on the left and right thigh and shank. In [22] the kick-count information was provided using a wireless sensor network that included eight end-devices (EDs) transmitting data wirelessly to an access point connected to a PC through an RS232 connection. The ED was worn on a belt on the back of the swimmer and integrated a triaxial gyroscope and a triaxial accelerometer. Only the data from the latter (limited to one axis) was used for the computation of the kick count, applying a threshold algorithm. The present study aims to develop and validate an algorithm for the evaluation of the number of kicks performed by a swimmer during a training phase. The algorithm is suitable for embedded and real-time processing on a microcontroller-based device.