getIntegerRandomWalk: Discrete random walk

Description Usage Arguments Details Value Examples

View source: R/utilities_math.R

Description

Internal soudgen function.

Usage

1
getIntegerRandomWalk(rw, nonlinBalance = 50, minLength = 50, plot = FALSE)

Arguments

rw

a random walk generated by getRandomWalk (expected range 0 to 100)

nonlinBalance

a number between 0 to 100: 0 = returns all zeroes; 100 = returns all twos

minLength

the mimimum length of each epoch

plot

if TRUE, plots the random walk underlying nonlinear regimes

Details

Takes a continuous random walk and converts it to continuous epochs of repeated values 0/1/2, each at least minLength points long. 0/1/2 correspond to different noise regimes: 0 = no noise, 1 = subharmonics, 2 = subharmonics and jitter/shimmer.

Value

Returns a vector of integers (0/1/2) of the same length as rw.

Examples

1
2
3
4
5
rw = soundgen:::getRandomWalk(len = 100, rw_range = 100, rw_smoothing = .2)
r = soundgen:::getIntegerRandomWalk(rw, nonlinBalance = 75,
                                     minLength = 10, plot = TRUE)
r = soundgen:::getIntegerRandomWalk(rw, nonlinBalance = 15,
                                     minLength = 10, plot = TRUE)

tatters/soundgen_beta documentation built on May 14, 2019, 9 a.m.