Title: | Analysis and Visualisation of Musical Audio and Video Movement Synchrony Data |
---|---|
Description: | Analysis and visualisation of synchrony, interaction, and joint movements from audio and video movement data of a group of music performers. The demo is data described in Clayton, Leante, and Tarsitani (2021) <doi:10.17605/OSF.IO/KS325>, while example analyses can be found in Clayton, Jakubowski, and Eerola (2019) <doi:10.1177/1029864919844809>. Additionally, wavelet analysis techniques have been applied to examine movement-related musical interactions, as shown in Eerola et al. (2018) <doi:10.1098/rsos.171520>. |
Authors: | Tuomas Eerola [aut, cre, cph] , Martin Clayton [aut] , Paul Emms [aut] |
Maintainer: | Tuomas Eerola <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.4 |
Built: | 2024-11-04 04:18:55 UTC |
Source: | https://github.com/tuomaseerola/movementsync |
Analyze Coherency from View object
analyze_coherency( obj, columns, loess.span = 0, dj = 1/50, lowerPeriod = 2/obj$recording$fps, upperPeriod = 5, window.type.t = 1, window.type.s = 1, window.size.t = 5, window.size.s = 1/4, make.pval = TRUE, method = "white.noise", params = NULL, n.sim = 1, date.format = NULL, date.tz = NULL, verbose = FALSE )
analyze_coherency( obj, columns, loess.span = 0, dj = 1/50, lowerPeriod = 2/obj$recording$fps, upperPeriod = 5, window.type.t = 1, window.type.s = 1, window.size.t = 5, window.size.s = 1/4, make.pval = TRUE, method = "white.noise", params = NULL, n.sim = 1, date.format = NULL, date.tz = NULL, verbose = FALSE )
obj |
View object. |
columns |
Two column names. |
loess.span |
parameter alpha in loess controlling the degree of time series smoothing, if the time series is to be detrended; no detrending if loess.span = 0. Default: 0. |
dj |
frequency resolution. Default 1/20. |
lowerPeriod |
in seconds |
upperPeriod |
in seconds |
window.type.t |
|
window.type.s |
|
window.size.t |
|
window.size.s |
|
make.pval |
|
method |
|
params |
|
n.sim |
number of simulations (default 1). |
date.format |
|
date.tz |
|
verbose |
an analyze_coherency
object.
Other wavelet functions:
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, c("Nose_x", "Nose_y"))
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, c("Nose_x", "Nose_y"))
Analyze Wavelet from View object
analyze_wavelet( obj, column, loess.span = 0, dj = 1/20, lowerPeriod = 2/obj$recording$fps, upperPeriod = 5, make.pval = TRUE, method = "white.noise", params = NULL, n.sim = 1, date.format = NULL, date.tz = NULL, verbose = TRUE )
analyze_wavelet( obj, column, loess.span = 0, dj = 1/20, lowerPeriod = 2/obj$recording$fps, upperPeriod = 5, make.pval = TRUE, method = "white.noise", params = NULL, n.sim = 1, date.format = NULL, date.tz = NULL, verbose = TRUE )
obj |
View object. |
column |
Column in view to analyse. |
loess.span |
parameter alpha in loess controlling the degree of time series smoothing, if the time series is to be detrended; no detrending if loess.span = 0. Default: 0. |
dj |
frequency resolution. Default 1/20. |
lowerPeriod |
lower Fourier period in seconds. Defaults to 2/fps. |
upperPeriod |
upper Fourier period in seconds. Defaults to 5s. |
make.pval |
|
method |
|
params |
|
n.sim |
number of simulations (default 1). |
date.format |
|
date.tz |
|
verbose |
an analyze.wavelet
object.
Other wavelet functions:
analyze_coherency()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) w <- analyze_wavelet(pv, "Nose_y")
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) w <- analyze_wavelet(pv, "Nose_y")
Apply summary function to each data point column in a SplicedView and return list of output data.
apply_column_spliceview(sv, FUN, simplify = FALSE, USE.NAMES = FALSE, ...) sapply_column_spliceview(sv, FUN, simplify = TRUE, USE.NAMES = TRUE, ...)
apply_column_spliceview(sv, FUN, simplify = FALSE, USE.NAMES = FALSE, ...) sapply_column_spliceview(sv, FUN, simplify = TRUE, USE.NAMES = TRUE, ...)
sv |
|
FUN |
function to apply. |
simplify |
see |
USE.NAMES |
see |
... |
passed to FUN. |
see sapply()
.
Other statistical and analysis functions:
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) mean_mat <- apply_column_spliceview(sv_duration_smile, mean, na.rm=TRUE)
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) mean_mat <- apply_column_spliceview(sv_duration_smile, mean, na.rm=TRUE)
Apply a filter to a View
apply_filter( view, data_points, sig_filter, param_str = "", folder_out = "Filtered", save_output = FALSE )
apply_filter( view, data_points, sig_filter, param_str = "", folder_out = "Filtered", save_output = FALSE )
view |
|
data_points |
body parts e.g. 'Nose'. |
sig_filter |
S3 filter object from signals package. |
param_str |
string of parameter values to add to output file if desired. |
folder_out |
output folder relative to recording home (default is 'Filtered'). |
save_output |
save the output? |
a filtered object.
Apply a Savitzky-Golay filter to a view
apply_filter_sgolay( view, data_points, n, p, folder_out = "Filtered", save_output = FALSE )
apply_filter_sgolay( view, data_points, n, p, folder_out = "Filtered", save_output = FALSE )
view |
|
data_points |
body parts e.g. 'Nose'. |
n |
window size. |
p |
poly order. |
folder_out |
output folder relative to recording home (default is 'Filtered'). |
save_output |
save the output? |
a FilteredView
object.
Other data functions:
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) set.seed(1) fv1 <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n = 19, p = 4) fv2 <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n = 41, p = 3) set.seed(1) # to reproduce with S3 filter object fv3 <- apply_filter(pv, c("Nose", "RWrist", "LWrist"), signal::sgolay(4, 19))
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) set.seed(1) fv1 <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n = 19, p = 4) fv2 <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n = 41, p = 3) set.seed(1) # to reproduce with S3 filter object fv3 <- apply_filter(pv, c("Nose", "RWrist", "LWrist"), signal::sgolay(4, 19))
Apply complex function to each segment in a SpliceView object
apply_segment_spliceview(sv, FUN, ...)
apply_segment_spliceview(sv, FUN, ...)
sv |
|
FUN |
function to apply. |
... |
passed to FUN. |
list of two elements: 'output' containing results of apply FUN to 'input'
Other statistical and analysis functions:
apply_column_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) wavelet_smile_list <- apply_segment_spliceview(sv_duration_smile, analyze_wavelet, column = "Nose_x_Central_Sitar") names(wavelet_smile_list)
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) wavelet_smile_list <- apply_segment_spliceview(sv_duration_smile, analyze_wavelet, column = "Nose_x_Central_Sitar") names(wavelet_smile_list)
Layers of annotation data to add to ggplots in 'movementsync.
## S3 method for class 'OnsetsSelected' autolayer( object, time_limits = c(-Inf, Inf), colour = "Inst.Name", fill = "Metre", alpha = 0.4, instrument_cols = NULL, ... ) ## S3 method for class 'Metre' autolayer( object, time_limits = c(-Inf, Inf), colour = "hotpink", alpha = 0.5, tempo = FALSE, view = NULL, columns = NULL, ... ) ## S3 method for class 'Duration' autolayer( object, time_limits = c(-Inf, Inf), expr = .data$Tier == "FORM", fill_column = "Comments", geom = "rect", vline_column = "In", ... ) ## S3 method for class 'Splice' autolayer(object, geom = "rect", vline_column = "Start", ...)
## S3 method for class 'OnsetsSelected' autolayer( object, time_limits = c(-Inf, Inf), colour = "Inst.Name", fill = "Metre", alpha = 0.4, instrument_cols = NULL, ... ) ## S3 method for class 'Metre' autolayer( object, time_limits = c(-Inf, Inf), colour = "hotpink", alpha = 0.5, tempo = FALSE, view = NULL, columns = NULL, ... ) ## S3 method for class 'Duration' autolayer( object, time_limits = c(-Inf, Inf), expr = .data$Tier == "FORM", fill_column = "Comments", geom = "rect", vline_column = "In", ... ) ## S3 method for class 'Splice' autolayer(object, geom = "rect", vline_column = "Start", ...)
object |
S3 object |
time_limits |
tuple of time limits. |
colour |
name of column for colouring. |
fill |
name of column for filling. |
alpha |
aesthetic |
instrument_cols |
instrument column names. |
... |
passed to geom. |
tempo |
do we plot tempo with a Metre layer? (Default is FALSE). |
view |
view object for a tempo Metre layer (Default is NULL). |
columns |
columns for view for a tempo Metre layer (Default is NULL). |
expr |
unquoted R expression for filtering data (default is Tier =='FORM'). |
fill_column |
data column used for fill. |
geom |
'rect' or 'vline'. |
vline_column |
column name for position of vertical lines. |
ggplot geom object
r<-get_recording("NIR_ABh_Puriya", fps=25) o <- get_onsets_selected_data(r) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y"), maxpts=5000) + autolayer(o) m <- get_metre_data(r) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, time_limits = c(1000, 2000)) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, tempo = TRUE, time_limits = c(1000, 2000), view = v, columns = c("LEar_x", "LEar_y")) d <- get_duration_annotation_data(r) autoplot(m) autoplot(m) + autolayer(d) autoplot(m) + autolayer(d, fill_col = "Tier") v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d) autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, geom = "vline", nudge_x = -60, size = 3, colour = "blue")
r<-get_recording("NIR_ABh_Puriya", fps=25) o <- get_onsets_selected_data(r) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y"), maxpts=5000) + autolayer(o) m <- get_metre_data(r) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, time_limits = c(1000, 2000)) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, tempo = TRUE, time_limits = c(1000, 2000), view = v, columns = c("LEar_x", "LEar_y")) d <- get_duration_annotation_data(r) autoplot(m) autoplot(m) + autolayer(d) autoplot(m) + autolayer(d, fill_col = "Tier") v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d) autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, geom = "vline", nudge_x = -60, size = 3, colour = "blue")
Autoplot methods for S3 objects in the movementsync package.
## S3 method for class 'Duration' autoplot(object, horizontal = FALSE, ...) ## S3 method for class 'OnsetsSelected' autoplot(object, instrument = "Inst", tactus = "Matra", ...) ## S3 method for class 'Metre' autoplot(object, ...) ## S3 method for class 'View' autoplot( object, columns = NULL, maxpts = 1000, time_limits = c(-Inf, Inf), time_breaks = NULL, expr = NULL, ... ) ## S3 method for class 'SplicedView' autoplot( object, columns = NULL, segments = NULL, time_breaks = NULL, time_limits = c(-Inf, Inf), maxpts = 1000, ... )
## S3 method for class 'Duration' autoplot(object, horizontal = FALSE, ...) ## S3 method for class 'OnsetsSelected' autoplot(object, instrument = "Inst", tactus = "Matra", ...) ## S3 method for class 'Metre' autoplot(object, ...) ## S3 method for class 'View' autoplot( object, columns = NULL, maxpts = 1000, time_limits = c(-Inf, Inf), time_breaks = NULL, expr = NULL, ... ) ## S3 method for class 'SplicedView' autoplot( object, columns = NULL, segments = NULL, time_breaks = NULL, time_limits = c(-Inf, Inf), maxpts = 1000, ... )
object |
S3 object |
horizontal |
make the barchart horizontal? (Default is FALSE). |
... |
passed to |
instrument |
instrument column name. |
tactus |
beat column name. |
columns |
names of columns in input data. |
maxpts |
maximum number of points to plot |
time_limits |
tuple to restrict the timeline or a duration object. |
time_breaks |
suggests the number of major time tick marks (Default is NULL). |
expr |
an R expression that sets the time scale using a duration object (Default is NULL). |
segments |
only include these segments in a SplicedView plot. |
a ggplot object.
r <- get_sample_recording() d <- get_duration_annotation_data(r) autoplot(d) o <- get_onsets_selected_data(r) autoplot(o) m <- get_metre_data(r) autoplot(m) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(20, 40)) l <- list(a = c(0, 10), b = c(20, 30), c = c(30, 60)) splicing_df <- splice_time(l) sv <- get_spliced_view(v, splicing_df) autoplot(sv, columns = c("LEar_x", "LEar_y", "Nose_x", "Nose_y"), time_breaks = 4, maxpts = 1000)
r <- get_sample_recording() d <- get_duration_annotation_data(r) autoplot(d) o <- get_onsets_selected_data(r) autoplot(o) m <- get_metre_data(r) autoplot(m) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(20, 40)) l <- list(a = c(0, 10), b = c(20, 30), c = c(30, 60)) splicing_df <- splice_time(l) sv <- get_spliced_view(v, splicing_df) autoplot(sv, columns = c("LEar_x", "LEar_y", "Nose_x", "Nose_y"), time_breaks = 4, maxpts = 1000)
Plot a Granger S3 object
## S3 method for class 'GrangerTime' autoplot(object, splicing_df, lev_sig = 0.05, ...)
## S3 method for class 'GrangerTime' autoplot(object, splicing_df, lev_sig = 0.05, ...)
object |
S3 object. |
splicing_df |
Splicing data.frame object. |
lev_sig |
significance level. |
... |
ignored. |
a ggplot
object.
Other Granger Causality:
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
r1 <- get_sample_recording() fv_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 3, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 3/25) autoplot(g, splicing_df)
r1 <- get_sample_recording() fv_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 3, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 3/25) autoplot(g, splicing_df)
Autoplot a SpectralDensityView S3 object
## S3 method for class 'SpectralDensityView' autoplot(object, period_range = c(0, 10), colour = "blue", ...)
## S3 method for class 'SpectralDensityView' autoplot(object, period_range = c(0, 10), colour = "blue", ...)
object |
|
period_range |
tuple for limiting range of periods. |
colour |
name of line colour. |
... |
ignored. |
a ggplot
object.
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sd1 <- spectral_density(pv, columns = c("LElbow_x", "LEye_x"), spans = 5) autoplot(sd1) fv <- apply_filter_sgolay(pv, data_points = c("LElbow", "LEye"), n = 19, p = 4) sd2 <- spectral_density(fv, data_points = c("LElbow", "LEye"), spans = c(3, 3)) autoplot(sd2)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sd1 <- spectral_density(pv, columns = c("LElbow_x", "LEye_x"), spans = 5) autoplot(sd1) fv <- apply_filter_sgolay(pv, data_points = c("LElbow", "LEye"), n = 19, p = 4) sd2 <- spectral_density(fv, data_points = c("LElbow", "LEye"), spans = c(3, 3)) autoplot(sd2)
Randomly generates splices from a splicing table and calculates average cross power for each segment and splice. Calculates the mean average cross power over the random splices for each segment and period. Compares with the average cross power for the original splice.
ave_cross_power_over_splices( jv, splicing_df, num_splices, columns, sampling_type = "offset", rejection_list = list(), include_original = TRUE, show_plot = TRUE )
ave_cross_power_over_splices( jv, splicing_df, num_splices, columns, sampling_type = "offset", rejection_list = list(), include_original = TRUE, show_plot = TRUE )
jv |
|
splicing_df |
|
num_splices |
number of randomly chosen splices. |
columns |
name of data columns on which to calculate average cross power. |
sampling_type |
either 'offset' or 'gap'. |
rejection_list |
list of splice objects that random splices must not overlap. |
include_original |
include the original splice in output? (Default is TRUE). |
show_plot |
show a plot? (Default is TRUE). |
data.frame of splice segments and their average cross power.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) d <- get_duration_annotation_data(r) splicing_tabla_solo_df <- splice_time(d, expr = "Tier == 'INTERACTION' & Comments == 'Mutual look and smile'") # Only do the first splice for sample data mean_ave_cross_power_df <- ave_cross_power_over_splices(jv, splicing_tabla_solo_df[1,], num_splices = 10, columns = c('Nose_x_Central_Sitar', 'Nose_y_Central_Sitar'), show_plot = TRUE)
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) d <- get_duration_annotation_data(r) splicing_tabla_solo_df <- splice_time(d, expr = "Tier == 'INTERACTION' & Comments == 'Mutual look and smile'") # Only do the first splice for sample data mean_ave_cross_power_df <- ave_cross_power_over_splices(jv, splicing_tabla_solo_df[1,], num_splices = 10, columns = c('Nose_x_Central_Sitar', 'Nose_y_Central_Sitar'), show_plot = TRUE)
Get the average cross power on each segment in a SplicedView
ave_cross_power_spliceview( sv, columns, colour = "blue", segments = NULL, show_plot = FALSE, ... )
ave_cross_power_spliceview( sv, columns, colour = "blue", segments = NULL, show_plot = FALSE, ... )
sv |
|
columns |
column names in the data of each |
colour |
name of colour on plots (default is 'blue'). |
segments |
indices of segments to plot e.g. 1:10 (default plots up to first 10). |
show_plot |
show a plot (default is FALSE). |
... |
passed to |
data.frame with columns containing Average Cross Power for each segment.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) ave_cross_power_smile <- ave_cross_power_spliceview( sv_duration_smile, columns = c("Nose_x_Central_Sitar", "Nose_y_Central_Sitar"), show_plot = TRUE) head(ave_cross_power_smile)
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) ave_cross_power_smile <- ave_cross_power_spliceview( sv_duration_smile, columns = c("Nose_x_Central_Sitar", "Nose_y_Central_Sitar"), show_plot = TRUE) head(ave_cross_power_smile)
Randomly generates splices from a splicing table and calculates average power for each segment and splice. Calculates the mean average power over the random splices for each segment and period. Compares with the average power for the original splice.
ave_power_over_splices( jv, splicing_df, num_splices, column, sampling_type = "offset", rejection_list = list(), include_original = TRUE, show_plot = TRUE )
ave_power_over_splices( jv, splicing_df, num_splices, column, sampling_type = "offset", rejection_list = list(), include_original = TRUE, show_plot = TRUE )
jv |
|
splicing_df |
|
num_splices |
number of randomly chosen splices. |
column |
name of data column on which to calculate average power. |
sampling_type |
either 'offset' or 'gap'. |
rejection_list |
list of splice objects that random splices must not overlap. |
include_original |
include the original splice in output? (Default is TRUE). |
show_plot |
show a plot? (Default is TRUE). |
data.frame of splice segments and their average power.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) d <- get_duration_annotation_data(r) splicing_tabla_solo_df <- splice_time(d, expr = "Tier == 'INTERACTION' & Comments == 'Mutual look and smile'") # Only do the first splice for sample data mean_ave_power_df <- ave_power_over_splices(jv, splicing_tabla_solo_df[1,], num_splices = 10, column = 'Nose_x_Central_Sitar', show_plot = TRUE)
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) d <- get_duration_annotation_data(r) splicing_tabla_solo_df <- splice_time(d, expr = "Tier == 'INTERACTION' & Comments == 'Mutual look and smile'") # Only do the first splice for sample data mean_ave_power_df <- ave_power_over_splices(jv, splicing_tabla_solo_df[1,], num_splices = 10, column = 'Nose_x_Central_Sitar', show_plot = TRUE)
Get the average power on each segment in a SplicedView
ave_power_spliceview( sv, column, colour = "blue", segments = NULL, show_plot = FALSE, ... )
ave_power_spliceview( sv, column, colour = "blue", segments = NULL, show_plot = FALSE, ... )
sv |
|
column |
name of data column on which to calculate average power. |
colour |
name of colour on plots (default is 'blue'). |
segments |
indices of segments to plot e.g. 1:10 (default plots up to first 10). |
show_plot |
show a plot? (Default is FALSE). |
... |
passed to |
data.frame with columns containing Average Power for each segment.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) ave_power_smile <- ave_power_spliceview(sv_duration_smile, column = "Nose_x_Central_Sitar", show_plot=TRUE) head(ave_power_smile)
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) ave_power_smile <- ave_power_spliceview(sv_duration_smile, column = "Nose_x_Central_Sitar", show_plot=TRUE) head(ave_power_smile)
Calculate average cross power distribution using a splicing table
calculate_ave_cross_power1( jv, splicing_df, splice_name, num_segment_samples, columns, show_plot = TRUE )
calculate_ave_cross_power1( jv, splicing_df, splice_name, num_segment_samples, columns, show_plot = TRUE )
jv |
|
splicing_df |
|
splice_name |
Name to give randomly spliced segments. |
num_segment_samples |
number of segments to randomly sample. |
columns |
name of data columns on which to calculate average cross power. |
show_plot |
show the plot? (Default is TRUE). |
a data frame: containing average cross power on the spliced JoinedView.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_dfr <- calculate_ave_cross_power1(jv, splicing_df, 'Splice', 10, c('Nose_x_Central_Tabla', 'Nose_y_Central_Tabla'))
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_dfr <- calculate_ave_cross_power1(jv, splicing_df, 'Splice', 10, c('Nose_x_Central_Tabla', 'Nose_y_Central_Tabla'))
Calculate average power distribution using a splicing table
calculate_ave_power1( jv, splicing_df, splice_name, num_segment_samples, column, show_plot = TRUE )
calculate_ave_power1( jv, splicing_df, splice_name, num_segment_samples, column, show_plot = TRUE )
jv |
|
splicing_df |
|
splice_name |
Name to give randomly spliced segments. |
num_segment_samples |
number of segments to randomly sample. |
column |
name of data column on which to calculate average power. |
show_plot |
show the plot? (Default is TRUE). |
a data frame: containing average power on the spliced JoinedView.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_dfr <- calculate_ave_power1(jv, splicing_df, 'Splice', 10, 'Nose_x_Central_Tabla')
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_dfr <- calculate_ave_power1(jv, splicing_df, 'Splice', 10, 'Nose_x_Central_Tabla')
Clip a splice so segments are of fixed duration
clip_splice(splice_dfr, duration, location = "middle")
clip_splice(splice_dfr, duration, location = "middle")
splice_dfr |
|
duration |
window duration in seconds. |
location |
'beginning', 'middle' or 'end'. |
a Splice
object.
Other splicing functions:
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
l <- list(a = c(10, 20), b = c(30, 40),c = c(50, 55)) splice_dfr <- splice_time(l) clip_splice(splice_dfr, duration = 1) clip_splice(splice_dfr, duration = 6) clip_splice(splice_dfr, duration = 1, location = 'beginning') clip_splice(splice_dfr, duration = 10, location = 'beginning') clip_splice(splice_dfr, duration = 1, location = 'end') clip_splice(splice_dfr, duration = 10, location = 'end')
l <- list(a = c(10, 20), b = c(30, 40),c = c(50, 55)) splice_dfr <- splice_time(l) clip_splice(splice_dfr, duration = 1) clip_splice(splice_dfr, duration = 6) clip_splice(splice_dfr, duration = 1, location = 'beginning') clip_splice(splice_dfr, duration = 10, location = 'beginning') clip_splice(splice_dfr, duration = 1, location = 'end') clip_splice(splice_dfr, duration = 10, location = 'end')
Compare average cross power distribution using a splicing table
compare_ave_cross_power1( jv, splicing_df, splice_name, num_segment_samples, num_splice_samples, columns, sampling_type = "offset", rejection_list = list(), show_plot = TRUE )
compare_ave_cross_power1( jv, splicing_df, splice_name, num_segment_samples, num_splice_samples, columns, sampling_type = "offset", rejection_list = list(), show_plot = TRUE )
jv |
|
splicing_df |
|
splice_name |
Name to give randomly spliced segments. |
num_segment_samples |
number of segments to randomly sample. |
num_splice_samples |
number of randomly chosen splices. |
columns |
name of data columns on which to calculate cross average power. |
sampling_type |
either 'offset' or 'gap'. |
rejection_list |
list of splice objects that random splices must not overlap. |
show_plot |
show the plot? (Default is TRUE). |
list of two data frames: one containing average cross power on the first splice and the other containing the average cross power on randomly generated splices.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_list <- compare_ave_cross_power1(jv, splicing_df, 'Random Splices', 5, 5, c('Nose_x_Central_Tabla', 'Nose_y_Central_Tabla'))
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_list <- compare_ave_cross_power1(jv, splicing_df, 'Random Splices', 5, 5, c('Nose_x_Central_Tabla', 'Nose_y_Central_Tabla'))
Compare average power distribution using a splicing table
compare_ave_power1( jv, splicing_df, splice_name, num_segment_samples, num_splice_samples, column, sampling_type = "offset", rejection_list = list(), show_plot = TRUE )
compare_ave_power1( jv, splicing_df, splice_name, num_segment_samples, num_splice_samples, column, sampling_type = "offset", rejection_list = list(), show_plot = TRUE )
jv |
|
splicing_df |
|
splice_name |
Name to give randomly spliced segments. |
num_segment_samples |
number of segments to randomly sample. |
num_splice_samples |
number of randomly chosen splices. |
column |
name of data column on which to calculate average power. |
sampling_type |
either 'offset' or 'gap'. |
rejection_list |
list of splice objects that random splices must not overlap. |
show_plot |
show the plot? (Default is TRUE). |
list of two data frames: one containing average power on the first splice and the other containing the average power on randomly generated splices.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_list <- compare_ave_power1(jv, splicing_df, 'Random Splices', 5, 5, 'Nose_x_Central_Tabla')
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) output_list <- compare_ave_power1(jv, splicing_df, 'Random Splices', 5, 5, 'Nose_x_Central_Tabla')
Compare the average cross power distribution of two SplicedViews using sampling on each segment
compare_avg_cross_power2( sv1, sv2, name1, name2, num_samples, columns, show_plot = TRUE )
compare_avg_cross_power2( sv1, sv2, name1, name2, num_samples, columns, show_plot = TRUE )
sv1 |
|
sv2 |
|
name1 |
name for first object. |
name2 |
name for second object. |
num_samples |
number of samples to draw from segments. |
columns |
column names in the data e.g. c('Nose_x', 'Nose_y'). |
show_plot |
show the plot? |
list of two data.frames containing the sampled data.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) splicing_alap_df <- splice_time( d1, tier = 'FORM', comments = 'Alap' ) sv_duration_alap <- get_spliced_view(jv, splicing_df = splicing_alap_df) sample_list <- compare_avg_cross_power2( sv_duration_smile, sv_duration_alap, 'Smile', 'Alap', num_samples = 100, columns = c("Nose_x_Central_Sitar", "Nose_y_Central_Sitar"))
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) splicing_alap_df <- splice_time( d1, tier = 'FORM', comments = 'Alap' ) sv_duration_alap <- get_spliced_view(jv, splicing_df = splicing_alap_df) sample_list <- compare_avg_cross_power2( sv_duration_smile, sv_duration_alap, 'Smile', 'Alap', num_samples = 100, columns = c("Nose_x_Central_Sitar", "Nose_y_Central_Sitar"))
Compare the average power distribution of two SplicedViews using sampling on each segment
compare_avg_power2( sv1, sv2, name1, name2, num_samples, column, show_plot = TRUE )
compare_avg_power2( sv1, sv2, name1, name2, num_samples, column, show_plot = TRUE )
sv1 |
|
sv2 |
|
name1 |
name for first object. |
name2 |
name for second object. |
num_samples |
number of samples to draw from segments. |
column |
column name in the data e.g. 'Nose_x_Central_Sitar'. |
show_plot |
show the plot? |
list of two data.frames containing the sampled data.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) splicing_alap_df <- splice_time( d1, tier = 'FORM', comments = 'Alap' ) sv_duration_alap <- get_spliced_view(jv, splicing_df = splicing_alap_df) sample_list <- compare_avg_power2( sv_duration_smile, sv_duration_alap, 'Smile', 'Alap', num_samples = 100, column = "Nose_x_Central_Sitar")
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) splicing_alap_df <- splice_time( d1, tier = 'FORM', comments = 'Alap' ) sv_duration_alap <- get_spliced_view(jv, splicing_df = splicing_alap_df) sample_list <- compare_avg_power2( sv_duration_smile, sv_duration_alap, 'Smile', 'Alap', num_samples = 100, column = "Nose_x_Central_Sitar")
Calculates the difference in onset times for each instrument pair in milli-seconds.
difference_onsets(onset_obj, instruments, expr = NULL, splicing_dfr = NULL)
difference_onsets(onset_obj, instruments, expr = NULL, splicing_dfr = NULL)
onset_obj |
|
instruments |
character vector of instrument names. |
expr |
R expression to subset onsets (not required). |
splicing_dfr |
|
OnsetsDifference
object.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r1 <- get_sample_recording() o1 <- get_onsets_selected_data(r1) head(difference_onsets(o1, instruments = c('Inst', 'Tabla'))) head(difference_onsets(o1, instruments = c('Inst', 'Tabla'), expr = 'Matra == 3'))
r1 <- get_sample_recording() o1 <- get_onsets_selected_data(r1) head(difference_onsets(o1, instruments = c('Inst', 'Tabla'))) head(difference_onsets(o1, instruments = c('Inst', 'Tabla'), expr = 'Matra == 3'))
Distribution plot of a view object
distribution_dp(obj, maxpts = 50000, alpha = 0.1, ...)
distribution_dp(obj, maxpts = 50000, alpha = 0.1, ...)
obj |
|
maxpts |
maximum number of points to plot. |
alpha |
ggplot aesthetic value. |
... |
passed to |
a ggplot
object.
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "Neck", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) distribution_dp(fv1)
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "Neck", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) distribution_dp(fv1)
Get the data points held in a view
get_data_points(obj)
get_data_points(obj)
obj |
|
character vector of body parts.
Other data functions:
apply_filter_sgolay()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") get_data_points(rv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") get_data_points(rv)
Get duration annotation data
get_duration_annotation_data(recording, filetype = "rda", verbose = FALSE)
get_duration_annotation_data(recording, filetype = "rda", verbose = FALSE)
recording |
|
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
list of data.frames.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() df <- get_duration_annotation_data(r)
r <- get_sample_recording() df <- get_duration_annotation_data(r)
Output from new analysis process that generates data at the same sample rate as the video data. The user is responsible for ensuring that this data is continuous before using this function.
get_feature_data( recording, vid, direct, inst, interpolate_data = FALSE, folder_out = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
get_feature_data( recording, vid, direct, inst, interpolate_data = FALSE, folder_out = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
recording |
|
vid |
camera. |
direct |
direction. |
inst |
instrument. |
interpolate_data |
should the data be interpolated? (default is FALSE). |
folder_out |
output folder relative to recording home (default is 'tempdir()'). |
save_output |
save the output? |
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
a FilteredView
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() fd <- get_feature_data(r, "Central" ,"", "Sitar") fv_list <- get_filtered_views(r, 'LEar', n = 41, p =3) fv_list$Feature <- fd jv <- get_joined_view(fv_list) get_data_points(jv) autoplot(jv)
r <- get_sample_recording() fd <- get_feature_data(r, "Central" ,"", "Sitar") fv_list <- get_filtered_views(r, 'LEar', n = 41, p =3) fv_list$Feature <- fd jv <- get_joined_view(fv_list) get_data_points(jv) autoplot(jv)
Get filtered views
get_filtered_views(r, data_points, n, p, filetype = "rda")
get_filtered_views(r, data_points, n, p, filetype = "rda")
r |
|
data_points |
vector of body parts e.g. 'Nose'. |
n |
window size. |
p |
poly order. |
filetype |
type of file ('rda' as default), can be 'csv'. |
list of FilteredView
objects.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) plot(fv_list$Central_Tabla)
r <- get_sample_recording() fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) plot(fv_list$Central_Tabla)
Get Granger Causality interactions
get_granger_interactions( sv, columns, cond_column = "", sig_level = 0.05, lag = 1, granger_fn = ms_grangertest2 )
get_granger_interactions( sv, columns, cond_column = "", sig_level = 0.05, lag = 1, granger_fn = ms_grangertest2 )
sv |
SplicedView object |
columns |
vector of column names |
cond_column |
name of conditioning column |
sig_level |
significance level |
lag |
in seconds (rounded to nearest frame) |
granger_fn |
function to perform Granger test (defaults to ms_grangertest2) |
GrangerInteraction object
Other Granger Causality:
autoplot.GrangerTime()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
r <- get_sample_recording() fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) l <- list(a = c(0, 300), b = c(300, 600), c = c(600, 900)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv_sub, splicing_df) g <- get_granger_interactions(sv, c("Nose_x_Central_Sitar", "Nose_x_Central_Tabla"), lag = 1/25) print(g)
r <- get_sample_recording() fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) l <- list(a = c(0, 300), b = c(300, 600), c = c(600, 900)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv_sub, splicing_df) g <- get_granger_interactions(sv, c("Nose_x_Central_Sitar", "Nose_x_Central_Tabla"), lag = 1/25) print(g)
Get joined view from multiple views from the same recording
get_joined_view(l, folder_out = "Joined", save_output = FALSE)
get_joined_view(l, folder_out = "Joined", save_output = FALSE)
l |
named list of |
folder_out |
output folder relative to recording home (default is 'Joined'). |
save_output |
save the output? |
JoinedView object
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() rv_list <- get_raw_views(r) jv <- get_joined_view(rv_list) plot(jv, columns = c("LEar_x_Central_Sitar", "LEar_x_Central_Tabla"), yax.flip=TRUE)
r <- get_sample_recording() rv_list <- get_raw_views(r) jv <- get_joined_view(rv_list) plot(jv, columns = c("LEar_x_Central_Sitar", "LEar_x_Central_Tabla"), yax.flip=TRUE)
Get periods locally maximal average power
get_local_max_average_power(obj, v)
get_local_max_average_power(obj, v)
obj |
|
v |
|
data.frame of Period and Local Maxima.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_average_power(w, pv1) get_local_max_average_power(w, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_average_power(w, pv1) get_local_max_average_power(w, pv1)
Get metre files
get_metre_data(recording, filetype = "rda", verbose = FALSE)
get_metre_data(recording, filetype = "rda", verbose = FALSE)
recording |
|
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
list of data.frames.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() m <- get_metre_data(r)
r <- get_sample_recording() m <- get_metre_data(r)
Get onsets selected files
get_onsets_selected_data( recording, tactus = "Matra", filetype = "rda", verbose = FALSE )
get_onsets_selected_data( recording, tactus = "Matra", filetype = "rda", verbose = FALSE )
recording |
|
tactus |
optional name of the beat column to ensure it is turned into integer. |
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
list of data.frames
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() o <- get_onsets_selected_data(r)
r <- get_sample_recording() o <- get_onsets_selected_data(r)
Get movementsync recording from OSF
get_osf_recordings( stems = c("NIR_ABh_Puriya", "NIRP1_VS_Hams", "NIRP1_MAK_Jaun", "Gagaku_5_Juha", "NIR_DBh_Malhar"), to_dir = tempdir(), overwrite = FALSE )
get_osf_recordings( stems = c("NIR_ABh_Puriya", "NIRP1_VS_Hams", "NIRP1_MAK_Jaun", "Gagaku_5_Juha", "NIR_DBh_Malhar"), to_dir = tempdir(), overwrite = FALSE )
stems |
zip file stem(s). |
to_dir |
directory to copy to (default is "tempdir()"). |
overwrite |
overwriting existing dataset files? |
invisible vector of downloaded CSV file names.
get_osf_recordings()
get_osf_recordings()
Normalises and interpolates missing data in the view.
get_processed_view( rv, folder_out = tempdir(), save_output = FALSE, verbose = FALSE )
get_processed_view( rv, folder_out = tempdir(), save_output = FALSE, verbose = FALSE )
rv |
|
folder_out |
output folder relative to recording home (default is 'Normalized'). |
save_output |
save the output? |
verbose |
messages the specific data loaded (default is 'FALSE'). |
a ProcessedView
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv)
Get processed views
get_processed_views(r, data_points, filetype = "rda")
get_processed_views(r, data_points, filetype = "rda")
r |
|
data_points |
vector of body parts e.g. 'Nose'. |
filetype |
type of file ('rda' as default), can be 'csv'. |
list of ProcessedView
objects.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() pv_list <- get_processed_views(r) plot(pv_list$Central_Tabla)
r <- get_sample_recording() pv_list <- get_processed_views(r) plot(pv_list$Central_Tabla)
Used to load OptFlow data.
get_raw_optflow_view( recording, vid, direct, inst, folder_out = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
get_raw_optflow_view( recording, vid, direct, inst, folder_out = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
recording |
|
vid |
camera. |
direct |
direction. |
inst |
instrument. |
folder_out |
output folder relative to recording home (default is 'tempdir()'). |
save_output |
save the output? |
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
an OptFlowView
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_recording("NIR_ABh_Puriya", fps = 25) rov <- get_raw_optflow_view(r, "Central" ,"", "Sitar") pov <- get_processed_view(rov) fv1 <- apply_filter_sgolay(pov, c("Head"), n=19, p=4) autoplot(fv1)
r <- get_recording("NIR_ABh_Puriya", fps = 25) rov <- get_raw_optflow_view(r, "Central" ,"", "Sitar") pov <- get_processed_view(rov) fv1 <- apply_filter_sgolay(pov, c("Head"), n=19, p=4) autoplot(fv1)
Creates time reference and displacement from raw csv data for the view.
get_raw_view( recording, vid, direct, inst, out_folder = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
get_raw_view( recording, vid, direct, inst, out_folder = tempdir(), save_output = FALSE, filetype = "rda", verbose = FALSE )
recording |
|
vid |
video camera. |
direct |
direction. |
inst |
instrument. |
out_folder |
output folder (tempdir if nothing is given). |
save_output |
save the output? |
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
a RawView
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar")
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar")
Get Pose views from a recording
get_raw_views(recording, filetype = "rda")
get_raw_views(recording, filetype = "rda")
recording |
|
filetype |
type of file ('rda' as default), can be 'csv'. |
named list of views
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_view()
,
get_recording()
,
get_sample_recording()
r <- get_sample_recording() v_list <- get_raw_views(r)
r <- get_sample_recording() v_list <- get_raw_views(r)
Get a meta-data recording object
get_recording( stem, fps, folder_in = "data", path = system.file(package = "movementsync"), filetype = "csv", verbose = FALSE )
get_recording( stem, fps, folder_in = "data", path = system.file(package = "movementsync"), filetype = "csv", verbose = FALSE )
stem |
recording identifier. |
fps |
frames per second. |
folder_in |
input folder relative to recording home (default is 'Original'). |
path |
recording home folder. |
filetype |
type of file ('rda' as default), can be 'csv'. |
verbose |
messages the specific data loaded (default is 'FALSE'). |
a Recording
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_sample_recording()
# Get the details of one recording r <- get_recording("NIR_ABh_Puriya", fps=25)
# Get the details of one recording r <- get_recording("NIR_ABh_Puriya", fps=25)
Get sample meta-data recording object
get_sample_recording(stem = "NIR_ABh_Puriya")
get_sample_recording(stem = "NIR_ABh_Puriya")
stem |
recording identifier. |
a Recording
object.
Other data functions:
apply_filter_sgolay()
,
get_data_points()
,
get_duration_annotation_data()
,
get_feature_data()
,
get_filtered_views()
,
get_joined_view()
,
get_metre_data()
,
get_onsets_selected_data()
,
get_processed_views()
,
get_processed_view()
,
get_raw_optflow_view()
,
get_raw_views()
,
get_raw_view()
,
get_recording()
r <- get_sample_recording()
r <- get_sample_recording()
Get spliced view from view object
get_spliced_view(v, splicing_df)
get_spliced_view(v, splicing_df)
v |
View object |
splicing_df |
|
a SplicedView
object.
Other splicing functions:
clip_splice()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splicing_df <- splice_time(l) sv <- get_spliced_view(rv, splicing_df)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splicing_df <- splice_time(l) sv <- get_spliced_view(rv, splicing_df)
Granger causality tests applied to a SplicedView
granger_test( obj, var1, var2, var3 = "", lag = 1, granger_fn = ms_grangertest2, cond_granger_fn = ms_condgrangertest )
granger_test( obj, var1, var2, var3 = "", lag = 1, granger_fn = ms_grangertest2, cond_granger_fn = ms_condgrangertest )
obj |
SplicedView object |
var1 |
column name of response |
var2 |
column name of predictor |
var3 |
column name of conditioning |
lag |
in seconds (rounded to nearest frame) |
granger_fn |
function to perform Granger test (defaults to ms_grangertest2) |
cond_granger_fn |
function to perform conditional Granger test (defaults to ms_condgrangertest) |
GrangerTime object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
r1 <- get_sample_recording() rv_list <- get_raw_views(r1) pv_list <- lapply(rv_list, get_processed_view) get_data_points(pv_list$Central_Sitar) fv_list <- lapply(pv_list, apply_filter_sgolay, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 5, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 1/25) granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", "Nose_y_Central_Tabla", lag = 1/25)
r1 <- get_sample_recording() rv_list <- get_raw_views(r1) pv_list <- lapply(rv_list, get_processed_view) get_data_points(pv_list$Central_Sitar) fv_list <- lapply(pv_list, apply_filter_sgolay, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 5, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 1/25) granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", "Nose_y_Central_Tabla", lag = 1/25)
Checks if splicing data.frames overlap
is_splice_overlapping(...)
is_splice_overlapping(...)
... |
Each argument can be a data frame or a list of data frames |
logical
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
l1 <- list(a=c(1, 10), a = c(20, 30), b = c(30, 40)) dfr1 <- splice_time(l1) l2 <- list(a=c(10, 15), b = c(15, 25)) dfr2 <- splice_time(l2) is_splice_overlapping(dfr1, dfr2)
l1 <- list(a=c(1, 10), a = c(20, 30), b = c(30, 40)) dfr1 <- splice_time(l1) l2 <- list(a=c(10, 15), b = c(15, 25)) dfr2 <- splice_time(l2) is_splice_overlapping(dfr1, dfr2)
List available recordings for movementsync from OSF
list_osf_recordings()
list_osf_recordings()
character vector of stem names
list_osf_recordings()
list_osf_recordings()
Map duration object comments to a Granger Test object
map_to_granger_test(d, g, influence1, influence2)
map_to_granger_test(d, g, influence1, influence2)
d |
DurationObject |
g |
GrangerTest object |
influence1 |
Comment X>Y string in the Granger Test of Y~X i.e. X causes Y |
influence2 |
Comment X>Y string in the Granger Test of Y~X i.e. X causes Y |
modified Duration object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 5, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 1/25) d <- get_duration_annotation_data(r) map_to_granger_test(d, g, "Influence T>S", "Influence S>T")
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 5, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 1/25) d <- get_duration_annotation_data(r) map_to_granger_test(d, g, "Influence T>S", "Influence S>T")
Merge splices together using set operations
merge_splice(..., operation)
merge_splice(..., operation)
... |
a collection of named |
operation |
either 'union' or 'intersection'. |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
l1 <- list(a1 = c(100, 200), a2 = c(250, 300), a3 = c(400, 550), a4 = c(600, 650)) split1_dfr <- splice_time(l1) split1_dfr l2 <- list(b1 = c(150, 275), b2 = c(610, 640)) split2_dfr <- splice_time(l2) split2_dfr l3 <- list(c1 = c(275, 325), c2 = c(600, 675), c3 = c(700, 725)) split3_dfr <- splice_time(l3) split3_dfr merge_splice(x = split1_dfr, y = split2_dfr, z = split3_dfr, operation = 'union') merge_splice(x = split1_dfr, y = split2_dfr, z = split3_dfr, operation = 'intersection')
l1 <- list(a1 = c(100, 200), a2 = c(250, 300), a3 = c(400, 550), a4 = c(600, 650)) split1_dfr <- splice_time(l1) split1_dfr l2 <- list(b1 = c(150, 275), b2 = c(610, 640)) split2_dfr <- splice_time(l2) split2_dfr l3 <- list(c1 = c(275, 325), c2 = c(600, 675), c3 = c(700, 725)) split3_dfr <- splice_time(l3) split3_dfr merge_splice(x = split1_dfr, y = split2_dfr, z = split3_dfr, operation = 'union') merge_splice(x = split1_dfr, y = split2_dfr, z = split3_dfr, operation = 'intersection')
Motion gram of a view object
motion_gram(obj, maxpts = 10000, alpha = 0.5, ...)
motion_gram(obj, maxpts = 10000, alpha = 0.5, ...)
obj |
view object |
maxpts |
maximum number of points to plot. |
alpha |
ggplot aesthetic value. |
... |
passed to |
a gtable
object.
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) sub_fv1 <- subset(fv1, Time >= 0 & Time <= 20, dp, by = 2) motion_gram(sub_fv1)
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) sub_fv1 <- subset(fv1, Time >= 0 & Time <= 20, dp, by = 2) motion_gram(sub_fv1)
Faster implementation of the vector version of lmtest::grangertest()
with
conditioning on the history of a third variable. The function assumes time
series always have the same start date and periodicity, which is true for the data in this
package.
ms_condgrangertest(x, y, z, order = 1, na.action = stats::na.omit, ...)
ms_condgrangertest(x, y, z, order = 1, na.action = stats::na.omit, ...)
x |
response vector of observations. |
y |
explanatory vector of observations. |
z |
conditioning vector of observations |
order |
number of lags (in frames). |
na.action |
a function for eliminating NAs after aligning the series x and y. |
... |
passed to |
Anova object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
data(wages, package = "lmtest") diff_wages <- diff(wages) # Granger tests lmtest::grangertest(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_grangertest1(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_grangertest2(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_condgrangertest(diff_wages[, 'w'], diff_wages[, 'CPI'], diff_wages[, 'u'], order = 3)
data(wages, package = "lmtest") diff_wages <- diff(wages) # Granger tests lmtest::grangertest(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_grangertest1(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_grangertest2(diff_wages[, 'w'], diff_wages[, 'CPI'], order = 3) ms_condgrangertest(diff_wages[, 'w'], diff_wages[, 'CPI'], diff_wages[, 'u'], order = 3)
Faster implementation of the vector version of lmtest::grangertest()
which uses a vectorised lag operation.
ms_grangertest1(x, y, order = 1, na.action = stats::na.omit, ...)
ms_grangertest1(x, y, order = 1, na.action = stats::na.omit, ...)
x |
either a bivariate series (in which case y has to be missing) or a univariate series of observations. |
y |
a univariate series of observations (if x is univariate, too). |
order |
number of lags (in frames). |
na.action |
a function for eliminating NAs after aligning the series x and y. |
... |
passed to |
Anova object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
data(ChickEgg, package = "lmtest") ms_grangertest1(ChickEgg, order = 3)
data(ChickEgg, package = "lmtest") ms_grangertest1(ChickEgg, order = 3)
Faster implementation of the vector version of lmtest::grangertest()
. The
function assumes time series always have the same start date and periodicity,
which is true for the data in this package.
ms_grangertest2(x, y, order = 1, na.action = stats::na.omit, ...)
ms_grangertest2(x, y, order = 1, na.action = stats::na.omit, ...)
x |
either a bivariate series (in which case y has to be missing) or a univariate series of observations |
y |
a univariate series of observations (if x is univariate, too). |
order |
number of lags (in frames). |
na.action |
a function for eliminating NAs after aligning the series x and y. |
... |
passed to |
Anova object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
data(ChickEgg, package = "lmtest") ms_grangertest2(ChickEgg, order = 3)
data(ChickEgg, package = "lmtest") ms_grangertest2(ChickEgg, order = 3)
A subset of data from NIR_ABh_Puriya annotation. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Annotation)
data(NIR_ABh_Puriya_Annotation)
rda
A data frame with 161 rows and 5 columns:
Type of annotation
Onset of annotation
Offset of annotation
Duration of annotation
Description
...
A subset of data from NIR_ABh_Puriya describing the annotated influence. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Annotation_Influence)
data(NIR_ABh_Puriya_Annotation_Influence)
rda
A data frame with 306 rows and 5 columns:
Type of event
Start of the event in seconds
End of the event in seconds
Duration of the event in seconds
Text notes
...
A subset of data from NIR_ABh_Puriya describing sitar pitch. Dummy data for demonstration purposes. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Central_Feature_Sitar)
data(NIR_ABh_Puriya_Central_Feature_Sitar)
rda
A data frame with 1,501 rows and 3 columns:
Frame (here 25 fps)
Pitch in Hz - Dummy data
Smooth - Dummy data
...
A subset of data from NIR_ABh_Puriya the estimate pose of the sitar player, carried out with openpose. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Central_Pose_Sitar)
data(NIR_ABh_Puriya_Central_Pose_Sitar)
rda
A data frame with 1,501 rows and 27 columns:
frame number, 25 fps
X coordinate of Left Ear
Y coordinate of Left Ear
X coordinate of Left Elbow
Y coordinate of Left Elbow
X coordinate of Left Eye
Y coordinate of Left Eye
X coordinate of Left Shoulder
Y coordinate of Left Shoulder
X coordinate of Left Wrist
Y coordinate of Left Wrist
X coordinate of Left MidHip
Y coordinate of Left MidHip
X coordinate of Left Neck
Y coordinate of Left Neck
X coordinate of Left Nose
Y coordinate of Left Nose
X coordinate of Right Ear
Y coordinate of Right Ear
X coordinate of Right Elbow
Y coordinate of Right Elbow
X coordinate of Right Eye
Y coordinate of Right Eye
X coordinate of Right Shoulder
Y coordinate of Right Shoulder
X coordinate of Right Wrist
Y coordinate of Right Wrist
...
A subset of data from NIR_ABh_Puriya the estimate pose of the tabla player. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Central_Pose_Tabla)
data(NIR_ABh_Puriya_Central_Pose_Tabla)
rda
A data frame with 1,501 rows and 27 columns:
frame number, here 25 fps
X coordinate of Left Ear
Y coordinate of Left Ear
X coordinate of Left Elbow
Y coordinate of Left Elbow
X coordinate of Left Eye
Y coordinate of Left Eye
X coordinate of Left Shoulder
Y coordinate of Left Shoulder
X coordinate of Left Wrist
Y coordinate of Left Wrist
X coordinate of Left MidHip
Y coordinate of Left MidHip
X coordinate of Left Neck
Y coordinate of Left Neck
X coordinate of Left Nose
Y coordinate of Left Nose
X coordinate of Right Ear
Y coordinate of Right Ear
X coordinate of Right Elbow
Y coordinate of Right Elbow
X coordinate of Right Eye
Y coordinate of Right Eye
X coordinate of Right Shoulder
Y coordinate of Right Shoulder
X coordinate of Right Wrist
Y coordinate of Right Wrist
...
A subset of data from NIR_ABh_Puriya Describing Metre (Cycle numbers and onset times). The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Metre_DrutTeental)
data(NIR_ABh_Puriya_Metre_DrutTeental)
rda
A data frame with 351 rows and 3 columns:
Number of the Cycle
Time in seconds
text which is empty for this file
...
A subset of data from NIR_ABh_Puriya describing the metre in Vilambit Teental section.
data(NIR_ABh_Puriya_Metre_VilambitTeental)
data(NIR_ABh_Puriya_Metre_VilambitTeental)
rda
A data frame with 72 rows and 4 columns:
Number of the Cycle
Time in seconds
text which is empty for this file
Number of beats in the cycle
...
The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
A subset of data from NIR_ABh_Puriya containing information about selected onsets for Drut Teental section. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Onsets_Selected_DrutTeental)
data(NIR_ABh_Puriya_Onsets_Selected_DrutTeental)
rda
A data frame with 5,585 rows and 20 columns:
Session name
Instrument Name
Tala name
Label for beat (1|1)
Matra number
logical On or Off
integer (1) for logical on or Off
Descriptor e.g. 'Gat'
Another descriptor, usually missing
Descriptor
Descriptor where N is 'No'
Onset time in seconds
Onset time in seconds of tabla
Calculated density of onsets (no/s)
Calculated density of onsets (no/s)
Peak of the onset (onset strength)
Peak of the onset (onset strength)
Name of the performer (sitar)
Name of the performer (tabla)
Chunk name
...
A subset of data from NIR_ABh_Puriya containing information about selected onsets for Vilambit Teental section (sitar and tabla). The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_Onsets_Selected_VilambitTeental)
data(NIR_ABh_Puriya_Onsets_Selected_VilambitTeental)
rda
A data frame with 2,275 rows and 20 columns:
Session name
Instrument Name
Tala name
Label for beat (1|1)
Matra number
logical On or Off
integer (1) for logical on or Off
Descriptor e.g. 'Gat'
Another descriptor, usually missing
Descriptor
Descriptor where N is 'No'
Onset time in seconds
Onset time in seconds of tabla
Calculated density of onsets (no/s)
Calculated density of onsets (no/s)
Peak of the onset (onset strength)
Peak of the onset (onset strength)
Name of the performer (sitar)
Name of the performer (tabla)
Chunk name
...
A subset of data from NIR_ABh_Puriya describing the head movement of the sitar player extracted using Optical Flow giving X and Y coordinates. The data comes from a collection of audiovisual recordings of North Indian (Hindustani) raga performances which are part of IEMP North Indian Raga collection, collected and curated by Martin Clayton, Laura Leante, and Simone Tarsitani.
data(NIR_ABh_Puriya_OptFlow_Central_Sitar)
data(NIR_ABh_Puriya_OptFlow_Central_Sitar)
rda
A data frame with 1,501 rows and 4 columns:
Frame (integer, related 25 fps)
Time in seconds
X coordinate
Y coordinate
...
Opens movementsync data home page at OSF
open_movementsync_data()
open_movementsync_data()
No return value, opens a browser on a specific OSF page
Plot average coherency of a coherency object
plot_average_coherency(obj, view, ...)
plot_average_coherency(obj, view, ...)
obj |
analyze.coherency object. |
view |
View object. |
... |
passed to |
a ggplot object.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_average_coherency(co, pv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_average_coherency(co, pv)
Plot average power of a wavelet object
plot_average_power(obj, view, ...)
plot_average_power(obj, view, ...)
obj |
analyze.wavelet object. |
view |
View object. |
... |
passed to |
a ggplot object.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_average_power(w, pv1) w <- analyze_wavelet(pv1, "Nose_y") plot_average_power(w, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_average_power(w, pv1) w <- analyze_wavelet(pv1, "Nose_y") plot_average_power(w, pv1)
Plot a coherency of a wavelet object
plot_cross_spectrum(obj, view, ...) plot_coherence(obj, view, ...)
plot_cross_spectrum(obj, view, ...) plot_coherence(obj, view, ...)
obj |
analyze.coherency object. |
view |
View object. |
... |
passed to |
a list of class graphical parameters
,
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) co <- analyze_coherency(pv1, c("Nose_x", "Nose_y")) plot_cross_spectrum(co, pv1) plot_coherence(co, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) co <- analyze_coherency(pv1, c("Nose_x", "Nose_y")) plot_cross_spectrum(co, pv1) plot_coherence(co, pv1)
Plot cross wavelet energy of a wavelet object
plot_cwt_energy(obj, view)
plot_cwt_energy(obj, view)
obj |
analyze.wavelet object. |
view |
View object. |
a ggplot object.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_cwt_energy(co, pv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_cwt_energy(co, pv)
Plot a set of data points over time
plot_history_xy(obj, maxpts = 10000)
plot_history_xy(obj, maxpts = 10000)
obj |
|
maxpts |
maximum number of points to plot. |
a ggplot
object.
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) fv1 <- apply_filter_sgolay(pv1, data_points = c("LElbow", "RElbow"), n = 41, p = 3) sub_fv1 <- subset(fv1, Time >= 0 & Time <= 100, by = 10) plot_history_xy(sub_fv1)
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) fv1 <- apply_filter_sgolay(pv1, data_points = c("LElbow", "RElbow"), n = 41, p = 3) sub_fv1 <- subset(fv1, Time >= 0 & Time <= 100, by = 10) plot_history_xy(sub_fv1)
Arrows show causality (influencing) direction.
plot_influence_diagram(obj, splicing_df, two_arrows = TRUE, lev_sig = 0.05)
plot_influence_diagram(obj, splicing_df, two_arrows = TRUE, lev_sig = 0.05)
obj |
GrangerTest object |
splicing_df |
Splicing data.frame object |
two_arrows |
plot influence arrows both ways? (Default is TRUE). |
lev_sig |
significance level |
By default two_arrows
is TRUE and an influencing arrow is drawn for each
significant p-value. If two_arrows
is FALSE and one
of the p-values is signficant then -log10(p_value) difference is plotted i.e
ggplot object
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
r1 <- get_sample_recording() fv_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 3, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 3/25) plot_influence_diagram(g, splicing_df) plot_influence_diagram(g, splicing_df, two_arrows = TRUE) d1 <- get_duration_annotation_data(r1) plot_influence_diagram(g, splicing_df) + autolayer(d1, expr = (Tier == "Influence S>T" | Tier == "Influence T>S") & Out <= 60, fill_col = "Tier")
r1 <- get_sample_recording() fv_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv_sub <- get_joined_view(fv_list) splicing_df <- splice_time(jv_sub, win_size = 3, step_size = 0.5) sv <- get_spliced_view(jv_sub, splicing_df) g <- granger_test(sv, "Nose_x_Central_Sitar", "Nose_x_Central_Tabla", lag = 3/25) plot_influence_diagram(g, splicing_df) plot_influence_diagram(g, splicing_df, two_arrows = TRUE) d1 <- get_duration_annotation_data(r1) plot_influence_diagram(g, splicing_df) + autolayer(d1, expr = (Tier == "Influence S>T" | Tier == "Influence T>S") & Out <= 60, fill_col = "Tier")
Plot a coherency of a wavelet object
plot_phase_difference(obj, view, ...)
plot_phase_difference(obj, view, ...)
obj |
analyze.coherency object. |
view |
View object. |
... |
passed to |
a list of class graphical parameters
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10 & Time <= 20) co <- analyze_coherency(pv1, c("Nose_x", "Nose_y")) plot_phase_difference(co, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10 & Time <= 20) co <- analyze_coherency(pv1, c("Nose_x", "Nose_y")) plot_phase_difference(co, pv1)
Plot a power spectrum of a wavelet object
plot_power_spectrum(obj, view, ...)
plot_power_spectrum(obj, view, ...)
obj |
analyze.wavelet object. |
view |
View object. |
... |
passed to |
a list of class graphical parameters
.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_roll_resultant_length()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 30) w <- analyze_wavelet(pv1, "Nose_y") plot_power_spectrum(w, pv1) w <- analyze_wavelet(pv1, "Nose_y", lowerPeriod = 0.01, upperPeriod = 10) plot_power_spectrum(w, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 30) w <- analyze_wavelet(pv1, "Nose_y") plot_power_spectrum(w, pv1) w <- analyze_wavelet(pv1, "Nose_y", lowerPeriod = 0.01, upperPeriod = 10) plot_power_spectrum(w, pv1)
Plot windowed resultant length
plot_roll_resultant_length( obj, window_duration = 1, smooth = FALSE, by = 1, ref_lines = c(W = 0.7, M = 0.85, H = 0.95), align = "right", na.rm = TRUE )
plot_roll_resultant_length( obj, window_duration = 1, smooth = FALSE, by = 1, ref_lines = c(W = 0.7, M = 0.85, H = 0.95), align = "right", na.rm = TRUE )
obj |
a |
window_duration |
duration of window over which to take mean (default is 1 sec). |
smooth |
use the smoothed phase angle data (default is FALSE). |
by |
calculate resultant length at every |
ref_lines |
names list of reference line values (default is |
align |
alignment of window (default is 'right'). |
na.rm |
Remove NAs from the circular mean (default is TRUE). |
a ggplot
object.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_sel_phases()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) sp <- plot_sel_phases(co, pv, sel.period = 0.64) plot_roll_resultant_length(sp, ref_lines = c(H = 0.9998))
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) sp <- plot_sel_phases(co, pv, sel.period = 0.64) plot_roll_resultant_length(sp, ref_lines = c(H = 0.9998))
Comparison plot of phases of a coherency object
plot_sel_phases( obj, view, sel.period = NULL, sel.upper = NULL, sel.lower = NULL, ... )
plot_sel_phases( obj, view, sel.period = NULL, sel.upper = NULL, sel.lower = NULL, ... )
obj |
coherency object. |
view |
View object. |
sel.period |
a single number which determines the (closest available) Fourier period to be selected. Default: NULL. |
sel.upper |
a number to define an upper Fourier period (or the closest available) for the selection of a band of periods (effective if sel.period is NULL). Default: NULL. |
sel.lower |
a number to define a lower Fourier period (or the closest available) for the selection of a band of periods (effective if sel.period is NULL). Default: NULL. |
... |
passed to |
an object of class sel.phases
.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_wt_energy()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_cross_spectrum(co, pv) plot_sel_phases(co, pv, sel.period = 0.64) plot_sel_phases(co, pv, sel.lower = 0.6, sel.upper = 0.8)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) plot_cross_spectrum(co, pv) plot_sel_phases(co, pv, sel.period = 0.64) plot_sel_phases(co, pv, sel.lower = 0.6, sel.upper = 0.8)
Plot wavelet energy of a wavelet object
plot_wt_energy(obj, view)
plot_wt_energy(obj, view)
obj |
analyze.wavelet object. |
view |
View object. |
a ggplot object.
Other wavelet functions:
analyze_coherency()
,
analyze_wavelet()
,
get_local_max_average_power()
,
plot_average_coherency()
,
plot_average_power()
,
plot_cross_spectrum()
,
plot_cwt_energy()
,
plot_phase_difference()
,
plot_power_spectrum()
,
plot_roll_resultant_length()
,
plot_sel_phases()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_wt_energy(w, pv1)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) pv1 <- subset(pv, Time >= 10) w <- analyze_wavelet(pv1, "Nose_x") plot_wt_energy(w, pv1)
Plot a Duration S3 object
## S3 method for class 'Duration' plot(x, ...)
## S3 method for class 'Duration' plot(x, ...)
x |
S3 object |
... |
passed to |
a plot object with durations.
r <- get_sample_recording() d <- get_duration_annotation_data(r) plot(d)
r <- get_sample_recording() d <- get_duration_annotation_data(r) plot(d)
Plot network diagram of Granger Causalities
## S3 method for class 'GrangerInteraction' plot(x, mfrow = NULL, mar = c(1, 1, 1, 1), oma = c(1, 1, 1, 1), ...)
## S3 method for class 'GrangerInteraction' plot(x, mfrow = NULL, mar = c(1, 1, 1, 1), oma = c(1, 1, 1, 1), ...)
x |
GrangerInteration object |
mfrow |
passed to |
mar |
passed to |
oma |
passed to |
... |
passed through to |
data.frame of P-Values
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot_influence_diagram()
r <- get_recording("NIR_ABh_Puriya", fps = 25) fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) jv <- subset(jv, Time <= 5*60) l <- list(a = c(0, 100), b = c(100, 200), c = c(200, 300)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv, splicing_df) gi <- get_granger_interactions(sv, c("Nose_x_Central_Sitar", "Nose_x_Central_Tabla"), lag = 1/25) print(gi)
r <- get_recording("NIR_ABh_Puriya", fps = 25) fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) jv <- subset(jv, Time <= 5*60) l <- list(a = c(0, 100), b = c(100, 200), c = c(200, 300)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv, splicing_df) gi <- get_granger_interactions(sv, c("Nose_x_Central_Sitar", "Nose_x_Central_Tabla"), lag = 1/25) print(gi)
Plot a Metre S3 object
## S3 method for class 'Metre' plot(x, ...)
## S3 method for class 'Metre' plot(x, ...)
x |
S3 object. |
... |
ignored. |
a plot object with metre.
r <- get_sample_recording() m <- get_metre_data(r) plot(m)
r <- get_sample_recording() m <- get_metre_data(r) plot(m)
Plot a OnsetsSelected S3 object
## S3 method for class 'OnsetsSelected' plot(x, instrument = "Inst", tactus = "Matra", ...)
## S3 method for class 'OnsetsSelected' plot(x, instrument = "Inst", tactus = "Matra", ...)
x |
S3 object. |
instrument |
column name. |
tactus |
beat column name (defaults to "Matra"). |
... |
passed to |
Return an 'OnsetsSelected' object.
r <- get_sample_recording() o <- get_onsets_selected_data(r) plot(o)
r <- get_sample_recording() o <- get_onsets_selected_data(r) plot(o)
Plot a View S3 object
## S3 method for class 'View' plot(x, columns = NULL, maxpts = 1000, ...)
## S3 method for class 'View' plot(x, columns = NULL, maxpts = 1000, ...)
x |
S3 object |
columns |
names of columns |
maxpts |
maximum number of points to plot. |
... |
passed to |
a plot object.
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar") plot(v, columns = "LEar_x")
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar") plot(v, columns = "LEar_x")
Apply function to SplicedView and pull out element from output
pull_segment_spliceview(sv, FUN, element, ...)
pull_segment_spliceview(sv, FUN, element, ...)
sv |
|
FUN |
function to apply. |
element |
name of element to pull out from output object. |
... |
passed to function. |
list with output and input fields.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) pull_segment_spliceview(sv_duration_smile, FUN = analyze_wavelet, column = "Nose_x_Central_Sitar", element = 'Power')
r <- get_sample_recording() d1 <- get_duration_annotation_data(r) # only one relevant section for sample data splicing_smile_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3) jv <- get_joined_view(fv_list) sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df) pull_segment_spliceview(sv_duration_smile, FUN = analyze_wavelet, column = "Nose_x_Central_Sitar", element = 'Power')
Works by randomly varying the gaps between segments assuming that the gap number follow a Poisson process with rate given by the average sample gap length in the input splice. Durations of segments remain the same.
sample_gap_splice(splicing_dfr, v, num_splices, rejection_list = list())
sample_gap_splice(splicing_dfr, v, num_splices, rejection_list = list())
splicing_dfr |
|
v |
|
num_splices |
number of random splices to generate. |
rejection_list |
list of |
Uses rejection sampling to avoid overlaps with the input segments and additional segments from a list of splices.
list of splicing data.frames.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_offset_splice()
,
summary_onsets()
,
visualise_sample_splices()
r1 <- get_sample_recording() d1 <- get_duration_annotation_data(r1) rv1 <- get_raw_view(r1, "Central", "", "Sitar") splicing_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') # Only first segment relevant for sample data x <- sample_gap_splice(splicing_df[1,], rv1, num_splices = 10)
r1 <- get_sample_recording() d1 <- get_duration_annotation_data(r1) rv1 <- get_raw_view(r1, "Central", "", "Sitar") splicing_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') # Only first segment relevant for sample data x <- sample_gap_splice(splicing_df[1,], rv1, num_splices = 10)
Works by adding a random offset to each start time in the splice. Uses rejection sampling to avoid overlaps with the input segments and additional segments from a list of splices.
sample_offset_splice(splicing_dfr, v, num_splices, rejection_list = list())
sample_offset_splice(splicing_dfr, v, num_splices, rejection_list = list())
splicing_dfr |
|
v |
|
num_splices |
number of random splices to generate. |
rejection_list |
list of |
list of splicing data.frames.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
summary_onsets()
,
visualise_sample_splices()
r1 <- get_sample_recording() d1 <- get_duration_annotation_data(r1) rv1 <- get_raw_view(r1, "Central", "", "Sitar") splicing_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') # Only first segment relevant for sample data x <- sample_offset_splice(splicing_df[1,], rv1, num_splices = 100)
r1 <- get_sample_recording() d1 <- get_duration_annotation_data(r1) rv1 <- get_raw_view(r1, "Central", "", "Sitar") splicing_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile') # Only first segment relevant for sample data x <- sample_offset_splice(splicing_df[1,], rv1, num_splices = 100)
Sample the time line from a list of Views
sample_time_spliced_views( ..., num_samples, replace = FALSE, na.action = stats::na.pass )
sample_time_spliced_views( ..., num_samples, replace = FALSE, na.action = stats::na.pass )
... |
names arguments of |
num_samples |
number of time points to sample |
replace |
sample with replacement (default is FALSE)? |
na.action |
function to deal with NAs in data (default is na.pass). |
a list of SplitView
object or a SplitView
object
r1 <- get_sample_recording() fv1_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv1 <- get_joined_view(fv1_list) l <- list(a=c(1, 2), b = c(2, 3)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv1, splicing_df = splicing_df) autoplot(sv) sv_new <- sample_time_spliced_views(sv, num_samples = 10, replace = FALSE) autoplot(sv_new) sv_new <- sample_time_spliced_views(sv, num_samples = 10, replace = TRUE) autoplot(sv_new) l <- list(a=c(1, 2), a = c(10, 20), b = c(30, 40)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv1, splicing_df = splicing_df) sv_new <- sample_time_spliced_views(sv, num_samples = 20, replace = TRUE) autoplot(sv_new)
r1 <- get_sample_recording() fv1_list <- get_filtered_views(r1, data_points = "Nose", n = 41, p = 3) jv1 <- get_joined_view(fv1_list) l <- list(a=c(1, 2), b = c(2, 3)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv1, splicing_df = splicing_df) autoplot(sv) sv_new <- sample_time_spliced_views(sv, num_samples = 10, replace = FALSE) autoplot(sv_new) sv_new <- sample_time_spliced_views(sv, num_samples = 10, replace = TRUE) autoplot(sv_new) l <- list(a=c(1, 2), a = c(10, 20), b = c(30, 40)) splicing_df <- splice_time(l) sv <- get_spliced_view(jv1, splicing_df = splicing_df) sv_new <- sample_time_spliced_views(sv, num_samples = 20, replace = TRUE) autoplot(sv_new)
Specgram Plot
specgram_plot(obj, ...)
specgram_plot(obj, ...)
obj |
|
... |
passed to |
a ggplot
object.
r <- get_recording("NIR_ABh_Puriya", fps = 25) rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sub_pv <- subset(pv, Time >= 15 & Time <= 25, columns = c("RWrist_x", "RWrist_y")) specgram_plot(sub_pv) fv <- apply_filter_sgolay(pv, data_points = c("RWrist"), n = 11, p = 4) sub_fv <- subset(fv, Time >= 15 & Time <= 25, columns = c("RWrist_x", "RWrist_y")) specgram_plot(sub_fv) specgram_plot(sub_fv, window = 200) + ggplot2::scale_fill_gradient(low = "white", high = "black")
r <- get_recording("NIR_ABh_Puriya", fps = 25) rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sub_pv <- subset(pv, Time >= 15 & Time <= 25, columns = c("RWrist_x", "RWrist_y")) specgram_plot(sub_pv) fv <- apply_filter_sgolay(pv, data_points = c("RWrist"), n = 11, p = 4) sub_fv <- subset(fv, Time >= 15 & Time <= 25, columns = c("RWrist_x", "RWrist_y")) specgram_plot(sub_fv) specgram_plot(sub_fv, window = 200) + ggplot2::scale_fill_gradient(low = "white", high = "black")
Estimates the periodicity of data points in a View
object.
spectral_density(view, columns = NULL, data_points = NULL, ...)
spectral_density(view, columns = NULL, data_points = NULL, ...)
view |
|
columns |
names of data columns e.g. Nose_x. |
data_points |
data points to process e.g. Nose. |
... |
passed to |
SpectralDensityView
object.
r<-get_recording("NIR_ABh_Puriya", fps=25) rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sd1 <- spectral_density(pv, columns = "LEar_x", spans = 5) fv <- apply_filter_sgolay(pv, data_points = c("LEye"), n = 19, p = 4) sd1 <- spectral_density(fv, data_points = c("LEye"), spans = 5)
r<-get_recording("NIR_ABh_Puriya", fps=25) rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) sd1 <- spectral_density(pv, columns = "LEar_x", spans = 5) fv <- apply_filter_sgolay(pv, data_points = c("LEye"), n = 19, p = 4) sd1 <- spectral_density(fv, data_points = c("LEye"), spans = 5)
S3 generic function to splice a timeline
splice_time(x, ...)
splice_time(x, ...)
x |
S3 object. |
... |
passed to relevant method. |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
split.SplicedView()
Generate spliced timeline using a Duration object
## S3 method for class 'Duration' splice_time( x, expr = NULL, make.unique = TRUE, tier = NULL, comments = NULL, ... )
## S3 method for class 'Duration' splice_time( x, expr = NULL, make.unique = TRUE, tier = NULL, comments = NULL, ... )
x |
|
expr |
R expression to filter data on. |
make.unique |
make the segments unique? (Default is TRUE). |
tier |
exact tier name to filter on. |
comments |
exact comment to filter on. |
... |
passed to |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
r <- get_sample_recording() d <- get_duration_annotation_data(r) splice_time(d, tier = 'Event', comments = 'tabla solo')
r <- get_sample_recording() d <- get_duration_annotation_data(r) splice_time(d, tier = 'Event', comments = 'tabla solo')
Generate spliced timeline using a list
## S3 method for class 'list' splice_time(x, ...)
## S3 method for class 'list' splice_time(x, ...)
x |
named list. |
... |
ignored. |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time()
,
split.SplicedView()
l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splice_time(l)
l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splice_time(l)
Generate spliced timeline using a Metre object
## S3 method for class 'Metre' splice_time( x, window_duration = NULL, window_proportion = NULL, tactus = NULL, ... )
## S3 method for class 'Metre' splice_time( x, window_duration = NULL, window_proportion = NULL, tactus = NULL, ... )
x |
|
window_duration |
duration of window around beat (may lead to overlapping windows if large). |
window_proportion |
sets the window duration around beat based on a proportion (0, 0.5] of the gap to the previous and following cycles. The first and last beats in each Metre are removed. |
tactus |
vector of Metres to subset on. |
... |
ignored. |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
r <- get_sample_recording() m <- get_metre_data(r) splicing_df <- splice_time(m, window_duration = 1) head(splicing_df) splicing_df <- splice_time(m, window_proportion = 0.25) head(splicing_df)
r <- get_sample_recording() m <- get_metre_data(r) splicing_df <- splice_time(m, window_duration = 1) head(splicing_df) splicing_df <- splice_time(m, window_proportion = 0.25) head(splicing_df)
OnsetsDifference
objectGenerate spliced timeline using an OnsetsDifference
object
## S3 method for class 'OnsetsDifference' splice_time(x, window_duration, metres = NULL, make.unique = TRUE, ...)
## S3 method for class 'OnsetsDifference' splice_time(x, window_duration, metres = NULL, make.unique = TRUE, ...)
x |
|
window_duration |
duration of window around onset point in seconds. |
metres |
vector of metres to subset. |
make.unique |
give unique names to each segment? |
... |
passed to |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
r <- get_sample_recording() o1 <- get_onsets_selected_data(r) po1 <- difference_onsets(o1, instruments = c('Inst', 'Tabla')) splicing_df <- splice_time(po1, window_duration = 1) head(splicing_df)
r <- get_sample_recording() o1 <- get_onsets_selected_data(r) po1 <- difference_onsets(o1, instruments = c('Inst', 'Tabla')) splicing_df <- splice_time(po1, window_duration = 1) head(splicing_df)
Generate spliced timeline using a view
## S3 method for class 'View' splice_time(x, win_size, step_size, ...)
## S3 method for class 'View' splice_time(x, win_size, step_size, ...)
x |
|
win_size |
duration of window segment in seconds. |
step_size |
increment in seconds between segments. |
... |
ignored. |
a Splice
object.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.list()
,
splice_time()
,
split.SplicedView()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") df <- splice_time(rv, win_size = 3, step_size = 0.5) head(df)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") df <- splice_time(rv, win_size = 3, step_size = 0.5) head(df)
Get a list of Views from a SplicedView
## S3 method for class 'SplicedView' split(x, f, drop, ...)
## S3 method for class 'SplicedView' split(x, f, drop, ...)
x |
|
f |
ignored. |
drop |
ignored. |
... |
ignored. |
list of View
objects.
Other splicing functions:
clip_splice()
,
get_spliced_view()
,
is_splice_overlapping()
,
merge_splice()
,
splice_time.Duration()
,
splice_time.Metre()
,
splice_time.OnsetsDifference()
,
splice_time.View()
,
splice_time.list()
,
splice_time()
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splicing_df <- splice_time(l) sv <- get_spliced_view(pv, splicing_df) v_list <- split(sv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) l <- list(a = c(0, 10), b = c(10, 20), c = c(20, 30)) splicing_df <- splice_time(l) sv <- get_spliced_view(pv, splicing_df) v_list <- split(sv)
Simple time and column subsetting of views.
## S3 method for class 'View' subset(x, expr = NULL, data_points = NULL, columns = NULL, by = NULL, ...)
## S3 method for class 'View' subset(x, expr = NULL, data_points = NULL, columns = NULL, by = NULL, ...)
x |
|
expr |
an R expression to subset time or other variables. |
data_points |
body part in the data e.g. 'Nose'. |
columns |
column name in the data e.g. 'Nose_x'. |
by |
increment of the sequence of rows to return. |
... |
unused. |
a View
object.
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar") vv <- subset(v, Time < 10, data_point = "Nose") plot(vv)
r <- get_sample_recording() v <- get_raw_view(r, "Central", "", "Sitar") vv <- subset(v, Time < 10, data_point = "Nose") plot(vv)
Summary of difference in onsets
summary_onsets( onset_obj, recording, instruments, splicing_dfr = NULL, expr = NULL, show_plot = FALSE, filter_pair = NULL, na_omit = TRUE, time_breaks = NULL )
summary_onsets( onset_obj, recording, instruments, splicing_dfr = NULL, expr = NULL, show_plot = FALSE, filter_pair = NULL, na_omit = TRUE, time_breaks = NULL )
onset_obj |
|
recording |
|
instruments |
character vector of instrument names. |
splicing_dfr |
|
expr |
R expression to subset onsetsSelected |
show_plot |
show a plot? (Default is FALSE). |
filter_pair |
regular expression to filter instrument pair names. |
na_omit |
omit NAs (Default is TRUE). |
time_breaks |
suggests the number of major time tick marks (default is NULL). |
a summary data frame of onset difference statistics.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
visualise_sample_splices()
r1 <- get_sample_recording() o1 <- get_onsets_selected_data(r1) d1 <- get_duration_annotation_data(r1) splice_dfr <- splice_time(d1, tier = 'FORM') summary_onsets(o1, r1, instruments = c('Inst', 'Tabla'), splicing_dfr = splice_dfr, show_plot = TRUE)
r1 <- get_sample_recording() o1 <- get_onsets_selected_data(r1) d1 <- get_duration_annotation_data(r1) splice_dfr <- splice_time(d1, tier = 'FORM') summary_onsets(o1, r1, instruments = c('Inst', 'Tabla'), splicing_dfr = splice_dfr, show_plot = TRUE)
Summarise an analyze.wavelet object
## S3 method for class 'analyze.wavelet' summary(object, v, ...)
## S3 method for class 'analyze.wavelet' summary(object, v, ...)
object |
|
v |
|
... |
ignored. |
data.frame
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) w <- analyze_wavelet(pv, "Nose_x") summary(w, pv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) w <- analyze_wavelet(pv, "Nose_x") summary(w, pv)
Summarise Duration object
## S3 method for class 'Duration' summary(object, ...)
## S3 method for class 'Duration' summary(object, ...)
object |
|
... |
ignored. |
data.frame
r <- get_sample_recording() d <- get_duration_annotation_data(r) head(summary(d))
r <- get_sample_recording() d <- get_duration_annotation_data(r) head(summary(d))
Summarises the cycle length for each Metre.
## S3 method for class 'Metre' summary(object, ...)
## S3 method for class 'Metre' summary(object, ...)
object |
|
... |
ignored. |
list of summaries.
r <- get_sample_recording() m <- get_metre_data(r) summary(m)
r <- get_sample_recording() m <- get_metre_data(r) summary(m)
Summarise OnsetsSelected object
## S3 method for class 'OnsetsSelected' summary(object, ...)
## S3 method for class 'OnsetsSelected' summary(object, ...)
object |
|
... |
ignored. |
list of summaries.
r <- get_sample_recording() o <- get_onsets_selected_data(r) summary(o)
r <- get_sample_recording() o <- get_onsets_selected_data(r) summary(o)
Summarise Recording object
## S3 method for class 'Recording' summary(object, ...)
## S3 method for class 'Recording' summary(object, ...)
object |
|
... |
ignored. |
list
r <- get_sample_recording() summary(r)
r <- get_sample_recording() summary(r)
Summarises a sel.phases object
## S3 method for class 'sel.phases' summary(object, na.rm = TRUE, ...)
## S3 method for class 'sel.phases' summary(object, na.rm = TRUE, ...)
object |
|
na.rm |
remove missings? |
... |
ignored. |
list of Circular
statistics.
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) sp <- plot_sel_phases(co, pv, sel.period = NULL, sel.lower = 0.5, sel.upper = 0.7) summary(sp)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) co <- analyze_coherency(pv, columns = c("Nose_x", "Nose_y")) sp <- plot_sel_phases(co, pv, sel.period = NULL, sel.lower = 0.5, sel.upper = 0.7) summary(sp)
Summarise a View object
## S3 method for class 'View' summary(object, ...)
## S3 method for class 'View' summary(object, ...)
object |
|
... |
ignored. |
summary of data.frame.
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) fv <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n=19, p=4) summary(rv) summary(pv) summary(fv)
r <- get_sample_recording() rv <- get_raw_view(r, "Central", "", "Sitar") pv <- get_processed_view(rv) fv <- apply_filter_sgolay(pv, c("Nose", "RWrist", "LWrist"), n=19, p=4) summary(rv) summary(pv) summary(fv)
Velocity plot of a view object
velocity_dp(obj, add_mean = TRUE, vscale = 5, maxpts = 10000, alpha = 0.5, ...)
velocity_dp(obj, add_mean = TRUE, vscale = 5, maxpts = 10000, alpha = 0.5, ...)
obj |
View object. |
add_mean |
add the mean to each line? (default is TRUE). |
vscale |
a vertical scaling to apply to the plot (default is 5). |
maxpts |
maximum number of points to plot. |
alpha |
ggplot aesthetic value. |
... |
passed to |
a ggplot
object.
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "Neck", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) sub_fv1 <- subset(fv1, Time >= 10 & Time <= 20, by = 2) velocity_dp(sub_fv1)
r1 <- get_sample_recording() rv1 <- get_raw_view(r1, "Central", "", "Sitar") pv1 <- get_processed_view(rv1) dp <- c("LWrist", "RWrist", "LElbow", "RElbow", "LEye", "REye", "Neck", "MidHip") fv1 <- apply_filter_sgolay(pv1, data_point = dp, n = 41, p = 4) sub_fv1 <- subset(fv1, Time >= 10 & Time <= 20, by = 2) velocity_dp(sub_fv1)
Visualise random splices
visualise_sample_splices( splicing_df, splicing_list, jv, overlay = TRUE, avoid_splice_list = list(), unstack = FALSE )
visualise_sample_splices( splicing_df, splicing_list, jv, overlay = TRUE, avoid_splice_list = list(), unstack = FALSE )
splicing_df |
|
splicing_list |
a list of |
jv |
|
overlay |
overlay the segments for a density plot? |
avoid_splice_list |
list of |
unstack |
overlay segments on top of each other? (default is FALSE). |
a ggplot
object.
Other statistical and analysis functions:
apply_column_spliceview()
,
apply_segment_spliceview()
,
ave_cross_power_over_splices()
,
ave_cross_power_spliceview()
,
ave_power_over_splices()
,
ave_power_spliceview()
,
calculate_ave_cross_power1()
,
calculate_ave_power1()
,
compare_ave_cross_power1()
,
compare_ave_power1()
,
compare_avg_cross_power2()
,
compare_avg_power2()
,
difference_onsets()
,
pull_segment_spliceview()
,
sample_gap_splice()
,
sample_offset_splice()
,
summary_onsets()
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) splicing_list <- sample_offset_splice(splicing_df, jv, num_splices = 20) visualise_sample_splices(splicing_df, splicing_list, jv)
r <- get_sample_recording() fv_list <- get_filtered_views(r, data_points = 'Nose', n = 41, p = 3) jv <- get_joined_view(fv_list) splicing_df <- splice_time(list(a = c(0, 5), b = c(10, 15))) splicing_list <- sample_offset_splice(splicing_df, jv, num_splices = 20) visualise_sample_splices(splicing_df, splicing_list, jv)
Get a ggplot2 xlim object based on duration data
xlim_duration(object, expr = .data$Tier == "Form")
xlim_duration(object, expr = .data$Tier == "Form")
object |
Duration object. |
expr |
R expression to subset rows. |
a 'Duration' object.
r<-get_recording("NIR_ABh_Puriya", fps=25) m <- get_metre_data(r) d <- get_duration_annotation_data(r) autoplot(m) autoplot(m) + autolayer(d) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d) autoplot(v, columns = c("LEar_x", "LEar_y")) + xlim_duration(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J") + autolayer(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J")
r<-get_recording("NIR_ABh_Puriya", fps=25) m <- get_metre_data(r) d <- get_duration_annotation_data(r) autoplot(m) autoplot(m) + autolayer(d) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d) autoplot(v, columns = c("LEar_x", "LEar_y")) + xlim_duration(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J") + autolayer(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J")