Description Usage Arguments Details Value Author(s) References See Also Examples
Computes local statistics "f" of each phase on an EMG signal. The phases are defined by the contiguos points that have the same class.
1 | phasestats(data,class,f)
|
data |
an ‘emg’ object. |
class |
a vector that indicates the class of each point in data. |
f |
A function that computes the desired local statistic. |
class is usually the result of a detection step (0=not active, 1=active). "f" could be the mean, standard deviaton, sum, length, etc.
An object storing the local statistics and the class of each value.
J.A. Guerrero jaguerrero@correo.uaa.mx
None
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Load a data.frame with EMG data
data(emg95306000)
# Coerce a data.frame into an 'emg' object
x <- as.emg(emg95306000, samplingrate = 1000, units = "mV")
# Detect the phases of activation in x
b <- onoff_singlethres(x, t = 0.1)
# Computes the length of the detected phases
plengths<-phasestats(x,b,length)
plengths
# Computes the mean of the values within the detected phases
pmeans<-phasestats(x,b,mean)
pmeans
# Only show the means of the active phases
pmeans$stats[names(pmeans$stats)==1]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.