Why linear trend should be removed before filtering?

Dear all,

Here is a conversation long time ago on the necessity of removing linear trend before filtering, if we think linear trend is a kind of noise. Hope this information is helpful for some of us!

P.S., whether linear trend is meaningful or not, @WANG Xin-Di is going to have a nice work on that issue. Hopefully we can have it published in the near future.

Here is a very simple example:



Signal:

y=sin(4*2*pi*t)+sin(2*2*pi*t)+sin(0.8*2*pi*t)+sin(0.5*2*pi*t)+sin(0.2*2*pi*t);

temporal domain:
image.png

 
frequency domain:
image.png

 
 
If the signal with a linear trend:
y2=sin(4*2*pi*t)+sin(2*2*pi*t)+sin(0.8*2*pi*t)+sin(0.5*2*pi*t)+sin(0.2*2*pi*t)+t;

 
temporal domain:
image.png
frequency domain:
image.png
 
 
If detrend first and then bandpass filter (0.01-1Hz):
temporal domain:
image.png
frequency domain:
image.png
 
 
However, If bandpass filter (0.01-1Hz) first and then detrend:
 
temporal domain:
image.png
frequency domain:
image.png

 
In conclusion, temporal filtering can not remove the linear trend very well (linear trend is not a single slow frequency component stuff and will leak and influence other band). So my opinion is detrend first and then do temporal filtering.
 
Best,
 
Chao-Gan