Description Usage Arguments Value Examples
View source: R/BatBioacoustics.R
This function is a modified version of the Bat Bioacoustics freeware developed by Christopher Scott (2012). It combines several detection, filtering and audio feature extraction algorithms.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | threshold_detection(
wave,
threshold = 14,
channel = "left",
time_exp = 1,
min_dur = 1.5,
max_dur = 80,
min_TBE = 20,
max_TBE = 1000,
EDG = 0.996,
LPF,
HPF = 16000,
FFT_size = 256,
FFT_overlap = 0.875,
start_thr = 40,
end_thr = 20,
SNR_thr = 10,
angle_thr = 40,
duration_thr = 80,
NWS = 100,
KPE = 1e-05,
KME = 1e-05,
settings = FALSE,
acoustic_feat = TRUE,
metadata = FALSE,
spectro_dir = NULL,
time_scale = 0.1,
ticks = TRUE
)
|
wave |
either a path to a file, or a Wave object. Audio files will be automatically decoded internally using the function read_audio. |
threshold |
integer. Sensitivity of the audio event detection function (peak-picking algorithm) in dB. A threshold value of 14 dB above SNR is recommended. Higher values increase the risk of leaving audio events undetected (false negative). In a noisy recording (low SNR) this sensitivity threshold may be set at 12 dB, but a value below 10 dB is not recommended. Default setting is 14 dB above SNR. |
channel |
character. Channel to keep for analysis in a stereo recording: 'left' or 'right'. Do not need to be specified for mono recordings, recordings with more than two channels are not yet supported. Default setting is 'left'. |
time_exp |
integer. Time expansion factor of the recording. Set to 1 for real-time recording or above for time expanded recording. Default setting is 1. |
min_dur |
numeric. Minimum duration threshold in milliseconds (ms). Extracted audio events shorter than this threshold are ignored. Default setting is 1.5 ms. |
max_dur |
numeric. Maximum duration threshold in milliseconds (ms). Extracted audio events longer than this threshold are ignored. The default setting is 80 ms. |
min_TBE |
numeric. Minimum time window between two audio events in milliseconds (ms). If the time interval between two successive audio events is shorter than this window, they are ignored. The default setting is 20 ms. |
max_TBE |
numeric. Maximum time window between two audio events in milliseconds (ms). If the time interval between two successive audio events is longer than this window, they are ignored. The default setting is 1000 ms. |
EDG |
numeric. Exponential Decay Gain from 0 to 1. Sets the degree of temporal masking at the end of each audio event. This filter avoids extracting noise or echoes at the end of the audio event. The default setting is 0.996. |
LPF |
integer. Low-Pass Filter (Hz). Frequencies above the cutoff are greatly attenuated. Default is set internally at the Nyquist frequency of the recording. |
HPF |
integer. High-Pass Filter (Hz). Frequencies below the cutoff are greatly attenuated. Default setting is 16000 Hz. A default of 1000 Hz is recommended for most bird vocalizations. |
FFT_size |
integer. Size of the Fast Fourrier Transform (FFT) window. Default setting is 256. |
FFT_overlap |
numeric. Percentage of overlap between two FFT windows (from 0 to 1). Default setting is 0.875. |
start_thr |
integer. Right to left amplitude threshold (dB) for audio event extraction, from the audio event centroid. The last FFT where the amplitude level is equal or above this threshold is considered the start of the audio event. Default setting is 40 dB. 20 dB is recommended for extracting bird vocalizations. |
end_thr |
integer. Left to right amplitude threshold (dB) for audio event extraction, from the audio event centroid. The last FFT where the amplitude level is equal or above this threshold is considered the end of the audio event. Default setting is 20 dB. 30 dB is recommended for extracting bird vocalizations. |
SNR_thr |
integer. SNR threshold (dB) at which the extraction of the audio event stops. Default setting is 10 dB. 8 dB is recommended for bird vocalizations. |
angle_thr |
integer. Angle threshold (°) at which the audio event extraction stops. Default setting is 40°. 125° is recommended for extracting bird vocalizations. |
duration_thr |
integer. Maximum duration threshold in milliseconds (ms) after which the monitoring of the background noise is resumed. Default setting is 80 ms for bat echolocation calls. A higher threshold value is recommended for extracting bird vocalizations. |
NWS |
integer. Length of the time window used for background noise estimation in the recording (ms). A longer window size is less sensitive to local variations in the background noise. Default setting is 100 ms. |
KPE |
numeric. Set the Process Error parameter of the Kalman filter. Default setting is 1e-05. |
KME |
numeric. Set the Measurement Error parameter of the Kalman filter. Default setting is 1e-05. |
settings |
logical. |
acoustic_feat |
logical. |
metadata |
logical. |
spectro_dir |
character (path) or |
time_scale |
numeric. Time resolution of the spectrogram in milliseconds (ms) per pixel (px). Default setting is 0.1 ms for bat echolocation calls. A default of 2 ms/px is recommended for most bird vocalizations. |
ticks |
either logical or numeric. If |
an object of class 'bioacoustics_output'.
1 2 3 | data(myotis)
Output <- threshold_detection(myotis, time_exp = 10, HPF = 16000, LPF = 200000)
Output$data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.