frites.utils.kernel_smoothing#

frites.utils.kernel_smoothing(x, kernel, axis=- 1)[source]#

Apply a kernel smoothing using the fftconvolve.

Parameters
xnumpy:array_like

Array to smooth. It can also be an instance of xarray.DataArray.

kernelnumpy:array_like

Kernel to use for smoothing (e.g kernel=np.ones((10,)) for a moving average or np.hanning(10))

axispython:int, python:str | -1

The axis to use for smoothing (typically the time-axis). If the x input is a DataArray, axis can be a string (e.g axis=’times’)

Returns
xnumpy:array_like

The smoothed array with the same shape and type as the input x.

See also

savgol_filter