A method and apparatus which can provide a temperature estimate in a hard
disk drive or other electronic device is provided. Output from the
sensor, which may be indicative of a location spaced from the target
temperature location, is sampled and integrated over an interval of time
to form an estimate of average input sensor voltage. During the time
interval, history of the HDD pre-amplifier operating modes is
accumulated. The results are combined to form an estimate of HDA ambient
temperature. Sensor offsets associated with each power mode, and weighted
to the corresponding mode duty, can be subtracted from the average input
sensor voltage.