Skip to contents

This function calculates the trill index of an audio wave object by analyzing the frequency modulation pattern over time. It can operate in either binary or continuous modes and provides options for generating visual plots of the trill activity. The function also identifies potential noise issues in the low- and mid-frequency ranges.

Usage

tai(
  wave,
  channel = "each",
  hpf = 0,
  cutoff = -60,
  n.windows = 120,
  freq.res = 100,
  plot = FALSE,
  plot.title = NULL,
  verbose = TRUE
)

Arguments

wave

A wave object to be analyzed.

channel

Channel or channels to be analyzed. Options are "left", "right", "each", and "mix".

cutoff

Numeric. The cutoff in decibels for the spectrogram generation.

n.windows

Numeric. Number of time windows to divide the signal into for analysis. Default is 60.

freq.res

Numeric. Frequency resolution (in Hz) for the spectrogram analysis. Default is 100.

plot

Logical. If TRUE, generates a plot of the trill index over time. Default is TRUE.

plot.title

Character. The title to be used for the plot. Default is NULL.

verbose

Logical. If TRUE, provides detailed output during the function's execution. Default is FALSE.

Value

A list containing:

  • summary: A tibble summarizing TAI statistics, including values for low and mid-frequency noise.

  • spectral: A 1-column matrix of mean trill index values for each frequency bin

Examples

if (FALSE) { # \dontrun{
# Example usage:
wave <- read_audio("example.wav")
trill_results <- tai(wave, channel = "left", binary = TRUE, plot = TRUE)
} # }