function wn=cutoff(sp,cop) %CUTOFF compute the cutoff frequency for time-series filtering. % % Input: sp - sampling period in hours % cop - cutoff period in hours % % Output: wn - cutoff frequency in rad/sec % % Call as: wn=cutoff(sp,cop); % % wn can be input into BUTTER to build a digital Butterworth filter. % sf = 2*pi/(sp*3600); cof = 2*pi/(cop*3600); wn = cof/(sf/2);