Suppose we have a discrete function which domain and codomain are both integers. For example, that function could be a signal from an ADC. In my case it is digitized signal from photomultiplier (see picture below). That signal have a baseline which represents the reference of the signal.
My analysis is very dependent on fine calculation of the baseline. So I am trying to implement an algorithm to determine position of the constant term in my signal. What is your ideas about my task?