Description Usage Arguments Details Value
View source: R/detect_artifacts.R
Artifact rejection procedure as described in Künecke et. al. (2014). Data samples are flagged if the range within a sliding 50ms window exceeds three times the standard deviation of the full session recording.
1 2 3 4 5 6 | detect_artifacts(
femg_data,
muscle_channels,
win_sec = 0.05,
flag_threshold = 3
)
|
femg_data |
data frame or tibble |
muscle_channels |
A vector with the names of the channels in the data that contain EMG data to be checked for artifacts. |
win_sec |
0.05 sec by default. The duration of the sliding window in which to look for extreme values. |
flag_threshold |
3 by default. The multiple of SD beyond which the range of data in win_sec is considered a likely artifact. |
Künecke, J., Hildebrandt, A., Recio, G., Sommer, W., & Wilhelm, O. (2014). Facial EMG Responses to Emotional Expressions Are Related to Emotion Perception Ability. PLoS ONE, 9(1), e84053. https://doi.org/10.1371/journal.pone.0084053
data frame or tibble with additional variables:
(muscle_channel)_z: z transformation of the muscle data
(muscle_channel)_zrange: range of the window of duration win_sec centred on this sample
(muscle_channel)_flagged: boolean indicating if the window centered on this sample contains artifactual data
(muscle_channel)_fixed: same data as muscle_channel but flagged samples are set to NA
(muscle_channel)_zfixed: same data as muscle_channel_z but flagged samples are set to NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.