# IoT-Based Patient Movement Monitoring: The Post-Operative Hip Fracture Rehabilitation Model
## 5 IoT System Performance
### IoT System Performance Testing  
This section investigates the data communication performance with an emphasis on packet loss analysis. The data stream communication rates of four different time intervals of 1, 2, 3, and 4 s were tested. While 4 s is considered typical for the FFT analysis of the accelerometer data of an elderly user, faster rates are considered to examine the system communication capability for other users. The test has also considered the trade-off of FFT computation performed at the wireless sensor edge against the gateway edge. Wireless Sensor Edge vs. Gateway Edge Analysis  
As part of the investigation, two architectural scenarios are considered. In the first scenario, which is related to the wearable sensor edge, the FFT-based signal processing is embedded within the wireless sensor where only one frame of 16 bytes of data packet size is sent to the gateway once at the four different time intervals chosen. These are intervals of 1, 2, 3, and 4 s, respectively. However, in the second scenario, the FFT computation is embedded at the gateway edge while the wireless sensors simply perform the acquisition and calibration of the data samples. Here, the fine tuning of the raw activity movement signals through basic filtering methods such as removing the DC offset and taking average of every fourth sample [3] is performed at the wearable wireless sensor edge. In doing so, a single frame has a data packet size of 12 bytes and 128 such readings are sent to the gateway again at four different time intervals where the FFT-based signal processing is performed at the gateway level. The experimental description of each of these scenarios and their effect on the packet loss analysis are as follows: \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Activity** & **Overlap** & **Correct** & **Incorrect** \\
**Performed** & **Activity** & **Recognition** & **Recognition** \\ \hline Case 1: LTU & LOS & 13/15 times & 2/15 times \\ \hline Case 1: Static & None & 15/15 times & None \\ \hline Case 1: SLTS & LM & 11/15 times & 4/15 times \\ \hline Case 2: LOB & LM & 11/15 times & 4/15 times \\ \hline Case 2: Static & None & 15/15 times & None \\ \hline Case 2: LOS & None & 13/15 times & 2/15 times \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Activities performed, overlap, and recognition findings summary for Cases 1 and 2. **Experiment 1:** The first experiment investigates the effect of increasing the number of data gathering nodes on the data drop rate while transmitting the data at different time intervals. Here, we used a network of up to five nodes feeding the gateway with a fixed rate of sensors' data. Five different network setups have been considered where each wearable node is static and transmitting the data packet based on first and second scenario as discussed above. The Carrier Sense Multiple Access (CSMA) MAC protocol is used, where all the nodes simultaneously report the coordinator attached to the gateway (Raspberry Pi). The experiment is repeated five times and each experiment is performed for a time duration of fifteen minutes. Each time, one more node is added to feed the data to the gateway. All the five sensors are stationary and are placed on the same bench without being obstructed by any obstacles around and between the nodes. At the wearable sensor edge level, no packet loss was observed for all the nodes in the network. However, at the gateway edge level and as represented in Figure 7, no packet loss is observed for one node network and is almost negligible, i.e., 1%. Taking two node networks as an example, the average packet loss for a 1 s time interval is around 37% and subsequently decreases to 3, 3, and 2%, respectively, as the time interval rate increases. However, a similar trend is also observed for the other three node networks. Therefore, especially in case of bulk data transmission, it is clearly indicated that as the number of nodes in the network increases, the percentage of packet loss increases exponentially.