phasestats: local statistics of each phase on an EMG (beta)

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/phasestats.R

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

1

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

onoff_singlethres

Examples

 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]

biosignalEMG documentation built on May 2, 2019, 12:07 p.m.