# IoT-Based Patient Movement Monitoring: The Post-Operative Hip Fracture Rehabilitation Model
## 5 IoT System Performance  
### Data Collection and Activity Recognition  
The proposed wearable activity tracker, as discussed in the previous section, has been used to collect real-time triaxial accelerometer activity movement data from ten different healthy young individuals (five male and five female subjects in their early twenties) [8]. While these subjects are not the best representatives of real-life hip fracture cases among the elderly, they offer the necessary preliminary trials before stepping towards the healthy elderlies and then the injured elderlies. The activity tracker is attached at the right ankle joint as it has been considered the most appropriate location in monitoring post-operative hip fracture rehabilitation activities [3]. The wearable activity tracker level involves three preliminary steps for turning the sensed raw data into higher level indicators of the type of activities. These are as follows:  
1. Raw data acquisition and calibration of 518 samples at a sampling rate of 128 sample/second;
2. FFT processing for identifying the dominant spectrum identification over four seconds of acquisition time;
3. Finite time movement classification over 4-second window. As a result, the overall process starts with the subject's activity movement acceleration data collection at a sampling rate of 128 samples/second for 4 s. The reason for choosing a 4 s duration was that it was found to be the minimum time for recognizing a particular activity without any signal distortion or information loss [8]. Therefore, this means that 512 samples of subject's activity movement acceleration data are collected every 4 s.  
In order to adhere to the 20 Hz suggested for everyday activities, the collected 512 samples of acceleration data from the three axes are subjected to a basic filtering method. The filtering method involves combining the three entire axes samples to prevent glitches in the activity tracker orientation, taking the mean of the combined axes' samples, eliminating the DC offset, and taking the moving average of every four samples. In doing so, 512 samples of raw data are compressed into 128 pieces of pre-cleaned processed data which will scale down the sampling frequency to 32 Hz with a frequency bin step size of 0.25 Hz. The compressed data are further exclusively subjected to FFT-based signal processing, as proposed by [3]. This identifies the spectrum CfMA with the maximum acceleration intensity or signal amplitude (MA) that would help in comparing and classifying the activity movements' type [8]. For finding the threshold parameters of each subject when performing any of the individual movements relevant to hip fracture rehabilitation, the data are continuously collected over a time-period of three minutes for each of the activities indicated in Figure 1. Here, for all activities (i.e., static, slow, and fast walking, leg movement while sitting, swinging leg to a side, lifting thigh upwards, lying on back and lying on stomach), each subject is instructed to continuously perform each individual activity for three minutes. The reason for choosing 3 min is that this offers a minimum of 45 samples of logically complete groups of data. Each of these groups is sufficient for FFT analysis. This will also help us track the dynamic changes for each exercise as the subject transitions from an energetic exercise to steady and then to slowing down. The outcome helps to set a specific threshold range for a particular individual with some level of precision. From the outcome of the FFT process, the recognition threshold parameters for all the activities are extracted for five male subjects using the approach proposed by [10] which is based on the MA  
whereas subjects 1, 2, and 4 are distributed with a slight margin but overlap with each other. These differences are mainly due to the variation among each subject's fitness level and body composition.