knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

emgR overview

Install emgR package

# install.packages("devtools") if not installed
devtools::install_github("https://github.com/ymatts/emgR")
library(emgR)

Data acquisition

data(emg)
head(emg,3)

Constructing object

tt = emg$Time # Time record
xx = emg[,-1] # EMG record
obj = emgR::emgList(x = xx,t = tt)
obj

Filtering sEMG signals

obj = emgR::btw(obj,order = 4,filtFreq = c(5,200))
obj

Normalize sEMG signals

obj = emgR::normalize(obj)
obj

Waveform similiarity analysis

obj = emgR::coherence(obj)
obj

Visualize coherence function

plot(obj,type="coh",files = "myCoh.jpg",cohRange=c(0,100))

Visualize coherence functions

knitr::include_graphics("~/Dropbox/matsui/git/emgR/myCoh.jpg")

Aggregate coherence function into means within frequency bands

obj = emgR::aggrCoh(obj,cohRange = c(15,20),plot.it = FALSE)
obj

Aggregate coherence function into means within frequency bands

obj = emgR::aggrCoh(obj,cohRange = c(15,20),plot.it = TRUE)

Coherent muscle network construction

obj = emgR::cohNet(obj,mode = "bin",thres = 0.25,plot.it = FALSE)

Coherent muscle network construction

obj = emgR::cohNet(obj,mode = "bin",thres = 0.25,plot.it = TRUE)


ymatts/emgR documentation built on March 7, 2020, 12:52 a.m.