To automatically calibrate a magnetic sensor without users' awareness by eliminating the need for a special operation for calibrating the magnetic sensor by the users.
A main controller unit 20 (control means) automatically calibrates the magnetic sensor, which detects geomagnetism, through the use of the rotation of this portable terminal apparatus in a state placed on a plane of a desk or the like with the vibration of a vibrator when the reception of communication or the reproduction of a ringtone is detected. The calibration is performed by storing measurement data captured from the magnetic sensor in a storage device, reading the measurement data stored in the storage device, estimating an offset according to a prescribed offset estimating algorithm, and determining whether an estimated offset value is valid or not.
Takashi Watanabe