How to remove a range of frequencies from a time series using the Lanczos filter?
8 views (last 30 days)
I would like to use this Lanczos filter code to remove the 3-9 day time scale from a time series. My data is at a 12-hourly resolution. So I computed the cut-off frequencies for the low-pass and high-pass filters as:
time_series = .5 + 1.5*rand(700,1) % dummy time series
Cf_lowpass = 3/(12/24)
Cf_highpass = 9/(12/24)
From here I can apply the filter (both low and high-pass). However, I am not sure if that is the right way to compute the cut-off frequencies. Also, after getting the low-pass and high-pass filtered time series, do I add or subtract them in order to remove the 3-9 time scale? Thanks.
William Rose on 8 Apr 2022
I recommend using the day as the unit of time. A three day time scale corresponds to a frequency of (1/3) per day, etc. Then you have:
fs=2; %sampling rate (units=1/day)
fco1=1/3; %cutoff frequency 1 (units=1/day)
fco2=1/9; %cutoff frequency 2 (units=1/day)
Compute normalized frequencies (normalize by the Nyquist frequency):
fn1=fco1/(fs/2); %normalized cutoff frequency 1
fn2=fco2/(fs/2); %normalized cutoff frequency 2
That should work.