praatScriptCentreOfGravity: Generates a script for extracting the CoG, for use with...

View source: R/praatScriptCentreOfGravity.R

praatScriptCentreOfGravityR Documentation

Generates a script for extracting the CoG, 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 one or more spectral centre of gravity (CoG) measurements.

Usage

praatScriptCentreOfGravity(powers = c(2), spectrum.fast = TRUE)

Arguments

powers

A vector of numbers specifying which powers to query for to extract, e.g. c(1.0,2.0).

spectrum.fast

Whether to use the 'fast' option when creating the spectrum object to query .

Value

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

See Also

processWithPraat

praatScriptFormants

praatScriptIntensity

praatScriptPitch

praatScriptFastTrack

Examples

## 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 centres of gravity for all matches
cog <- processWithPraat(
              labbcat.url,
              results$MatchId, results$Target.segment.start, results$Target.segment.end,
              praatScriptCentreOfGravity(powers=c(1.0,2.0)))

## End(Not run)

nzilbb.labbcat documentation built on July 26, 2023, 6:08 p.m.