Skip to contents

afdiff function adapted from libassp

Usage

afdiff(
  listOfFiles = NULL,
  optLogFilePath = NULL,
  computeBackwardDifference = FALSE,
  computeCentralDifference = FALSE,
  channel = 1,
  toFile = TRUE,
  explicitExt = NULL,
  outputDirectory = NULL,
  forceToLog = useWrasspLogger,
  verbose = TRUE
)

Arguments

listOfFiles

vector of file paths to be processed by function

optLogFilePath

path to option log file

computeBackwardDifference

compute backward difference (s'[n] = s[n] - s[n-1]) (default: forward difference s'[n] = s[n+1] - s[n])

computeCentralDifference

compute central/interpolated/3-point difference

channel

= <num>: for multi-channel input files: extract and differentiate channel <num> (1 <= <num> <= 8 default: channel 1)

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

Value

nrOfProcessedFiles or if only one file to process return AsspDataObj of that file

Details

Computes the first difference of the signal in the audio- formatted file(s) <listOfFiles>. The differentiated signal will be written to a file with the base name of the input file and an extension consisting of '.d', followed by the extension of the input file. The format of the output file will be the same as that of the input file. Differentiation can improve results on F0 analysis of e.g. EGG signals because it removes a DC offset, attenuates very low frequency components - and in the case of central differentiation also very high ones - and enhances the moment of glottal closure.

See also