
Fig. 6. Phone attachment to hand for data collection.
STEP 1: COLLECT ACCELEROMETER DATA FROM SMARTPHONE
PT Assist uses the Matlab mobile app to collect data using a smartphone’s built in sensors. Fig. 6 shows how the phone must be attached to the hand. The screen must be facing up, and the top of the phone (camera side) towards your wrist. For testing purposes, we used three tight rubber bands to hold and stabilize the phone to the hand.
​
Data collected from Matlab app must collect Acceleration, Orientation, and Angular Velocity. The sample rate must be set to 100 Hz.
STEP 2: PRE-PROCESS DATA
Initial steps of our algorithm are listed below and are necessary for putting the data in a form that can be used to distinguish between proper and improper pallof press form.
-
Get the raw accelerometer data for each direction of motion (x, y, and z smartphone axes) by parsing the Matlab app.
-
Cut off the first 10 and last 10 samples to account for the time to start and stop the data collection (before and after you complete exercise, respectively).
-
Pass the raw acceleration data through a 5 point moving average filter while it is still in the time domain using (1). The raw data contains noise due to expected shaking while exercising, as well as the phone not staying perfectly still on your hand. We focus on the lower accelerations that represent a correct pallof press instead of the higher spikes that may be a result of shaking from fatigue or expected instability from the resistance. This filter averages consecutive points, reducing the high frequency noise.
​
​
​
​
(1)


Fig. 7. Raw and Filtered Data in Time Domain in x, y, and z axes.
Fig. 7 shows our raw and filtered data in the time domain. As shown, the filtered data removes the large spikes in our raw data. Since there is no clear indication of the motion, we convert from the time domain to frequency domain using the Fourier transform.
​

Fig. 8. Data in Frequency Domain Comparing Correct and Incorrect (not perpendicular to body) trial.
STEP 3: CONVERT TO FREQUENCY DOMAIN
Using the Discrete Fourier Transform (DFT), the filtered data is converted to the frequency domain. The expected frequencies are explained in the motion model. Every sample has an amplitude at 0Hz that is about 5x greater than the next highest amplitude in all axes (regardless of exercise correctness). Therefore, the 0Hz frequency's amplitude is zeroed out, leaving all the remaining frequencies relevant to our classification and within the same order of magnitude of each other.
​
Examining the frequency domain plots for the three classifications (correct, incorrect: not parallel to ground, incorrect: not perpendicular to body) of the pallof press, we see that the trials for each classification are similar to each other with regards to frequencies as well as the amplitudes of those frequencies across all three axes. As explained in the motion model, the three classifications present different frequencies and amplitudes when compared to one another. For example, as displayed in Fig. 8, the amplitudes are about three times higher in the x axis for the incorrect trial than the correct trial, which is what we expect for this graph since the incorrect trial has motion in the x axis.

Fig. 9. Cutoff RMS Value for x axis compared to RMS from Correct Trial and Incorrect (not perpendicular) Trial.
Fig. 9 represents how the algorithm classifies a correct pallof press from an incorrect pallof press. One trial of a correct exercise and an incorrect exercise by not being perpendicular to the body is shown in the frequency domain. The correct exercise's calculated RMS is below the cut-off, while the incorrect exercise's is above the cutoff.
STEP 4: APPLY ALGORITHM TO DETERMINE EXERCISE CORRECTNESS
The root mean square (RMS) values were used to establish a cutoff for the algorithm to differentiate between good and incorrect trials. RMS is a statistical tool used to measure the mean magnitude of a signal and is defined in (2).
A cutoff was determined for each direction by taking the variance of a set of four "correct trials" for each direction and then adding that variance to the maximum value in that set. The variance was added because incorrect trials have a higher RMS value, thus creating a cutoff where correct trials have a lower RMS and incorrect trials a higher RMS. These cutoff values were inputted into the main algorithm, and are used with the current trial data in the algorithm to calculate a percent error for each direction. The percent error provided the foundation for a series of if statements that indicate to the user whether their form was correct or incorrect and the direction with the greatest error in the case of a incorrect trial. Fig. 10 shows the algorithm's outputs.
​
​
​
​
These messages help guide the patient on how they can correct their form, but also encourage them to work with their PT so they do not continue to do the exercise incorrectly.

_edited.png)
Fig. 10. Logic flow diagram of algorithm output.