我试图通过使用 filfilt 过滤器来消除信号的趋势(锯齿),但效果不佳。这里的数据
core_3 = pd.read_csv(filename_3, sep=";",header=0,index_col = 0,
parse_dates=True, names='date','temp'], infer_datetime_format=True, dayfirst=True)
core_7 = pd.read_csv(filename_7 ,sep=";",header=0,index_col = 0,
parse_dates=True, names=['date','temp'], infer_datetime_format=True,dayfirst=True)
当我应用巴特沃斯过滤器时
b3, a3 = sg.butter(1, 0.045)
y3 = sg.filtfilt(b3, a3, core_3.temp)
b7, a7 = sg.butter(1, 0.030)
y7 = sg.filtfilt(b7, a7, core_7.temp)
如您所见,对于 3 THz 信号,存在锯齿趋势。在 21:45,信号有一个扰动(我想研究那个扰动)。在 7 THz 时可以清楚地观察到这种扰动。在 3 THz 时观察到锯齿的中断。所以,我需要去趋势或过滤这个信号。我尝试使用filtfilt
过滤器,但我不知道是否更方便使用scipy.detrend
。