Learn R Programming

wrassp (version 0.1.2)

zcrana: zcrana

Description

zcrana function adapted from libassp

Usage

zcrana(listOfFiles = NULL, optLogFilePath = NULL, beginTime = 0,
  centerTime = FALSE, endTime = 0, windowShift = 5, windowSize = 25,
  toFile = TRUE, explicitExt = NULL, outputDirectory = NULL,
  forceToLog = useWrasspLogger)

Arguments

listOfFiles
vector of file paths to be processed by function
optLogFilePath
path to option log file
beginTime
=
centerTime
=
endTime
=
windowShift
= : set analysis window shift to ms (default: 5.0)
windowSize
= : set analysis window size to ms (default: 25.0)
toFile
write results to file (default extension is .zcr)
explicitExt
set if you wish to overwride 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.

Value

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

Details

Analysis of the averages of the short-term positive and negative zero-crossing rates of the signal in . Analysis results will be written to a file with the base name of the input file and extension '.zcr'. Default output is in SSFF binary format (track 'zcr').

Examples

Run this code
# get path to audio file
path2wav <- list.files(system.file("extdata", package = "wrassp"),
                       pattern = glob2rx("*.wav"),
                       full.names = TRUE)[1]

# calculate zcr values
res <- zcrana(path2wav, toFile=FALSE)

# plot zcr values
plot(seq(0,numRecs.AsspDataObj(res) - 1) / rate.AsspDataObj(res) +
       attr(res, 'startTime'),
     res$zcr,
     type='l',
     xlab='time (s)',
     ylab='ZCR values')

Run the code above in your browser using DataLab