How to use bandpass filter (say 30-60 day) with daily timeseries data (for 365 days) especially in MATLAB? How many data points are going to be reduced after filtering? Any suggestion would be greatly appreciated.
I am not sure if I got your question right but if you want to bandpass your data for frequencies where one cycle corresponds to 30 and 60 days and you collected data for 365 days this code is what you need in Matlab. Note that depending on your task a butterworth filter might not be the right/best one.
highcut = (365/30)/(365/2); %define highcut frequency 30 days in radians
lowcut =(365/60)/(365/2); %define lowcut frequency 60 days in radians
[b,a] = butter(6,[lowcut highcut]); %create 6th order butterworth band pass filter
freqz(b,a); %look at your filter characteristics
FilteredData = filtfilt(b,a,DataIn); %filter Data without phase shift
This will not reduce the data points however be careful interpreting filtered signals close to the beginning and ending of the dataset.
You can't filter frequencies fast then the half of your sampling rate. This is called Nyquist freqency and is always the half of the originally sampled freuqency. In your case 182.5 days instead of 365.