## 3 Methodology
### Motivation and Background
Additionally, before initiating data collection, the smartphone is restarted and left idle for a period to ensure the activation of the device's sensor calibration features. During data collection, the sampling frequency of the smartphone's accelerometer and orientation sensors is consistent, and the impact of the sensors operating at short intervals, such as 100 Hz, on the results is limited compared with vehicle speeds ranging from 0 km/h to 60 km/h. Therefore, linear interpolation techniques have been employed to perform time alignment for the collected data from multiple sensors. Additionally, the calculation of the smartphone's posture within the sensor array requires reference to electronic compasses, magnetometers, and other sensors. Therefore, during data collection, the smartphone should be kept away from strong magnetic fields to ensure the accuracy of data collection. Therefore, the first step in our process is temporal alignment for \(S\) due to the different time stamps and sampling frequencies. The acceleration timestamp is used as a reference, and stream data from the gyroscope sensor is aligned to the acceleration recordings using linear interpolation. GPS samples are aligned in a similar fashion. The speed information is computed based on the distance and time duration between consecutive GPS position samplings (cf. Section 3.3 for details). It is assumed that under normal driving conditions (speeds of 0-60 km/h, without sudden traffic accidents, and consistent movement), changes in speed and position over a 1-s interval are continuous. Furthermore, given that GPS signals inherently possess an error greater than 5 m, employing linear interpolation for estimating GPS positions is considered reasonable. Consequently, to correlate acceleration sampling moments with GPS location data, linear interpolation is used to estimate GPS positions at each acceleration sampling moment. Using the smartphone's recorded 3D orientation information, spatial transformations are performed on the corresponding acceleration data at each moment. This process converts the arbitrarily oriented 3D acceleration data into acceleration information that is parallel to the \(xy\) plane and perpendicular to the \(z\)-axis of the road surface, thereby accurately representing the vertical acceleration relative to the road surface and the horizontal changes in vehicle movement at each moment. The proposed method implements the coordinate system rotation using the Direction Cosine Matrix (DCM) method. At each sampling moment of acceleration, linear interpolation is utilized to temporally align sensor attitude data. Using the three-dimensional posture data corresponding to that moment, a DCM is established. This matrix is then multiplied with the corresponding tri-axial acceleration data to achieve spatial transformation, yielding acceleration data with the \(z\)-axis perpendicular to the road surface and the \(xy\)-axis parallel to it. The 3-axis acceleration \(Acc\) is affected by vehicle acceleration. Hence, the spatial pose of the accelerometer is reoriented by the timestamp-aligned orientation recordings \(Orialigned\), and the transformedacceleration \(Acc_{trans}\big{(}a_{x},a_{y},a_{z}\big{)}\) consists of a \(z\)-axis acceleration that is always vertical to the ground and \(x\)-axis and \(y\)-axis accelerations parallel to the ground (cf. (3)). \[ \begin{split} Acc_{trans}\big{(}a_{x},a_{y},a_{z}\big{)}=\text{ SpatialTransform}\Big{(}Acc,Ori_{aligned}\Big{)}\\ with\ a_{z}\bot ground\ \&\ \big{(}a_{x},a_{y}\big{)}\ \parallel ground \end{split}