Skip to contents

This function takes a sound file and computes f$_0$ and an estimate of pitch using the "A robust algorithm for pitch tracking" (RAPT) algorithm (Talkin and Kleijn 1995) .

Usage

rapt(
  listOfFiles,
  beginTime = 0,
  endTime = 0,
  windowShift = 5,
  minF = 70,
  maxF = 200,
  voicing.threshold = 0.3,
  explicitExt = "swi",
  outputDirectory = NULL,
  toFile = TRUE,
  conda.env = NULL
)

Arguments

listOfFiles

A vector of file paths to wav files.

beginTime

The start time of the section of the sound file that should be processed.

endTime

The end time of the section of the sound file that should be processed.

windowShift

The measurement interval (frame duration), in seconds.

minF

Candidate f0 frequencies below this frequency will not be considered.

maxF

Candidates above this frequency will be ignored.

voicing.threshold

Voice/unvoiced threshold. Default is 0.3.

explicitExt

the file extension that should be used.

outputDirectory

set an explicit directory for where the signal file will be written. If not defined, the file will be written to the same directory as the sound file.

toFile

write the output to a file? The file will be written in outputDirectory, if defined, or in the same directory as the soundfile.

conda.env

The name of the conda environment in which Python and its required packages are stored. Please make sure that you know what you are doing if you change this.

Value

An SSFF track object containing two tracks (f0 and pitch) that are either returned (toFile == FALSE) or stored on disk.

Details

The implementation of RAPT in the Speech Signal Processing Toolkit (SPTK) (Group and others 2017) is used, and called via its Python interface and the retiulate R package to compute the signal track. Therefore, the user will have to make sure that a python environment is present and can be attached by the reticulate. An anaconda environment is recommended, and can set up by the user by a setup procedure that involve at least these commands:

conda create conda create --prefix -n pysuperassp python=3.8 
conda activate pysuperassp
pip install librosa
pip install pysptk
#Not used by this function but by other functions in this package
pip install pyreaper 

to make the functionality that this function requires available.

References

Group SW, others (2017). “Speech Signal Processing Toolkit (SPTK), 2017.” http://sp-tk.sourceforge. net.

Talkin D, Kleijn WB (1995). “A robust algorithm for pitch tracking (RAPT).” Speech coding and synthesis, 495, 518.