soundgen (version 1.5.0)

getSigmoid: 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 freq

spikiness

the larger, the more quickly the shape of filter leaves; numeric vector of length 1 or the same length as freq sine-like approximation as shape deviates from 0

Value

Returns a vector of length len and range from 0 to 1

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.

Examples

Run this code
# NOT RUN {
for (shape in c(0, -.1, .1, -1, 1)) {
  s = soundgen:::getSigmoid(shape = shape, len = 1000, samplingRate = 500,  freq = 2)
  plot(s, type = 'l',  main = paste('shape =', shape), xlab = '', ylab = '')
}
# }

Run the code above in your browser using DataLab