afdiff | R Documentation |
afdiff function adapted from libassp
afdiff(
listOfFiles = NULL,
optLogFilePath = NULL,
computeBackwardDifference = FALSE,
computeCentralDifference = FALSE,
channel = 1,
toFile = TRUE,
explicitExt = NULL,
outputDirectory = NULL,
forceToLog = useWrasspLogger,
verbose = TRUE
)
listOfFiles |
vector of file paths to be processed by function |
optLogFilePath |
path to option log file |
computeBackwardDifference |
compute backward difference (s'n = sn - sn-1) (default: forward difference s'n = sn+1 - sn) |
computeCentralDifference |
compute central/interpolated/3-point difference |
channel |
= |
toFile |
write results to file (default extension is .d+(extensionsOfAudioFile)) |
explicitExt |
set if you wish to override the default extension |
outputDirectory |
directory in which output files are stored. Defaults to NULL, i.e. the directory of the input files |
forceToLog |
is set by the global package variable useWrasspLogger. This is set to FALSE by default and should be set to TRUE is logging is desired. |
verbose |
display infos & show progress bar |
Computes the first difference of the signal in the audio-
formatted file(s)
nrOfProcessedFiles or if only one file to process return AsspDataObj of that file
Raphael Winkelmann
Lasse Bombien
# get path to audio file
path2wav <- list.files(system.file("extdata", package = "wrassp"),
pattern = glob2rx("*.wav"),
full.names = TRUE)[1]
# compute the first forward difference of the signal
res <- afdiff(path2wav, toFile=FALSE)
# plot samples
# (only plot every 10th element to accelerate plotting)
plot(seq(0,numRecs.AsspDataObj(res) - 1, 10) / rate.AsspDataObj(res),
res$audio[c(TRUE, rep(FALSE,9))],
type='l',
xlab='time (s)',
ylab='Audio samples')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.