Learn R Programming

soundgen (version 1.3.1)

interpolMatrix: Interpolate matrix

Description

Internal soundgen function

Usage

interpolMatrix(m, nr, nc, interpol = c("approx", "spline")[1])

Arguments

m

input matrix of numeric values

nr, nc

target dimensions

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

Details

Performs a chosen type of interpolation (linear or smooth) across both rows and columns of a matrix, in effect up- or downsampling a matrix to required dimensions

Examples

Run this code
# NOT RUN {
m = matrix(1:12 + rnorm(12, 0, .2), nrow = 3)
soundgen:::interpolMatrix(m, nr = 10, nc = 7)
soundgen:::interpolMatrix(m, nr = 10, nc = 7, interpol = 'spline')
soundgen:::interpolMatrix(m, nr = 2, nc = 7)
soundgen:::interpolMatrix(m, nr = 2, nc = 2)
# }

Run the code above in your browser using DataLab