phasestats {biosignalEMG} | R Documentation |
local statistics of each phase on an EMG (beta)
Description
Computes local statistics "f" of each phase on an EMG signal. The phases are defined by the contiguos points that have the same class.
Usage
phasestats(data,class,f)
Arguments
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. |
Details
class is usually the result of a detection step (0=not active, 1=active). "f" could be the mean, standard deviaton, sum, length, etc.
Value
An object storing the local statistics and the class of each value.
Author(s)
J.A. Guerrero jaguerrero@correo.uaa.mx
References
None
See Also
Examples
# 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]
[Package biosignalEMG version 2.1.0 Index]