Function for plotting formant objects called by praatpicture. Instead of
using this function directly, just use
praatpicture('my_sound_file', frames='formant')
.
formantplot(
fm,
start,
end,
tfrom0 = TRUE,
tgbool = FALSE,
lines = NULL,
focusTierColor = "black",
focusTierLineType = "dotted",
dynamicRange = 30,
freqRange = c(0, 5500),
plotType = "speckle",
color = "black",
ind = NULL,
min_max_only = FALSE,
highlight = NULL,
axisLabel = "Frequency (Hz)",
drawSize = 1,
speckleSize = 1
)
No return values, called internally by praatpicture and sibling functions.
Formant object loaded using rPraat::formant.read
Start time (in seconds) of desired plotted area.
End time (in seconds) of desired plotted area.
Logical; should time on the x-axis run from 0 or from the
original time? Default is TRUE
.
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is FALSE
.
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is NULL
.
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is 'black'
.
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is 'dotted'
.
Dynamic range in dB for producing formant plots.
When a formant plot of plotType='speckle'
is drawn, no formants are
shown in frames with intensity level dynamicRange
below the maximum
intensity. Default is 30
. If set to 0
, all formants are shown.
Vector of two integers giving the frequency range to be
used for producing formant plots. Default is c(0,5500)
.
String giving the type of formant plot to produce;
default is speckle
(a point plot), the only other option is draw
(a line
plot). Alternatively a vector c('draw','speckle')
can be passed, in which
case both are used.
String or vector of strings giving the name(s) of
colors to be used for plotting formants. If one color is provided, all
formants will be plotted in this color. If multiple colors are provided,
different formants will be shown in different colors. Default is 'black'
.
Integer indexing waveform relative to other plot components.
Default is NULL
.
Logical; should only minimum and maximum values be given
on the y-axis? Default is FALSE
. Can also be a logical vector if some but
not all plot components should have minimum and maximum values on the y-axis.
Ignored for TextGrid component.
Named list giving parameters for differential
highlighting of formants based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the start
and end
arguments which must be numbers or numeric
vectors, or using the tier
and label
arguments to highlight based on
information in a plotted TextGrid. Further contains the optional arguments
color
(string or vector of strings, see color
),
drawSize
or speckleSize
(both numeric), and background
(a string specifying a background color).
String giving the name of the label to print along the
y-axis when plotting formants. Default is Frequency (Hz)
.
Number indicating the line width if
plotType
is 'draw'
. Default is 1
. Controls the lwd
argument of
graphics::lines.
Number indicating the point size of if _plotType
is
'speckle'
. Default is 1
. Controls the cex
arguments of
graphics::points.
# Don't use directly
datapath <- system.file('extdata', package='praatpicture')
soundFile <- paste0(datapath, '/1.wav')
praatpicture(soundFile, frames='formant')
Run the code above in your browser using DataLab