## 3 Adaptive Data Transmission Algorithm
Four frame transmission frequencies \(f_{T}\) were defined in the transmission control algorithm (Figure 6): 60 Hz, 30 Hz, 15 Hz and 5 Hz. The \(f_{T}\) frequencies are approximate values and result from dividing the sensor sampling frequency (119 Hz) by the numbers 2, 4, 8 and 24, respectively. 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). 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}\), \(\omega_{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