Apply a Savitzky-Golay filter to a view
apply_filter_sgolay.Rd
Apply a Savitzky-Golay filter to a view
Arguments
- view
View
object.- 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?
See also
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()
Examples
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))