0
$\begingroup$

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.

See the type of issue I am facing in the image

$\endgroup$
2
1
$\begingroup$

I'd do this nonlinearily, in two steps:

  1. Detect the jump
  2. 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.)

$\endgroup$
4
  • $\begingroup$ Thanks for the answer. But this is just an example, I was wondering if there already exists a standard algorithm or function specifically for these kind of corrections.I am not a person who has worked with signal processing at all. This is my first time. If you can elaborate on your method that would also be helpful. $\endgroup$ – user55240 Jan 20 at 11:21
  • 1
    $\begingroup$ what I described is an algorithm for these kind of corrections? It exists now? I'd like to elaborate, but I'd need you to ask a specific question! $\endgroup$ – Marcus Müller Jan 20 at 11:22
  • $\begingroup$ Okay, I'll try explain my case as best as I can. We are getting these signals from a device now I want an algorithm to remove the sudden DC offset caused due to motion/ external disturbance such that the DC component does not get removed entirely as happens in all the baseline correction methods. The reason being that hemodynamic information will get lost. In simple words, what I want to do is that this data be manipulated such that there is no information loss and offset gets removed. As u can see the signal after offset is same just shifted upwards in y axis. I want it to recover. Help! $\endgroup$ – user55240 Jan 21 at 11:10
  • $\begingroup$ my algorithm does exactly that. $\endgroup$ – Marcus Müller Jan 21 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.