gaussianSmooth2D: Gaussian smoothing in 2D

View source: R/utilities_math.R

gaussianSmooth2DR Documentation

Gaussian smoothing in 2D

Description

Takes a matrix of numeric values and smoothes it by convolution with a symmetric Gaussian window function.

Usage

gaussianSmooth2D(m, kernelSize = 5, kernelSD = 0.5, plotKernel = FALSE)

Arguments

m

input matrix (numeric, on any scale, doesn't have to be square)

kernelSize

the size of the Gaussian kernel, in points

kernelSD

the SD of the Gaussian kernel relative to its size (.5 = the edge is two SD's away)

plotKernel

if TRUE, plots the kernel

Value

Returns a numeric matrix of the same dimensions as input.

See Also

modulationSpectrum

Examples

s = spectrogram(soundgen(), samplingRate = 16000,
  output = 'original', plot = FALSE)
# image(log(s))
s1 = gaussianSmooth2D(s, kernelSize = 11, plotKernel = TRUE)
# image(log(s1))

soundgen documentation built on Aug. 14, 2022, 5:05 p.m.