|
20 | 20 | #' @param make_plot whether to also output a plot showing the synchs in time in recording vs talking clock time, with the final fit and outliers indicated
|
21 | 21 | #' @param handle_special_cases whether (`T` or `F`) to handle a few special cases in the synch info table, such as when the synch clock stopped or when two synch clocks were around due to a group split with rovers - these cases had to be hardcoded in. this parameter should always be set to `T` for meerkat data
|
22 | 22 | #' @param quadratic_fit whether (`T` or `F`) to perform a quadratic fit to the synchs
|
| 23 | +#' @param remove_noisy_synchs whether (`T` or `F`) to remove synchs that are labeled as noisy (will remove everything that has an x, not case sensitive) |
23 | 24 | #'
|
24 | 25 | #' @returns Returns a list containing:
|
25 | 26 | #'
|
@@ -72,7 +73,8 @@ meerkat_synch_audio_file_labels_to_UTC <- function(path_to_label_file,
|
72 | 73 | min_frac_spanned_by_synchs = 0.2,
|
73 | 74 | make_plot = T,
|
74 | 75 | handle_special_cases = T,
|
75 |
| - quadratic_fit = F){ |
| 76 | + quadratic_fit = F, |
| 77 | + remove_noisy_synchs = T){ |
76 | 78 |
|
77 | 79 | #----READ IN LABELS----
|
78 | 80 |
|
@@ -196,6 +198,13 @@ meerkat_synch_audio_file_labels_to_UTC <- function(path_to_label_file,
|
196 | 198 | #find synchs
|
197 | 199 | synchs <- labels[grep('sync', labels$Name, ignore.case = T),]
|
198 | 200 |
|
| 201 | + #remove noisy synchs |
| 202 | + if(remove_noisy_synchs){ |
| 203 | + if(length(grep('x', synchs$Name, ignore.case = T)) > 0){ |
| 204 | + synchs <- synchs[-grep('x', synchs$Name, ignore.case = T),] |
| 205 | + } |
| 206 | + } |
| 207 | + |
199 | 208 | #get times of synchs, according to the talking clock (in sec)
|
200 | 209 | #talking clock labels are in auditon format, so can use audition parsing function
|
201 | 210 | if(nrow(synchs)>0){
|
|
0 commit comments