Adaptive Data Transmission Algorithm for the System of Inertial Sensors for Hand Movement Acquisition

Modern systems of intelligent sensors commonly use radio data transmission. Hand movement acquisition with the use of inertial sensors requires the processing and transmission of a relatively large amount of data, which may be associated with a significant load on the network structure. Network traffic limitation, without losing the quality of monitoring parameters from the sensor system, is therefore important for the functioning of the radio network which integrates both the teletransmission sensor system and the data acquisition server. The paper presents a wearable solution for hand movement acquisition, which uses data transmission in the Wi-Fi standard and contains 16 MEMS (Micro Electro Mechanical System) sensors. An adaptive algorithm to control radio data transmission for the sensor system has been proposed. The algorithm implemented in the embedded system controls the change of the frame length, the length of the transmission frame and the frequency of its sending, which reduces the load on the network router. The use of the algorithm makes it possible to reduce the power consumption by the sensor system by up to 19.9% and to limit the number of data transferred by up to about 91.6%, without losing the quality of the monitored signal. The data analysis showed no statistically significant differences (p > 0.05) between the signal reconstructed from the complete data and processed by the algorithm.


Introduction
Gesture recognition systems using IMU (Inertial Measurement Unit) sensors are solutions in which relatively large amounts of data are processed. Thus, the efficiency of such systems is related to the methods of processing data from sensors and their transmission. Wearable solutions for monitoring movement or other body parameters use radio data transmission [1][2][3][4], including transmission in the ISM (Industrial, Scientific, Medical) 2.4 GHz band. Within this band, radio transmission is implemented in many standards, such as Wi-Fi (IEEE 802.11) [5,6], Bluetooth (IEEE 802.15.1) [7,8] or ZigBee (IEEE 802.15.4) [9,10]. Here, it is important to point out the key problems related to the processing and radio transmission of data in sensor networks. Devices using radio transmission in these technologies may be in close proximity and interfere with each other [11]. Moreover, the use of a large number of wireless IMU systems can lead to their mutual interference. This causes a decrease in the efficiency and reliability of transmission, which reduces the functionality of these systems. For this reason, it is important to reduce radio band occupancy, for example, by limiting radio transmission. Radio transmission also has a significant impact on the energy demand of sensor systems, therefore, limiting the use of teletransmission modules allows for a reduction in electricity consumption. In turn, reducing energy demand is of particular importance in the case of solutions using battery power supply. There are many different methods of radio transmission control to optimize network traffic or reduce energy consumption. The latter can be achieved by monitoring the network and controlling the frequency of connection events (mainly in Bluetooth Low Energy), transmission speed, and transmitter power [12,13]. In turn, the transmitter power can be controlled based on the input data from the system sensors [14]. Transmission control using the input data can be implemented using machine learning [14]. One of the methods for reducing teletransmission band occupancy is data aggregation. In the Wi-Fi standard (802.11), a mechanism for sending data blocks containing several data frames has been introduced, wherein the receipt of the data block is acknowledged by one ACK (Acknowledgment). Controlling the length of data blocks can be used to optimize network traffic while maintaining transmission reliability [15]. The network radio traffic can also be limited by dividing the network into clusters with a master node as well as assigning different priorities to data and data queuing [16]. Solutions modifying MACs in terms of prioritizing data are also proposed [17], and time slots of variable length [18] or dedicated slots for critical data transmission are introduced [19]. Modifications of the MAC layer require appropriate implementation in all cooperating network devices. Optimization of radio network management is also carried out by modifying the routing protocols by introducing specialized supervision devices [20]. Such solutions involve sending additional information about the packet path and implementing algorithms, e.g., ant colony [21] or fuzzy logic [22]. In the case of coexistence of several networks with many access points, optimization methods are introduced that make it possible to select an access point for the network device, which is used, for example, in cellular networks [23]. Reducing the network load may also be realized by using two networks operating in separate bands in parallel (for example Wi-Fi and LTE/3G) [24,25]. Radio data transmission can also be optimized by limiting the data packet length, for example, by sending only differences between consecutive values, which may limit the scope of sent data and allow the original data to be restored [26]. In order to reduce the energy expended on radio transmission and limit the amount of transmitted data, the measurement signal sampling frequency is controlled in sensor systems. For this purpose, algorithms are used that limit signal sampling depending on the nature of the input data [27][28][29]. However, limiting the amount of data transferred may lead to the loss of some data [30]. Signal sampling is also controlled through the use of dedicated electronic systems that allow for the detection of a specific nature of monitored signals [31]. Effective management of radio data transmission is important in the sensor systems for motion acquisition, which allows to reduce the energy demand of electronic systems and reduce network traffic [32,33]. One of the methods of radio transmission optimization in the case of generating a large amount of data by sensors is, for example, the selection of a minimum data set necessary to describe the monitored process [34].
The article presents a new transmission protocol for the sensor network in the form of an algorithm designed both to increase the energy efficiency of the radio link and to reduce the load on the Wi-Fi sensor network. This approach to radio data transmission management seems to be universal, as the mentioned aspects are important for the practical implementation of the developed algorithm. The proposed method allows for transmission control only on the basis of data from sensors. In addition, the transmission process is controlled without the need for two-way communication between the sensor system and another device supervising the transmission or routing process (e.g., PC server). The developed transmission method does not require the transmission of additional control frames, which reduces the network load. Furthermore, the transmission control algorithm does not modify the 802.11 MAC layer, nor does it introduce additional routing protocols, which simplifies its implementation, in particular in sensor networks with limited hardware resources. Dedicated electronic systems are also not required to control the transmission. Therefore, the proposed algorithm can be used in sensor network nodes with a reduced architecture [35][36][37]. Moreover, a constant sampling frequency is maintained for all MEMS sensors. The transmitted data do not require additional processing on the part of the receiving device.
The article is divided into three main parts. Sections 2 and 3 describe the measuring stations used in the research cycle as well as the hardware and logical architecture of the developed wearable system with a dedicated transmission control algorithm. Section 4 concerns testing the presented hardware solution and the algorithm in terms of energy efficiency and load of the sensor network as well as the quality of traffic mapping. Section 5 is related to the analysis and discussion of the obtained results.

Measuring Stations
Three measuring stations were designed to test the adaptive data transmission algorithm developed for a system of inertial sensors. Figure 1 presents the structure of two measuring stations. The first station is marked with the Roman number I. It contains the WSS (Wearable Sensor System) described in detail in Section 2.2, router (RT) with an access point (RT-N10U) and PC server. The WSS radio transmits data from sensors in the Wi-Fi 2.4 GHz standard. The frames transmitted by the WSS were filled with data from the sensors, and the value of the transmission filter control parameter was simulated, which is described in Section 3. In turn, the RT receives Wi-Fi frames containing data transmitted by the WSS, and then the RT via a wire (cable with RJ45 plug) sends Ethernet frames using UDP (User Datagram Protocol) to the PC server, where the data are archived.
pling frequency is maintained for all MEMS sensors. The transmitted data do not require additional processing on the part of the receiving device.
The article is divided into three main parts. Sections 2 and 3 describe the measuring stations used in the research cycle as well as the hardware and logical architecture of the developed wearable system with a dedicated transmission control algorithm. Section 4 concerns testing the presented hardware solution and the algorithm in terms of energy efficiency and load of the sensor network as well as the quality of traffic mapping. Section 5 is related to the analysis and discussion of the obtained results.

Measuring Stations
Three measuring stations were designed to test the adaptive data transmission algorithm developed for a system of inertial sensors. Figure 1 presents the structure of two measuring stations. The first station is marked with the Roman number I. It contains the WSS (Wearable Sensor System) described in detail in Section 2.2, router (RT) with an access point (RT-N10U) and PC server. The WSS radio transmits data from sensors in the Wi-Fi 2.4 GHz standard. The frames transmitted by the WSS were filled with data from the sensors, and the value of the transmission filter control parameter was simulated, which is described in Section 3. In turn, the RT receives Wi-Fi frames containing data transmitted by the WSS, and then the RT via a wire (cable with RJ45 plug) sends Ethernet frames using UDP (User Datagram Protocol) to the PC server, where the data are archived. The station marked with II ( Figure 1) was designed to test the network load in the context of radio band occupancy. Station II is an extended version of the previously described Station I. Station II additionally includes SA-(spectrum analyser RSA5065-TG), The station marked with II ( Figure 1) was designed to test the network load in the context of radio band occupancy. Station II is an extended version of the previously described Station I. Station II additionally includes SA-(spectrum analyser RSA5065-TG), which allows for density spectrogram registration. The AARONIA HyperLOG 7060 antenna was attached to RSA5065-TG. Figure 2 presents the station for the analysis of network traffic generated by the WSS. Like in the case of the stations I and II, the RT allows for the registration of only data frames (Ethernet), whereas the network traffic is monitored in a wider range via the sniffer-ALFA AWUS036ACH AC1200. The sniffer connected to the PC server via the USB port was used to receive Wi-Fi frames. The measuring station makes it possible to monitor the simulated load on the radio network with a different amount of transmitted data, which is described in more detail in Section 4.
which allows for density spectrogram registration. The AARONIA HyperLOG 7060 antenna was attached to RSA5065-TG. Figure 2 presents the station for the analysis of network traffic generated by the WSS. Like in the case of the stations I and II, the RT allows for the registration of only data frames (Ethernet), whereas the network traffic is monitored in a wider range via the sniffer-ALFA AWUS036ACH AC1200. The sniffer connected to the PC server via the USB port was used to receive Wi-Fi frames. The measuring station makes it possible to monitor the simulated load on the radio network with a different amount of transmitted data, which is described in more detail in Section 4. In the stations presented in Figures 1 and 2, the network created by the WSS, the RT with an access point and the PC server use the IPv4 protocol. The Beacon time (packets sent by the access point to synchronize a wireless network) of the RT was 100 ms, the DTIM (Delivery Traffic Indication Message) value was 3. The Wi-Fi access point channel was selected automatically. The data from the WSS module are sent to the PC server using the UDP. The data section of the UDP frame in the context of the adaptive transmission algorithm is discussed in more detail later in the article.

Wearable Sensor System
The developed sensor system for hand motion acquisition is presented in the form of a block diagram in Figure 3. Hand motion acquisition with the use of inertial sensors is related to the implementation of such a system in a wearable form. The solution presented in the article consists of a central module (MAIN), to which sixteen LSM9DS1 sensors [38] (S1 to S16) are connected via the SPI (Serial Peripheral Interface) bus (SPI BUS). Each of the sensors has a built-in accelerometer, gyroscope, and magnetometer. The sensor system is powered by a 3.7 V lithium polymer battery (1 s). The battery is connected to the CHARGE CONTROL system, which, while charging the battery, is powered from an external 5 V source connected to the CHARGE INPUT. The CHARGE CONTROL output is connected to the DC-DC CONVERTER input. The converter output voltage is 3.3 V and is used to power both the ESP32 module and the LSM9DS1 sensors. ESP32 [39] is a single 2.4 GHz Wi-Fi-and-Bluetooth combo chip, which in the presented wearable solution downloads data from the LSM9DS1 sensors, processes the received In the stations presented in Figures 1 and 2, the network created by the WSS, the RT with an access point and the PC server use the IPv4 protocol. The Beacon time (packets sent by the access point to synchronize a wireless network) of the RT was 100 ms, the DTIM (Delivery Traffic Indication Message) value was 3. The Wi-Fi access point channel was selected automatically. The data from the WSS module are sent to the PC server using the UDP. The data section of the UDP frame in the context of the adaptive transmission algorithm is discussed in more detail later in the article.

Wearable Sensor System
The developed sensor system for hand motion acquisition is presented in the form of a block diagram in Figure 3. Hand motion acquisition with the use of inertial sensors is related to the implementation of such a system in a wearable form. The solution presented in the article consists of a central module (MAIN), to which sixteen LSM9DS1 sensors [38] (S1 to S16) are connected via the SPI (Serial Peripheral Interface) bus (SPI BUS). Each of the sensors has a built-in accelerometer, gyroscope, and magnetometer. The sensor system is powered by a 3.7 V lithium polymer battery (1 s). The battery is connected to the CHARGE CONTROL system, which, while charging the battery, is powered from an external 5 V source connected to the CHARGE INPUT. The CHARGE CONTROL output is connected to the DC-DC CONVERTER input. The converter output voltage is 3.3 V and is used to power both the ESP32 module and the LSM9DS1 sensors. ESP32 [39] is a single 2.4 GHz Wi-Fi-and-Bluetooth combo chip, which in the presented wearable solution downloads data from the LSM9DS1 sensors, processes the received data and transmits them to the computer. The main board of the central module (MAIN) is shown in Figure 4a        The location of the individual sensors of the hand motion acquisition system is presented in Figure 5a,b. Sensors S1-S15 (external) are connected to the MAIN module via multi-core cables, whereas the S16 (internal) sensor is integrated with the main board of the MAIN module. The S15 sensor is placed on the forearm, whereas each of the other external sensors (S1 to S14) is placed on the corresponding phalanx of individual fingers ( Figure 5). There are two sensors for the thumb, whereas for the other fingers, three sensors are implemented in the system. The applied location of the sensors allows both to monitor the movement of each of the fingers as well as the position of the hand in relation to the forearm. The location of the individual sensors of the hand motion acquisition system is presented in Figure 5a,b. Sensors S1-S15 (external) are connected to the MAIN module via multi-core cables, whereas the S16 (internal) sensor is integrated with the main board of the MAIN module. The S15 sensor is placed on the forearm, whereas each of the other external sensors (S1 to S14) is placed on the corresponding phalanx of individual fingers ( Figure 5). There are two sensors for the thumb, whereas for the other fingers, three sensors are implemented in the system. The applied location of the sensors allows both to monitor the movement of each of the fingers as well as the position of the hand in relation to the forearm.

Adaptive Data Transmission Algorithm
The wearable sensor system is also an embedded system with the implemented adaptive data transmission algorithm. The general structure of the WSS operation is

Adaptive Data Transmission Algorithm
The wearable sensor system is also an embedded system with the implemented adaptive data transmission algorithm. The general structure of the WSS operation is presented in Figure 6, where the block of the radio transmission control algorithm is marked with a dashed line. This algorithm allows to increase the energy efficiency of the WSS and reduce the load on the sensor network. In turn, the input data of the algorithm are the vector ω i and the defined threshold values TH1, TH2, and TH3. In addition, the WSS operation diagram includes the processing of vectors a i , m i , and the quaternion q i , which is also indicated in the pseudocode in Figure 7. During operation, the ESP32 module collects data from S i sensors (i = 1, 2, . . . , 16). The sampling frequency of sensors in the implemented system for the accelerometer and the gyroscope is 119 Hz. The data obtained from each sensor are in the form of three vectors a i , ω i , m i (1), where i = 1, 2, . . . , 16 denotes the indexing of the sensor number.
marked with a dashed line. This algorithm allows to increase the energy efficiency of the WSS and reduce the load on the sensor network. In turn, the input data of the algorithm are the vector and the defined threshold values 1, 2, and 3. In addition, the WSS operation diagram includes the processing of vectors , , and the quaternion , which is also indicated in the pseudocode in Figure 7. During operation, the ESP32 module collects data from Si sensors (i = 1, 2,…, 16). The sampling frequency of sensors in the implemented system for the accelerometer and the gyroscope is 119 Hz. The data obtained from each sensor are in the form of three vectors , , The vectors , , represent the data of individual sensors. The coordinates , and of the vector correspond to the acceleration in relation to the , i axes, respectively. Similarly, the coordinates , , correspond to the rotational speeds of rotations performed by individual sensors around the , and axes. In turn, the coordinates , , correspond to the values of the magnetic field induction measured by the magnetometers of the individual sensors. The data obtained from the i-th sensor are used by the fusion algorithm (SENSOR FUSION ALGORITHM) to determine the quaternion . An algorithm for AHRS (Attitude Heading Reference System) was used for the sensor Fusion [40]. The data ( , , ) from the sensor and the quaternion are saved in the data buffer along with the index number of the i-th sensor to which they correspond.
The operation of the data transmission control algorithm requires only a small number of simple arithmetic operations. The results of testing the algorithm in the context of energy efficiency are presented in more detail in Section 4.2. In turn, Sections 4.3.1 and 4.3.2 show the algorithm effectiveness in terms of optimizing network traffic. The vectors a i , ω i , m i represent the data of individual sensors. The coordinates a ix , a iy and a iz of the vector a i correspond to the acceleration in relation to the x, y i z axes, respectively. Similarly, the coordinates ω ix , ω iy , ω iz correspond to the rotational speeds of rotations performed by individual sensors around the x, y and z axes. In turn, the coordinates m ix , m iy , m iz correspond to the values of the magnetic field induction measured by the magnetometers of the individual sensors.
The data obtained from the i-th sensor are used by the fusion algorithm (SENSOR FUSION ALGORITHM) to determine the quaternion q i . An algorithm for AHRS (Attitude Heading Reference System) was used for the sensor Fusion [40]. The data (a i , ω i , m i ) from the sensor and the quaternion q i are saved in the data buffer along with the index number of the i-th sensor to which they correspond.
The operation of the data transmission control algorithm requires only a small number of simple arithmetic operations. The results of testing the algorithm in the context of energy efficiency are presented in more detail in Section 4.2. In turn, Sections 4.3.1 and 4.3.2 show the algorithm effectiveness in terms of optimizing network traffic.
On the basis of the rotational speed vector ω i , the parameter d i is also determined according to the Formula (2) and is related to the resultant angle of rotation of individual sensors. Taking into account the rotation from all system axes allows for more effective transmission.
The algorithm is presented in the form of a block pseudocode (Figure 7), in which the sections responsible for data transmission with declared frequencies are grouped graphically. Data from all sensors are stored in the data buffer and then placed in common data frames (the data structure is presented in Appendix A) and transmitted with a frequency of 5 Hz. Depending on the value of the parameter , data from individual sensors can be transmitted at several frequencies, which is associated with sending additional frames. The input data of the algorithm are also three threshold values TH1, TH2, and TH3, fulfilling the condition: 0 < TH1 < TH2 < TH3. Based on the result of comparing the value of the parameter d i with the threshold values TH1, TH2 and TH3, the frequency of data transmission f T from the i-th sensor is determined (Table 1). Table 1. Frequency of sending frames depending on the parameter d i .

Condition
Frequency of Sending Frames f T 60 Hz The individual threshold values TH were determined on the basis of preliminary analyses, which allowed for assigning the speed of motion to four ranges. The slowest movements are associated with a threshold below TH1, whereas the fastest with a threshold above TH3. Defining the threshold values TH is related to the dynamics of the monitored traffic. Theoretically, too low threshold values of the algorithm will increase the frequency of frame transmission even with slow movements. In this case, the effectiveness of network traffic reduction will decrease. On the other hand, too high threshold values will negatively affect the smoothness of motion mapping. When monitoring movements, the system will tend to transmit frames at lower frequencies, which may result in significant delays in movement mapping. In this case, only the most dynamic movements will activate the increase in frame transmission frequency, and therefore only they will be mapped without delays on the server side. The procedure for determining the threshold values is described in more detail in Section 4.3.3.
By correlating the frequency of sending frames with the threshold values, it is possible to optimize radio network traffic, which allows for the reduction of bandwidth usage and more effective management of the energy expended on data transmission. Limiting only the transmission frequency and aggregation of data in a frame (frame lengthening) will limit network traffic. However, in the case of monitoring fast movements, it will not ensure their smooth (real-time) mapping. The lack of smoothness in mapping fast movements is related to the relatively long interval of transmission of successive data portions (e.g., 200 ms). Data aggregation consists in placing the measurement points obtained from the sensors from the moment of sending a previous data frame in the teletransmission frame, as discussed in previous publications [25,26]. However, in the case of the adaptive algorithm presented in the article, the data were not aggregated due to the large number of sensors (16 sensors). Teletransmission frames contain the current quaternion q i and the averaged (arithmetic mean) values of the vectors a i , ω i , and m i , obtained from one or more sensors. All values derived from a specific sensor since the moment of sending a previous data frame are averaged.
The algorithm is presented in the form of a block pseudocode (Figure 7), in which the sections responsible for data transmission with declared frequencies are grouped graphically.
Data from all sensors are stored in the data buffer and then placed in common data frames (the data structure is presented in Appendix A) and transmitted with a frequency of 5 Hz. Depending on the value of the parameter d i , data from individual sensors can be transmitted at several frequencies, which is associated with sending additional frames. Figure 8 presents examples of data transmission structures from individual sensors, with the transmission frequencies f T being presented in the form of time slots with an interval of 16.7 ms. If the value of the parameter d i for at least one sensor exceeds the TH1 threshold, then the data transmission for these sensors is performed with a frequency f T of 5 Hz and additionally 15 Hz. On the other hand, when the value of the parameter d i for at least one sensor exceeds the TH2 threshold, then the data transmission for these sensors is carried out at frequencies f T of 5 Hz, 15 Hz and additionally 30 Hz, which is presented graphically in Figure 8a. The situation is similar in the case of exceeding the TH3 value, when the frames are additionally transmitted with a frequency of 60 Hz (Figure 8b). Figure 8c presents an example of a frame transmission structure in which different frequencies f T (5 Hz, 15 Hz, 30 Hz, and 60 Hz) are used to transmit data from different groups of sensors. Figure 8 presents examples of data transmission structures from individual sensors, with the transmission frequencies fT being presented in the form of time slots with an interval of 16.7 ms. If the value of the parameter for at least one sensor exceeds the 1 threshold, then the data transmission for these sensors is performed with a frequency fT of 5 Hz and additionally 15 Hz. On the other hand, when the value of the parameter for at least one sensor exceeds the 2 threshold, then the data transmission for these sensors is carried out at frequencies fT of 5 Hz, 15 Hz and additionally 30 Hz, which is presented graphically in Figure 8a. The situation is similar in the case of exceeding the 3 value, when the frames are additionally transmitted with a frequency of 60 Hz (Figure 8b). Figure 8c presents an example of a frame transmission structure in which different frequencies fT (5 Hz, 15 Hz, 30 Hz, and 60 Hz) are used to transmit data from different groups of sensors.

Measurement Protocol
The developed adaptive data transmission algorithm was tested in terms of energy efficiency and network load. For this purpose, a measurement protocol was designed, which consisted of 26 measurement cases, P1 to P26. The measurement protocol controlled the data transmission from 16 sensors, which allowed to simulate the practical application of the algorithm. In individual measurement cases, data from sensors were transmitted with predefined frequencies f T . The tested measurement cases are presented in Table 2. The measurement protocol includes data transmission from all 16 sensors both at the highest frequency f T of 60 Hz (P1) and the lowest frequency of 5 Hz (P26). The cases from P2 to P25 represent selected intermediate transmission states of the sensor network.  0  0  14  2  P7  2  0  0  14  P8  13  3  0  0  P9  13  0  3  0  P10  13  0  0  3  P11  0  13  3  0  P12  0  0  13  3  P13  3  0  0  13  P14  8  8  0  0  P15  8  0  8  0  P16  8  0  0  8  P17  0  8  8  0  P18  0  0  8  8  P19  15  1  0  0  P20  15  0  1  0  P21  15  0  0  1  P22  14  1  1  0  P23  13  1  1  1  P24  0  16  0  0  P25  0  0  16  0  P26  0  0  0  16 For example, in the measurement case P21, the data are transmitted for 15 sensors with the frequency f T equal to 5 Hz, and for one sensor with the frequency f T equal to 5 Hz, 15 Hz, 30 Hz, and 60 Hz (for the sensor, for which data are transmitted at a given frequency f T , data are also transmitted with all available frequencies below f T ). Measurements of each case from P1 to P26 were recorded for 20 s. During this time, the MEMS sensors made continuous measurements, and their parameters d i (the parameter controlling the transmission filter) were set in such a way as to ensure the frequency of data transmission f T from individual sensors in accordance with the developed measurement cases.

System Current Consumption Testing
The energy efficiency tests of the system with the implemented adaptive algorithm were carried out on the basis of current consumption. The supply voltage of the system was 4 V. The current consumption was determined by measuring the voltage across the shunt resistor. Due to slight differences between the measured current consumption values (below 0.5%), the measurement cases were grouped in accordance with Table 3. The tests, conducted in accordance with the measurement protocol, show that the greatest savings in the current consumed by the system are obtained when data from sensors are sent with the frequency f T equal to 5 Hz. A reduction in the system current consumption in this case can even reach 19.9% in relation to the system in which data from sensors are transmitted at frequencies of 60 Hz or 30 Hz.

Measurements of Radio Band Occupancy
The network load status test was carried out both in terms of radio band occupancy and data transmission. During the performed tests, the WSS transmitted data in accordance with the previously developed measurement protocol. Measurements of radio band occupancy depending on the frame transmission frequency f T and the length of transmission frames were carried out using the measuring station presented in Figure 1. The spectrum analyser (SA) performed the measurements in the RTSA (Real-Time Spectrum Analyser) mode and displayed spectrograms. The measurements were performed in the frequency range from 2.39 GHz to 2.43 GHz. The WSS sensor module communicated with the RT access point using channel 1 (2.412 GHz). The acquisition time of one measurement was set to 24.996 ms. The measurement antenna directed at the WSS was 1 m away. The band occupancy tests, depending on the test case, were performed on the basis of the analysis of recorded spectrograms, where the X axis represents the frequency, and the Y axis represents the time. The Y axis consists of 483 points, with each point representing a single SA analyser measurement (24.996 ms). The signal strength measurement range represented by the spectrogram colours is from −100 dBm to 0 dBm. However, it was limited and ranged from −72 dBm to −27 dBm (Ref Hue Pos was set to 73 and Bottom Hue Pos to 28). Measurements were taken for all the test cases from P1 to P26 and, additionally, a measurement was performed with the sensor module turned off to determine the effect of ambient noise on the other measurements. The measurement results were saved as bitmaps presenting spectrograms. For the purposes of further analysis, the spectrogram colours were changed. The default colour range (Figure 9a) was converted to grayscale from the hexadecimal value range 0xFFFFFF (white) to 0x242424 (dark grey), where white is the highest measured signal strength (Figure 9b where white is the highest measured signal strength (Figure 9b). From each image, the central part of the monitored band with a range of about 18 MHz was selected. Then, each image was thresholded with the values of 75, 100, 125, and 150 (from the range of 0-255, where 0 is black, 255 is white). For each of the processed images (Figure 9c), the percentage of white was calculated, which represents the band occupancy. Regardless of the adopted threshold value, the share of white in the background image does not exceed 2.2%, so it can be concluded that the background noise did not have a significant impact on the measurement results. Figure 10 shows a graph of the percentage of white in the images as a function of the frequency fT, for various threshold values (thd).   For each of the processed images (Figure 9c), the percentage of white was calculated, which represents the band occupancy. Regardless of the adopted threshold value, the share of white in the background image does not exceed 2.2%, so it can be concluded that the background noise did not have a significant impact on the measurement results. Figure 10 shows a graph of the percentage of white in the images as a function of the frequency f T , for various threshold values (thd).
where white is the highest measured signal strength (Figure 9b). From each image, the central part of the monitored band with a range of about 18 MHz was selected. Then, each image was thresholded with the values of 75, 100, 125, and 150 (from the range of 0-255, where 0 is black, 255 is white). For each of the processed images (Figure 9c), the percentage of white was calculated, which represents the band occupancy. Regardless of the adopted threshold value, the share of white in the background image does not exceed 2.2%, so it can be concluded that the background noise did not have a significant impact on the measurement results. Figure 10 shows a graph of the percentage of white in the images as a function of the frequency fT, for various threshold values (thd).    Table 4 shows the mean percentage reduction in the band occupancy for transmitting frames at 5 Hz, 15 Hz, and 30 Hz, relative to transmission at 60 Hz, calculated using all curves.

. Transmission
To test the network load in terms of the amount of transmitted data, the measuring station presented in Figure 2 was used. The WSS module transmitted data in accordance with the developed measurement procedure (26 measurement cases). During the system operation, Ethernet transmission frames, which use the UDP, were acquired on the PC server side using Wireshark. Then, the Wi-Fi frames captured by the Sniffer were also acquired. Only the data frames sent by the WSS were analysed. In the measurement cases (P1, P2, P8, P14, P19, and P24), for which the maximum frame transmission frequency f T was 5 Hz or 15 Hz, Management frames were captured informing that the radio module goes to sleep or is woken up. These frames were not observed for the other measurement cases. Putting the radio module into the sleep mode allows to reduce power consumption, which was observed while testing the system energy efficiency (Section 4.2). In addition, the amount of data transferred was calculated (in kB/s), in which the Management and ACK frames captured by the Sniffer were omitted. The mean data rate during 1 s was calculated for both Ethernet and Wi-Fi frames. The graph of the amount of transmitted data versus time, taking into account the measurement cases (P1 to P26), is shown in Figure 11. frame rate were analysed as being equivalent. Moreover, irrespective of the threshold value, the curves of the percentage of white for the measurement cases with the maximum frequency fT are of a similar nature (Figure 10). Table 4 shows the mean percentage reduction in the band occupancy for transmitting frames at 5 Hz, 15 Hz, and 30 Hz, relative to transmission at 60 Hz, calculated using all curves.

. Transmission
To test the network load in terms of the amount of transmitted data, the measuring station presented in Figure 2 was used. The WSS module transmitted data in accordance with the developed measurement procedure (26 measurement cases). During the system operation, Ethernet transmission frames, which use the UDP, were acquired on the PC server side using Wireshark. Then, the Wi-Fi frames captured by the Sniffer were also acquired. Only the data frames sent by the WSS were analysed. In the measurement cases (P1, P2, P8, P14, P19, and P24), for which the maximum frame transmission frequency fT was 5 Hz or 15 Hz, Management frames were captured informing that the radio module goes to sleep or is woken up. These frames were not observed for the other measurement cases. Putting the radio module into the sleep mode allows to reduce power consumption, which was observed while testing the system energy efficiency (Section 4.2). In addition, the amount of data transferred was calculated (in kB/s), in which the Management and ACK frames captured by the Sniffer were omitted. The mean data rate during 1 s was calculated for both Ethernet and Wi-Fi frames. The graph of the amount of transmitted data versus time, taking into account the measurement cases (P1 to P26), is shown in Figure 11. In the case of Ethernet frames, the data include: data from the system, UDP, IP, and MAC 802.3 headers, whereas in the case of Wi-Fi frames, the total length of the frame sent by radio (including the radio interface configuration header, WPA2, MAC 802.11, LLC, SNAP, IP, and UDP). Due to the greater number of components and the fact that the 802.11 MAC header is longer than the 802.3 MAC, the total length of the Wi-Fi frame will be greater than for the Ethernet frame. Attention should be drawn to the difference in the In the case of Ethernet frames, the data include: data from the system, UDP, IP, and MAC 802.3 headers, whereas in the case of Wi-Fi frames, the total length of the frame sent by radio (including the radio interface configuration header, WPA2, MAC 802.11, LLC, SNAP, IP, and UDP). Due to the greater number of components and the fact that the 802.11 MAC header is longer than the 802.3 MAC, the total length of the Wi-Fi frame will be greater than for the Ethernet frame. Attention should be drawn to the difference in the amount of data captured by the Sniffer compared to the Ethernet transmission. The amount of data from the captured Wi-Fi frames should be greater than the amount of data from the Ethernet frames. In some measurement cases, the opposite is true because the Sniffer cyclically switches between Wi-Fi channels, which leads to partial data loss, but the shape of the curve remains intact.
Reducing the maximum frequency with which data frames are transmitted, and possibly increasing the number of sensors for which data frames are transmitted at a frequency f T of 5 Hz, allows for a significant reduction in the amount of data transmitted. This reduction does not have a significant impact on the quality of motion mapping on the PC server side, which is discussed later in the article. Most data are sent in the case of P26, whereas the least in P1. In the case of P1, the amount of data transferred is by approximately 91.6% lower than in the case of P26. The percentage differences between P26 and the other cases are presented in Table 5.

Quality of Motion Mapping Using the Data Transmission Algorithm
In the presented system, when optimizing network traffic, it is important to reduce the amount of transmitted data, while maintaining high-quality monitoring of individual sensor signals. In the algorithm described in Section 3, data from the accelerometer, gyroscope and magnetometer are averaged and then sent to the PC server. Additionally, the latest quaternion representing the rotation of the individual sensors is sent. This reduces the number of measurement points depending on the frame transmission frequency f T . In order to verify the quality of mapping the measurement signals, a series of tests was carried out with the use of the proposed algorithm. The research allowed to compare the reduced data received from the WSS and the complete measurement data from the MEMS sensors. The tests were preceded by the procedure of determining the threshold values (TH1, TH2, TH3).
In order to determine the threshold values, measurements were performed with the participation of three volunteers. During the measurement, the WSS transmitted all measurement data from the MEMS sensors (the transmission control algorithm was disabled). Each volunteer performed six measurement gestures, which are presented in Figure 12a through Figure 12f. For the purposes of the research, a measurement procedure was designed, in which the time of performing individual gestures and the time of the control gesture were determined. The set times ensured repeatability in reproducing the sequence of gestures by individual volunteers. In addition, the performance of successive gestures in accordance with the adopted measurement procedure ensured the diversified hand movement dynamics as well as the diversification of the input data for testing the transmission algorithm. Each measurement gesture was performed for 3 s. In the measurement procedure, a control gesture was also introduced-the hand was positioned horizontally with the fingers extended (Figure 12g). The control gesture was performed before the beginning of the series of measurement gestures, after its completion and between each of the measurement gestures. The control gesture was also performed for about 2-3 s. With the participation of volunteers, three measurement cycles were carried out, in which three series of gestures were performed (9 series in total). There was a 10-s pause between the series of gestures. measurement data from the MEMS sensors (the transmission control algorithm was disabled). Each volunteer performed six measurement gestures, which are presented in Figure 12a through Figure 12f. For the purposes of the research, a measurement procedure was designed, in which the time of performing individual gestures and the time of the control gesture were determined. The set times ensured repeatability in reproducing the sequence of gestures by individual volunteers. In addition, the performance of successive gestures in accordance with the adopted measurement procedure ensured the diversified hand movement dynamics as well as the diversification of the input data for testing the transmission algorithm. Each measurement gesture was performed for 3 s. In the measurement procedure, a control gesture was also introduced-the hand was positioned horizontally with the fingers extended (Figure 12g). The control gesture was performed before the beginning of the series of measurement gestures, after its completion and between each of the measurement gestures. The control gesture was also performed for about 2-3 s. With the participation of volunteers, three measurement cycles were carried out, in which three series of gestures were performed (9 series in total). There was a 10-s pause between the series of gestures.  From the received data, only the values from the 3D gyroscopes were analysed, and the d i parameter was calculated for each vector ω i according to the Formula (2). Then, the local maxima were determined for the data from all the series of measurements. The maxima occurred at the time of performing the measurement gesture, or switching to the control gesture (12 maxima per series). The arithmetic mean was calculated from the set of maxima. The threshold values of TH1, TH2, and TH3 were 1 /4, 1 /2, and 3 /4 of the calculated mean, i.e., 84.21, 168.42, and 252.63, respectively.

Acquisition of Data from Sensors
The WSS, with the implemented control algorithm, transmitted two types of frames: frames containing complete data from the MEMS sensors sent with a frequency of 119 Hz and frames modified by the algorithm. The study of the hand motion mapping quality based on data modified by the transmission control algorithm was carried out on the basis of measurements with one volunteer. A series of measurements was performed, consisting of the previously described three repetitions of a predetermined series of gestures. Then, the data obtained from the frames created by the algorithm were compared with the complete data from the MEMS sensors.
Examples of measurement signals (from complete data and after applying the algorithm) from one series of gestures, obtained from the accelerometer and the gyroscope, are presented in Figure 13a,b, respectively. The presence of subsequent gestures 1-6 ( Figure 12a-f) and the control gesture C (Figure 12g), visible as a flattened signal between individual gestures (Figure 13), have been marked.

Acquisition of Data from Sensors
The WSS, with the implemented control algorithm, transmitted two types of frames: frames containing complete data from the MEMS sensors sent with a frequency of 119 Hz and frames modified by the algorithm. The study of the hand motion mapping quality based on data modified by the transmission control algorithm was carried out on the basis of measurements with one volunteer. A series of measurements was performed, consisting of the previously described three repetitions of a predetermined series of gestures. Then, the data obtained from the frames created by the algorithm were compared with the complete data from the MEMS sensors.
Examples of measurement signals (from complete data and after applying the algorithm) from one series of gestures, obtained from the accelerometer and the gyroscope, are presented in Figure 13a and Figure 13b, respectively. The presence of subsequent gestures 1-6 (Figure 12a-f) and the control gesture C (Figure 12g), visible as a flattened signal between individual gestures (Figure 13), have been marked. It can be observed in Figure 13 that the use of the algorithm does not significantly change the nature of the recorded signal. However, the areas under the curves (AUC) were compared to determine the differences between the time waveforms obtained. The entire recorded measurement cycle was separated into individual gestures, and for each of them (for each component: ax, ay, az, ωx, ωy, and ωz from 16 sensors), the AUC was calculated. It can be observed in Figure 13 that the use of the algorithm does not significantly change the nature of the recorded signal. However, the areas under the curves (AUC) were compared to determine the differences between the time waveforms obtained. The entire recorded measurement cycle was separated into individual gestures, and for each of them (for each component: a x, a y , a z , ω x , ω y , and ω z from 16 sensors), the AUC was calculated.

Statistical Analysis
The statistical analysis of the results was performed using Statistica 13. The distribution of variables in the individual groups was verified with the Shapiro-Wilk W test and graphically assessed. The unpaired t-test and, in justified cases, its non-parametric counterpart, the Mann-Whitney U test, was used to compare the results (AUC) of two groups, i.e., those obtained from complete data and after applying the transmission control algorithm. Although the measurement cycle consisted of a series of gestures repeated three times, they were not treated as dependent samples. The aim was not to check the repeatability of the gestures performed, but to verify the impact of the applied transmission control algorithm on the shape of the obtained measurement signals. For this reason, each repetition of a specific gesture was treated as independent. Each group (individually for each of the six gestures) was verified with the two-sided Grubbs test for outliers. However, none of the values indicated by the test was removed, as the deviation in the values did not result from a measurement error, but from a specific arrangement of sensors on the hand when performing a specific gesture. For example, in the case of gesture 2 and sensor 15 or 16, the changes in values in some components may be much smaller than in the case of other sensors, due to the arrangement of these sensors. The calculated AUC value may deviate from the other values, but should not be treated as a measurement error and removed from the data series. Table 6 shows the probabilities obtained for the comparison of the AUCs calculated from the signals obtained from the complete data and after applying the data transmission control algorithm. In each of the analysed cases (for each of the six gestures performed), the differences in the AUC turned out to be statistically insignificant (p > 0.05). Table 6. Probabilities obtained from testing the significance of differences between the AUCs calculated based on the complete data and after applying the algorithm. Tables 7 and 8 present descriptive statistics (mean, standard deviation, minimum value, maximum value, median, p 25 -lower quartile, p 75 -upper quartile, p 75 -p 25 -interquartile range) obtained from the percentage differences between the AUCs calculated from the complete data and after applying the data transmission control algorithm.  The maximum difference between the AUCs for the accelerometer data was obtained for gesture 3 ( Figure 12c) and was about 5-7%, but it was the only case in the entire series of data, none of which exceeded 4.7%. In the case of the gyroscope, also for gesture 3, in one case (only for the z component) the difference in the AUCs exceeded 5%. The mean difference in the AUCs from the entire measurement cycle, both for the data obtained from the accelerometer and the gyroscope, was about 1%. Due to the separation of individual components and the imperfect reproducibility of gestures in the next three series of repetitions, the data are varied, therefore the standard deviations (std) are comparable to the calculated mean values.

Conclusions
Modern wearable sensor systems require the processing and transmission of more and more data. Energy and teletransmission aspects should be taken into account when designing such solutions. The necessity to transmit large amounts of data, as in the case of the presented sensor system for hand motion acquisition, is related to the load on the radio module and external teletransmission infrastructure. The process of radio data transmission is also a significant energy burden for modern wearable battery-powered sensor systems.
The article presents the algorithm that was implemented in the sensor system and then tested. This algorithm controls data transmission via the Wi-Fi module. Depending on the dynamics of hand motion, the algorithm changes the number of transmitted frames and the length of these frames, which allows to reduce the energy demand of the radio module, but also significantly reduces the load on the Wi-Fi network. This data transmission procedure does not degrade the image quality of the monitored signal. The conducted research shows that new algorithms for data processing and transmission used in sensor systems allow for the improvement of energy (battery operation time) and teletransmission parameters (lower network load). The developed adaptive algorithm can be used to monitor motion with different dynamics, as in the case of gestures, where there is a movement phase (increased amount of transmitted data) and a rest phase (reduced amount of transmitted data).  Figure A1 shows the data frame format. The HEADER block contains tags to identify the device type (TOKEN), its version (VERSION), and the frame type (F.TYPE). The header block further includes the frame number (F.NUM) and the current time (TIME). Elements marked as RESERVED constitute additional data stores that can be used in more complex applications. The data block (DATA) consists of sensor data blocks (SENSOR DATA 1,…, SENSOR DATA m), where ∈ 1, 2 … ,16 . Only the data from sensors selected for transmission by the algorithm are added to the data section. The sensor data block consists of the sensor number (SENS ID), averaged values of the coordinates of the vectors (AVG ax, AVG ay, AVG az), (AVG ωx, AVG ωy, AVG ωz), (AVG mx, AVG my, AVG mz), and the current quaternion = , , , (LATEST q0, LATEST q1, LATEST q2, Figure A1. Structure of the WSS data frame. The data block (DATA) consists of m sensor data blocks (SENSOR DATA 1, . . . , SENSOR DATA m), where m ∈ {1, 2 . . . , 16}. Only the data from sensors selected for transmission by the algorithm are added to the data section. The sensor data block consists of the sensor number (SENS ID), averaged values of the coordinates of the vectors a i (AVG a x , AVG a y , AVG a z ), ω i (AVG ω x , AVG ω y , AVG ω z ), m i (AVG m x , AVG m y , AVG m z ), and the current quaternion q i = [q 0 , q 1 , q 2 , q 3 ] (LATEST q 0 , LATEST q 1 , LATEST q 2 , LATEST q 3 ). Both the averaged values of the vector coordinates and the elements of the current quaternion are single-precision four-byte floating-point numbers (floats). The total length of a single sensor data block is 53 B as shown in Figure A1.