Patent ID: 8214165

Claim:
An apparatus for determining power source failure, the apparatus comprising: a power supply that receives an alternating current (“AC”) power waveform, the power waveform comprising a predetermined frequency and a corresponding predetermined period; a rectifier that rectifies the power waveform to yield a rectified power waveform; an analog-to-digital converter that samples the rectified power waveform; an initialization module that initializes a stored threshold amplitude, using the analog-to-digital converter, at a plurality of known points within the predetermined period by sampling the AC power waveform over a single half cycle of the predetermined period, the sampling at a sampling frequency which is a multiple of the predetermined frequency; and calibrates the stored threshold amplitude by multiplying each stored amplitude by a predetermined percentage of the stored amplitude, wherein the initialization module uses one single half cycle for sampling the AC power waveform, initializing the stored threshold amplitudes, and calibrating the stored threshold amplitudes without using other single half cycles of the AC power waveform; a sampling module that samples, using the analog-to-digital converter, the AC power waveform, the sampling to obtain a sampled amplitude at times that correspond to the known points of the stored threshold amplitude; a buffer module that buffers the sampled amplitude through a consecutive sequence of most recent sampled amplitudes; a comparison module that compares the sampled amplitude to the stored threshold amplitude to obtain a comparison result, the stored threshold amplitude corresponding to the known point within the predetermined period; an accumulation module that accumulates the most recent comparison results; and a warning module that asserts an early power off warning signal if a predetermined number of the most recent comparison results each indicate that the sampled amplitude is smaller in absolute value than the stored threshold amplitude.