interp_mc {voice} | R Documentation |
Interpolate vectors using multicore
Description
Interpolate vectors using multicore
Usage
interp_mc(
y,
compact.to,
drop.zeros = FALSE,
to.data.frame = FALSE,
round.off = NULL,
weight = NULL,
mc.cores = 1
)
Arguments
y |
A numeric vector, matrix or data frame. |
compact.to |
Proportion of remaining points after compression. If equals to 1 and keep.zeros = TRUE, the original vector is presented. |
drop.zeros |
Logical. Drop repeated zeros? Default: |
to.data.frame |
Logical. Convert to data frame? Default: |
round.off |
Number of decimal places of the interpolated |
weight |
Vector of weights with same length of |
mc.cores |
The number of cores to mclapply. Default: |
Value
A list of x and y convoluted values with length near to compact.to*length(y)
.
See Also
rm0
, interp
, interp_df
Examples
library(voice)
# Same result of interp() function if x is a vector
interp(1:100, compact.to = 0.1, drop.zeros = TRUE, to.data.frame = FALSE)
interp_mc(1:100, compact.to = 0.1, drop.zeros = TRUE, to.data.frame = FALSE)
interp(1:100, compact.to = 0.1, drop.zeros = TRUE, to.data.frame = TRUE)
interp_mc(1:100, compact.to = 0.1, drop.zeros = TRUE, to.data.frame = TRUE)
# get path to audio file
path2wav <- list.files(system.file('extdata', package = 'wrassp'),
pattern = glob2rx('*.wav'), full.names = TRUE)
# getting Media data frame
M <- voice::extract_features(dirname(path2wav), mc.cores = 1, verbose = FALSE)
M.num <- M[,-(1:3)]
nrow(M.num)
cm1 <- interp_mc(M.num, compact.to = 0.1, drop.zeros = TRUE,
to.data.frame = FALSE, mc.cores = 1)
names(cm1)
lapply(cm1$f0, length)
[Package voice version 0.4.21 Index]