Below is an explanation of what is called search offset software.
When a compass is mounted in a mobile device, a search offset must be conducted (e.g. at time of startup) and the optimal measurement range set.
Diagram 1. The relationship between magnetic field measurement and compass measurement range
In order to effectively use the range of the AD converter, the measurement window for operating the AMI306 is set to +/- 3 Gauss.
Diagram 2. Scenario where a stationary magnetic field exists at the compass mounting location
Because electrical components on a circuit board become magnetized, if the compass is mounted on the circuit board, the circuit board’s magnetization (a fixed value) is superimposed on the earth’s magnetic field.
The circuit board’s magnetization can be much larger than the absolute value of the earth’s magnetic field.
To account for this, the measurement window must be moved.
The measurement window can be moved at 1/96 increments within a +/- 12G absolute measurement range