feat_summary {voice}R Documentation

Features summary

Description

Returns summary measures of 'voice::extract_features'.

Usage

feat_summary(
  x,
  groupBy = "wav_path",
  wavPath = unique(x$wav_path),
  wavPathName = "wav_path",
  features = "f0",
  filesRange = NULL,
  sex = "u",
  windowShift = 10,
  numFormants = 8,
  numcep = 12,
  dcttype = c("t2", "t1", "t3", "t4"),
  fbtype = c("mel", "htkmel", "fcmel", "bark"),
  resolution = 40,
  usecmp = FALSE,
  mc.cores = 1,
  full.names = TRUE,
  recursive = FALSE,
  check.mono = FALSE,
  stereo2mono = FALSE,
  overwrite = FALSE,
  freq = 44100,
  round.to = 4,
  verbose = FALSE
)

Arguments

x

An Extended data frame to be tagged with media information.

groupBy

A variable to group the summary measures. The argument must be a character vector. (Default: groupBy = 'wav_path').

wavPath

A vector containing the path(s) to WAV files. May be both as dirname or basename formats.

wavPathName

A string containing the WAV path name. (Default: wavPathName = 'wav_path').

features

Vector of features to be extracted. (Default: 'f0').

filesRange

The desired range of directory files (default: NULL, i.e., all files). Should only be used when all the WAV files are in the same folder.

sex

= <code> set sex specific parameters where <code> = 'f'[emale], 'm'[ale] or 'u'[nknown] (Default: 'u'). Used as 'gender' by wrassp::ksvF0, wrassp::forest and wrassp::mhsF0.

windowShift

= <dur> set analysis window shift to <dur>ation in ms (Default: 5.0). Used by wrassp::ksvF0, wrassp::forest, wrassp::mhsF0, wrassp::zcrana, wrassp::rfcana, wrassp::acfana, wrassp::cepstrum, wrassp::dftSpectrum, wrassp::cssSpectrum and wrassp::lpsSpectrum.

numFormants

= <num> <num>ber of formants (Default: 8). Used by wrassp::forest.

numcep

Number of Mel-frequency cepstral coefficients (cepstra) to return (Default: 12). Used by tuneR::melfcc.

dcttype

Type of DCT used. 't1' or 't2', 't3' for HTK 't4' for feacalc (Default: 't2'). Used by tuneR::melfcc.

fbtype

Auditory frequency scale to use: 'mel', 'bark', 'htkmel', 'fcmel' (Default: 'mel'). Used by tuneR::melfcc.

resolution

= <freq> set FFT length to the smallest value which results in a frequency resolution of <freq> Hz or better (Default: 40.0). Used by wrassp::cssSpectrum, wrassp::dftSpectrum and wrassp::lpsSpectrum.

usecmp

Logical. Apply equal-loudness weighting and cube-root compression (PLP instead of LPC) (Default: FALSE). Used by tuneR::melfcc.

mc.cores

Number of cores to be used in parallel processing. (Default: 1)

full.names

Logical. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned. (Default: TRUE). Used by base::list.files.

recursive

Logical. Should the listing recursively into directories? (Default: FALSE) Used by base::list.files.

check.mono

Logical. Check if the WAV file is mono. (Default: TRUE)

stereo2mono

(Experimental) Logical. Should files be converted from stereo to mono? (Default: TRUE)

overwrite

(Experimental) Logical. Should converted files be overwritten? If not, the file gets the suffix _mono. (Default: FALSE)

freq

Frequency in Hz to write the converted files when stereo2mono=TRUE. (Default: 44100)

round.to

Number of decimal places to round to. (Default: NULL)

verbose

Logical. Should the running status be showed? (Default: FALSE)

Details

filesRange should only be used when all the WAV files are in the same folder.

Value

A tibble data frame containing summarized numeric columns using (1) mean, (2) standard deviation, (3) variation coefficient, (4) median, (5) interquartile range and (6) median absolute deviation.

Examples

library(voice)

# get path to audio file
path2wav <- list.files(system.file('extdata', package = 'wrassp'),
pattern = glob2rx('*.wav'), full.names = TRUE)

# creating Extended synthetic data
E <- dplyr::tibble(subject_id = c(1,1,1,2,2,2,3,3,3),
wav_path = path2wav)

# minimal usage
feat_summary(E)

# canonical data
feat_summary(E, groupBy = 'subject_id')

[Package voice version 0.4.21 Index]