Abstract: An electronic circuit provides automatic compensation with reduced errors of undesirable offsets in analog and digital signals, including offsets in the input signal and offsets due to tolerances in components comprising said electronic circuit. The electronic circuit includes a minimum-hold circuit or, depending on the polarity of the signal of interest, a maximum-hold circuit to continuously determine the at-rest, or reference level of the input signal. The accuracy of compensation is therefore not a function of the duty cycle or amplitude of the input signal of interest.