1

I have some voltage data recorded from brain electrophysiology that look like this:

Raw voltage trace

Notice that the fluctuations <200 uV is the actual data and the huge peaks are artifacts that might arise from occasional touching of the reference with something else. I'm not an expert in electrical engineering, but the artifact looks like the step response of a high-pass filter that is used to remove the DC offset.

Now I'm trying to remove the artifacts by curve fitting. If I detect peaks in my diff(data) and avarage all waveforms around the peak, it looks like this:

Average artifact waveform

My questions are the following:

  1. What is the function/kernal for the artifact? I thought exponential decay would work, but the waveform clearly has overshoot that an exponential decay doesn't. Is this actually a step response of a high-pass filter? If so, what's the analytical form?

  2. How do I solve the fitting problem of expressing my signal as a sum of time-shifted and scaled kernals? cfit doesn't seem to be the correct option.

Thank you!

1 Answers1

0

You can try using a superposition of three sigmoid functions, for example:

enter image description here

Yields this:

enter image description here

When used with parameters described in this Desmos: https://www.desmos.com/calculator/ouuauyihdt

You can probably simplify the equation a bit or add additional parameters, and then use any of the standard curve fitters to fit your data.

Justas
  • 5,718
  • 2
  • 34
  • 36