Active control of the baseline of digitized preamplifiers with sliding-scale correction