spectro_calls: Generate spectrograms from labels

View source: R/spectro_calls.R

spectro_callsR Documentation

Generate spectrograms from labels

Description

Generate spectrograms from recording labels for classification purposes. The spectrogram parameters are user defined and should be selected depending on the type of sound event to classify.

Usage

spectro_calls(files_path, update_progress = NA,
db_path, spec_size = NA, window_length = NA,
frequency_resolution = 1, overlap = NA,
dynamic_range = NA, freq_range = NA, tx = 1, seed = 1002)

Arguments

files_path

Character. Path for the folder containing sound recordings.

update_progress

Progress bar only to be used inside shiny.

db_path

Character. Path for the database of recording labels created with the shinny app provided in the package.

spec_size

Integer. Spectrogram size in ms.

window_length

Numeric. Moving window length in ms.

frequency_resolution

Integer. Spectrogram frequency resolution with higher values meaning better resolution. Specifically, for any integer X provided, 1/X the analysis bandwidth (as determined by the number of samples in the analysis window) will be used. Not implemented yet, always uses 1 as input value.

overlap

Percentage of overlap between moving windows. Accepts values between 0.5 and 0.75.

dynamic_range

Threshold of minimum intensity values to show in the spectrogram. A value of 100 will typically be adequate for the majority of the recorders. If this is set to NULL, no threshold is applied.

freq_range

Frequency range of the spectrogram. Vector with two values, referring to the minimum and maximum frequency to show in the spectrogram.

tx

Time expanded. Only used in recorders specifically intended for bat recordings. Can take the values "auto" or any numeric value. If the recording is not time expanded tx must be set to 1 (the default). If it's time expanded the numeric value corresponding to the time expansion should be indicated or "auto" should be selected. If tx = "auto" the function assumes that sampling rates < 50kHz corresponds to tx = 10 and > 50kHz to tx = 1.

seed

Integer. Define a custom seed for randomizing data.

Value

A list with the following components:

  • data_x – an array with the spectrogram matrices

  • data_y – the labels for each matrix in one-hot-encoded format

  • parameters – the parameters used to create the matrices

  • labels_df – the labels with their respective numeric index

Author(s)

Bruno Silva


soundClass documentation built on May 30, 2022, 1:07 a.m.