frites.utils.savgol_filter#
- frites.utils.savgol_filter(x, h_freq, axis=None, sfreq=None, polyorder=5, verbose=None)[source]#
Filter the data using Savitzky-Golay polynomial method.
This function is an adaptation of the mne-python one for xarray.DataArray.
- Parameters
- xnumpy:array_like
Multidimensional array or DataArray
- h_freq
python:float
Approximate high cut-off frequency in Hz. Note that this is not an exact cutoff, since Savitzky-Golay filtering is done using polynomial fits instead of FIR/IIR filtering. This parameter is thus used to determine the length of the window
- axis
python:int
,python:str
|python:None
Position of the time axis. Can either be an integer when x is a NumPy array or a string (e.g ‘times’) when using a DataArray
- polyorder
python:int
| 5 Polynomial order
- Returns
- x_filtnumpy:array_like
Filtered data
See also
Notes
- For Savitzky-Golay low-pass approximation, see: