onoff_singlethres {biosignalEMG} | R Documentation |
Automatic detection algorithm to determine the times at which muscles “turn on” (activity periods) and “turn off” (silence periods) in an EMG signal.
onoff_singlethres(data, channel, eemg, t = 0.05, data.name)
data |
an ‘emg’ object. |
channel |
in case of multi-channel 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 |
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.
A numeric vector with values 0 (silence) and 1 (activity).
J.A. Guerrero jaguerrero@correo.uaa.mx
Rose W. (2014) Electromyogram Analysis. Mathematics and Signal Processing for Biomechanics. http://www.udel.edu/biology/rosewc/kaap686/
# 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)