firwin (pyleoclim.utils.filter.firwin)
- pyleoclim.utils.filter.firwin(ys, fc, numtaps=None, fs=1, pad='reflect', window='hamming', reflect_type='odd', params=(1, 0, 0), padFrac=0.1, **kwargs)[source]
Applies a Finite Impulse Response filter design with window method and frequency fc, with padding
- Parameters
ys (numpy array) – Timeseries
fc (float or list) – cutoff frequency. If scalar, it is interpreted as a low-frequency cutoff (lowpass) If fc is a list, it is interpreted as a frequency band (f1, f2), with f1 < f2 (bandpass)
numptaps (int) – Length of the filter (number of coefficients, i.e. the filter order + 1). numtaps must be odd if a passband includes the Nyquist frequency. If None, will use the largest number that is smaller than 1/3 of the the data length.
fs (float) – sampling frequency
window (str or tuple of string and parameter values, optional) – Desired window to use. See scipy.signal.get_window for a list of windows and required parameters.
pad (string) – Indicates if padding is needed. - ‘reflect’: Reflects the timeseries - ‘ARIMA’: Uses an ARIMA model for the padding - None: No padding.
params (tuple) – model parameters for ARIMA model (if pad = True)
padFrac (float) – fraction of the series to be padded
kwargs (dict) – a dictionary of keyword arguments for scipy.signal.firwin
- Returns
yf – filtered array
- Return type
array
See also
scipy.signal.firwin
FIR filter design using the window method