wiggleGC: Wiggle glottal cycles

View source: R/soundgen_utilities.R

wiggleGCR Documentation

Wiggle glottal cycles

Description

Internal soundgen function

Usage

wiggleGC(dep, len, nGC, pitch_per_gc, rw, effect_on)

Arguments

dep

a vector of any length specifying the strengh of applied effect as 2 ^ rnorm(..., 0, dep))

len

a vector of any length specifying the period of applied effect in ms

nGC

number of glottal cycles

pitch_per_gc

vector of length nGC specifying pitch per glottal cycle, Hz

rw

vector of length nGC specifying a random walk around 1 to multiply the effect with

effect_on

vector of length nGC specifying glottal cycles to which the effect should be applied (0 = off, 1 = on)

Details

Helper function for preparing a vector of multiplication factors for adding jitter and shimmer per glottal cycle. Generates random anchors for each jitter/shimmer period and draws a smooth contour between them by spline interpolation.

Examples

plot(soundgen:::wiggleGC(dep = 5 / 12, len = c(3, 50), nGC = 100,
              pitch_per_gc = rnorm(100, 150, 10),
              rw = rep(1, 100), effect_on = rep(1, 100)),
     type = 'b')
plot(soundgen:::wiggleGC(dep = 5 / 12, len = c(3, 50), nGC = 100,
              pitch_per_gc = rnorm(100, 150, 10),
              rw = rep(1, 100),
              effect_on = c(rep(1, 30), rep(0, 20), rep(1, 50))),
     type = 'b')
plot(soundgen:::wiggleGC(dep = c(1/12, 10/12), len = c(3, 50), nGC = 100,
              pitch_per_gc = rnorm(100, 150, 10),
              rw = rep(1, 100), effect_on = rep(1, 100)),
     type = 'b')

soundgen documentation built on Sept. 29, 2023, 5:09 p.m.