onoff_singlethres {biosignalEMG}R Documentation

Automatic on/off detection algorithm based on a simple threshold rule

Description

Automatic detection algorithm to determine the times at which muscles “turn on” (activity periods) and “turn off” (silence periods) in an EMG signal.

Usage

onoff_singlethres(data, channel, eemg, t = 0.05, data.name)

Arguments

data

an ‘emg’ object.

channel

in case of multi-channel data, channel is the specific channel to be considered by the procedure. Possible values: a character vector specifying the name of the channel to be considered (case sensitive) or a numeric value specifying the channel to be considered (number of column in data).

eemg

an ‘emg’ object containing an envelope.

t

a threshold value to determine if a datum reresent activity (above the threshold) or silence (below the threshold) in a signal.

data.name

a string specifying the name of the variable which will appears on the plots. If empty or not provided is taken from the object given as data.

Details

In this procedure, on and off time estimation is determined by the times at which the envelope of the signal (eemg or determined using envelope) exceeds a threshold.

Value

A numeric vector with values 0 (silence) and 1 (activity).

Author(s)

J.A. Guerrero jaguerrero@correo.uaa.mx

References

Rose W. (2014) Electromyogram Analysis. Mathematics and Signal Processing for Biomechanics. http://www.udel.edu/biology/rosewc/kaap686/

See Also

envelope, onoff_bonato

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")

# change graphical parameters to show multiple plots
op <- par(mfrow = c(2, 1))

# Detect the phases of activation in x
b <- onoff_singlethres(x, t = 0.1)

# Plot 'x' and the detected phases
plot(x, main = "Sample EMG")
plot(b, type = "l", main = "Detected phases (single thresholding)")

# reset graphical parameters
par(op)

[Package biosignalEMG version 2.1.0 Index]