For the following signal, I am trying to remove the gradual positive drift but retain the spikes using a high pass filter.
I am aware that I can use implement a high pass filter using difference equation. I am familiar with convolution, and I have implemented simple low pass filter using moving average and first order recursive filter in the past. But I am not sure how to use difference equation to implement a high order filter that fits this particular problem. I am looking for a simple starting point using difference equation that I can tweak around, and then maybe move toward something a bit more complicated.
Any starting point would be appreciated.
I've tried difference equation $y[n] = \alpha y[n-1] + x[n] - x[n-1]$ posted on How to remove or filter the drift problem in measured Strain signal?, but I do not get the expected result. The signal can be found here as a Python list, and I chose $\alpha$ value to be 0.8.