I have a signal, shown in the attachment (blue one). As you can see that the latter part of my signal has a higher dc offset. I want to bring the signal into the same level. I have tried eliminate the low frequency signal by using FFT (I FFT the signal, then set the low frequency element to be 0, then returned it by IFFT), but the result that I get is shown in red color. I am open to any suggestion and any python code is very appreciated.
Additional info:
sampling frequency = 100 Hz
Low cutoff frequency = 0.05 Hz