## 3 Methodology
### Motivation and Background  
Smartphones currently contain a large array of sensors. Using smartphone sensor data, particularly acceleration data for BFRS detection, is akin to \"listening\" to road surface changes through an accelerometer, much like how a song records information about its environment. However, unlike voice signals, where a speaker's speed remains relatively stable, vehicle speed and acceleration fluctuate in real-time according to actual road conditions. This variability can cause the same signal to manifest in multiple ways. Consequently, one of the innovations of the proposed method is on analyzing and modeling the relationship between BFRS characteristics and vehicle speed and on enhancing features based on this relationship to accurately capture BFRS information under various speed conditions. The following are relevant for our use case: (1) the GPS sensor to collect two-dimensional location data \(P(x,y)\); (2) a gyroscope sensor to collect 3-axis orientations \(Ori(o_{x},o_{y},o_{z})\); and (3) the accelerometer sensor to collect 3-axis accelerations \(Acc\big{(}a_{x},a_{y},a_{z}\big{)}\). This multi-sensor data are discretely collected at different frequencies and time stamps as a data stream \(S\) denoted by (1). \[S\big{\{}P(x,y),Ori\big{(}o_{x},o_{y},o_{z}\big{)},Acc\big{(}a_{x},a_{y},a_{z} \big{)}\big{\}} \tag{1}\]  
When the vehicle passes an object with the bump of the road surface, abnormal shakes should appear, and they can be recorded by the smartphone placed or mounted in a vehicle. Data stream \(S\) captures the state of the road surface. Our goal is to detect BFRS using these data. Challenging issues are that the quality of smartphone sensors varies across devices (denoted as \(S_{noise}\)), smartphones are arbitrarily placed, and driving behaviors vary (denoted as \(D_{speed}\)), as denoted by (2). All these conditions lead to a non-homogenous multi-sensor data stream, making it difficult to extract BFRS. \[BFRS=\text{Detect}(S_{noise})\ s.t.\ discrete\ \&\ non-homogenous \tag{2}\]  
In this article, smartphones are used as sources for road surface data collection. The sensors within the smartphone are highly integrated and encapsulated within the device. However, compared to professional surveying equipment, the accuracy of sensor data from smartphones is limited. Therefore, to obtain road surface information, the following two issues must be analyzed from both macroscopic and microscopic perspectives:(1) Smartphone installation/placement in macroscopic aspect: The sensors in smartphones are integrated and fixed on the mainboard, meaning the spatial attitude information of the smartphone is consistent with the accelerometer and orientation sensor data. Thus, it is possible to transform the acceleration records at any moment into an initial posture perpendicular to the road surface along the \(z\)-axis using the orientation sensor. This means the smartphone can be placed in any orientation within the vehicle as per the method described in this article. (2) Multiple sensor calibration in microscopic aspect: At the hardware level, the relative positions of the sensors are fixed during integration within the smartphone. At the system level, calibrations can be made through the smartphone's system settings to calibrate between multiple sensors (for example, in iOS, settings can be conducted via \"System\"->\"Privacy\"->\"Location Services\"->\"System Services\"->\"Compass Calibration\" and \"Motion Calibration and Distance\"). Although \"data flow/drift\" occurs in motion sensors like gyroscopes, where errors accumulate over time, the data preprocessing algorithms provided by smartphone operating systems, such as the \"sensor fusion algorithm\" in the iPhone's Core Motion framework, can transform this \"dirty data\" into \"clean data\". Consequently, the collected dataset, including acceleration and orientation, is preprocessed and filtered.