Skip to contents

wpd_features Measure wavelet packet decomposition features.

Usage

wpd_features(X, normalize = TRUE, threshold1 = 6,
threshold2 = 0.5, path = NULL, pb = TRUE, parallel = 1)

Arguments

X

object of class 'selection_table', 'extended_selection_table' or data frame with the following columns: 1) "sound.files": name of the sound files, 2) "sel": number of the selections, 3) "start": start time of selections, 4) "end": end time of selections. The output of auto_detec can also be used as the input data frame.

normalize

Logical to determine if features are normalized by signal duration.

threshold1

Threshold (%) for wavelet coefficient detection. Equivalent to denominator of equation 6 in Selin et al (2007). Must be a value between 0 and 1.

threshold2

Threshold for width detection. Equivalent to threshold 2 (th2) in equation 7 in Selin et al (2007).

path

Character string containing the directory path where the sound files are located. If NULL (default) then the current working directory is used.

pb

Logical argument to control progress bar and messages. Default is TRUE.

parallel

Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing).

Value

A data frame with rows for each of the selections in 'X' in addition to four wavelet packet decomposition features: max.energy, position, spread and width.

Details

Measures wavelet packet decomposition features. STILL UNDER DEVELOPMENT. USE IT UNDER YOUR OWN RISK.

References

Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: An R package to streamline analysis of animal acoustic signals. Methods in Ecology and Evolution, 8(2), 184-191.Selin A., J. Turunen, and J. T. Tanttu, 2007. Wavelets in recognition of bird sounds. EURASIP Journal on Advances in Signal Processing.

Author

Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)

Examples

{
  data(list = c("Phae.long1", "Phae.long2", "lbh_selec_table"))
  writeWave(Phae.long1, file.path(tempdir(), "Phae.long1.wav"))
  writeWave(Phae.long2, file.path(tempdir(), "Phae.long2.wav"))

  # not normalize
  wpd_features(lbh_selec_table[1:5, ], threshold2 = 0.3, nor = FALSE, path = tempdir())
}
#>      sound.files selec max.energy position    spread width
#> 1 Phae.long1.wav     1 3819085942     3413 0.5333922    18
#> 2 Phae.long1.wav     2 4566803930     3371 0.5617731    15
#> 3 Phae.long1.wav     3 1710652669     3332 4.4784859    31
#> 4 Phae.long2.wav     1  123488775     3872 1.0150520   125
#> 5 Phae.long2.wav     2  347589172     3364 1.2633529    41