The signal values should not get affected by the correction. Most methods I found were related to baseline drift or exponential baseline shift/decay. I am unable to find a method suitable for my use case. In the image it is visible that after sudden dc offset the baseline got shifted. After correction it should stay same.
I'd do this nonlinearily, in two steps:
- Detect the jump
- Correct the jump
Detection sounds rather easy: a short (linear-phase) high-pass filtered version of your signal is compared to a threshold. From that, we know exactly the position of your jump; it's where the threshold was crossed, minus the group delay of the filter (which happens to be half the filter length).
Take the value of the original signal right after the jump. Shift the right-hand side of the original signal such that it ends up at the same amplitude as the sample before the jump. (A more elegant way would be definining a signal model, and then modeling the most likely signal progression, but you don't seem to have an overly useful signal, as you don't mention it.)