# Avoiding transients during filtering: Padding or Gustafsson's method?

I'm pretty uneducated when it comes to filtering, more of a stats guy, but I have to bandpass some signals and after a bunch of reading today I understand that the scipy.signal.sosfiltfilt function seems to be a gold standard. One thing I notice is that it doesn't provide the option to use the Gustafsson method for reducing transients as does regular ol' scipy.signal.filtfilt does. Which led me to wonder, is there much to argue for using the Gustafsson method over simple padding?

• I would simply extrapolate the signal by $P$ samples in the front and back by fitting a polynomial function, and then remove the extrapolated part after filtering. Zero-padding should also work, but it also introduced abrupt shifts. – Maxtron Aug 21 '19 at 18:57