I could not figure out which of those signals you want to filter, so I arbitrarily chose ‘t1’ and ‘y1’.
They are not consistently sampled, so I used the resample function to correct that. This will eliminate the high-frequency noise, however I was not able to eliminate the baseline offset using a bandpass filter, since I do not know what constitutes the signal and what constitutes the baseline drift. I leave that to you to experiment with, using:
[yfilt,df] = bandpass(xr, [0.005 0.04], Fs, 'ImpulseResponse','iir');
Experiment with the lower passband frequency to get the result you want.
Try this —
[xr,Ttr] = resample(x,Tt,4.5);
X = fftshift(fft(xr-mean(xr))/L);
Fv2 = linspace(-Fn, Fn, L);
[yfilt,df] = lowpass(xr, 0.04, Fs, 'ImpulseResponse','iir');
I cannot run this in the online application since I cannot load .mat files in it.