convolve

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

README

convolve

convolve.Slice32 operates on []float32 data, convolving data with a kernel, while convolve.Slice64 operates on []float64 data.

SmoothTable operates on an entire table.Table set of columns.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GaussianKernel32

func GaussianKernel32(khalf int, sigma float32) []float32

GaussianKernel32 returns a normalized gaussian kernel for smoothing with given half-width and normalized sigma (actual sigma = khalf * sigma). A sigma value of .5 is typical for smaller half-widths for containing most of the gaussian efficiently -- anything lower than .33 is inefficient -- generally just use a lower half-width instead.

func GaussianKernel64

func GaussianKernel64(khalf int, sigma float64) []float64

GaussianKernel64 returns a normalized gaussian kernel with given half-width and normalized sigma (actual sigma = khalf * sigma) A sigma value of .5 is typical for smaller half-widths for containing most of the gaussian efficiently -- anything lower than .33 is inefficient -- generally just use a lower half-width instead.

func Slice32

func Slice32(dest *[]float32, src []float32, kern []float32) error

Slice32 convolves given kernel with given source slice, putting results in destination, which is ensured to be the same size as the source slice, using existing capacity if available, and otherwise making a new slice. The kernel should be normalized, and odd-sized do it is symmetric about 0. Returns an error if sizes are not valid. No parallelization is used -- see Slice32Parallel for very large slices. Edges are handled separately with renormalized kernels -- they can be clipped from dest by excluding the kernel half-width from each end.

func Slice64

func Slice64(dest *[]float64, src []float64, kern []float64) error

Slice64 convolves given kernel with given source slice, putting results in destination, which is ensured to be the same size as the source slice, using existing capacity if available, and otherwise making a new slice. The kernel should be normalized, and odd-sized do it is symmetric about 0. Returns an error if sizes are not valid. No parallelization is used -- see Slice64Parallel for very large slices. Edges are handled separately with renormalized kernels -- they can be clipped from dest by excluding the kernel half-width from each end.

func SmoothTable

func SmoothTable(src *table.Table, khalf int) *table.Table

SmoothTable returns a cloned table with each of the floating-point columns in the source table smoothed over rows. khalf is the half-width of the Gaussian smoothing kernel, where larger values produce more smoothing. A sigma of .5 is used for the kernel.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL