Let's say I have all smartphone sensor data, i.e. accelerometer, gyroscope, magnetometer, gravity sensor. As we know all the above data are available in the device's frame of reference; how do you convert the data with reference to earth's coordinate system?