Learn R Programming

wrassp (version 0.1.2)

mhsF0: mhsF0

Description

mhsF0 function adapted from libassp

Usage

mhsF0(listOfFiles = NULL, optLogFilePath = NULL, beginTime = 0,
  centerTime = FALSE, endTime = 0, windowShift = 5, gender = "u",
  maxF = 600, minF = 50, minAmp = 50, minAC1 = 0.25, minRMS = 18,
  maxZCR = 3000, minProb = 0.52, plainSpectrum = FALSE, 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)
gender
= set gender-specific pitch ranges; may be: "f[emale]" (80.0 - 600.0 Hz) "m[ale]" (50.0 - 375.0 Hz) "u[nknown]" (default; 50.0 - 600.0 Hz)
maxF
= : set maximum pitch value to Hz (default: 500.0)
minF
= : set minimum pitch value to Hz (default: 50.0 minimum: 25.0)
minAmp
= : minimum signal amplitude (default: 50)
minAC1
= : minimum 1st correlation coefficient (default: 0.250)
minRMS
= : minimum RMS amplitude in dB (default: 18.0)
maxZCR
= : maximum zero crossing rate in Hz (default: 3000)
minProb
= : minimum quality value of F0 fit (default: 0.520)
plainSpectrum
use plain rather than masked power spectrum
toFile
write results to file (default extension is .pit)
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

Pitch analysis of the speech signal in using Michel's/Modified Harmonic Sieve algorithm. Analysis results will be written to a file with the base name of the input file and extension '.pit'. Default output is in SSFF binary format (track 'pitch').

See Also

ksvF0 for an tracking the fundamental frequency

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 <- mhsF0(path2wav, toFile=FALSE)

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

Run the code above in your browser using DataLab