Learn R Programming

nzilbb.labbcat (version 1.0-1)

praatScriptPitch: Generates a script for extracting pitch, for use with processWithPraat.

Description

This function generates a Praat script fragment which can be passed as the praat.script parameter of processWithPraat, in order to extract pitch information.

Usage

praatScriptPitch(
  get.mean = TRUE,
  get.minimum = FALSE,
  get.maximum = FALSE,
  time.step = 0,
  pitch.floor = 60,
  max.number.of.candidates = 15,
  very.accurate = FALSE,
  silence.threshold = 0.03,
  voicing.threshold = 0.5,
  octave.cost = 0.01,
  octave.jump.cost = 0.35,
  voiced.unvoiced.cost = 0.35,
  pitch.ceiling = 500,
  pitch.floor.male = 30,
  voicing.threshold.male = 0.4,
  pitch.ceiling.male = 250,
  gender.attribute = "participant_gender",
  value.for.male = "M",
  window.length = 0.025,
  preemphasis.from = 50
)

Arguments

get.mean

Extract the mean pitch for the sample.

get.minimum

Extract the minimum pitch for the sample.

get.maximum

Extract the maximum pitch for the sample.

time.step

Step setting for praat command

pitch.floor

Minimum pitch (Hz) for all speakers, or for female speakers, if pitch.floor.male is also specified.

max.number.of.candidates

Maximum number of candidates setting for praat command

very.accurate

Accuracy setting for praat command

silence.threshold

Silence threshold setting for praat command

voicing.threshold

Voicing threshold (Hz) for all speakers, or for female speakers, if voicing.threshold.male is also specified.

octave.cost

Octave cost setting for praat command

octave.jump.cost

Octave jump cost setting for praat command

voiced.unvoiced.cost

Voiced/unvoiced cost setting for praat command

pitch.ceiling

Maximum pitch (Hz) for all speakers, or for female speakers, if pitch.floor.male is also specified.

pitch.floor.male

Minimum pitch (Hz) for male speakers.

voicing.threshold.male

Voicing threshold (Hz) for male speakers.

pitch.ceiling.male

Maximum pitch (Hz) for male speakers.

gender.attribute

Name of the LaBB-CAT participant attribute that contains the participant's gender - normally this is "participant_gender".

value.for.male

The value that the gender.attribute has when the participant is male.

window.length

Window length in seconds.

preemphasis.from

Pre-emphasis from (Hz)

Value

A script fragment which can be passed as the praat.script parameter of processWithPraat

See Also

processWithPraat

praatScriptFormants

praatScriptCentreOfGravity

praatScriptIntensity

praatScriptFastTrack

Examples

Run this code
# NOT RUN {
## define the LaBB-CAT URL
labbcat.url <- "https://labbcat.canterbury.ac.nz/demo/"

## Perform a search
results <- getMatches(labbcat.url, list(segment="I"))

## Get pitch mean, max, and min for all matches
pitch <- processWithPraat(
              labbcat.url,
              results$MatchId, results$Target.segment.start, results$Target.segment.end,
              praatScriptPitch(get.mean=TRUE, get.minimum=TRUE, get.maximum=TRUE))
# }

Run the code above in your browser using DataLab