Learn R Programming

wrassp (version 0.1.2)

ksvF0: ksvF0

Description

ksvF0 function adapted from libassp

Usage

ksvF0(listOfFiles = NULL, optLogFilePath = NULL, beginTime = 0,
  endTime = 0, windowShift = 5, gender = "u", maxF = 600, minF = 50,
  minAmp = 50, maxZCR = 3000, 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
=
endTime
set end of analysis interval to
windowShift
= : set frame shift to ms (default: 5.0)
gender
= set gender-specific F0 ranges; may be: "f[emale]" (80.0 - 640.0 Hz) "m[ale]" (50.0 - 400.0 Hz) "u[nknown]" (default; 50.0 - 600.0 Hz)
maxF
= : set maximum F0 value to Hz (default: 500.0)
minF
= : set minimum F0 value to Hz (default: 50.0)
minAmp
= : set amplitude threshold for voiced samples to (default: 100)
maxZCR
maximum zero crossing rate in Hz (for voicing detection)
toFile
write results to file (default extension is .f0)
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

F0 analysis of the signal in using the K. Schaefer-Vincent periodicity detection algortithm. Analysis results will be written to a file with the base name of the input file and extension '.f0'. Default output is in SSFF binary format (track 'F0'). Optionally, location and type of the signal extrema on which the F0 data are based, may be stored in a label file. The name of this file will consist of the base name of the F0 file and the extension '.prd'.

See Also

mhsF0 for an alternative pitch tracker

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 fundamental frequency contour
res <- ksvF0(path2wav, toFile=FALSE)

# plot the fundamental frequency contour
plot(seq(0,numRecs.AsspDataObj(res) - 1) / rate.AsspDataObj(res) +
       attr(res, 'startTime'),
     res$F0,
     type='l',
     xlab='time (s)',
     ylab='F0 frequency (Hz)')

Run the code above in your browser using DataLab