getSigmoid {soundgen} | R Documentation |
Get sigmoid filter
Description
Internal soundgen function.
Usage
getSigmoid(len, samplingRate = 16000, freq = 5, shape = 0, spikiness = 1)
Arguments
len |
the length of output vector |
samplingRate |
the sampling rate of the output vector, Hz |
freq |
the frequency of amplitude modulation, Hz (numeric vector) |
shape |
0 = ~sine, -1 = clicks, +1 = notches (NB: vice versa in
soundgen!); numeric vector of length 1 or the same length as |
spikiness |
amplifies the effect of the "shape" parameter;
numeric vector of length 1 or the same length as |
Details
Produces a filter for amplitude modulation ranging from clicks to approximately a sine wave to reversed clicks (small episodes of silence). The filter is made from concatenated sigmoids and their mirror reflections.
Value
Returns a vector of length len
and range from 0 to 1
Examples
par(mfrow = c(3, 2))
for (shape in c(0, -.1, .1, .5, -1, 1)) {
s = soundgen:::getSigmoid(shape = shape, len = 1000, samplingRate = 500, freq = 2)
plot(s, type = 'l', main = paste('shape =', shape), xlab = '', ylab = '')
}
par(mfrow = c(1, 1))
par(mfrow = c(3, 2))
for (shape in c(0, -.1, .1, .5, -1, 1)) {
s = soundgen:::getSigmoid(shape = shape, len = 1000, samplingRate = 500, freq = 2,
spikiness = 3)
plot(s, type = 'l', main = paste('shape =', shape), xlab = '', ylab = '')
}
par(mfrow = c(1, 1))
[Package soundgen version 2.7.3 Index]