
Last chance! 50% off unlimited learning
Sale ends in
Internal soundgen function.
morphDF(
a,
b,
nMorphs = 5,
method = c("smooth", "perAnchor")[2],
lenSmooth = 50,
matchIdx = NULL,
plot = F,
...
)
A list of length nMorphs containing anchor dataframes for morphing
dataframes to morph
length of morphing sequence
morphing method. 'smooth' equalizes contour lengths and takes a weighted mean. 'perAnchor' is a more sophisticated algorithm that attempts to match individual anchors
the length of curves generated from anchors prior to averaging (only applicable if method is 'smooth')
manual override of anchor matching: if you have a better idea of which anchors should morph into each other, specify
if TRUE, plots the morphing sequence of anchors
other graphical pars passed on to plot
Morphs two dataframes of anchors, with two columns and at least two rows in each.
a = data.frame(time=c(0, .2, .9, 1), value=c(100, 110, 180, 110))
b = data.frame(time=c(0, .3, .5, .8, 1), value=c(300, 220, 190, 400, 350))
plot (a, type = 'b', ylim = c(0, 500))
points (b, type = 'b', col = 'blue')
m = soundgen:::morphDF(a, b, nMorphs = 15, method = 'smooth', plot = TRUE)
m = soundgen:::morphDF(a, b, nMorphs = 15, method = 'perAnchor', plot = TRUE)
m = soundgen:::morphDF(a = data.frame(time = c(0, 1), freq = c(700, 700)),
b = data.frame(time = c(0, 1), freq = c(400, 600)),
nMorphs = 5, method = 'perAnchor', plot = TRUE)
m = soundgen:::morphDF(a = data.frame(time = c(-30, 120, 350), value = c(-120, 10, -120)),
b = data.frame(time = c(50, 500), value = c(0, -30)),
nMorphs = 10, method = 'perAnchor', plot = TRUE)
m = soundgen:::morphDF(a = data.frame(time = c(-50, 1214), value = c(-50, -70)),
b = data.frame(time = c(0, 49, 256), value = c(-120, 10, -120)),
nMorphs = 8, method = 'perAnchor', plot = TRUE)
Run the code above in your browser using DataLab