Research Article

Evaluation of Bus Vibration Comfort Based on Passenger Crowdsourcing Mode

Algorithm 1

Filtering algorithm. () The parameter of alpha is calculated by equation: , where is single sampling time of filter and dT is sampling frequency. () The array of values is used to store the values of raw acceleration along -axis, -axis, and -axis, respectively. () The array of gravity is the values of gravity. () The array of linear_acceleration is acceleration without gravity.
(1) public void onSensorChanged(SensorEvent event)
(2) final float alpha = 0.8;
(3)   gravity[0] = alpha gravity[0] + (1 − alpha) event.values[0];
(4)   gravity[1] = alpha gravity[1] + (1 − alpha) event.values[1];
(5)   gravity[2] = alpha gravity[2] + (1 − alpha) event.values[2];
(6)   linear_acceleration[0] = event.values[0] − gravity[0];
(7)   linear_acceleration[1] = event.values[1] − gravity[1];
(8)   linear_acceleration[2] = event.values[2] − gravity[2];
(9)