Learn R Programming

soundgen (version 1.7.0)

drawContour: Draw contour

Description

Internal soundgen function

Usage

drawContour(
  len,
  anchors,
  interpol,
  valueFloor,
  valueCeiling,
  duration_ms = 500,
  loessSpan = NULL
)

Arguments

len

the required length of the output contour. If NULL, it will be calculated based on the maximum time value (in ms) and samplingRate

anchors

a numeric vector of values or a list/dataframe with one column (value) or two columns (time and value). achors$time can be in ms (with len=NULL) or in arbitrary units, eg 0 to 1 (with duration determined by len, which must then be provided in ms). So anchors$time is assumed to be in ms if len=NULL and relative if len is specified. anchors$value can be on any scale.

interpol

the method of smoothing envelopes based on provided anchors: 'approx' = linear interpolation, 'spline' = cubic spline, 'loess' (default) = polynomial local smoothing function. NB: this does not affect contours for "noise", "glottal", and the smoothing of formants

valueFloor

lowser/upper bounds for the contour

valueCeiling

lowser/upper bounds for the contour

duration_ms

contour duration, ms

loessSpan

parameter that controlled the amount of smoothing when interpolating pitch etc between anchors; passed on to loess, so only has an effect if interpol = 'loess'

Details

The core part of getSmoothContour() that actually performs the interpolation between anchors.