pybaselines.utils.gaussian_kernel

pybaselines.utils.gaussian_kernel(window_size, sigma=1.0)[source]

Creates an area-normalized gaussian kernel for convolution.

Parameters:
window_sizeint

The number of points for the entire kernel.

sigmafloat, optional

The standard deviation of the gaussian model.

Returns:
numpy.ndarray, shape (window_size,)

The area-normalized gaussian kernel.

Notes

Return gaus/sum(gaus) rather than creating a unit-area gaussian since the unit-area gaussian would have an area smaller than 1 for window_size < ~ 6 * sigma.