Learn R Programming

praatpicture (version 1.5.0)

intensity_overlay: Overlay intensity on plot frame

Description

Function for overlaying intensity contour on another plot frame, viz. the waveform or spectrogram. Instead of using this function directly, just use praatpicture('my_sound_file') with intensity_plotOnSpec or pitch_plotOnWave set to TRUE.

Usage

intensity_overlay(
  it,
  bottomRange,
  topRange,
  start,
  org_start = 0,
  tfrom0 = TRUE,
  range = NULL,
  color = "black",
  ind = NULL,
  drawSize = 1,
  axisLabel = "Intensity (dB)",
  min_max_only = TRUE,
  highlight = NULL,
  pitch_overlay = FALSE
)

Value

No return values, called internally by praatpicture and sibling functions.

Arguments

it

IntensityTier object loaded using rPraat::it.read or other object formatted in a similar way, i.e. a list object containing the elements t (a vector of time values) and i (a vector of intensity values) of identical length.

bottomRange

Bottom y-axis range of the plot frame that intensity is plotted on.

topRange

Top y-axis range of the plot frame that intensity is plotted on.

start

Start time (in seconds) of desired plotted area.

org_start

Start time (in seconds) of desired plotted area in the original sound file.

tfrom0

Logical; should time on the x-axis run from 0 or from the original time? Default is TRUE.

range

Vector of two integers giving the intensity range to be used for producing intensity plots. Default is NULL, in which case the range is simply the minimum and maximum levels in the curve.

color

String giving the name of the color to be used for plotting intensity. Default is 'black'.

ind

Integer indexing intensity relative to other plot components. Default is NULL.

drawSize

Number indicating the line width of the intensity contour. Default is 1. Controls the lwd argument of graphics::lines.

axisLabel

String giving the name of the label to print along the y-axis when plotting intensity. Default is Intensity (dB).

min_max_only

Logical; should only minimum and maximum values be given on the y-axis? Default is TRUE. 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.

highlight

Named list giving parameters for differential highlighting of the intensity contour 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) and drawSize (integer), and background (a string specifying a background color).

pitch_overlay

Logical; is pitch also overlaid on the same plot frame? Default is FALSE.

Examples

Run this code
# Don't use directly
datapath <- system.file('extdata', package='praatpicture')
soundFile <- paste0(datapath, '/1.wav')
praatpicture(soundFile, frames = 'spectrogram',
intensity_plotOnSpec = TRUE)

Run the code above in your browser using DataLab