Skip to contents

This function takes an SSFF object or a path to a file containing one, reads the content of a fm.field and bw.field and uses Praat to construct a Formant object and store it in a file. The function's primary purpose is to allow the user to re-use already computed, and possibly adjusted, formant frequency and bandwidth tracks in subsequent calculations in for instance praat_sauce.

Usage

ssffToFormant(
  inData,
  outputPath = NULL,
  fm.field = "fm",
  bw.field = "bw",
  start = 0,
  end = 0,
  windowShift = 5,
  nominalF1 = 500,
  zero.threshold = 0,
  dump.script = FALSE,
  soundFileDuration = NULL
)

Arguments

inData

An SSFF formant track object, or the full path to one.

outputPath

The directory where the Formant file should be stored.

fm.field

The field / column in the SSFF object where the formant frequency tracks are stored. The field may be indicated by the name of it, or its number. Often, the SSFF object will contain formant frequency values in the first field and bandwidths in the second, so the user could also give field=1 as an argument.

bw.field

The field / column in the SSFF object where the formant banwidth tracks are stored. The field may be indicated by the name of it, or its number. Often, the SSFF object will contain formant frequency values in the first field and bandwidths in the second, so the user could also give field=2 as an argument.

start

An optional start time (in s) for a part of the SSFF formant track which should be converted to a Formant object.

end

An optional end time (in s) for a part of the SSFF formant track which should be converted to a Formant object.

windowShift

The analysis window of the formant track (in ms).

nominalF1

An assumed F$_1$ value for the created Formant object.

zero.threshold

The threshold below which formant frequencies or bandwidths should be considered as zero.

dump.script

If TRUE, the Praat script that is used to create a Pitch object will be dumped to a file for debuging or inspection. The file will be placed in the same directory as the output Formant file, but with a '.praat'. extension.

soundFileDuration

An explicit duration that will be set for the created Formant object. If not explicitly supplied, the duration of the SSFF object track will be used instead.

Details

The user may optionally compute a Formant object for only parts of the SSFF formant track if the track is stored in a file. An ability to subset an SSFF object directly is currently not implemented.

Please note that the process of converting formant tracks from SSFF is very slow, as shown by the microbenchmark output below which indicates that constructing an Formant object using the current strategy takes about 353 times the time it takes to simply compute the formant tracks.

Unit: relative
expr         min          lq        mean      median          uq         max neval
read      1.0000      1.0000      1.0000      1.0000      1.0000      1.0000     1
forest    705.8529    705.8529    705.8529    705.8529    705.8529    705.8529     1
Formant 249267.5829 249267.5829 249267.5829 249267.5829 249267.5829 249267.5829     1