diff --git a/articles/align_test_sounds.html b/articles/align_test_sounds.html index db8bfe8..f89f7e5 100644 --- a/articles/align_test_sounds.html +++ b/articles/align_test_sounds.html @@ -61,7 +61,7 @@

Synthesize and align test sounds

Marcelo Araya-Salas, PhD

-

2024-12-16

+

2024-12-17

Source: vignettes/align_test_sounds.Rmd
align_test_sounds.Rmd
@@ -572,7 +572,7 @@

Create master sound file for play dest.path = tempdir(), gap.duration = 0.15 ) -

[30mThe file synthetic_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m
+

[30mThe file synthetic_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m

 

The function saves the master sound file as a wave file and returns a selection table in the R environment with the time and frequency @@ -636,7 +636,7 @@

Create master sound file for play dest.path = tempdir(), gap.duration = 0.3 ) -

[30mThe file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m
+

[30mThe file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m

 

Again, we can look at the spectrogram of the output file:

@@ -1548,14 +1548,14 @@ 

Align re-recorded sounds duration = 2.4, ovlp = 0 )

-

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m
+

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m
 aligned_imgs
-
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_10m_closed.jpeg"
-[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_10m_open.jpeg"  
-[3] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_1m_open.jpeg"   
-[4] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_30m_closed.jpeg"
-[5] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_30m_open.jpeg"  
+
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_10m_closed.jpeg"
+[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_10m_open.jpeg"  
+[3] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_1m_open.jpeg"   
+[4] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_30m_closed.jpeg"
+[5] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_30m_open.jpeg"  

These are two of the files generated by the code above:

 

diff --git a/articles/quantify_degradation.html b/articles/quantify_degradation.html index b772303..11e3285 100644 --- a/articles/quantify_degradation.html +++ b/articles/quantify_degradation.html @@ -61,7 +61,7 @@

Quantify degradation

Marcelo Araya-Salas, PhD

-

2024-12-16

+

2024-12-17

Source: vignettes/quantify_degradation.Rmd
quantify_degradation.Rmd
@@ -1958,12 +1958,12 @@

Visual inspection# create plots degrad_imgs <- plot_degradation(test_sounds_est, dest.path = tempdir()) -

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpPJkAB2'
[39m
+

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxw49Sq'
[39m

These are the paths to some of the image files:

 degrad_imgs
-
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/plot_degradation_p1.jpeg"
-[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/plot_degradation_p2.jpeg"
+
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/plot_degradation_p1.jpeg"
+[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/plot_degradation_p2.jpeg"

… and this is one of the images:

 

@@ -2926,16 +2926,16 @@

Blur ratio
 # plot blur ratio
 blur_imgs <- plot_blur_ratio(X = test_sounds_est, dest.path = tempdir())
-

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpPJkAB2'
[39m
+

[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxw49Sq'
[39m

These are the paths to some of the image files:

 head(blur_imgs)
-
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-10m_closed.wav-4.jpeg"
-[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-30m_closed.wav-4.jpeg"
-[3] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-10m_open.wav-4.jpeg"  
-[4] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-30m_open.wav-4.jpeg"  
-[5] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:4-1m_open.wav-3-10m_closed.wav-3.jpeg"
-[6] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:4-1m_open.wav-3-30m_closed.wav-3.jpeg"
+
[1] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-10m_closed.wav-4.jpeg"
+[2] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-30m_closed.wav-4.jpeg"
+[3] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-10m_open.wav-4.jpeg"  
+[4] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-30m_open.wav-4.jpeg"  
+[5] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:4-1m_open.wav-3-10m_closed.wav-3.jpeg"
+[6] "/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:4-1m_open.wav-3-30m_closed.wav-3.jpeg"

Output image files (in the working directory) look like this one:

 

diff --git a/pkgdown.yml b/pkgdown.yml index f2b3667..7ff8456 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: align_test_sounds: align_test_sounds.html quantify_degradation: quantify_degradation.html -last_built: 2024-12-16T04:24Z +last_built: 2024-12-17T04:24Z urls: reference: https://marce10.github.io/baRulho/reference article: https://marce10.github.io/baRulho/articles diff --git a/reference/master_sound_file.html b/reference/master_sound_file.html index 856eab3..42350fa 100644 --- a/reference/master_sound_file.html +++ b/reference/master_sound_file.html @@ -163,7 +163,7 @@

Examples#> all selections are OK #> -#> The file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' diff --git a/reference/plot_aligned_sounds.html b/reference/plot_aligned_sounds.html index e4aee2f..e376902 100644 --- a/reference/plot_aligned_sounds.html +++ b/reference/plot_aligned_sounds.html @@ -206,7 +206,7 @@

Examples # plot (look into temporary working directory `tempdir()`) plot_aligned_sounds(X = test_sounds_est, dest.path = tempdir(), duration = 3, ovlp = 0) } -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' diff --git a/reference/plot_blur_ratio.html b/reference/plot_blur_ratio.html index b563bf7..5d12f2b 100644 --- a/reference/plot_blur_ratio.html +++ b/reference/plot_blur_ratio.html @@ -183,7 +183,7 @@

Examples # create plots plot_blur_ratio(X = X, dest.path = tempdir()) } -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' diff --git a/reference/plot_degradation.html b/reference/plot_degradation.html index 30efee3..ec1d2ce 100644 --- a/reference/plot_degradation.html +++ b/reference/plot_degradation.html @@ -222,7 +222,7 @@

Examples plot_degradation( X = Y, nrow = 3, ovlp = 95 ) -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # using other color palettes plot_degradation( @@ -230,22 +230,22 @@

Examples cols = viridis::magma(4, alpha = 0.3), palette = viridis::magma ) -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # missing some data, 2 rows plot_degradation( X = Y[-3, ], nrow = 2, ovlp = 95, cols = viridis::mako(4, alpha = 0.4), palette = viridis::mako, wl = 200 ) -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # changing marging and high overlap plot_degradation(X = Y, margins = c(5, 1), nrow = 6, ovlp = 95) -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # more rows than needed (will adjust it automatically) plot_degradation(X = Y, nrow = 10, ovlp = 90) -#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' +#> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # } diff --git a/search.json b/search.json index 3ba4f0e..552bf4e 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing","title":"Contributing","text":"First , thanks taking time contribute! types contributions encouraged valued. See Table Contents different ways help details project handles . Please make sure read relevant section making contribution. make lot easier us maintainers smooth experience involved. community looks forward contributions. like project, just don’t time contribute, ’s fine. easy ways support project show appreciation, also happy : - Star project - Tweet - Refer project project’s readme - Mention project local meetups tell friends/colleagues","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of Contents","title":"Contributing","text":"Code Conduct Question Want Contribute Reporting Bugs Suggesting Enhancements","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing","text":"Please note baRulho released Contributor Code Conduct. contributing project agree abide terms. See rOpenSci contributing guide details.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"i-have-a-question","dir":"","previous_headings":"","what":"I Have a Question","title":"Contributing","text":"want ask question, assume read available Documentation. ask question, best search existing Issues might help . case found suitable issue still need clarification, can write question issue. also advisable search internet answers first. still feel need ask question need clarification, recommend following: Open https://github.com/ropensci/baRulho/issues/. Provide much context can ’re running . Provide project platform versions (nodejs, npm, etc), depending seems relevant. take care issue soon possible.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"i-want-to-contribute","dir":"","previous_headings":"","what":"I Want To Contribute","title":"Contributing","text":"contributing project, must agree authored 100% content, necessary rights content content contribute may provided project license.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"before-submitting-a-bug-report","dir":"","previous_headings":"I Want To Contribute > Reporting Bugs","what":"Before Submitting a Bug Report","title":"Contributing","text":"good bug report shouldn’t leave others needing chase information. Therefore, ask investigate carefully, collect information describe issue detail report. Please complete following steps advance help us fix potential bug fast possible. Make sure using latest version. Determine bug really bug error side e.g. using incompatible environment components/versions (Make sure read documentation. looking support, might want check section). see users experienced (potentially already solved) issue , check already bug report existing bug erro. Also make sure search internet (including Stack Overflow) see users outside GitHub community discussed issue. Collect information bug: Stack trace (Traceback) OS, Platform Version (Windows, Linux, macOS, x86, ARM) Version interpreter, compiler, SDK, runtime environment, package manager, depending seems relevant. Possibly input output Can reliably reproduce issue? can also reproduce older versions?","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"how-do-i-submit-a-good-bug-report","dir":"","previous_headings":"I Want To Contribute > Reporting Bugs","what":"How Do I Submit a Good Bug Report?","title":"Contributing","text":"must never report security related issues, vulnerabilities bugs including sensitive information issue tracker, elsewhere public. Instead sensitive bugs must sent email marcelo.araya@ucr.ac.cr. use GitHub issues track bugs errors. run issue project: Open Issue. (Since can’t sure point whether bug , ask talk bug yet label issue.) Explain behavior expect actual behavior. Please provide much context possible describe reproduction steps someone else can follow recreate issue . usually includes code. good bug reports isolate problem create reduced test case. Provide information collected previous section. ’s filed: project team label issue accordingly. team member try reproduce issue provided steps. reproduction steps obvious way reproduce issue, team ask steps mark issue needs-repro. Bugs needs-repro tag addressed reproduced. team able reproduce issue, marked needs-fix, well possibly tags (critical), issue left implemented someone.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"suggesting-enhancements","dir":"","previous_headings":"I Want To Contribute","what":"Suggesting Enhancements","title":"Contributing","text":"section guides submitting enhancement suggestion, including completely new features minor improvements existing functionality. Following guidelines help maintainers community understand suggestion find related suggestions.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"before-submitting-an-enhancement","dir":"","previous_headings":"I Want To Contribute > Suggesting Enhancements","what":"Before Submitting an Enhancement","title":"Contributing","text":"Make sure using latest version. Read documentation carefully find functionality already covered, maybe individual configuration. Perform search see enhancement already suggested. , add comment existing issue instead opening new one. Find whether idea fits scope aims project. ’s make strong case convince project’s developers merits feature. Keep mind want features useful majority users just small subset. ’re just targeting minority users, consider writing add-/plugin library.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"how-do-i-submit-a-good-enhancement-suggestion","dir":"","previous_headings":"I Want To Contribute > Suggesting Enhancements","what":"How Do I Submit a Good Enhancement Suggestion?","title":"Contributing","text":"Enhancement suggestions tracked GitHub issues. Use clear descriptive title issue identify suggestion. Provide step--step description suggested enhancement many details possible. Describe current behavior explain behavior expected see instead . point can also tell alternatives work . may want include screenshots animated GIFs help demonstrate steps point part suggestion related . can use tool record GIFs macOS Windows, tool tool Linux. Explain enhancement useful users. may also want point projects solved better serve inspiration.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributing","text":"guide based contributing.md. Make !","code":""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"glossary","dir":"Articles","previous_headings":"","what":"Glossary","title":"Synthesize and align test sounds","text":"-Model sound: sound transmission properties studied, usually found original field recordings synthetic sound files. -Reference sound: sound use pattern compare . Usually created re-recording model sound broadcast 1 m source (speaker). -Sound ID: ID sounds used identify counterparts across distances. sound must unique ID within distance. -Ambient noise: energy background sounds recording, excluding sounds interest. -Test sound: sounds re-recorded far source test transmission/degradation (also refer ‘re-recorded’ sounds). -Degradation: loose term used describe changes structure sound transmitted habitat.","code":""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"synthesize-sounds","dir":"Articles","previous_headings":"","what":"Synthesize sounds","title":"Synthesize and align test sounds","text":"often want figure transmission properties vary across range frequencies. instance, Tobias et al (2010) studied whether acoustic adaptation (special case sensory drive; Morton 1975), explain song evolution Amazonian avian communities. test authors created synthetic pure tone sounds used playback re-recorded different habitats. actual procedure creating synthetic sounds described : “Tones synthesized six different frequencies (0.5, 1.0, 2.0, 3.0, 4.0, 5.0 kHz) encompass range maximum avian auditory sensitivity (Dooling 1982). frequency, generated two sequences two 100-msec tones. One sequence relatively short interval 150 msec, close mean internote interval sample (152± 4 msec). sequence longer interval 250 msec, close mean maximum internote interval sample (283± 74 msec). first sequence reflects fast-paced song second slower paced song (sensu Slabbekoorn et al. 2007). master file (44100 Hz/16 bit WAV) thereby consisted series 12 pairs artificial 100-ms constant-frequency tones six different frequencies (0.5, 1.0, 2.0, 3.0, 4.0, 5.0 kHz).” can synthesize pure tones using function synth_sounds(). function requires 1) frequencies tones synthesize (argument frequencies, kHz) 2) duration tones (durations, seconds). addition, logical arguments fm allow create frequency amplitude modulated sounds respectively. case need six tones 100 ms 0.5, 1, 2, 3, 4, 5 kHz separated intervals 150 ms (least first synthetic file described Tobias et al 2010). can also get selection table (sensu warbleR) information time frequency location every sound. required order make master sound file. get selection table need set argument selec.table = TRUE. can done follows:   function can add complexity additional acoustic dimensions. instance following code generates possible combinations frequencies (2, 3 4 kHz), durations (0.1, 0.2 s), frequency modulation (tonal modulated) amplitude modulation (flat modulated envelope): Note output extended selection table contains time-frequency annotations synthetic sounds:   extended selection table, ‘sound.files’ column refers Wave objects included attributes instead files directory:  ","code":"# load packages library(viridis) Loading required package: viridisLite library(baRulho) Loading required package: warbleR Loading required package: tuneR Loading required package: seewave Loading required package: NatureSounds Loading required package: ohun Please cite 'ohun' as: Araya-Salas, M., Smith-Vidaurre, G., Chaverri, G., Brenes, J. C., Chirino, F., Elizondo-Calvo, J., & Rico-Guevara, A. 2023. ohun: an R package for diagnosing and optimizing automatic sound event detection. Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.14170 Please cite 'baRulho' as: Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, A. Garcia-Rodriguez, A. Rico-Guevara. (2023), baRulho: an R package to quantify degradation in animal acoustic signals .bioRxiv 2023.11.22.568305. Attaching package: 'baRulho' The following object is masked from 'package:seewave': attenuation library(Rraven) # synthesize synth_est <- baRulho::synth_sounds( mar = 0.1, frequencies = c(0.5, 1:5), durations = 0.1, fm = FALSE, am = FALSE, sampling.rate = 12 ) 
[30msynthesizing sounds (step 0 of 0):
[39m # convert into a single wave object synth_wav <- Rraven::exp_est(X = synth_est, single.file = TRUE, wave.object = TRUE) # plot spectro seewave::spectro( wave = synth_wav, scale = FALSE, palette = viridis, grid = FALSE, collevels = seq(-20, 0, 1), osc = TRUE, colwave = \"#31688EB3\", heights = c(2, 1), wl = 100 ) # synthesize synth_est2 <- baRulho::synth_sounds( mar = 0.01, sig2 = 0.05, frequencies = 2:4, durations = c(0.1, 0.2), fm = TRUE, am = TRUE, shuffle = TRUE, seed = 123, sampling.rate = 12 ) # convert into a single wave object synth_wav2 <- Rraven::exp_est( X = synth_est2, single.file = TRUE, path = tempdir(), wave.object = TRUE ) # plot spectro seewave::spectro( synth_wav2, tlim = c(0, 2), scale = FALSE, palette = viridis, grid = FALSE, collevels = seq(-20, 0, 1), osc = TRUE, colwave = \"#31688EB3\", heights = c(2, 1), wl = 140 ) # check first 6 rows head(as.data.frame(synth_est2)) # check name of wave objects names(attributes(synth_est2)$wave.objects) [1] \"synthetic_sound_1\" \"synthetic_sound_2\" \"synthetic_sound_3\" \"synthetic_sound_4\" [5] \"synthetic_sound_5\" \"synthetic_sound_6\" \"synthetic_sound_7\" \"synthetic_sound_8\" [9] \"synthetic_sound_9\" \"synthetic_sound_10\" \"synthetic_sound_11\" \"synthetic_sound_12\" [13] \"synthetic_sound_13\" \"synthetic_sound_14\" \"synthetic_sound_15\" \"synthetic_sound_16\" [17] \"synthetic_sound_17\" \"synthetic_sound_18\" \"synthetic_sound_19\" \"synthetic_sound_20\" [21] \"synthetic_sound_21\" \"synthetic_sound_22\" \"synthetic_sound_23\" \"synthetic_sound_24\""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"create-master-sound-file-for-playback","dir":"Articles","previous_headings":"","what":"Create master sound file for playback","title":"Synthesize and align test sounds","text":"function master_sound_file() creates master sound file (probably guessed) playback experiments. function takes wave objects data frame (extended) selection table containing model sounds concatenates single sound file (silence sounds length can modified). master_sound_file() adds acoustic markers start end playback can used time-sync re-recorded sounds, streamlines quantification acoustic degradation. following example shows create master sound file using synthetic sounds generated . synthetic sounds need add little space top bottom frequency sim_songs() make values exactly pure tones:   function saves master sound file wave file returns selection table R environment time frequency ‘coordinates’ sounds file (careful playing master sound file can shocking audiences!). can look spectrogram output file using seewave function spectro() follows: function can also create master sound file sounds found sound files several sounds files, likely case recordings collected field. following example shows create master sound file using several sound files. code uses example data recordings package warbleR:   , can look spectrogram output file: Note output also exported Raven sound analysis software (Cornell Lab Ornithology) visualization manipulation using function exp_raven() Rraven package. exp_raven() exports selections R environment ‘.txt’ file can read Raven:   sound files annotations can visualized Raven ( acoustic analysis software):   Take look Rraven vignette details export import data R Raven. Note start end markers placed relatively low frequencies less affected degradation. frequency range markers can set argument flim. relative amplitude markers can also adjusted amp.marker argument. Amplitude markers multiplied value supplied markers louder sounds. two features increases chances detecting markers distances.","code":"# create master sound file synth_master_annotations <- baRulho::master_sound_file( X = synth_est, file.name = \"synthetic_master\", dest.path = tempdir(), gap.duration = 0.15 ) 
[30mThe file synthetic_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m # read wave file wave <- tuneR::readWave(file.path(tempdir(), \"synthetic_master.wav\")) # plot spectrogram seewave::spectro( wave, scale = FALSE, palette = viridis, wl = 150, grid = FALSE, flim = c(0, 4.7) ) # load example data from warbleR data(list = c( \"Phae.long1\", \"Phae.long2\", \"Phae.long3\", \"Phae.long4\", \"lbh_selec_table\" )) # save sound files to temporary folder writeWave(Phae.long1, file.path(tempdir(), \"Phae.long1.wav\")) writeWave(Phae.long2, file.path(tempdir(), \"Phae.long2.wav\")) writeWave(Phae.long3, file.path(tempdir(), \"Phae.long3.wav\")) writeWave(Phae.long4, file.path(tempdir(), \"Phae.long4.wav\")) # make an extended selection table est <- warbleR::selection_table( X = lbh_selec_table, extended = TRUE, path = tempdir(), pb = FALSE ) 
[30mall selections are OK 
[39m # add sound_id column est$sound.id <- paste0(abbreviate(est$sound.files), est$selec) # create master sound file master_annotations <- baRulho::master_sound_file( X = est, file.name = \"example_master\", dest.path = tempdir(), gap.duration = 0.3 ) 
[30mThe file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m # read wave file wave <- tuneR::readWave(file.path(tempdir(), \"example_master.wav\")) # plot spectrogram seewave::spectro( wave, scale = FALSE, palette = viridis, collevels = seq(-120, 0, 5), wl = 500, grid = FALSE, flim = c(0, 10) ) Rraven::exp_raven(master_annotations, path = tempdir(), file.name = \"example_master_selection_table\") knitr::include_graphics(\"example_master_table.jpg\")"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"align-re-recorded-sounds","dir":"Articles","previous_headings":"","what":"Align re-recorded sounds","title":"Synthesize and align test sounds","text":"went field (lab) re-recorded master sound files different distances, ready start data analysis. first step getting data ready analysis involves finding sounds within re-recorded sound files. need align start marker master playback re-recorded sound files, based fact time difference marker sounds cases:   use acoustic data included package example data. data subset sound transmission experiment. complete data set experiment hosted repository. two example objects used:   files contained data set:   names self-explanatory: master sound file (“master.wav”) annotations, reference sound file (“reference_1m.wav”) two test files (“test_10m.wav” “test_20m.wav”) re-recorded 10 20 m respectively. Now save files temporary working directory (objects extended selection tables R environment) resemble usual case acoustic data found sound files.   annotations needed aligning test sound must share following structure:   Note ‘sound.id’ column contains unique identifier sound. used label counterparts test sound files. Users can import annotations Raven using Rraven package (see vignette). find location start marker test sound files use functions find_markers() run cross-correlation one markers across test files order determine exact time marker found:   position markers determined highest spectrogram cross-correlation value marker using functions find_markers(). two markers used function computes additional column, ‘time.mismatch’, compares time difference two markers test files master sound file. perfect detection value must 0. number can used measure error. cases precision can improve increasing time resolution spectrogram, , lowering size time window. done argument ‘hop.size’. default 11.6 ms (equivalent 512 samples window length 44.1 kHz file). Let’s try 4 ms:   time location acoustic markers can infer position sounds new recordings. selection table re-recorded files can generated using function align_test_files():   function returns object class input object ‘X’. case ‘X’ data.frame: can check precision alignment looking spectrograms. function plot_aligned_sounds() can create spectrograms visually inspect alignment precision test sound files. spectrograms saved individual JPEG image files (‘dest.path’ supplied). One file created sound file: two files generated code :  ","code":"data(\"master_est\") data(\"test_sounds_est\") unique(master_est$sound.files) [1] \"master.wav\" unique(test_sounds_est$sound.files) [1] \"10m_closed.wav\" \"10m_open.wav\" \"1m_open.wav\" \"30m_closed.wav\" \"30m_open.wav\" # first remove any other wave file in the temporary working directory (dont do it with your data!) unlink(list.files( path = tempdir(), full.names = TRUE, pattern = \".wav\" )) # save master sound file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # save test sound files for (i in unique(test_sounds_est$sound.files)) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # make annotations a data frame master_annotations <- as.data.frame(master_est) master_annotations markers_position <- baRulho::find_markers(X = master_annotations, path = tempdir()) markers_position # lower window length markers_position <- baRulho::find_markers(X = master_annotations, hop.size = 4, path = tempdir()) markers_position aligned_tests <- baRulho::align_test_files( X = master_annotations, Y = markers_position, by.song = TRUE, remove.markers = FALSE, path = tempdir() ) is.data.frame(aligned_tests) [1] TRUE aligned_tests aligned_imgs <- baRulho::plot_aligned_sounds( X = aligned_tests, path = tempdir(), dest.path = tempdir(), duration = 2.4, ovlp = 0 ) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxh0QrD'
[39m aligned_imgs [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_10m_closed.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_10m_open.jpeg\" [3] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_1m_open.jpeg\" [4] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_30m_closed.jpeg\" [5] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxh0QrD/plot_align_30m_open.jpeg\""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"manually-fixing-alignment","dir":"Articles","previous_headings":"Align re-recorded sounds","what":"Manually fixing alignment","title":"Synthesize and align test sounds","text":"cases alignments might accurate, particularly markers considerably degraded test sound files. function manual_realign() allows users interactively adjust alignment test sound files produced align_test_files(). function generates multipanel graph spectrogram master sound file top test sound files, highlighting position correspondent test sounds order simplify assessing adjusting alignment: Spectrograms include first seconds sound files (controlled ‘duration’) usually enough tell precision alignment. lower spectrogram shows series ‘buttons’ users can click control test sound file spectrogram (low panel) needs moved left (“<”) right (“>”). Users can also reset spectrogram original position (‘reset’), move next sound file ‘X’ (test sound file annotations) stop process (stop button). function returns object similar input object ‘X’ start end sounds adjusted. default uses start marker reference can modified argument ‘marker’.","code":"baRulho::manual_realign( X = aligned_tests, Y = master_annotations, duration = 2.4, path = tempdir() )"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"further-aligning","dir":"Articles","previous_headings":"Align re-recorded sounds","what":"Further aligning","title":"Synthesize and align test sounds","text":"alignments done manually (broadcasting devices add short delays case bluetooth transmitters) small misalignment inferred versus actual start time re-recorded sounds. problematic quantifying degradation baRulho (sound analysis software) precise alignment sound crucial accuracy downstream measures sound degradation. Misalignment can fixed function auto_realign(). function uses spectrogram cross-correlation sync position time sounds regard reference sound. manual_realign() takes sound recorded closest distance source reference sound. function calls warbleR’s cross_correlation() (just ) internally align sounds using cross-correlation. can simulate aligned data set test sound slightly position: Now can re-aligned test sounds: sounds look aligned:   case doesn’t work expected another option. function seltailor() warbleR allows user manually adjust start end sounds extended selection table. Alternatively, users can manually determined position markers using Raven import annotations ‘R’ using function ‘imp_raven()’ Rraven package.   Please report bugs . package baRulho cited follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":"data(\"test_sounds_est\") data(\"master_est\") # create \"unaligned_test_sounds_est\" by # adding error to \"test_sounds_est\" start and end unaligned_test_sounds_est <- test_sounds_est set.seed(123) noise_time <- sample(c(0.009, -0.01, 0.03, -0.03, 0, 0.07, -0.007), nrow(unaligned_test_sounds_est), replace = TRUE) attr(unaligned_test_sounds_est, \"check.res\")$start <- unaligned_test_sounds_est$start <- unaligned_test_sounds_est$start + noise_time attr(unaligned_test_sounds_est, \"check.res\")$end <- unaligned_test_sounds_est$end <- unaligned_test_sounds_est$end + noise_time #re align rts <- auto_realign(X = unaligned_test_sounds_est, Y = master_est)"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Synthesize and align test sounds","text":"Araya-Salas, M. (2017). Rraven: connecting R Raven bioacoustic software. R package version 1.0.0. Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0 Araya-Salas M, Smith-Vidaurre G. (2017) warbleR: R package streamline analysis animal acoustic signals. Methods Ecol Evol 8:184–191. Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34. Tobias, J. ., Aben, J., Brumfield, R. T., Derryberry, E. P., Halfwerk, W., Slabbekoorn, H., & Seddon, N. (2010). Song divergence sensory drive Amazonian birds. Evolution, 64(10), 2820-2839. Session information","code":"R version 4.4.2 (2024-10-31) Platform: aarch64-apple-darwin20 Running under: macOS Sonoma 14.7.1 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: UTC tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Rraven_1.0.14 baRulho_2.1.2 ohun_1.0.2 warbleR_1.1.33 NatureSounds_1.0.4 [6] seewave_2.2.3 tuneR_1.4.7 viridis_0.6.5 viridisLite_0.4.2 knitr_1.49 loaded via a namespace (and not attached): [1] gtable_0.3.6 rjson_0.2.23 xfun_0.49 bslib_0.8.0 ggplot2_3.5.1 [6] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 curl_6.0.1 parallel_4.4.2 [11] tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 pkgconfig_2.0.3 KernSmooth_2.23-24 [16] checkmate_2.3.2 desc_1.4.3 lifecycle_1.0.4 stringr_1.5.1 compiler_4.4.2 [21] textshaping_0.4.1 brio_1.1.5 munsell_0.5.1 htmltools_0.5.8.1 class_7.3-22 [26] sass_0.4.9 RCurl_1.98-1.16 yaml_2.3.10 pillar_1.9.0 pkgdown_2.1.1 [31] jquerylib_0.1.4 MASS_7.3-61 classInt_0.4-10 cachem_1.1.0 Deriv_4.1.6 [36] digest_0.6.37 stringi_1.8.4 sf_1.0-19 fastmap_1.2.0 grid_4.4.2 [41] colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 utf8_1.2.4 e1071_1.7-16 [46] scales_1.3.0 backports_1.5.0 rmarkdown_2.29 httr_1.4.7 Sim.DiffProc_4.9 [51] signal_1.8-1 igraph_2.1.2 gridExtra_2.3 png_0.1-8 ragg_1.3.3 [56] kableExtra_1.4.0 pbapply_1.7-2 evaluate_1.0.1 dtw_1.23-1 fftw_1.0-9 [61] testthat_3.2.2 rlang_1.1.4 Rcpp_1.0.13-1 glue_1.8.0 DBI_1.2.3 [66] xml2_1.3.6 svglite_2.1.3 rstudioapi_0.17.1 jsonlite_1.8.9 R6_2.5.1 [71] systemfonts_1.1.0 fs_1.6.5 units_0.8-5"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"required-data-structure","dir":"Articles","previous_headings":"","what":"Required data structure","title":"Quantify degradation","text":"Transmission experiments tend follow common experimental design model sounds re-recorded increasing distance within transect. Hence, data must indicate, besides basic acoustic annotation information (e.g. sound file, time, frequency), transect distance within transect sound. baRulho comes example annotation data set can used show required data structure: despcription required input data columns: sound.files: character factor column name sound files including file extension (e.g. “rec_1.wav”) selec: numeric, character factor column unique identifier (least within sound file) annotation (e.g. 1, 2, 3 “”, “b”, “c”) start: numeric column start position time annotated sound (seconds) end: numeric column end position time annotated sound (seconds) ‘bottom.freq’: numeric column bottom frequency frequency range annotation (kHz, used bandpass filtering) top.freq: numeric column top frequency frequency range annotation (kHz, used bandpass filtering) channel: numeric column number channel annotation found multi-channel sound file (optional, default 1 supplied) sound.id: numeric, character factor column ID sounds used identify sounds different distances transects. sound ID can one sample distance/transect combination. sound id label “ambient” can used defined annotations ambient noise can measure. transect: numeric, character factor column transect ID. distance: numeric column distance (m) source sound recorded. package assumes distance replicated within transect.","code":"# load packages library(baRulho) library(viridis) library(ggplot2) # load example data data(\"test_sounds_est\") test_sounds_est"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"setting-reference-sounds","dir":"Articles","previous_headings":"","what":"Setting reference sounds","title":"Quantify degradation","text":"combined information columns used identify reference sounds test sound. function set_reference_sounds() exactly . Hence, unless define reference sound test sound manually, set_reference_sounds() must always run degradation measuring function. two possible experimental designs defining reference sounds (controlled argument ‘method’ set_reference_sounds()): 1: compare sounds (‘sound.id’) counterpart recorded closest distance source (e.g. compare sound recorded 5m, 10m 15m counterpart recorded 1m). default method. design users can single example shortest distance used reference (instance 1m case studies) function try use references transect. However, another test sound ‘sound.id’ shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. 2: compare sounds counterpart recorded distance immediately within transect (e.g. sound recorded 10m compared sound recorded 5m, sound recorded 15m compared sound recorded 10m ). Also note selections labeled “ambient” ‘sound.id’. selections refer ambient (background) noise. Ambient noise can used functions correct amplitude differences due non-target sounds. example data 4 recordings increasing distances: 1m, 5m, 10m 15m: data contains selections 5 sounds well 1 ambient noise selections distance/recording:   baRulho can take sound file annotations represented following R objects: Data frames Selection tables Extended selection tables last 2 annotation specific R classes included warbleR. Take look annotation format vignette warbleR details formats.","code":"# count selection per recordings unique(test_sounds_est$sound.files) [1] \"10m_closed.wav\" \"10m_open.wav\" \"1m_open.wav\" \"30m_closed.wav\" [5] \"30m_open.wav\" table(test_sounds_est$sound.id, test_sounds_est$distance)"},{"path":[]},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"data-format","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Data format","title":"Quantify degradation","text":"mention , function set_reference_sounds() used determined, row input data, sounds used references. function can using two methods described :   function adds column ‘reference’ used downstream functions plotting measuring degradation. Hence used running degradation functions (including plotting functions). References indicated combination ‘sound.files’ ‘selec’ column. instance, ‘10m.wav-1’ indicates row ‘selec’ column ‘1’ sound file ‘10m.wav’ used reference. function also checks information ‘X’ (input annotation data) right format won’t produce errors downstream analysis (see ‘X’ argument description details format). function ignore rows sound id column ‘ambient’, ‘start_marker’ ‘end_marker’.","code":"# add reference column test_sounds_est <- set_reference_sounds(test_sounds_est, method = 1) # print test_sounds_est 
[30mcomputing references (step 0 of 0):
[39m"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"visual-inspection","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Visual inspection","title":"Quantify degradation","text":"function plot_degradation() aims simplify visual inspection sound degradation producing multipanel figures (saved JPEG files ‘dest.path’) containing visualizations test sound reference. Sounds sorted distance (columns) transect. Visualizations include spectrograms, amplitude envelopes power spectra (last 2 optional): paths image files: … one images:   row includes copies sound id given transect (row label includes sound id first line transect second line), also including reference comes another transect. Ambient noise annotations (sound.id ‘ambient’) excluded.","code":"# sort to order panels test_sounds_est <- test_sounds_est[order(test_sounds_est$sound.id, test_sounds_est$transect, decreasing = FALSE),] # create plots degrad_imgs <- plot_degradation(test_sounds_est, dest.path = tempdir()) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpPJkAB2'
[39m degrad_imgs [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/plot_degradation_p1.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/plot_degradation_p2.jpeg\""},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"blur-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Blur ratio","title":"Quantify degradation","text":"Blur ratio quantifies degradation sound function distortion amplitude envelope (time domain) excluding changes due energy attenuation. measure first described Dabelsteen et al. (1993). Blur ratio measured mismatch amplitude envelopes (expressed probability density functions) reference sound re-recorded sound. Low values indicate low degradation sounds. function blur_ratio() measures blur ratio sounds reference playback re-recorded different distances. function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). ‘sound.id’ column must used tell function compare sounds belonging category (e.g. song-types). sound files (wave objects extended selection table) must sampling rate length envelopes comparable. Blur ratio can calculated follows:   output data frame simply input data additional column (‘blur.ratio’) blur ratio values. Note NAs returned sounds used reference ‘ambient’ noise selections. function plot_blur_ratio() can used generate image files (‘jpeg’ format) comparison showing spectrograms sounds overlaid amplitude envelopes (probability mass functions (PMF)). paths image files: Output image files (working directory) look like one:   image shows spectrogram reference re-recorded sound, well envelopes sounds overlaid single graph. Colors indicate sound spectrograms envelopes belong . blur ratio value also displayed. function can also return amplitude spectrum contours argument envelopes = TRUE. contours can directly input ggplot visualize amplitude envelopes, vary distance across sound types (ambient noise included): env.smooth argument change envelope shapes related measurements, higher values tend smooth envelopes. following code sets env.smooth = 800 produces smoother envelopes:  ","code":"# run blur ratio br <- blur_ratio(X = test_sounds_est) # see output br # plot blur ratio blur_imgs <- plot_blur_ratio(X = test_sounds_est, dest.path = tempdir()) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpPJkAB2'
[39m head(blur_imgs) [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-10m_closed.wav-4.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-30m_closed.wav-4.jpeg\" [3] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-10m_open.wav-4.jpeg\" [4] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:1-1m_open.wav-4-30m_open.wav-4.jpeg\" [5] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:4-1m_open.wav-3-10m_closed.wav-3.jpeg\" [6] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpPJkAB2/blur_ratio_freq:4-1m_open.wav-3-30m_closed.wav-3.jpeg\" # get envelopes br <- blur_ratio(X = test_sounds_est, envelopes = TRUE) envs <- attributes(br)$envelopes # make distance a factor for plotting envs$distance <- as.factor(envs$distance) # plot ggplot(envs, aes(x = time, y = amp, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic() # get envelopes br <- blur_ratio(X = test_sounds_est, envelopes = TRUE, env.smooth = 800) envs <- attributes(br)$envelopes envs$distance <- as.factor(envs$distance) ggplot(envs, aes(x = time, y = amp, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic()"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrum-blur-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrum blur ratio","title":"Quantify degradation","text":"Spectrum blur ratio (measured spectrum_blur_ratio()) quantifies degradation sound function change sound energy across frequency domain, analogous blur ratio described time domain (implemented blur_ratio()). Low values also indicate low degradation sounds. Spectrum blur ratio measured mismatch power spectra (expressed probability density functions) reference sound re-recorded sound. works way blur_ratio(), comparing sound corresponding reference sound, output images alike well. Spectrum blur ratio can calculated follows:   blur_ratio(), spectrum_blur_ratio() can also return amplitude spectrum contours argument spectra = TRUE:  ","code":"# run Spectrum blur ratio sbr <- spectrum_blur_ratio(test_sounds_est) # see output sbr sbr <- spectrum_blur_ratio(X = test_sounds_est, spectra = TRUE) spctr <- attributes(sbr)$spectra spctr$distance <- as.factor(spctr$distance) ggplot(spctr[spctr$freq > 0.3,], aes(y = amp, x = freq, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (PMF)\") + coord_flip() + theme_classic()"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"excess-attenuation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Excess attenuation","title":"Quantify degradation","text":"every doubling distance, sounds attenuate 6 dB loss amplitude (Morton, 1975; Marten & Marler, 1977). additional loss amplitude results excess attenuation, energy loss excess expected occur distance via spherical spreading, due atmospheric conditions habitat (Wiley & Richards, 1978). degradation metric can measured using excess_attenuation() function. Low values indicate little sound attenuation. function compare sound corresponding reference sound within frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). excess_attenuation() can measured like : output, similar functions, extended selection table input data, also including two new columns (‘reference’ ‘excess.attenuation’) reference sound excess attenuation:  ","code":"# run envelope correlation ea <- excess_attenuation(test_sounds_est) # print output ea"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"envelope-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Envelope correlation","title":"Quantify degradation","text":"Amplitude envelope correlation measures similarity two sounds time domain. envelope_correlation() function measures envelope correlation coefficients reference playback re-recorded sounds. Values close 1 means similar amplitude envelopes (.e. little degradation occurred). envelopes different lengths (sounds different lengths) cross-correlation applied maximum correlation coefficient returned. Cross-correlation achieved sliding shortest sound along largest one calculating correlation step. functions detailed , ‘sound.id’ column must used instruct function compare sounds belong category. envelope_correlation() can run follows: output also similar functions; extended selection table similar input data, also includes two new columns (‘reference’ ‘envelope.correlation’) reference sound amplitude envelope correlation coefficients:   Note function doesn’t provide graphical output. However, graphs generated blur_ratio() can used inspect envelope shapes alignment sounds.","code":"# run envelope correlation ec <- envelope_correlation(test_sounds_est) # print output ec"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrum-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrum correlation","title":"Quantify degradation","text":"Spectrum correlation measures similarity two sounds frequency domain. similar envelope_correlation(), frequency domain. sounds compared within frequency range reference sound (spectra length). , values near 1 indicate identical frequency spectrum (.e. degradation). output also similar envelope_correlation():   envelope_correlation(), spectrum_correlation() doesn’t provide graphical output. However, graphs generated spectrum_blur_ratio() can also used inspect spectrum shapes sound alignment.","code":"# run spectrum correlation sc <- spectrum_correlation(test_sounds_est) # print output sc"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"signal-to-noise-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Signal-to-noise ratio","title":"Quantify degradation","text":"Signal--noise ratio (SNR) quantifies sound amplitude level relation ambient noise metric overall sound attenuation. Therefore, attenuation refers loss energy described Dabelsteen et al (1993). method implemented function signal_to_noise_ratio(), uses envelopes quantify sound power signals background noise. function requires measurement ambient noise, either noise right sound (noise.ref = \"adjacent\") one ambient noise measurements per recording (noise.ref = \"custom\"). latter, selections sound parameters ambient noise measured must specified. Alternatively, one selections ambient noise can used reference (see ‘noise.ref’ argument). can potentially provide accurate representation ambient noise. margins overlap another acoustic signal nearby, SNR inaccurate, margin length carefully considered. SNR less equal one suggests background noise equal overpowering acoustic signal. SNR can measured follows: output also similar functions:   Negative values can occur background noise measured higher power signal. Note function compare sounds references, reference column added.","code":"# run signal to noise ratio snr <- signal_to_noise_ratio(test_sounds_est, pb = FALSE, noise.ref = \"custom\", mar = 0.1) # print output snr"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"tail-to-signal-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Tail-to-signal ratio","title":"Quantify degradation","text":"Tail--signal ratio (TSR) used quantify reverberations. Specifically TSR measures ratio energy reverberation tail (time segment right sound) energy sound. general margin reverberation tail measured must specified. function measure TSR within supplied frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). Two methods calculating reverberations provided (see ‘type’ argument). Type 1 based original description TSR Dabelsteen et al. (1993) type 2 better referred “tail--noise ratio”, given compares amplitude tails ambient noise. types higher values represent reverberations. TSR can measured follows: , output similar functions: Tail--signal ratio values typically negative signals tend higher power reverberating tail.  ","code":"# run tail to signal ratio tsr <- tail_to_signal_ratio(test_sounds_est, tsr.formula = 1, mar = 0.05) # print output tsr"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrogram-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrogram correlation","title":"Quantify degradation","text":"Finally, function spcc() measures spectrogram cross-correlation metric sound distortion sounds. Values close 1 means similar spectrograms (.e. little sound distortion). function wrapper warbleR’s cross_correlation(). can run follows: , output similar functions:  ","code":"# run spcc sc <- spcc(X = test_sounds_est, wl = 512) # print output sc"},{"path":[]},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"noise-profiles","dir":"Articles","previous_headings":"Setting reference sounds > Other measurements","what":"Noise profiles","title":"Quantify degradation","text":"function noise_profile() allows estimate frequency spectrum ambient noise. can done extended selection tables (using segments containing sound) entire sound files working directory (path supplied). function uses seewave function meanspec() internally calculate frequency spectra. following code measures ambient noise profile recordings distance >= 5m example extended selection table: output data frame amplitude values frequency bins wave object extended selection table: can graphically represented follows: output data actually average several frequency spectra sound file. can obtain original spectra setting argument averaged = FALSE: Note can limit frequency range using bandpass filter (‘bp’ argument). addition, argument ‘hop.size’, control size time windows, affects precision frequency domain. can get better precision increasing ‘hop.size’ (‘wl’): function can estimate noise profiles entire sound files, supplying list files (argument ‘files’, supplying ‘X’) simply running without supplying ‘X’ ‘files’. case run sound files working directory (‘path’ supplied). Please report bugs . package baRulho cited follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":"# run noise profile np <- noise_profile(X = test_sounds_est[test_sounds_est$distance > 5,], mar = 0.05) 
[30mcomputing noise profile(s) (step 0 of 0):
[39m # print output head(np, 20) ggplot(np, aes(y = amp, x = freq, col = sound.files)) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() np <- noise_profile(X = test_sounds_est[test_sounds_est$distance > 5, ], mar = 0.1, averaged = FALSE) # make a column containing sound file and selection np$sf.sl <- paste(np$sound.files, np$selec) ggplot(np, aes( y = amp, x = freq, col = sound.files, group = sf.sl )) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() np <- noise_profile( X = test_sounds_est[test_sounds_est$distance > 5,], mar = 0.05, bp = c(0, 10), averaged = FALSE, hop.size = 3 ) # make a column containing sound file and selection np$sf.sl <- paste(np$sound.files, np$selec) ggplot(np, aes( y = amp, x = freq, col = sound.files, group = sf.sl )) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() Warning: 
[1m
[22mRemoved 20 rows containing missing values or values outside the scale range (`geom_line()`)."},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Quantify degradation","text":"Araya-Salas, M. (2017). Rraven: connecting R Raven bioacoustic software. R package version 1.0.0. Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0 Araya-Salas M, Smith-Vidaurre G. (2017) warbleR: R package streamline analysis animal acoustic signals. Methods Ecol Evol 8:184–191. Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34. Tobias, J. ., Aben, J., Brumfield, R. T., Derryberry, E. P., Halfwerk, W., Slabbekoorn, H., & Seddon, N. (2010). Song divergence sensory drive Amazonian birds. Evolution, 64(10), 2820-2839. Session information","code":"R version 4.4.2 (2024-10-31) Platform: aarch64-apple-darwin20 Running under: macOS Sonoma 14.7.1 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: UTC tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ggplot2_3.5.1 viridis_0.6.5 viridisLite_0.4.2 baRulho_2.1.2 [5] ohun_1.0.2 warbleR_1.1.33 NatureSounds_1.0.4 seewave_2.2.3 [9] tuneR_1.4.7 knitr_1.49 loaded via a namespace (and not attached): [1] gtable_0.3.6 rjson_0.2.23 xfun_0.49 bslib_0.8.0 [5] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 curl_6.0.1 [9] parallel_4.4.2 tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 [13] pkgconfig_2.0.3 KernSmooth_2.23-24 checkmate_2.3.2 desc_1.4.3 [17] lifecycle_1.0.4 farver_2.1.2 stringr_1.5.1 compiler_4.4.2 [21] textshaping_0.4.1 brio_1.1.5 munsell_0.5.1 htmltools_0.5.8.1 [25] class_7.3-22 sass_0.4.9 RCurl_1.98-1.16 yaml_2.3.10 [29] pkgdown_2.1.1 pillar_1.9.0 jquerylib_0.1.4 MASS_7.3-61 [33] classInt_0.4-10 cachem_1.1.0 Deriv_4.1.6 digest_0.6.37 [37] stringi_1.8.4 sf_1.0-19 labeling_0.4.3 fastmap_1.2.0 [41] grid_4.4.2 colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 [45] utf8_1.2.4 e1071_1.7-16 withr_3.0.2 scales_1.3.0 [49] backports_1.5.0 rmarkdown_2.29 httr_1.4.7 Sim.DiffProc_4.9 [53] signal_1.8-1 igraph_2.1.2 gridExtra_2.3 png_0.1-8 [57] ragg_1.3.3 kableExtra_1.4.0 pbapply_1.7-2 evaluate_1.0.1 [61] dtw_1.23-1 fftw_1.0-9 testthat_3.2.2 rlang_1.1.4 [65] Rcpp_1.0.13-1 glue_1.8.0 DBI_1.2.3 xml2_1.3.6 [69] svglite_2.1.3 rstudioapi_0.17.1 jsonlite_1.8.9 R6_2.5.1 [73] systemfonts_1.1.0 fs_1.6.5 units_0.8-5"},{"path":"https://marce10.github.io/baRulho/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Marcelo Araya-Salas. Author, maintainer. Michael Mahoney. Reviewer. Dena Clink. Reviewer.","code":""},{"path":"https://marce10.github.io/baRulho/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":"@Article{, journal = {bioRxiv}, title = {baRulho: quantifying habitat-induced degradation of (animal) acoustic signals in R}, author = {M. Araya-Salas and Erin E. Grabarczyk and Marcos Quiroz-Oliva and Adrian Garcia-Rodriguez and Alejandro Rico-Guevara}, year = {2023}, }"},{"path":"https://marce10.github.io/baRulho/index.html","id":"barulho-quantifying-degradation-of-animal-sounds","dir":"","previous_headings":"","what":"Quantifying (Animal) Sound Degradation","title":"Quantifying (Animal) Sound Degradation","text":"baRulho intended facilitate implementation (animal) sound transmission experiments, typically aim quantify changes signal structure transmitted given habitat broadcasting re-recording animal sounds increasing distances. experiments aim answer research questions : habitat structure shaped transmission properties animal acoustic signals? acoustic features shaped selection improving transmission? features degraded different habitats? far acoustic signals can detected? common sequence steps experimentally test hypotheses related sound transmission depicted following diagram: Diagram depicting typical workflow experiment working signal transmission degradation. Nodes black font indicate steps can conducted using baRulho functions. Blue nodes denote functions can used steps.   baRulho offers functions critical steps workflow (black, including ‘checks’) required acoustic data manipulation analysis. main features package : use loops apply tasks sounds referenced selection table (sensu warbleR) production image files graphic representations sound time /frequency let users verify acoustic analyses use annotation tables object format input acoustic data annotations output results use parallelization distribute tasks among several cores improve computational efficiency baRulho builds upon functions data formats warbleR seewave packages, experience packages advised. Take look vignettes overview main features packages: Align test sounds Quantify degradation","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"installing-barulho","dir":"","previous_headings":"","what":"Installing baRulho","title":"Quantifying (Animal) Sound Degradation","text":"Install/load package CRAN follows: can also install R-Universe way: install latest developmental version github need R package remotes: system requirements due dependency seewave may needed. Take look link instruction install/troubleshoot external dependencies.","code":"# From CRAN would be # install.packages(\"baRulho\") # load package library(baRulho) install.packages(\"baRulho\", repos = \"https://ropensci.r-universe.dev\") ## Installing package into '/home/m/R/x86_64-pc-linux-gnu-library/4.1' ## (as 'lib' is unspecified) # install remotes if not installed if (!requireNamespace(\"remotes\")) { install.packages(\"remotes\") } # From github remotes::install_github(\"ropensci/baRulho\") # load package library(baRulho)"},{"path":"https://marce10.github.io/baRulho/index.html","id":"other-packages","dir":"","previous_headings":"","what":"Other packages","title":"Quantifying (Animal) Sound Degradation","text":"packages seewave tuneR provide huge variety functions acoustic analysis manipulation. mostly work wave objects already imported R environment. package warbleR provides functions visualize measure sounds already referenced annotation tables, similar baRulho. package Rraven facilitates exchange data R Raven sound analysis software (Cornell Lab Ornithology) can helpful incorporating Raven annotating tool acoustic analysis workflow R. package ohun works automated detection sound events, providing functions diagnose optimize detection routines.","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Quantifying (Animal) Sound Degradation","text":"Please cite baRulho follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Quantifying (Animal) Sound Degradation","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":null,"dir":"Reference","previous_headings":"","what":"Add synthetic noise — add_noise","title":"Add synthetic noise — add_noise","text":"add_noise adds synthetic noise annotations extended selection tables","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add synthetic noise — add_noise","text":"","code":"add_noise( X, mar = NULL, target.snr = 2, precision = 0.1, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), max.iterations = 1000, kind = c(\"pink\", \"white\", \"brown\", \"red\", \"power\"), alpha = 1, ... )"},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add synthetic noise — add_noise","text":"X Object class 'extended_selection_table' (created function selection_table warbleR package), generated 'element', reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds (needed calculate signal noise ratio internally using signal_to_noise_ratio). mar numeric vector length 1. Specifies margins adjacent start point annotation measure ambient noise. target.snr numeric vector length 1. Specifies desired signal--noise ratio. Must lower current signal--noise ratio. Annotations showing signal--noise ratio higher 'target.snr' remain unchanged. Must supplied. precision numeric vector length 1. Specifies precision adjusted signal--noise ratio (dB). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). max.iterations Numeric vector length 1. Specifies maximum number iterations internal signal--noise adjusting routine run stopping. Note cases default maximum number iterations (1000) reached. kind Character vector length 1 indicating kind noise, “white”, “pink”, “power”, \"brown\", “red”. Noise synthesized modified version function noise. Default \"pink\" similar background noise natural environments. alpha Numeric vector length 1. power power law noise (defaults 1 pink 1.5 red noise). used kind = \"power\". ... Additional arguments passed internally signal_to_noise_ratio.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add synthetic noise — add_noise","text":"Object 'X' wave objects modified match target signal--noise ratio. also includes additional column, 'adjusted.snr', new signal--noise ratio values.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add synthetic noise — add_noise","text":"function adds synthetic noise sounds referenced extended selection table (class created function selection_table warbleR package) decrease signal--noise ratio. can useful, instance, evaluating effect background noise signal structure. Note implementation slow.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add synthetic noise — add_noise","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305. Timmer. J M. König (1995): generating power law noise. Astron. Astrophys. 300, 707-710.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add synthetic noise — add_noise","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add synthetic noise — add_noise","text":"","code":"if (FALSE) { # \\dontrun{ # load example data data(\"test_sounds_est\") # make it a 'by element' extended selection table X <- warbleR::by_element_est(X = test_sounds_est) # add noise to the first five rows X_noise <- add_noise(X = X[1:5, ], mar = 0.2, target.snr = 3) } # }"},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Align test sound files — align_test_files","title":"Align test sound files — align_test_files","text":"align_test_files aligns test (re-recorded) sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align test sound files — align_test_files","text":"","code":"align_test_files( X, Y, path = getOption(\"sound.files.path\", \".\"), by.song = TRUE, marker = NULL, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), ... )"},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align test sound files — align_test_files","text":"X object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package). data used finding position markers find_markers. also contain 'sound.id' column used label re-recorded sounds according counterpart master sound file. Y object class 'data.frame' output find_markers. object contains position markers re-recorded sound files. one marker supplied sound file one highest correlation score ('scores' column 'X') used. path Character string containing directory path test (re-recorded) sound files found. .song Logical argument indicate extended selection table created song (see '.song' selection_table argument). Default TRUE. marker Character string define whether \"start\" \"end\" marker used aligning re-recorded sound files. Default NULL. DEPRECATED. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). ... Additional arguments passed selection_table customizing extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align test sound files — align_test_files","text":"object class 'X' aligned sounds test (re-recorded) sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align test sound files — align_test_files","text":"function aligns sounds found re-recorded sound files (referenced 'Y') according master sound file (referenced 'X'). one marker supplied sound file one highest correlation score ('scores' column 'X') used. function outputs 'extended selection table' default.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Align test sound files — align_test_files","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Align test sound files — align_test_files","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Align test sound files — align_test_files","text":"","code":"{ # load example data data(list = c(\"master_est\", \"test_sounds_est\")) # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # get marker position for the first test file markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[1], path = tempdir()) # align all test sounds alg.tests <- align_test_files(X = master_est, Y = markers, path = tempdir()) } #> computing correlations (step 1 of 0): #> all selections are OK #>"},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate attenuation of sound pressure level — attenuation","title":"Estimate attenuation of sound pressure level — attenuation","text":"attenuation estimates atmospheric attenuation atmospheric absorption.","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate attenuation of sound pressure level — attenuation","text":"","code":"attenuation( frequency, dist0, dist, temp = 20, rh = 60, pa = 101325, hab.att.coef = 0.02 )"},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate attenuation of sound pressure level — attenuation","text":"frequency Numeric vector length 1 frequency (Hertz). dist0 Numeric vector length 1 distance (m) reference SPL. dist Numeric vector length 1 distance (m) sound propagates. temp Numeric vector length 1 frequency (Celsius). Default 20. rh Numeric vector length 1 relative humidity (percentage). Default 60. pa Numeric vector length 1 atmospheric (barometric) pressure Pa (standard: 101325, default). Used atmospheric attenuation. hab.att.coef Attenuation coefficient habitat (dB/kHz/m).","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate attenuation of sound pressure level — attenuation","text":"Returns geometric, atmospheric habitat attenuation (dB) well combined attenuation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate attenuation of sound pressure level — attenuation","text":"Calculate geometric, atmospheric habitat attenuation overall expected attenuation (sum three) based temperature, relative humidity, atmospheric pressure sound frequency. Attenuation values given dB. function modified http://www.sengpielaudio.com","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate attenuation of sound pressure level — attenuation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate attenuation of sound pressure level — attenuation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate attenuation of sound pressure level — attenuation","text":"","code":"{ # measure attenuation attenuation(frequency = 2000, dist = 50, dist0 = 1) } #> frequency dist geometric.attenuation atmopheric.attenuation #> 1 2000 50 33.9794 0.4547757 #> habitat.attenuation combined.attenuation #> 1 1.96 36.39418"},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":null,"dir":"Reference","previous_headings":"","what":"Fix small misalignments in the time position test sounds — auto_realign","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"auto_realign fixes small misalignments time position test sounds extended selection table using spectrographic cross-correlation","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"","code":"auto_realign( X, Y, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 90), wn = c(\"hanning\", \"hamming\", \"bartlett\", \"blackman\", \"flattop\", \"rectangle\") )"},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"X object class 'extended_selection_table' created function selection_table warbleR package. object must include following additional columns: 'sound.id', 'bottom.freq' 'top.freq'. Y object class 'extended_selection_table' (class created function selection_table warbleR package) master sound file annotations. data used finding position markers find_markers. also contain 'sound.id' column. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 90. High values slow function produce accurate results. Can set globally current R session via \"ovlp\" option (see options). wn character vector length 1 specifying window name ftwindow.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Object 'X' time parameters (columns 'start' 'end') tailored closely match start end reference sound.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Precise alignment crucial downstream measures sound degradation. function uses spectrographic cross-correlation align position time test sounds. master sound file used reference. function calls warbleR's cross_correlation internally align sounds using cross-correlation. output extended selection table contains new start end values alignment. Note function works improve alignments estimated position test sound already close actual position. Note 'X' 'Y' must extended selection tables sensu selection_table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"","code":"{ # load example data data(\"test_sounds_est\") data(\"master_est\") # create \"unaligned_test_sounds_est\" by # adding error to \"test_sounds_est\" start and end unaligned_test_sounds_est <- test_sounds_est set.seed(123) noise_time <- sample(c(0.009, -0.01, 0.03, -0.03, 0, 0.07, -0.007), nrow(unaligned_test_sounds_est), replace = TRUE) attr(unaligned_test_sounds_est, \"check.res\")$start <- unaligned_test_sounds_est$start <- unaligned_test_sounds_est$start + noise_time attr(unaligned_test_sounds_est, \"check.res\")$end <- unaligned_test_sounds_est$end <- unaligned_test_sounds_est$end + noise_time # re align realigned_est <- auto_realign(X = unaligned_test_sounds_est, Y = master_est) }"},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":null,"dir":"Reference","previous_headings":"","what":"baRulho: quantifying acoustic signal degradation — baRulho-package","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"`baRulho` package intended quantify habitat-induced degradation (animal) acoustic signals.","code":""},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"main features package : Loops apply tasks sounds referenced extended selection table comparison playback sounds re-recorded different distances functions allow parallelization tasks, distributes tasks among several processors improve computational efficiency. License: GPL (>= 2)","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"Marcelo Araya-Salas Maintainer: Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure blur ratio in the time domain — blur_ratio","title":"Measure blur ratio in the time domain — blur_ratio","text":"blur_ratio measures blur ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure blur ratio in the time domain — blur_ratio","text":"","code":"blur_ratio( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), env.smooth = getOption(\"env.smooth\", 200), envelopes = FALSE, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), n.samples = 100, path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure blur ratio in the time domain — blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope calculation (used internally env). Default 200. Can set globally current R session via \"env.smooth\" option (see options). envelopes Logical control envelopes returned (attributes, 'attributes(X)$envelopes'). Default FALSE. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Used applying bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). n.samples Numeric vector length 1 specifying number amplitude samples use representing amplitude envelopes. Default 100. null raw amplitude envelope used (note can result high RAM memory usage large data sets). Amplitude envelope values interpolated using approx. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure blur ratio in the time domain — blur_ratio","text":"Object 'X' additional column, 'blur.ratio', containing computed blur ratio values. envelopes = TRUE output include amplitude envelopes sounds attributes ('attributes(X)$envelopes').","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure blur ratio in the time domain — blur_ratio","text":"Blur ratio measures degradation sound change sound power time domain described Dabelsteen et al (1993). Low values indicate low degradation sounds. function measures blur ratio sounds reference playback re-recorded different distances. Blur ratio measured mismatch amplitude envelopes (expressed probability mass functions) reference sound re-recorded sound. converting envelopes probability mass functions effect energy attenuation removed, focusing analysis modification envelope shape. function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). 'sound.id' column must used tell function compare sounds belonging category (e.g. song-types). Two methods setting experimental design provided. wave objects extended selection table must sampling rate length envelopes comparable.","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure blur ratio in the time domain — blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure blur ratio in the time domain — blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure blur ratio in the time domain — blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) blur_ratio(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) blur_ratio(X = X) # get envelopes br <- blur_ratio(X = X, envelopes = TRUE) envs <- attributes(br)$envelopes # make distance a factor for plotting envs$distance <- as.factor(envs$distance) # plot rlang::check_installed(\"ggplot2\") library(ggplot2) ggplot(envs, aes(x= time, y = amp, col = distance)) + geom_line() + facet_wrap(~ sound.id) + scale_color_viridis_d() + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic() }"},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure detection distance of sound — detection_distance","title":"Measure detection distance of sound — detection_distance","text":"detection_distance detection distance sounds.","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure detection distance of sound — detection_distance","text":"","code":"detection_distance( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), path = getOption(\"sound.files.path\", \".\"), spl = NULL, spl.cutoff = NULL, temp = 20, rh = 60, pa = 101325, hab.att.coef = 0.02, max.distance = 1000, resolution = 0.1, subtract.bgn = TRUE, envelope = c(\"abs\", \"hil\"), mar = NULL )"},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure detection distance of sound — detection_distance","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). spl numeric vector length 1 specifying sound pressure level sounds. supplied measured sounds . spl.cutoff numeric vector length 1 specifying sound pressure level cutoff define sound longer detected. Ideally estimated based sound detection threshold species. temp Numeric vector length 1 frequency (Celsius). Default 20. rh Numeric vector length 1 relative humidity (percentage). Default 60. pa Numeric vector length 1 ambient pressure Pa (standard: 101325, default). Used Atmospheric attenuation. hab.att.coef Attenuation coefficient habitat (dB/kHz/m). max.distance Numeric vector length 1 maximum distance (m) detection evaluated. Note function calculates expected sound pressure level values along vector distances find distance expected sound pressure level equates 'spl.cutoff'. Default 1000 m. resolution Numeric vector length 1 distance resolution (m) estimated detection distance. Higher resolutions take longer estimate. Default 0.1 m. subtract.bgn Logical argument control SPL background noise excluded measured signal SPL. Default FALSE. envelope Character string vector method calculate amplitude envelopes (SPL measured, used required 'spl' supplied), env. Must either 'abs' (absolute envelope, default) 'hil' (Hilbert transformation). mar numeric vector length 1. Specifies margins adjacent start end points selection measure background noise. required subtract background noise sound pressure level (needed 'subtract.bgn = TRUE').","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure detection distance of sound — detection_distance","text":"Object 'X' additional column, 'detection.distance', containing computed detection distances (m).","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure detection distance of sound — detection_distance","text":"function computes maximum distance sound detected, calculated distance sound pressure level (SPL) goes specified SPL cutoff ('spl.cutoff')). returned additional column 'detection.distance' (m). function uses internally attenuation estimate SPL increasing values reaches defined cutoff. peak frequency (calculated power spectrum reference sound) reference sound sound ID used carrier frequency distance estimation. sound recorded lowest distance used reference. function assumes recordings made recording volume.","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure detection distance of sound — detection_distance","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure detection distance of sound — detection_distance","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure detection distance of sound — detection_distance","text":"","code":"if (FALSE) { # \\dontrun{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) detection_distance(X = X[X$distance %in% c(1, 10), ], spl.cutoff = 5, mar = 0.05) } # }"},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure amplitude envelope correlation — envelope_correlation","title":"Measure amplitude envelope correlation — envelope_correlation","text":"envelope_correlation measures amplitude envelope correlation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure amplitude envelope correlation — envelope_correlation","text":"","code":"envelope_correlation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), env.smooth = getOption(\"env.smooth\", 200), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure amplitude envelope correlation — envelope_correlation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). env.smooth Numeric vector length 1 determine length sliding window used sum smooth amplitude envelope calculation (used internally env). Can set globally current R session via \"env.smooth\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Object 'X' additional column, 'envelope.correlation', containing computed envelope correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Amplitude envelope correlation measures similarity two sounds time domain. function measures envelope correlation coefficients sounds reference playback re-recorded increasing distances. Values close 1 means similar amplitude envelopes (.e. little degradation occurred). envelopes different lengths (means sounds different lengths) cross-correlation used maximum correlation coefficient returned. Cross-correlation achieved sliding shortest sound along largest one computing correlation step. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing envelope correlation provided (see 'method' argument). Use blur_ratio create envelopes graphs.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Apol, C.., Sturdy, C.B. & Proppe, D.S. (2017). Seasonal variability habitat structure may shaped acoustic signals repertoires black-capped boreal chickadees. Evol Ecol. 32:57-74.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure amplitude envelope correlation — envelope_correlation","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) envelope_correlation(X = X) # method 2 # add reference to X X <- set_reference_sounds(X = test_sounds_est, method = 2) envelope_correlation(X = X) } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 11 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 5 more column(s) (sound.id, transect, distance, reference, envelope.correlation) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure excess attenuation — excess_attenuation","title":"Measure excess attenuation — excess_attenuation","text":"excess_attenuation measures excess attenuation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure excess attenuation — excess_attenuation","text":"","code":"excess_attenuation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 50), bp = \"freq.range\", path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure excess attenuation — excess_attenuation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 50. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure excess attenuation — excess_attenuation","text":"Object 'X' additional column, 'excess.attenuation', containing computed excess attenuation values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure excess attenuation — excess_attenuation","text":"Excess attenuation amplitude loss sound excess due spherical spreading (observed attenuation - expected attenuation). every doubling distance, sounds attenuate 6 dB loss amplitude (Morton, 1975; Marten & Marler, 1977). additional loss amplitude results energy loss excess expected occur distance via spherical spreading. represents power loss due additional factors like vegetation atmospheric conditions (Wiley & Richards, 1978). accounts attenuation additional factors : Ground absorption: sound energy can absorbed ground, especially environments like forests soft uneven terrain. Vegetation obstacles: trees, shrubs, obstacles can absorb scatter sound energy, reducing sound level geometric spreading alone predict. Air absorption: sound travels air, loses energy due air molecules absorbing sound waves, effect becomes pronounced longer distances. Wind temperature gradients: environmental factors can cause sound waves bend refract. Excess attenuation computed -20 * log10(rms(\"test signal\") / rms(\"reference signal\"))) - (20 * log10(1 / \"distance\") 'rms(..)' represents root mean square amplitude envelope. Low values indicate little additional attenuation. goal function measure excess attenuation sounds reference playback re-recorded increasing distances. 'sound.id' column must used indicate sounds belonging category (e.g. song-types). function compare sound type corresponding reference sound. Two approaches computing excess attenuation provided (see 'type' argument). NAs returned one envelopes completely flat (e.g. variation amplitude).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure excess attenuation — excess_attenuation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Dabelsteen, T., & Mathevon, N. (2002). songbirds sing intensively dawn?. Acta ethologica, 4(2), 65-72.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.Marten K, & Marler P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290.Morton ES. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34.Wiley, R., & Richards, D. G. (1978). Physical constraints acoustic communication atmosphere: implications evolution animal vocalizations. Behavioral Ecology Sociobiology, 3(1), 69-94.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure excess attenuation — excess_attenuation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure excess attenuation — excess_attenuation","text":"","code":"{ # load example data data(\"test_sounds_est\") # using method 1 # add reference to X X <- set_reference_sounds(X = test_sounds_est) excess_attenuation(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) # excess_attenuation(X = X) }"},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":null,"dir":"Reference","previous_headings":"","what":"Find acoustic markers on test sound files — find_markers","title":"Find acoustic markers on test sound files — find_markers","text":"find_markers find acoustic markers test (re-recorded) sound files using spectrographic cross-correlation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find acoustic markers on test sound files — find_markers","text":"","code":"find_markers( X, markers = c(\"start_marker\", \"end_marker\"), test.files = NULL, path = getOption(\"sound.files.path\", \".\"), pb = getOption(\"pb\", TRUE), cores = getOption(\"mc.cores\", 1), ... )"},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find acoustic markers on test sound files — find_markers","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference sounds master sound file. Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time, 4) \"end\": end time selections 5) \"sound.id\": unique identifier annotated sounds 'X'. Columns 'top.freq', 'bottom.freq' 'channel' optional. acoustic start end markers (added master_sound_file) labeled \"start_marker\" \"end_marker\" respectively. Required. markers Character vector name annotations (column 'sound.id') used templates cross-correlation. Default c(\"start_marker\", \"end_marker\"). Using one marker recommended time difference position can used evaluate precision detection (see 'Value' section). test.files Character vector length 1 name(s) test (re-recorded) file(s) search marker(s). supplied sound files 'path' used instead. path Character string containing directory path test (re-recorded) sound files found. pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). ... Additional arguments passed template_correlator setting cross-correlation parameters (e.g. 'wl', 'ovlp', etc).","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find acoustic markers on test sound files — find_markers","text":"data frame test file names, marker id, maximum cross-correlation score marker start end detected. two markers used function computes additional column, 'time.mismatch', compares time difference two markers test-files master sound file. perfect detection value must 0.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find acoustic markers on test sound files — find_markers","text":"function takes master sound file's reference data ('X') finds position acoustics markers ('markers' argument, included selections 'X') re-recorded sound files. used align signals found re-recorded sound files according master sound file referenced 'X'. position markers determined highest spectrogram cross-correlation value marker using functions template_correlator template_detector. Make sure master sound file (referred 'X') found folder re-recorded sound files. Take look package vignette information incorporate function sound degradation analysis workflow. cases markers correctly detected editing test sound files remove audio segments target sounds (start marker end marker) can improve performance. Using low 'hop.size' window length 'wl' (used internally template_correlator) can help improve precision spectrogram types (argument 'type' template_correlator) can sometimes show better performance markers highly degraded.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find acoustic markers on test sound files — find_markers","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find acoustic markers on test sound files — find_markers","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find acoustic markers on test sound files — find_markers","text":"","code":"{ # set temporary directory td <- tempdir() # load example data data(\"master_est\") # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(td, i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(td, \"master.wav\")) # set path and no progress bar in global options options(sound.files.path = td, pb = FALSE) # get marker position markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[2]) }"},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrograms to check test sound files alignment — manual_realign","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"manual_realign plots spectrograms visually inspect alignment precision test sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"","code":"manual_realign( X, Y, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\"), collevels = seq(-120, 0, 5), palette = viridis::viridis, duration = 2, mar = 0.2, step.lengths = c(5, 30), flim = NULL, label.col = \"white\", ext.window = TRUE, width = 10, height = 5, srt = 0, cex = 1, fast.spec = TRUE, marker = \"start_marker\", grid = 0.2, ... )"},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances. sound must unique ID within distance. Y object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) master sound file annotations. data used finding position markers find_markers. also contain 'sound.id' column. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). collevels numeric vector length 3. Specifies levels partition amplitude range spectrogram (dB). levels higher resolution spectrogram. Default seq(-120, 0, 1). palette Color palette function spectrogram. Default viridis. See spectro palettes. Palettes gray.2 may work better fast.spec = TRUE (argument can passed internal spectrogram function using \"...\"). duration numeric vector length 1. Specifies overall duration clip plotted. Notice initial part test files plotted enough tell precision alignment. mar numeric vector length 1. Specifies minimum margins adjacent () start marker used checking alignments (see 'marker' argument). Default 0.2. step.lengths Numeric vector length 2 indicating time length (ms) short (min(step.lengths)) long steps (max(step.lengths)) manually aligning spectrograms. Default c(5, 30). flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL plot spectrograms full frequency range (0 - nyquist frequency). label.col Character string controlling color lines sound ID labels. ext.window Logical. TRUE external graphic window used.Dimensions can set using 'width' 'height' arguments. Default TRUE. width Numeric vector length 1. Single value (inches) indicating width output image files. Default 10. height Numeric vector length 1. Single value (inches) indicating height output image files. Default 5. srt Numeric argument length 1. rotation (degrees) sound id labels. Default 0. cex Numeric argument length 1controlling size sound id text labels. Default 1. fast.spec Logical. TRUE image function used internally create spectrograms, substantially increases performance (much faster), although options become unavailable, collevels (amplitude scale). Default FALSE. marker Character string name marker used main reference checking/adjusting time alignments. Default 'start_marker'. Note can take sound IDs 'Y$sound.id'. grid Numeric vector length 1 controlling spacing vertical lines spectrogram. Default 0.2 s. Use 0 remove grid. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Creates multipanel graph spectrograms master test sound files users can interactively adjust alignment time. Return object similar input object 'X' start end sounds adjusted.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"function allows interactive adjustment alignment test sound files produced align_test_files. function generates multipanel graph spectrogram master sound file top test sound files, highlighting position correspondent test sounds order simplify assessing adjusting alignment. Spectrograms include first seconds sound files (controlled 'duration') usually enough tell precision alignment. lower spectrogram shows series 'buttons' users can click control test sound file spectrogram (low panel) needs moved left (\"<\") right (\">\"). Users can also reset spectrogram original position ('reset'), move next sound file 'X' (test sound file annotations) stop process (stop button). function returns object similar input object 'X' start end sounds adjusted.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"","code":"{ # load example data data(\"master_est\") # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # get marker position markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[2], path = tempdir()) # align all test sounds alg.tests <- align_test_files(X = master_est, Y = markers) # add error to alignment lag <- (as.numeric(as.factor(alg.tests$sound.files)) - 2) / 30 alg.tests$start <- alg.tests$start + lag alg.tests$end <- alg.tests$end + lag if(interactive()){ realigned_est <- manual_realign(X = alg.tests, Y = master_est, duration = 2, ovlp = 50, hop.size = 14, collevels = seq(-140, 0, 5), palette = viridis::mako, ext.window = FALSE) } }"},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":null,"dir":"Reference","previous_headings":"","what":"Extended selection table of master acoustic data — master_est","title":"Extended selection table of master acoustic data — master_est","text":"Extended selection table (est) acoustic data annotations master sound file synthetic sounds. synthetic sounds 2 s long, frequency modulated amplitude modulated. data created function selection_table warbleR package. re-recorded data generated sounds found example object test_sounds_est.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extended selection table of master acoustic data — master_est","text":"","code":"data(master_est)"},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Extended selection table of master acoustic data — master_est","text":"Extended selection table object warbleR format, contains annotations acoustic data.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Extended selection table of master acoustic data — master_est","text":"Marcelo Araya-Salas","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a master sound file — master_sound_file","title":"Create a master sound file — master_sound_file","text":"master_sound_file creates master sound file used playback experiments related sound degradation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a master sound file — master_sound_file","text":"","code":"master_sound_file( X, file.name, dest.path = getOption(\"dest.path\", \".\"), overwrite = FALSE, delay = 1, gap.duration = 1, amp.marker = 2, flim = c(0, 4), cex = 14, path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a master sound file — master_sound_file","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference model sounds. Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass 6) \"top.freq\": high frequency bandpass. optional 'sound.id' column can included use custom label sound output. column must contain unique id sound (labels repeated). supplied function make combining sound file selection columns. file.name Character string indicating name sound file. dest.path Character string containing directory path sound file saved. NULL (default) current working directory used instead. overwrite Logical argument determine function overwrite existing sound file file name. Default current working directory. delay Numeric vector length 1 control duration (s) silence gap beginning (end) sound file. can useful allow time start playback experiment. Default 1. gap.duration Numeric vector length 1 control duration (s) silence gaps placed sounds. Default 1 s. amp.marker Numeric vector length 1 use constant amplify markers amplitude. useful increase amplitude markers relation sounds, picked distances. Default 2. flim Numeric vector length 2 control frequency range markers found. NULL markers display across whole frequency range. Default c(0, 4). cex Numeric vector length 1 indicating font size start end markers. Default 14. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a master sound file — master_sound_file","text":".wav file 'path' well data frame R environment annotations (.e. time position) sounds master sound file additional column 'sound.id' provides unique id sound sound file. useful identifying/labeling sounds test (re-recorded) sound files downstream analyses.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a master sound file — master_sound_file","text":"function intended simplify creation master sound files playback experiments sound degradation studies. function clips sounds sound files (wave objects extended selection tables) concatenates single sound file. function also adds acoustic markers start end playback can used time-sync test (re-recorded) sounds facilitate streamlining degradation quantification. predefined limit duration output master sound file, although long constrained computer memory. reference, master sound files 10 min created 16GB RAM laptop computer.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create a master sound file — master_sound_file","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a master sound file — master_sound_file","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a master sound file — master_sound_file","text":"","code":"{ # load example data from warbleR data(list = c( \"Phae.long1\", \"Phae.long2\", \"Phae.long3\", \"Phae.long4\", \"lbh_selec_table\" )) # save sound files to temporary folder writeWave(Phae.long1, file.path(tempdir(), \"Phae.long1.wav\")) writeWave(Phae.long2, file.path(tempdir(), \"Phae.long2.wav\")) writeWave(Phae.long3, file.path(tempdir(), \"Phae.long3.wav\")) writeWave(Phae.long4, file.path(tempdir(), \"Phae.long4.wav\")) # make an extended selection table est <- selection_table( X = lbh_selec_table, extended = TRUE, path = tempdir() ) # create master sound file master.sel.tab <- master_sound_file( X = est, file.name = \"example_master\", dest.path = tempdir(), gap.duration = 0.3 ) if (FALSE) { # \\dontrun{ # the following code exports the selection table to Raven # using the Rraven package Rraven::exp_raven(master.sel.tab, path = tempdir(), file.name = \"example_master_selection_table\") } # } } #> all selections are OK #> #> The file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx'"},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure full spectrum sound noise profiles — noise_profile","title":"Measure full spectrum sound noise profiles — noise_profile","text":"noise_profile Measure full spectrum sound pressure levels (.e. noise profiles) sound files extended selection tables.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure full spectrum sound noise profiles — noise_profile","text":"","code":"noise_profile( X = NULL, files = NULL, mar = NULL, noise.ref = c(\"adjacent\", \"custom\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), path = getOption(\"sound.files.path\", \".\"), bp = NULL, hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), PSD = FALSE, norm = TRUE, dB = c(\"A\", \"B\", \"C\", \"D\", \"ITU\", \"max0\"), averaged = TRUE )"},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure full spectrum sound noise profiles — noise_profile","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances (needed \"custom\" noise reference, see \"noise.ref\" argument). Default NULL. files Character vector names wave files analyzed. Files must found 'path' supplied (working directory 'path' supplied). Default NULL. mar numeric vector length 1. Specifies margins adjacent start end points selection measure ambient noise. Required 'X' supplied ignored supplied. Default NULL. noise.ref Character vector length 1 determined noise segment must used measuring ambient noise. Ignored 'X' supplied. Two options available: adjacent: measure ambient noise right sound (using argument 'mar' define duration ambient noise segments). custom: measure ambient noise segments referenced selection table (labeled 'ambient' 'sound.id' column). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Default NULL. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude ratio calculations. PSD Logical control whether Probability Mass Function (probability distribution frequencies). See meanspec. Default FALSE. norm Logical control whether amplitude values normalized (divided maximum) highest value 1. See meanspec. Default TRUE. dB character string length 1 specifying type dB return: \"max0\" maximum dB value 0, \"\", \"B\", \"C\", \"D\", \"ITU\" common dB weights. See meanspec. Default \"\". averaged Logical control frequency spectra averaged within sound file. Default TRUE.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure full spectrum sound noise profiles — noise_profile","text":"data frame containing frequency spectra sound file wave object ('X' supplied class 'extended.selection.table').","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure full spectrum sound noise profiles — noise_profile","text":"function estimates full spectrum sound pressure levels (.e. noise profiles) ambient noise. can done data frames/(extended) selection tables (using segments containing target sound 'ambient' sound id) complete sound files working directory (path supplied). function uses meanspec internally calculate frequency spectra.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure full spectrum sound noise profiles — noise_profile","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305..","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure full spectrum sound noise profiles — noise_profile","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure full spectrum sound noise profiles — noise_profile","text":"","code":"{ # load example data data(\"test_sounds_est\") # measure on custom noise reference noise_profile(X = test_sounds_est, mar = 0.01, pb = FALSE, noise.ref = \"custom\") # remove noise selections so noise is measured right before the signals pe <- test_sounds_est[test_sounds_est$sound.id != \"ambient\", ] noise_profile(X = pe, mar = 0.01, pb = FALSE, noise.ref = \"adjacent\") } #> sound.files freq amp #> 1 10m_closed.wav 1.002273 -1.478756370 #> 2 10m_closed.wav 2.004545 -8.554912560 #> 3 10m_closed.wav 3.006818 -15.653879395 #> 4 10m_closed.wav 4.009091 -20.594564397 #> 5 10m_closed.wav 5.011364 -24.596826317 #> 6 10m_closed.wav 6.013636 -27.741536121 #> 7 10m_closed.wav 7.015909 -28.631141207 #> 8 10m_closed.wav 8.018182 -29.343274598 #> 9 10m_closed.wav 9.020455 -31.581649783 #> 10 10m_closed.wav 10.022727 -37.142756979 #> 11 10m_open.wav 1.002273 -1.470944432 #> 12 10m_open.wav 2.004545 -5.716210091 #> 13 10m_open.wav 3.006818 -14.060376878 #> 14 10m_open.wav 4.009091 -21.637019767 #> 15 10m_open.wav 5.011364 -28.007595476 #> 16 10m_open.wav 6.013636 -31.998254047 #> 17 10m_open.wav 7.015909 -33.040067144 #> 18 10m_open.wav 8.018182 -33.446761775 #> 19 10m_open.wav 9.020455 -36.054384166 #> 20 10m_open.wav 10.022727 -40.262096085 #> 21 1m_open.wav 1.002273 0.001384514 #> 22 1m_open.wav 2.004545 -4.328099010 #> 23 1m_open.wav 3.006818 -12.731830547 #> 24 1m_open.wav 4.009091 -20.519891620 #> 25 1m_open.wav 5.011364 -24.786032150 #> 26 1m_open.wav 6.013636 -27.331145913 #> 27 1m_open.wav 7.015909 -27.522403062 #> 28 1m_open.wav 8.018182 -27.601169568 #> 29 1m_open.wav 9.020455 -30.958903505 #> 30 1m_open.wav 10.022727 -36.213758740 #> 31 30m_closed.wav 1.002273 -5.018620398 #> 32 30m_closed.wav 2.004545 -19.660800804 #> 33 30m_closed.wav 3.006818 -26.467263845 #> 34 30m_closed.wav 4.009091 -29.190019017 #> 35 30m_closed.wav 5.011364 -33.368022266 #> 36 30m_closed.wav 6.013636 -37.485873353 #> 37 30m_closed.wav 7.015909 -39.725404754 #> 38 30m_closed.wav 8.018182 -42.088478865 #> 39 30m_closed.wav 9.020455 -44.455196777 #> 40 30m_closed.wav 10.022727 -47.253627732 #> 41 30m_open.wav 1.002273 -0.794205765 #> 42 30m_open.wav 2.004545 -5.394132145 #> 43 30m_open.wav 3.006818 -16.362837354 #> 44 30m_open.wav 4.009091 -21.711879855 #> 45 30m_open.wav 5.011364 -26.204882614 #> 46 30m_open.wav 6.013636 -26.312227870 #> 47 30m_open.wav 7.015909 -28.104324225 #> 48 30m_open.wav 8.018182 -28.673914281 #> 49 30m_open.wav 9.020455 -32.218532962 #> 50 30m_open.wav 10.022727 -34.076725570"},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"plot_aligned_sounds plots spectrograms visually inspect alignment precision test sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"","code":"plot_aligned_sounds( X, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 50), path = getOption(\"sound.files.path\", \".\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), collevels = seq(-120, 0, 5), palette = viridis::viridis, duration = 2, mar = 0.2, dest.path = getOption(\"dest.path\", \".\"), flim = NULL, col = \"white\", width = 7, height = 4, res = 100, label = TRUE, fast.spec = FALSE, srt = 0, cex = 1, ... )"},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances. sound must unique ID within distance. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). collevels numeric vector length 3. Specifies levels partition amplitude range spectrogram (dB). levels higher resolution spectrogram. Default seq(-40, 0, 1). seq(-115, 0, 1) produces spectrograms similar acoustic analysis software packages. palette Color palette function spectrogram. Default viridis. See spectro palettes. Palettes gray.2 may work better fast.spec = TRUE. duration numeric vector length 1. Specifies overall duration clip plotted. Notice initial part test files plotted enough tell precision alignment. mar numeric vector length 1. Specifies margins adjacent start first annotation included plot. dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL plot spectrograms full frequency range (0 - nyquist frequency). col Character string controlling color lines sound ID labels. width Numeric vector length 1. Single value (inches) indicating width output image files. Default 7. height Numeric vector length 1. Single value (inches) indicating height output image files. Default 4. res Numeric argument length 1. Controls image resolution. Default 100 (faster) although 300 - 400 recommended publication/presentation quality. label Logical control labels ('sound.id' column 'X') plotted. Default TRUE. fast.spec Logical. TRUE image function used internally create spectrograms, substantially increases performance (much faster), although options become unavailable, collevels (amplitude scale). Default FALSE. srt Numeric argument length 1. rotation (degrees) sound id labels. Default 0. cex Numeric argument length 1controlling size sound id text labels. Default 1. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Image files jpeg format spectrograms working directory, one sound file 'X'. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"functions aims simplify evaluation alignment test sound files align_test_files. function creates single spectrogram sound file (saved 'dest.path'). Spectrograms include first seconds sound files (controlled 'duration') usually enough tell precision alignment. plots include vertical lines denoting start end sound well sound ID ('sound.id' column 'X'). Note plot created R graphic device.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"","code":"{ # load example data data(\"test_sounds_est\") # plot (look into temporary working directory `tempdir()`) plot_aligned_sounds(X = test_sounds_est, dest.path = tempdir(), duration = 3, ovlp = 0) } #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx'"},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot blur ratio — plot_blur_ratio","title":"Plot blur ratio — plot_blur_ratio","text":"plot_blur_ratio plots time frequency blur ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot blur ratio — plot_blur_ratio","text":"","code":"plot_blur_ratio( X, type = c(\"envelope\", \"spectrum\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), env.smooth = getOption(\"env.smooth\", 200), spec.smooth = getOption(\"spec.smooth\", 5), res = 150, flim = c(\"-1\", \"+1\"), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), palette = viridis::viridis, collevels = seq(-120, 0, 5), dest.path = getOption(\"dest.path\", \".\"), path = getOption(\"sound.files.path\", \".\"), colors = viridis::viridis(3), n.samples = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot blur ratio — plot_blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. type Character vector length 1 indicating type blur ratio plot. two options 'envelope' (regular blur ratio blur_ratio, default) 'spectrum' (spectrum blur ratio spectrum_blur_ratio). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope calculation (used internally env). Default 200. spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. Can set globally current R session via \"spec.smooth\" option (see options). res Numeric argument length 1. Controls image resolution. Default 150 (faster) although 300 - 400 recommended publication/presentation quality. flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrograms, spectro. Default NULL. Alternatively, character vector similar c(\"-1\", \"1\") first number value added minimum bottom frequency 'X' second value added maximum top frequency 'X'. computed independently sound id frequency limit better fits frequency range annotated signals. useful test sounds show marked differences frequency ranges. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. used plotting. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). palette color palette function used assign colors plot, spectro. Default viridis. collevels Numeric vector indicating set levels used partition amplitude range spectrogram (dB) spectro. Default seq(-120, 0, 5). dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). colors Character vector length 4 containing colors used color identify reference sound (element 1), color identify test sound (element 2) color blurred region (element 3). n.samples Numeric vector length 1 specifying number amplitude samples (frequency bins spectrum = TRUE) use representing power distributions. Default 100. null raw power distribution used (note can result high RAM memory usage large data sets).","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot blur ratio — plot_blur_ratio","text":"returns 1 image file ('jpeg' format) blur ratio estimation, showing spectrograms sounds overlaid amplitude envelopes (power spectra spectrum = TRUE) probability mass functions (PMF). Spectrograms shown within frequency range reference sound. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot blur ratio — plot_blur_ratio","text":"function generates image files ('jpeg' format) possible blur ratio estimation 'X'. image files show spectrograms sounds overlaid power distribution (either amplitude envelopes power spectrum, see argument 'type') probability mass functions (PMF). output graphs highlight mismatch compared distribution represent estimated blur ratio returned either blur_ratio spectrum_blur_ratio. Spectrograms shown within frequency range reference sound also show dotted lines time (type = \"envelope\") frequency range (type = \"spectrum\") energy distributions computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot blur ratio — plot_blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot blur ratio — plot_blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot blur ratio — plot_blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # create plots plot_blur_ratio(X = X, dest.path = tempdir()) } #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx'"},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":null,"dir":"Reference","previous_headings":"","what":"Save multipanel plots with reference and test sounds — plot_degradation","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"plot_degradation creates multipanel plots (image files) reference test sounds distance transect.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"","code":"plot_degradation( X, nrow = 4, env.smooth = getOption(\"env.smooth\", 200), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), dest.path = getOption(\"dest.path\", \".\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), collevels = seq(-120, 0, 5), palette = viridis::viridis, flim = c(\"-1\", \"+1\"), envelope = TRUE, spectrum = TRUE, heights = c(4, 1), widths = c(5, 1), margins = c(2, 1), row.height = 2, col.width = 2, cols = viridis::mako(4, alpha = 0.3), res = 120, ... )"},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. nrow Numeric vector length 1 number rows per image file. Default 4. dynamically adjusted rows needed set. env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope power spectrum calculations (used internally env). Default 200. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. used plotting. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). collevels Numeric vector indicating set levels used partition amplitude range spectrogram (dB) spectro. Default seq(-120, 0, 5). palette color palette function used assign colors plot, spectro. Default viridis. flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL. Alternatively, character vector similar c(\"-1\", \"1\") first number value added minimum bottom frequency 'X' second value added maximum top frequency 'X'. computed independently sound id frequency limit better fits frequency range annotated signals. useful test sounds show marked differences frequency ranges. envelope Logical control envelopes plotted. Default TRUE. spectrum Logical control power spectra plotted. Default TRUE. heights Numeric vector length 2 control relative heights spectrogram (first number) amplitude envelope (second number) envelope = TRUE. Default c(4, 1). widths Numeric vector length 2 control relative widths spectrogram (first number) power spectrum (second number) spectrum = TRUE. Default c(5, 1). margins Numeric vector length 2 control relative time test sound (first number) adjacent margins (.e. adjacent background noise, second number) included spectrogram spectrum = TRUE. Default c(2, 1) means margin next sound half duration sound. Note spectrograms time length margins calculated ensure spectrograms match duration spectrogram longest sound. , argument controls margin longest sound. row.height Numeric vector length 1 controlling height (inches) sound panels output image file. Default 2. col.width Numeric vector length 1 controlling width (inches) sound panels output image file. Default 2. cols Character vector length 4 containing colors used background column row title panels (element 1), color amplitude envelopes (element 2), color power spectra (element 3), background color envelopes spectra (element 4). res Numeric argument length 1. Controls image resolution. Default 120 (faster) although 300 - 400 recommended publication/presentation quality. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"One ore image files multipanel figure spectrograms test sound distance, sound id transect. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"function aims simplify visual inspection sound degradation producing multipanel figures (saved 'dest.path') containing visualizations test sound reference. Sounds sorted distance (columns) transect (1). Visualizations include spectrograms, amplitude envelopes power spectra (last 2 optional). row includes copies sound id given transect (row label includes sound id first line transect second line), also including reference comes another transect. Ambient noise annotations (sound.id 'ambient') excluded. Amplitude envelopes power spectra computed using functions envelope (warbleR package) spec (seewave package) respectively. two visualizations show power distribution time frequency minimum maximum power values sound. Therefore scales necessarily comparable across panels.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"","code":"# \\donttest{ # load example data data(\"test_sounds_est\") # order so spectrograms from same sound id as close in the graph test_sounds_est <- test_sounds_est[order(test_sounds_est$sound.id), ] # set directory to save image files options(dest.path = tempdir()) # method 1 Y <- set_reference_sounds(X = test_sounds_est) # plot degradation spectrograms plot_degradation( X = Y, nrow = 3, ovlp = 95 ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' # using other color palettes plot_degradation( X = Y, nrow = 3, ovlp = 95, cols = viridis::magma(4, alpha = 0.3), palette = viridis::magma ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' # missing some data, 2 rows plot_degradation( X = Y[-3, ], nrow = 2, ovlp = 95, cols = viridis::mako(4, alpha = 0.4), palette = viridis::mako, wl = 200 ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' # changing marging and high overlap plot_degradation(X = Y, margins = c(5, 1), nrow = 6, ovlp = 95) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' # more rows than needed (will adjust it automatically) plot_degradation(X = Y, nrow = 10, ovlp = 90) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpfIPZgx' # }"},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Set reference for test sounds — set_reference_sounds","title":"Set reference for test sounds — set_reference_sounds","text":"set_reference_sounds set rows used reference test sound.","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set reference for test sounds — set_reference_sounds","text":"","code":"set_reference_sounds( X, method = getOption(\"method\", 1), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set reference for test sounds — set_reference_sounds","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances (transects 1) 8) \"distance\": distance (numeric) test sound re-recorded. 'transect' column labeling sounds recorded transect required 'method = 2'. 'X' can 1 copy given sound id distance transect-distance combination (column 'transect' supplied). addition, 'selec' column values 'X' duplicated within sound file ('sound.files' column) combination used refer specific rows output 'reference' column. method Integer vector length 1 indicate 'experimental design' measuring degradation. Two methods available: 1: compare sounds ('sound.id') counterpart recorded closest distance source (e.g. compare sounds recorded 5m, 10m 15m counterpart recorded 1m). default method. function try use references transect. However, another test sound 'sound.id' shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. 2: compare sounds counterpart recorded distance immediately within transect (e.g. sound recorded 10m compared sound recorded 5m, sound recorded 15m compared sound recorded 10m ). 'transect' column 'X' required. Can set globally current R session via \"method\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set reference for test sounds — set_reference_sounds","text":"object similar 'X' one additional column, 'reference', ID sounds used reference degradation-quantifying functions downstream analyses. ID created paste(X$sound.files, X$selec, sep = \"-\").","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set reference for test sounds — set_reference_sounds","text":"function adds 'reference' column defining sounds used functions reference. Two methods available (see 'methods' argument description). method 1 function attempt use re-recorded sounds shortest distance transect reference. However, another re-recorded sound 'sound.id' shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. Note users want define reference sound can set manually. , NAs must used indicate rows ignored. References must indicated combination 'sound.files' 'selec' column. instance, '10m.wav-1' indicates row 'selec' column '1' sound file '10m.wav' used reference. function also checks information 'X' right format wont produce errors downstream analysis (see 'X' argument description details format). function ignore rows column 'sound.id' equals 'ambient', 'start_marker' 'end_marker'.","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set reference for test sounds — set_reference_sounds","text":"Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: R package streamline analysis animal acoustic signals. Methods Ecology Evolution, 8(2), 184-191.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Set reference for test sounds — set_reference_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set reference for test sounds — set_reference_sounds","text":"","code":"{ # load example data data(\"test_sounds_est\") # save wav file examples X <- test_sounds_est[test_sounds_est$sound.files != \"master.wav\", ] # method 1 Y <- set_reference_sounds(X = X) # method 2 Y <- set_reference_sounds(X = X, method = 2) }"},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"signal_to_noise_ratio measures attenuation signal--noise ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"","code":"signal_to_noise_ratio( X, mar = NULL, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), eq.dur = FALSE, noise.ref = c(\"adjacent\", \"custom\"), snr.formula = 1, bp = \"freq.range\", hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances (needed \"custom\" noise reference, see \"noise.ref\" argument). mar numeric vector length 1. Specifies margins adjacent start point annotation measure ambient noise. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). eq.dur Logical. Controls whether ambient noise segment measured duration sound (TRUE. Default FALSE). TRUE 'mar' 'noise.ref' arguments ignored. noise.ref Character vector length 1 determined noise segment must used measuring ambient noise. Two options available: adjacent: measure ambient noise right test sounds (using argument 'mar' define duration ambient noise segments). custom: measure ambient noise segments referenced selection table (labeled 'ambient' 'sound.id' column). segments used apply ambient noise reference sounds sound file. Therefore, least one 'ambient' selection sound file must provided. several 'ambient' selections sound file supplied, root mean square amplitude envelope averaged across selections. snr.formula Integer vector length 1. Selects formula used calculate signal--noise ratio (S = signal , N = background noise): 1: ratio S amplitude envelope root mean square N amplitude envelope root mean square (20 * log10(rms(env(S))/rms(env(N)))) described Darden (2008). 2: ratio difference S amplitude envelope root mean square N amplitude envelope root mean square N amplitude envelope root mean square (20 * log10((rms(env(S)) - rms(env(N)))/rms(env(N))), described Dabelsteen et al (1993). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude ratios calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Object 'X' additional column, 'signal..noise.ratio', signal--noise ratio values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Signal--noise ratio (SNR) measures sound amplitude level relation ambient noise. Noise measured background noise immediately test sound. general margin ambient noise measured must specified. Alternatively, selection ambient noise can used reference (see 'noise.ref' argument). margins overlap another sound nearby, SNR inaccurate, margin length carefully considered. SNR less equal one suggests background noise equal overpowering sound. function measure signal--noise ratio within supplied frequency range (e.g. bandpass) reference signal ('bottom.freq' 'top.freq' columns 'X') default (, bp = 'freq.range'. SNR can ~0 tail signal low amplitude.","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Holland J, Dabelsteen T, Pedersen SB, Paris AL (2001) Potential ranging cues contained within energetic pauses transmitted wren song. Bioacoustics 12(1):3-20.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # using measure ambient noise reference selections signal_to_noise_ratio(X = test_sounds_est, mar = 0.05, noise.ref = \"custom\") # using margin for ambient noise of 0.05 and adjacent measure ambient noise reference signal_to_noise_ratio(X = test_sounds_est, mar = 0.05, noise.ref = \"adjacent\") } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 10 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 4 more column(s) (sound.id, transect, distance, signal.to.noise.ratio) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"spcc measures spectrographic cross-correlation measure sound distortion sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"","code":"spcc( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 90), wn = \"hanning\", path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying % overlap two consecutive windows, spectro. Default 90. High values ovlp slow function produce accurate results. Can set globally current R session via \"ovlp\" option (see options). wn character vector length 1 specifying window name ftwindow. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Object 'X' additional column, 'cross.correlation', containing computed spectrogram cross-correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Spectrographic cross-correlation measures frequency distortion sounds similarity metric. Values close 1 means similar spectrograms (.e. little sound distortion occurred). Cross-correlation measured sounds reference playback re-recorded increasing distances. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing cross-correlation provided (see 'method' argument). function wrapper warbleR's cross_correlation function.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # get spcc spcc(X = X) } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 11 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 5 more column(s) (sound.id, transect, distance, reference, cross.correlation) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"spectrum_blur_ratio measures blur ratio frequency spectra sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"","code":"spectrum_blur_ratio( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), spec.smooth = getOption(\"spec.smooth\", 5), spectra = FALSE, res = 150, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), n.bins = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. spectra Logical control power spectra returned (attributes). Default FALSE. res Numeric argument length 1. Controls image resolution. Default 150 (faster) although 300 - 400 recommended publication/presentation quality. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Applied spectra spectrograms image files. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). n.bins Numeric vector length 1 specifying number frequency bins use representing power spectra. Default 100. null raw power spectrum used (note can result high RAM memory usage large data sets). Power spectrum values interpolated using approx.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Object 'X' additional column, 'spectrum.blur.ratio', containing computed spectrum blur ratio values. spectra = TRUE output include power spectra sounds attributes ('attributes(X)$spectra').","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Spectral blur ratio measures degradation sound function change sound power frequency domain, analogous blur ratio proposed Dabelsteen et al (1993) time domain (implemented blur_ratio). Low values indicate low degradation sounds. function measures blur ratio spectra sounds reference playback re-recorded different distances. Spectral blur ratio measured mismatch power spectra (expressed probability density functions) reference sound re-recorded sound. function compares sound type corresponding reference sound. 'sound.id' column must used tell function compare sounds belonging category (e.g. song-types). Two methods setting experimental design provided. wave objects extended selection table must sampling rate length spectra comparable. function uses spec internally compute power spectra. NA returned least one power spectra computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # get spetrum blur ratio spectrum_blur_ratio(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) spectrum_blur_ratio(X = X) # get power spectra sbr <- spectrum_blur_ratio(X = X, spectra = TRUE) spctr <- attributes(sbr)$spectra # make distance a factor for plotting spctr$distance <- as.factor(spctr$distance) # plot rlang::check_installed(\"ggplot2\") library(ggplot2) ggplot(spctr[spctr$freq > 0.3, ], aes(y = amp, x = freq, col = distance)) + geom_line() + facet_wrap(~sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (PMF)\") + coord_flip() + theme_classic() }"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure frequency spectrum correlation — spectrum_correlation","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"spectrum_correlation measures frequency spectrum correlation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"","code":"spectrum_correlation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), spec.smooth = getOption(\"spec.smooth\", 5), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), n.bins = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). n.bins Numeric vector length 1 specifying number frequency bins use representing power spectra. Default 100. null raw power spectrum used (note can result high RAM memory usage large data sets). Power spectrum values interpolated using approx.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Object 'X' additional column, 'spectrum.correlation', containing computed frequency spectrum correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"spectral correlation measures similarity two sounds frequency domain. function measures spectral correlation coefficients sounds reference playback re-recorded increasing distances. Values range 1 (identical frequency spectrum, .e. degradation) 0. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compare sound corresponding reference sound. Two methods computing spectral correlation provided (see 'method' argument). function uses meanspec internally compute power spectra. Use spectrum_blur_ratio extract raw spectra values. NA returned least one power spectra computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Apol, C.., Sturdy, C.B. & Proppe, D.S. (2017). Seasonal variability habitat structure may shaped acoustic signals repertoires black-capped boreal chickadees. Evol Ecol. 32:57-74.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"","code":"{ # load example data data(\"test_sounds_est\") # method 1 # add reference column Y <- set_reference_sounds(X = test_sounds_est) # run spectrum correlation spectrum_correlation(X = Y) # method 2 Y <- set_reference_sounds(X = test_sounds_est, method = 2) # spectrum_correlation(X = Y) }"},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Create synthetic sounds — synth_sounds","title":"Create synthetic sounds — synth_sounds","text":"synth_sounds create synthetic sounds","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create synthetic sounds — synth_sounds","text":"","code":"synth_sounds( replicates = 1, frequencies, durations, nharmonics = 1, fm = FALSE, am = FALSE, am.amps = rep(c(1:4, 3:2), length.out = 11), mar = 0.05, seed = NULL, sig2 = 0.3, shuffle = FALSE, hrm.freqs = c(1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10), sampling.rate = 44.1, pb = TRUE )"},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create synthetic sounds — synth_sounds","text":"replicates Numeric vector length 1 indicating number replicates treatment combination. Default 1. Useful measuring variation transmission parameters. frequencies Numeric vector different frequencies (seconds) synthesize. Brownian bridge motion stochastic process (diff.fun == \"BB\") used simulate frequency modulation (see simulate_songs). durations Numeric vector different durations (seconds) synthesize. nharmonics Numeric vector length 1 specifying number harmonics simulate. 1 indicates fundamental frequency harmonic simulated. fm Logical control frequency modulated sounds pure tones (.e. non-modulated sounds) synthesize. FALSE (default) pure tones synthesized. Logical control amplitude modulated sounds non-modulated sounds synthesize. FALSE (default) non-modulated sounds synthesized. .amps Numeric vector relative amplitude time step simulate amplitude modulation (applied fundamental frequency). default value (rep(c(1:4, 3:2), length.= 11)) 2 amplitude peaks (although applied '= TRUE') mar Numeric vector duration margins silence around sounds seconds. Default 0.05. seed Numeric vector length 1. allows users get results different runs (using se.seed internally). Default NULL. sig2 Numeric vector length 1 defining sigma value brownian motion model (used simulating frequency modulation). Default 0.3. shuffle Logical control position sounds randomized. sounds treatment sequence can problematic environmental noise masks . Hence 'shuffle' useful avoid sounds treatment next . Default FALSE. hrm.freqs Numeric vector frequencies harmonics relative fundamental frequency. default values c(1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10). sampling.rate Numeric vector length 1. Sets sampling frequency wave object (kHz). Default 44.1. pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create synthetic sounds — synth_sounds","text":"extended selection table, can input master_sound_file create .wav file. table contains columns varying features 'treatment' column (useful tell acoustic features sound) 'replicate' column indicating replicates 'treatment'.","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create synthetic sounds — synth_sounds","text":"function creates synthetic sounds can used playback experiments understand link signal structure transmission properties. function can add variation signal structure 5 features: frequency: continuous, argument 'frequencies'. duration: continuous, argument 'durations'. harmonic structure: binary (harmonics vs -harmonics), arguments 'nharmonics' 'hrm.freqs'. frequency modulation: variation fundamental frequency across time. Binary (modulated vs non-modulated), arguments 'fm' 'sig2'. amplitude modulation: variation amplitude across time. Binary (modulated vs non-modulated), arguments '' '.amps'. Sound possible combinations selected structure dimensions synthesized. output extended selection table, can input master_sound_file create .wav file. functions uses simulate_songs internally synthesizing individual sounds. Brownian bridge motion stochastic process (diff.fun == \"BB\") used simulate frequency modulation. output table contains columns varying features 'treatment' column (useful tell sound combination features using replicates).","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create synthetic sounds — synth_sounds","text":"Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: R package streamline analysis animal acoustic signals. Methods Ecology Evolution, 8(2), 184-191.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create synthetic sounds — synth_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create synthetic sounds — synth_sounds","text":"","code":"if (FALSE) { # \\dontrun{ synthetic_est <- synth_sounds( mar = 0.01, frequencies = c(1, 2, 3, 5), durations = 0.1, fm = TRUE, am = TRUE, nharmonics = 4, shuffle = TRUE, replicates = 3 ) } # }"},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"tail_to_signal_ratio measures reverberations tail--signal ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"","code":"tail_to_signal_ratio( X, mar, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), tsr.formula = 1, bp = \"freq.range\", hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass 6) \"top.freq\": high frequency bandpass. mar numeric vector length 1. Specifies margins adjacent end sound measure tail power. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). tsr.formula Integer vector length 1. Determine formula used calculate tail--signal ratio (S = signal, T = tail, N = background noise): 1: ratio T amplitude envelope quadratic mean S amplitude envelope quadratic mean (rms(env(T))/rms(env(S))) described Dabelsteen et al. (1993). 2: ratio T amplitude envelope quadratic mean N amplitude envelope quadratic mean (rms(env(T))/rms(env(N))). N measure margin right sound. tsr.formula 2 actually measures tail--noise ratio. bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). Note might internally adjusted number samples tail lower hop.size. wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Object 'X' additional column, 'tail..signal.ratio', tail--signal ratio values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Tail--signal ratio (TSR) measures ratio power tail reverberations test sound. general margin reverberation tail measured must specified. function measure TSR within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing reverberations provided (see 'tsr.formula' argument). Note 'tsr.formula' 2 equivalent original description TSR Dabelsteen et al. (1993) better referred tail--noise ratio. Tail--signal ratio values typically negative signals tend higher power reverberating tail. TSR can ~0 tail signal low amplitude.","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.Mathevon, N., Dabelsteen, T., & Blumenrath, S. H. (2005). high perches blackcap Sylvia atricapilla song listening posts? sound transmission study. Journal Acoustical Society America, 117(1), 442-449.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # set global options options(pb = FALSE) # using margin for noise of 0.01 tsr <- tail_to_signal_ratio(X = test_sounds_est, mar = 0.01) # use tsr.formula 2 which is equivalent to tail-to-noise ratio tsr <- tail_to_signal_ratio(X = test_sounds_est, mar = 0.01, tsr.formula = 2) }"},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":null,"dir":"Reference","previous_headings":"","what":"Extended selection table with re-recorded playbacks — test_sounds_est","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Extended selection table (est) 7 re-recorded synthetic sounds. synthetic sounds 2 s long, frequency modulated, amplitude modulated, broadcast re-recorded 3 distances (1, 10 30m, column 'distance'). data created function selection_table warbleR package. master sound file data used create test sounds found example object master_est.","code":""},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"","code":"data(test_sounds_est)"},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Extended selection table object warbleR format, contains annotations acoustic data.","code":""},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Marcelo Araya-Salas","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-212","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.2","title":"baRulho 2.1.2","text":"CRAN release: 2024-08-31","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-2-1-2","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 2.1.2","text":"Improved tracking progress messages 1 progress bar used process","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-211","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.1","title":"baRulho 2.1.1","text":"Update requested CRAN fix package reference issue. changes code.","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-210","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.0","title":"baRulho 2.1.0","text":"CRAN release: 2024-04-21","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"new-features-2-1-0","dir":"Changelog","previous_headings":"","what":"NEW FEATURES","title":"baRulho 2.1.0","text":"new function add_noise() modifying signal--noise ratio adding synthetic noise new function manual_realign() generates interactive plot manual adjustment time alignments new function plot_blur_ratio() generates plots previously created blur_ratio() spectrum_blur_ratio() new function plot_degradation() visually compare sounds across distances new function plot_aligned_sounds() visually assess precision test sound alignment align_test_files() now can take several markers input select highest correlation score aligning test files New function attenuation() Data frames selection tables can used input data Added new methods blur_ratio() excess_atenuation() spectral_correlation() spectral_blur_ratio() renamed spectrum_correlation(), spectrum_blur_ratio() respectively","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-2-1-0","dir":"Changelog","previous_headings":"NEW FEATURES","what":"MINOR IMPROVEMENTS","title":"baRulho 2.1.0","text":"optimize performance signal_to_noise_ratio() atmospheric_attenuation() longer available (use attenuation() instead) Improved documentation functions Fix bug spcc() excess_attenuation() ‘markers’ argument deprecated align_test_files() fix bug auto_realign() find_markers() compares time difference markers master sound file measure precision find_markers() can run several markers templates files ‘template.rows’ argument deprecated find_markers() spcc_align() renamed auto_realign() search_templates() renamed find_markers() ‘output’ argument deprecated ‘parallel’ argument deprecated replaced ‘cores’","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-106","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.6","title":"baRulho 1.0.6","text":"CRAN release: 2022-03-01 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-105","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.5","title":"baRulho 1.0.5","text":"CRAN release: 2021-04-21 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-104","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.4","title":"baRulho 1.0.4","text":"CRAN release: 2021-03-09","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-4","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.4","text":"warbleR::freq_range_detec() now used internally detect frequency range markers master_sound_file()","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-103","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.3","title":"baRulho 1.0.3","text":"CRAN release: 2021-02-11 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-103-1","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.3","title":"baRulho 1.0.3","text":"CRAN release: 2021-02-11","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-3","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.3","text":"New argument ‘marker’ align_test_files() control start end marker used aligning Fix bug detecting several templates per sound file search_templates()","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-102","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.2","title":"baRulho 1.0.2","text":"CRAN release: 2020-06-07","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-2","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.2","text":"Windows length converted even functions Fix sign error signal amplitude measurements (signal_to_noise_ratio() excess_attenuation()) New function noise_profile() rename snr() signal_to_noise_ratio() New function tail_to_signal_ratio() measure reverberations Fix bug excess_attenuation() method = 1 Added type argument excess_attenuation() run “Darden” version excess attenuation","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-101","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.1","title":"baRulho 1.0.1","text":"CRAN release: 2020-03-09","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"new-features-1-0-1","dir":"Changelog","previous_headings":"","what":"NEW FEATURES","title":"baRulho 1.0.1","text":"New function search_templates() find signals re-recorded sound files New function align_test_files() set time signals aligned re-recorded files Parallel available internal prep_X_bRlo_int() function Data frame also returned functions","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-100","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.0","title":"baRulho 1.0.0","text":"CRAN release: 2020-02-22 First release","code":""}] +[{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing","title":"Contributing","text":"First , thanks taking time contribute! types contributions encouraged valued. See Table Contents different ways help details project handles . Please make sure read relevant section making contribution. make lot easier us maintainers smooth experience involved. community looks forward contributions. like project, just don’t time contribute, ’s fine. easy ways support project show appreciation, also happy : - Star project - Tweet - Refer project project’s readme - Mention project local meetups tell friends/colleagues","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of Contents","title":"Contributing","text":"Code Conduct Question Want Contribute Reporting Bugs Suggesting Enhancements","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing","text":"Please note baRulho released Contributor Code Conduct. contributing project agree abide terms. See rOpenSci contributing guide details.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"i-have-a-question","dir":"","previous_headings":"","what":"I Have a Question","title":"Contributing","text":"want ask question, assume read available Documentation. ask question, best search existing Issues might help . case found suitable issue still need clarification, can write question issue. also advisable search internet answers first. still feel need ask question need clarification, recommend following: Open https://github.com/ropensci/baRulho/issues/. Provide much context can ’re running . Provide project platform versions (nodejs, npm, etc), depending seems relevant. take care issue soon possible.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"i-want-to-contribute","dir":"","previous_headings":"","what":"I Want To Contribute","title":"Contributing","text":"contributing project, must agree authored 100% content, necessary rights content content contribute may provided project license.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"before-submitting-a-bug-report","dir":"","previous_headings":"I Want To Contribute > Reporting Bugs","what":"Before Submitting a Bug Report","title":"Contributing","text":"good bug report shouldn’t leave others needing chase information. Therefore, ask investigate carefully, collect information describe issue detail report. Please complete following steps advance help us fix potential bug fast possible. Make sure using latest version. Determine bug really bug error side e.g. using incompatible environment components/versions (Make sure read documentation. looking support, might want check section). see users experienced (potentially already solved) issue , check already bug report existing bug erro. Also make sure search internet (including Stack Overflow) see users outside GitHub community discussed issue. Collect information bug: Stack trace (Traceback) OS, Platform Version (Windows, Linux, macOS, x86, ARM) Version interpreter, compiler, SDK, runtime environment, package manager, depending seems relevant. Possibly input output Can reliably reproduce issue? can also reproduce older versions?","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"how-do-i-submit-a-good-bug-report","dir":"","previous_headings":"I Want To Contribute > Reporting Bugs","what":"How Do I Submit a Good Bug Report?","title":"Contributing","text":"must never report security related issues, vulnerabilities bugs including sensitive information issue tracker, elsewhere public. Instead sensitive bugs must sent email marcelo.araya@ucr.ac.cr. use GitHub issues track bugs errors. run issue project: Open Issue. (Since can’t sure point whether bug , ask talk bug yet label issue.) Explain behavior expect actual behavior. Please provide much context possible describe reproduction steps someone else can follow recreate issue . usually includes code. good bug reports isolate problem create reduced test case. Provide information collected previous section. ’s filed: project team label issue accordingly. team member try reproduce issue provided steps. reproduction steps obvious way reproduce issue, team ask steps mark issue needs-repro. Bugs needs-repro tag addressed reproduced. team able reproduce issue, marked needs-fix, well possibly tags (critical), issue left implemented someone.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"suggesting-enhancements","dir":"","previous_headings":"I Want To Contribute","what":"Suggesting Enhancements","title":"Contributing","text":"section guides submitting enhancement suggestion, including completely new features minor improvements existing functionality. Following guidelines help maintainers community understand suggestion find related suggestions.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"before-submitting-an-enhancement","dir":"","previous_headings":"I Want To Contribute > Suggesting Enhancements","what":"Before Submitting an Enhancement","title":"Contributing","text":"Make sure using latest version. Read documentation carefully find functionality already covered, maybe individual configuration. Perform search see enhancement already suggested. , add comment existing issue instead opening new one. Find whether idea fits scope aims project. ’s make strong case convince project’s developers merits feature. Keep mind want features useful majority users just small subset. ’re just targeting minority users, consider writing add-/plugin library.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"how-do-i-submit-a-good-enhancement-suggestion","dir":"","previous_headings":"I Want To Contribute > Suggesting Enhancements","what":"How Do I Submit a Good Enhancement Suggestion?","title":"Contributing","text":"Enhancement suggestions tracked GitHub issues. Use clear descriptive title issue identify suggestion. Provide step--step description suggested enhancement many details possible. Describe current behavior explain behavior expected see instead . point can also tell alternatives work . may want include screenshots animated GIFs help demonstrate steps point part suggestion related . can use tool record GIFs macOS Windows, tool tool Linux. Explain enhancement useful users. may also want point projects solved better serve inspiration.","code":""},{"path":"https://marce10.github.io/baRulho/CONTRIBUTING.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributing","text":"guide based contributing.md. Make !","code":""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"glossary","dir":"Articles","previous_headings":"","what":"Glossary","title":"Synthesize and align test sounds","text":"-Model sound: sound transmission properties studied, usually found original field recordings synthetic sound files. -Reference sound: sound use pattern compare . Usually created re-recording model sound broadcast 1 m source (speaker). -Sound ID: ID sounds used identify counterparts across distances. sound must unique ID within distance. -Ambient noise: energy background sounds recording, excluding sounds interest. -Test sound: sounds re-recorded far source test transmission/degradation (also refer ‘re-recorded’ sounds). -Degradation: loose term used describe changes structure sound transmitted habitat.","code":""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"synthesize-sounds","dir":"Articles","previous_headings":"","what":"Synthesize sounds","title":"Synthesize and align test sounds","text":"often want figure transmission properties vary across range frequencies. instance, Tobias et al (2010) studied whether acoustic adaptation (special case sensory drive; Morton 1975), explain song evolution Amazonian avian communities. test authors created synthetic pure tone sounds used playback re-recorded different habitats. actual procedure creating synthetic sounds described : “Tones synthesized six different frequencies (0.5, 1.0, 2.0, 3.0, 4.0, 5.0 kHz) encompass range maximum avian auditory sensitivity (Dooling 1982). frequency, generated two sequences two 100-msec tones. One sequence relatively short interval 150 msec, close mean internote interval sample (152± 4 msec). sequence longer interval 250 msec, close mean maximum internote interval sample (283± 74 msec). first sequence reflects fast-paced song second slower paced song (sensu Slabbekoorn et al. 2007). master file (44100 Hz/16 bit WAV) thereby consisted series 12 pairs artificial 100-ms constant-frequency tones six different frequencies (0.5, 1.0, 2.0, 3.0, 4.0, 5.0 kHz).” can synthesize pure tones using function synth_sounds(). function requires 1) frequencies tones synthesize (argument frequencies, kHz) 2) duration tones (durations, seconds). addition, logical arguments fm allow create frequency amplitude modulated sounds respectively. case need six tones 100 ms 0.5, 1, 2, 3, 4, 5 kHz separated intervals 150 ms (least first synthetic file described Tobias et al 2010). can also get selection table (sensu warbleR) information time frequency location every sound. required order make master sound file. get selection table need set argument selec.table = TRUE. can done follows:   function can add complexity additional acoustic dimensions. instance following code generates possible combinations frequencies (2, 3 4 kHz), durations (0.1, 0.2 s), frequency modulation (tonal modulated) amplitude modulation (flat modulated envelope): Note output extended selection table contains time-frequency annotations synthetic sounds:   extended selection table, ‘sound.files’ column refers Wave objects included attributes instead files directory:  ","code":"# load packages library(viridis) Loading required package: viridisLite library(baRulho) Loading required package: warbleR Loading required package: tuneR Loading required package: seewave Loading required package: NatureSounds Loading required package: ohun Please cite 'ohun' as: Araya-Salas, M., Smith-Vidaurre, G., Chaverri, G., Brenes, J. C., Chirino, F., Elizondo-Calvo, J., & Rico-Guevara, A. 2023. ohun: an R package for diagnosing and optimizing automatic sound event detection. Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.14170 Please cite 'baRulho' as: Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, A. Garcia-Rodriguez, A. Rico-Guevara. (2023), baRulho: an R package to quantify degradation in animal acoustic signals .bioRxiv 2023.11.22.568305. Attaching package: 'baRulho' The following object is masked from 'package:seewave': attenuation library(Rraven) # synthesize synth_est <- baRulho::synth_sounds( mar = 0.1, frequencies = c(0.5, 1:5), durations = 0.1, fm = FALSE, am = FALSE, sampling.rate = 12 ) 
[30msynthesizing sounds (step 0 of 0):
[39m # convert into a single wave object synth_wav <- Rraven::exp_est(X = synth_est, single.file = TRUE, wave.object = TRUE) # plot spectro seewave::spectro( wave = synth_wav, scale = FALSE, palette = viridis, grid = FALSE, collevels = seq(-20, 0, 1), osc = TRUE, colwave = \"#31688EB3\", heights = c(2, 1), wl = 100 ) # synthesize synth_est2 <- baRulho::synth_sounds( mar = 0.01, sig2 = 0.05, frequencies = 2:4, durations = c(0.1, 0.2), fm = TRUE, am = TRUE, shuffle = TRUE, seed = 123, sampling.rate = 12 ) # convert into a single wave object synth_wav2 <- Rraven::exp_est( X = synth_est2, single.file = TRUE, path = tempdir(), wave.object = TRUE ) # plot spectro seewave::spectro( synth_wav2, tlim = c(0, 2), scale = FALSE, palette = viridis, grid = FALSE, collevels = seq(-20, 0, 1), osc = TRUE, colwave = \"#31688EB3\", heights = c(2, 1), wl = 140 ) # check first 6 rows head(as.data.frame(synth_est2)) # check name of wave objects names(attributes(synth_est2)$wave.objects) [1] \"synthetic_sound_1\" \"synthetic_sound_2\" \"synthetic_sound_3\" \"synthetic_sound_4\" [5] \"synthetic_sound_5\" \"synthetic_sound_6\" \"synthetic_sound_7\" \"synthetic_sound_8\" [9] \"synthetic_sound_9\" \"synthetic_sound_10\" \"synthetic_sound_11\" \"synthetic_sound_12\" [13] \"synthetic_sound_13\" \"synthetic_sound_14\" \"synthetic_sound_15\" \"synthetic_sound_16\" [17] \"synthetic_sound_17\" \"synthetic_sound_18\" \"synthetic_sound_19\" \"synthetic_sound_20\" [21] \"synthetic_sound_21\" \"synthetic_sound_22\" \"synthetic_sound_23\" \"synthetic_sound_24\""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"create-master-sound-file-for-playback","dir":"Articles","previous_headings":"","what":"Create master sound file for playback","title":"Synthesize and align test sounds","text":"function master_sound_file() creates master sound file (probably guessed) playback experiments. function takes wave objects data frame (extended) selection table containing model sounds concatenates single sound file (silence sounds length can modified). master_sound_file() adds acoustic markers start end playback can used time-sync re-recorded sounds, streamlines quantification acoustic degradation. following example shows create master sound file using synthetic sounds generated . synthetic sounds need add little space top bottom frequency sim_songs() make values exactly pure tones:   function saves master sound file wave file returns selection table R environment time frequency ‘coordinates’ sounds file (careful playing master sound file can shocking audiences!). can look spectrogram output file using seewave function spectro() follows: function can also create master sound file sounds found sound files several sounds files, likely case recordings collected field. following example shows create master sound file using several sound files. code uses example data recordings package warbleR:   , can look spectrogram output file: Note output also exported Raven sound analysis software (Cornell Lab Ornithology) visualization manipulation using function exp_raven() Rraven package. exp_raven() exports selections R environment ‘.txt’ file can read Raven:   sound files annotations can visualized Raven ( acoustic analysis software):   Take look Rraven vignette details export import data R Raven. Note start end markers placed relatively low frequencies less affected degradation. frequency range markers can set argument flim. relative amplitude markers can also adjusted amp.marker argument. Amplitude markers multiplied value supplied markers louder sounds. two features increases chances detecting markers distances.","code":"# create master sound file synth_master_annotations <- baRulho::master_sound_file( X = synth_est, file.name = \"synthetic_master\", dest.path = tempdir(), gap.duration = 0.15 ) 
[30mThe file synthetic_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m # read wave file wave <- tuneR::readWave(file.path(tempdir(), \"synthetic_master.wav\")) # plot spectrogram seewave::spectro( wave, scale = FALSE, palette = viridis, wl = 150, grid = FALSE, flim = c(0, 4.7) ) # load example data from warbleR data(list = c( \"Phae.long1\", \"Phae.long2\", \"Phae.long3\", \"Phae.long4\", \"lbh_selec_table\" )) # save sound files to temporary folder writeWave(Phae.long1, file.path(tempdir(), \"Phae.long1.wav\")) writeWave(Phae.long2, file.path(tempdir(), \"Phae.long2.wav\")) writeWave(Phae.long3, file.path(tempdir(), \"Phae.long3.wav\")) writeWave(Phae.long4, file.path(tempdir(), \"Phae.long4.wav\")) # make an extended selection table est <- warbleR::selection_table( X = lbh_selec_table, extended = TRUE, path = tempdir(), pb = FALSE ) 
[30mall selections are OK 
[39m # add sound_id column est$sound.id <- paste0(abbreviate(est$sound.files), est$selec) # create master sound file master_annotations <- baRulho::master_sound_file( X = est, file.name = \"example_master\", dest.path = tempdir(), gap.duration = 0.3 ) 
[30mThe file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m # read wave file wave <- tuneR::readWave(file.path(tempdir(), \"example_master.wav\")) # plot spectrogram seewave::spectro( wave, scale = FALSE, palette = viridis, collevels = seq(-120, 0, 5), wl = 500, grid = FALSE, flim = c(0, 10) ) Rraven::exp_raven(master_annotations, path = tempdir(), file.name = \"example_master_selection_table\") knitr::include_graphics(\"example_master_table.jpg\")"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"align-re-recorded-sounds","dir":"Articles","previous_headings":"","what":"Align re-recorded sounds","title":"Synthesize and align test sounds","text":"went field (lab) re-recorded master sound files different distances, ready start data analysis. first step getting data ready analysis involves finding sounds within re-recorded sound files. need align start marker master playback re-recorded sound files, based fact time difference marker sounds cases:   use acoustic data included package example data. data subset sound transmission experiment. complete data set experiment hosted repository. two example objects used:   files contained data set:   names self-explanatory: master sound file (“master.wav”) annotations, reference sound file (“reference_1m.wav”) two test files (“test_10m.wav” “test_20m.wav”) re-recorded 10 20 m respectively. Now save files temporary working directory (objects extended selection tables R environment) resemble usual case acoustic data found sound files.   annotations needed aligning test sound must share following structure:   Note ‘sound.id’ column contains unique identifier sound. used label counterparts test sound files. Users can import annotations Raven using Rraven package (see vignette). find location start marker test sound files use functions find_markers() run cross-correlation one markers across test files order determine exact time marker found:   position markers determined highest spectrogram cross-correlation value marker using functions find_markers(). two markers used function computes additional column, ‘time.mismatch’, compares time difference two markers test files master sound file. perfect detection value must 0. number can used measure error. cases precision can improve increasing time resolution spectrogram, , lowering size time window. done argument ‘hop.size’. default 11.6 ms (equivalent 512 samples window length 44.1 kHz file). Let’s try 4 ms:   time location acoustic markers can infer position sounds new recordings. selection table re-recorded files can generated using function align_test_files():   function returns object class input object ‘X’. case ‘X’ data.frame: can check precision alignment looking spectrograms. function plot_aligned_sounds() can create spectrograms visually inspect alignment precision test sound files. spectrograms saved individual JPEG image files (‘dest.path’ supplied). One file created sound file: two files generated code :  ","code":"data(\"master_est\") data(\"test_sounds_est\") unique(master_est$sound.files) [1] \"master.wav\" unique(test_sounds_est$sound.files) [1] \"10m_closed.wav\" \"10m_open.wav\" \"1m_open.wav\" \"30m_closed.wav\" \"30m_open.wav\" # first remove any other wave file in the temporary working directory (dont do it with your data!) unlink(list.files( path = tempdir(), full.names = TRUE, pattern = \".wav\" )) # save master sound file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # save test sound files for (i in unique(test_sounds_est$sound.files)) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # make annotations a data frame master_annotations <- as.data.frame(master_est) master_annotations markers_position <- baRulho::find_markers(X = master_annotations, path = tempdir()) markers_position # lower window length markers_position <- baRulho::find_markers(X = master_annotations, hop.size = 4, path = tempdir()) markers_position aligned_tests <- baRulho::align_test_files( X = master_annotations, Y = markers_position, by.song = TRUE, remove.markers = FALSE, path = tempdir() ) is.data.frame(aligned_tests) [1] TRUE aligned_tests aligned_imgs <- baRulho::plot_aligned_sounds( X = aligned_tests, path = tempdir(), dest.path = tempdir(), duration = 2.4, ovlp = 0 ) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/RtmpaSx6DS'
[39m aligned_imgs [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_10m_closed.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_10m_open.jpeg\" [3] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_1m_open.jpeg\" [4] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_30m_closed.jpeg\" [5] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//RtmpaSx6DS/plot_align_30m_open.jpeg\""},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"manually-fixing-alignment","dir":"Articles","previous_headings":"Align re-recorded sounds","what":"Manually fixing alignment","title":"Synthesize and align test sounds","text":"cases alignments might accurate, particularly markers considerably degraded test sound files. function manual_realign() allows users interactively adjust alignment test sound files produced align_test_files(). function generates multipanel graph spectrogram master sound file top test sound files, highlighting position correspondent test sounds order simplify assessing adjusting alignment: Spectrograms include first seconds sound files (controlled ‘duration’) usually enough tell precision alignment. lower spectrogram shows series ‘buttons’ users can click control test sound file spectrogram (low panel) needs moved left (“<”) right (“>”). Users can also reset spectrogram original position (‘reset’), move next sound file ‘X’ (test sound file annotations) stop process (stop button). function returns object similar input object ‘X’ start end sounds adjusted. default uses start marker reference can modified argument ‘marker’.","code":"baRulho::manual_realign( X = aligned_tests, Y = master_annotations, duration = 2.4, path = tempdir() )"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"further-aligning","dir":"Articles","previous_headings":"Align re-recorded sounds","what":"Further aligning","title":"Synthesize and align test sounds","text":"alignments done manually (broadcasting devices add short delays case bluetooth transmitters) small misalignment inferred versus actual start time re-recorded sounds. problematic quantifying degradation baRulho (sound analysis software) precise alignment sound crucial accuracy downstream measures sound degradation. Misalignment can fixed function auto_realign(). function uses spectrogram cross-correlation sync position time sounds regard reference sound. manual_realign() takes sound recorded closest distance source reference sound. function calls warbleR’s cross_correlation() (just ) internally align sounds using cross-correlation. can simulate aligned data set test sound slightly position: Now can re-aligned test sounds: sounds look aligned:   case doesn’t work expected another option. function seltailor() warbleR allows user manually adjust start end sounds extended selection table. Alternatively, users can manually determined position markers using Raven import annotations ‘R’ using function ‘imp_raven()’ Rraven package.   Please report bugs . package baRulho cited follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":"data(\"test_sounds_est\") data(\"master_est\") # create \"unaligned_test_sounds_est\" by # adding error to \"test_sounds_est\" start and end unaligned_test_sounds_est <- test_sounds_est set.seed(123) noise_time <- sample(c(0.009, -0.01, 0.03, -0.03, 0, 0.07, -0.007), nrow(unaligned_test_sounds_est), replace = TRUE) attr(unaligned_test_sounds_est, \"check.res\")$start <- unaligned_test_sounds_est$start <- unaligned_test_sounds_est$start + noise_time attr(unaligned_test_sounds_est, \"check.res\")$end <- unaligned_test_sounds_est$end <- unaligned_test_sounds_est$end + noise_time #re align rts <- auto_realign(X = unaligned_test_sounds_est, Y = master_est)"},{"path":"https://marce10.github.io/baRulho/articles/align_test_sounds.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Synthesize and align test sounds","text":"Araya-Salas, M. (2017). Rraven: connecting R Raven bioacoustic software. R package version 1.0.0. Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0 Araya-Salas M, Smith-Vidaurre G. (2017) warbleR: R package streamline analysis animal acoustic signals. Methods Ecol Evol 8:184–191. Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34. Tobias, J. ., Aben, J., Brumfield, R. T., Derryberry, E. P., Halfwerk, W., Slabbekoorn, H., & Seddon, N. (2010). Song divergence sensory drive Amazonian birds. Evolution, 64(10), 2820-2839. Session information","code":"R version 4.4.2 (2024-10-31) Platform: aarch64-apple-darwin20 Running under: macOS Sonoma 14.7.1 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: UTC tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Rraven_1.0.14 baRulho_2.1.2 ohun_1.0.2 warbleR_1.1.33 NatureSounds_1.0.4 [6] seewave_2.2.3 tuneR_1.4.7 viridis_0.6.5 viridisLite_0.4.2 knitr_1.49 loaded via a namespace (and not attached): [1] gtable_0.3.6 rjson_0.2.23 xfun_0.49 bslib_0.8.0 ggplot2_3.5.1 [6] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 curl_6.0.1 parallel_4.4.2 [11] tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 pkgconfig_2.0.3 KernSmooth_2.23-24 [16] checkmate_2.3.2 desc_1.4.3 lifecycle_1.0.4 stringr_1.5.1 compiler_4.4.2 [21] textshaping_0.4.1 brio_1.1.5 munsell_0.5.1 htmltools_0.5.8.1 class_7.3-22 [26] sass_0.4.9 RCurl_1.98-1.16 yaml_2.3.10 pillar_1.9.0 pkgdown_2.1.1 [31] jquerylib_0.1.4 MASS_7.3-61 classInt_0.4-10 cachem_1.1.0 Deriv_4.1.6 [36] digest_0.6.37 stringi_1.8.4 sf_1.0-19 fastmap_1.2.0 grid_4.4.2 [41] colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 utf8_1.2.4 e1071_1.7-16 [46] scales_1.3.0 backports_1.5.0 rmarkdown_2.29 httr_1.4.7 Sim.DiffProc_4.9 [51] signal_1.8-1 igraph_2.1.2 gridExtra_2.3 png_0.1-8 ragg_1.3.3 [56] kableExtra_1.4.0 pbapply_1.7-2 evaluate_1.0.1 dtw_1.23-1 fftw_1.0-9 [61] testthat_3.2.2 rlang_1.1.4 Rcpp_1.0.13-1 glue_1.8.0 DBI_1.2.3 [66] xml2_1.3.6 svglite_2.1.3 rstudioapi_0.17.1 jsonlite_1.8.9 R6_2.5.1 [71] systemfonts_1.1.0 fs_1.6.5 units_0.8-5"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"required-data-structure","dir":"Articles","previous_headings":"","what":"Required data structure","title":"Quantify degradation","text":"Transmission experiments tend follow common experimental design model sounds re-recorded increasing distance within transect. Hence, data must indicate, besides basic acoustic annotation information (e.g. sound file, time, frequency), transect distance within transect sound. baRulho comes example annotation data set can used show required data structure: despcription required input data columns: sound.files: character factor column name sound files including file extension (e.g. “rec_1.wav”) selec: numeric, character factor column unique identifier (least within sound file) annotation (e.g. 1, 2, 3 “”, “b”, “c”) start: numeric column start position time annotated sound (seconds) end: numeric column end position time annotated sound (seconds) ‘bottom.freq’: numeric column bottom frequency frequency range annotation (kHz, used bandpass filtering) top.freq: numeric column top frequency frequency range annotation (kHz, used bandpass filtering) channel: numeric column number channel annotation found multi-channel sound file (optional, default 1 supplied) sound.id: numeric, character factor column ID sounds used identify sounds different distances transects. sound ID can one sample distance/transect combination. sound id label “ambient” can used defined annotations ambient noise can measure. transect: numeric, character factor column transect ID. distance: numeric column distance (m) source sound recorded. package assumes distance replicated within transect.","code":"# load packages library(baRulho) library(viridis) library(ggplot2) # load example data data(\"test_sounds_est\") test_sounds_est"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"setting-reference-sounds","dir":"Articles","previous_headings":"","what":"Setting reference sounds","title":"Quantify degradation","text":"combined information columns used identify reference sounds test sound. function set_reference_sounds() exactly . Hence, unless define reference sound test sound manually, set_reference_sounds() must always run degradation measuring function. two possible experimental designs defining reference sounds (controlled argument ‘method’ set_reference_sounds()): 1: compare sounds (‘sound.id’) counterpart recorded closest distance source (e.g. compare sound recorded 5m, 10m 15m counterpart recorded 1m). default method. design users can single example shortest distance used reference (instance 1m case studies) function try use references transect. However, another test sound ‘sound.id’ shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. 2: compare sounds counterpart recorded distance immediately within transect (e.g. sound recorded 10m compared sound recorded 5m, sound recorded 15m compared sound recorded 10m ). Also note selections labeled “ambient” ‘sound.id’. selections refer ambient (background) noise. Ambient noise can used functions correct amplitude differences due non-target sounds. example data 4 recordings increasing distances: 1m, 5m, 10m 15m: data contains selections 5 sounds well 1 ambient noise selections distance/recording:   baRulho can take sound file annotations represented following R objects: Data frames Selection tables Extended selection tables last 2 annotation specific R classes included warbleR. Take look annotation format vignette warbleR details formats.","code":"# count selection per recordings unique(test_sounds_est$sound.files) [1] \"10m_closed.wav\" \"10m_open.wav\" \"1m_open.wav\" \"30m_closed.wav\" [5] \"30m_open.wav\" table(test_sounds_est$sound.id, test_sounds_est$distance)"},{"path":[]},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"data-format","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Data format","title":"Quantify degradation","text":"mention , function set_reference_sounds() used determined, row input data, sounds used references. function can using two methods described :   function adds column ‘reference’ used downstream functions plotting measuring degradation. Hence used running degradation functions (including plotting functions). References indicated combination ‘sound.files’ ‘selec’ column. instance, ‘10m.wav-1’ indicates row ‘selec’ column ‘1’ sound file ‘10m.wav’ used reference. function also checks information ‘X’ (input annotation data) right format won’t produce errors downstream analysis (see ‘X’ argument description details format). function ignore rows sound id column ‘ambient’, ‘start_marker’ ‘end_marker’.","code":"# add reference column test_sounds_est <- set_reference_sounds(test_sounds_est, method = 1) # print test_sounds_est 
[30mcomputing references (step 0 of 0):
[39m"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"visual-inspection","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Visual inspection","title":"Quantify degradation","text":"function plot_degradation() aims simplify visual inspection sound degradation producing multipanel figures (saved JPEG files ‘dest.path’) containing visualizations test sound reference. Sounds sorted distance (columns) transect. Visualizations include spectrograms, amplitude envelopes power spectra (last 2 optional): paths image files: … one images:   row includes copies sound id given transect (row label includes sound id first line transect second line), also including reference comes another transect. Ambient noise annotations (sound.id ‘ambient’) excluded.","code":"# sort to order panels test_sounds_est <- test_sounds_est[order(test_sounds_est$sound.id, test_sounds_est$transect, decreasing = FALSE),] # create plots degrad_imgs <- plot_degradation(test_sounds_est, dest.path = tempdir()) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxw49Sq'
[39m degrad_imgs [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/plot_degradation_p1.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/plot_degradation_p2.jpeg\""},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"blur-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Blur ratio","title":"Quantify degradation","text":"Blur ratio quantifies degradation sound function distortion amplitude envelope (time domain) excluding changes due energy attenuation. measure first described Dabelsteen et al. (1993). Blur ratio measured mismatch amplitude envelopes (expressed probability density functions) reference sound re-recorded sound. Low values indicate low degradation sounds. function blur_ratio() measures blur ratio sounds reference playback re-recorded different distances. function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). ‘sound.id’ column must used tell function compare sounds belonging category (e.g. song-types). sound files (wave objects extended selection table) must sampling rate length envelopes comparable. Blur ratio can calculated follows:   output data frame simply input data additional column (‘blur.ratio’) blur ratio values. Note NAs returned sounds used reference ‘ambient’ noise selections. function plot_blur_ratio() can used generate image files (‘jpeg’ format) comparison showing spectrograms sounds overlaid amplitude envelopes (probability mass functions (PMF)). paths image files: Output image files (working directory) look like one:   image shows spectrogram reference re-recorded sound, well envelopes sounds overlaid single graph. Colors indicate sound spectrograms envelopes belong . blur ratio value also displayed. function can also return amplitude spectrum contours argument envelopes = TRUE. contours can directly input ggplot visualize amplitude envelopes, vary distance across sound types (ambient noise included): env.smooth argument change envelope shapes related measurements, higher values tend smooth envelopes. following code sets env.smooth = 800 produces smoother envelopes:  ","code":"# run blur ratio br <- blur_ratio(X = test_sounds_est) # see output br # plot blur ratio blur_imgs <- plot_blur_ratio(X = test_sounds_est, dest.path = tempdir()) 
[30mThe image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmpxw49Sq'
[39m head(blur_imgs) [1] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-10m_closed.wav-4.jpeg\" [2] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-30m_closed.wav-4.jpeg\" [3] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-10m_open.wav-4.jpeg\" [4] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:1-1m_open.wav-4-30m_open.wav-4.jpeg\" [5] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:4-1m_open.wav-3-10m_closed.wav-3.jpeg\" [6] \"/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T//Rtmpxw49Sq/blur_ratio_freq:4-1m_open.wav-3-30m_closed.wav-3.jpeg\" # get envelopes br <- blur_ratio(X = test_sounds_est, envelopes = TRUE) envs <- attributes(br)$envelopes # make distance a factor for plotting envs$distance <- as.factor(envs$distance) # plot ggplot(envs, aes(x = time, y = amp, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic() # get envelopes br <- blur_ratio(X = test_sounds_est, envelopes = TRUE, env.smooth = 800) envs <- attributes(br)$envelopes envs$distance <- as.factor(envs$distance) ggplot(envs, aes(x = time, y = amp, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic()"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrum-blur-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrum blur ratio","title":"Quantify degradation","text":"Spectrum blur ratio (measured spectrum_blur_ratio()) quantifies degradation sound function change sound energy across frequency domain, analogous blur ratio described time domain (implemented blur_ratio()). Low values also indicate low degradation sounds. Spectrum blur ratio measured mismatch power spectra (expressed probability density functions) reference sound re-recorded sound. works way blur_ratio(), comparing sound corresponding reference sound, output images alike well. Spectrum blur ratio can calculated follows:   blur_ratio(), spectrum_blur_ratio() can also return amplitude spectrum contours argument spectra = TRUE:  ","code":"# run Spectrum blur ratio sbr <- spectrum_blur_ratio(test_sounds_est) # see output sbr sbr <- spectrum_blur_ratio(X = test_sounds_est, spectra = TRUE) spctr <- attributes(sbr)$spectra spctr$distance <- as.factor(spctr$distance) ggplot(spctr[spctr$freq > 0.3,], aes(y = amp, x = freq, col = distance)) + geom_line() + facet_wrap( ~ sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (PMF)\") + coord_flip() + theme_classic()"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"excess-attenuation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Excess attenuation","title":"Quantify degradation","text":"every doubling distance, sounds attenuate 6 dB loss amplitude (Morton, 1975; Marten & Marler, 1977). additional loss amplitude results excess attenuation, energy loss excess expected occur distance via spherical spreading, due atmospheric conditions habitat (Wiley & Richards, 1978). degradation metric can measured using excess_attenuation() function. Low values indicate little sound attenuation. function compare sound corresponding reference sound within frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). excess_attenuation() can measured like : output, similar functions, extended selection table input data, also including two new columns (‘reference’ ‘excess.attenuation’) reference sound excess attenuation:  ","code":"# run envelope correlation ea <- excess_attenuation(test_sounds_est) # print output ea"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"envelope-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Envelope correlation","title":"Quantify degradation","text":"Amplitude envelope correlation measures similarity two sounds time domain. envelope_correlation() function measures envelope correlation coefficients reference playback re-recorded sounds. Values close 1 means similar amplitude envelopes (.e. little degradation occurred). envelopes different lengths (sounds different lengths) cross-correlation applied maximum correlation coefficient returned. Cross-correlation achieved sliding shortest sound along largest one calculating correlation step. functions detailed , ‘sound.id’ column must used instruct function compare sounds belong category. envelope_correlation() can run follows: output also similar functions; extended selection table similar input data, also includes two new columns (‘reference’ ‘envelope.correlation’) reference sound amplitude envelope correlation coefficients:   Note function doesn’t provide graphical output. However, graphs generated blur_ratio() can used inspect envelope shapes alignment sounds.","code":"# run envelope correlation ec <- envelope_correlation(test_sounds_est) # print output ec"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrum-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrum correlation","title":"Quantify degradation","text":"Spectrum correlation measures similarity two sounds frequency domain. similar envelope_correlation(), frequency domain. sounds compared within frequency range reference sound (spectra length). , values near 1 indicate identical frequency spectrum (.e. degradation). output also similar envelope_correlation():   envelope_correlation(), spectrum_correlation() doesn’t provide graphical output. However, graphs generated spectrum_blur_ratio() can also used inspect spectrum shapes sound alignment.","code":"# run spectrum correlation sc <- spectrum_correlation(test_sounds_est) # print output sc"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"signal-to-noise-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Signal-to-noise ratio","title":"Quantify degradation","text":"Signal--noise ratio (SNR) quantifies sound amplitude level relation ambient noise metric overall sound attenuation. Therefore, attenuation refers loss energy described Dabelsteen et al (1993). method implemented function signal_to_noise_ratio(), uses envelopes quantify sound power signals background noise. function requires measurement ambient noise, either noise right sound (noise.ref = \"adjacent\") one ambient noise measurements per recording (noise.ref = \"custom\"). latter, selections sound parameters ambient noise measured must specified. Alternatively, one selections ambient noise can used reference (see ‘noise.ref’ argument). can potentially provide accurate representation ambient noise. margins overlap another acoustic signal nearby, SNR inaccurate, margin length carefully considered. SNR less equal one suggests background noise equal overpowering acoustic signal. SNR can measured follows: output also similar functions:   Negative values can occur background noise measured higher power signal. Note function compare sounds references, reference column added.","code":"# run signal to noise ratio snr <- signal_to_noise_ratio(test_sounds_est, pb = FALSE, noise.ref = \"custom\", mar = 0.1) # print output snr"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"tail-to-signal-ratio","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Tail-to-signal ratio","title":"Quantify degradation","text":"Tail--signal ratio (TSR) used quantify reverberations. Specifically TSR measures ratio energy reverberation tail (time segment right sound) energy sound. general margin reverberation tail measured must specified. function measure TSR within supplied frequency range (e.g. bandpass) reference sound (‘bottom.freq’ ‘top.freq’ columns ‘X’). Two methods calculating reverberations provided (see ‘type’ argument). Type 1 based original description TSR Dabelsteen et al. (1993) type 2 better referred “tail--noise ratio”, given compares amplitude tails ambient noise. types higher values represent reverberations. TSR can measured follows: , output similar functions: Tail--signal ratio values typically negative signals tend higher power reverberating tail.  ","code":"# run tail to signal ratio tsr <- tail_to_signal_ratio(test_sounds_est, tsr.formula = 1, mar = 0.05) # print output tsr"},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"spectrogram-correlation","dir":"Articles","previous_headings":"Setting reference sounds > Measuring degradation","what":"Spectrogram correlation","title":"Quantify degradation","text":"Finally, function spcc() measures spectrogram cross-correlation metric sound distortion sounds. Values close 1 means similar spectrograms (.e. little sound distortion). function wrapper warbleR’s cross_correlation(). can run follows: , output similar functions:  ","code":"# run spcc sc <- spcc(X = test_sounds_est, wl = 512) # print output sc"},{"path":[]},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"noise-profiles","dir":"Articles","previous_headings":"Setting reference sounds > Other measurements","what":"Noise profiles","title":"Quantify degradation","text":"function noise_profile() allows estimate frequency spectrum ambient noise. can done extended selection tables (using segments containing sound) entire sound files working directory (path supplied). function uses seewave function meanspec() internally calculate frequency spectra. following code measures ambient noise profile recordings distance >= 5m example extended selection table: output data frame amplitude values frequency bins wave object extended selection table: can graphically represented follows: output data actually average several frequency spectra sound file. can obtain original spectra setting argument averaged = FALSE: Note can limit frequency range using bandpass filter (‘bp’ argument). addition, argument ‘hop.size’, control size time windows, affects precision frequency domain. can get better precision increasing ‘hop.size’ (‘wl’): function can estimate noise profiles entire sound files, supplying list files (argument ‘files’, supplying ‘X’) simply running without supplying ‘X’ ‘files’. case run sound files working directory (‘path’ supplied). Please report bugs . package baRulho cited follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":"# run noise profile np <- noise_profile(X = test_sounds_est[test_sounds_est$distance > 5,], mar = 0.05) 
[30mcomputing noise profile(s) (step 0 of 0):
[39m # print output head(np, 20) ggplot(np, aes(y = amp, x = freq, col = sound.files)) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() np <- noise_profile(X = test_sounds_est[test_sounds_est$distance > 5, ], mar = 0.1, averaged = FALSE) # make a column containing sound file and selection np$sf.sl <- paste(np$sound.files, np$selec) ggplot(np, aes( y = amp, x = freq, col = sound.files, group = sf.sl )) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() np <- noise_profile( X = test_sounds_est[test_sounds_est$distance > 5,], mar = 0.05, bp = c(0, 10), averaged = FALSE, hop.size = 3 ) # make a column containing sound file and selection np$sf.sl <- paste(np$sound.files, np$selec) ggplot(np, aes( y = amp, x = freq, col = sound.files, group = sf.sl )) + geom_line(linewidth = 1.4) + scale_color_viridis_d(begin = 0.2, end = 0.8, alpha = 0.5) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (dBA)\") + coord_flip() + theme_classic() Warning: 
[1m
[22mRemoved 20 rows containing missing values or values outside the scale range (`geom_line()`)."},{"path":"https://marce10.github.io/baRulho/articles/quantify_degradation.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Quantify degradation","text":"Araya-Salas, M. (2017). Rraven: connecting R Raven bioacoustic software. R package version 1.0.0. Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0 Araya-Salas M, Smith-Vidaurre G. (2017) warbleR: R package streamline analysis animal acoustic signals. Methods Ecol Evol 8:184–191. Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34. Tobias, J. ., Aben, J., Brumfield, R. T., Derryberry, E. P., Halfwerk, W., Slabbekoorn, H., & Seddon, N. (2010). Song divergence sensory drive Amazonian birds. Evolution, 64(10), 2820-2839. Session information","code":"R version 4.4.2 (2024-10-31) Platform: aarch64-apple-darwin20 Running under: macOS Sonoma 14.7.1 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: UTC tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ggplot2_3.5.1 viridis_0.6.5 viridisLite_0.4.2 baRulho_2.1.2 [5] ohun_1.0.2 warbleR_1.1.33 NatureSounds_1.0.4 seewave_2.2.3 [9] tuneR_1.4.7 knitr_1.49 loaded via a namespace (and not attached): [1] gtable_0.3.6 rjson_0.2.23 xfun_0.49 bslib_0.8.0 [5] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 curl_6.0.1 [9] parallel_4.4.2 tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 [13] pkgconfig_2.0.3 KernSmooth_2.23-24 checkmate_2.3.2 desc_1.4.3 [17] lifecycle_1.0.4 farver_2.1.2 stringr_1.5.1 compiler_4.4.2 [21] textshaping_0.4.1 brio_1.1.5 munsell_0.5.1 htmltools_0.5.8.1 [25] class_7.3-22 sass_0.4.9 RCurl_1.98-1.16 yaml_2.3.10 [29] pkgdown_2.1.1 pillar_1.9.0 jquerylib_0.1.4 MASS_7.3-61 [33] classInt_0.4-10 cachem_1.1.0 Deriv_4.1.6 digest_0.6.37 [37] stringi_1.8.4 sf_1.0-19 labeling_0.4.3 fastmap_1.2.0 [41] grid_4.4.2 colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 [45] utf8_1.2.4 e1071_1.7-16 withr_3.0.2 scales_1.3.0 [49] backports_1.5.0 rmarkdown_2.29 httr_1.4.7 Sim.DiffProc_4.9 [53] signal_1.8-1 igraph_2.1.2 gridExtra_2.3 png_0.1-8 [57] ragg_1.3.3 kableExtra_1.4.0 pbapply_1.7-2 evaluate_1.0.1 [61] dtw_1.23-1 fftw_1.0-9 testthat_3.2.2 rlang_1.1.4 [65] Rcpp_1.0.13-1 glue_1.8.0 DBI_1.2.3 xml2_1.3.6 [69] svglite_2.1.3 rstudioapi_0.17.1 jsonlite_1.8.9 R6_2.5.1 [73] systemfonts_1.1.0 fs_1.6.5 units_0.8-5"},{"path":"https://marce10.github.io/baRulho/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Marcelo Araya-Salas. Author, maintainer. Michael Mahoney. Reviewer. Dena Clink. Reviewer.","code":""},{"path":"https://marce10.github.io/baRulho/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":"@Article{, journal = {bioRxiv}, title = {baRulho: quantifying habitat-induced degradation of (animal) acoustic signals in R}, author = {M. Araya-Salas and Erin E. Grabarczyk and Marcos Quiroz-Oliva and Adrian Garcia-Rodriguez and Alejandro Rico-Guevara}, year = {2023}, }"},{"path":"https://marce10.github.io/baRulho/index.html","id":"barulho-quantifying-degradation-of-animal-sounds","dir":"","previous_headings":"","what":"Quantifying (Animal) Sound Degradation","title":"Quantifying (Animal) Sound Degradation","text":"baRulho intended facilitate implementation (animal) sound transmission experiments, typically aim quantify changes signal structure transmitted given habitat broadcasting re-recording animal sounds increasing distances. experiments aim answer research questions : habitat structure shaped transmission properties animal acoustic signals? acoustic features shaped selection improving transmission? features degraded different habitats? far acoustic signals can detected? common sequence steps experimentally test hypotheses related sound transmission depicted following diagram: Diagram depicting typical workflow experiment working signal transmission degradation. Nodes black font indicate steps can conducted using baRulho functions. Blue nodes denote functions can used steps.   baRulho offers functions critical steps workflow (black, including ‘checks’) required acoustic data manipulation analysis. main features package : use loops apply tasks sounds referenced selection table (sensu warbleR) production image files graphic representations sound time /frequency let users verify acoustic analyses use annotation tables object format input acoustic data annotations output results use parallelization distribute tasks among several cores improve computational efficiency baRulho builds upon functions data formats warbleR seewave packages, experience packages advised. Take look vignettes overview main features packages: Align test sounds Quantify degradation","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"installing-barulho","dir":"","previous_headings":"","what":"Installing baRulho","title":"Quantifying (Animal) Sound Degradation","text":"Install/load package CRAN follows: can also install R-Universe way: install latest developmental version github need R package remotes: system requirements due dependency seewave may needed. Take look link instruction install/troubleshoot external dependencies.","code":"# From CRAN would be # install.packages(\"baRulho\") # load package library(baRulho) install.packages(\"baRulho\", repos = \"https://ropensci.r-universe.dev\") ## Installing package into '/home/m/R/x86_64-pc-linux-gnu-library/4.1' ## (as 'lib' is unspecified) # install remotes if not installed if (!requireNamespace(\"remotes\")) { install.packages(\"remotes\") } # From github remotes::install_github(\"ropensci/baRulho\") # load package library(baRulho)"},{"path":"https://marce10.github.io/baRulho/index.html","id":"other-packages","dir":"","previous_headings":"","what":"Other packages","title":"Quantifying (Animal) Sound Degradation","text":"packages seewave tuneR provide huge variety functions acoustic analysis manipulation. mostly work wave objects already imported R environment. package warbleR provides functions visualize measure sounds already referenced annotation tables, similar baRulho. package Rraven facilitates exchange data R Raven sound analysis software (Cornell Lab Ornithology) can helpful incorporating Raven annotating tool acoustic analysis workflow R. package ohun works automated detection sound events, providing functions diagnose optimize detection routines.","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Quantifying (Animal) Sound Degradation","text":"Please cite baRulho follows: Araya-Salas, M. (2020), baRulho: quantifying degradation (animal) acoustic signals R. R package version 1.0.0.","code":""},{"path":"https://marce10.github.io/baRulho/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Quantifying (Animal) Sound Degradation","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206. Marten, K., & Marler, P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290. Morton, E. S. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":null,"dir":"Reference","previous_headings":"","what":"Add synthetic noise — add_noise","title":"Add synthetic noise — add_noise","text":"add_noise adds synthetic noise annotations extended selection tables","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add synthetic noise — add_noise","text":"","code":"add_noise( X, mar = NULL, target.snr = 2, precision = 0.1, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), max.iterations = 1000, kind = c(\"pink\", \"white\", \"brown\", \"red\", \"power\"), alpha = 1, ... )"},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add synthetic noise — add_noise","text":"X Object class 'extended_selection_table' (created function selection_table warbleR package), generated 'element', reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds (needed calculate signal noise ratio internally using signal_to_noise_ratio). mar numeric vector length 1. Specifies margins adjacent start point annotation measure ambient noise. target.snr numeric vector length 1. Specifies desired signal--noise ratio. Must lower current signal--noise ratio. Annotations showing signal--noise ratio higher 'target.snr' remain unchanged. Must supplied. precision numeric vector length 1. Specifies precision adjusted signal--noise ratio (dB). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). max.iterations Numeric vector length 1. Specifies maximum number iterations internal signal--noise adjusting routine run stopping. Note cases default maximum number iterations (1000) reached. kind Character vector length 1 indicating kind noise, “white”, “pink”, “power”, \"brown\", “red”. Noise synthesized modified version function noise. Default \"pink\" similar background noise natural environments. alpha Numeric vector length 1. power power law noise (defaults 1 pink 1.5 red noise). used kind = \"power\". ... Additional arguments passed internally signal_to_noise_ratio.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add synthetic noise — add_noise","text":"Object 'X' wave objects modified match target signal--noise ratio. also includes additional column, 'adjusted.snr', new signal--noise ratio values.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add synthetic noise — add_noise","text":"function adds synthetic noise sounds referenced extended selection table (class created function selection_table warbleR package) decrease signal--noise ratio. can useful, instance, evaluating effect background noise signal structure. Note implementation slow.","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add synthetic noise — add_noise","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305. Timmer. J M. König (1995): generating power law noise. Astron. Astrophys. 300, 707-710.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add synthetic noise — add_noise","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/add_noise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add synthetic noise — add_noise","text":"","code":"if (FALSE) { # \\dontrun{ # load example data data(\"test_sounds_est\") # make it a 'by element' extended selection table X <- warbleR::by_element_est(X = test_sounds_est) # add noise to the first five rows X_noise <- add_noise(X = X[1:5, ], mar = 0.2, target.snr = 3) } # }"},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Align test sound files — align_test_files","title":"Align test sound files — align_test_files","text":"align_test_files aligns test (re-recorded) sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align test sound files — align_test_files","text":"","code":"align_test_files( X, Y, path = getOption(\"sound.files.path\", \".\"), by.song = TRUE, marker = NULL, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), ... )"},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align test sound files — align_test_files","text":"X object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package). data used finding position markers find_markers. also contain 'sound.id' column used label re-recorded sounds according counterpart master sound file. Y object class 'data.frame' output find_markers. object contains position markers re-recorded sound files. one marker supplied sound file one highest correlation score ('scores' column 'X') used. path Character string containing directory path test (re-recorded) sound files found. .song Logical argument indicate extended selection table created song (see '.song' selection_table argument). Default TRUE. marker Character string define whether \"start\" \"end\" marker used aligning re-recorded sound files. Default NULL. DEPRECATED. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). ... Additional arguments passed selection_table customizing extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align test sound files — align_test_files","text":"object class 'X' aligned sounds test (re-recorded) sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align test sound files — align_test_files","text":"function aligns sounds found re-recorded sound files (referenced 'Y') according master sound file (referenced 'X'). one marker supplied sound file one highest correlation score ('scores' column 'X') used. function outputs 'extended selection table' default.","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Align test sound files — align_test_files","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Align test sound files — align_test_files","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/align_test_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Align test sound files — align_test_files","text":"","code":"{ # load example data data(list = c(\"master_est\", \"test_sounds_est\")) # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # get marker position for the first test file markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[1], path = tempdir()) # align all test sounds alg.tests <- align_test_files(X = master_est, Y = markers, path = tempdir()) } #> computing correlations (step 1 of 0): #> all selections are OK #>"},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate attenuation of sound pressure level — attenuation","title":"Estimate attenuation of sound pressure level — attenuation","text":"attenuation estimates atmospheric attenuation atmospheric absorption.","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate attenuation of sound pressure level — attenuation","text":"","code":"attenuation( frequency, dist0, dist, temp = 20, rh = 60, pa = 101325, hab.att.coef = 0.02 )"},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate attenuation of sound pressure level — attenuation","text":"frequency Numeric vector length 1 frequency (Hertz). dist0 Numeric vector length 1 distance (m) reference SPL. dist Numeric vector length 1 distance (m) sound propagates. temp Numeric vector length 1 frequency (Celsius). Default 20. rh Numeric vector length 1 relative humidity (percentage). Default 60. pa Numeric vector length 1 atmospheric (barometric) pressure Pa (standard: 101325, default). Used atmospheric attenuation. hab.att.coef Attenuation coefficient habitat (dB/kHz/m).","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate attenuation of sound pressure level — attenuation","text":"Returns geometric, atmospheric habitat attenuation (dB) well combined attenuation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate attenuation of sound pressure level — attenuation","text":"Calculate geometric, atmospheric habitat attenuation overall expected attenuation (sum three) based temperature, relative humidity, atmospheric pressure sound frequency. Attenuation values given dB. function modified http://www.sengpielaudio.com","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate attenuation of sound pressure level — attenuation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate attenuation of sound pressure level — attenuation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/attenuation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate attenuation of sound pressure level — attenuation","text":"","code":"{ # measure attenuation attenuation(frequency = 2000, dist = 50, dist0 = 1) } #> frequency dist geometric.attenuation atmopheric.attenuation #> 1 2000 50 33.9794 0.4547757 #> habitat.attenuation combined.attenuation #> 1 1.96 36.39418"},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":null,"dir":"Reference","previous_headings":"","what":"Fix small misalignments in the time position test sounds — auto_realign","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"auto_realign fixes small misalignments time position test sounds extended selection table using spectrographic cross-correlation","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"","code":"auto_realign( X, Y, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 90), wn = c(\"hanning\", \"hamming\", \"bartlett\", \"blackman\", \"flattop\", \"rectangle\") )"},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"X object class 'extended_selection_table' created function selection_table warbleR package. object must include following additional columns: 'sound.id', 'bottom.freq' 'top.freq'. Y object class 'extended_selection_table' (class created function selection_table warbleR package) master sound file annotations. data used finding position markers find_markers. also contain 'sound.id' column. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 90. High values slow function produce accurate results. Can set globally current R session via \"ovlp\" option (see options). wn character vector length 1 specifying window name ftwindow.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Object 'X' time parameters (columns 'start' 'end') tailored closely match start end reference sound.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Precise alignment crucial downstream measures sound degradation. function uses spectrographic cross-correlation align position time test sounds. master sound file used reference. function calls warbleR's cross_correlation internally align sounds using cross-correlation. output extended selection table contains new start end values alignment. Note function works improve alignments estimated position test sound already close actual position. Note 'X' 'Y' must extended selection tables sensu selection_table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/auto_realign.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fix small misalignments in the time position test sounds — auto_realign","text":"","code":"{ # load example data data(\"test_sounds_est\") data(\"master_est\") # create \"unaligned_test_sounds_est\" by # adding error to \"test_sounds_est\" start and end unaligned_test_sounds_est <- test_sounds_est set.seed(123) noise_time <- sample(c(0.009, -0.01, 0.03, -0.03, 0, 0.07, -0.007), nrow(unaligned_test_sounds_est), replace = TRUE) attr(unaligned_test_sounds_est, \"check.res\")$start <- unaligned_test_sounds_est$start <- unaligned_test_sounds_est$start + noise_time attr(unaligned_test_sounds_est, \"check.res\")$end <- unaligned_test_sounds_est$end <- unaligned_test_sounds_est$end + noise_time # re align realigned_est <- auto_realign(X = unaligned_test_sounds_est, Y = master_est) }"},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":null,"dir":"Reference","previous_headings":"","what":"baRulho: quantifying acoustic signal degradation — baRulho-package","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"`baRulho` package intended quantify habitat-induced degradation (animal) acoustic signals.","code":""},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"main features package : Loops apply tasks sounds referenced extended selection table comparison playback sounds re-recorded different distances functions allow parallelization tasks, distributes tasks among several processors improve computational efficiency. License: GPL (>= 2)","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/baRulho-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"baRulho: quantifying acoustic signal degradation — baRulho-package","text":"Marcelo Araya-Salas Maintainer: Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure blur ratio in the time domain — blur_ratio","title":"Measure blur ratio in the time domain — blur_ratio","text":"blur_ratio measures blur ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure blur ratio in the time domain — blur_ratio","text":"","code":"blur_ratio( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), env.smooth = getOption(\"env.smooth\", 200), envelopes = FALSE, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), n.samples = 100, path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure blur ratio in the time domain — blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope calculation (used internally env). Default 200. Can set globally current R session via \"env.smooth\" option (see options). envelopes Logical control envelopes returned (attributes, 'attributes(X)$envelopes'). Default FALSE. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Used applying bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). n.samples Numeric vector length 1 specifying number amplitude samples use representing amplitude envelopes. Default 100. null raw amplitude envelope used (note can result high RAM memory usage large data sets). Amplitude envelope values interpolated using approx. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure blur ratio in the time domain — blur_ratio","text":"Object 'X' additional column, 'blur.ratio', containing computed blur ratio values. envelopes = TRUE output include amplitude envelopes sounds attributes ('attributes(X)$envelopes').","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure blur ratio in the time domain — blur_ratio","text":"Blur ratio measures degradation sound change sound power time domain described Dabelsteen et al (1993). Low values indicate low degradation sounds. function measures blur ratio sounds reference playback re-recorded different distances. Blur ratio measured mismatch amplitude envelopes (expressed probability mass functions) reference sound re-recorded sound. converting envelopes probability mass functions effect energy attenuation removed, focusing analysis modification envelope shape. function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). 'sound.id' column must used tell function compare sounds belonging category (e.g. song-types). Two methods setting experimental design provided. wave objects extended selection table must sampling rate length envelopes comparable.","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure blur ratio in the time domain — blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure blur ratio in the time domain — blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure blur ratio in the time domain — blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) blur_ratio(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) blur_ratio(X = X) # get envelopes br <- blur_ratio(X = X, envelopes = TRUE) envs <- attributes(br)$envelopes # make distance a factor for plotting envs$distance <- as.factor(envs$distance) # plot rlang::check_installed(\"ggplot2\") library(ggplot2) ggplot(envs, aes(x= time, y = amp, col = distance)) + geom_line() + facet_wrap(~ sound.id) + scale_color_viridis_d() + labs(x = \"Time (s)\", y = \"Amplitude (PMF)\") + theme_classic() }"},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure detection distance of sound — detection_distance","title":"Measure detection distance of sound — detection_distance","text":"detection_distance detection distance sounds.","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure detection distance of sound — detection_distance","text":"","code":"detection_distance( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), path = getOption(\"sound.files.path\", \".\"), spl = NULL, spl.cutoff = NULL, temp = 20, rh = 60, pa = 101325, hab.att.coef = 0.02, max.distance = 1000, resolution = 0.1, subtract.bgn = TRUE, envelope = c(\"abs\", \"hil\"), mar = NULL )"},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure detection distance of sound — detection_distance","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). spl numeric vector length 1 specifying sound pressure level sounds. supplied measured sounds . spl.cutoff numeric vector length 1 specifying sound pressure level cutoff define sound longer detected. Ideally estimated based sound detection threshold species. temp Numeric vector length 1 frequency (Celsius). Default 20. rh Numeric vector length 1 relative humidity (percentage). Default 60. pa Numeric vector length 1 ambient pressure Pa (standard: 101325, default). Used Atmospheric attenuation. hab.att.coef Attenuation coefficient habitat (dB/kHz/m). max.distance Numeric vector length 1 maximum distance (m) detection evaluated. Note function calculates expected sound pressure level values along vector distances find distance expected sound pressure level equates 'spl.cutoff'. Default 1000 m. resolution Numeric vector length 1 distance resolution (m) estimated detection distance. Higher resolutions take longer estimate. Default 0.1 m. subtract.bgn Logical argument control SPL background noise excluded measured signal SPL. Default FALSE. envelope Character string vector method calculate amplitude envelopes (SPL measured, used required 'spl' supplied), env. Must either 'abs' (absolute envelope, default) 'hil' (Hilbert transformation). mar numeric vector length 1. Specifies margins adjacent start end points selection measure background noise. required subtract background noise sound pressure level (needed 'subtract.bgn = TRUE').","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure detection distance of sound — detection_distance","text":"Object 'X' additional column, 'detection.distance', containing computed detection distances (m).","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure detection distance of sound — detection_distance","text":"function computes maximum distance sound detected, calculated distance sound pressure level (SPL) goes specified SPL cutoff ('spl.cutoff')). returned additional column 'detection.distance' (m). function uses internally attenuation estimate SPL increasing values reaches defined cutoff. peak frequency (calculated power spectrum reference sound) reference sound sound ID used carrier frequency distance estimation. sound recorded lowest distance used reference. function assumes recordings made recording volume.","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure detection distance of sound — detection_distance","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure detection distance of sound — detection_distance","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/detection_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure detection distance of sound — detection_distance","text":"","code":"if (FALSE) { # \\dontrun{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) detection_distance(X = X[X$distance %in% c(1, 10), ], spl.cutoff = 5, mar = 0.05) } # }"},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure amplitude envelope correlation — envelope_correlation","title":"Measure amplitude envelope correlation — envelope_correlation","text":"envelope_correlation measures amplitude envelope correlation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure amplitude envelope correlation — envelope_correlation","text":"","code":"envelope_correlation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), env.smooth = getOption(\"env.smooth\", 200), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure amplitude envelope correlation — envelope_correlation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). env.smooth Numeric vector length 1 determine length sliding window used sum smooth amplitude envelope calculation (used internally env). Can set globally current R session via \"env.smooth\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Object 'X' additional column, 'envelope.correlation', containing computed envelope correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Amplitude envelope correlation measures similarity two sounds time domain. function measures envelope correlation coefficients sounds reference playback re-recorded increasing distances. Values close 1 means similar amplitude envelopes (.e. little degradation occurred). envelopes different lengths (means sounds different lengths) cross-correlation used maximum correlation coefficient returned. Cross-correlation achieved sliding shortest sound along largest one computing correlation step. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing envelope correlation provided (see 'method' argument). Use blur_ratio create envelopes graphs.","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Apol, C.., Sturdy, C.B. & Proppe, D.S. (2017). Seasonal variability habitat structure may shaped acoustic signals repertoires black-capped boreal chickadees. Evol Ecol. 32:57-74.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure amplitude envelope correlation — envelope_correlation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/envelope_correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure amplitude envelope correlation — envelope_correlation","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) envelope_correlation(X = X) # method 2 # add reference to X X <- set_reference_sounds(X = test_sounds_est, method = 2) envelope_correlation(X = X) } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 11 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 5 more column(s) (sound.id, transect, distance, reference, envelope.correlation) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure excess attenuation — excess_attenuation","title":"Measure excess attenuation — excess_attenuation","text":"excess_attenuation measures excess attenuation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure excess attenuation — excess_attenuation","text":"","code":"excess_attenuation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 50), bp = \"freq.range\", path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure excess attenuation — excess_attenuation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 50. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure excess attenuation — excess_attenuation","text":"Object 'X' additional column, 'excess.attenuation', containing computed excess attenuation values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure excess attenuation — excess_attenuation","text":"Excess attenuation amplitude loss sound excess due spherical spreading (observed attenuation - expected attenuation). every doubling distance, sounds attenuate 6 dB loss amplitude (Morton, 1975; Marten & Marler, 1977). additional loss amplitude results energy loss excess expected occur distance via spherical spreading. represents power loss due additional factors like vegetation atmospheric conditions (Wiley & Richards, 1978). accounts attenuation additional factors : Ground absorption: sound energy can absorbed ground, especially environments like forests soft uneven terrain. Vegetation obstacles: trees, shrubs, obstacles can absorb scatter sound energy, reducing sound level geometric spreading alone predict. Air absorption: sound travels air, loses energy due air molecules absorbing sound waves, effect becomes pronounced longer distances. Wind temperature gradients: environmental factors can cause sound waves bend refract. Excess attenuation computed -20 * log10(rms(\"test signal\") / rms(\"reference signal\"))) - (20 * log10(1 / \"distance\") 'rms(..)' represents root mean square amplitude envelope. Low values indicate little additional attenuation. goal function measure excess attenuation sounds reference playback re-recorded increasing distances. 'sound.id' column must used indicate sounds belonging category (e.g. song-types). function compare sound type corresponding reference sound. Two approaches computing excess attenuation provided (see 'type' argument). NAs returned one envelopes completely flat (e.g. variation amplitude).","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure excess attenuation — excess_attenuation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Dabelsteen, T., & Mathevon, N. (2002). songbirds sing intensively dawn?. Acta ethologica, 4(2), 65-72.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.Marten K, & Marler P. (1977). Sound transmission significance animal vocalization. Behavioral Ecology Sociobiology, 2(3), 271-290.Morton ES. (1975). Ecological sources selection avian sounds. American Naturalist, 109(965), 17-34.Wiley, R., & Richards, D. G. (1978). Physical constraints acoustic communication atmosphere: implications evolution animal vocalizations. Behavioral Ecology Sociobiology, 3(1), 69-94.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure excess attenuation — excess_attenuation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/excess_attenuation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure excess attenuation — excess_attenuation","text":"","code":"{ # load example data data(\"test_sounds_est\") # using method 1 # add reference to X X <- set_reference_sounds(X = test_sounds_est) excess_attenuation(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) # excess_attenuation(X = X) }"},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":null,"dir":"Reference","previous_headings":"","what":"Find acoustic markers on test sound files — find_markers","title":"Find acoustic markers on test sound files — find_markers","text":"find_markers find acoustic markers test (re-recorded) sound files using spectrographic cross-correlation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find acoustic markers on test sound files — find_markers","text":"","code":"find_markers( X, markers = c(\"start_marker\", \"end_marker\"), test.files = NULL, path = getOption(\"sound.files.path\", \".\"), pb = getOption(\"pb\", TRUE), cores = getOption(\"mc.cores\", 1), ... )"},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find acoustic markers on test sound files — find_markers","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference sounds master sound file. Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time, 4) \"end\": end time selections 5) \"sound.id\": unique identifier annotated sounds 'X'. Columns 'top.freq', 'bottom.freq' 'channel' optional. acoustic start end markers (added master_sound_file) labeled \"start_marker\" \"end_marker\" respectively. Required. markers Character vector name annotations (column 'sound.id') used templates cross-correlation. Default c(\"start_marker\", \"end_marker\"). Using one marker recommended time difference position can used evaluate precision detection (see 'Value' section). test.files Character vector length 1 name(s) test (re-recorded) file(s) search marker(s). supplied sound files 'path' used instead. path Character string containing directory path test (re-recorded) sound files found. pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). ... Additional arguments passed template_correlator setting cross-correlation parameters (e.g. 'wl', 'ovlp', etc).","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find acoustic markers on test sound files — find_markers","text":"data frame test file names, marker id, maximum cross-correlation score marker start end detected. two markers used function computes additional column, 'time.mismatch', compares time difference two markers test-files master sound file. perfect detection value must 0.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find acoustic markers on test sound files — find_markers","text":"function takes master sound file's reference data ('X') finds position acoustics markers ('markers' argument, included selections 'X') re-recorded sound files. used align signals found re-recorded sound files according master sound file referenced 'X'. position markers determined highest spectrogram cross-correlation value marker using functions template_correlator template_detector. Make sure master sound file (referred 'X') found folder re-recorded sound files. Take look package vignette information incorporate function sound degradation analysis workflow. cases markers correctly detected editing test sound files remove audio segments target sounds (start marker end marker) can improve performance. Using low 'hop.size' window length 'wl' (used internally template_correlator) can help improve precision spectrogram types (argument 'type' template_correlator) can sometimes show better performance markers highly degraded.","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find acoustic markers on test sound files — find_markers","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find acoustic markers on test sound files — find_markers","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/find_markers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find acoustic markers on test sound files — find_markers","text":"","code":"{ # set temporary directory td <- tempdir() # load example data data(\"master_est\") # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(td, i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(td, \"master.wav\")) # set path and no progress bar in global options options(sound.files.path = td, pb = FALSE) # get marker position markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[2]) }"},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrograms to check test sound files alignment — manual_realign","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"manual_realign plots spectrograms visually inspect alignment precision test sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"","code":"manual_realign( X, Y, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\"), collevels = seq(-120, 0, 5), palette = viridis::viridis, duration = 2, mar = 0.2, step.lengths = c(5, 30), flim = NULL, label.col = \"white\", ext.window = TRUE, width = 10, height = 5, srt = 0, cex = 1, fast.spec = TRUE, marker = \"start_marker\", grid = 0.2, ... )"},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances. sound must unique ID within distance. Y object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) master sound file annotations. data used finding position markers find_markers. also contain 'sound.id' column. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). collevels numeric vector length 3. Specifies levels partition amplitude range spectrogram (dB). levels higher resolution spectrogram. Default seq(-120, 0, 1). palette Color palette function spectrogram. Default viridis. See spectro palettes. Palettes gray.2 may work better fast.spec = TRUE (argument can passed internal spectrogram function using \"...\"). duration numeric vector length 1. Specifies overall duration clip plotted. Notice initial part test files plotted enough tell precision alignment. mar numeric vector length 1. Specifies minimum margins adjacent () start marker used checking alignments (see 'marker' argument). Default 0.2. step.lengths Numeric vector length 2 indicating time length (ms) short (min(step.lengths)) long steps (max(step.lengths)) manually aligning spectrograms. Default c(5, 30). flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL plot spectrograms full frequency range (0 - nyquist frequency). label.col Character string controlling color lines sound ID labels. ext.window Logical. TRUE external graphic window used.Dimensions can set using 'width' 'height' arguments. Default TRUE. width Numeric vector length 1. Single value (inches) indicating width output image files. Default 10. height Numeric vector length 1. Single value (inches) indicating height output image files. Default 5. srt Numeric argument length 1. rotation (degrees) sound id labels. Default 0. cex Numeric argument length 1controlling size sound id text labels. Default 1. fast.spec Logical. TRUE image function used internally create spectrograms, substantially increases performance (much faster), although options become unavailable, collevels (amplitude scale). Default FALSE. marker Character string name marker used main reference checking/adjusting time alignments. Default 'start_marker'. Note can take sound IDs 'Y$sound.id'. grid Numeric vector length 1 controlling spacing vertical lines spectrogram. Default 0.2 s. Use 0 remove grid. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Creates multipanel graph spectrograms master test sound files users can interactively adjust alignment time. Return object similar input object 'X' start end sounds adjusted.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"function allows interactive adjustment alignment test sound files produced align_test_files. function generates multipanel graph spectrogram master sound file top test sound files, highlighting position correspondent test sounds order simplify assessing adjusting alignment. Spectrograms include first seconds sound files (controlled 'duration') usually enough tell precision alignment. lower spectrogram shows series 'buttons' users can click control test sound file spectrogram (low panel) needs moved left (\"<\") right (\">\"). Users can also reset spectrogram original position ('reset'), move next sound file 'X' (test sound file annotations) stop process (stop button). function returns object similar input object 'X' start end sounds adjusted.","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/manual_realign.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrograms to check test sound files alignment — manual_realign","text":"","code":"{ # load example data data(\"master_est\") # save example files in working director to recreate a case in which working # with sound files instead of extended selection tables. # This doesn't have to be done with your own data as you will # have them as sound files already. for (i in unique(test_sounds_est$sound.files)[1:2]) { writeWave(object = attr(test_sounds_est, \"wave.objects\")[[i]], file.path(tempdir(), i)) } # save master file writeWave(object = attr(master_est, \"wave.objects\")[[1]], file.path(tempdir(), \"master.wav\")) # get marker position markers <- find_markers(X = master_est, test.files = unique(test_sounds_est$sound.files)[2], path = tempdir()) # align all test sounds alg.tests <- align_test_files(X = master_est, Y = markers) # add error to alignment lag <- (as.numeric(as.factor(alg.tests$sound.files)) - 2) / 30 alg.tests$start <- alg.tests$start + lag alg.tests$end <- alg.tests$end + lag if(interactive()){ realigned_est <- manual_realign(X = alg.tests, Y = master_est, duration = 2, ovlp = 50, hop.size = 14, collevels = seq(-140, 0, 5), palette = viridis::mako, ext.window = FALSE) } }"},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":null,"dir":"Reference","previous_headings":"","what":"Extended selection table of master acoustic data — master_est","title":"Extended selection table of master acoustic data — master_est","text":"Extended selection table (est) acoustic data annotations master sound file synthetic sounds. synthetic sounds 2 s long, frequency modulated amplitude modulated. data created function selection_table warbleR package. re-recorded data generated sounds found example object test_sounds_est.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extended selection table of master acoustic data — master_est","text":"","code":"data(master_est)"},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Extended selection table of master acoustic data — master_est","text":"Extended selection table object warbleR format, contains annotations acoustic data.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_est.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Extended selection table of master acoustic data — master_est","text":"Marcelo Araya-Salas","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a master sound file — master_sound_file","title":"Create a master sound file — master_sound_file","text":"master_sound_file creates master sound file used playback experiments related sound degradation.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a master sound file — master_sound_file","text":"","code":"master_sound_file( X, file.name, dest.path = getOption(\"dest.path\", \".\"), overwrite = FALSE, delay = 1, gap.duration = 1, amp.marker = 2, flim = c(0, 4), cex = 14, path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a master sound file — master_sound_file","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference model sounds. Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass 6) \"top.freq\": high frequency bandpass. optional 'sound.id' column can included use custom label sound output. column must contain unique id sound (labels repeated). supplied function make combining sound file selection columns. file.name Character string indicating name sound file. dest.path Character string containing directory path sound file saved. NULL (default) current working directory used instead. overwrite Logical argument determine function overwrite existing sound file file name. Default current working directory. delay Numeric vector length 1 control duration (s) silence gap beginning (end) sound file. can useful allow time start playback experiment. Default 1. gap.duration Numeric vector length 1 control duration (s) silence gaps placed sounds. Default 1 s. amp.marker Numeric vector length 1 use constant amplify markers amplitude. useful increase amplitude markers relation sounds, picked distances. Default 2. flim Numeric vector length 2 control frequency range markers found. NULL markers display across whole frequency range. Default c(0, 4). cex Numeric vector length 1 indicating font size start end markers. Default 14. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a master sound file — master_sound_file","text":".wav file 'path' well data frame R environment annotations (.e. time position) sounds master sound file additional column 'sound.id' provides unique id sound sound file. useful identifying/labeling sounds test (re-recorded) sound files downstream analyses.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a master sound file — master_sound_file","text":"function intended simplify creation master sound files playback experiments sound degradation studies. function clips sounds sound files (wave objects extended selection tables) concatenates single sound file. function also adds acoustic markers start end playback can used time-sync test (re-recorded) sounds facilitate streamlining degradation quantification. predefined limit duration output master sound file, although long constrained computer memory. reference, master sound files 10 min created 16GB RAM laptop computer.","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create a master sound file — master_sound_file","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a master sound file — master_sound_file","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/master_sound_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a master sound file — master_sound_file","text":"","code":"{ # load example data from warbleR data(list = c( \"Phae.long1\", \"Phae.long2\", \"Phae.long3\", \"Phae.long4\", \"lbh_selec_table\" )) # save sound files to temporary folder writeWave(Phae.long1, file.path(tempdir(), \"Phae.long1.wav\")) writeWave(Phae.long2, file.path(tempdir(), \"Phae.long2.wav\")) writeWave(Phae.long3, file.path(tempdir(), \"Phae.long3.wav\")) writeWave(Phae.long4, file.path(tempdir(), \"Phae.long4.wav\")) # make an extended selection table est <- selection_table( X = lbh_selec_table, extended = TRUE, path = tempdir() ) # create master sound file master.sel.tab <- master_sound_file( X = est, file.name = \"example_master\", dest.path = tempdir(), gap.duration = 0.3 ) if (FALSE) { # \\dontrun{ # the following code exports the selection table to Raven # using the Rraven package Rraven::exp_raven(master.sel.tab, path = tempdir(), file.name = \"example_master_selection_table\") } # } } #> all selections are OK #> #> The file example_master.wav has been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA'"},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure full spectrum sound noise profiles — noise_profile","title":"Measure full spectrum sound noise profiles — noise_profile","text":"noise_profile Measure full spectrum sound pressure levels (.e. noise profiles) sound files extended selection tables.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure full spectrum sound noise profiles — noise_profile","text":"","code":"noise_profile( X = NULL, files = NULL, mar = NULL, noise.ref = c(\"adjacent\", \"custom\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), path = getOption(\"sound.files.path\", \".\"), bp = NULL, hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), PSD = FALSE, norm = TRUE, dB = c(\"A\", \"B\", \"C\", \"D\", \"ITU\", \"max0\"), averaged = TRUE )"},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure full spectrum sound noise profiles — noise_profile","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances (needed \"custom\" noise reference, see \"noise.ref\" argument). Default NULL. files Character vector names wave files analyzed. Files must found 'path' supplied (working directory 'path' supplied). Default NULL. mar numeric vector length 1. Specifies margins adjacent start end points selection measure ambient noise. Required 'X' supplied ignored supplied. Default NULL. noise.ref Character vector length 1 determined noise segment must used measuring ambient noise. Ignored 'X' supplied. Two options available: adjacent: measure ambient noise right sound (using argument 'mar' define duration ambient noise segments). custom: measure ambient noise segments referenced selection table (labeled 'ambient' 'sound.id' column). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Default NULL. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude ratio calculations. PSD Logical control whether Probability Mass Function (probability distribution frequencies). See meanspec. Default FALSE. norm Logical control whether amplitude values normalized (divided maximum) highest value 1. See meanspec. Default TRUE. dB character string length 1 specifying type dB return: \"max0\" maximum dB value 0, \"\", \"B\", \"C\", \"D\", \"ITU\" common dB weights. See meanspec. Default \"\". averaged Logical control frequency spectra averaged within sound file. Default TRUE.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure full spectrum sound noise profiles — noise_profile","text":"data frame containing frequency spectra sound file wave object ('X' supplied class 'extended.selection.table').","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure full spectrum sound noise profiles — noise_profile","text":"function estimates full spectrum sound pressure levels (.e. noise profiles) ambient noise. can done data frames/(extended) selection tables (using segments containing target sound 'ambient' sound id) complete sound files working directory (path supplied). function uses meanspec internally calculate frequency spectra.","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure full spectrum sound noise profiles — noise_profile","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305..","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure full spectrum sound noise profiles — noise_profile","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/noise_profile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure full spectrum sound noise profiles — noise_profile","text":"","code":"{ # load example data data(\"test_sounds_est\") # measure on custom noise reference noise_profile(X = test_sounds_est, mar = 0.01, pb = FALSE, noise.ref = \"custom\") # remove noise selections so noise is measured right before the signals pe <- test_sounds_est[test_sounds_est$sound.id != \"ambient\", ] noise_profile(X = pe, mar = 0.01, pb = FALSE, noise.ref = \"adjacent\") } #> sound.files freq amp #> 1 10m_closed.wav 1.002273 -1.478756370 #> 2 10m_closed.wav 2.004545 -8.554912560 #> 3 10m_closed.wav 3.006818 -15.653879395 #> 4 10m_closed.wav 4.009091 -20.594564397 #> 5 10m_closed.wav 5.011364 -24.596826317 #> 6 10m_closed.wav 6.013636 -27.741536121 #> 7 10m_closed.wav 7.015909 -28.631141207 #> 8 10m_closed.wav 8.018182 -29.343274598 #> 9 10m_closed.wav 9.020455 -31.581649783 #> 10 10m_closed.wav 10.022727 -37.142756979 #> 11 10m_open.wav 1.002273 -1.470944432 #> 12 10m_open.wav 2.004545 -5.716210091 #> 13 10m_open.wav 3.006818 -14.060376878 #> 14 10m_open.wav 4.009091 -21.637019767 #> 15 10m_open.wav 5.011364 -28.007595476 #> 16 10m_open.wav 6.013636 -31.998254047 #> 17 10m_open.wav 7.015909 -33.040067144 #> 18 10m_open.wav 8.018182 -33.446761775 #> 19 10m_open.wav 9.020455 -36.054384166 #> 20 10m_open.wav 10.022727 -40.262096085 #> 21 1m_open.wav 1.002273 0.001384514 #> 22 1m_open.wav 2.004545 -4.328099010 #> 23 1m_open.wav 3.006818 -12.731830547 #> 24 1m_open.wav 4.009091 -20.519891620 #> 25 1m_open.wav 5.011364 -24.786032150 #> 26 1m_open.wav 6.013636 -27.331145913 #> 27 1m_open.wav 7.015909 -27.522403062 #> 28 1m_open.wav 8.018182 -27.601169568 #> 29 1m_open.wav 9.020455 -30.958903505 #> 30 1m_open.wav 10.022727 -36.213758740 #> 31 30m_closed.wav 1.002273 -5.018620398 #> 32 30m_closed.wav 2.004545 -19.660800804 #> 33 30m_closed.wav 3.006818 -26.467263845 #> 34 30m_closed.wav 4.009091 -29.190019017 #> 35 30m_closed.wav 5.011364 -33.368022266 #> 36 30m_closed.wav 6.013636 -37.485873353 #> 37 30m_closed.wav 7.015909 -39.725404754 #> 38 30m_closed.wav 8.018182 -42.088478865 #> 39 30m_closed.wav 9.020455 -44.455196777 #> 40 30m_closed.wav 10.022727 -47.253627732 #> 41 30m_open.wav 1.002273 -0.794205765 #> 42 30m_open.wav 2.004545 -5.394132145 #> 43 30m_open.wav 3.006818 -16.362837354 #> 44 30m_open.wav 4.009091 -21.711879855 #> 45 30m_open.wav 5.011364 -26.204882614 #> 46 30m_open.wav 6.013636 -26.312227870 #> 47 30m_open.wav 7.015909 -28.104324225 #> 48 30m_open.wav 8.018182 -28.673914281 #> 49 30m_open.wav 9.020455 -32.218532962 #> 50 30m_open.wav 10.022727 -34.076725570"},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"plot_aligned_sounds plots spectrograms visually inspect alignment precision test sound files.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"","code":"plot_aligned_sounds( X, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 50), path = getOption(\"sound.files.path\", \".\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), collevels = seq(-120, 0, 5), palette = viridis::viridis, duration = 2, mar = 0.2, dest.path = getOption(\"dest.path\", \".\"), flim = NULL, col = \"white\", width = 7, height = 4, res = 100, label = TRUE, fast.spec = FALSE, srt = 0, cex = 1, ... )"},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances. sound must unique ID within distance. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). collevels numeric vector length 3. Specifies levels partition amplitude range spectrogram (dB). levels higher resolution spectrogram. Default seq(-40, 0, 1). seq(-115, 0, 1) produces spectrograms similar acoustic analysis software packages. palette Color palette function spectrogram. Default viridis. See spectro palettes. Palettes gray.2 may work better fast.spec = TRUE. duration numeric vector length 1. Specifies overall duration clip plotted. Notice initial part test files plotted enough tell precision alignment. mar numeric vector length 1. Specifies margins adjacent start first annotation included plot. dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL plot spectrograms full frequency range (0 - nyquist frequency). col Character string controlling color lines sound ID labels. width Numeric vector length 1. Single value (inches) indicating width output image files. Default 7. height Numeric vector length 1. Single value (inches) indicating height output image files. Default 4. res Numeric argument length 1. Controls image resolution. Default 100 (faster) although 300 - 400 recommended publication/presentation quality. label Logical control labels ('sound.id' column 'X') plotted. Default TRUE. fast.spec Logical. TRUE image function used internally create spectrograms, substantially increases performance (much faster), although options become unavailable, collevels (amplitude scale). Default FALSE. srt Numeric argument length 1. rotation (degrees) sound id labels. Default 0. cex Numeric argument length 1controlling size sound id text labels. Default 1. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Image files jpeg format spectrograms working directory, one sound file 'X'. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"functions aims simplify evaluation alignment test sound files align_test_files. function creates single spectrogram sound file (saved 'dest.path'). Spectrograms include first seconds sound files (controlled 'duration') usually enough tell precision alignment. plots include vertical lines denoting start end sound well sound ID ('sound.id' column 'X'). Note plot created R graphic device.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_aligned_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrograms to check test sound files alignment — plot_aligned_sounds","text":"","code":"{ # load example data data(\"test_sounds_est\") # plot (look into temporary working directory `tempdir()`) plot_aligned_sounds(X = test_sounds_est, dest.path = tempdir(), duration = 3, ovlp = 0) } #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA'"},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot blur ratio — plot_blur_ratio","title":"Plot blur ratio — plot_blur_ratio","text":"plot_blur_ratio plots time frequency blur ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot blur ratio — plot_blur_ratio","text":"","code":"plot_blur_ratio( X, type = c(\"envelope\", \"spectrum\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), env.smooth = getOption(\"env.smooth\", 200), spec.smooth = getOption(\"spec.smooth\", 5), res = 150, flim = c(\"-1\", \"+1\"), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), palette = viridis::viridis, collevels = seq(-120, 0, 5), dest.path = getOption(\"dest.path\", \".\"), path = getOption(\"sound.files.path\", \".\"), colors = viridis::viridis(3), n.samples = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot blur ratio — plot_blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. type Character vector length 1 indicating type blur ratio plot. two options 'envelope' (regular blur ratio blur_ratio, default) 'spectrum' (spectrum blur ratio spectrum_blur_ratio). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope calculation (used internally env). Default 200. spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. Can set globally current R session via \"spec.smooth\" option (see options). res Numeric argument length 1. Controls image resolution. Default 150 (faster) although 300 - 400 recommended publication/presentation quality. flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrograms, spectro. Default NULL. Alternatively, character vector similar c(\"-1\", \"1\") first number value added minimum bottom frequency 'X' second value added maximum top frequency 'X'. computed independently sound id frequency limit better fits frequency range annotated signals. useful test sounds show marked differences frequency ranges. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. used plotting. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). palette color palette function used assign colors plot, spectro. Default viridis. collevels Numeric vector indicating set levels used partition amplitude range spectrogram (dB) spectro. Default seq(-120, 0, 5). dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). colors Character vector length 4 containing colors used color identify reference sound (element 1), color identify test sound (element 2) color blurred region (element 3). n.samples Numeric vector length 1 specifying number amplitude samples (frequency bins spectrum = TRUE) use representing power distributions. Default 100. null raw power distribution used (note can result high RAM memory usage large data sets).","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot blur ratio — plot_blur_ratio","text":"returns 1 image file ('jpeg' format) blur ratio estimation, showing spectrograms sounds overlaid amplitude envelopes (power spectra spectrum = TRUE) probability mass functions (PMF). Spectrograms shown within frequency range reference sound. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot blur ratio — plot_blur_ratio","text":"function generates image files ('jpeg' format) possible blur ratio estimation 'X'. image files show spectrograms sounds overlaid power distribution (either amplitude envelopes power spectrum, see argument 'type') probability mass functions (PMF). output graphs highlight mismatch compared distribution represent estimated blur ratio returned either blur_ratio spectrum_blur_ratio. Spectrograms shown within frequency range reference sound also show dotted lines time (type = \"envelope\") frequency range (type = \"spectrum\") energy distributions computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot blur ratio — plot_blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot blur ratio — plot_blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot blur ratio — plot_blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # create plots plot_blur_ratio(X = X, dest.path = tempdir()) } #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA'"},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":null,"dir":"Reference","previous_headings":"","what":"Save multipanel plots with reference and test sounds — plot_degradation","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"plot_degradation creates multipanel plots (image files) reference test sounds distance transect.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"","code":"plot_degradation( X, nrow = 4, env.smooth = getOption(\"env.smooth\", 200), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), dest.path = getOption(\"dest.path\", \".\"), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), collevels = seq(-120, 0, 5), palette = viridis::viridis, flim = c(\"-1\", \"+1\"), envelope = TRUE, spectrum = TRUE, heights = c(4, 1), widths = c(5, 1), margins = c(2, 1), row.height = 2, col.width = 2, cols = viridis::mako(4, alpha = 0.3), res = 120, ... )"},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. nrow Numeric vector length 1 number rows per image file. Default 4. dynamically adjusted rows needed set. env.smooth Numeric vector length 1 determining length sliding window (amplitude samples) used sum smooth amplitude envelope power spectrum calculations (used internally env). Default 200. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. used plotting. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). dest.path Character string containing directory path image files saved. supplied current working directory used instead. Can set globally current R session via \"dest.path\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). collevels Numeric vector indicating set levels used partition amplitude range spectrogram (dB) spectro. Default seq(-120, 0, 5). palette color palette function used assign colors plot, spectro. Default viridis. flim numeric vector length 2 indicating highest lowest frequency limits (kHz) spectrogram, spectro. Default NULL. Alternatively, character vector similar c(\"-1\", \"1\") first number value added minimum bottom frequency 'X' second value added maximum top frequency 'X'. computed independently sound id frequency limit better fits frequency range annotated signals. useful test sounds show marked differences frequency ranges. envelope Logical control envelopes plotted. Default TRUE. spectrum Logical control power spectra plotted. Default TRUE. heights Numeric vector length 2 control relative heights spectrogram (first number) amplitude envelope (second number) envelope = TRUE. Default c(4, 1). widths Numeric vector length 2 control relative widths spectrogram (first number) power spectrum (second number) spectrum = TRUE. Default c(5, 1). margins Numeric vector length 2 control relative time test sound (first number) adjacent margins (.e. adjacent background noise, second number) included spectrogram spectrum = TRUE. Default c(2, 1) means margin next sound half duration sound. Note spectrograms time length margins calculated ensure spectrograms match duration spectrogram longest sound. , argument controls margin longest sound. row.height Numeric vector length 1 controlling height (inches) sound panels output image file. Default 2. col.width Numeric vector length 1 controlling width (inches) sound panels output image file. Default 2. cols Character vector length 4 containing colors used background column row title panels (element 1), color amplitude envelopes (element 2), color power spectra (element 3), background color envelopes spectra (element 4). res Numeric argument length 1. Controls image resolution. Default 120 (faster) although 300 - 400 recommended publication/presentation quality. ... Additional arguments passed internal spectrogram creating function customizing graphical output. function modified version spectro, takes arguments.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"One ore image files multipanel figure spectrograms test sound distance, sound id transect. also returns file path images invisibly.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"function aims simplify visual inspection sound degradation producing multipanel figures (saved 'dest.path') containing visualizations test sound reference. Sounds sorted distance (columns) transect (1). Visualizations include spectrograms, amplitude envelopes power spectra (last 2 optional). row includes copies sound id given transect (row label includes sound id first line transect second line), also including reference comes another transect. Ambient noise annotations (sound.id 'ambient') excluded. Amplitude envelopes power spectra computed using functions envelope (warbleR package) spec (seewave package) respectively. two visualizations show power distribution time frequency minimum maximum power values sound. Therefore scales necessarily comparable across panels.","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/plot_degradation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save multipanel plots with reference and test sounds — plot_degradation","text":"","code":"# \\donttest{ # load example data data(\"test_sounds_est\") # order so spectrograms from same sound id as close in the graph test_sounds_est <- test_sounds_est[order(test_sounds_est$sound.id), ] # set directory to save image files options(dest.path = tempdir()) # method 1 Y <- set_reference_sounds(X = test_sounds_est) # plot degradation spectrograms plot_degradation( X = Y, nrow = 3, ovlp = 95 ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # using other color palettes plot_degradation( X = Y, nrow = 3, ovlp = 95, cols = viridis::magma(4, alpha = 0.3), palette = viridis::magma ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # missing some data, 2 rows plot_degradation( X = Y[-3, ], nrow = 2, ovlp = 95, cols = viridis::mako(4, alpha = 0.4), palette = viridis::mako, wl = 200 ) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # changing marging and high overlap plot_degradation(X = Y, margins = c(5, 1), nrow = 6, ovlp = 95) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # more rows than needed (will adjust it automatically) plot_degradation(X = Y, nrow = 10, ovlp = 90) #> The image files have been saved in the directory path '/private/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/Rtmp7Be5pA' # }"},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Set reference for test sounds — set_reference_sounds","title":"Set reference for test sounds — set_reference_sounds","text":"set_reference_sounds set rows used reference test sound.","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set reference for test sounds — set_reference_sounds","text":"","code":"set_reference_sounds( X, method = getOption(\"method\", 1), cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set reference for test sounds — set_reference_sounds","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances (transects 1) 8) \"distance\": distance (numeric) test sound re-recorded. 'transect' column labeling sounds recorded transect required 'method = 2'. 'X' can 1 copy given sound id distance transect-distance combination (column 'transect' supplied). addition, 'selec' column values 'X' duplicated within sound file ('sound.files' column) combination used refer specific rows output 'reference' column. method Integer vector length 1 indicate 'experimental design' measuring degradation. Two methods available: 1: compare sounds ('sound.id') counterpart recorded closest distance source (e.g. compare sounds recorded 5m, 10m 15m counterpart recorded 1m). default method. function try use references transect. However, another test sound 'sound.id' shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. 2: compare sounds counterpart recorded distance immediately within transect (e.g. sound recorded 10m compared sound recorded 5m, sound recorded 15m compared sound recorded 10m ). 'transect' column 'X' required. Can set globally current R session via \"method\" option (see options). cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set reference for test sounds — set_reference_sounds","text":"object similar 'X' one additional column, 'reference', ID sounds used reference degradation-quantifying functions downstream analyses. ID created paste(X$sound.files, X$selec, sep = \"-\").","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set reference for test sounds — set_reference_sounds","text":"function adds 'reference' column defining sounds used functions reference. Two methods available (see 'methods' argument description). method 1 function attempt use re-recorded sounds shortest distance transect reference. However, another re-recorded sound 'sound.id' shorter distance transects, used reference instead. behavior aims account fact type experiments reference sounds typically recorded 1 m single transect. Note users want define reference sound can set manually. , NAs must used indicate rows ignored. References must indicated combination 'sound.files' 'selec' column. instance, '10m.wav-1' indicates row 'selec' column '1' sound file '10m.wav' used reference. function also checks information 'X' right format wont produce errors downstream analysis (see 'X' argument description details format). function ignore rows column 'sound.id' equals 'ambient', 'start_marker' 'end_marker'.","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set reference for test sounds — set_reference_sounds","text":"Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: R package streamline analysis animal acoustic signals. Methods Ecology Evolution, 8(2), 184-191.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Set reference for test sounds — set_reference_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/set_reference_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set reference for test sounds — set_reference_sounds","text":"","code":"{ # load example data data(\"test_sounds_est\") # save wav file examples X <- test_sounds_est[test_sounds_est$sound.files != \"master.wav\", ] # method 1 Y <- set_reference_sounds(X = X) # method 2 Y <- set_reference_sounds(X = X, method = 2) }"},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"signal_to_noise_ratio measures attenuation signal--noise ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"","code":"signal_to_noise_ratio( X, mar = NULL, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), eq.dur = FALSE, noise.ref = c(\"adjacent\", \"custom\"), snr.formula = 1, bp = \"freq.range\", hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds (typically output align_test_files). Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass 7) \"sound.id\": ID sounds used identify counterparts across distances (needed \"custom\" noise reference, see \"noise.ref\" argument). mar numeric vector length 1. Specifies margins adjacent start point annotation measure ambient noise. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). eq.dur Logical. Controls whether ambient noise segment measured duration sound (TRUE. Default FALSE). TRUE 'mar' 'noise.ref' arguments ignored. noise.ref Character vector length 1 determined noise segment must used measuring ambient noise. Two options available: adjacent: measure ambient noise right test sounds (using argument 'mar' define duration ambient noise segments). custom: measure ambient noise segments referenced selection table (labeled 'ambient' 'sound.id' column). segments used apply ambient noise reference sounds sound file. Therefore, least one 'ambient' selection sound file must provided. several 'ambient' selections sound file supplied, root mean square amplitude envelope averaged across selections. snr.formula Integer vector length 1. Selects formula used calculate signal--noise ratio (S = signal , N = background noise): 1: ratio S amplitude envelope root mean square N amplitude envelope root mean square (20 * log10(rms(env(S))/rms(env(N)))) described Darden (2008). 2: ratio difference S amplitude envelope root mean square N amplitude envelope root mean square N amplitude envelope root mean square (20 * log10((rms(env(S)) - rms(env(N)))/rms(env(N))), described Dabelsteen et al (1993). bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude ratios calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Object 'X' additional column, 'signal..noise.ratio', signal--noise ratio values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Signal--noise ratio (SNR) measures sound amplitude level relation ambient noise. Noise measured background noise immediately test sound. general margin ambient noise measured must specified. Alternatively, selection ambient noise can used reference (see 'noise.ref' argument). margins overlap another sound nearby, SNR inaccurate, margin length carefully considered. SNR less equal one suggests background noise equal overpowering sound. function measure signal--noise ratio within supplied frequency range (e.g. bandpass) reference signal ('bottom.freq' 'top.freq' columns 'X') default (, bp = 'freq.range'. SNR can ~0 tail signal low amplitude.","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Holland J, Dabelsteen T, Pedersen SB, Paris AL (2001) Potential ranging cues contained within energetic pauses transmitted wren song. Bioacoustics 12(1):3-20.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/signal_to_noise_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure attenuation as signal-to-noise ratio — signal_to_noise_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # using measure ambient noise reference selections signal_to_noise_ratio(X = test_sounds_est, mar = 0.05, noise.ref = \"custom\") # using margin for ambient noise of 0.05 and adjacent measure ambient noise reference signal_to_noise_ratio(X = test_sounds_est, mar = 0.05, noise.ref = \"adjacent\") } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 10 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 4 more column(s) (sound.id, transect, distance, signal.to.noise.ratio) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"spcc measures spectrographic cross-correlation measure sound distortion sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"","code":"spcc( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 90), wn = \"hanning\", path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying % overlap two consecutive windows, spectro. Default 90. High values ovlp slow function produce accurate results. Can set globally current R session via \"ovlp\" option (see options). wn character vector length 1 specifying window name ftwindow. path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Object 'X' additional column, 'cross.correlation', containing computed spectrogram cross-correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Spectrographic cross-correlation measures frequency distortion sounds similarity metric. Values close 1 means similar spectrograms (.e. little sound distortion occurred). Cross-correlation measured sounds reference playback re-recorded increasing distances. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compares sound corresponding reference sound within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing cross-correlation provided (see 'method' argument). function wrapper warbleR's cross_correlation function.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Clark, C.W., Marler, P. & Beeman K. (1987). Quantitative analysis animal vocal phonology: application Swamp Sparrow song. Ethology. 76:101-115.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spcc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure spectrographic cross-correlation as a measure of sound distortion — spcc","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # get spcc spcc(X = X) } #> Object of class 'extended_selection_table' #> * The output of the following call: #> selection_table(X = alg, path = \"./testing/example_data/tailored_files_tlalpan/\", extended = TRUE, confirm.extended = FALSE, mar = 10, by.song = \"sound.files\") #> #> Contains: #> * A selection table data frame with 25 row(s) and 11 columns: #> | |sound.files | selec| start| end| bottom.freq| top.freq| #> |:--|:--------------|-----:|------:|------:|-----------:|--------:| #> |8 |10m_closed.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> |9 |10m_closed.wav | 2| 1.3000| 1.5000| 7.8750| 8.8050| #> |10 |10m_closed.wav | 3| 1.5500| 1.7500| 3.2080| 4.0690| #> |11 |10m_closed.wav | 4| 1.8000| 2.0001| 0.4220| 1.2230| #> |12 |10m_closed.wav | 5| 2.0501| 2.2501| 6.9050| 7.9170| #> |13 |10m_open.wav | 1| 0.0500| 0.2000| 1.3333| 2.6667| #> ... 5 more column(s) (sound.id, transect, distance, reference, cross.correlation) #> and 19 more row(s) #> #> * 5 wave object(s) (as attributes): #> 10m_closed.wav, 10m_open.wav, 1m_open.wav, 30m_closed.wav, 30m_open.wav #> #> * A data frame (check.results) with 25 rows generated by check_sels() (as attribute) #> #> Additional information: #> * The selection table was created by song (see 'class_extended_selection_table') #> * 1 sampling rate(s) (in kHz): 22.05 #> * 1 bit depth(s): 16 #> * Created by warbleR 1.1.29"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"spectrum_blur_ratio measures blur ratio frequency spectra sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"","code":"spectrum_blur_ratio( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), spec.smooth = getOption(\"spec.smooth\", 5), spectra = FALSE, res = 150, hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), n.bins = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. spectra Logical control power spectra returned (attributes). Default FALSE. res Numeric argument length 1. Controls image resolution. Default 150 (faster) although 300 - 400 recommended publication/presentation quality. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl numeric vector length 1 specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Applied spectra spectrograms image files. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Applied spectra spectrograms image files. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). n.bins Numeric vector length 1 specifying number frequency bins use representing power spectra. Default 100. null raw power spectrum used (note can result high RAM memory usage large data sets). Power spectrum values interpolated using approx.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Object 'X' additional column, 'spectrum.blur.ratio', containing computed spectrum blur ratio values. spectra = TRUE output include power spectra sounds attributes ('attributes(X)$spectra').","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Spectral blur ratio measures degradation sound function change sound power frequency domain, analogous blur ratio proposed Dabelsteen et al (1993) time domain (implemented blur_ratio). Low values indicate low degradation sounds. function measures blur ratio spectra sounds reference playback re-recorded different distances. Spectral blur ratio measured mismatch power spectra (expressed probability density functions) reference sound re-recorded sound. function compares sound type corresponding reference sound. 'sound.id' column must used tell function compare sounds belonging category (e.g. song-types). Two methods setting experimental design provided. wave objects extended selection table must sampling rate length spectra comparable. function uses spec internally compute power spectra. NA returned least one power spectra computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation sound signals: Quantifying effects communication sounds bird location blur ratio, excess attenuation, signal--noise ratio blackbird song. Journal Acoustical Society America, 93(4), 2206.Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_blur_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure blur ratio in the frequency domain — spectrum_blur_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # add reference to X X <- set_reference_sounds(X = test_sounds_est) # get spetrum blur ratio spectrum_blur_ratio(X = X) # using method 2 X <- set_reference_sounds(X = test_sounds_est, method = 2) spectrum_blur_ratio(X = X) # get power spectra sbr <- spectrum_blur_ratio(X = X, spectra = TRUE) spctr <- attributes(sbr)$spectra # make distance a factor for plotting spctr$distance <- as.factor(spctr$distance) # plot rlang::check_installed(\"ggplot2\") library(ggplot2) ggplot(spctr[spctr$freq > 0.3, ], aes(y = amp, x = freq, col = distance)) + geom_line() + facet_wrap(~sound.id) + scale_color_viridis_d(alpha = 0.7) + labs(x = \"Frequency (kHz)\", y = \"Amplitude (PMF)\") + coord_flip() + theme_classic() }"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure frequency spectrum correlation — spectrum_correlation","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"spectrum_correlation measures frequency spectrum correlation sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"","code":"spectrum_correlation( X, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), cor.method = c(\"pearson\", \"spearman\", \"kendall\"), spec.smooth = getOption(\"spec.smooth\", 5), hop.size = getOption(\"hop.size\", 11.6), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 70), path = getOption(\"sound.files.path\", \".\"), n.bins = 100 )"},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"X output set_reference_sounds object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass, 6) \"top.freq\": high frequency bandpass, 7) \"sound.id\": ID sounds used identify counterparts across distances 8) \"reference\": identity sounds used reference test sound (row). See set_reference_sounds details structure 'X'. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). cor.method Character string indicating correlation coefficient applied (\"pearson\", \"spearman\", \"kendall\", see cor). spec.smooth Numeric vector length 1 determining length sliding window used sum smooth power spectrum calculation (kHz). Default 5. hop.size numeric vector length 1 specifying time window duration (ms). Default 11.6 ms, equivalent 512 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). wl vector single even integer number specifying window length spectrogram, default NULL. supplied, 'hop.size' ignored. Odd integers rounded nearest even number. Can set globally current R session via \"wl\" option (see options). ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 70. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options). n.bins Numeric vector length 1 specifying number frequency bins use representing power spectra. Default 100. null raw power spectrum used (note can result high RAM memory usage large data sets). Power spectrum values interpolated using approx.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Object 'X' additional column, 'spectrum.correlation', containing computed frequency spectrum correlation coefficients.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"spectral correlation measures similarity two sounds frequency domain. function measures spectral correlation coefficients sounds reference playback re-recorded increasing distances. Values range 1 (identical frequency spectrum, .e. degradation) 0. 'sound.id' column must used indicate function compare sounds belonging category (e.g. song-types). function compare sound corresponding reference sound. Two methods computing spectral correlation provided (see 'method' argument). function uses meanspec internally compute power spectra. Use spectrum_blur_ratio extract raw spectra values. NA returned least one power spectra computed.","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Apol, C.., Sturdy, C.B. & Proppe, D.S. (2017). Seasonal variability habitat structure may shaped acoustic signals repertoires black-capped boreal chickadees. Evol Ecol. 32:57-74.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/spectrum_correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure frequency spectrum correlation — spectrum_correlation","text":"","code":"{ # load example data data(\"test_sounds_est\") # method 1 # add reference column Y <- set_reference_sounds(X = test_sounds_est) # run spectrum correlation spectrum_correlation(X = Y) # method 2 Y <- set_reference_sounds(X = test_sounds_est, method = 2) # spectrum_correlation(X = Y) }"},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":null,"dir":"Reference","previous_headings":"","what":"Create synthetic sounds — synth_sounds","title":"Create synthetic sounds — synth_sounds","text":"synth_sounds create synthetic sounds","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create synthetic sounds — synth_sounds","text":"","code":"synth_sounds( replicates = 1, frequencies, durations, nharmonics = 1, fm = FALSE, am = FALSE, am.amps = rep(c(1:4, 3:2), length.out = 11), mar = 0.05, seed = NULL, sig2 = 0.3, shuffle = FALSE, hrm.freqs = c(1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10), sampling.rate = 44.1, pb = TRUE )"},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create synthetic sounds — synth_sounds","text":"replicates Numeric vector length 1 indicating number replicates treatment combination. Default 1. Useful measuring variation transmission parameters. frequencies Numeric vector different frequencies (seconds) synthesize. Brownian bridge motion stochastic process (diff.fun == \"BB\") used simulate frequency modulation (see simulate_songs). durations Numeric vector different durations (seconds) synthesize. nharmonics Numeric vector length 1 specifying number harmonics simulate. 1 indicates fundamental frequency harmonic simulated. fm Logical control frequency modulated sounds pure tones (.e. non-modulated sounds) synthesize. FALSE (default) pure tones synthesized. Logical control amplitude modulated sounds non-modulated sounds synthesize. FALSE (default) non-modulated sounds synthesized. .amps Numeric vector relative amplitude time step simulate amplitude modulation (applied fundamental frequency). default value (rep(c(1:4, 3:2), length.= 11)) 2 amplitude peaks (although applied '= TRUE') mar Numeric vector duration margins silence around sounds seconds. Default 0.05. seed Numeric vector length 1. allows users get results different runs (using se.seed internally). Default NULL. sig2 Numeric vector length 1 defining sigma value brownian motion model (used simulating frequency modulation). Default 0.3. shuffle Logical control position sounds randomized. sounds treatment sequence can problematic environmental noise masks . Hence 'shuffle' useful avoid sounds treatment next . Default FALSE. hrm.freqs Numeric vector frequencies harmonics relative fundamental frequency. default values c(1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10). sampling.rate Numeric vector length 1. Sets sampling frequency wave object (kHz). Default 44.1. pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create synthetic sounds — synth_sounds","text":"extended selection table, can input master_sound_file create .wav file. table contains columns varying features 'treatment' column (useful tell acoustic features sound) 'replicate' column indicating replicates 'treatment'.","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create synthetic sounds — synth_sounds","text":"function creates synthetic sounds can used playback experiments understand link signal structure transmission properties. function can add variation signal structure 5 features: frequency: continuous, argument 'frequencies'. duration: continuous, argument 'durations'. harmonic structure: binary (harmonics vs -harmonics), arguments 'nharmonics' 'hrm.freqs'. frequency modulation: variation fundamental frequency across time. Binary (modulated vs non-modulated), arguments 'fm' 'sig2'. amplitude modulation: variation amplitude across time. Binary (modulated vs non-modulated), arguments '' '.amps'. Sound possible combinations selected structure dimensions synthesized. output extended selection table, can input master_sound_file create .wav file. functions uses simulate_songs internally synthesizing individual sounds. Brownian bridge motion stochastic process (diff.fun == \"BB\") used simulate frequency modulation. output table contains columns varying features 'treatment' column (useful tell sound combination features using replicates).","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create synthetic sounds — synth_sounds","text":"Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: R package streamline analysis animal acoustic signals. Methods Ecology Evolution, 8(2), 184-191.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create synthetic sounds — synth_sounds","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/synth_sounds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create synthetic sounds — synth_sounds","text":"","code":"if (FALSE) { # \\dontrun{ synthetic_est <- synth_sounds( mar = 0.01, frequencies = c(1, 2, 3, 5), durations = 0.1, fm = TRUE, am = TRUE, nharmonics = 4, shuffle = TRUE, replicates = 3 ) } # }"},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"tail_to_signal_ratio measures reverberations tail--signal ratio sounds referenced extended selection table.","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"","code":"tail_to_signal_ratio( X, mar, cores = getOption(\"mc.cores\", 1), pb = getOption(\"pb\", TRUE), tsr.formula = 1, bp = \"freq.range\", hop.size = getOption(\"hop.size\", 1), wl = getOption(\"wl\", NULL), ovlp = getOption(\"ovlp\", 0), path = getOption(\"sound.files.path\", \".\") )"},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"X Object class 'data.frame', 'selection_table' 'extended_selection_table' (last 2 classes created function selection_table warbleR package) reference test sounds . Must contain following columns: 1) \"sound.files\": name .wav files, 2) \"selec\": unique selection identifier (within sound file), 3) \"start\": start time 4) \"end\": end time selections, 5) \"bottom.freq\": low frequency bandpass 6) \"top.freq\": high frequency bandpass. mar numeric vector length 1. Specifies margins adjacent end sound measure tail power. cores Numeric vector length 1. Controls whether parallel computing applied specifying number cores used. Default 1 (.e. parallel computing). Can set globally current R session via \"mc.cores\" option (see options). pb Logical argument control progress bar shown. Default TRUE. Can set globally current R session via \"pb\" option (see options). tsr.formula Integer vector length 1. Determine formula used calculate tail--signal ratio (S = signal, T = tail, N = background noise): 1: ratio T amplitude envelope quadratic mean S amplitude envelope quadratic mean (rms(env(T))/rms(env(S))) described Dabelsteen et al. (1993). 2: ratio T amplitude envelope quadratic mean N amplitude envelope quadratic mean (rms(env(T))/rms(env(N))). N measure margin right sound. tsr.formula 2 actually measures tail--noise ratio. bp Numeric vector length 2 giving lower upper limits frequency bandpass filter (kHz). Alternatively, set 'freq.range' (default), function use 'bottom.freq' 'top.freq' sound bandpass range. hop.size numeric vector length 1 specifying time window duration (ms). Default 1 ms, equivalent ~45 wl 44.1 kHz sampling rate. Ignored 'wl' supplied. Can set globally current R session via \"hop.size\" option (see options). Note might internally adjusted number samples tail lower hop.size. wl numeric vector length 1 specifying window length spectrogram, default NULL. Ignored bp = NULL. supplied, 'hop.size' ignored. Note lower values increase time resolution, important amplitude calculations. ovlp Numeric vector length 1 specifying percentage overlap two consecutive windows, spectro. Default 0. used bandpass filtering. Can set globally current R session via \"ovlp\" option (see options). path Character string containing directory path sound files found. needed 'X' extended selection table. supplied current working directory used. Can set globally current R session via \"sound.files.path\" option (see options).","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Object 'X' additional column, 'tail..signal.ratio', tail--signal ratio values (dB).","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Tail--signal ratio (TSR) measures ratio power tail reverberations test sound. general margin reverberation tail measured must specified. function measure TSR within supplied frequency range (e.g. bandpass) reference sound ('bottom.freq' 'top.freq' columns 'X'). Two methods computing reverberations provided (see 'tsr.formula' argument). Note 'tsr.formula' 2 equivalent original description TSR Dabelsteen et al. (1993) better referred tail--noise ratio. Tail--signal ratio values typically negative signals tend higher power reverberating tail. TSR can ~0 tail signal low amplitude.","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, . Garcia-Rodriguez, . Rico-Guevara. (2023), baRulho: R package quantify degradation animal acoustic signals .bioRxiv 2023.11.22.568305.Darden, SK, Pedersen SB, Larsen , & Dabelsteen T. (2008). Sound transmission ground level short-grass prairie habitat implications long-range communication swift fox *Vulpes velox*. Journal Acoustical Society America, 124(2), 758-766.Mathevon, N., Dabelsteen, T., & Blumenrath, S. H. (2005). high perches blackcap Sylvia atricapilla song listening posts? sound transmission study. Journal Acoustical Society America, 117(1), 442-449.","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)","code":""},{"path":"https://marce10.github.io/baRulho/reference/tail_to_signal_ratio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Measure reverberations as tail-to-signal ratio — tail_to_signal_ratio","text":"","code":"{ # load example data data(\"test_sounds_est\") # set global options options(pb = FALSE) # using margin for noise of 0.01 tsr <- tail_to_signal_ratio(X = test_sounds_est, mar = 0.01) # use tsr.formula 2 which is equivalent to tail-to-noise ratio tsr <- tail_to_signal_ratio(X = test_sounds_est, mar = 0.01, tsr.formula = 2) }"},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":null,"dir":"Reference","previous_headings":"","what":"Extended selection table with re-recorded playbacks — test_sounds_est","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Extended selection table (est) 7 re-recorded synthetic sounds. synthetic sounds 2 s long, frequency modulated, amplitude modulated, broadcast re-recorded 3 distances (1, 10 30m, column 'distance'). data created function selection_table warbleR package. master sound file data used create test sounds found example object master_est.","code":""},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"","code":"data(test_sounds_est)"},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Extended selection table object warbleR format, contains annotations acoustic data.","code":""},{"path":"https://marce10.github.io/baRulho/reference/test_sounds_est.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Extended selection table with re-recorded playbacks — test_sounds_est","text":"Marcelo Araya-Salas","code":""},{"path":[]},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-212","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.2","title":"baRulho 2.1.2","text":"CRAN release: 2024-08-31","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-2-1-2","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 2.1.2","text":"Improved tracking progress messages 1 progress bar used process","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-211","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.1","title":"baRulho 2.1.1","text":"Update requested CRAN fix package reference issue. changes code.","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-210","dir":"Changelog","previous_headings":"","what":"baRulho 2.1.0","title":"baRulho 2.1.0","text":"CRAN release: 2024-04-21","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"new-features-2-1-0","dir":"Changelog","previous_headings":"","what":"NEW FEATURES","title":"baRulho 2.1.0","text":"new function add_noise() modifying signal--noise ratio adding synthetic noise new function manual_realign() generates interactive plot manual adjustment time alignments new function plot_blur_ratio() generates plots previously created blur_ratio() spectrum_blur_ratio() new function plot_degradation() visually compare sounds across distances new function plot_aligned_sounds() visually assess precision test sound alignment align_test_files() now can take several markers input select highest correlation score aligning test files New function attenuation() Data frames selection tables can used input data Added new methods blur_ratio() excess_atenuation() spectral_correlation() spectral_blur_ratio() renamed spectrum_correlation(), spectrum_blur_ratio() respectively","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-2-1-0","dir":"Changelog","previous_headings":"NEW FEATURES","what":"MINOR IMPROVEMENTS","title":"baRulho 2.1.0","text":"optimize performance signal_to_noise_ratio() atmospheric_attenuation() longer available (use attenuation() instead) Improved documentation functions Fix bug spcc() excess_attenuation() ‘markers’ argument deprecated align_test_files() fix bug auto_realign() find_markers() compares time difference markers master sound file measure precision find_markers() can run several markers templates files ‘template.rows’ argument deprecated find_markers() spcc_align() renamed auto_realign() search_templates() renamed find_markers() ‘output’ argument deprecated ‘parallel’ argument deprecated replaced ‘cores’","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-106","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.6","title":"baRulho 1.0.6","text":"CRAN release: 2022-03-01 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-105","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.5","title":"baRulho 1.0.5","text":"CRAN release: 2021-04-21 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-104","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.4","title":"baRulho 1.0.4","text":"CRAN release: 2021-03-09","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-4","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.4","text":"warbleR::freq_range_detec() now used internally detect frequency range markers master_sound_file()","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-103","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.3","title":"baRulho 1.0.3","text":"CRAN release: 2021-02-11 Update requested CRAN","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-103-1","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.3","title":"baRulho 1.0.3","text":"CRAN release: 2021-02-11","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-3","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.3","text":"New argument ‘marker’ align_test_files() control start end marker used aligning Fix bug detecting several templates per sound file search_templates()","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-102","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.2","title":"baRulho 1.0.2","text":"CRAN release: 2020-06-07","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"minor-improvements-1-0-2","dir":"Changelog","previous_headings":"","what":"MINOR IMPROVEMENTS","title":"baRulho 1.0.2","text":"Windows length converted even functions Fix sign error signal amplitude measurements (signal_to_noise_ratio() excess_attenuation()) New function noise_profile() rename snr() signal_to_noise_ratio() New function tail_to_signal_ratio() measure reverberations Fix bug excess_attenuation() method = 1 Added type argument excess_attenuation() run “Darden” version excess attenuation","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-101","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.1","title":"baRulho 1.0.1","text":"CRAN release: 2020-03-09","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"new-features-1-0-1","dir":"Changelog","previous_headings":"","what":"NEW FEATURES","title":"baRulho 1.0.1","text":"New function search_templates() find signals re-recorded sound files New function align_test_files() set time signals aligned re-recorded files Parallel available internal prep_X_bRlo_int() function Data frame also returned functions","code":""},{"path":"https://marce10.github.io/baRulho/news/index.html","id":"barulho-100","dir":"Changelog","previous_headings":"","what":"baRulho 1.0.0","title":"baRulho 1.0.0","text":"CRAN release: 2020-02-22 First release","code":""}]