Gaussian convolution window
Return a Gaussian convolution window of length n
.
gaussian(n, a = 1)
n |
Window length, specified as a positive integer. |
a |
Width factor, specified as a positive real scalar. |
The width of the window is inversely proportional to the parameter a
.
Use larger a
for a narrower window. Use larger m
for longer
tails.
w = e^{(-(a*x)^{2}/2 )}
for x <- seq(-(n - 1) / 2, (n - 1) / 2, by = n)
.
Width a is measured in frequency units (sample rate/num samples). It should be f when multiplying in the time domain, but 1/f when multiplying in the frequency domain (for use in convolutions).
Gaussian convolution window, returned as a vector.
Paul Kienzle, pkienzle@users.sf.net.
Conversion to R by Geert van Boxtel G.J.M.vanBoxtel@gmail.com.
g1 <- gaussian(128, 1) g2 <- gaussian(128, 0.5) plot (g1, type = "l", xlab = "Samples", ylab =" Amplitude", ylim = c(0, 1)) lines(g2, col = "red")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.